/* ==========================================================================
   TrendSpy SaaS 3.0 · High-End Design System
   Modern Obsidian Dark Mode, Glassmorphism, Micro-Animations & Curated Palette
   ========================================================================== */

:root {
  --bg-base: #07090e;
  --bg-surface: #0e131f;
  --bg-surface-elevated: #151d2f;
  --bg-surface-hover: #1c263c;
  --border-subtle: rgba(255, 255, 255, 0.07);
  --border-active: rgba(56, 189, 248, 0.35);
  
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-dim: #64748b;
  
  --cyan-primary: #38bdf8;
  --cyan-glow: rgba(56, 189, 248, 0.15);
  --purple-primary: #a855f7;
  --purple-glow: rgba(168, 85, 247, 0.15);
  --emerald-primary: #10b981;
  --emerald-glow: rgba(16, 185, 129, 0.15);
  --amber-primary: #f59e0b;
  --amber-glow: rgba(245, 158, 11, 0.15);
  --rose-primary: #f43f5e;
  --rose-glow: rgba(244, 63, 94, 0.15);
  
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-full: 9999px;
  
  --transition-fast: 0.15s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-normal: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  --font-main: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, monospace;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  background-color: var(--bg-base);
  color: var(--text-main);
  font-family: var(--font-main);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  background-image: 
    radial-gradient(circle at 15% 10%, rgba(56, 189, 248, 0.04) 0%, transparent 40%),
    radial-gradient(circle at 85% 20%, rgba(168, 85, 247, 0.04) 0%, transparent 45%);
}

/* ==========================================================================
   Header
   ========================================================================== */
.app-header {
  height: 68px;
  background: rgba(14, 19, 31, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-left, .header-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.brand-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.logo-icon {
  width: 38px;
  height: 38px;
  background: linear-gradient(135deg, #0284c7 0%, #7c3aed 100%);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  box-shadow: 0 0 20px rgba(56, 189, 248, 0.3);
}

.brand-text {
  display: flex;
  flex-direction: column;
}

.brand-title {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 8px;
}

.badge-version {
  font-size: 10px;
  padding: 2px 7px;
  border-radius: var(--radius-full);
  background: rgba(56, 189, 248, 0.15);
  color: var(--cyan-primary);
  border: 1px solid rgba(56, 189, 248, 0.3);
  font-weight: 600;
}

.brand-subtitle {
  font-size: 11px;
  color: var(--text-dim);
  font-weight: 400;
}

/* Status Pill */
.pipeline-status-pill {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 6px 16px;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-subtle);
  font-size: 12px;
  font-weight: 500;
  transition: var(--transition-normal);
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: #64748b;
  display: inline-block;
}

.pipeline-status-pill.idle .status-dot {
  background-color: var(--emerald-primary);
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.6);
}

.pipeline-status-pill.scanning {
  background: rgba(56, 189, 248, 0.08);
  border-color: rgba(56, 189, 248, 0.3);
  color: var(--cyan-primary);
}

.pipeline-status-pill.scanning .status-dot {
  background-color: var(--cyan-primary);
  box-shadow: 0 0 12px rgba(56, 189, 248, 0.8);
  animation: pulseDot 1.5s infinite;
}

@keyframes pulseDot {
  0% { transform: scale(0.95); opacity: 0.6; }
  50% { transform: scale(1.35); opacity: 1; }
  100% { transform: scale(0.95); opacity: 0.6; }
}

/* ==========================================================================
   Buttons & Micro-Interactions
   ========================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: var(--radius-md);
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-fast);
  border: 1px solid transparent;
  outline: none;
}

.btn-primary {
  background: linear-gradient(135deg, #0284c7 0%, #2563eb 100%);
  color: #fff;
  box-shadow: 0 2px 10px rgba(37, 99, 235, 0.3);
}

.btn-primary:hover {
  background: linear-gradient(135deg, #0369a1 0%, #1d4ed8 100%);
  box-shadow: 0 4px 16px rgba(37, 99, 235, 0.5);
  transform: translateY(-1px);
}

.btn-secondary {
  background: var(--bg-surface-elevated);
  color: var(--text-main);
  border: 1px solid var(--border-subtle);
}

.btn-secondary:hover {
  background: var(--bg-surface-hover);
  border-color: rgba(255, 255, 255, 0.15);
  transform: translateY(-1px);
}

.btn-danger {
  background: rgba(244, 63, 94, 0.2);
  color: var(--rose-primary);
  border: 1px solid rgba(244, 63, 94, 0.35);
}

.btn-danger:hover {
  background: rgba(244, 63, 94, 0.3);
}

.btn-icon {
  width: 36px;
  height: 36px;
  padding: 0;
  background: var(--bg-surface-elevated);
  color: var(--text-muted);
  border: 1px solid var(--border-subtle);
}

.btn-icon:hover {
  color: #fff;
  border-color: rgba(255, 255, 255, 0.2);
}

.btn-sm {
  padding: 6px 12px;
  font-size: 12px;
}

.btn-xs {
  padding: 4px 10px;
  font-size: 11px;
}

/* ==========================================================================
   Main Layout & KPI Grid
   ========================================================================== */
.main-layout {
  flex: 1;
  max-width: 1440px;
  width: 100%;
  margin: 0 auto;
  padding: 24px 28px 60px 28px;
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

.kpi-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  position: relative;
  overflow: hidden;
  transition: var(--transition-normal);
  cursor: pointer;
  user-select: none;
}

.kpi-card:hover {
  transform: translateY(-3px);
  border-color: rgba(255, 255, 255, 0.22);
  box-shadow: 0 10px 24px -5px rgba(0, 0, 0, 0.5);
}

.kpi-click-hint {
  font-size: 11px;
  color: var(--cyan-primary);
  opacity: 0.85;
  margin-left: 6px;
  font-weight: 600;
  transition: opacity 0.15s ease;
}

.kpi-card:hover .kpi-click-hint {
  opacity: 1;
  text-decoration: underline;
}

.card-glow-cyan::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: linear-gradient(90deg, var(--cyan-primary), transparent);
}

