/* ==========================================================================
   全球 AI / 科技成长股估值终端 — 样式表
   设计基调：Apple + Linear + TradingView 现代金融终端
   配色克制：浅灰背景、白色卡片、深灰文字，仅在关键状态使用红绿
   ========================================================================== */

:root {
  /* 基础色 */
  --bg: #F7F8FA;
  --card: #FFFFFF;
  --text: #111827;
  --text-sub: #6B7280;
  --text-mute: #9CA3AF;
  --border: rgba(17, 24, 39, 0.08);
  --border-strong: rgba(17, 24, 39, 0.14);

  /* 语义色 */
  --strong-buy: #059669;
  --buy: #10B981;
  --hold: #3B82F6;
  --hold-gray: #64748B;
  --reduce: #EA580C;
  --sell: #DC2626;
  --accent: #2563EB;

  /* 涨跌（中文市场直觉：红涨绿跌） */
  --up: #E1523E;
  --down: #1FA97C;

  --radius: 14px;
  --radius-sm: 9px;
  --shadow-sm: 0 1px 2px rgba(17, 24, 39, 0.04);
  --shadow: 0 1px 3px rgba(17, 24, 39, 0.06), 0 8px 24px rgba(17, 24, 39, 0.04);
  --shadow-lg: 0 12px 40px rgba(17, 24, 39, 0.12);

  --sidebar-w: 208px;
  --header-h: 56px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Segoe UI", Roboto, sans-serif;
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
h1, h2, h3 { margin: 0; font-weight: 600; letter-spacing: -0.01em; }

/* ─────────────────── 布局骨架 ─────────────────── */

.app {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  min-height: 100vh;
}

.sidebar {
  background: var(--card);
  border-right: 1px solid var(--border);
  padding: 18px 12px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}

.brand {
  padding: 4px 10px 18px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 12px;
}
.brand-name { font-size: 15px; font-weight: 700; letter-spacing: -0.02em; }
.brand-sub { font-size: 11px; color: var(--text-mute); margin-top: 2px; }

.nav-group { margin-bottom: 6px; }
.nav-title {
  font-size: 10px;
  color: var(--text-mute);
  letter-spacing: 0.08em;
  padding: 12px 10px 6px;
  text-transform: uppercase;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  border-radius: var(--radius-sm);
  color: var(--text-sub);
  font-size: 13px;
  transition: background 0.14s, color 0.14s;
}
.nav-item:hover { background: rgba(17, 24, 39, 0.04); color: var(--text); }
.nav-item.active { background: rgba(37, 99, 235, 0.09); color: var(--accent); font-weight: 500; }
.nav-dot { width: 5px; height: 5px; border-radius: 50%; background: currentColor; opacity: 0.55; flex: none; }

.shell { display: flex; flex-direction: column; min-width: 0; }

.header {
  height: var(--header-h);
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 22px;
  position: sticky;
  top: 0;
  z-index: 40;
}

.search-wrap { position: relative; flex: 1; max-width: 380px; }
.search-wrap::before {
  content: '🔍';
  position: absolute;
  left: 11px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 12px;
  opacity: 0.55;
}
#search-input {
  width: 100%;
  height: 34px;
  padding: 0 12px 0 30px;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  background: var(--card);
  font-size: 13px;
  color: var(--text);
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
#search-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.btn-primary {
  height: 34px;
  padding: 0 15px;
  border: none;
  border-radius: 8px;
  background: var(--text);
  color: #fff;
  font-size: 13px;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: opacity 0.14s, transform 0.1s;
}
.btn-primary:hover { opacity: 0.86; }
.btn-primary:active { transform: scale(0.98); }

.btn-ghost {
  height: 32px;
  padding: 0 13px;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  background: var(--card);
  color: var(--text-sub);
  font-size: 13px;
  transition: background 0.14s;
}
.btn-ghost:hover { background: rgba(17, 24, 39, 0.04); }

.main { padding: 0 22px 60px; max-width: 1320px; width: 100%; }

/* ─────────────────── Hero ─────────────────── */

.hero {
  padding: 34px 0 26px;
  text-align: center;
}
.hero-badge {
  display: inline-block;
  font-size: 11px;
  color: var(--accent);
  background: rgba(37, 99, 235, 0.08);
  padding: 4px 12px;
  border-radius: 999px;
  letter-spacing: 0.04em;
  margin-bottom: 12px;
}
.hero-title { font-size: 27px; letter-spacing: -0.03em; }
.hero-sub { color: var(--text-sub); font-size: 13px; margin-top: 7px; }
.hero-time { color: var(--text-mute); font-size: 11px; margin-top: 9px; font-variant-numeric: tabular-nums; }

