/* market-watch — Linear-inspired Dark Theme v3 */
* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  /* Linear-inspired color system */
  --bg: #08090a;
  --card: #191a1b;
  --card-border: rgba(255,255,255,0.05);
  --border: rgba(255,255,255,0.08);
  --border-subtle: rgba(255,255,255,0.05);
  --text: #f7f8f8;
  --text-dim: #d0d6e0;
  --text-muted: #8a8f98;
  --text-quaternary: #62666d;
  --accent: #5e6ad2;
  --accent-dim: rgba(94, 106, 210, 0.1);
  --accent-interactive: #7170ff;
  /* A 股约定：涨红跌绿。红色仅表示价格上涨，绿色仅表示下跌，其余警戒用琥珀 */
  --up: #ef4444;            /* 涨 */
  --up-soft: rgba(239, 68, 68, 0.1);
  --bar-from: #ef4444;
  --bar-to: #f87171;
  --down: #22c55e;          /* 跌 */
  --down-soft: rgba(34, 197, 94, 0.1);
  --warn: #f97316;          /* 警戒/危险（非涨跌） */
  --warn-soft: rgba(249, 115, 22, 0.15);
  --tag-new-bg: rgba(249, 115, 22, 0.15);
  --tag-new: #f97316;
  --tag-continued-bg: rgba(56, 189, 248, 0.12);
  --tag-continued: #38bdf8;
}

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800;900&family=JetBrains+Mono:wght@400;500;600&display=swap');

html { font-size: 16px; }
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI",
               "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  max-width: 700px;
  margin: 0 auto;
  padding: 32px 24px 56px;
  min-height: 100vh;
}

/* ── Header ── */
header {
  margin-bottom: 28px;
}
h1 {
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--text);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
h1::before {
  content: '';
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent);
}
.subtitle {
  color: var(--text-dim);
  font-size: 0.75rem;
  font-family: 'JetBrains Mono', monospace;
  margin-top: 4px;
  letter-spacing: 0.01em;
}

/* ── 今日要点 hero ── */
.hero {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: 12px;
  padding: 24px;
  margin-bottom: 16px;
  position: relative;
  overflow: hidden;
  transition: all 0.2s ease;
}
.hero:hover {
  border-color: var(--border);
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}
.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.08) 0%, transparent 60%);
  pointer-events: none;
}
.hero-label-top {
  font-size: 0.6875rem;
  color: var(--text-quaternary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 600;
  margin-bottom: 16px;
  position: relative;
}
.hero-stats {
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
  position: relative;
}
.hero-stat {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}
.hero-val {
  font-family: 'JetBrains Mono', monospace;
  font-weight: 700;
  font-size: 2rem;
  line-height: 1;
  letter-spacing: -0.5px;
}
.hero-val-up { color: var(--up); }
.hero-val-accent { color: var(--accent-interactive); font-size: 1.25rem; }
.hero-val-warn { color: var(--warn); }
.hero-val-dim { color: var(--text-muted); }
.hero-trend {
  font-size: 0.875rem;
  font-weight: 700;
  margin-left: 4px;
  vertical-align: middle;
}
.hero-trend-up { color: var(--up); }
.hero-trend-down { color: var(--down); }
.hero-label {
  font-size: 0.6875rem;
  color: var(--text-muted);
  letter-spacing: 0.03em;
}
.hero-sep {
  color: var(--border);
  align-self: center;
  margin: 0 8px;
  font-size: 1rem;
}
.hero-spark-wrap {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border-subtle);
}
.hero-spark-label {
  display: block;
  font-size: 0.6875rem;
  color: var(--text-muted);
  letter-spacing: 0.03em;
  margin-bottom: 4px;
}
.hero .sparkline {
  width: 100%;
  height: 48px;
  margin: 0;
}
@media (max-width: 480px) {
  .hero-stats { gap: 4px; }
  .hero-sep { margin: 0 4px; }
  .hero-val { font-size: 1.25rem; }
  .hero-val-accent { font-size: 1rem; }
}