.card-glow-purple::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: linear-gradient(90deg, var(--purple-primary), transparent);
}

.card-glow-emerald::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: linear-gradient(90deg, var(--emerald-primary), transparent);
}

.card-glow-amber::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: linear-gradient(90deg, var(--amber-primary), transparent);
}

.card-glow-rose::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: linear-gradient(90deg, var(--rose-primary), transparent);
}

.kpi-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.kpi-title {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
}

.kpi-badge {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  font-weight: 600;
}

.badge-cyan {
  background: var(--cyan-glow);
  color: var(--cyan-primary);
  border: 1px solid rgba(56, 189, 248, 0.25);
}

.badge-purple {
  background: var(--purple-glow);
  color: var(--purple-primary);
  border: 1px solid rgba(168, 85, 247, 0.25);
}

.badge-emerald {
  background: var(--emerald-glow);
  color: var(--emerald-primary);
  border: 1px solid rgba(16, 185, 129, 0.25);
}

.badge-amber {
  background: var(--amber-glow);
  color: var(--amber-primary);
  border: 1px solid rgba(245, 158, 11, 0.25);
}

.badge-rose {
  background: var(--rose-glow);
  color: var(--rose-primary);
  border: 1px solid rgba(244, 63, 94, 0.25);
}

.kpi-value {
  font-family: var(--font-mono);
  font-size: 32px;
  font-weight: 700;
  color: #fff;
  letter-spacing: -0.03em;
  margin-bottom: 6px;
}

.kpi-footer {
  font-size: 11px;
  color: var(--text-dim);
}

/* ==========================================================================
   Navigation Tabs
   ========================================================================== */
.nav-tabs {
  display: flex;
  align-items: center;
  gap: 8px;
  border-bottom: 1px solid var(--border-subtle);
  margin-bottom: 24px;
}

.nav-tab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 20px;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text-muted);
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-fast);
  margin-bottom: -1px;
}

.nav-tab:hover {
  color: var(--text-main);
}

.nav-tab.active {
  color: #fff;
  border-bottom-color: var(--cyan-primary);
}

