/* ========================================================================
   CS2 分析台 — warm paper / editorial light
   ======================================================================== */
:root {
  /* warm paper neutrals (light) */
  --bg:        oklch(0.971 0.008 85);
  --bg-raise:  oklch(0.995 0.004 90);
  --bg-sink:   oklch(0.935 0.012 82);
  --line:      oklch(0.872 0.012 78);
  --line-soft: oklch(0.912 0.01 80);

  --ink:       oklch(0.265 0.022 62);
  --ink-dim:   oklch(0.44 0.022 66);
  --ink-faint: oklch(0.58 0.022 70);

  /* signature: firearm amber + tactical teal (darkened for light bg) */
  --amber:     oklch(0.6 0.16 54);
  --amber-hot: oklch(0.54 0.18 44);
  --teal:      oklch(0.52 0.1 205);

  /* heat ramp for success rate (red -> amber -> green) */
  --heat-lo:   oklch(0.56 0.21 28);
  --heat-mid:  oklch(0.7 0.15 78);
  --heat-hi:   oklch(0.56 0.15 152);

  /* chart colors (read by board.js so theme stays single-source) */
  --c-axis:    oklch(0.58 0.02 70);
  --c-bar:     oklch(0.74 0.03 72);
  --c-ink:     oklch(0.27 0.022 62);
  --c-ink-dim: oklch(0.46 0.022 66);

  --radius: 3px;
  --gutter: clamp(16px, 3vw, 40px);
  --maxw: 1280px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: "Noto Sans SC", "Space Grotesk", sans-serif;
  background:
    radial-gradient(120% 80% at 82% -12%, oklch(0.86 0.05 62 / 0.4), transparent 58%),
    var(--bg);
  color: var(--ink);
  line-height: 1.5;
  min-height: 100vh;
  letter-spacing: 0.01em;
}
h1, h2, h3 { font-family: "Space Grotesk", "Noto Sans SC", sans-serif; margin: 0; font-weight: 600; }
.num, .stat-num, .hero-rate-value, .dstat-num, .board td.num, .rate-cell { font-family: "Spline Sans Mono", monospace; font-variant-numeric: tabular-nums; }

.scanline { display: none; }

/* ===== masthead ===== */
.masthead {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; flex-wrap: wrap;
  padding: clamp(18px, 3vw, 28px) var(--gutter);
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, var(--bg-raise), transparent);
}
.brand { display: flex; align-items: center; gap: 16px; }
.brand-mark { display: flex; gap: 3px; align-items: flex-end; height: 26px; }
.brand-mark span { width: 5px; background: var(--amber); display: block; }
.brand-mark span:nth-child(1) { height: 12px; opacity: 0.5; }
.brand-mark span:nth-child(2) { height: 26px; }
.brand-mark span:nth-child(3) { height: 18px; opacity: 0.75; }
.brand-text h1 { font-size: clamp(20px, 2.6vw, 28px); letter-spacing: 0.04em; }
.brand-sub { margin: 2px 0 0; font-family: "Spline Sans Mono", monospace; font-size: 11px; color: var(--ink-faint); letter-spacing: 0.18em; }
.masthead-meta {
  display: flex; align-items: center; gap: 9px;
  font-family: "Spline Sans Mono", monospace; font-size: 12px; color: var(--ink-dim);
  border: 1px solid var(--line); padding: 7px 13px; border-radius: 100px;
  background: var(--bg-raise);
}
.meta-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--amber); box-shadow: 0 0 8px var(--amber); animation: pulse 2.2s ease-in-out infinite; }
.masthead-meta.ok .meta-dot { background: var(--heat-hi); box-shadow: 0 0 8px var(--heat-hi); }
.masthead-meta.err .meta-dot { background: var(--heat-lo); box-shadow: 0 0 8px var(--heat-lo); animation: none; }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.35; } }

main { max-width: var(--maxw); margin: 0 auto; padding: var(--gutter); display: flex; flex-direction: column; gap: clamp(20px, 2.6vw, 34px); }