/* ── Tab 导航 ── */
.section-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 16px;
  padding: 4px;
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: 10px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.section-tab {
  flex: 1;
  padding: 10px 12px;
  background: transparent;
  border: none;
  border-radius: 7px;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-dim);
  cursor: pointer;
  transition: all 0.15s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  white-space: nowrap;
  font-family: inherit;
}
.section-tab:hover {
  background: rgba(255,255,255,0.03);
  color: var(--text);
}
.section-tab.active {
  background: var(--accent);
  color: white;
  box-shadow: 0 2px 8px rgba(94, 106, 210, 0.4);
}
.section-tab .tab-count {
  font-size: 0.625rem;
  padding: 2px 6px;
  background: rgba(255,255,255,0.12);
  border-radius: 8px;
  font-family: 'JetBrains Mono', monospace;
}
.section-tab.active .tab-count {
  background: rgba(255,255,255,0.2);
}
/* Tab 内容面板 */
.tab-panel {
  display: none;
}
.tab-panel.active {
  display: block;
  animation: fadeIn 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}
/* Tab 内卡片 hover 增强 */
.tab-panel > section {
  transition: all 0.2s ease;
}
.tab-panel > section:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
}
/* Tab 内 section 间距 */
.tab-panel > section {
  margin-bottom: 16px;
}
.tab-panel > section:last-child {
  margin-bottom: 4px;
}
@media (max-width: 480px) {
  .section-tab { padding: 8px 10px; font-size: 0.75rem; }
}

/* ── Cards ── */
section {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: 12px;
  padding: 24px;
  margin-bottom: 16px;
  position: relative;
  transition: all 0.2s ease;
}
section:hover {
  border-color: var(--border);
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}
section::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(255,255,255,0.02) 0%, transparent 50%);
  pointer-events: none;
}
section > h2 {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 8px;
}
/* 问号图标 + tooltip */
.info-tip {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: rgba(255,255,255,0.06);
  color: var(--text-quaternary);
  font-size: 0.625rem;
  font-weight: 700;
  cursor: help;
  transition: all 0.15s ease;
  flex-shrink: 0;
}
.info-tip:hover {
  background: var(--accent-dim);
  color: var(--accent-interactive);
}
.info-tip .tooltip {
  visibility: hidden;
  opacity: 0;
  position: absolute;
  top: 50%;
  left: 100%;
  transform: translateY(-50%) translateX(8px);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 0.75rem;
  font-weight: 400;
  color: var(--text-dim);
  line-height: 1.5;
  width: 260px;
  text-transform: none;
  letter-spacing: 0;
  z-index: 100;
  box-shadow: 0 8px 24px rgba(0,0,0,0.5);
  transition: opacity 0.15s ease, visibility 0.15s ease;
  pointer-events: none;
}
.info-tip:hover .tooltip {
  visibility: visible;
  opacity: 1;
}
/* tooltip 箭头（在左侧，指向问号） */
.info-tip .tooltip::before {
  content: '';
  position: absolute;
  right: 100%;
  top: 50%;
  transform: translateY(-50%);
  border: 5px solid transparent;
  border-right-color: var(--border);
}
.info-tip .tooltip::after {
  content: '';
  position: absolute;
  right: 100%;
  top: 50%;
  transform: translateY(-50%);
  border: 4px solid transparent;
  border-right-color: var(--bg-elevated);
}

/* ── 密度 ── */
.density-main {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 2px;
}
.density-pct {
  font-size: 3.2rem;
  font-weight: 900;
  font-family: 'JetBrains Mono', monospace;
  color: var(--accent);
  line-height: 1;
  letter-spacing: -0.04em;
}
.density-detail {
  color: var(--text-dim);
  font-size: 0.8rem;
}
.sparkline {
  width: 100%;
  height: 64px;
  margin: 12px 0 6px;
  display: block;
}

/* ── 板块 ── */
.sector-row {
  display: grid;
  grid-template-columns: 72px 1fr 50px;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  font-size: 0.85rem;
}
.sector-row + .sector-row {
  border-top: 1px solid var(--border-subtle);
}
.sector-name {
  color: var(--text);
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 0.82rem;
}
.sector-bar-track {
  height: 4px;
  background: var(--up-soft);
  border-radius: 2px;
  overflow: hidden;
}
.sector-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--bar-from), var(--bar-to));
  border-radius: 2px;
  transition: width 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}
.sector-meta {
  color: var(--text-dim);
  font-size: 0.72rem;
  font-family: 'JetBrains Mono', monospace;
  text-align: right;
  line-height: 1.35;
}