.tab-pill {
  font-size: 11px;
  padding: 2px 7px;
  border-radius: var(--radius-full);
  background: var(--bg-surface-elevated);
  color: var(--text-dim);
  font-weight: 600;
}

.nav-tab.active .tab-pill {
  background: rgba(56, 189, 248, 0.15);
  color: var(--cyan-primary);
}

.tab-pane {
  display: none;
}

.tab-pane.active {
  display: block;
}

/* ==========================================================================
   Filter Bar & Search Input
   ========================================================================== */
.filter-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 12px 18px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.filter-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.filter-label {
  font-size: 12px;
  color: var(--text-dim);
  font-weight: 600;
}

.filter-chip {
  padding: 5px 12px;
  border-radius: var(--radius-full);
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  font-family: inherit;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition-fast);
}

.filter-chip:hover {
  color: var(--text-main);
  background: var(--bg-surface-hover);
}

.filter-chip.active {
  background: rgba(56, 189, 248, 0.15);
  border-color: rgba(56, 189, 248, 0.4);
  color: var(--cyan-primary);
  font-weight: 600;
}

.custom-select {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 13px;
  outline: none;
  cursor: pointer;
}

.custom-select:focus {
  border-color: var(--border-active);
}

.search-box {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 6px 12px;
  min-width: 260px;
}

.search-box:focus-within {
  border-color: var(--border-active);
}

.search-box svg {
  color: var(--text-dim);
}

.search-box input {
  background: transparent;
  border: none;
  color: var(--text-main);
  font-family: inherit;
  font-size: 13px;
  outline: none;
  width: 100%;
}

.search-box input::placeholder {
  color: var(--text-dim);
}

/* ==========================================================================
   Breakouts Grid & Cards
   ========================================================================== */
.breakouts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
  gap: 18px;
}

.breakout-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 20px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 16px;
  transition: var(--transition-normal);
  position: relative;
}

.clickable-card {
  cursor: pointer;
}

.clickable-card:hover {
  border-color: rgba(56, 189, 248, 0.45);
  box-shadow: 0 10px 30px rgba(0, 242, 254, 0.08);
}

.breakout-card:hover {
  transform: translateY(-2px);
  border-color: rgba(56, 189, 248, 0.3);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

.card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.keyword-wrap {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.keyword-text {
  font-size: 18px;
  font-weight: 700;
  color: #fff;
  letter-spacing: -0.01em;
}

.entity-subtext {
  font-size: 12px;
  color: var(--text-dim);
  display: flex;
  align-items: center;
  gap: 6px;
}

.stage-badge {
  font-size: 11px;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: var(--radius-full);
  white-space: nowrap;
}

.stage-breakout {
  background: rgba(244, 63, 94, 0.15);
  color: #fb7185;
  border: 1px solid rgba(244, 63, 94, 0.3);
}

.stage-resurging {
  background: rgba(168, 85, 247, 0.15);
  color: #c084fc;
  border: 1px solid rgba(168, 85, 247, 0.3);
}

.stage-highgrowth {
  background: rgba(56, 189, 248, 0.15);
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.3);
}

.stage-declining {
  background: rgba(100, 116, 139, 0.2);
  color: #94a3b8;
  border: 1px solid rgba(100, 116, 139, 0.4);
}


/* Benchmark Bar */
.ratio-metric-box {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 12px 14px;
}

.ratio-label-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  margin-bottom: 6px;
}

.ratio-highlight {
  font-family: var(--font-mono);
  font-weight: 700;
  color: var(--cyan-primary);
  font-size: 14px;
}

.momentum-tag {
  font-size: 11px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 4px;
}

.momentum-up {
  color: var(--emerald-primary);
}

.momentum-down {
  color: var(--rose-primary);
}

