/* 美股编年史 — 设计系统沿用 field guide 系列（羊皮纸 + 铁锈红/金/橄榄） */
:root {
  --bg: #F1ECDF;
  --bg-card: #EBE5D6;
  --bg-card-hover: #E5DECC;
  --bg-deep: #E0D8C2;
  --ink: #1A1410;
  --ink-soft: #3D352D;
  --ink-muted: #6B5D4F;
  --accent: #A0392F;
  --accent-deep: #7E2A22;
  --accent-soft: rgba(160, 57, 47, 0.08);
  --gold: #B8893E;
  --gold-soft: rgba(184, 137, 62, 0.10);
  --moss: #14A63E; /* 苹果绿：鲜艳亮色，全站涨幅/正值统一用 */
  --blue: #2B5F8F;
  --teal: #2D4A48;
  --purple: #6A4E9E;
  --danger: #FF2400;
  /* 对比图专用四色：深红 / Chase 蓝 / 深紫 / 凯尔特人绿 —— 高饱和高区分 */
  --cmp-red: #B01212;
  --cmp-blue: #117ACA;
  --cmp-purple: #6A3FB5;
  --cmp-green: #00A93E;
  --grid: rgba(26, 20, 16, 0.10);
  --grid-strong: rgba(26, 20, 16, 0.18);
  --border: #D8D0BA;
}
.dark-mode {
  --bg: #1A1410;
  --bg-card: #241C16;
  --bg-card-hover: #2D241D;
  --bg-deep: #20180F;
  --ink: #F1ECDF;
  --ink-soft: #D8D0BA;
  --ink-muted: #9B8E7C;
  --accent: #D45D4F;
  --accent-deep: #B8421E;
  --accent-soft: rgba(212, 93, 79, 0.14);
  --gold: #E0B05A;
  --gold-soft: rgba(224, 176, 90, 0.14);
  --moss: #34D96C; /* 苹果绿（夜间提亮版） */
  --blue: #6FA0CC;
  --teal: #6A8C88;
  --purple: #A88FD8;
  --danger: #FF2400;
  --cmp-red: #FF5C5C;
  --cmp-blue: #4BA8FF;
  --cmp-purple: #B78FFF;
  --cmp-green: #3BE577;
  --grid: rgba(241, 236, 223, 0.10);
  --grid-strong: rgba(241, 236, 223, 0.18);
  --border: #3D352D;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: 'Noto Sans SC', 'IBM Plex Sans', sans-serif;
  font-size: 15px;
  line-height: 1.7;
  transition: background 0.3s, color 0.3s;
}
.dark-mode body { background: var(--bg); }

/* ---------- 顶栏 ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: color-mix(in srgb, var(--bg) 94%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}
.topbar-inner {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  gap: 24px;
  height: 58px;
}
.brand {
  font-family: 'Noto Serif SC', serif;
  font-weight: 700;
  font-size: 19px;
  white-space: nowrap;
}
.brand em {
  font-family: 'Fraunces', serif;
  font-style: italic;
  font-weight: 400;
  color: var(--ink-muted);
  font-size: 13px;
  margin-left: 8px;
}
.tabs {
  display: flex;
  gap: 2px;
  flex: 1;
  flex-wrap: nowrap;
  overflow-x: auto;
  scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }
.tab {
  padding: 6px 11px;
  border: none;
  background: none;
  color: var(--ink-muted);
  font: inherit;
  font-size: 14px;
  cursor: pointer;
  border-radius: 6px 6px 0 0;
  border-bottom: 2px solid transparent;
  white-space: nowrap;
  flex-shrink: 0;
}
.tab:hover { color: var(--ink); background: var(--bg-card-hover); }
.tab.active {
  color: var(--accent-deep);
  font-weight: 600;
  border-bottom-color: var(--accent);
}
.top-controls { display: flex; align-items: center; gap: 10px; margin-left: 18px; }
/* 窄屏收起品牌副题，给 tab 让位；非中文界面下主名已译为英文，副题冗余 */
@media (max-width: 1560px) { .brand em { display: none; } }
html:not([lang^="zh"]) .brand em { display: none; }
/* 西语系 tab 标签更宽（Consommation / LEAPS-Fenster…），9 个 tab 会把最后一个
   「LEAPS Window」挤出 .tabs 的 overflow-x 边界被截断。非中文界面下收紧 tab 字号/
   内边距、顶栏间距与右侧控件占位，让全部 tab 单行完整显示。 */