/* ── 候选 ── */
.cand-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 4px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border-subtle);
}
.cand-row:last-child { border-bottom: none; }
.cand-row:hover {
  background: rgba(255,255,255,0.012);
  margin: 0 -14px;
  padding: 14px;
  border-radius: 10px;
}
.cand-name {
  font-weight: 600;
  font-size: 0.9375rem;
  letter-spacing: -0.01em;
  color: var(--text);
}
.cand-ticker {
  color: var(--text-quaternary);
  font-size: 0.75rem;
  font-family: 'JetBrains Mono', monospace;
  letter-spacing: 0.03em;
  margin-top: 2px;
}
.cand-summary {
  color: var(--text-dim);
  font-size: 0.8125rem;
  margin-top: 10px;
  grid-column: 1 / -1;
  line-height: 1.6;
}
.cand-pct {
  font-weight: 600;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.9375rem;
  color: var(--up);
  text-align: right;
  white-space: nowrap;
  letter-spacing: -0.5px;
}
.cand-pct-down {
  color: var(--down);
}
.cand-meta {
  color: var(--text-quaternary);
  font-size: 0.75rem;
  font-family: 'JetBrains Mono', monospace;
  text-align: right;
}
.tag {
  display: inline-block;
  font-size: 0.625rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 4px;
  margin-left: 8px;
  vertical-align: middle;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}
.tag-continued {
  background: var(--tag-continued-bg);
  color: var(--tag-continued);
  border: 1px solid rgba(56, 189, 248, 0.2);
}
.tag-new {
  background: var(--tag-new-bg);
  color: var(--tag-new);
  border: 1px solid rgba(249, 115, 22, 0.2);
}
.risk-flags {
  display: inline-flex;
  gap: 4px;
  margin-left: 8px;
  vertical-align: middle;
}
.risk-tag {
  display: inline-block;
  font-size: 0.5625rem;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 3px;
  background: var(--warn-soft);
  color: var(--warn);
  letter-spacing: 0.02em;
  border: 1px solid rgba(249, 115, 22, 0.2);
}

/* ── 趋势死亡模式 ── */
.death-summary {
  color: var(--text-dim);
  font-size: 0.78rem;
  margin-bottom: 14px;
}
.death-bar-row {
  display: grid;
  grid-template-columns: 72px 1fr 80px;
  align-items: center;
  gap: 8px;
  padding: 5px 0;
}
.death-bar-label {
  font-size: 0.75rem;
  color: var(--text);
  font-weight: 500;
}
.death-bar-track {
  height: 6px;
  background: rgba(255,255,255,0.04);
  border-radius: 3px;
  overflow: hidden;
}
.death-bar {
  height: 100%;
  border-radius: 3px;
  transition: width 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}