.progress-track {
  height: 6px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  border-radius: var(--radius-full);
  background: linear-gradient(90deg, var(--cyan-primary), #6366f1);
  transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Suggested Action Box */
.action-advice-box {
  background: rgba(16, 185, 129, 0.05);
  border-left: 3px solid var(--emerald-primary);
  padding: 8px 12px;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-size: 12px;
  color: #cbd5e1;
  line-height: 1.4;
}

.action-advice-box strong {
  color: var(--emerald-primary);
}

/* Card Actions */
.card-bottom-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 12px;
  border-top: 1px solid var(--border-subtle);
  font-size: 12px;
}

.external-links {
  display: flex;
  align-items: center;
  gap: 12px;
}

.link-trends {
  color: var(--cyan-primary);
  text-decoration: none;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 4px;
}

.link-trends:hover {
  text-decoration: underline;
}

.link-serp {
  color: var(--text-dim);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 4px;
}

.link-serp:hover {
  color: var(--text-main);
}

/* ==========================================================================
   Arbitrage Opportunities Grid
   ========================================================================== */
.arbitrage-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(420px, 1fr));
  gap: 20px;
}

.arbitrage-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  position: relative;
  transition: var(--transition-normal);
}

.arbitrage-card:hover {
  transform: translateY(-2px);
  border-color: rgba(16, 185, 129, 0.35);
}

.arbitrage-card.is-declining {
  opacity: 0.85;
}

.arbitrage-card.is-declining:hover {
  border-color: rgba(244, 63, 94, 0.35);
}

.arb-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.arb-source-pill {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  font-weight: 600;
  text-transform: uppercase;
}

.pill-github {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.pill-reddit {
  background: rgba(255, 69, 0, 0.15);
  color: #ff6b3d;
}

.arb-keyword {
  font-size: 19px;
  font-weight: 700;
  color: #fff;
}

.arb-verdict-banner {
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.4;
}

.verdict-accepted {
  background: rgba(16, 185, 129, 0.1);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.25);
}

.verdict-declining {
  background: rgba(244, 63, 94, 0.1);
  color: #fb7185;
  border: 1px solid rgba(244, 63, 94, 0.25);
}

.emd-domains-box {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 12px 14px;
}

.emd-title {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 8px;
}

.emd-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.emd-tag {
  font-family: var(--font-mono);
  font-size: 11px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  color: var(--cyan-primary);
  display: inline-flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  transition: var(--transition-fast);
}

.emd-tag:hover {
  background: rgba(56, 189, 248, 0.12);
}

.suggest-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 6px;
}

.suggest-pill {
  font-size: 11px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-muted);
  padding: 2px 7px;
  border-radius: var(--radius-full);
}

/* ==========================================================================
   Multi-Platform Subtabs & Tables
   ========================================================================== */
.subtabs-bar {
  display: flex;
  gap: 12px;
  margin-bottom: 20px;
}

.subtab-btn {
  padding: 8px 16px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  border-radius: var(--radius-md);
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: var(--transition-fast);
}

.subtab-btn:hover {
  color: var(--text-main);
  background: var(--bg-surface-elevated);
}

.subtab-btn.active {
  background: var(--bg-surface-elevated);
  border-color: var(--cyan-primary);
  color: #fff;
}

.badge-sm {
  font-size: 10px;
  padding: 1px 6px;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.08);
}

.subtab-pane {
  display: none;
}

.subtab-pane.active {
  display: block;
}

/* Table Style */
.data-table-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.data-table th {
  background: rgba(255, 255, 255, 0.02);
  color: var(--text-dim);
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border-subtle);
}

.data-table td {
  padding: 14px 20px;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-main);
  font-size: 13px;
}

.data-table tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}

/* GitHub Repos Grid */
.github-repos-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: 16px;
}

.repo-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: var(--transition-fast);
}

.repo-card:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, 0.18);
}

.repo-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.repo-name {
  font-size: 15px;
  font-weight: 700;
  color: #fff;
  text-decoration: none;
}

.repo-name:hover {
  color: var(--cyan-primary);
}

.repo-stars {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  color: var(--amber-primary);
  display: flex;
  align-items: center;
  gap: 4px;
}

.repo-desc {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.5;
  flex: 1;
}

/* Reddit Posts Grid */
.reddit-posts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
  gap: 16px;
}

.reddit-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: var(--transition-fast);
}