html:not([lang^="zh"]) .topbar-inner { gap: 14px; }
html:not([lang^="zh"]) .tab { font-size: 12.5px; padding: 6px 7px; }
html:not([lang^="zh"]) .top-controls { margin-left: 8px; gap: 8px; }
html:not([lang^="zh"]) .lang-switch { font-size: 11.5px; padding: 3px 8px; }
.lang-switch {
  white-space: nowrap;
  flex-shrink: 0;
  font-size: 12.5px;
  color: var(--ink-muted);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 3px 10px;
  background: var(--bg-card);
  cursor: default;
}
.lang-switch { cursor: default; }
.lang-switch span[data-lang] { cursor: pointer; padding: 0 2px; }
.lang-switch span[data-lang]:hover { color: var(--ink); }
.lang-switch span.active { color: var(--accent-deep); font-weight: 600; }
.lang-switch .sep { color: var(--border); margin: 0 1px; }
.theme-toggle {
  width: 34px; height: 34px;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: var(--bg-card);
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
  color: var(--ink);
}
.theme-toggle:hover { background: var(--bg-card-hover); }

/* ---------- 窄屏 / 平板顶栏 ----------
   桌面端顶栏是「品牌 · tab · 控件」一行。窄屏时品牌 + 六语切换会占满整行，
   而 .tabs 因 overflow-x:auto 的最小宽度为 0，被 flex 挤成 0 宽度整条消失。
   这里让顶栏换行：品牌与控件占首行，tab 栏独占次行满宽横向滚动。 */
@media (max-width: 820px) {
  .topbar-inner {
    flex-wrap: wrap;
    height: auto;
    gap: 8px 12px;
    padding: 8px 16px;
  }
  .brand { order: 1; font-size: 17px; }
  .top-controls { order: 2; margin-left: auto; }
  .tabs {
    order: 3;
    flex: 0 0 100%;
    width: 100%;
    padding-bottom: 2px;
    -webkit-overflow-scrolling: touch;
    /* 右缘渐隐，提示 tab 栏可横向滑动、并非被截断 */
    -webkit-mask-image: linear-gradient(90deg, #000 90%, transparent);
    mask-image: linear-gradient(90deg, #000 90%, transparent);
  }
  .lang-switch { font-size: 11px; padding: 3px 8px; }
  .tab { font-size: 13.5px; padding: 6px 9px; }
}

/* ---------- 版面 ---------- */
.container { max-width: 1180px; margin: 0 auto; padding: 32px 24px 80px; }
.panel { display: none; }
.panel.active { display: block; }

.hero { margin: 12px 0 36px; }
.hero h1 {
  font-family: 'Noto Serif SC', serif;
  font-size: 34px;
  font-weight: 700;
  line-height: 1.3;
}
.hero .kicker {
  color: var(--accent);
  font-size: 13px;
  letter-spacing: 0.12em;
  font-weight: 600;
  margin-bottom: 6px;
}
.hero .dek { color: var(--ink-muted); max-width: 1020px; margin-top: 10px; font-size: 15.5px; }

.chapter { margin: 48px 0; }
.chapter-head { display: flex; align-items: baseline; gap: 14px; border-bottom: 2px solid var(--ink); padding-bottom: 8px; margin-bottom: 6px; }
.chapter-no {
  font-family: 'Fraunces', serif;
  font-style: italic;
  color: var(--accent);
  font-size: 15px;
  white-space: nowrap;
}
.chapter-head h2 { font-family: 'Noto Serif SC', serif; font-size: 22px; font-weight: 700; }
.chapter-q { color: var(--ink-muted); font-size: 14px; margin-bottom: 18px; }

.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 18px 18px 10px;
  margin-bottom: 22px;
}
.card h3 { font-size: 15.5px; font-weight: 600; margin-bottom: 2px; }
.card .sub { color: var(--ink-muted); font-size: 12.5px; margin-bottom: 6px; }
.chart { width: 100%; height: 420px; }
.chart.tall { height: 560px; }
.chart.short { height: 320px; }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }
@media (max-width: 900px) { .grid-2 { grid-template-columns: 1fr; } }

