:root {
  --bg: #0f1419;
  --surface: #1a2332;
  --surface-2: #243044;
  --border: #2d3a4f;
  --text: #e8edf4;
  --text-muted: #8b9cb3;
  --primary: #3b82f6;
  --primary-hover: #2563eb;
  --accent: #10b981;
  --accent-hover: #059669;
  --danger: #ef4444;
  --news: #60a5fa;
  --disclosure: #34d399;
  --radius: 12px;
  --shadow: 0 8px 32px rgba(0, 0, 0, 0.35);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: "Segoe UI", "Malgun Gothic", sans-serif;
  background: linear-gradient(160deg, #0b1020 0%, #121a2b 45%, #0f1419 100%);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.5;
}

.app {
  max-width: 1400px;
  margin: 0 auto;
  padding: 24px 20px 40px;
}

.header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.header h1 {
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.header__subtitle {
  color: var(--text-muted);
  margin-top: 4px;
  font-size: 0.95rem;
}

.header__status {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 0.875rem;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--text-muted);
}

.status-pill.active .status-dot {
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent);
  animation: pulse 1.5s infinite;
}

.status-pill.loading .status-dot {
  background: var(--primary);
  animation: pulse 0.8s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

.countdown {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

.controls {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  margin-bottom: 20px;
  box-shadow: var(--shadow);
}

.controls__buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 14px;
}

.controls__info {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  font-size: 0.875rem;
  color: var(--text-muted);
}

.controls__info strong {
  color: var(--text);
}

.btn {
  border: none;
  border-radius: 8px;
  padding: 10px 18px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
}

.btn:hover:not(:disabled) {
  transform: translateY(-1px);
}

.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.btn--primary {
  background: var(--primary);
  color: #fff;
}

.btn--primary:hover:not(:disabled) {
  background: var(--primary-hover);
}

.btn--accent {
  background: var(--accent);
  color: #052e1f;
}

.btn--accent:hover:not(:disabled) {
  background: var(--accent-hover);
  color: #fff;
}

.btn--ghost {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
}

.btn--ghost:hover:not(:disabled) {
  background: var(--surface-2);
}

.btn--sm {
  padding: 6px 12px;
  font-size: 0.8rem;
}

.panels {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 20px;
}

@media (max-width: 960px) {
  .panels {
    grid-template-columns: 1fr;
  }
}

.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  min-height: 420px;
}

.panel__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 18px;
  border-bottom: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.02);
}

.panel__header h2 {
  font-size: 1.05rem;
}

.badge {
  background: rgba(96, 165, 250, 0.15);
  color: var(--news);
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
}

.badge--disclosure {
  background: rgba(52, 211, 153, 0.15);
  color: var(--disclosure);
}

.panel__body {
  flex: 1;
  overflow-y: auto;
  max-height: 520px;
  padding: 8px;
}

.empty {
  color: var(--text-muted);
  text-align: center;
  padding: 40px 16px;
  font-size: 0.9rem;
}

.item {
  padding: 14px 12px;
  border-radius: 8px;
  border: 1px solid transparent;
  transition: background 0.15s, border-color 0.15s;
}

.item:hover {
  background: var(--surface-2);
  border-color: var(--border);
}

.item + .item {
  border-top: 1px solid rgba(255, 255, 255, 0.04);
}

.item__title {
  font-weight: 600;
  font-size: 0.95rem;
  margin-bottom: 6px;
  line-height: 1.4;
}

.item__title a {
  color: var(--text);
  text-decoration: none;
}

.item__title a:hover {
  color: var(--primary);
  text-decoration: underline;
}

.item__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 0.78rem;
  color: var(--text-muted);
}

.item__meta span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.item__meta .datetime {
  font-variant-numeric: tabular-nums;
  color: #a5b4c8;
}

.item__desc {
  margin-top: 8px;
  font-size: 0.82rem;
  color: var(--text-muted);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.item__title b,
.item__title strong,
.item__desc b,
.item__desc strong {
  color: #fbbf24;
  font-weight: 700;
}

.tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 0.72rem;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.08);
}

.tag--stock {
  color: #fbbf24;
}

.log-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}

.log-panel__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
}

.log-panel__header h2 {
  font-size: 1rem;
}

.log-panel__body {
  max-height: 220px;
  overflow-y: auto;
  padding: 10px 14px;
  font-family: Consolas, "Cascadia Mono", monospace;
  font-size: 0.82rem;
}

.log-entry {
  padding: 6px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  display: flex;
  gap: 10px;
  align-items: baseline;
}

.log-entry:last-child {
  border-bottom: none;
}

.log-time {
  color: var(--text-muted);
  flex-shrink: 0;
}

.log-message {
  word-break: break-word;
}

.log-entry.success .log-message {
  color: #86efac;
}

.log-entry.error .log-message {
  color: #fca5a5;
}

.log-entry.info .log-message {
  color: #93c5fd;
}

.log-entry.warn .log-message {
  color: #fcd34d;
}