.reddit-card:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 69, 0, 0.3);
}

.reddit-title {
  font-size: 14px;
  font-weight: 600;
  color: #fff;
  text-decoration: none;
  line-height: 1.4;
}

.reddit-title:hover {
  color: #ff6b3d;
}

/* ==========================================================================
   Reports Center Layout & Markdown Body
   ========================================================================== */
.reports-layout {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 20px;
  min-height: 650px;
}

.reports-sidebar {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border-subtle);
}

.sidebar-header h3 {
  font-size: 14px;
  font-weight: 600;
  color: #fff;
}

.reports-count-label {
  font-size: 11px;
  color: var(--text-dim);
}

.reports-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow-y: auto;
  max-height: 600px;
}

.report-item-btn {
  background: var(--bg-surface-elevated);
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  padding: 12px 14px;
  text-align: left;
  cursor: pointer;
  transition: var(--transition-fast);
  color: var(--text-muted);
}

.report-item-btn:hover {
  background: var(--bg-surface-hover);
  color: #fff;
}

.report-item-btn.active {
  background: rgba(56, 189, 248, 0.1);
  border-color: rgba(56, 189, 248, 0.35);
  color: #fff;
}

.report-item-title {
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 4px;
}

.report-item-meta {
  font-size: 11px;
  color: var(--text-dim);
}

.report-viewer-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 24px 28px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.viewer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: 16px;
}

.viewer-meta h2 {
  font-size: 18px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 4px;
}

.viewer-time {
  font-size: 12px;
  color: var(--text-dim);
}

.markdown-body {
  font-size: 14px;
  line-height: 1.7;
  color: #cbd5e1;
  max-height: 650px;
  overflow-y: auto;
  padding-right: 12px;
}

.markdown-body h1, .markdown-body h2, .markdown-body h3 {
  color: #fff;
  margin-top: 24px;
  margin-bottom: 12px;
  font-weight: 700;
}

.markdown-body h1 { font-size: 22px; border-bottom: 1px solid var(--border-subtle); padding-bottom: 8px; }
.markdown-body h2 { font-size: 18px; }
.markdown-body h3 { font-size: 15px; }

.markdown-body p { margin-bottom: 14px; }
.markdown-body ul, .markdown-body ol { margin-left: 20px; margin-bottom: 14px; }
.markdown-body li { margin-bottom: 6px; }

.markdown-body table {
  width: 100%;
  border-collapse: collapse;
  margin: 18px 0;
  font-size: 13px;
}

.markdown-body th {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  padding: 10px 14px;
  text-align: left;
  color: #fff;
}

.markdown-body td {
  border: 1px solid var(--border-subtle);
  padding: 10px 14px;
}

.markdown-body blockquote {
  border-left: 4px solid var(--cyan-primary);
  background: rgba(56, 189, 248, 0.05);
  padding: 10px 16px;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  margin: 16px 0;
}

/* ==========================================================================
   Seeds Grid
   ========================================================================== */
.seeds-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 16px;
}

.seed-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: var(--transition-fast);
}

.seed-card:hover {
  transform: translateY(-2px);
  border-color: rgba(56, 189, 248, 0.3);
}

.seed-title {
  font-size: 16px;
  font-weight: 700;
  color: #fff;
}

.seed-desc {
  font-size: 12px;
  color: var(--text-muted);
}

.seed-action {
  font-size: 11px;
  color: var(--cyan-primary);
  background: rgba(56, 189, 248, 0.08);
  padding: 4px 8px;
  border-radius: var(--radius-sm);
}

/* ==========================================================================
   Modals & Terminal Drawer
   ========================================================================== */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 200;
}

.modal-overlay.active {
  display: flex;
}

.modal-dialog {
  background: var(--bg-surface);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-lg);
  width: 540px;
  max-width: 90vw;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6);
  overflow: hidden;
  animation: modalFadeIn 0.2s ease-out;
}

@keyframes modalFadeIn {
  from { opacity: 0; transform: scale(0.96); }
  to { opacity: 1; transform: scale(1); }
}