/* ---------- K 指数状态卡 ---------- */
.k-status {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 26px;
}
@media (max-width: 900px) { .k-status { grid-template-columns: repeat(2, 1fr); } }
.stat {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 18px;
}
.stat .label { font-size: 12px; color: var(--ink-muted); letter-spacing: 0.06em; }
.stat .value {
  font-family: 'JetBrains Mono', monospace;
  font-size: 26px;
  font-weight: 700;
  margin-top: 2px;
}
.stat .note { font-size: 12px; color: var(--ink-muted); }
.stat.signal-on { border-color: var(--accent); background: var(--accent-soft); }
.stat.signal-on .value { color: var(--accent-deep); }

.poem {
  font-family: 'Noto Serif SC', serif;
  color: var(--ink-soft);
  background: var(--gold-soft);
  border-left: 3px solid var(--gold);
  padding: 10px 16px;
  border-radius: 0 8px 8px 0;
  margin: 18px 0;
  font-size: 14.5px;
}

/* ---------- 表格 ---------- */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
th {
  text-align: right;
  font-weight: 600;
  color: var(--ink-muted);
  border-bottom: 2px solid var(--ink);
  padding: 8px 10px;
  white-space: nowrap;
}
th:first-child, td:first-child { text-align: left; }
td {
  padding: 7px 10px;
  border-bottom: 1px solid var(--border);
  text-align: right;
  font-family: 'JetBrains Mono', monospace;
  font-size: 12.5px;
  white-space: nowrap;
}
td:first-child { font-family: 'Noto Sans SC', sans-serif; }
tr:hover td { background: var(--bg-card-hover); }
.pos { color: var(--moss); }
.neg { color: var(--danger); }
.k-min { color: var(--accent-deep); font-weight: 700; }

.footnote { color: var(--ink-muted); font-size: 12.5px; margin-top: 10px; }
.src-note { font-size: 11.5px; opacity: 0.85; margin-top: 8px; }