/* ===== overview ===== */
.overview { display: grid; grid-template-columns: minmax(320px, 1.1fr) 1.6fr; gap: clamp(16px, 2.4vw, 30px); align-items: stretch; }
.hero-rate {
  position: relative; padding: clamp(22px, 3vw, 34px);
  border: 1px solid var(--line); border-radius: var(--radius);
  background:
    linear-gradient(135deg, oklch(0.6 0.16 54 / 0.08), transparent 55%),
    var(--bg-raise);
  overflow: hidden; box-shadow: 0 1px 2px oklch(0.5 0.02 70 / 0.04);
}
.hero-rate::before {
  content: ""; position: absolute; top: 0; left: 0; width: 4px; height: 100%;
  background: linear-gradient(var(--amber), var(--amber-hot));
}
.hero-rate-label { font-size: 13px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--ink-dim); font-family: "Spline Sans Mono", monospace; }
.hero-rate-value { display: flex; align-items: baseline; gap: 2px; margin: 6px 0 14px; line-height: 1; }
.hero-rate-value #ov-rate { font-size: clamp(54px, 8vw, 84px); font-weight: 600; color: var(--ink); letter-spacing: -0.02em; }
.hero-rate-value .pct { font-size: clamp(22px, 3vw, 32px); color: var(--amber); font-family: "Spline Sans Mono", monospace; }
.hero-rate-track { height: 6px; background: var(--bg-sink); border-radius: 100px; overflow: hidden; border: 1px solid var(--line-soft); }
.hero-rate-fill { height: 100%; width: 0; border-radius: 100px; transition: width 1.1s cubic-bezier(0.22, 1, 0.36, 1); }
.hero-rate-sub { margin-top: 12px; font-family: "Spline Sans Mono", monospace; font-size: 12.5px; color: var(--ink-faint); }

.stat-strip { display: grid; grid-template-columns: repeat(3, 1fr); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.stat { padding: clamp(20px, 3vw, 32px) clamp(16px, 2vw, 26px); background: var(--bg-raise); display: flex; flex-direction: column; justify-content: center; gap: 8px; position: relative; }
.stat + .stat { border-left: 1px solid var(--line-soft); }
.stat-num { font-size: clamp(30px, 4.4vw, 46px); font-weight: 600; line-height: 1; color: var(--ink); }
.stat-lbl { font-size: 12px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-faint); font-family: "Spline Sans Mono", monospace; }

/* ===== panels ===== */
.grid { display: grid; grid-template-columns: minmax(280px, 1fr) 1.5fr; gap: clamp(16px, 2.4vw, 30px); align-items: start; }
.panel { border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg-raise); box-shadow: 0 1px 2px oklch(0.5 0.02 70 / 0.04); }
.panel-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 18px 20px; border-bottom: 1px solid var(--line-soft); }
.panel-head h2 { font-size: 16px; letter-spacing: 0.02em; }
.panel-tag { font-family: "Spline Sans Mono", monospace; font-size: 10.5px; letter-spacing: 0.12em; color: var(--ink-faint); }
.panel-note { margin: 0; padding: 14px 20px 4px; font-size: 12.5px; color: var(--ink-dim); }

/* weapon list */
.weapon-list { padding: 14px 20px 20px; display: flex; flex-direction: column; gap: 12px; }
.weapon-list.mini { padding: 12px 0 0; gap: 9px; }
.weapon-row { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; align-items: center; }
.weapon-row .wname { font-size: 13.5px; color: var(--ink); font-weight: 500; }
.weapon-row .wmeta { font-family: "Spline Sans Mono", monospace; font-size: 12px; color: var(--ink-dim); white-space: nowrap; }
.weapon-row .wbar { grid-column: 1 / -1; height: 5px; background: var(--bg-sink); border-radius: 100px; overflow: hidden; border: 1px solid var(--line-soft); }
.weapon-row .wbar > span { display: block; height: 100%; border-radius: 100px; transition: width 0.9s cubic-bezier(0.22,1,0.36,1); }