.death-bar-count {
  font-size: 0.72rem;
  font-family: 'JetBrains Mono', monospace;
  color: var(--text-dim);
  text-align: right;
}
.death-bar-pct {
  color: var(--text-muted);
}
.death-recent-title {
  font-size: 0.65rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-top: 16px;
  margin-bottom: 8px;
  font-weight: 600;
}
.death-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 0;
  border-bottom: 1px solid var(--border-subtle);
  font-size: 0.78rem;
}
.death-item:last-child { border-bottom: none; }
.death-name {
  font-weight: 600;
  color: var(--text);
}
.death-ticker {
  color: var(--text-muted);
  font-size: 0.65rem;
  font-family: 'JetBrains Mono', monospace;
}
.death-pattern-tag {
  font-size: 0.56rem;
  font-weight: 600;
  padding: 1px 5px;
  border-radius: 3px;
  letter-spacing: 0.02em;
}
/* 趋势死亡标签：这些是"危险/警戒"而非"下跌"信号，红涨模型下用琥珀色系避免与"涨"混淆 */
.death-crash { background: rgba(249, 115, 22, 0.18); color: #fb923c; }
.death-negative { background: rgba(249, 115, 22, 0.14); color: var(--warn); }
.death-drop { background: rgba(234, 179, 8, 0.14); color: #eab308; }
.death-pct {
  font-family: 'JetBrains Mono', monospace;
  font-weight: 700;
  color: var(--up);
  margin-left: auto;
  font-size: 0.75rem;
}
.death-date {
  color: var(--text-muted);
  font-size: 0.65rem;
  font-family: 'JetBrains Mono', monospace;
}

/* ── 沉默-火山爆发 ── */
.sv-summary {
  color: var(--text-dim);
  font-size: 0.78rem;
  margin-bottom: 14px;
}
.sv-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 12px 0;
  border-bottom: 1px solid var(--border-subtle);
  gap: 12px;
}
.sv-row:last-child { border-bottom: none; }
.sv-left {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}
.sv-name {
  font-weight: 600;
  font-size: 0.88rem;
  color: var(--text);
}
.sv-ticker {
  color: var(--text-muted);
  font-size: 0.65rem;
  font-family: 'JetBrains Mono', monospace;
}
.sv-status {
  font-size: 0.6rem;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: 3px;
  display: inline-block;
  width: fit-content;
}
/* 状态严重度梯度（非涨跌信号）：ok=中性蓝，warn/hot=琥珀，红涨模型下避免误读为涨跌 */
.sv-ok { background: var(--accent-dim); color: var(--accent); }
.sv-hot { background: rgba(249, 115, 22, 0.18); color: #fb923c; }
.sv-warn { background: var(--warn-soft); color: var(--warn); }
.sv-right {
  text-align: right;
  flex-shrink: 0;
}
.sv-stats {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-bottom: 3px;
}
.sv-stat {
  font-size: 0.7rem;
  color: var(--text-dim);
  font-family: 'JetBrains Mono', monospace;
}
.sv-stat b { color: var(--up); }
.sv-price {
  font-size: 0.72rem;
  color: var(--text-dim);
  font-family: 'JetBrains Mono', monospace;
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}
.sv-fib { color: var(--text-muted); }

/* ── 概念热度生命周期 ── */
.cl-summary {
  color: var(--text-dim);
  font-size: 0.78rem;
  margin-bottom: 14px;
}
.cl-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}
.cl-tab {
  font-size: 0.65rem;
  font-weight: 500;
  padding: 4px 10px;
  border-radius: 5px;
  border: 1px solid var(--border-subtle);
  background: transparent;
  color: var(--text-dim);
  cursor: pointer;
  transition: all 0.15s ease;
  font-family: inherit;
}
.cl-tab:hover {
  color: var(--text);
  border-color: var(--border);
}
.cl-tab-active {
  background: var(--accent-dim);
  color: var(--accent);
  border-color: rgba(56, 189, 248, 0.3);
}
.cl-row {
  display: grid;
  grid-template-columns: 80px 1fr 60px 50px;
  align-items: center;
  gap: 8px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border-subtle);
  font-size: 0.78rem;
}
.cl-row:last-child { border-bottom: none; }
.cl-concept {
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cl-sparkline {
  width: 100%;
  height: 24px;
}
.cl-stage {
  font-size: 0.6rem;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 3px;
  text-align: center;
  white-space: nowrap;
}
/* 概念热度阶段：热度梯度（非涨跌），高峰最烈用亮琥珀 */
.cl-stage-peak { background: rgba(251, 146, 60, 0.16); color: #fb923c; }
.cl-stage-heating { background: var(--warn-soft); color: var(--warn); }
.cl-stage-cooling { background: var(--accent-dim); color: var(--accent); }
.cl-stage-gone { background: rgba(107, 114, 128, 0.12); color: #6b7280; }
.cl-peak {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.68rem;
  color: var(--text-dim);
  text-align: right;
}

/* ── 市场叙事周报 ── */
.nw-card {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: 14px;
  padding: 22px 22px 18px;
  margin-bottom: 14px;
  position: relative;
}
.nw-card::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(255,255,255,0.02) 0%, transparent 50%);
  pointer-events: none;
}
.nw-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 12px;
}
.nw-week {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text);
  font-family: 'JetBrains Mono', monospace;
}
.nw-dates {
  font-size: 0.68rem;
  color: var(--text-muted);
  font-family: 'JetBrains Mono', monospace;
}
.nw-reasons {
  font-size: 0.65rem;
  color: var(--text-dim);
  margin-bottom: 12px;
}
.nw-section-label {
  font-size: 0.6rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin: 12px 0 6px;
  font-weight: 600;
}
.nw-concepts {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.nw-concept-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.7rem;
  font-weight: 500;
  padding: 4px 10px;
  border-radius: 6px;
  background: rgba(56, 189, 248, 0.08);
  color: var(--accent);
  border: 1px solid rgba(56, 189, 248, 0.15);
}
.nw-concept-count {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.62rem;
  opacity: 0.7;
}
/* 概念热度方向（非股价涨跌）：新兴=升温用琥珀，退潮=降温用冷蓝 */
.nw-emerging-tag {
  background: var(--warn-soft);
  color: var(--warn);
  border-color: rgba(249, 115, 22, 0.18);
}
.nw-fading-tag {
  background: var(--accent-dim);
  color: var(--accent);
  border-color: rgba(56, 189, 248, 0.18);
}
.nw-fading-count {
  text-decoration: line-through;
  opacity: 0.5;
}
.nw-arrow {
  color: var(--text-muted);
  font-size: 0.6rem;
}