.modal-header {
  padding: 18px 24px;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-title {
  display: flex;
  align-items: center;
  gap: 10px;
}

.modal-title h3 {
  font-size: 16px;
  font-weight: 700;
  color: #fff;
}

.modal-close {
  background: transparent;
  border: none;
  font-size: 20px;
  color: var(--text-dim);
  cursor: pointer;
}

.modal-close:hover {
  color: #fff;
}

.modal-body {
  padding: 22px 24px;
}

.modal-desc {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 16px;
}

.pipeline-options {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.pipeline-option {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 16px;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: var(--transition-fast);
}

.pipeline-option:hover {
  background: var(--bg-surface-hover);
}

.pipeline-option input[type="radio"] {
  margin-top: 3px;
  accent-color: var(--cyan-primary);
}

.option-content {
  flex: 1;
}

.option-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 4px;
}

.option-name {
  font-size: 14px;
  font-weight: 600;
  color: #fff;
}

.option-desc {
  font-size: 12px;
  color: var(--text-dim);
  line-height: 1.4;
}

.modal-footer {
  padding: 16px 24px;
  background: rgba(0, 0, 0, 0.2);
  border-top: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
}

/* Terminal Drawer */
.terminal-drawer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: #090d16;
  border-top: 1px solid rgba(56, 189, 248, 0.3);
  box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.6);
  z-index: 150;
  transform: translateY(100%);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
  height: 380px;
}

.terminal-drawer.open {
  transform: translateY(0);
}

.terminal-header {
  height: 44px;
  background: #0e1422;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 18px;
}

.terminal-title {
  display: flex;
  align-items: center;
  gap: 8px;
}

.terminal-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.terminal-dot.green { background: #10b981; }
.terminal-dot.yellow { background: #f59e0b; }
.terminal-dot.red { background: #ef4444; }

.terminal-name {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  color: #fff;
  margin-left: 6px;
}

.terminal-badge {
  font-family: var(--font-mono);
  font-size: 10px;
  padding: 1px 6px;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-dim);
}

.terminal-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.terminal-body {
  flex: 1;
  padding: 14px 18px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: #94a3b8;
  overflow-y: auto;
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-all;
}

.log-line.system {
  color: var(--cyan-primary);
}

.log-line.error {
  color: var(--rose-primary);
}

/* Toast */
.toast-container {
  position: fixed;
  top: 80px;
  right: 28px;
  z-index: 300;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.toast {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-active);
  padding: 12px 18px;
  border-radius: var(--radius-md);
  font-size: 13px;
  color: #fff;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  animation: toastIn 0.25s ease-out;
}

@keyframes toastIn {
  from { opacity: 0; transform: translateX(20px); }
  to { opacity: 1; transform: translateX(0); }
}

/* Responsive */
@media (max-width: 1200px) {
  .kpi-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 768px) {
  .kpi-grid {
    grid-template-columns: 1fr;
  }
  .reports-layout {
    grid-template-columns: 1fr;
  }
}

/* Modal Dialog System */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  transition: opacity var(--transition-normal);
}

.modal-overlay.active {
  display: flex;
  opacity: 1;
}

.modal-dialog {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-active);
  border-radius: var(--radius-lg);
  width: 90%;
  max-width: 580px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.8), 0 0 30px var(--cyan-glow);
  overflow: hidden;
  animation: modalScaleUp 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalScaleUp {
  from { transform: scale(0.92); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 24px;
  border-bottom: 1px solid var(--border-subtle);
  background: rgba(255, 255, 255, 0.02);
}

.modal-title {
  display: flex;
  align-items: center;
  gap: 10px;
}

.modal-title h3 {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-main);
  margin: 0;
}

.modal-close {
  background: transparent;
  border: none;
  color: var(--text-dim);
  font-size: 24px;
  cursor: pointer;
  line-height: 1;
  padding: 4px;
  transition: color var(--transition-fast);
}

.modal-close:hover {
  color: var(--text-main);
}

.modal-body {
  padding: 24px;
}

.modal-desc {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 16px;
}

