:root {
  --bg: #eef1f7;
  --bg-grad: linear-gradient(180deg, #f5f7fb 0%, #eaeef6 100%);
  --card: #ffffff;
  --text: #1f2937;
  --title: #0f172a;
  --muted: #64748b;
  --border: #e7ebf2;
  /* ---------- A股涨跌色：两套语义，别混用 ----------
     · 图形/填充（K线蜡烛、涨跌家数条、色块）—— WCAG 对图形只要求 3:1，
       保持鲜亮，A股的「红红绿绿」才立得住。
     · 文本（.up/.down 以及一切带涨跌色的数字）—— 白底必须 ≥4.5:1。
     初版只有一套色，结果白字落在 --down 上只有 3.38:1：排行榜涨跌、
     指标卡、详情页建仓价位的绿色数字全都不达 AA，又是绿的这样一来
     用户只能靠猜哪个数字是「跌」。 */
  --up: #e23b3b;        /* A股惯例：涨 = 红 */
  --up-text: #c9302a;   /* 白底 5.36:1 · #f1f5f9 上 4.89:1 */
  --up-bg: rgba(226, 59, 59, 0.10);
  --down: #15a05a;      /* A股惯例：跌 = 绿 */
  --down-text: #107f4b; /* 白底 5.05:1 · #f1f5f9 上 4.61:1 */
  --down-bg: rgba(21, 160, 90, 0.10);
  /* 次要文字：原先 #64748b 在 #f1f5f9 底（.chip / .kd / tab）上只有 4.34:1，
     同样是差一点点。压深一档后白底 5.74:1，灰底 5.24:1。 */
  --muted: #5b6779;
  --flat-bg: rgba(100, 116, 139, 0.10);
  /* 「平」的填充色。⚠️ 必须存在：.breadth-bar .flat / .verdict 都用 var(--flat)，
     早先只定义了 --flat-bg，这两个 var(--flat) 解析为 invalid →
     平盘段无底色，而 .breadth-bar 自身是 color:#fff，白字压底几乎不可读。
     白字在其上对比度 4.76:1（与 324 行注释口径一致）。 */
  --flat: #64748b;
  --accent: #4f46e5;
  --accent-soft: #eef2ff;
  --info: #2563eb;
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, .06);
  --shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 10px 30px rgba(16, 24, 40, .07);
  --radius: 16px;
  --radius-sm: 10px;
  /* 顶栏基准高度：排行表 sticky 表头要贴在这条线下面。
     抽成变量是为了让「顶栏高度」与「表头偏移」只有一个来源 ——
     原先表头写死 top:56px，改顶栏内边距时两边就悄悄错位。 */
  --topbar-h: 56px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  background: var(--bg-grad) fixed;
  color: var(--text);
  line-height: 1.55;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* 数值等宽，避免跳动 */
.value, .breadth-stats b, .rank-row, .mt-row, .index-card .value {
  font-variant-numeric: tabular-nums;
}

/* ---------- 顶栏 ---------- */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  padding: 14px 22px;
  min-height: var(--topbar-h);
  background: linear-gradient(100deg, #0f172a 0%, #1e293b 55%, #312e81 100%);
  color: #fff;
  position: sticky;
  top: 0;
  z-index: 10;
  box-shadow: 0 2px 14px rgba(15, 23, 42, .25);
}
.brand {
  font-size: 18px;
  font-weight: 800;
  letter-spacing: .5px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.status { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; font-size: 13px; }
.status .muted { color: #cbd5e1; }
.status b { color: #fff; font-weight: 600; }

.badge {
  display: inline-block;
  padding: 3px 11px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
}
.badge-info { background: rgba(96, 165, 250, .22); color: var(--info); }
/* 标签底色都用了淡色底 + 深色字（WCAG AA 4.5:1），别再退回 #dbeafe 那种近白字 */
.badge-ok { background: rgba(22, 163, 74, .16); color: #15803d; }
.pos-cov { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 6px; }
.pos-cov .muted { font-size: 12px; }

.btn {
  background: #fff;
  color: #0f172a;
  border: none;
  border-radius: 9px;
  padding: 7px 16px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: transform .12s ease, background .15s ease, box-shadow .15s ease;
  box-shadow: 0 1px 4px rgba(0, 0, 0, .2);
}
.btn:hover { background: #eef2ff; transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn:disabled { opacity: .5; cursor: default; transform: none; }

#refreshState { animation: rstate-pulse 1.4s ease-in-out infinite; }

/* ---------- 提示条 ---------- */
.offline {
  background: #fef3c7;
  color: #92400e;
  padding: 9px 22px;
  font-size: 13px;
  text-align: center;
  font-weight: 600;
}
.fresh-warn {
  background: #fee2e2;
  color: #991b1b;
  padding: 9px 22px;
  font-size: 13px;
  font-weight: 700;
  text-align: center;
}
.empty-box { padding: 14px 8px; font-size: 13px; color: var(--muted); }

/* 八道门数据时效条（#masterFresh）：把「榜单生成时间 / 股价取数日 / 财报基准年」
   显式摆出来。榜单每天才跑一次，不标时间用户会当成实时数据。 */
.fresh-line {
  margin: 0 0 10px;
  padding: 6px 10px;
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: 4px;
  color: #92400e;
  font-size: 12px;
  line-height: 1.7;
}
/* 价格列尾部的小字日期（MM-DD）。窄屏沿用 .rank-hide-sm 收起，价格本身保留。 */
.px-date {
  font-style: normal;
  margin-left: 3px;
  opacity: 0.65;
  font-size: 10.5px;
}
.fx { white-space: nowrap; }
.fx-sep { margin: 0 7px; opacity: 0.45; }
.px-warn { color: var(--up-text); font-weight: 700; }

/* 股本推算风险标记（2026-09-26）：市值/PE/PB/股息率由「股价 × 股本」推出，
   股本算错时这些会一起失真。挂在榜单名称列后面，不占额外列宽；
   ⚠️ 深底浅字 —— 与「涨」相反，取琥珀色，避免和红涨绿跌的颜色语义撞车。 */
.risk-mark {
  margin-left: 5px;
  padding: 0 4px;
  border-radius: 3px;
  font-size: 10px;
  line-height: 15px;
  white-space: nowrap;
  color: #7c4a03;
  background: #ffe9b8;
  border: 1px solid #e0b34d;
  vertical-align: 1px;
}
.has-risk .rank-name { color: inherit; }

/* ---------- 公司事件提醒标签 ---------- */
.event-tag {
  display: inline-block;
  margin-left: 4px;
  padding: 0 5px;
  border-radius: 3px;
  font-size: 10px;
  line-height: 16px;
  white-space: nowrap;
  vertical-align: 1px;
  cursor: help;
}
.event-positive {
  color: #0a5c36;
  background: #d4edda;
  border: 1px solid #8fd6a5;
}
.event-negative {
  color: #7a1a1a;
  background: #f8d7da;
  border: 1px solid #e8a5a5;
}
.event-mixed {
  color: #7a5a00;
  background: #fff3cd;
  border: 1px solid #e8c84a;
}

/* ---------- 右侧固定区块导航 ---------- */
html { scroll-behavior: smooth; }
.card[id] { scroll-margin-top: calc(var(--topbar-h, 64px) + 16px); }

.side-nav {
  position: fixed;
  right: 26px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 9;
}
.side-nav a {
  display: block;
  padding: 7px 16px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  text-align: center;
  color: var(--muted, #64748b);
  background: rgba(255, 255, 255, .88);
  border: 1px solid var(--border, #e2e8f0);
  text-decoration: none;
  backdrop-filter: blur(6px);
  transition: color .18s ease, border-color .18s ease, background .18s ease, box-shadow .18s ease;
}
.side-nav a:hover {
  color: var(--accent, #4f46e5);
  border-color: var(--accent, #4f46e5);
}
.side-nav a.active {
  color: #fff;
  background: linear-gradient(100deg, var(--accent, #4f46e5), #818cf8);
  border-color: transparent;
  box-shadow: 0 2px 10px rgba(79, 70, 229, .35);
}
/* 内容区 1240 + 左右余量：屏宽不足时隐藏，避免遮挡内容 */
@media (max-width: 1479px) {
  .side-nav { display: none; }
}

/* ---------- 主体 ---------- */
.container {
  max-width: 1240px;
  margin: 22px auto;
  padding: 0 18px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px 22px;
  transition: box-shadow .2s ease, transform .2s ease;
}
.card:hover { box-shadow: 0 4px 10px rgba(16,24,40,.08), 0 14px 38px rgba(16,24,40,.10); }
.card h2 {
  margin: 0 0 16px;
  font-size: 17px;
  font-weight: 800;
  color: var(--title);
  position: relative;
  padding-left: 13px;
}
.card h2::before {
  content: "";
  position: absolute;
  left: 0; top: 3px; bottom: 3px;
  width: 4px; border-radius: 4px;
  background: linear-gradient(180deg, var(--accent), #818cf8);
}
.card h3 { margin: 18px 0 10px; font-size: 14px; color: var(--title); font-weight: 700; }

.grid { display: grid; gap: 14px; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 760px) {
  .grid-3 { grid-template-columns: 1fr; }
  .two-col { grid-template-columns: 1fr !important; }
}
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }

/* ---------- 指数卡片 ---------- */
.index-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px 14px;
  text-align: center;
  background: linear-gradient(180deg, #ffffff, #fbfcfe);
  transition: transform .15s ease, box-shadow .15s ease;
}
.index-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-sm); }
.index-card .name { font-size: 13px; color: var(--muted); font-weight: 600; }
.index-card .value { font-size: 27px; font-weight: 800; margin: 7px 0 8px; color: var(--title); }
.index-card .chg {
  display: inline-block;
  font-size: 13px; font-weight: 700;
  padding: 3px 10px; border-radius: 999px;
}
/* 淡底 + 同色字：底色是 rgba(...0.10)，必须用文本色，
   用鲜亮 --up/--down 会在淡底上掉到 3.9:1。 */
.chg.up { background: var(--up-bg); color: var(--up-text); }
.chg.down { background: var(--down-bg); color: var(--down-text); }
.chg.flat { background: var(--flat-bg); color: var(--muted); }

/* ---------- 涨跌家数 ---------- */
.breadth { margin-top: 18px; }
.breadth-bar {
  display: flex;
  height: 24px;
  border-radius: 8px;
  overflow: hidden;
  font-size: 11px;
  font-weight: 700;
  color: #fff;
  box-shadow: inset 0 0 0 1px rgba(0,0,0,.04);
}
/* 涨跌家数条：色块是图形（3:1 即达标）但**上面压着白字**，
   所以这里用文本色 —— 白字落在鲜亮绿 #15a05a 上只有 3.38:1，不够。 */
.breadth-bar .up { background: var(--up-text); }
.breadth-bar .down { background: var(--down-text); }
.breadth-bar .flat { background: var(--flat); }
.breadth-stats { display: flex; gap: 20px; flex-wrap: wrap; margin-top: 10px; font-size: 13px; color: var(--muted); }
.breadth-stats b { color: var(--text); }
.breadth-stats .sub { font-style: normal; font-size: 11px; color: var(--muted); margin-left: 4px; }

/* ---------- 市场情绪仪表（自建合成，非官方恐慌指数） ---------- */
.mood-gauge {
  margin-top: 14px; border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 14px 16px; background: #fcfdff;
}
.mg-head { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.mg-score { font-size: 30px; font-weight: 800; line-height: 1; font-variant-numeric: tabular-nums; }
.mg-score .mg-unit { font-size: 12px; font-weight: 600; color: var(--muted); margin-left: 2px; }
.mg-score.up { color: var(--up-text); }
.mg-score.down { color: var(--down-text); }
.mg-score.flat { color: var(--muted); }
.mg-band { font-size: 12px; font-weight: 700; padding: 3px 10px; border-radius: 999px; }
.mg-band.up { background: var(--up-bg); color: var(--up-text); }
.mg-band.down { background: var(--down-bg); color: var(--down-text); }
.mg-band.flat { background: var(--flat-bg); color: var(--muted); }
.mg-note { font-size: 11px; color: var(--muted); margin-left: auto; }
.mg-note b { color: var(--text); }
.mg-parts { margin-top: 10px; display: flex; flex-direction: column; gap: 4px; }
.mg-row {
  display: flex; align-items: center; gap: 10px; font-size: 12px;
  padding: 5px 0; border-top: 1px dashed var(--border);
}
.mg-row .k { flex: 1 1 auto; color: var(--muted); }
.mg-row .k i { font-style: normal; margin-left: 6px; opacity: .75; }
.mg-row .v { flex: 0 0 auto; color: var(--text); font-weight: 600; font-variant-numeric: tabular-nums; }
.mg-row .s { flex: 0 0 74px; text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; }
.mg-row .s i { font-style: normal; font-weight: 400; color: var(--muted); margin-left: 4px; }
.mg-foot { margin-top: 10px; font-size: 11px; color: var(--muted); line-height: 1.6; }
/* 地量警示条（2026-09-30）：成交额跌进近一年极值区间时点名提醒 */
.mg-dry {
  margin-top: 10px; padding: 8px 12px; border-radius: var(--radius-sm);
  background: var(--down-bg); color: var(--down-text);
  font-size: 12px; font-weight: 600; line-height: 1.5;
}

/* ---------- 列表（新闻） ---------- */
.list { display: flex; flex-direction: column; gap: 11px; }
.item { border-bottom: 1px dashed var(--border); padding-bottom: 11px; }
.item:last-child { border-bottom: none; padding-bottom: 0; }
.item .line1 { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; }
.item .title { font-weight: 700; color: var(--title); font-size: 14px; }
.item .meta { font-size: 12px; color: var(--muted); white-space: nowrap; }
.item .summary { font-size: 13px; color: #475569; margin-top: 5px; line-height: 1.5; }
.item a { color: var(--info); text-decoration: none; font-weight: 600; }
.item a:hover { text-decoration: underline; }

/* ---------- 板块行 ---------- */
.row {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; padding: 8px 4px; border-bottom: 1px dashed var(--border); font-size: 14px;
}
.row:last-child { border-bottom: none; }
.row .nm { font-weight: 700; color: var(--title); }
.row .sub { font-size: 12px; color: var(--muted); }
.tag {
  font-weight: 800; padding: 3px 10px; border-radius: 999px; font-size: 13px;
}
.tag.up { background: var(--up-bg); color: var(--up-text); }
.tag.down { background: var(--down-bg); color: var(--down-text); }
.tag.flat { background: var(--flat-bg); color: var(--muted); }
.leader { font-size: 12px; color: var(--muted); margin-left: auto; text-align: right; }

/* ---------- 涨/跌/平 通用色（保持 A股 红涨绿跌） ----------
   这三个是「文字」语义，所以走 *-text 深一档；图形/填充另用 --up/--down。 */
.up { color: var(--up-text); }
.down { color: var(--down-text); }
/* 「平」没有涨跌倾向，用次要文字色而不是 --flat ——
   --flat 只在「白字压在其上」的填充场景用（对比度刚好 4.76:1），
   当正文色时它在 #f1f5f9 上会掉到 4.34:1。 */
.flat { color: var(--muted); }

.disclaimer {
  max-width: 1240px;
  margin: 10px auto 28px;
  padding: 0 18px;
  font-size: 12px;
  color: var(--muted);
  text-align: center;
  line-height: 1.6;
}

/* ---------- Toast ---------- */
.toast {
  position: fixed;
  bottom: 26px;
  left: 50%;
  transform: translateX(-50%) translateY(8px);
  background: #0f172a;
  color: #fff;
  padding: 11px 20px;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 600;
  box-shadow: 0 10px 30px rgba(15, 23, 42, .35);
  /* 必须高于弹窗（.modal = 40）：否则弹窗开着时 toast 会被遮罩盖住，
     用户点「立即刷新」后看不到任何反馈。 */
  z-index: 60;
  opacity: 0;
  transition: opacity .2s ease, transform .2s ease;
}
.toast:not(.hidden) { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---------- Tabs ---------- */
.tabs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 6px; }
.tab {
  padding: 7px 20px;
  border: 1px solid var(--border);
  background: #fff;
  border-radius: 9px;
  font-size: 14px;
  font-weight: 700;
  color: var(--muted);
  cursor: pointer;
  transition: all .15s ease;
}
.tab:hover { border-color: #c7d2fe; color: var(--accent); }
.tab.active {
  background: linear-gradient(180deg, #4f46e5, #4338ca);
  color: #fff; border-color: transparent;
  box-shadow: 0 4px 12px rgba(79, 70, 229, .35);
}

/* ---------- 排行表 ---------- */
.rank-table { font-size: 13px; }
.rank-head, .rank-row {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 8px;
  border-bottom: 1px solid var(--border);
}
.rank-head {
  position: sticky; top: var(--topbar-h); z-index: 5;
  color: var(--muted); font-size: 12px; font-weight: 700;
  background: var(--card);
  border-bottom: 2px solid var(--accent);
}
/* 排行行现在也可点开（明细 + 日K），与 .mt-row 保持同一套交互观感：
   cursor 与 .open 底色缺一个就会出现「点了好像没反应」的错觉。 */
.rank-row { transition: background .12s ease; cursor: pointer; }
.rank-row:hover { background: var(--accent-soft); }
.rank-row.open { background: #e0e7ff; border-bottom-color: transparent; }
.rank-row:last-child { border-bottom: none; }
.rank-head > span, .rank-row > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rank-r { text-align: right; }
.rank-c { text-align: center; }
.rank-name { font-weight: 700; color: var(--title); flex: 1 1 auto; }
/* 行业龙头 / 垄断 徽章（数据源：tag_leaders.py → _leaders.json → apply_masters 注入行内）。
   刻意避开 A 股涨跌色（红=涨/绿=跌），改用蓝（龙头）/ 琥珀（垄断特征）。
   悬浮 title 显示行业与判定依据。 */
.leader-badge {
  display: inline-block; margin-left: 5px; padding: 0 5px;
  font-size: 10px; line-height: 15px; font-style: normal; font-weight: 600;
  border-radius: 4px; vertical-align: middle; white-space: nowrap;
  background: rgba(37, 99, 235, 0.10); color: #1d4ed8; border: 0.5px solid rgba(37, 99, 235, 0.28);
}
.leader-badge.mono {
  background: rgba(161, 92, 0, 0.10); color: #8a4f00; border-color: rgba(161, 92, 0, 0.28);
}
.rank-code { color: var(--muted); font-size: 12px; }
.rank-c {
  font-weight: 800; color: var(--muted);
  background: #f1f5f9; border-radius: 7px;
  width: 30px; flex: 0 0 30px; padding: 2px 0;
}
.rank-score {
  font-weight: 800;
  color: #fff;
  background: linear-gradient(180deg, #6366f1, #4f46e5);
  border-radius: 7px;
  text-align: center;
  padding: 3px 0;
  box-shadow: 0 2px 6px rgba(79, 70, 229, .3);
}
@media (max-width: 620px) {
  .rank-hide-sm { display: none; }
  /* ⚠️ 窄屏顶栏会换行、高度不确定，sticky 表头贴不准。
     旧写法 `top: 0` 更糟：表头 z-index(5) < 顶栏(10)，会**藏在顶栏后面看不见**。
     拿不准就不粘 —— 让它随内容正常滚走，行为确定。 */
  .rank-head { position: static; }
}

/* ---------- 价值大师筛选 ---------- */
.master-desc {
  font-size: 13px;
  color: #475569;
  background: var(--accent-soft);
  border-left: 3px solid var(--accent);
  border-radius: 0 10px 10px 0;
  padding: 9px 13px;
  margin: 12px 0;
  line-height: 1.6;
}
.gate-chips { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 14px; }
.gate-chip {
  font-size: 11.5px;
  color: #475569;
  background: #f1f5f9;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 4px 11px;
  white-space: nowrap;
}

.mt-row {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 8px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background .12s ease;
}
.mt-row:hover { background: var(--accent-soft); }
.mt-row.open { background: #e0e7ff; border-bottom-color: transparent; }
.mt-row > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ⚠️ 分数档位胶囊是「白字压色块」，比正文要求更严（4.5:1，不是图形的 3:1）。
   原来三个档位用的是「好看但不合规」的亮色：亮绿 #22c55e 上白字只有 2.4:1，
   琥珀 #f59e0b 上 2.15:1，浅灰上更低 —— 低分档等于看不见数字。
   现在三档都压到白字 ≥4.5:1，色相不变，只是暗一档。 */
.mt-pass {
  display: block;
  font-weight: 800;
  color: #fff;
  background: linear-gradient(180deg, #15803d, var(--down-text));
  border-radius: 7px;
  text-align: center;
  padding: 3px 0;
  font-size: 12px;
  box-shadow: 0 2px 6px rgba(22, 163, 74, .3);
}
.mt-pass.mid { background: linear-gradient(180deg, #b45309, #92400e); box-shadow: 0 2px 6px rgba(146, 64, 14, .3); }
.mt-pass.low { background: linear-gradient(180deg, #71717a, #52525b); box-shadow: none; }

.gate-dots { display: flex; gap: 3px; justify-content: center; }
.gate-dot {
  width: 10px; height: 10px;
  border-radius: 3px;
  background: #e2e8f0;
  transition: background .15s ease;
}
.gate-dot.ok { background: var(--down); box-shadow: 0 0 0 2px rgba(22, 163, 74, .18); }

.mt-detail {
  background: #f8fafc;
  border-bottom: 1px solid var(--border);
  padding: 11px 14px 13px;
  font-size: 12.5px;
}
.mt-detail .gd {
  display: flex;
  align-items: baseline;
  gap: 9px;
  padding: 4px 0;
}
.mt-detail .gd .mk { font-weight: 800; width: 16px; flex: 0 0 16px; text-align: center; }
.mt-detail .gd .mk.ok { color: var(--down-text); }
.mt-detail .gd .mk.no { color: var(--up-text); }  /* 第三套红会跟涨跌红撞车，并入语义色 */
.mt-detail .gd .gl { color: var(--text); }
.mt-detail .gd .gv { color: var(--muted); margin-left: auto; font-variant-numeric: tabular-nums; }
.mt-empty { padding: 16px 8px; }

/* ---------- 标题旁的口径按钮 ---------- */
.h2-btn {
  float: right;
  margin-top: 1px;
  padding: 4px 12px;
  font-size: 12px;
  font-weight: 700;
  font-family: inherit;
  color: var(--accent);
  background: var(--accent-soft);
  border: 1px solid #c7d2fe;
  border-radius: 999px;
  cursor: pointer;
  transition: background .15s ease, color .15s ease, box-shadow .15s ease;
}
.h2-btn:hover {
  background: var(--accent);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 3px 10px rgba(79, 70, 229, .3);
}

/* ---------- 价格列 ---------- */
.rank-price { font-weight: 700; color: var(--title); }

/* ---------- 排序与评分口径弹窗 ---------- */
.modal {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, .5);
  backdrop-filter: blur(2px);
}
.modal-panel {
  position: relative;
  width: 100%;
  max-width: 720px;
  max-height: 82vh;
  display: flex;
  flex-direction: column;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 20px 60px rgba(15, 23, 42, .35);
  overflow: hidden;
  animation: modal-in .16s ease-out;
}
.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(180deg, #ffffff, #f8fafc);
}
.modal-head h3 { margin: 0; font-size: 15px; font-weight: 800; color: var(--title); }
.modal-x {
  border: none;
  background: #f1f5f9;
  color: var(--muted);
  width: 28px; height: 28px;
  border-radius: 8px;
  font-size: 13px;
  line-height: 1;
  cursor: pointer;
  transition: background .15s ease, color .15s ease;
}
.modal-x:hover { background: #e2e8f0; color: var(--title); }
.modal-body { padding: 16px 18px 18px; overflow-y: auto; }

.fm-block { margin-bottom: 16px; }
.fm-block:last-child { margin-bottom: 0; }
.fm-block h4 {
  margin: 0 0 7px;
  font-size: 13.5px;
  font-weight: 800;
  color: var(--title);
  padding-left: 10px;
  position: relative;
}
.fm-block h4::before {
  content: "";
  position: absolute;
  left: 0; top: 4px; bottom: 4px;
  width: 3px; border-radius: 3px;
  background: linear-gradient(180deg, var(--accent), #818cf8);
}
/* pre-line：保留快照文案里的换行，段内自动折行 */
.fm-text { font-size: 13px; line-height: 1.75; color: #475569; white-space: pre-line; }
.fm-master { margin-top: 10px; }
.fm-master-h { font-size: 12.5px; font-weight: 800; color: var(--accent); margin-bottom: 4px; }
.fm-gates {
  margin: 0;
  padding-left: 22px;
  font-size: 12.5px;
  line-height: 1.7;
  color: #475569;
}
.fm-gates li { margin-bottom: 2px; }
/* 技术择时回测披露：结论与直觉相反，给一块独立底色，别混在口径正文里被划过去。 */
.fm-bt {
  margin-top: 10px;
  padding: 10px 12px;
  border: 1px solid #f3d6a0;
  border-radius: 9px;
  background: #fffaf0;
  color: #7a4b00;
  font-size: 12px;
  line-height: 1.7;
}
.fm-bt a { color: #b4530a; font-weight: 700; }
/* 门槛参照系：与回测披露同色系，但加粗左边框，避免两条琥珀块连成一片被略过 */
.fm-gate {
  margin-top: 10px;
  padding: 10px 12px;
  border: 1px solid #f3d6a0;
  border-left: 4px solid #d97706;
  border-radius: 9px;
  background: #fffaf0;
  color: #7a4b00;
  line-height: 1.75;
}
.fm-gate b { color: #663f00; }
.fm-foot {
  margin-top: 14px;
  padding: 10px 12px;
  background: #f8fafc;
  border-left: 3px solid #f59e0b;
  border-radius: 0 8px 8px 0;
  font-size: 12px;
  line-height: 1.65;
  color: #92400e;
}

@keyframes modal-in {
  from { opacity: 0; transform: translateY(10px) scale(.99); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

@media (max-width: 620px) {
  .modal { padding: 12px; }
  .modal-panel { max-height: 88vh; }
  .h2-btn { padding: 3px 9px; font-size: 11.5px; }
}

.hidden { display: none !important; }

/* ---------- 尊重「减少动态效果」系统偏好 ----------
   最关键的是 #refreshState 的 1.4s **无限**脉冲：对前庭敏感用户那是无休止的
   闪烁，比任何一个 hover 位移都难受。系统里明确要求减少动效时，
   必须让它真的停下来，而不是只把 hover 位移收掉。 */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
}

@keyframes rstate-pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.4; } }

/* 焦点可见性（可访问性） */
/* .rank-row 也要在内：排行行现在走 attachRowExpand 加 tabIndex，
   不在列表里就是「可聚焦但没有焦点框」，键盘 User 不知道自己在哪一行。
   ⚠️ 新增可点元素时必须往这个清单里补：之前 .h2-btn / .modal-x / .krange-btn
   三个按钮都是「能点、有 cursor:pointer、但没有统一焦点框」，
   靠浏览器默认 outline 兜底，换主题就看不见了。 */
.btn:focus-visible, .tab:focus-visible, .mt-row:focus-visible, .rank-row:focus-visible,
.h2-btn:focus-visible, .modal-x:focus-visible, .krange-btn:focus-visible,
.analyse-btn:focus-visible, .back-link:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
/* 深底上的返回链接：--accent 在 topbar 上几乎看不见，改用反白焦点框 */
.back-link:focus-visible { outline-color: #fff; }

/* K 线（排行 / 大师表展开行，懒加载 + 档位切换） */
.kline-tag {
  font-size: 11.5px; color: var(--muted);
  margin: 8px 0 2px;
}
/* 档位切条：近一月/近一年/近三年/上市至今。胶囊按钮，选中态用主色反白。 */
.kline-switch { display: flex; gap: 6px; margin: 6px 0 0; flex-wrap: wrap; }
.krange-btn {
  appearance: none; border: 1px solid var(--border); background: var(--card);
  color: var(--muted); font-size: 11.5px; line-height: 1;
  padding: 4px 9px; border-radius: 999px; cursor: pointer;
}
.krange-btn:hover { color: var(--text); border-color: var(--accent); }
.krange-btn.on { background: var(--accent); border-color: var(--accent); color: #fff; }
/* 窄屏不缩到看不清：viewBox 620×230 一旦等比压到 320px，日期轴的字会变成
   米粒大。改成「保持最小宽度 + 横向滚动」，宁可滑一下也不要糊。 */
.kline-box { margin: 10px 0 4px; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.kline-box svg { width: 100%; height: auto; display: block; min-width: 460px; }
.kline-loading, .kline-empty, .kline-error {
  padding: 10px 8px; font-size: 12px; color: var(--muted);
}

/* 展开行顶部：推荐理由（为什么是这个分/名次）。只陈述数据事实，不作定性判断。 */
.rank-reason {
  background: var(--accent-soft);
  border-left: 3px solid var(--accent);
  border-radius: 6px;
  padding: 8px 10px;
  margin: 2px 0 8px;
  font-size: 12px;
  line-height: 1.7;
  color: var(--text);
}
.rank-reason p { margin: 0 0 4px; }
.rank-reason p:last-child { margin-bottom: 0; }
.rank-reason strong { color: var(--title); font-weight: 600; }
/* 八道门档 32 门逐门点阵：● 通过 ○ 未通过，悬浮 title 看每门取值 */
.rank-reason .gd-matrix { display: block; }
.rank-reason .gd-row { margin: 0 0 2px; }
.rank-reason .gd-dot { letter-spacing: 2px; color: var(--border); cursor: help; }
.rank-reason .gd-dot.on { color: var(--accent); }

/* 展开行里的「维度明细」：把窄屏被收起的那些维度摊开，
   顺便回答用户最常问的「综合分是怎么算出来的」。 */
/* 用 auto-fill 网格而不是 flex-wrap：标签列对齐成一条线，读起来像规格表。 */
.kd-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(134px, 1fr));
  gap: 4px 8px;
}
.kd-grid .kd {
  display: flex; align-items: baseline; justify-content: space-between; gap: 6px;
  background: #f1f5f9; border-radius: 6px; padding: 3px 8px;
}
.kd-grid .kd i { font-style: normal; color: var(--muted); font-size: 11.5px; }
.kd-grid .kd b {
  font-weight: 700; color: var(--text);
  font-variant-numeric: tabular-nums;
}
/* 明细是纵向卡片，表体的「撑满列宽 / 渐变胶囊」列类名在这里要抹平 */
.kd-grid .kd b.rank-name,
.kd-grid .kd b.rank-score {
  flex: 0 0 auto; background: none; box-shadow: none;
  padding: 0; color: inherit; font-weight: 700;
}
.kd-grid .kd b.up { color: var(--up-text); }
.kd-grid .kd b.down { color: var(--down-text); }

.rank-detail { padding: 11px 12px 13px; }
.rank-detail .kline-tag { margin-top: 10px; }

/* ---------- 分析按钮（排行行尾，进布局分析详情页） ---------- */
/* 与 .btn 区分开：它是行内的次要动作，做成「描边小胶囊」而不是实心按钮，
   否则一整列实心块会把行内的数据列视觉权重压过去。 */
.rank-act { display: flex; align-items: center; justify-content: flex-end; }
.analyse-btn {
  display: inline-block;
  font-size: 11.5px; font-weight: 700;
  color: var(--accent);
  background: var(--accent-soft);
  border: 1px solid rgba(79, 70, 229, .28);
  border-radius: 999px;
  padding: 2px 9px;
  text-decoration: none;
  white-space: nowrap;
  transition: background .12s ease, color .12s ease;
  font-variant-numeric: tabular-nums;
}
.analyse-btn:hover { background: var(--accent); color: #fff; }
.analyse-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }

/* =================================================================
   布局分析详情页（position.html）
   ================================================================= */

/* 顶栏回看板：详情页顶栏复用 .topbar 深色底，链接要压得住这个背景 */
.pos-brand { gap: 12px; }
.back-link {
  display: inline-flex; align-items: center; gap: 4px;
  color: #fff; text-decoration: none; font-size: 13.5px;
  font-weight: 600; padding: 5px 11px; border-radius: 8px;
  background: rgba(255, 255, 255, .12);
  border: 1px solid rgba(255, 255, 255, .12);
}
.back-link span { font-size: 12px; opacity: .8; }
.back-link:hover { background: rgba(255, 255, 255, .22); border-color: rgba(255, 255, 255, .22); }
.brand-title {
  color: #fff; font-size: 18px; font-weight: 800; letter-spacing: .3px;
  padding-left: 12px; border-left: 1px solid rgba(255, 255, 255, .25);
}

.pos-body .pos-head { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.pos-title { display: flex; align-items: baseline; gap: 10px; flex: 1 1 260px; }
.pos-title h1 { margin: 0; font-size: 21px; color: var(--title); }
.pos-code { color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; }
.pos-quote { display: flex; align-items: baseline; gap: 12px; }
.pos-price {
  font-size: 30px; font-weight: 800; color: var(--title);
  font-variant-numeric: tabular-nums; line-height: 1.1;
}
.pos-meta { color: var(--muted); font-size: 12.5px; }
.pos-meta b { color: var(--text); font-variant-numeric: tabular-nums; }

/* 结论条：整块底色随「贵 / 便宜」走，第一眼就判断出该不该追 */
.verdict {
  flex: 1 1 100%;
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  border-radius: var(--radius-sm);
  padding: 9px 13px;
  font-size: 13.5px;
  background: var(--flat-bg);
  border-left: 4px solid var(--flat);
  color: var(--text);
}
.verdict b { font-size: 15px; color: var(--title); }
.verdict .v-num {
  font-weight: 800; font-variant-numeric: tabular-nums;
  background: rgba(255, 255, 255, .7); border-radius: 6px; padding: 1px 8px;
}
.verdict .v-basis { color: var(--muted); font-size: 12px; }
/* ⚠️ 这里是「贵/便宜」而不是涨跌，但配色仍沿用 A 股红涨绿跌的直觉：
   偏贵＝红（风险），偏低＝绿（机会）。文案里已写明口径，不会误读成涨跌。 */
.verdict.pos-bias-dear { background: var(--up-bg); border-left-color: var(--up); }
.verdict.pos-bias-cheap { background: var(--down-bg); border-left-color: var(--down); }

/* 中枢三件套 */
.fair-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(158px, 1fr));
  gap: 10px; margin: 12px 0 14px;
}
.fair-item, .anchor {
  background: #f8fafc; border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 9px 11px;
  display: flex; flex-direction: column; gap: 2px;
}
.fair-item i, .anchor i { font-style: normal; color: var(--muted); font-size: 11.5px; }
.fair-item b { font-size: 19px; font-weight: 800; color: var(--title); font-variant-numeric: tabular-nums; }
.fair-item s, .anchor s { text-decoration: none; color: var(--muted); font-size: 11px; }
.fair-item b.up { color: var(--up-text); }
.fair-item b.down { color: var(--down-text); }

/* .anchor-list / .kline-wrap / .kline-svg / .pos-anchor-card 这四个 class 一直在
   HTML 与 JS 里挂着，但 styles.css 从没定义过 —— 属于「用了没吃样式」的假 class。
   其中 .pos-anchor-card 挂在整页唯一的核心模块上，不定义就等于核心区没有强调。 */
.anchor-list { margin: 14px 0 4px; }
.kline-wrap { min-width: 0; }           /* flex/grid 子项默认 min-width:auto，会被 K 线撑破 */
.kline-svg { display: block; width: 100%; height: auto; }
/* 核心卡：整页只有这一张承载「建仓价位」结论，用主色顶边 + 实一点的底噪，
   和下面几张通用卡片拉开层级，不用看标题就知道先看哪块。 */
.pos-anchor-card {
  border-top: 3px solid var(--accent);
  background: linear-gradient(180deg, #fbfcff 0%, var(--card) 42%);
  box-shadow: var(--shadow);
}

.anchor-t {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 10px; margin-bottom: 14px;
}
.anchor b { font-size: 16px; font-weight: 800; color: var(--accent); font-variant-numeric: tabular-nums; }

/* 分批建仓表 —— 5 列里「含义」列文案长，窄屏必须能横滚，否则整卡被撑破、页面出现横向滚动条。 */
.plan-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.plan-table {
  width: 100%; border-collapse: collapse; font-size: 13px;
  border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden;
}
.plan-table th {
  background: #f1f5f9; color: var(--muted); font-size: 12px; font-weight: 700;
  text-align: left; padding: 7px 10px; border-bottom: 1px solid var(--border);
}
.plan-table td {
  padding: 8px 10px; border-bottom: 1px solid var(--border); vertical-align: middle;
}
.plan-table tr:last-child td { border-bottom: none; }
.plan-table .mono { font-variant-numeric: tabular-nums; }
.plan-table .dim { color: var(--muted); font-size: 12px; }
/* 首仓整行浅色打底：它是唯一「现在就能执行」的一档，其余都是等回调 */
.plan-table tr.plan-first { background: var(--accent-soft); }
.plan-table tr.plan-first td:first-child { border-left: 3px solid var(--accent); }

.pos-foot { font-size: 12px; margin: 9px 0 0; }
.pos-foot b { color: var(--title); }

/* 价位标尺 */
.ruler-svg { width: 100%; height: auto; display: block; min-width: 420px; }
.ruler { overflow-x: auto; }

/* 技术位小胶囊 */
.level-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.chip {
  display: inline-flex; align-items: baseline; gap: 6px;
  background: #f1f5f9; border-radius: 999px; padding: 3px 11px;
  font-size: 12px; color: var(--muted);
}
.chip b { font-size: 13px; color: var(--title); font-variant-numeric: tabular-nums; }
.chip b.up { color: var(--up-text); }
.chip b.down { color: var(--down-text); }

/* 指标网格（基本面 / 评分共用） */
.metric-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(148px, 1fr));
  gap: 6px 8px; margin-top: 10px;
}
.metric-grid .metric {
  display: flex; align-items: baseline; justify-content: space-between; gap: 6px;
  background: #f8fafc; border-radius: 6px; padding: 5px 9px;
}
.metric-grid .metric i { font-style: normal; color: var(--muted); font-size: 11.5px; }
.metric-grid .metric b {
  font-weight: 700; color: var(--text); font-variant-numeric: tabular-nums;
}
.metric-grid .metric b.up { color: var(--up-text); }
.metric-grid .metric b.down { color: var(--down-text); }

/* 机构观点 */
.pos-report {
  margin-top: 14px; padding: 10px 12px;
  background: var(--accent-soft); border-left: 3px solid var(--accent);
  border-radius: 6px; font-size: 12.5px; line-height: 1.7;
}
.pos-report h3 { margin: 0 0 6px; font-size: 13px; }
.pos-report p { margin: 0; color: var(--text); }

@media (max-width: 620px) {
  .pos-body .pos-head { gap: 10px; }
  .pos-price { font-size: 25px; }
  .fair-grid { grid-template-columns: repeat(auto-fit, minmax(128px, 1fr)); }
  /* 建仓表：先砍掉「含义」（第 5 列）这块最占地的，剩下 4 列在手机上才读得顺；
     再给个 min-width，万一屏幕比它还窄就由 .plan-scroll 横向滚动，不压缩内容。
     ⚠️ 两个规则要一起加：只加 min-width 会让「含义」被挤成竖排乱码，
        只藏列又会在超窄屏上把数字压到换行。 */
  .plan-table th:nth-child(5), .plan-table td:nth-child(5) { display: none; }
  .plan-table { min-width: 300px; }
}

/* 红利基金策略 · 三因子择时 */
.dividend-summary {
  display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 10px;
}
.ds-tag {
  display: inline-block; padding: 4px 12px; border-radius: 6px; font-size: 13px;
  font-weight: 600; line-height: 1;
}
.ds-tag.cheap {
  background: var(--down-bg); color: var(--down-text);
}
.ds-tag.normal {
  background: var(--flat-bg); color: var(--flat);
}
.ds-tag.expensive {
  background: var(--up-bg); color: var(--up-text);
}

/* 红利策略行底色 */
.rank-row.ds-cheap {
  background: rgba(21, 160, 90, 0.06);
}
/* 便宜行左边强调条：榜单里最先要看的就是这几行 */
.rank-row.ds-cheap {
  box-shadow: inset 3px 0 0 rgba(21, 160, 90, .55);
}
.rank-row.ds-expensive {
  background: rgba(226, 59, 59, 0.06);
}
.rank-row.ds-normal {
  /* 无特殊底色 */
}

/* 红利表信号/动作/分析列的居中类（独立于排行表 .rank-c 徽章样式） */
.rank-ctr { text-align: center; }

/* 信号胶囊：按信号着色，替代裸文本 */
.ds-signal-chip {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
  color: var(--muted);
  background: #f1f5f9;
  border: 1px solid var(--border);
}
.ds-signal-chip.cheap {
  color: #fff;
  background: linear-gradient(180deg, #16a35a, #128a4c);
  border-color: transparent;
  box-shadow: 0 1px 5px rgba(21, 160, 90, .3);
}
.ds-signal-chip.expensive {
  color: #fff;
  background: linear-gradient(180deg, #ef5350, #e23b3b);
  border-color: transparent;
  box-shadow: 0 1px 5px rgba(226, 59, 59, .3);
}

/* 底部口径：分段卡片，替代 <br> 堆砌 */
#dividendFoot { display: flex; flex-direction: column; gap: 8px; }

/* 红利展开行：归属信息小徽标 */
.ds-bits { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 7px; }
.ds-bit {
  font-size: 11.5px;
  color: #475569;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 3px 10px;
  white-space: nowrap;
}

.ds-foot-block {
  font-size: 11.5px;
  line-height: 1.7;
  color: var(--muted);
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 12px;
}
.ds-foot-block b { color: #475569; }

/* 红利卡片：信号/动作两列窄但必须完整可读，禁用省略截断 */
#dividendCard .rank-row > span:nth-last-child(3),
#dividendCard .rank-row > span:nth-last-child(2),
#dividendCard .rank-row > span:last-child {
  overflow: visible;
  text-overflow: clip;
  flex-shrink: 0;
}
/* ⚠️ .rank-c（排行表分数格用的灰底定宽块，width:30px）会串进红利表的
   信号/动作/分析列 —— 在这里整体还原成普通列，否则胶囊和文字会被压成 30px。 */
#dividendCard .rank-row > .rank-c,
#dividendCard .rank-head > .rank-c {
  background: none;
  border-radius: 0;
  padding: 0;
  width: auto;
}
/* 数字列统一等宽数字，纵向读起来不跳 */
#dividendCard .rank-row > span { font-variant-numeric: tabular-nums; }

/* 分析列：表头 + 数据行都靠右；flex 行内 text-align 不生效，必须用 flex */
#dividendCard .rank-row > span:last-child,
#dividendCard .rank-head > span:last-child {
  display: flex;
  align-items: center;
  justify-content: flex-end;
}

/* ---------- TradingView 技术择时（内联） ---------- */

.tv-stale-banner {
  background: #fff3cd;
  border: 1px solid #ffc107;
  border-radius: 6px;
  padding: 8px 12px;
  font-size: 12.5px;
  color: #856404;
  margin-bottom: 10px;
}

.tv-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.tv-summary-card {
  flex: 1 1 0;
  min-width: 80px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 9px 6px;
  text-align: center;
  cursor: pointer;
  transition: all .15s;
  font-family: inherit;
  font-size: 12.5px;
  color: #475569;
}

.tv-summary-card:hover { background: #eef2ff; border-color: #818cf8; }
.tv-summary-card.active { background: #eef2ff; border-color: #6366f1; color: #312e81; font-weight: 600; }
.tv-summary-card span { display: block; font-size: 11px; margin-bottom: 2px; opacity: .7; }
.tv-summary-card b { display: block; font-size: 18px; }

.tv-error {
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: 6px;
  padding: 10px 14px;
  font-size: 13px;
  color: #991b1b;
margin-bottom: 10px;
}

.tv-loading {
  text-align: center;
  color: #64748b;
  font-size: 13px;
  padding: 24px 0;
}

.tv-empty {
  text-align: center;
  color: #94a3b8;
  font-size: 13px;
  padding: 20px 0;
}

.tv-table-wrap { overflow-x: auto; }

.tv-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
}

.tv-table th {
  text-align: left;
  font-weight: 600;
  color: #475569;
  padding: 8px 6px;
  border-bottom: 2px solid #e2e8f0;
  white-space: nowrap;
  font-size: 11.5px;
}

.tv-table td {
  padding: 7px 6px;
  border-bottom: 1px solid #f1f5f9;
  vertical-align: middle;
}

.tv-table tbody tr:hover { background: #f8fafc; }

.tv-rank { text-align: center; font-weight: 600; color: #64748b; width: 32px; }

.tv-name strong { display: block; font-size: 13px; color: #1e293b; }
.tv-name span { display: block; font-size: 11px; color: #94a3b8; margin-top: 1px; }

.tv-grade {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 11.5px;
  font-weight: 600;
}

.grade-A { background: #dcfce7; color: #166534; }
.grade-B { background: #dbeafe; color: #1e40af; }
.grade-C { background: #fef9c3; color: #854d0e; }
.grade-D { background: #f1f5f9; color: #475569; }
.grade-E { background: #fee2e2; color: #991b1b; }

.tv-date { font-size: 10.5px; color: #94a3b8; margin-top: 2px; max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.tv-rating {
  display: inline-block;
padding: 1px 6px;
  border-radius: 8px;
  font-size: 11px;
  font-weight: 600;
}

.tv-rating.strong-buy { background: #166534; color: #fff; }
.tv-rating.buy { background: #16a34a; color: #fff; }
.tv-rating.neutral { background: #e2e8f0; color: #475569; }
.tv-rating.sell { background: #f97316; color: #fff; }
.tv-rating.strong-sell { background: #dc2626; color: #fff; }

.tv-metric { font-variant-numeric: tabular-nums; text-align: center; }

.tv-action {
  display: inline-block;
  padding: 3px 10px;
  background: #eef2ff;
  color: #4f46e5;
  border-radius: 6px;
  font-size: 11.5px;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  transition: background .15s;
}

.tv-action:hover { background: #c7d2fe; }

.tv-footnote {
  font-size: 11px;
  color: #94a3b8;
  text-align: center;
}

@media (max-width: 768px) {
  .hide-mobile { display: none; }
  .tv-summary-card { min-width: 60px; padding: 6px 4px; }
  .tv-summary-card b { font-size: 15px; }
}

/* ---------- 各模块「数据获取时间」标注（2026-10-15） ---------- */
.mod-time {
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
  margin-left: 8px;
  vertical-align: baseline;
  white-space: nowrap;
}
.mod-time-stale { color: #f0a020; }
.mod-times-legend {
  max-width: 1240px;
  margin: 0 auto 28px;
  padding: 0 18px;
  font-size: 11.5px;
  color: var(--muted);
  text-align: center;
  line-height: 1.7;
}

/* ============================================================
   移动端专项修正（≤820px）
   - 顶栏在窄屏会换行、高度不定，sticky 表头因 top 写死 56px 会错位/被遮挡，
     移动端直接关掉表头 sticky，改为随内容滚动（根治对齐问题）。
   - 放大常用按钮/标签的触摸区域，手机点得准。
   ============================================================ */
@media (max-width: 820px) {
  .rank-head,
  table thead th,
  .tv-table thead th {
    position: static !important;
  }
  .h2-btn { padding: 8px 14px; font-size: 14px; }
  .tab { padding: 9px 16px; font-size: 14px; }
  .btn { padding: 9px 16px; }
  .tv-summary-card { padding: 10px 8px; }
  /* 顶栏：品牌 + 汉堡占第一行，状态信息换行到下方，避免拥挤 */
  .topbar { gap: 8px 14px; }
}