/* ── 排头兵-补涨梯队 ── */
.cub-summary {
  color: var(--text-dim);
  font-size: 0.78rem;
  margin-bottom: 14px;
}
.cub-section-title {
  font-size: 0.65rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin: 16px 0 8px;
  font-weight: 600;
}
/* 热门概念 */
.cub-heat-row {
  display: grid;
  grid-template-columns: 90px 50px 50px 1fr;
  align-items: center;
  gap: 8px;
  padding: 6px 0;
  border-bottom: 1px solid var(--border-subtle);
  font-size: 0.78rem;
}
.cub-heat-row:last-child { border-bottom: none; }
.cub-heat-concept {
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cub-heat-count {
  font-family: 'JetBrains Mono', monospace;
  color: var(--up);
  font-weight: 600;
  font-size: 0.75rem;
}
.cub-heat-days {
  font-family: 'JetBrains Mono', monospace;
  color: var(--text-dim);
  font-size: 0.7rem;
}
.cub-heat-bar-track {
  height: 4px;
  background: rgba(255,255,255,0.04);
  border-radius: 2px;
  overflow: hidden;
}
/* 热度条（非涨跌）：琥珀热度渐变 */
.cub-heat-bar {
  height: 100%;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--accent), var(--accent-interactive));
  transition: width 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}
/* 补涨候选 */
.cub-catchup-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 4px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border-subtle);
}
.cub-catchup-row:last-child { border-bottom: none; }
.cub-catchup-left {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}
.cub-catchup-name {
  font-weight: 600;
  font-size: 0.88rem;
  color: var(--text);
}
.cub-catchup-ticker {
  color: var(--text-muted);
  font-size: 0.65rem;
  font-family: 'JetBrains Mono', monospace;
}
.cub-catchup-concepts {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 4px;
}
.cub-catchup-tag {
  font-size: 0.56rem;
  font-weight: 500;
  padding: 1px 6px;
  border-radius: 3px;
  background: rgba(56, 189, 248, 0.1);
  color: var(--accent);
  letter-spacing: 0.02em;
}
.cub-catchup-right {
  text-align: right;
  flex-shrink: 0;
}
.cub-catchup-pct {
  font-weight: 700;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.88rem;
  color: var(--up);
}
.cub-catchup-meta {
  color: var(--text-muted);
  font-size: 0.68rem;
  font-family: 'JetBrains Mono', monospace;
  margin-top: 2px;
}
.cub-catchup-last {
  color: var(--text-dim);
  font-size: 0.65rem;
  font-family: 'JetBrains Mono', monospace;
}