.pipeline-options {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.pipeline-option {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 16px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  background: var(--bg-surface);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.pipeline-option:hover {
  border-color: var(--border-active);
  background: var(--bg-surface-hover);
}

.pipeline-option.active {
  border-color: var(--cyan-primary);
  background: rgba(56, 189, 248, 0.06);
  box-shadow: 0 0 15px rgba(56, 189, 248, 0.1);
}

.pipeline-option input[type="radio"] {
  margin-top: 3px;
  accent-color: var(--cyan-primary);
}

.option-content {
  flex: 1;
}

.option-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}

.option-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-main);
}

.option-desc {
  font-size: 12px;
  color: var(--text-dim);
  line-height: 1.5;
  margin: 0;
}

.modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  padding: 16px 24px;
  border-top: 1px solid var(--border-subtle);
  background: rgba(255, 255, 255, 0.01);
}

/* Detail Modal Specific Styling */
.detail-kpi-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.detail-kpi-label {
  font-size: 11px;
  color: var(--text-dim);
}

.detail-kpi-val {
  font-size: 16px;
  font-weight: 700;
  color: #fff;
  font-family: var(--font-mono);
}

.detail-kpi-sub {
  font-size: 10px;
  color: var(--text-muted);
}

.clickable-keyword {
  cursor: pointer;
  transition: var(--transition-fast);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.clickable-keyword:hover {
  color: var(--cyan-primary) !important;
  text-decoration: underline;
}

.longtail-pill {
  background: rgba(56, 189, 248, 0.08);
  border: 1px solid rgba(56, 189, 248, 0.2);
  color: #7dd3fc;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 12px;
  font-family: var(--font-mono);
  cursor: pointer;
  transition: var(--transition-fast);
}

.longtail-pill:hover {
  background: rgba(56, 189, 248, 0.2);
  color: #fff;
  border-color: #38bdf8;
}

/* ==========================================================================
   WebCafe Style · 极简实时流 (Live Stream & Timeline Pills)
   ========================================================================== */

.badge-hot {
  background: linear-gradient(135deg, #f97316, #ef4444) !important;
  color: #fff !important;
  font-weight: 700 !important;
  font-size: 10px !important;
  padding: 1px 6px !important;
  border-radius: var(--radius-full);
  animation: pulse-hot 2s infinite;
}

@keyframes pulse-hot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.85; transform: scale(1.08); }
}

/* 顶部三大板块概览网格 */
.stream-overview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(330px, 1fr));
  gap: 18px;
  margin-bottom: 30px;
}

.stream-kpi-card {
  background: #141519;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 20px 22px;
  display: flex;
  flex-direction: column;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
  position: relative;
  overflow: hidden;
}

.stream-kpi-card:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, 0.18);
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.5);
}

.stream-kpi-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.stream-kpi-title {
  font-size: 16px;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: -0.01em;
}

.stream-kpi-tag {
  font-size: 11px;
  background: rgba(255, 255, 255, 0.08);
  color: #9ca3af;
  padding: 2px 8px;
  border-radius: 4px;
  font-weight: 500;
}

.stream-kpi-tag.tag-exclusive {
  background: rgba(249, 115, 22, 0.15);
  color: #fb923c;
  border: 1px solid rgba(249, 115, 22, 0.3);
}

.stream-kpi-desc {
  font-size: 12px;
  color: #858997;
  line-height: 1.45;
  margin-bottom: 18px;
  min-height: 35px;
}

.stream-kpi-metrics-row {
  display: grid;
  grid-template-columns: 1.2fr 1fr 1fr;
  gap: 12px;
  padding: 14px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  margin-bottom: 16px;
}

.stream-metric-col {
  display: flex;
  flex-direction: column;
}

.stream-metric-val {
  font-size: 24px;
  font-weight: 800;
  color: #f3f4f6;
  font-family: var(--font-mono);
  letter-spacing: -0.03em;
  line-height: 1.1;
}

.stream-metric-lbl {
  font-size: 11px;
  color: #71717a;
  margin-top: 5px;
}

.stream-kpi-bullets {
  list-style: none;
  padding: 0;
  margin: 0 0 16px 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex-grow: 1;
}