/* ─────────────────── 统计卡 ─────────────────── */

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(148px, 1fr));
  gap: 10px;
  margin-bottom: 28px;
}
.stat-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  box-shadow: var(--shadow-sm);
}
.stat-label { font-size: 11.5px; color: var(--text-sub); }
.stat-value {
  font-size: 22px;
  font-weight: 650;
  margin-top: 4px;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}

/* ─────────────────── 区块 ─────────────────── */

.section { margin-bottom: 30px; }
.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
.section-head h2 { font-size: 15px; }
.section-note { font-size: 11.5px; color: var(--text-mute); }

.panel {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow-sm);
}
.panel-title {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-sub);
  letter-spacing: 0.02em;
  margin-bottom: 12px;
}
.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.empty {
  color: var(--text-mute);
  font-size: 13px;
  text-align: center;
  padding: 22px 0;
}
.muted { color: var(--text-sub); font-size: 12.5px; margin: 0; line-height: 1.75; }

.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

/* ─────────────────── 市场环境 ─────────────────── */

.market-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(122px, 1fr));
  gap: 8px;
}
.market-item {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
}
.market-name { font-size: 11px; color: var(--text-sub); }
.market-value { font-size: 16px; font-weight: 600; margin-top: 2px; font-variant-numeric: tabular-nums; }
.market-change { font-size: 11.5px; font-variant-numeric: tabular-nums; }

.up { color: var(--up); }
.down { color: var(--down); }
.flat { color: var(--text-mute); }

.risk-temp {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
  display: grid;
  grid-template-columns: auto auto 1fr;
  align-items: center;
  gap: 12px;
}
.risk-temp-label { font-size: 12px; color: var(--text-sub); }
.risk-temp-value { font-size: 15px; font-weight: 650; }
.risk-temp-bar {
  height: 6px;
  background: rgba(17, 24, 39, 0.06);
  border-radius: 999px;
  overflow: hidden;
}
.risk-temp-bar span { display: block; height: 100%; border-radius: 999px; }
.risk-temp-factors {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.factor {
  font-size: 11px;
  padding: 3px 9px;
  border-radius: 999px;
  background: rgba(17, 24, 39, 0.05);
  color: var(--text-sub);
}
.factor.positive { background: rgba(5, 150, 105, 0.1); color: var(--strong-buy); }
.factor.negative { background: rgba(220, 38, 38, 0.09); color: var(--sell); }

/* ─────────────────── 今日机会 ─────────────────── */

.opportunity-list { display: flex; flex-direction: column; }
.opportunity-row {
  display: grid;
  grid-template-columns: 62px 1fr 44px 1fr 74px;
  align-items: center;
  gap: 10px;
  padding: 9px 6px;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
  transition: background 0.12s;
}
.opportunity-row:last-child { border-bottom: none; }
.opportunity-row:hover { background: rgba(17, 24, 39, 0.025); }
.op-code { font-weight: 650; letter-spacing: 0.01em; }
.op-name { color: var(--text-sub); font-size: 12.5px; }
.op-score { font-weight: 650; font-variant-numeric: tabular-nums; text-align: right; }
.op-desc { color: var(--text-sub); font-size: 12px; }

.chip-row { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--card);
  font-size: 12px;
  font-weight: 550;
  transition: background 0.12s;
}
.chip:hover { background: rgba(17, 24, 39, 0.04); }
.chip-warn { border-color: rgba(234, 88, 12, 0.28); color: var(--reduce); }
.chip-premium { font-size: 11px; opacity: 0.85; font-variant-numeric: tabular-nums; }

/* ─────────────────── 标签 ─────────────────── */

.tag {
  display: inline-block;
  padding: 2px 9px;
  border-radius: 6px;
  font-size: 11.5px;
  font-weight: 600;
  white-space: nowrap;
}
.tone-strong-buy { background: rgba(5, 150, 105, 0.12); color: var(--strong-buy); }
.tone-buy { background: rgba(16, 185, 129, 0.12); color: var(--buy); }
.tone-hold { background: rgba(59, 130, 246, 0.11); color: var(--hold); }
.tone-reduce { background: rgba(234, 88, 12, 0.12); color: var(--reduce); }
.tone-sell { background: rgba(220, 38, 38, 0.11); color: var(--sell); }
.cat-tag { background: rgba(17, 24, 39, 0.06); color: var(--text-sub); }