/* ---------- 今日 · 头版（聚光灯封面） ---------- */
.pulse-hero {
  position: relative;
  min-height: calc(100vh - 140px);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  margin-top: 18px;
}
.pulse-layer {
  background: var(--bg);
  color: var(--ink);
  padding: 48px 56px;
  display: flex;
  flex-direction: column;
  gap: 26px;
}
/* 日间层在文档流内撑起封面高度，内容再多也不会被裁 */
.pulse-base { position: relative; }
@media (max-width: 900px) { .pulse-layer { padding: 26px 20px; } }
/* 揭示层：仅在光标柔光圆内可见（JS 更新 mask 圆心） */
.pulse-reveal {
  position: absolute;
  inset: 0;
  overflow: hidden;
  z-index: 3;
  pointer-events: none;
  -webkit-mask-image: radial-gradient(circle 0px at -999px -999px, #fff 0%, transparent 100%);
  mask-image: radial-gradient(circle 0px at -999px -999px, #fff 0%, transparent 100%);
}
.pulse-chartline {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}
/* 顶部世纪带：百年走势 + 危机红点 */
.pulse-chartband {
  position: relative;
  height: 280px;
  flex-shrink: 0;
  margin: 2px 0 4px;
}
@media (max-width: 900px) { .pulse-chartband { height: 190px; } }
.crisis-dot {
  position: absolute;
  transform: translate(-50%, -50%);
  z-index: 2;
  cursor: pointer;
}
/* 放大不可见的命中区，13px 的小点也好悬停/点击 */
.crisis-dot i::after {
  content: "";
  position: absolute;
  inset: -12px;
  border-radius: 50%;
}
.crisis-dot i {
  position: relative;
  display: block;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: #D62828;
  border: 2px solid color-mix(in srgb, var(--bg) 80%, #fff);
  animation: crisisPulse 1.8s ease-out infinite;
}
@keyframes crisisPulse {
  0% { box-shadow: 0 0 0 0 rgba(214, 40, 40, 0.55); transform: scale(1); }
  60% { box-shadow: 0 0 0 13px rgba(214, 40, 40, 0); transform: scale(1.22); }
  100% { box-shadow: 0 0 0 0 rgba(214, 40, 40, 0); transform: scale(1); }
}
.crisis-dot > span {
  position: absolute;
  left: 50%;
  transform: translate(calc(-50% + var(--dx, 0px)), var(--dy, 0px));
  top: -26px;
  white-space: nowrap;
  font-size: 12px;
  font-weight: 700;
  font-family: 'JetBrains Mono', 'Noto Sans SC', monospace;
  color: var(--accent-deep);
  background: color-mix(in srgb, var(--bg) 72%, transparent);
  padding: 1px 7px;
  border-radius: 5px;
}
.crisis-dot.below > span { top: auto; bottom: -28px; }
.crisis-dot.edge-r > span { left: auto; right: -8px; transform: translate(var(--dx, 0px), var(--dy, 0px)); }
.crisis-dot.edge-l > span { left: -8px; transform: translate(var(--dx, 0px), var(--dy, 0px)); }
/* 描线动画：走势线从左至右自己画出来 */
.draw-line {
  stroke-dasharray: 1000;
  stroke-dashoffset: 1000;
  animation: drawLine 3.4s cubic-bezier(0.4, 0, 0.2, 1) 0.5s forwards;
}
@keyframes drawLine { to { stroke-dashoffset: 0; } }
/* 入场动画：血压计式的错峰浮现 */
@keyframes heroRise {
  from { opacity: 0; transform: translateY(20px); filter: blur(7px); }
  to { opacity: 1; transform: none; filter: none; }
}
.pulse-base > * { animation: heroRise 0.85s cubic-bezier(0.2, 0.7, 0.3, 1) both; }
.pulse-base > :nth-child(1) { animation-delay: 0.1s; }
.pulse-base > :nth-child(2) { animation-delay: 0.28s; }
.pulse-base > :nth-child(3) { animation-delay: 0.5s; }
.pulse-base > :nth-child(4) { animation-delay: 0.68s; }
.pulse-base > :nth-child(5) { animation-delay: 0.85s; }
.pulse-base > :nth-child(6) { animation-delay: 1s; }
.pulse-base > :nth-child(7) { animation-delay: 1.12s; }
/* 揭示层强制夜间调色（scoped 副本） */
.force-dark {
  --bg: #1A1410; --bg-card: #241C16; --bg-card-hover: #2D241D; --bg-deep: #20180F;
  --ink: #F1ECDF; --ink-soft: #D8D0BA; --ink-muted: #9B8E7C;
  --accent: #D45D4F; --accent-deep: #B8421E; --accent-soft: rgba(212, 93, 79, 0.14);
  --gold: #E0B05A; --gold-soft: rgba(224, 176, 90, 0.14);
  --moss: #34D96C; --blue: #6FA0CC; --teal: #6A8C88; --purple: #A88FD8;
  --danger: #FF2400; --grid: rgba(241, 236, 223, 0.10); --grid-strong: rgba(241, 236, 223, 0.18);
  --border: #3D352D;
  --cmp-red: #FF5C5C; --cmp-blue: #4BA8FF; --cmp-purple: #B78FFF; --cmp-green: #3BE577;
}
.pulse-kicker {
  color: var(--accent);
  font-size: 13px;
  letter-spacing: 0.14em;
  font-weight: 600;
}
.pulse-head { display: flex; align-items: center; gap: 44px; flex-wrap: wrap; }
.pulse-title { flex: 1; min-width: 260px; }
.pulse-title h1 { font-family: 'Noto Serif SC', serif; font-size: 44px; font-weight: 700; line-height: 1.2; }
.pulse-title .sub { color: var(--ink-muted); margin-top: 8px; font-size: 14.5px; max-width: 560px; }
/* 温度环：conic-gradient 圆环 + 中心大数字（纯 CSS，可克隆） */
.temp-ring {
  --pct: 0;
  width: 190px; height: 190px;
  border-radius: 50%;
  background:
    radial-gradient(closest-side, var(--bg) 82%, transparent 83% 100%),
    conic-gradient(var(--temp-color, #B8421E) calc(var(--pct) * 1%), var(--bg-deep) 0);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.temp-ring .val { font-family: 'JetBrains Mono', monospace; font-size: 44px; font-weight: 700; line-height: 1.1; }
.temp-ring .val em { font-style: normal; font-size: 20px; color: var(--ink-muted); }
.temp-ring .lbl { font-size: 12px; color: var(--ink-muted); letter-spacing: 0.08em; max-width: 132px; text-align: center; line-height: 1.25; }
/* 西语系文案更长，缩小字号+去字距，配合加宽的圆心区，确保落在浅色圆内不压到色环 */
html:not([lang^="zh"]) .temp-ring .lbl { font-size: 9.5px; letter-spacing: 0; }
.pulse-quotes { display: flex; gap: 10px; flex-wrap: wrap; }
.pq {
  border: 1px solid var(--border);
  background: var(--bg-card);
  border-radius: 8px;
  padding: 5px 11px;
  font-size: 12.5px;
  white-space: nowrap;
}
.pq b { font-family: 'JetBrains Mono', monospace; font-weight: 600; margin-left: 5px; }
/* 宽屏下四大指数强制一行 */
@media (min-width: 1000px) { .pulse-quotes { flex-wrap: nowrap; } }
/* 涨跌带 */
.breadth-bar { display: flex; height: 30px; border-radius: 8px; overflow: hidden; font-family: 'JetBrains Mono', monospace; font-size: 12px; }
.breadth-bar div { display: flex; align-items: center; justify-content: center; color: #fff; min-width: 40px; white-space: nowrap; padding: 0 8px; box-sizing: border-box; }
/* 西语系"平/flat/stable"更长，给窄段留足宽度不被截断 */
html:not([lang^="zh"]) .breadth-bar div { min-width: 62px; }
.breadth-note { color: var(--ink-muted); font-size: 12.5px; margin-top: 6px; }
/* 板块热力图（TradingView 官方 widget 容器）——始终暗色，做成嵌入式数据面板 */
.heat-tree {
  width: 100%;
  height: 620px;
  border-radius: 10px;
  overflow: hidden;
  background: #0e0e0e;               /* 与 TradingView dark 主题一致的深底，无缝框住 */
  border: 1px solid var(--border);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.25);
}
@media (max-width: 900px) { .heat-tree { height: 460px; } }
/* TradingView 版权小字：暗底上用浅灰，两种主题都可读 */
.tv-heatmap .tradingview-widget-copyright {
  font-size: 11px;
  line-height: 22px;
  text-align: right;
  padding: 0 8px;
  color: #7d7d7d;
}
.tv-heatmap .tradingview-widget-copyright a { color: #8f8f8f; text-decoration: none; }
/* 板块热力图（旧 11 格，保留样式以防复用） */
.heat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(128px, 1fr));
  gap: 10px;
}
.heat-tile {
  border-radius: 8px;
  padding: 12px 12px 10px;
  border: 1px solid var(--border);
}
.heat-tile .n { font-size: 13px; }
.heat-tile .c { font-family: 'JetBrains Mono', monospace; font-size: 17px; font-weight: 700; margin-top: 2px; }
.pulse-section-label {
  font-size: 12.5px;
  color: var(--ink-muted);
  letter-spacing: 0.1em;
  margin-bottom: 8px;
  font-weight: 600;
}
.pulse-foot { color: var(--ink-muted); font-size: 12px; margin-top: auto; line-height: 1.8; }

/* ---------- 二级胶囊导航（板块总览 ↔ 个股） ---------- */
.subnav {
  position: sticky;
  top: 58px;
  z-index: 90;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 12px 0;
  background: color-mix(in srgb, var(--bg) 94%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
  margin-bottom: 8px;
}
.pill {
  font-size: 13px;
  padding: 4px 14px;
  border-radius: 99px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--ink-muted);
  text-decoration: none;
  font-family: 'JetBrains Mono', 'Noto Sans SC', monospace;
}
.pill:hover { background: var(--bg-card-hover); color: var(--ink); }
.pill.active {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent-deep);
  font-weight: 600;
}
.pill .zh { font-family: 'Noto Sans SC', sans-serif; }
.cmp-chips { display: inline-flex; gap: 6px; vertical-align: middle; }
.cmp-chips .pill { font-size: 11.5px; padding: 2px 10px; cursor: pointer; }
.pill-group {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding-left: 12px;
  border-left: 1px dashed var(--border);
}
.pill-group:first-child { border-left: none; padding-left: 0; }
.pill-group-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--accent-deep);
  letter-spacing: 0.08em;
  white-space: nowrap;
}
.subnav .pill { font-size: 12.5px; padding: 3px 12px; }
/* 两行分组布局：锚胶囊纵跨两行 + 右侧行容器 */
.subnav .pill-anchor {
  align-self: stretch;
  display: flex;
  align-items: center;
  font-size: 15px;
  font-weight: 600;
  padding: 8px 20px;
}
.pill-rows {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
  min-width: 0;
}
.pill-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  align-items: center;
}

/* ---------- 个股专页 ---------- */
.stock-hero { margin: 20px 0 8px; }
.stock-hero h1 { font-family: 'Noto Serif SC', serif; font-size: 30px; font-weight: 700; }
.stock-hero .ticker {
  font-family: 'JetBrains Mono', monospace;
  color: var(--ink-muted);
  font-size: 14px;
  margin-left: 10px;
}
.stat-strip {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 12px;
  margin: 18px 0 8px;
}
@media (max-width: 900px) { .stat-strip { grid-template-columns: repeat(3, 1fr); } }
.stat-strip .stat .value { font-size: 20px; }
.stock-nav {
  display: flex;
  justify-content: space-between;
  margin: 30px 0 10px;
}
.stock-nav a { color: var(--accent-deep); text-decoration: none; font-size: 14px; }
.stock-nav a:hover { text-decoration: underline; }
tr.clickable { cursor: pointer; }
tr.clickable td:first-child { color: var(--accent-deep); font-weight: 600; }

/* ---------- 左侧悬浮章节目录 ---------- */
.toc {
  display: none;
  position: fixed;
  top: 116px;
  left: 18px;
  width: 176px;
  max-height: calc(100vh - 160px);
  overflow-y: auto;
  scrollbar-width: none;
  z-index: 95;
  padding: 4px;
}
.toc::-webkit-scrollbar { display: none; }
.toc.open { display: block; }
/* ≥1280px：目录常驻左栏，正文右移让位，互不遮挡 */
@media (min-width: 1280px) {
  .toc { display: block; }
  .toc-toggle { display: none; }
  .container {
    margin-left: max(214px, calc((100vw - 1180px) / 2));
    margin-right: max(24px, calc((100vw - 1180px) / 2));
  }
  /* 顶栏用尽全宽：语言/主题切换贴右缘，tab 栏空间最大化 */
  .topbar-inner {
    max-width: none;
    margin-left: max(214px, calc((100vw - 1180px) / 2));
    margin-right: 24px;
  }
}
/* 窄屏：☰ 展开为「抽屉 + 背景遮罩」，内容明显退到后面而非被目录压住 */
@media (max-width: 1279px) {
  .toc.open {
    width: min(264px, 76vw);
    max-height: calc(100vh - 132px);
    padding: 10px;
    background: var(--bg-card);          /* 不透明，杜绝内容透出 */
    border: 1px solid var(--border);
    border-radius: 10px;
    box-shadow: 0 10px 34px rgba(0, 0, 0, 0.28);
  }
  /* 全屏半透明遮罩：压暗正文、并承接「点击空白处关闭」 */
  .toc.open::before {
    content: "";
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.42);
    z-index: -1;
  }
}
.toc a {
  display: block;
  font-size: 12.5px;
  color: var(--ink-muted);
  text-decoration: none;
  border: 1px solid var(--border);
  background: var(--bg-card);
  border-radius: 6px;
  padding: 4px 10px;
  margin-bottom: 6px;
  font-family: 'JetBrains Mono', 'Noto Sans SC', monospace;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
/* 西语系目录条目更长：加宽目录列 + 缩小字号，保持单行 */
html:not([lang^="zh"]) .toc { width: 216px; }
html:not([lang^="zh"]) .toc a { font-size: 11.5px; }
@media (min-width: 1280px) {
  html:not([lang^="zh"]) .container,
  html:not([lang^="zh"]) .topbar-inner {
    margin-left: max(254px, calc((100vw - 1180px) / 2));
  }
}
.toc a:hover { color: var(--ink); background: var(--bg-card-hover); }
.toc a.active {
  border-color: var(--accent);
  color: var(--accent-deep);
  background: var(--accent-soft);
  font-weight: 600;
}
.toc-toggle {
  position: fixed;
  top: 72px;
  left: 18px;
  z-index: 96;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--ink);
  font-size: 15px;
  cursor: pointer;
}
.toc-toggle:hover { background: var(--bg-card-hover); }
/* 两行顶栏更高（≈98px），☰ 下移并置顶栏之上，避免被压住半截（须在基础规则之后覆盖） */
@media (max-width: 820px) {
  .toc-toggle { top: 106px; z-index: 101; }
}