.stream-kpi-bullets li {
  font-size: 11.5px;
  color: #8b8f9d;
  line-height: 1.4;
  position: relative;
  padding-left: 12px;
}

.stream-kpi-bullets li::before {
  content: "·";
  position: absolute;
  left: 2px;
  top: -1px;
  font-weight: 900;
  color: #52525b;
  font-size: 14px;
}

.stream-kpi-time {
  font-size: 11px;
  color: #52525b;
  border-top: 1px dashed rgba(255, 255, 255, 0.05);
  padding-top: 10px;
  font-family: var(--font-mono);
}

/* 更新动态 时间轴卡片流 */
.stream-timeline-section {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.stream-timeline-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  padding-bottom: 10px;
}

.stream-timeline-title-wrap {
  display: flex;
  align-items: baseline;
  gap: 14px;
  flex-wrap: wrap;
}

.stream-timeline-title {
  font-size: 18px;
  font-weight: 800;
  color: #ffffff;
  letter-spacing: -0.02em;
}

.stream-timeline-subtitle {
  font-size: 12.5px;
  color: #94a3b8;
}

.stream-batches-container {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* 单个批次卡片 */
.stream-batch-card {
  background: #141519;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 18px 22px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  transition: border-color 0.15s ease;
}

.stream-batch-card:hover {
  border-color: rgba(255, 255, 255, 0.16);
}

.stream-batch-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

.stream-batch-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.stream-batch-date {
  font-size: 15px;
  font-weight: 700;
  color: #f8fafc;
  font-family: var(--font-mono);
}

.stream-batch-relative {
  font-size: 12px;
  color: #71717a;
}

.stream-batch-badges {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.stream-badge {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 4px;
}

.stream-badge.badge-new {
  background: rgba(249, 115, 22, 0.15);
  color: #fb923c;
  border: 1px solid rgba(249, 115, 22, 0.3);
}

.stream-badge.badge-resurge {
  background: rgba(234, 179, 8, 0.15);
  color: #facc15;
  border: 1px solid rgba(234, 179, 8, 0.3);
}

.stream-badge.badge-game {
  background: rgba(6, 182, 212, 0.15);
  color: #22d3ee;
  border: 1px solid rgba(6, 182, 212, 0.3);
}

.stream-badge.badge-push {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

/* 批次指标流水明细行 */
.stream-batch-stats {
  font-size: 12px;
  color: #8b8f9e;
  line-height: 1.5;
  background: rgba(255, 255, 255, 0.02);
  padding: 7px 12px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.04);
}

/* 分类与胶囊药丸行 */
.stream-batch-content {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.stream-category-row {
  display: flex;
  align-items: flex-start;
  gap: 14px;
}

.stream-category-label {
  font-size: 12px;
  font-weight: 600;
  color: #71717a;
  min-width: 56px;
  padding-top: 5px;
  letter-spacing: -0.01em;
}

.stream-pills-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  flex: 1;
}

/* 核心药丸胶囊 */
.stream-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: #202227;
  color: #e2e8f0;
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 4px 12px;
  border-radius: var(--radius-full);
  font-size: 12.5px;
  font-family: var(--font-mono);
  cursor: pointer;
  transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
  user-select: none;
  white-space: nowrap;
}

.stream-pill:hover {
  background: #2a2c33;
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.22);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

/* 爆发高热度突出药丸 (同 WebCafe 亮橙色高倍率样式) */
.stream-pill.high {
  background: rgba(234, 88, 12, 0.16);
  border: 1px solid rgba(249, 115, 22, 0.45);
  color: #fb923c;
  font-weight: 600;
}

.stream-pill.high:hover {
  background: rgba(234, 88, 12, 0.28);
  border-color: #f97316;
  color: #ffedd5;
  box-shadow: 0 4px 14px rgba(249, 115, 22, 0.25);
}

.stream-pill-ratio {
  font-size: 11.5px;
  font-weight: 700;
  opacity: 0.9;
  letter-spacing: -0.02em;
}

.stream-pill.high .stream-pill-ratio {
  color: #fdba74;
}