/* ─────────────────── 股票池 ─────────────────── */

.tabs {
  display: flex;
  gap: 4px;
  overflow-x: auto;
  padding-bottom: 6px;
  margin-bottom: 10px;
  scrollbar-width: thin;
}
.tab {
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text-sub);
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 12.5px;
  white-space: nowrap;
  transition: all 0.13s;
}
.tab:hover { color: var(--text); border-color: var(--border-strong); }
.tab.on { background: var(--text); border-color: var(--text); color: #fff; }

.sortbar { display: flex; gap: 4px; margin-bottom: 12px; flex-wrap: wrap; }
.sort-btn {
  border: none;
  background: transparent;
  color: var(--text-mute);
  font-size: 12px;
  padding: 4px 9px;
  border-radius: 6px;
  transition: all 0.13s;
}
.sort-btn:hover { color: var(--text); background: rgba(17, 24, 39, 0.04); }
.sort-btn.on { color: var(--accent); background: rgba(37, 99, 235, 0.09); font-weight: 550; }

.switch { display: flex; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.switch-btn {
  border: none;
  background: var(--card);
  color: var(--text-sub);
  font-size: 12px;
  padding: 4px 12px;
  transition: all 0.13s;
}
.switch-btn.on { background: var(--text); color: #fff; }

.pool.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(252px, 1fr));
  gap: 10px;
}
.pool.rows { display: flex; flex-direction: column; gap: 4px; }

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 13px 14px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  transition: box-shadow 0.16s, transform 0.16s, border-color 0.16s;
}
.card:hover {
  box-shadow: var(--shadow);
  transform: translateY(-1px);
  border-color: var(--border-strong);
}
.card-top { display: flex; align-items: flex-start; gap: 8px; }
.card-id { flex: 1; min-width: 0; }
.card-code { font-weight: 650; font-size: 14px; letter-spacing: 0.01em; }
.card-name {
  font-size: 11.5px;
  color: var(--text-sub);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.card-rating {
  font-size: 12px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 6px;
  background: rgba(17, 24, 39, 0.06);
}
.grade-Aplus, .grade-A { background: rgba(5, 150, 105, 0.13); color: var(--strong-buy); }
.grade-Aminus { background: rgba(16, 185, 129, 0.12); color: var(--buy); }
.grade-Bplus { background: rgba(59, 130, 246, 0.11); color: var(--hold); }
.grade-B, .grade-Bminus { background: rgba(100, 116, 139, 0.12); color: var(--hold-gray); }
.grade-Cplus, .grade-C { background: rgba(234, 88, 12, 0.11); color: var(--reduce); }
.grade-D { background: rgba(220, 38, 38, 0.11); color: var(--sell); }

.star {
  border: none;
  background: transparent;
  color: var(--text-mute);
  font-size: 15px;
  line-height: 1;
  padding: 2px;
  transition: color 0.13s, transform 0.13s;
}
.star:hover { transform: scale(1.15); }
.star.on { color: #F59E0B; }
.star.big { font-size: 13px; margin-left: 10px; color: var(--text-mute); }
.star.big.on { color: #F59E0B; }

.card-price-row { display: flex; align-items: baseline; gap: 8px; margin: 10px 0 8px; }
.card-price { font-size: 19px; font-weight: 650; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.card-change { font-size: 12.5px; font-variant-numeric: tabular-nums; }

.card-score { margin-bottom: 10px; }
.card-score-label { font-size: 11px; color: var(--text-sub); }
.card-score-value { font-size: 17px; font-weight: 650; font-variant-numeric: tabular-nums; }
.card-score-max { font-size: 11px; color: var(--text-mute); font-weight: 400; margin-left: 2px; }

.bar {
  height: 5px;
  background: rgba(17, 24, 39, 0.06);
  border-radius: 999px;
  overflow: hidden;
  margin-top: 5px;
}
.bar span {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #2563EB, #60A5FA);
  transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.card-meta { display: flex; flex-direction: column; gap: 4px; margin-bottom: 10px; }
.card-meta > div { display: flex; justify-content: space-between; font-size: 12px; }
.meta-label { color: var(--text-sub); }
.meta-value { font-weight: 550; font-variant-numeric: tabular-nums; }

.card-link {
  margin-top: auto;
  font-size: 12.5px;
  color: var(--accent);
  font-weight: 550;
  padding-top: 8px;
  border-top: 1px solid var(--border);
}

/* 列表模式 */
.row {
  display: grid;
  grid-template-columns: 26px 1.6fr 1fr 0.8fr 1fr 78px;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 13px;
  transition: border-color 0.14s, box-shadow 0.14s;
}
.row:hover { border-color: var(--border-strong); box-shadow: var(--shadow-sm); }
.row-id { display: flex; flex-direction: column; }
.row-code { font-weight: 650; }
.row-name { font-size: 11.5px; color: var(--text-sub); }
.row-cell { display: flex; flex-direction: column; align-items: flex-end; font-variant-numeric: tabular-nums; }
.row-cell small { font-size: 11px; color: var(--text-mute); }
.row-score strong { font-size: 15px; }

/* ─────────────────── 排行榜 ─────────────────── */

.rank-list { display: flex; flex-direction: column; }
.rank-row {
  display: grid;
  grid-template-columns: 26px 62px 1fr 120px 42px 34px;
  align-items: center;
  gap: 10px;
  padding: 8px 4px;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}
.rank-row:last-child { border-bottom: none; }
.rank-row:hover { background: rgba(17, 24, 39, 0.025); }
.rank-no { color: var(--text-mute); font-variant-numeric: tabular-nums; font-size: 12px; }
.rank-code { font-weight: 650; }
.rank-name { color: var(--text-sub); font-size: 12px; }
.rank-bar { height: 5px; background: rgba(17, 24, 39, 0.06); border-radius: 999px; overflow: hidden; }
.rank-bar i { display: block; height: 100%; background: linear-gradient(90deg, #2563EB, #60A5FA); border-radius: 999px; }
.rank-score { text-align: right; font-weight: 650; font-variant-numeric: tabular-nums; }
.rank-grade { font-size: 11px; color: var(--text-sub); text-align: center; }

.val-row {
  display: grid;
  grid-template-columns: 58px 1fr auto 92px 58px;
  align-items: center;
  gap: 8px;
  padding: 7px 4px;
  border-bottom: 1px solid var(--border);
  font-size: 12.5px;
}
.val-row:last-child { border-bottom: none; }
.val-row:hover { background: rgba(17, 24, 39, 0.025); }
.val-code { font-weight: 650; }
.val-name { color: var(--text-sub); font-size: 11.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.val-price, .val-fv, .val-diff { font-variant-numeric: tabular-nums; text-align: right; }
.val-fv { color: var(--text-sub); font-size: 11.5px; }
.val-diff { font-weight: 600; }

.custom-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}
.custom-row:last-child { border-bottom: none; }

/* ─────────────────── 详情页 ─────────────────── */

.detail { padding-top: 22px; }

.detail-header {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 28px;
  align-items: flex-start;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border);
}
.detail-id h1 { font-size: 25px; letter-spacing: -0.03em; }
.detail-code { font-size: 14px; color: var(--text-sub); margin: 2px 0 8px; font-weight: 550; letter-spacing: 0.02em; }

.detail-price { text-align: right; }
.dp-value { font-size: 30px; font-weight: 680; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.dp-change { font-size: 13px; font-variant-numeric: tabular-nums; margin-top: 1px; }
.dp-perf {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  margin-top: 9px;
  font-size: 11.5px;
  color: var(--text-sub);
}
.dp-perf b { font-variant-numeric: tabular-nums; }

.detail-score {
  text-align: center;
  padding: 14px 22px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  min-width: 172px;
}
.ds-label { font-size: 11px; color: var(--text-sub); }
.ds-value { font-size: 34px; font-weight: 700; letter-spacing: -0.035em; line-height: 1.15; font-variant-numeric: tabular-nums; }
.ds-value span { font-size: 14px; color: var(--text-mute); font-weight: 400; }
.ds-grade { font-size: 12px; color: var(--text-sub); }
.ds-action {
  margin: 9px auto 0;
  display: inline-block;
  padding: 4px 14px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 650;
}
.ds-headline { font-size: 11px; color: var(--text-sub); margin-top: 8px; line-height: 1.5; }

.detail-metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 8px;
  margin: 18px 0 12px;
}
.metric {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 11px 13px;
}
.m-label { font-size: 11px; color: var(--text-sub); }
.m-value { font-size: 17px; font-weight: 620; margin-top: 2px; font-variant-numeric: tabular-nums; }

.detail-reasons { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 18px; }
.reason {
  font-size: 11.5px;
  padding: 4px 11px;
  border-radius: 999px;
  background: rgba(17, 24, 39, 0.05);
  color: var(--text-sub);
}

.detail-grid {
  display: grid;
  grid-template-columns: 1.25fr 1fr;
  gap: 12px;
  margin-bottom: 12px;
}

/* 评分条 */
.score-panel .sbar { margin-bottom: 12px; }
.score-panel .sbar:last-child { margin-bottom: 0; }
.sbar-head { display: flex; justify-content: space-between; align-items: baseline; font-size: 12.5px; }
.sbar-label { color: var(--text-sub); display: inline-flex; align-items: center; gap: 6px; }
.sbar-value { font-weight: 650; font-variant-numeric: tabular-nums; }
.sbar.highlight .sbar-label { color: var(--text); font-weight: 600; }
.sbar.highlight .sbar-value { color: var(--accent); font-size: 14px; }
.sbar.highlight .bar { height: 8px; }
.sbar.highlight .bar span { background: linear-gradient(90deg, #2563EB, #818CF8); }
.sbar-badge {
  font-style: normal;
  font-size: 9.5px;
  background: rgba(37, 99, 235, 0.12);
  color: var(--accent);
  padding: 1px 7px;
  border-radius: 999px;
  letter-spacing: 0.02em;
}

.radar-panel { display: flex; flex-direction: column; align-items: center; }
#radar { width: 240px; height: 240px; }
.radar-note { font-size: 11px; color: var(--text-mute); margin-top: auto; }

/* 三情景价值 */
.fv-panel { margin-bottom: 12px; }
.fv-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.fv-cell {
  text-align: center;
  padding: 13px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}
.fv-cell.bear { background: rgba(220, 38, 38, 0.045); border-color: rgba(220, 38, 38, 0.14); }
.fv-cell.base { background: rgba(37, 99, 235, 0.05); border-color: rgba(37, 99, 235, 0.16); }
.fv-cell.bull { background: rgba(5, 150, 105, 0.05); border-color: rgba(5, 150, 105, 0.16); }
.fv-label { font-size: 11.5px; color: var(--text-sub); }
.fv-num { font-size: 21px; font-weight: 650; margin-top: 3px; font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }
.fv-method { font-size: 11.5px; color: var(--text-mute); margin-top: 11px; text-align: center; }

/* 价格区间条 */
.zone-panel { margin-bottom: 12px; }
.zone-bar-wrap { padding-top: 4px; }
.zone-marks {
  display: flex;
  justify-content: space-between;
  font-size: 10.5px;
  color: var(--text-mute);
  margin-bottom: 5px;
  font-variant-numeric: tabular-nums;
}
.zone-bar {
  position: relative;
  height: 34px;
  border-radius: 8px;
  overflow: visible;
  background: rgba(17, 24, 39, 0.03);
}
.zseg { position: absolute; top: 0; bottom: 0; }
.zseg.strong-buy { background: rgba(5, 150, 105, 0.3); }
.zseg.buy { background: rgba(16, 185, 129, 0.2); }
.zseg.hold { background: rgba(59, 130, 246, 0.13); }
.zseg.reduce { background: rgba(234, 88, 12, 0.2); }
.zseg.sell { background: rgba(220, 38, 38, 0.26); }

.base-marker, .current-marker {
  position: absolute;
  top: -4px;
  bottom: -4px;
  width: 2px;
}
.base-marker { background: var(--text-sub); }
.base-marker span, .current-marker span {
  position: absolute;
  top: -19px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 10.5px;
  white-space: nowrap;
  padding: 1px 7px;
  border-radius: 5px;
  font-variant-numeric: tabular-nums;
}
.base-marker span { background: rgba(100, 116, 139, 0.16); color: #475569; }
.current-marker { background: var(--text); }
.current-marker span { background: var(--text); color: #fff; font-weight: 600; }

.zone-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 22px;
  font-size: 11.5px;
  color: var(--text-sub);
}
.zone-note { font-size: 11px; color: var(--text-mute); margin-top: 7px; }

/* K 线 */
.chart-panel { margin-bottom: 12px; }
.range-switch { display: flex; gap: 2px; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.range-btn {
  border: none;
  background: var(--card);
  color: var(--text-sub);
  font-size: 11.5px;
  padding: 4px 9px;
  transition: all 0.12s;
}
.range-btn:hover { background: rgba(17, 24, 39, 0.04); }
.range-btn.on { background: var(--text); color: #fff; }

.chart-overlays {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 10px 0 8px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}
.overlay-toggle {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11.5px;
  color: var(--text-sub);
  cursor: pointer;
  user-select: none;
}
.overlay-toggle input { accent-color: var(--accent); margin: 0; }

.chart-wrap {
  height: 340px;
  position: relative;
  border-radius: var(--radius-sm);
  overflow: hidden;
}
#kline { display: block; width: 100%; height: 100%; }

.crosshair-info {
  font-size: 11.5px;
  color: var(--text-sub);
  margin-top: 8px;
  min-height: 20px;
  font-variant-numeric: tabular-nums;
}
.crosshair-info b { color: var(--text); font-weight: 600; margin-right: 10px; }

/* 价格状态 */
.status-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(112px, 1fr));
  gap: 8px;
}
.st {
  display: flex;
  flex-direction: column;
  gap: 1px;
  padding: 9px 11px;
  border-radius: var(--radius-sm);
  background: rgba(17, 24, 39, 0.025);
  font-size: 11.5px;
  color: var(--text-sub);
}
.st b { font-size: 15px; color: var(--text); font-weight: 620; font-variant-numeric: tabular-nums; }
.st b.up { color: var(--up); }
.st b.down { color: var(--down); }

/* 投资逻辑 */
.logic-block { margin-bottom: 13px; }
.logic-title { font-size: 12.5px; font-weight: 600; margin-bottom: 6px; }
.logic-list { margin: 0; padding-left: 19px; font-size: 12.5px; color: var(--text-sub); line-height: 1.85; }
.logic-list.core li::marker { color: var(--strong-buy); font-weight: 700; }
.logic-list.risk li::marker { color: var(--reduce); font-weight: 700; }
.logic-note { font-size: 11px; color: var(--text-mute); border-top: 1px solid var(--border); padding-top: 9px; }

/* 基本面 */
.fund-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(128px, 1fr));
  gap: 7px;
}
.f {
  display: flex;
  flex-direction: column;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  background: rgba(17, 24, 39, 0.025);
  font-size: 11px;
  color: var(--text-sub);
}
.f b { font-size: 14px; color: var(--text); font-weight: 620; font-variant-numeric: tabular-nums; }
.f b.up { color: var(--up); }
.f b.down { color: var(--down); }

/* 假设 */
.assump-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}
.as {
  padding: 9px 11px;
  border-radius: var(--radius-sm);
  background: rgba(17, 24, 39, 0.025);
  font-size: 11.5px;
  color: var(--text-sub);
}
.as b { display: block; font-size: 15px; color: var(--text); font-variant-numeric: tabular-nums; }

/* 历史 */
.score-history svg { display: block; }
.history-note { font-size: 11.5px; color: var(--text-sub); margin-top: 6px; }

.vh-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}
.vh-cell {
  padding: 9px 11px;
  border-radius: var(--radius-sm);
  background: rgba(17, 24, 39, 0.025);
  font-size: 11px;
  color: var(--text-sub);
}
.vh-cell b { display: block; font-size: 16px; color: var(--text); font-variant-numeric: tabular-nums; }
.vh-bar {
  position: relative;
  height: 8px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(5,150,105,0.2), rgba(59,130,246,0.2), rgba(234,88,12,0.22));
  overflow: visible;
}
.vh-fill { display: block; height: 100%; border-radius: 999px; opacity: 0.32; }
.vh-marker {
  position: absolute;
  top: -4px;
  width: 3px;
  height: 16px;
  background: var(--text);
  border-radius: 2px;
  transform: translateX(-50%);
}
.vh-note { font-size: 11.5px; color: var(--text-sub); margin-top: 8px; }

/* ─────────────────── Modal ─────────────────── */

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(17, 24, 39, 0.42);
  backdrop-filter: blur(3px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 20px;
}
.modal-backdrop.show { display: flex; }

.modal {
  background: var(--card);
  border-radius: 16px;
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 440px;
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: modal-in 0.18s cubic-bezier(0.34, 1.3, 0.64, 1);
}
@keyframes modal-in {
  from { opacity: 0; transform: translateY(12px) scale(0.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 18px;
  border-bottom: 1px solid var(--border);
}
.modal-head h3 { font-size: 15px; }
.modal-close {
  border: none;
  background: rgba(17, 24, 39, 0.05);
  color: var(--text-sub);
  width: 26px;
  height: 26px;
  border-radius: 7px;
  font-size: 17px;
  line-height: 1;
}
.modal-close:hover { background: rgba(17, 24, 39, 0.1); }

.modal-body { padding: 18px; overflow-y: auto; }
.modal-foot {
  padding: 14px 18px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  background: rgba(247, 248, 250, 0.6);
}

.field { margin-bottom: 13px; }
.field label { display: block; font-size: 12px; color: var(--text-sub); margin-bottom: 5px; }
.field input[type="text"] {
  width: 100%;
  height: 36px;
  padding: 0 11px;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  font-size: 13.5px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.field input[type="text"]:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}
.field input[type="range"] { width: 100%; accent-color: var(--accent); }
.field-out { float: right; font-size: 12px; color: var(--text); font-weight: 600; font-variant-numeric: tabular-nums; }

.or-line {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 12px 0;
  color: var(--text-mute);
  font-size: 11px;
}
.or-line::before, .or-line::after { content: ''; flex: 1; height: 1px; background: var(--border); }

.divider { height: 1px; background: var(--border); margin: 14px 0; }

.check {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  margin-bottom: 8px;
  color: var(--text);
  cursor: pointer;
}
.check input { accent-color: var(--accent); width: 15px; height: 15px; margin: 0; }

.radio-group { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.radio {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 12.5px;
  padding: 7px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.13s;
}
.radio:has(input:checked) {
  border-color: var(--accent);
  background: rgba(37, 99, 235, 0.06);
  color: var(--accent);
  font-weight: 550;
}
.radio input { accent-color: var(--accent); margin: 0; }

.add-result { margin-top: 14px; }
.alert {
  padding: 12px;
  border-radius: 10px;
  font-size: 12.5px;
  line-height: 1.75;
}
.alert.success { background: rgba(5, 150, 105, 0.08); border: 1px solid rgba(5, 150, 105, 0.2); }
.alert.error { background: rgba(220, 38, 38, 0.07); border: 1px solid rgba(220, 38, 38, 0.2); color: var(--sell); }
.ar-row { color: var(--text-sub); margin-top: 3px; }
.ar-row b { color: var(--text); }
.ar-hint { color: var(--text-mute); font-size: 11.5px; margin-top: 6px; }
.alert .btn-primary { margin-top: 10px; }

/* ─────────────────── 移动端底部导航 ─────────────────── */

.mobile-nav { display: none; }

/* ─────────────────── 响应式 ─────────────────── */

@media (max-width: 1024px) {
  .detail-grid { grid-template-columns: 1fr; }
  .two-col { grid-template-columns: 1fr; }
}

@media (max-width: 820px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .main { padding: 0 14px 92px; }
  .header { padding: 0 14px; gap: 10px; }
  .hero { padding: 24px 0 18px; }
  .hero-title { font-size: 21px; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .detail-header { grid-template-columns: 1fr; gap: 16px; }
  .detail-price { text-align: left; }
  .dp-perf { justify-content: flex-start; }
  .detail-score { text-align: left; min-width: 0; }
  .ds-action { margin-left: 0; }
  .fv-row { grid-template-columns: 1fr; }
  .chart-wrap { height: 250px; }
  .pool.grid { grid-template-columns: 1fr; }
  .row { grid-template-columns: 26px 1fr auto auto; }
  .row-cell.row-fv, .row-cell:last-child { display: none; }
  .opportunity-row { grid-template-columns: 54px 1fr 38px 66px; }
  .op-desc { display: none; }

  .mobile-nav {
    display: flex;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 58px;
    background: rgba(255, 255, 255, 0.94);
    backdrop-filter: saturate(180%) blur(14px);
    border-top: 1px solid var(--border);
    z-index: 50;
  }
  .mobile-nav button {
    flex: 1;
    border: none;
    background: transparent;
    color: var(--text-mute);
    font-size: 10.5px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
  }
  .mobile-nav button.active { color: var(--accent); }
  .mobile-nav .mn-icon { font-size: 17px; }
}

@media (max-width: 480px) {
  .stat-grid { grid-template-columns: 1fr 1fr; }
  .stat-value { font-size: 19px; }
  .radio-group { grid-template-columns: 1fr; }
  .risk-temp { grid-template-columns: 1fr; }
}

/* ══════════════════════════════════════════════════════════
   数据来源徽标 —— 让用户随时知道当前价格是实时还是内置
   ══════════════════════════════════════════════════════════ */

.data-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  color: var(--text-sub);
  background: rgba(17, 24, 39, 0.05);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 4px 11px;
  white-space: nowrap;
  cursor: default;
  transition: all 0.2s;
}
.data-badge .db-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  flex: none;
}
.data-badge.loading { color: var(--text-mute); }
.data-badge.loading .db-dot { animation: pulse 1.2s ease-in-out infinite; }
.data-badge.live {
  color: var(--strong-buy);
  background: rgba(5, 150, 105, 0.08);
  border-color: rgba(5, 150, 105, 0.22);
}
.data-badge.live .db-dot { animation: pulse 2s ease-in-out infinite; }
.data-badge.warn {
  color: var(--reduce);
  background: rgba(234, 88, 12, 0.08);
  border-color: rgba(234, 88, 12, 0.24);
}
.data-badge.seed {
  color: var(--sell);
  background: rgba(220, 38, 38, 0.07);
  border-color: rgba(220, 38, 38, 0.22);
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.35; }
}

/* 详情页价格来源 */
.price-src {
  font-size: 11px;
  margin-top: 5px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.price-src.live { color: var(--strong-buy); }
.price-src.seed {
  color: var(--sell);
  background: rgba(220, 38, 38, 0.07);
  padding: 2px 8px;
  border-radius: 5px;
  font-weight: 500;
}

/* 移动端：数据徽标独占一行，避免挤压搜索框 */
@media (max-width: 820px) {
  .data-badge { font-size: 10.5px; padding: 3px 9px; }
  .data-badge .db-dot { width: 5px; height: 5px; }
}

/* 添加股票：加载态与警告态 */
.alert.loading {
  background: rgba(37, 99, 235, 0.06);
  border: 1px solid rgba(37, 99, 235, 0.2);
  color: var(--accent);
}
.alert.loading::after {
  content: '';
  display: inline-block;
  width: 10px;
  height: 10px;
  margin-left: 7px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  vertical-align: -1px;
}
@keyframes spin { to { transform: rotate(360deg); } }

.alert.warn {
  background: rgba(234, 88, 12, 0.07);
  border: 1px solid rgba(234, 88, 12, 0.26);
}
.ar-warn { color: var(--reduce); font-weight: 500; }

.btn-primary:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

/* 详情页加载态：数据未就绪时不展示任何价格，避免误导 */
.detail-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 90px 20px;
  text-align: center;
}
.spinner {
  width: 26px;
  height: 26px;
  border: 2.5px solid rgba(37, 99, 235, 0.2);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.75s linear infinite;
}
.dl-text { font-size: 13.5px; color: var(--text-sub); }
.dl-error { color: var(--sell); }

/* 详情页：明确标注涨跌幅的计算基准（昨收），避免口径歧义 */
.dp-prev {
  font-size: 11px;
  color: var(--text-mute);
  font-variant-numeric: tabular-nums;
  margin-top: 1px;
}

/* 市场环境：加载态与不可用态 */
.market-item.is-loading .market-value.skeleton {
  color: var(--text-mute);
  background: linear-gradient(90deg, rgba(17,24,39,0.04) 25%, rgba(17,24,39,0.08) 50%, rgba(17,24,39,0.04) 75%);
  background-size: 200% 100%;
  animation: skeleton 1.4s ease-in-out infinite;
  border-radius: 5px;
  min-width: 62px;
}
.market-item.is-loading .market-change,
.market-item.is-error .market-change {
  color: var(--text-mute);
  font-size: 10.5px;
}
.market-item.is-error .market-value {
  color: var(--text-mute);
}
@keyframes skeleton {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* 空状态：自选为空时给出明确引导 */
.empty-title {
  font-size: 14px;
  font-weight: 550;
  color: var(--text-sub);
  margin-bottom: 6px;
}
.empty-hint {
  font-size: 12.5px;
  color: var(--text-mute);
  line-height: 1.7;
  max-width: 340px;
  margin: 0 auto;
}

/* 评分变化归因 */
.attribution-list { display: flex; flex-direction: column; gap: 10px; }
.attribution-item {
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: rgba(17, 24, 39, 0.025);
  font-size: 12.5px;
}
.ai-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 5px;
}
.ai-head span { font-variant-numeric: tabular-nums; font-weight: 550; }
.ai-reasons { display: flex; flex-wrap: wrap; gap: 6px; }
.ai-reasons span {
  font-size: 11px;
  color: var(--text-sub);
  background: rgba(17, 24, 39, 0.05);
  padding: 2px 8px;
  border-radius: 999px;
}

/* 统计卡副标题：说明该数字的口径，避免与卡片角标产生歧义 */
.stat-sub {
  font-size: 10.5px;
  color: var(--text-mute);
  margin-top: 2px;
  line-height: 1.4;
}