/* charts */
.chart-wrap { padding: 8px 16px 18px; height: 260px; position: relative; }
.chart-wrap.small { height: 200px; padding: 8px 0 0; }
.svg-hist { width: 100%; height: 100%; }
.svg-hist svg { width: 100%; height: 100%; display: block; }
.hist-empty { display: flex; align-items: center; justify-content: center;
  height: 100%; color: var(--ink-faint); font-size: 13px;
  font-family: 'Spline Sans Mono', monospace; }

/* ===== leaderboard ===== */
.board-head { align-items: flex-end; }
.weapon-select { display: flex; flex-direction: column; gap: 5px; font-family: "Spline Sans Mono", monospace; font-size: 11px; letter-spacing: 0.12em; color: var(--ink-faint); text-transform: uppercase; }
.weapon-select select {
  appearance: none; background: var(--bg-raise); color: var(--ink); border: 1px solid var(--line);
  padding: 8px 30px 8px 12px; border-radius: var(--radius); font-family: "Noto Sans SC", sans-serif; font-size: 13px; cursor: pointer;
  background-image: linear-gradient(45deg, transparent 50%, var(--amber) 50%), linear-gradient(135deg, var(--amber) 50%, transparent 50%);
  background-position: calc(100% - 16px) center, calc(100% - 11px) center; background-size: 5px 5px, 5px 5px; background-repeat: no-repeat;
}
.weapon-select select:focus-visible { outline: 2px solid var(--amber); outline-offset: 1px; }

.table-scroll { overflow-x: auto; }
table.board { width: 100%; border-collapse: collapse; }
.board thead th {
  text-align: left; padding: 13px 18px; font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--ink-faint); font-family: "Spline Sans Mono", monospace; font-weight: 500;
  border-bottom: 1px solid var(--line); white-space: nowrap; user-select: none;
}
.board th.num, .board td.num { text-align: right; }
.board th.col-rank { width: 48px; text-align: center; }
.board th.sortable { cursor: pointer; transition: color 0.15s; }
.board th.sortable:hover { color: var(--ink); }
.board th.sortable::after { content: "↕"; margin-left: 6px; opacity: 0.3; font-size: 10px; }
.board th.sortable.asc::after { content: "↑"; opacity: 1; color: var(--amber); }
.board th.sortable.desc::after { content: "↓"; opacity: 1; color: var(--amber); }

.board tbody tr { border-bottom: 1px solid var(--line-soft); cursor: pointer; transition: background 0.13s; }
.board tbody tr:hover { background: oklch(0.6 0.16 54 / 0.06); }
.board tbody tr:last-child { border-bottom: none; }
.board td { padding: 13px 18px; font-size: 14px; vertical-align: middle; }
.board td.col-rank { text-align: center; font-family: "Spline Sans Mono", monospace; color: var(--ink-faint); font-size: 13px; }
.board tbody tr:nth-child(1) td.col-rank { color: var(--amber); font-weight: 600; }
.board .pname { font-weight: 500; color: var(--ink); }

/* heat rate cell: number + thin heat bar */
.rate-cell { display: inline-flex; flex-direction: column; align-items: flex-end; gap: 4px; min-width: 92px; }
.rate-cell .rval { font-size: 14px; }
.rate-cell .rbar { width: 100%; height: 4px; background: var(--bg-sink); border-radius: 100px; overflow: hidden; border: 1px solid var(--line-soft); }
.rate-cell .rbar > span { display: block; height: 100%; }

.empty { padding: 40px 20px; text-align: center; color: var(--ink-faint); font-family: "Spline Sans Mono", monospace; font-size: 13px; letter-spacing: 0.08em; }