/* ── 概念共现网络 ── */
.cc-summary {
  color: var(--text-dim);
  font-size: 0.78rem;
  margin-bottom: 14px;
}
.cc-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 14px;
}
.cc-tab {
  font-size: 0.7rem;
  font-weight: 500;
  padding: 5px 14px;
  border-radius: 6px;
  border: 1px solid var(--border-subtle);
  background: transparent;
  color: var(--text-dim);
  cursor: pointer;
  transition: all 0.15s ease;
  font-family: inherit;
}
.cc-tab:hover {
  color: var(--text);
  border-color: var(--border);
}
.cc-tab-active {
  background: var(--accent-dim);
  color: var(--accent);
  border-color: rgba(56, 189, 248, 0.3);
}
.cc-legend {
  display: flex;
  gap: 16px;
  margin-bottom: 12px;
}
.cc-legend-item {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 0.68rem;
  color: var(--text-dim);
}
.cc-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}
/* 热力矩阵 */
.cc-matrix-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.cc-matrix {
  display: block;
  min-width: 500px;
}
.cc-label-vert {
  font-size: 9px;
  fill: var(--text-dim);
  font-family: 'JetBrains Mono', monospace;
}
.cc-label-horiz {
  font-size: 9px;
  fill: var(--text-dim);
  text-anchor: end;
  font-family: 'JetBrains Mono', monospace;
}
.cc-cell {
  fill: var(--accent);
  stroke: var(--bg);
  stroke-width: 1;
  rx: 2;
  cursor: pointer;
  transition: opacity 0.15s ease;
}
.cc-cell:hover {
  stroke: var(--text);
  stroke-width: 1.5;
}
.cc-cell-diag {
  fill: rgba(255, 255, 255, 0.04);
  stroke: var(--bg);
  stroke-width: 1;
}
.cc-cell-empty {
  fill: rgba(255, 255, 255, 0.015);
  stroke: var(--bg);
  stroke-width: 1;
}
/* 力导向图 */
.cc-graph {
  display: block;
  width: 100%;
  max-width: 400px;
  margin: 0 auto;
}
.cc-edge {
  stroke: var(--accent);
  stroke-linecap: round;
}
.cc-node {
  stroke: var(--bg);
  stroke-width: 1.5;
  cursor: pointer;
  transition: r 0.15s ease;
}
.cc-node:hover {
  filter: brightness(1.3);
}
.cc-node-sector { fill: var(--accent); }
.cc-node-tech { fill: #a78bfa; }
.cc-node-event { fill: #f97316; }
.cc-node-label {
  font-size: 8px;
  fill: var(--text-dim);
  text-anchor: middle;
  font-family: 'JetBrains Mono', monospace;
  pointer-events: none;
}

/* ── 连续多日入选榜 ── */
.streak-summary {
  color: var(--text-dim);
  font-size: 0.78rem;
  margin-bottom: 14px;
}
.streak-row {
  display: grid;
  grid-template-columns: 28px 1fr 140px 70px;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border-subtle);
  font-size: 0.8125rem;
}
.streak-row:last-child { border-bottom: none; }
.streak-rank {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  color: var(--text-quaternary);
  text-align: center;
  font-weight: 600;
}
/* 连续多日入选榜前3名金银铜色 (h2 + summary + 3 streak-rows) */
.streak-row:nth-child(3) .streak-rank { color: #ffd700; }
.streak-row:nth-child(4) .streak-rank { color: #c0c0c0; }
.streak-row:nth-child(5) .streak-rank { color: #cd7f32; }
.streak-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.streak-name {
  font-weight: 600;
  color: var(--text);
  font-size: 0.875rem;
}
.streak-ticker {
  color: var(--text-quaternary);
  font-size: 0.6875rem;
  font-family: 'JetBrains Mono', monospace;
}
.streak-bar-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}
.streak-bar {
  height: 6px;
  background: linear-gradient(90deg, var(--accent), var(--accent-interactive));
  border-radius: 3px;
  transition: width 0.5s ease;
}
.streak-days {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  color: var(--accent-interactive);
  font-weight: 600;
  white-space: nowrap;
}
.streak-pct {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.8125rem;
  color: var(--up);
  font-weight: 600;
  text-align: right;
}

/* ── 板块资金流向 ── */
.sector-flow-chart {
  width: 100%;
  display: block;
}
.sf-axis {
  font-size: 9px;
  fill: var(--text-muted);
  font-family: 'JetBrains Mono', monospace;
}
.sf-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  margin-top: 8px;
}
.sf-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.68rem;
  color: var(--text-dim);
}
.sf-legend-dot {
  width: 8px;
  height: 8px;
  border-radius: 2px;
  display: inline-block;
}
.sf-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 12px;
  margin-bottom: 10px;
}
.sf-check {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.68rem;
  color: var(--text-dim);
  cursor: pointer;
  user-select: none;
}
.sf-check input {
  display: none;
}
.sf-check-dot {
  width: 10px;
  height: 10px;
  border-radius: 2px;
  display: inline-block;
  opacity: 0.3;
  transition: opacity 0.15s;
}
.sf-check input:checked + .sf-check-dot {
  opacity: 1;
}
.sf-check:has(input:checked) {
  color: var(--text);
}

/* ── 早鸟指数 ── */
.eb-summary {
  color: var(--text-dim);
  font-size: 0.78rem;
  margin-bottom: 14px;
}
.eb-row {
  display: grid;
  grid-template-columns: 24px 1fr auto;
  align-items: center;
  gap: 8px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border-subtle);
}
.eb-row:last-child { border-bottom: none; }
.eb-rank {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.68rem;
  color: var(--text-muted);
  text-align: center;
}
.eb-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.eb-name {
  font-weight: 600;
  color: var(--text);
  font-size: 0.82rem;
}
.eb-meta {
  color: var(--text-muted);
  font-size: 0.62rem;
  font-family: 'JetBrains Mono', monospace;
}
.eb-pcts {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.72rem;
}
.eb-first { color: var(--text-dim); }
.eb-arrow { color: var(--text-muted); font-size: 0.6rem; }
.eb-peak { color: var(--up); font-weight: 700; }