/* ---------- 长表格 / 个股 logo / 数据条 ---------- */
.table-scroll { max-height: 440px; overflow-y: auto; }
th.left { text-align: left; }
.tbl-logo {
  width: 18px;
  height: 18px;
  border-radius: 4px;
  background: #fff;
  object-fit: contain;
  vertical-align: -4px;
  margin-right: 8px;
}
.table-scroll th { position: sticky; top: 0; background: var(--bg-card); z-index: 1; }
.stock-logo {
  width: 46px;
  height: 46px;
  border-radius: 10px;
  background: #fff;
  object-fit: contain;
  padding: 4px;
  border: 1px solid var(--border);
  vertical-align: middle;
  margin-right: 14px;
}
.stat-strip { grid-template-columns: repeat(auto-fit, minmax(148px, 1fr)); }
/* 个股 hero 的 7 张卡固定一行排满，避免最大回撤孤零零掉到第二行 */
.stock-hero .stat-strip { grid-template-columns: repeat(7, 1fr); }
@media (max-width: 1000px) { .stock-hero .stat-strip { grid-template-columns: repeat(4, 1fr); } }
.stock-hero .stat .value { font-size: 18px; }
/* ---------- 页脚合规区 ---------- */
.site-footer {
  border-top: 1px solid var(--border);
  color: var(--ink-muted);
  font-size: 12.5px;
  padding: 30px 24px 44px;
  max-width: 1180px;
  margin: 40px auto 0;
}
.footer-cols {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 24px;
  flex-wrap: wrap;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--border);
}
.footer-brand-col { flex: 1 1 240px; min-width: 0; }
.footer-brand { font-family: 'Noto Serif SC', serif; font-weight: 700; font-size: 16px; color: var(--ink); }
.footer-tag { margin-top: 4px; font-size: 12px; }
/* 链接区始终靠右：撑满剩余宽度、右对齐，即使换行也在右下而非左下 */
.footer-links { display: flex; flex-wrap: wrap; gap: 8px 18px; align-items: center; justify-content: flex-end; flex: 1 1 auto; }
.footer-links a { color: var(--ink-muted); text-decoration: none; white-space: nowrap; }
.footer-links a:hover { color: var(--accent-deep); }
.footer-note { margin-top: 16px; line-height: 1.7; }