/* ===== drawer ===== */
.drawer { position: fixed; inset: 0; z-index: 200; pointer-events: none; }
.drawer[aria-hidden="false"] { pointer-events: auto; }
.drawer-scrim { position: absolute; inset: 0; background: oklch(0.4 0.02 70 / 0.32); opacity: 0; transition: opacity 0.3s; backdrop-filter: blur(2px); }
.drawer[aria-hidden="false"] .drawer-scrim { opacity: 1; }
.drawer-panel {
  position: absolute; top: 0; right: 0; height: 100%; width: min(440px, 92vw);
  background: var(--bg); border-left: 1px solid var(--line);
  transform: translateX(100%); transition: transform 0.42s cubic-bezier(0.22, 1, 0.36, 1);
  overflow-y: auto; padding: clamp(20px, 3vw, 30px); display: flex; flex-direction: column; gap: 22px;
  box-shadow: -8px 0 30px oklch(0.5 0.02 70 / 0.12);
}
.drawer[aria-hidden="false"] .drawer-panel { transform: translateX(0); }
.drawer-close { position: absolute; top: 16px; right: 16px; background: var(--bg-raise); border: 1px solid var(--line); color: var(--ink-dim); width: 32px; height: 32px; border-radius: var(--radius); cursor: pointer; font-size: 13px; transition: all 0.15s; }
.drawer-close:hover { color: var(--ink); border-color: var(--amber); }
.drawer-head { padding-right: 40px; }
.drawer-name { font-family: "Space Grotesk", sans-serif; font-size: 24px; font-weight: 600; }
.drawer-id { font-family: "Spline Sans Mono", monospace; font-size: 12px; color: var(--ink-faint); margin-top: 4px; }
.drawer-stats { display: grid; grid-template-columns: repeat(3, 1fr); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.dstat { padding: 16px 12px; background: var(--bg-raise); text-align: center; }
.dstat + .dstat { border-left: 1px solid var(--line-soft); }
.dstat-num { font-size: 24px; font-weight: 600; }
.dstat-lbl { font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-faint); font-family: "Spline Sans Mono", monospace; margin-top: 4px; }
.drawer-section h3 { font-size: 13px; letter-spacing: 0.08em; color: var(--ink-dim); text-transform: uppercase; font-family: "Spline Sans Mono", monospace; }

/* ===== entrance animation ===== */
.reveal { opacity: 0; transform: translateY(12px); animation: reveal 0.6s cubic-bezier(0.22, 1, 0.36, 1) forwards; }
@keyframes reveal { to { opacity: 1; transform: none; } }