/* ── 异常看板 ── */
.anomaly-summary {
  color: var(--text-dim);
  font-size: 0.78rem;
  margin-bottom: 14px;
}
.anomaly-row {
  display: grid;
  grid-template-columns: 60px 1fr auto 50px;
  align-items: center;
  gap: 8px;
  padding: 6px 0;
  border-bottom: 1px solid var(--border-subtle);
  font-size: 0.78rem;
}
.anomaly-row:last-child { border-bottom: none; }
.anomaly-type {
  font-size: 0.6rem;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 3px;
  text-align: center;
}
/* 异常严重度（非涨跌）：高=烈琥珀 */
.anomaly-high { background: rgba(249, 115, 22, 0.18); color: #fb923c; }
.anomaly-medium { background: var(--warn-soft); color: var(--warn); }
.anomaly-label {
  font-weight: 600;
  color: var(--text);
}
.anomaly-val {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.72rem;
  color: var(--text-dim);
}
.anomaly-arrow {
  color: var(--text-muted);
}
.anomaly-dev {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.72rem;
  font-weight: 700;
  text-align: right;
}
/* 异常偏差幅度（非涨跌）：中性蓝强调幅度 */
.anomaly-row:has(.anomaly-dev) .anomaly-dev {
  color: var(--accent);
}

/* ── 被排除股追踪 ── */
.excl-summary {
  color: var(--text-dim);
  font-size: 0.78rem;
  margin-bottom: 14px;
}
.excl-summary b {
  color: var(--accent);
}
.excl-section {
  font-size: 0.6rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin: 14px 0 6px;
  font-weight: 600;
}
.excl-row {
  display: grid;
  grid-template-columns: 80px 50px 1fr 60px;
  align-items: center;
  gap: 8px;
  padding: 6px 0;
  border-bottom: 1px solid var(--border-subtle);
  font-size: 0.75rem;
}
.excl-row:last-child { border-bottom: none; }
.excl-label {
  font-weight: 600;
  color: var(--text);
}
.excl-count {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.68rem;
  color: var(--text-dim);
}
.excl-stat {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.68rem;
  color: var(--text-dim);
}
.excl-stat b {
  color: var(--accent);
  font-weight: 700;
}
.excl-name {
  font-weight: 600;
  color: var(--text);
}
.excl-ticker {
  color: var(--text-muted);
  font-size: 0.62rem;
  font-family: 'JetBrains Mono', monospace;
}
.excl-reason {
  color: var(--text-dim);
  font-size: 0.68rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.excl-reason.excl-expandable {
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: normal;
  word-break: break-word;
}
.excl-reason.excl-expandable:hover {
  color: var(--accent);
}
.excl-reason.excl-expandable.expanded {
  white-space: normal;
  max-width: 400px;
}
.excl-ret {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.72rem;
  font-weight: 700;
  text-align: right;
}
/* 漏网之鱼：被排除却大涨 = 涨，红 */
.excl-escapee {
  color: var(--up);
}

/* ── 羊群扩散 ── */
.herd-summary {
  color: var(--text-dim);
  font-size: 0.78rem;
  margin-bottom: 14px;
}
.herd-row {
  display: grid;
  grid-template-columns: 70px 80px 50px 1fr 60px;
  align-items: center;
  gap: 6px;
  padding: 6px 0;
  border-bottom: 1px solid var(--border-subtle);
  font-size: 0.75rem;
}
.herd-row:last-child { border-bottom: none; }
.herd-sector {
  font-weight: 600;
  color: var(--text);
  font-size: 0.78rem;
}
.herd-spark {
  width: 80px;
  height: 16px;
}
.herd-stage {
  font-size: 0.58rem;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 3px;
  text-align: center;
}
/* 板块活跃度（非涨跌）：爆发=烈琥珀，退潮=灰 */
.herd-hot { background: rgba(249, 115, 22, 0.18); color: #fb923c; }
.herd-warm { background: var(--warn-soft); color: var(--warn); }
.herd-cold { background: rgba(107, 114, 128, 0.12); color: #6b7280; }
.herd-stat {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.68rem;
  color: var(--text-dim);
}

/* ── 选股验证 ── */
.fit-section {
  font-size: 0.6rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin: 14px 0 6px;
  font-weight: 600;
}
.fit-row {
  display: grid;
  grid-template-columns: 80px 50px 1fr 1fr;
  align-items: center;
  gap: 8px;
  padding: 6px 0;
  border-bottom: 1px solid var(--border-subtle);
  font-size: 0.75rem;
}
.fit-row:last-child { border-bottom: none; }
.fit-label {
  font-weight: 600;
  color: var(--text);
}
.fit-count {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.68rem;
  color: var(--text-dim);
}
.fit-stat {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.68rem;
  color: var(--text-dim);
}
.fit-stat b {
  color: var(--accent);
  font-weight: 700;
}

/* ── 历史 ── */
.history {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 20px 24px;
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: 12px;
}
.history-label {
  font-size: 0.75rem;
  color: var(--text-quaternary);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  width: 100%;
  margin-bottom: 6px;
  font-weight: 600;
}
.history a {
  font-size: 0.75rem;
  font-family: 'JetBrains Mono', monospace;
  color: var(--text-muted);
  text-decoration: none;
  padding: 6px 12px;
  border-radius: 6px;
  border: 1px solid var(--border-subtle);
  transition: all 0.15s ease;
}
.history a:hover {
  color: var(--accent-interactive);
  border-color: rgba(94, 106, 210, 0.3);
  background: var(--accent-dim);
}
.history a.active {
  color: var(--accent-interactive);
  border-color: rgba(94, 106, 210, 0.4);
  background: var(--accent-dim);
  font-weight: 500;
}

/* ── 状态 ── */
.loading {
  text-align: center;
  padding: 80px 20px;
  color: var(--text-dim);
  font-size: 0.85rem;
}
.error {
  text-align: center;
  padding: 80px 20px;
  color: var(--up);
  font-size: 0.85rem;
}

/* ── 展开/收起按钮 ── */
.show-more-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  padding: 10px;
  margin-top: 12px;
  background: transparent;
  border: 1px dashed var(--border);
  border-radius: 8px;
  color: var(--text-muted);
  font-size: 0.75rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
  font-family: inherit;
}
.show-more-btn:hover {
  background: rgba(255,255,255,0.02);
  border-color: var(--accent);
  color: var(--accent-interactive);
}
.show-more-btn .arrow {
  font-size: 0.625rem;
  transition: transform 0.15s ease;
}
.show-more-btn.expanded .arrow {
  transform: rotate(180deg);
}
/* 折叠隐藏的项目 */
.collapsible-item.hidden {
  display: none;
}

/* ── 动画 ── */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes pulse {
  0%, 100% { opacity: 0.6; }
  50% { opacity: 1; }
}
/* 尊重用户的减少动画偏好：长期每日使用时，加载动画应可被关闭 */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-delay: 0ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}

/* 键盘焦点可见：tab 按钮、历史日期链接、可点击 SVG 单元格默认无焦点环 */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}
/* 元素自带圆角时让 outline 贴合形状 */
a:focus-visible, button:focus-visible {
  outline-offset: 1px;
}
.history {
  animation: fadeUp 0.45s cubic-bezier(0.22, 1, 0.36, 1) both;
}
.history { animation-delay: 0.1s; }

/* ── 资金属性画像 ── */
.cp-summary { display: flex; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.cp-type { font-size: 0.78rem; padding: 2px 8px; border-radius: 4px; font-weight: 600; }
.cp-inst { background: #1a3a5c; color: #5ba3e6; }
.cp-hot { background: #3a1a1a; color: #e65b5b; }
.cp-mixed { background: #2a2a1a; color: #c9b458; }
.cp-unk { background: #222; color: #888; }
.cp-row {
  display: grid;
  grid-template-columns: 48px 90px 42px 1fr 60px 1fr;
  gap: 8px; align-items: center;
  padding: 6px 0; border-bottom: 1px solid var(--border);
  font-size: 0.82rem;
}
.cp-name { font-weight: 600; color: var(--text); }
.cp-conf { color: var(--muted); font-variant-numeric: tabular-nums; }
.cp-seats { color: var(--accent); font-size: 0.78rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cp-dt { color: var(--muted); font-size: 0.78rem; text-align: right; }
.cp-reason { color: var(--muted); font-size: 0.75rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ── 响应式 ── */
@media (max-width: 480px) {
  body { padding: 20px 16px 40px; }
  .density-pct { font-size: 2.6rem; }
  .sector-row { grid-template-columns: 60px 1fr 44px; gap: 8px; }
  section { padding: 18px; }
  .hero-val { font-size: 1.5rem; }
  .hero-stats { gap: 8px; }
  .hero-sep { margin: 0 4px; }
  .section-tabs { overflow-x: auto; }
  .section-tab { min-width: 100px; flex: none; }
}