/* ---------- 页脚静态页（关于/联系/隐私/条款/退款/定价） ---------- */
.doc-page { max-width: 760px; margin: 0 auto; }
.doc-body { font-size: 15px; line-height: 1.85; color: var(--ink); }
.doc-body h3 {
  font-family: 'Noto Serif SC', serif;
  font-size: 18px; font-weight: 700;
  margin: 30px 0 8px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border);
}
.doc-body p { margin: 0 0 12px; }
.doc-body ul { margin: 0 0 14px; padding-left: 22px; }
.doc-body li { margin-bottom: 6px; }
.doc-body a { color: var(--accent-deep); text-decoration: none; border-bottom: 1px solid color-mix(in srgb, var(--accent) 40%, transparent); }
.doc-body a:hover { border-bottom-color: var(--accent); }
.doc-body strong { color: var(--ink); font-weight: 600; }
.doc-fineprint { font-size: 12.5px; color: var(--ink-muted); margin-top: 16px; }
.contact-list { list-style: none; padding: 0; margin: 8px 0; }
.contact-list li { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 12px 0; border-bottom: 1px solid var(--border); }
.contact-list .c-icon { display: inline-flex; align-items: center; justify-content: center; width: 22px; flex-shrink: 0; }
.c-ic { width: 19px; height: 19px; fill: var(--ink); opacity: 0.8; }
.contact-list .c-label { min-width: 84px; color: var(--ink-muted); font-size: 13px; }