/* ===== responsive ===== */
@media (max-width: 880px) {
  .overview { grid-template-columns: 1fr; }
  .grid { grid-template-columns: 1fr; }
}
@media (max-width: 520px) {
  .stat-strip { grid-template-columns: 1fr; }
  .stat + .stat { border-left: none; border-top: 1px solid var(--line-soft); }
  .board td, .board thead th { padding: 11px 12px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
  .scanline { display: none; }
}

/* ===== 猜想板 ===== */
.board-nav { display: flex; align-items: center; gap: 14px; }
.nav-link { color: var(--amber); text-decoration: none; font-size: 13px;
  font-family: 'Spline Sans Mono', monospace; padding: 4px 10px;
  border: 1px solid var(--line); border-radius: 3px; }
.nav-link:hover { background: var(--bg-sink); }
.board-intro { color: var(--ink-dim); font-size: 13px; margin: 4px 0 20px;
  max-width: 760px; line-height: 1.6; }
.qboard { display: flex; flex-direction: column; gap: 22px; }
.qcard { background: var(--bg-raise); border: 1px solid var(--line);
  border-radius: 4px; padding: 20px 22px; box-shadow: 0 1px 2px oklch(0.5 0.02 70 / 0.05); }
.qcard-head { display: flex; justify-content: space-between; align-items: baseline;
  gap: 16px; flex-wrap: wrap; }
.qcard-head h2 { font-size: 20px; font-weight: 600; margin: 0;
  color: var(--ink); }
.verdict { font-family: 'Spline Sans Mono', monospace; font-size: 12.5px;
  color: oklch(0.46 0.13 150); background: oklch(0.9 0.06 150 / 0.6);
  border: 1px solid oklch(0.78 0.09 150 / 0.6); border-radius: 3px;
  padding: 3px 10px; white-space: nowrap; }
.hypothesis { color: var(--ink-dim); font-size: 14px; margin: 12px 0 6px;
  line-height: 1.55; }
.method { color: var(--ink-faint); font-size: 12px; margin: 8px 0 0;
  line-height: 1.5; }
.tag { display: inline-block; font-family: 'Spline Sans Mono', monospace;
  font-size: 10px; letter-spacing: 0.04em; color: var(--amber);
  border: 1px solid oklch(0.7 0.1 54 / 0.5); border-radius: 3px;
  padding: 1px 6px; margin-right: 8px; vertical-align: middle; }
.tag.dim { color: var(--ink-faint); border-color: var(--line); }
.qcard .chart-wrap { height: auto; padding: 14px 0 4px; }
.card-svg { width: 100%; height: auto; display: block; }
.card-drill { display: inline-block; margin-top: 14px; font-size: 13px;
  font-family: 'Space Grotesk','Noto Sans SC',sans-serif; color: var(--amber);
  text-decoration: none; border: 1px solid oklch(0.7 0.1 54 / 0.45); border-radius: 4px;
  padding: 7px 14px; transition: background .15s, border-color .15s; }
.card-drill:hover { background: oklch(0.6 0.16 54 / 0.08); border-color: var(--amber); }
.rank-toggle { display:inline-block; margin-top:10px; font-size:12.5px;
  font-family:'Spline Sans Mono',monospace; color: var(--ink-dim); cursor:pointer;
  background: var(--bg-sink); border:1px solid var(--line); border-radius:4px;
  padding:6px 13px; transition: color .15s, border-color .15s, background .15s; }
.rank-toggle:hover { color: var(--ink); border-color: var(--amber); background: oklch(0.6 0.16 54 / 0.06); }
.board-empty { color: var(--ink-faint); padding: 40px; text-align: center; }

/* 判读标准说明块(分布卡上方) */
.explain { background: oklch(0.96 0.012 80); border: 1px solid var(--line);
  border-left: 2px solid var(--amber); border-radius: 0 4px 4px 0;
  padding: 10px 14px; margin: 10px 0 4px; }
.explain ul { margin: 6px 0 0; padding-left: 18px; }
.explain li { color: var(--ink-dim); font-size: 12.5px; line-height: 1.6; margin: 2px 0; }

/* 量化控制表(开火速度控制) */
.ctrl-wrap { margin-top: 10px; overflow-x: auto; }
.ctrl-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.ctrl-table th { text-align: left; color: var(--ink-dim); font-weight: 400;
  font-family: 'Spline Sans Mono', monospace; font-size: 11px; padding: 6px 10px;
  border-bottom: 1px solid var(--line); }
.ctrl-table th.r { text-align: right; }
.ctrl-table .th-sub { font-size: 9px; opacity: 0.7; }
.ctrl-table td { padding: 9px 10px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
.ctrl-table td.r { text-align: right; }
.ctrl-table td.mono { font-family: 'Spline Sans Mono', monospace; }
.ctrl-table tr.hl td { background: oklch(0.6 0.16 54 / 0.07); }
.ctrl-table tr.hl .lbl { color: var(--ink); font-weight: 600; }
.ctrl-table .lbl { color: var(--ink); }
.ctrl-table .lbl .n { color: var(--ink-faint); font-size: 10px; font-family: 'Spline Sans Mono', monospace; margin-left: 7px; }
.ctrl-table .stack { display: flex; height: 16px; min-width: 220px; border-radius: 3px; overflow: hidden; background: var(--bg-sink); }
.ctrl-table .seg { display: flex; align-items: center; justify-content: center;
  font-size: 9.5px; font-family: 'Spline Sans Mono', monospace; color: oklch(0.99 0.01 90); overflow: hidden; }
.ctrl-table .seg.g  { background: oklch(0.62 0.15 152); }
.ctrl-table .seg.a  { background: oklch(0.72 0.15 78); color: oklch(0.25 0.02 60); }
.ctrl-table .seg.rn { background: oklch(0.58 0.19 28); color: oklch(0.98 0.02 28); }
.ctrl-table .std-good { color: oklch(0.5 0.14 150); }
.ctrl-table .std-mid  { color: var(--ink-dim); }
.ctrl-table .std-bad  { color: oklch(0.55 0.18 32); }

/* 排行榜口径说明(可展开) */
.kpi-note { margin: 0 20px 12px; border: 1px solid var(--line); border-radius: 4px;
  background: oklch(0.96 0.012 80); }
.kpi-note summary { cursor: pointer; padding: 9px 14px; font-size: 12.5px;
  color: var(--amber); font-family: 'Spline Sans Mono', monospace; user-select: none; }
.kpi-note summary:hover { color: var(--amber-hot); }
.kpi-note[open] summary { border-bottom: 1px solid var(--line-soft); }
.kpi-note ul { margin: 8px 0; padding: 0 18px 4px 32px; }
.kpi-note li { color: var(--ink-dim); font-size: 12.5px; line-height: 1.7; margin: 4px 0; }
.kpi-note b { color: var(--ink); font-weight: 600; }
.kpi-note a { color: var(--amber); }

/* 统一顶部导航(所有页共用) */
.topnav { display: flex; gap: 4px; margin-left: auto; }
.topnav a { font-family: 'Space Grotesk','Noto Sans SC',sans-serif; font-size: 14px;
  color: var(--ink-dim); text-decoration: none; padding: 7px 16px; border-radius: 4px;
  border: 1px solid transparent; transition: background .15s, color .15s; }
.topnav a:hover { background: var(--bg-sink); color: var(--ink); }
.topnav a.active { color: oklch(0.99 0.01 90); background: var(--amber);
  font-weight: 600; }
.masthead .masthead-meta { margin-left: 14px; }

/* ============ 首页:分析档案门户 ============ */
body.home { background:
    radial-gradient(130% 90% at 88% -8%, oklch(0.85 0.06 60 / 0.45), transparent 56%),
    var(--bg); }
.site-head { display:flex; align-items:center; justify-content:space-between;
  padding: 16px clamp(20px,4vw,56px); border-bottom:1px solid var(--line);
  position:sticky; top:0; z-index:50; backdrop-filter:saturate(1.2) blur(6px);
  background: oklch(0.97 0.008 85 / 0.85); }
.brand { display:flex; align-items:center; gap:11px; text-decoration:none; }
a.brand { cursor:pointer; }
.brand-name { font-family:'Space Grotesk',sans-serif; font-weight:600; font-size:16px;
  letter-spacing:0.02em; color: var(--ink); }

.hero { max-width:1180px; margin:0 auto; padding: clamp(34px,6vw,72px) clamp(20px,4vw,56px) clamp(20px,3vw,34px); }
.hero .kicker { font-family:'Spline Sans Mono',monospace; font-size:12px; letter-spacing:0.16em;
  color: var(--amber); margin:0 0 18px; }
.hero h1 { font-family:'Space Grotesk','Noto Sans SC',sans-serif; font-weight:600;
  font-size: clamp(26px,3.4vw,40px); line-height:1.1; letter-spacing:-0.01em;
  color: var(--ink); margin:0; max-width:20ch; }
.hero-lead { color: var(--ink-dim); font-size:15px; line-height:1.6; margin:20px 0 0; max-width:54ch; }
.hero-stats { display:flex; flex-wrap:wrap; gap: clamp(20px,4vw,52px); margin:30px 0 0; padding:0; }
.hero-stats div { display:flex; flex-direction:column; }
.hero-stats dt { order:2; font-size:11px; letter-spacing:0.12em; text-transform:uppercase;
  color: var(--ink-faint); font-family:'Spline Sans Mono',monospace; margin-top:5px; }
.hero-stats dd { order:1; margin:0; font-family:'Space Grotesk',sans-serif; font-weight:600;
  font-size: clamp(26px,4vw,40px); color: var(--ink); line-height:1; }

.layout { max-width:1180px; margin:0 auto; padding: 8px clamp(20px,4vw,56px) 80px;
  display:grid; grid-template-columns: 196px minmax(0,1fr); gap: clamp(24px,4vw,52px);
  align-items:start; }
.index-rail { position:sticky; top:78px; align-self:start; display:flex; flex-direction:column; gap:18px;
  max-height: calc(100vh - 96px); overflow:auto; padding-right:4px; }
.rail-group .rail-cat { display:flex; align-items:center; justify-content:space-between;
  font-family:'Space Grotesk',sans-serif; font-size:12.5px; font-weight:600; letter-spacing:0.02em;
  color: var(--ink); margin:0 0 7px; }
.rail-group .rail-cat span { font-family:'Spline Sans Mono',monospace; font-size:10px;
  color: var(--ink-faint); }
.index-rail ul { list-style:none; margin:0; padding:0; border-left:1px solid var(--line); }
.index-rail li a { display:block; padding:4px 0 4px 12px; margin-left:-1px; font-size:12.5px;
  color: var(--ink-dim); text-decoration:none; border-left:2px solid transparent;
  line-height:1.35; transition: color .15s, border-color .15s; }
.index-rail li a:hover { color: var(--ink); }
.index-rail li a.here { color: var(--amber-hot); border-left-color: var(--amber); }

.board-sections { display:flex; flex-direction:column; gap: clamp(40px,6vw,64px); min-width:0; }
.cat-section { display:flex; flex-direction:column; gap:20px; scroll-margin-top:80px; }
.cat-head { display:flex; align-items:baseline; gap:14px; padding-bottom:12px;
  border-bottom:1px solid var(--line); }
.cat-head .cat-num { font-family:'Spline Sans Mono',monospace; font-size:13px; color: var(--amber); }
.cat-head h2 { font-family:'Space Grotesk','Noto Sans SC',sans-serif; font-weight:600;
  font-size: clamp(20px,2.6vw,26px); color: var(--ink); margin:0; letter-spacing:-0.01em; }
.cat-head .cat-count { margin-left:auto; font-family:'Spline Sans Mono',monospace; font-size:11px;
  color: var(--ink-faint); }
.board-sections .qcard { scroll-margin-top:80px; }

@media (max-width: 820px) {
  .layout { grid-template-columns: 1fr; }
  .index-rail { display:none; }
}
main.board-sections { max-width:none; margin:0; padding:0; }

/* 容器约束:让宽表(控速表)在卡片内横向滚动,不把整页撑宽 */
.cat-section, .qcard { min-width: 0; }
.ctrl-wrap, .table-scroll, .card-svg { max-width: 100%; }
@media (max-width: 560px) {
  .hero h1 { font-size: clamp(24px, 7vw, 32px); }
  .qcard { padding: 16px 15px; }
  .qcard-head { gap: 8px 12px; }
  .qcard-head h2 { font-size: 17px; line-height: 1.3; }
  .verdict { font-size: 11.5px; }
}

/* 顶栏右上角作者签名 */
.topnav-sig { font: 12px "Spline Sans Mono", monospace; color: var(--ink-faint); letter-spacing: 0.03em; }
.topnav-sig b { color: var(--amber-hot); font-weight: 600; letter-spacing: 0.06em; }

/* 移动端横向分类目录(桌面隐藏;窄屏侧栏 rail 被隐藏后用它跳转分类) */
.toc-mobile { display: none; }
@media (max-width: 820px) {
  .toc-mobile { display: flex; gap: 8px; overflow-x: auto; -webkit-overflow-scrolling: touch;
    position: sticky; top: 0; z-index: 30; padding: 9px clamp(14px, 4vw, 20px);
    background: oklch(0.98 0.008 85 / 0.93); backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--line-soft); scrollbar-width: none; }
  .toc-mobile::-webkit-scrollbar { display: none; }
  .toc-mobile a { flex: 0 0 auto; font: 12.5px "Spline Sans Mono", monospace; color: var(--ink-dim);
    background: var(--bg-sink); border: 1px solid var(--line-soft); border-radius: 100px;
    padding: 5px 12px; white-space: nowrap; text-decoration: none; }
  .toc-mobile a:active { color: var(--ink); border-color: var(--amber); }
  .cat-section { scroll-margin-top: 52px; }   /* 锚点跳转时让标题落在 sticky 目录条下方 */
}

/* 页脚签名 */
.site-foot { max-width: 1180px; margin: 48px auto 0; padding: 22px clamp(20px,4vw,56px) 44px;
  display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap;
  border-top: 1px solid var(--line-soft);
  font-family: "Spline Sans Mono", monospace; font-size: 12px; color: var(--ink-faint); letter-spacing: 0.03em; }
.site-foot .sig b { color: var(--amber-hot); font-weight: 600; letter-spacing: 0.06em; }

/* 排名榜:真实 DOM 行(替代固定宽 SVG)。桌面单行;窄屏分两行,文字用真 px 不被缩糊 */
.rank { list-style: none; margin: 0; padding: 0; }
.rank-row { display: grid; align-items: center;
  grid-template-columns: 26px minmax(56px, 116px) 1fr auto minmax(0, max-content);
  grid-template-areas: "no name bar val detail";
  column-gap: 10px; min-height: 30px; }
.rank-row + .rank-row { border-top: 1px solid var(--line-soft); }
.rk-no { grid-area: no; text-align: right; color: var(--ink-faint); font: 12px "Spline Sans Mono", monospace; }
.rk-name { grid-area: name; color: var(--ink-dim); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rank-row.hot .rk-name { color: var(--ink); font-weight: 700; }
.rk-bar { grid-area: bar; height: 16px; background: var(--bg-sink); border-radius: 3px; overflow: hidden; }
.rk-bar i { display: block; height: 100%; background: oklch(0.74 0.03 72); border-radius: 3px; }
.rank-row.hot .rk-bar i { background: var(--amber); }
.rk-val { grid-area: val; text-align: right; min-width: 42px; color: var(--ink-dim); font: 12px "Spline Sans Mono", monospace; }
.rank-row.hot .rk-val { color: var(--ink); }
.rk-detail { grid-area: detail; justify-self: end; font-size: 10.5px; color: var(--ink-faint);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 560px) {
  .rank-row { grid-template-columns: 22px 1fr auto;
    grid-template-areas: "no name val" "no bar bar" "no detail detail";
    row-gap: 3px; padding: 8px 0; }
  .rk-name { font-size: 14px; }
  .rk-detail { justify-self: start; white-space: normal; }
}

/* 顶导航移动端:6 个链接 + 签名在窄屏会横向溢出(site-head 无 wrap 且 sticky) */
@media (max-width: 700px) {
  .site-head { flex-wrap: wrap; row-gap: 2px; }
  .topnav { flex-wrap: wrap; gap: 2px; margin-left: 0; }
  .topnav a { font-size: 12.5px; padding: 5px 10px; }
  .topnav-sig { display: none; }   /* 签名让位,页脚仍有 made by HOPE */
}

/* 窄屏图表:720 宽的 SVG 缩到 340px 时字号只剩 ~4px 不可读 —— 改为保住最小宽度+横向滚动 */
@media (max-width: 560px) {
  .chart-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .chart-wrap .card-svg { min-width: 580px; }
}
