:root {
  --bg: #f6f7f9;
  --surface: #ffffff;
  --surface-2: #f0f2f5;
  --surface-3: #e7eaef;
  --border: #e1e5ea;
  --border-strong: #cdd3db;
  --text: #1a1f26;
  --text-2: #48515c;
  --text-3: #7b8490;
  --accent: #3b5bdb;
  --accent-2: #4c6ef5;
  --accent-soft: #e9eeff;
  --ok: #2b8a3e;
  --warn: #d9480f;
  --c-sign: #e8590c;
  --c-exp: #3b5bdb;
  --c-man: #0ca678;
  --c-int: #7048e8;
  --c-scale: #f59f00;
  --shadow: 0 1px 2px rgba(16, 24, 40, 0.04), 0 1px 3px rgba(16, 24, 40, 0.06);
  --radius: 12px;
  --radius-sm: 8px;
  --font: system-ui, -apple-system, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC", "Noto Sans SC", sans-serif;
  --mono: "JetBrains Mono", "SFMono-Regular", Menlo, Consolas, "Liberation Mono", monospace;
  --chip-l: 38%;
  --chip-bg-l: 95%;
  --chip-s: 65%;
  color-scheme: light;
}

[data-theme="dark"] {
  --bg: #0d1015;
  --surface: #151a21;
  --surface-2: #1b2129;
  --surface-3: #232a34;
  --border: #29303a;
  --border-strong: #38414d;
  --text: #e6e9ee;
  --text-2: #b4bcc7;
  --text-3: #858f9c;
  --accent: #8ea6ff;
  --accent-2: #748ffc;
  --accent-soft: #1e2847;
  --ok: #51cf66;
  --warn: #ff8f5a;
  --c-sign: #ff922b;
  --c-exp: #748ffc;
  --c-man: #38d9a9;
  --c-int: #9775fa;
  --c-scale: #fcc419;
  --shadow: none;
  --chip-l: 74%;
  --chip-bg-l: 19%;
  --chip-s: 55%;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 76px; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
code {
  font-family: var(--mono);
  font-size: 0.86em;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 0.05em 0.35em;
  white-space: nowrap;
}
strong { font-weight: 650; }
button, input, select { font: inherit; color: inherit; }
.container { max-width: 1200px; margin: 0 auto; padding: 0 24px; }
.muted { color: var(--text-3); }
.small { font-size: 13px; }
.mono { font-family: var(--mono); }

/* ---------- top bar ---------- */
.progress-line {
  position: fixed; top: 0; left: 0; height: 3px; width: 0;
  background: var(--accent); z-index: 60; transition: width 0.4s ease;
}
.topbar {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(160%) blur(12px);
  -webkit-backdrop-filter: saturate(160%) blur(12px);
  border-bottom: 1px solid var(--border);
}
.topbar .container { display: flex; align-items: center; gap: 20px; height: 60px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; color: var(--text); white-space: nowrap; }
.brand:hover { text-decoration: none; }
.brand-mark { width: 26px; height: 26px; }
.nav { display: flex; gap: 4px; margin-left: auto; overflow-x: auto; scrollbar-width: none; }
.nav::-webkit-scrollbar { display: none; }
.nav a {
  color: var(--text-2); padding: 6px 11px; border-radius: 8px; font-size: 14px; white-space: nowrap;
}
.nav a:hover { background: var(--surface-2); text-decoration: none; color: var(--text); }
.nav a.active { color: var(--accent); background: var(--accent-soft); }
.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; border-radius: 9px; border: 1px solid var(--border);
  background: var(--surface); color: var(--text-2); cursor: pointer; flex: none;
}
.icon-btn:hover { color: var(--text); border-color: var(--border-strong); }
.icon-btn svg { width: 18px; height: 18px; }

/* ---------- sections ---------- */
section { padding: 72px 0 24px; }
.section-head { margin-bottom: 28px; max-width: 820px; }
.eyebrow {
  display: inline-block; font-size: 12px; font-weight: 650; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--accent); margin-bottom: 8px;
}
h1, h2, h3, h4 { line-height: 1.3; margin: 0; letter-spacing: -0.01em; }
h2 { font-size: 28px; font-weight: 750; margin-bottom: 10px; }
h3 { font-size: 18px; font-weight: 700; }
h4 { font-size: 15px; font-weight: 700; }
.section-head p { color: var(--text-2); margin: 0; font-size: 16px; }
.sub-head { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; margin: 44px 0 16px; }
.sub-head h3 { font-size: 20px; }
.sub-head p { margin: 0; color: var(--text-3); font-size: 14px; }

.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.card-pad { padding: 22px; }
.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

/* ---------- hero ---------- */
.hero { padding: 64px 0 32px; }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 40px; align-items: center; }
.hero h1 { font-size: 44px; font-weight: 800; letter-spacing: -0.02em; margin-bottom: 16px; }
.hero h1 .hl { color: var(--accent); }
.hero .lead { font-size: 17px; color: var(--text-2); margin: 0 0 24px; max-width: 640px; }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; }
.btn {
  display: inline-flex; align-items: center; gap: 8px; padding: 10px 18px; border-radius: 10px;
  border: 1px solid var(--border); background: var(--surface); color: var(--text); font-weight: 600;
  cursor: pointer; font-size: 14px;
}
.btn:hover { text-decoration: none; border-color: var(--border-strong); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
[data-theme="dark"] .btn.primary { color: #0d1015; }
.btn.primary:hover { filter: brightness(1.06); }
.btn.sm { padding: 6px 12px; font-size: 13px; border-radius: 8px; }
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-top: 32px; }
.stat { padding: 14px 16px; }
.stat b { display: block; font-size: 26px; font-weight: 800; line-height: 1.2; }
.stat span { color: var(--text-3); font-size: 13px; }
.hero-progress { padding: 26px; display: flex; flex-direction: column; align-items: center; gap: 14px; }
.ring { position: relative; width: 168px; height: 168px; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring .ring-bg { stroke: var(--surface-3); }
.ring .ring-fg { stroke: var(--accent); transition: stroke-dashoffset 0.5s ease; }
.ring-label { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.ring-label b { font-size: 34px; font-weight: 800; line-height: 1; }
.ring-label span { color: var(--text-3); font-size: 13px; margin-top: 6px; }
.stage-mini { width: 100%; display: grid; gap: 8px; }
.stage-mini-row { display: grid; grid-template-columns: 74px 1fr 40px; align-items: center; gap: 10px; font-size: 13px; }
.stage-mini-row .bar { height: 6px; }
.bar { height: 8px; border-radius: 99px; background: var(--surface-3); overflow: hidden; }
.bar > i { display: block; height: 100%; width: 0; border-radius: 99px; background: var(--c, var(--accent)); transition: width 0.4s ease; }

/* ---------- timeline ---------- */
.timeline { padding: 20px 22px 22px; overflow-x: auto; }
.tl-grid { min-width: 760px; display: grid; grid-template-columns: 150px repeat(10, minmax(0, 1fr)); gap: 6px 4px; align-items: center; }
.tl-week { text-align: center; font-size: 12px; color: var(--text-3); padding-bottom: 4px; }
.tl-label { font-size: 13px; font-weight: 600; color: var(--text-2); white-space: nowrap; }
.tl-bar {
  height: 34px; border-radius: 8px; display: flex; align-items: center; padding: 0 12px; gap: 8px;
  font-size: 13px; font-weight: 600; color: #fff; cursor: pointer; border: 0; text-align: left;
  background: var(--c); white-space: nowrap; overflow: hidden;
}
[data-theme="dark"] .tl-bar { color: #0d1015; }
.tl-bar:hover { filter: brightness(1.08); }
.tl-bar small { font-weight: 500; opacity: 0.85; }

/* ---------- stages ---------- */
.tabs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.tab {
  display: flex; align-items: center; gap: 10px; padding: 9px 14px; border-radius: 10px; cursor: pointer;
  border: 1px solid var(--border); background: var(--surface); color: var(--text-2); font-weight: 600; font-size: 14px;
}
.tab .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--c); }
.tab .pct { font-size: 12px; color: var(--text-3); font-weight: 500; }
.tab:hover { border-color: var(--border-strong); color: var(--text); }
.tab.active { border-color: var(--c); color: var(--text); box-shadow: inset 0 0 0 1px var(--c); }
.stage-panel { padding: 0; overflow: hidden; }
.stage-top { padding: 24px 26px 20px; border-bottom: 1px solid var(--border); display: grid; grid-template-columns: minmax(0, 1fr) 260px; gap: 24px; align-items: start; }
.stage-top .weeks { display: inline-block; font-size: 12px; font-weight: 700; color: var(--c); background: color-mix(in srgb, var(--c) 12%, transparent); padding: 2px 10px; border-radius: 99px; margin-bottom: 10px; }
.stage-top h3 { font-size: 24px; margin-bottom: 8px; }
.stage-top .goal { color: var(--text); font-weight: 600; margin: 0 0 6px; }
.stage-top .intro { color: var(--text-2); margin: 0; }
.stage-meter { background: var(--surface-2); border-radius: 10px; padding: 14px 16px; }
.stage-meter .row { display: flex; justify-content: space-between; font-size: 13px; color: var(--text-3); margin-bottom: 8px; }
.stage-meter .row b { color: var(--text); font-size: 20px; }
.stage-body { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); }
.stage-col { padding: 22px 26px; }
.stage-col + .stage-col { border-left: 1px solid var(--border); background: color-mix(in srgb, var(--surface-2) 45%, var(--surface)); }
.col-title { font-size: 12px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-3); margin: 0 0 12px; display: flex; justify-content: space-between; }
.col-title + * { margin-top: 0; }
.col-block + .col-block { margin-top: 24px; }
.check-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.check-item { display: grid; grid-template-columns: 22px 1fr; gap: 10px; padding: 10px 10px; border-radius: 10px; cursor: pointer; }
.check-item:hover { background: var(--surface-2); }
.check-item input { display: none; }
.check-box {
  width: 20px; height: 20px; border-radius: 6px; border: 1.5px solid var(--border-strong); margin-top: 2px;
  display: flex; align-items: center; justify-content: center; transition: all 0.15s ease; background: var(--surface);
}
.check-box svg { width: 13px; height: 13px; stroke: #fff; opacity: 0; }
.check-item input:checked + .check-box { background: var(--c, var(--accent)); border-color: var(--c, var(--accent)); }
.check-item input:checked + .check-box svg { opacity: 1; }
[data-theme="dark"] .check-box svg { stroke: #0d1015; }
.check-item .ttl { font-weight: 650; display: block; }
.check-item .txt { color: var(--text-2); font-size: 14px; }
.check-item .txt.solo { color: var(--text); }
.check-item.done .ttl { color: var(--text-3); text-decoration: line-through; text-decoration-color: var(--border-strong); }
.res-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.res-list li { display: grid; grid-template-columns: 1fr auto; gap: 10px; padding: 7px 0; border-bottom: 1px dashed var(--border); font-size: 14px; }
.res-list li:last-child { border-bottom: 0; }
.res-list .by { color: var(--text-3); font-size: 12px; white-space: nowrap; }
.res-list .note { display: block; color: var(--text-3); font-size: 12px; }
.bar-line { margin-top: 24px; padding: 12px 14px; border-radius: 10px; background: color-mix(in srgb, var(--c) 9%, transparent); border: 1px solid color-mix(in srgb, var(--c) 28%, transparent); font-size: 14px; }
.bar-line b { color: var(--c); }

/* ---------- quiz ---------- */
.qa { border: 1px solid var(--border); border-radius: 10px; background: var(--surface); }
.qa + .qa { margin-top: 8px; }
.qa summary { list-style: none; cursor: pointer; padding: 12px 14px; display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: start; font-weight: 600; font-size: 14px; }
.qa summary::-webkit-details-marker { display: none; }
.qa summary .qtag { font-size: 11px; font-weight: 700; color: var(--c, var(--accent)); background: color-mix(in srgb, var(--c, var(--accent)) 12%, transparent); padding: 1px 8px; border-radius: 99px; margin-top: 2px; white-space: nowrap; }
.qa summary .chev { width: 16px; height: 16px; color: var(--text-3); transition: transform 0.2s; margin-top: 3px; }
.qa[open] summary .chev { transform: rotate(180deg); }
.qa .ans { padding: 0 14px 14px 14px; color: var(--text-2); font-size: 14px; border-top: 1px dashed var(--border); margin: 0 14px; padding: 12px 0 14px; }
.qa .ans::before { content: "答题要点"; display: block; font-size: 12px; font-weight: 700; color: var(--text-3); margin-bottom: 4px; }

/* ---------- parallel matrix ---------- */
.table-wrap { overflow-x: auto; }
table.matrix { width: 100%; border-collapse: collapse; font-size: 14px; min-width: 980px; }
.matrix th, .matrix td { padding: 11px 12px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: top; }
.matrix thead th { font-size: 12px; font-weight: 700; color: var(--text-3); letter-spacing: 0.04em; background: var(--surface-2); position: sticky; top: 0; }
.matrix tbody tr:hover { background: color-mix(in srgb, var(--surface-2) 60%, transparent); }
.matrix td.name { font-weight: 700; white-space: nowrap; }
.matrix th.dotcol, .matrix td.dotcol { text-align: center; width: 54px; padding-left: 4px; padding-right: 4px; }
.sdot { display: inline-block; width: 14px; height: 14px; border-radius: 50%; border: 1.5px solid var(--border-strong); vertical-align: middle; }
.sdot.on { background: var(--accent); border-color: var(--accent); }
.sdot.half { background: linear-gradient(90deg, var(--accent) 50%, transparent 50%); border-color: var(--accent); }
.legend { display: flex; gap: 18px; flex-wrap: wrap; font-size: 13px; color: var(--text-3); padding: 12px 16px; border-top: 1px solid var(--border); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }

/* ---------- device mesh ---------- */
.controls { display: flex; flex-wrap: wrap; gap: 14px 18px; align-items: flex-end; }
.field { display: grid; gap: 4px; font-size: 13px; color: var(--text-3); }
.field select, .field input[type="number"], .field input[type="text"] {
  height: 36px; min-width: 96px; padding: 0 10px; border-radius: 8px; border: 1px solid var(--border);
  background: var(--surface); color: var(--text); font-size: 14px;
}
.field input[type="range"] { width: 200px; accent-color: var(--accent); }
.field select:focus, .field input:focus { outline: 2px solid color-mix(in srgb, var(--accent) 40%, transparent); outline-offset: 1px; }
.mesh-wrap { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 20px; margin-top: 18px; }
.mesh-nodes { display: grid; gap: 10px; }
.mesh-node { display: grid; grid-template-columns: 64px 1fr; align-items: center; gap: 10px; }
.mesh-node .nlabel { font-size: 12px; color: var(--text-3); font-weight: 600; }
.mesh-gpus { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 6px; padding: 8px; border: 1px dashed var(--border-strong); border-radius: 10px; }
.gpu {
  border-radius: 8px; padding: 6px 4px; text-align: center; font-size: 11px; line-height: 1.35; cursor: default;
  background: hsl(var(--h) var(--chip-s) var(--chip-bg-l)); color: hsl(var(--h) var(--chip-s) var(--chip-l));
  border: 2px solid transparent; transition: transform 0.1s, border-color 0.1s, opacity 0.15s;
}
.gpu b { display: block; font-size: 12px; }
.mesh-nodes.hovering .gpu { opacity: 0.35; }
.mesh-nodes.hovering .gpu.g-tp, .mesh-nodes.hovering .gpu.g-dp, .mesh-nodes.hovering .gpu.g-pp, .mesh-nodes.hovering .gpu.g-self { opacity: 1; }
.gpu.g-tp { border-color: var(--accent); }
.gpu.g-dp { border-color: var(--c-scale); border-style: dashed; }
.gpu.g-pp { border-color: var(--c-man); border-style: dotted; }
.gpu.g-self { border-color: var(--text); border-style: solid; transform: scale(1.06); }
.mesh-side .kv { display: grid; grid-template-columns: 1fr auto; gap: 6px 10px; font-size: 14px; }
.mesh-side .kv span { color: var(--text-3); }
.mesh-side .kv b.bad { color: var(--warn); }
.mesh-side .kv b.good { color: var(--ok); }
.mesh-side p { font-size: 13px; color: var(--text-2); margin: 14px 0 0; }
.swatches { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; font-size: 12px; color: var(--text-3); }
.swatches i { display: inline-block; width: 12px; height: 12px; border-radius: 3px; vertical-align: -1px; margin-right: 4px; }
.swatch-line { display: inline-block; width: 18px; height: 0; border-top: 2px solid; vertical-align: 3px; margin-right: 4px; }

/* ---------- inference flow ---------- */
.flow { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 26px; position: relative; padding: 8px 4px 40px; }
.flow-node {
  position: relative; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); padding: 14px 12px;
  cursor: pointer; text-align: left; transition: border-color 0.15s, transform 0.15s;
}
.flow-node:hover { border-color: var(--border-strong); transform: translateY(-1px); }
.flow-node.active { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.flow-node .num { font-size: 11px; font-weight: 700; color: var(--accent); font-family: var(--mono); }
.flow-node b { display: block; font-size: 15px; margin: 2px 0; }
.flow-node span { font-size: 12px; color: var(--text-3); font-family: var(--mono); }
.flow-node:not(:last-of-type)::after {
  content: ""; position: absolute; right: -20px; top: 50%; width: 14px; height: 2px; background: var(--border-strong);
}
.flow-node:not(:last-of-type)::before {
  content: ""; position: absolute; right: -21px; top: calc(50% - 4px); border: 5px solid transparent; border-left-color: var(--border-strong); border-right: 0;
}
.flow-loop { position: absolute; left: 25%; right: 25%; bottom: 6px; height: 26px; border: 2px dashed var(--border-strong); border-top: 0; border-radius: 0 0 14px 14px; }
.flow-loop span { position: absolute; left: 50%; bottom: -11px; transform: translateX(-50%); background: var(--surface); padding: 0 10px; font-size: 12px; color: var(--text-3); white-space: nowrap; }
.flow-detail { margin-top: 6px; display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 20px; padding: 18px 20px; border-radius: 12px; background: var(--surface-2); }
.flow-detail h4 { margin-bottom: 6px; font-size: 16px; }
.flow-detail p { margin: 0; color: var(--text-2); font-size: 14px; }
.flow-detail ul { margin: 0; padding-left: 18px; color: var(--text-2); font-size: 14px; }
.pd-strip { margin-top: 16px; display: grid; grid-template-columns: 1fr auto 1fr; gap: 14px; align-items: stretch; }
.pd-box { border: 1px solid var(--border); border-radius: 12px; padding: 14px 16px; background: var(--surface); }
.pd-box b { display: block; margin-bottom: 4px; }
.pd-box p { margin: 0; font-size: 13px; color: var(--text-2); }
.pd-arrow { display: flex; flex-direction: column; align-items: center; justify-content: center; font-size: 12px; color: var(--text-3); gap: 4px; min-width: 130px; text-align: center; }
.pd-arrow .line { width: 100%; height: 2px; background: var(--c-scale); position: relative; }
.pd-arrow .line::after { content: ""; position: absolute; right: -2px; top: -4px; border: 5px solid transparent; border-left-color: var(--c-scale); border-right: 0; }

/* ---------- paged attention ---------- */
.paged { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); gap: 22px; }
.seq-row { margin-bottom: 14px; }
.seq-row .seq-head { display: flex; justify-content: space-between; font-size: 13px; margin-bottom: 6px; }
.seq-row .seq-head b { font-weight: 700; }
.lblocks { display: flex; gap: 6px; flex-wrap: wrap; }
.lblock { border: 1px solid var(--border-strong); border-radius: 8px; padding: 4px; background: var(--surface); }
.lblock .cells { display: grid; grid-template-columns: repeat(4, 12px); gap: 3px; }
.lblock .cells i { width: 12px; height: 12px; border-radius: 3px; background: var(--surface-3); }
.lblock .cells i.f { background: hsl(var(--h) 65% 55%); }
.lblock .tag { display: block; text-align: center; font-size: 10px; color: var(--text-3); font-family: var(--mono); margin-top: 3px; }
.pool { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 6px; }
.pblock { border-radius: 8px; border: 1px solid var(--border); padding: 6px 4px; text-align: center; font-size: 11px; font-family: var(--mono); color: var(--text-3); background: var(--surface); min-height: 50px; }
.pblock.used { background: hsl(var(--h) var(--chip-s) var(--chip-bg-l)); color: hsl(var(--h) var(--chip-s) var(--chip-l)); border-color: hsl(var(--h) 55% 60% / 0.5); }
.pblock .ref { display: block; font-size: 10px; opacity: 0.85; }
.paged-stats { display: flex; gap: 18px; flex-wrap: wrap; font-size: 13px; color: var(--text-3); margin: 12px 0; }
.paged-stats b { color: var(--text); }

/* ---------- roofline ---------- */
.roof-wrap { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 22px; align-items: start; }
.chart svg { width: 100%; height: auto; display: block; }
.chart .axis { stroke: var(--border-strong); }
.chart .gridline { stroke: var(--border); stroke-dasharray: 3 4; }
.chart text { fill: var(--text-3); font-size: 11px; font-family: var(--font); }
.chart .roof { stroke: var(--accent); stroke-width: 2.5; fill: none; }
.chart .pt { stroke: var(--surface); stroke-width: 2; }
.readout { display: grid; gap: 10px; }
.readout .big { font-size: 26px; font-weight: 800; line-height: 1.2; }
.readout .kv { display: grid; grid-template-columns: 1fr auto; gap: 6px 10px; font-size: 14px; }
.readout .kv span { color: var(--text-3); }
.pill { display: inline-block; padding: 2px 10px; border-radius: 99px; font-size: 12px; font-weight: 700; }
.pill.mem { background: color-mix(in srgb, var(--c-scale) 18%, transparent); color: color-mix(in srgb, var(--c-scale) 70%, var(--text)); }
.pill.comp { background: color-mix(in srgb, var(--c-man) 18%, transparent); color: color-mix(in srgb, var(--c-man) 70%, var(--text)); }

/* ---------- calculators ---------- */
.calc { display: flex; flex-direction: column; }
.calc h4 { font-size: 16px; margin-bottom: 4px; }
.calc .desc { color: var(--text-3); font-size: 13px; margin: 0 0 14px; }
.calc .form { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.calc .form .field select, .calc .form .field input { min-width: 0; width: 100%; }
.calc .form .wide { grid-column: 1 / -1; }
.calc .out { margin-top: 16px; padding: 14px 16px; border-radius: 10px; background: var(--surface-2); }
.calc .out .total { font-size: 24px; font-weight: 800; line-height: 1.2; }
.calc .out .total small { font-size: 13px; font-weight: 500; color: var(--text-3); margin-left: 6px; }
.calc .out .lines { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; font-size: 13px; margin-top: 10px; }
.calc .out .lines span { color: var(--text-3); }
.calc .note { font-size: 12px; color: var(--text-3); margin: 10px 0 0; }
.stack { display: flex; height: 14px; border-radius: 99px; overflow: hidden; background: var(--surface-3); margin-top: 12px; position: relative; }
.stack i { display: block; height: 100%; }
.stack-legend { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 12px; color: var(--text-3); margin-top: 8px; }
.stack-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }
.cap-line { font-size: 12px; margin-top: 6px; }
.cap-line.over { color: var(--warn); font-weight: 600; }
.cap-line.ok { color: var(--ok); }

/* ---------- quant visuals ---------- */
.fmt-list { display: grid; gap: 8px; }
.fmt-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 5px 12px; align-items: baseline; font-size: 13px; padding-bottom: 8px; border-bottom: 1px dashed var(--border); }
.fmt-row:last-child { border-bottom: 0; padding-bottom: 0; }
.fmt-row .fname { font-weight: 700; font-family: var(--mono); font-size: 13px; margin-right: 8px; }
.fmt-row .fuse { color: var(--text-3); }
.fmt-row .fmax { font-family: var(--mono); color: var(--text-2); text-align: right; white-space: nowrap; }
.fmt-row .fmax span { color: var(--text-3); font-family: var(--font); margin-right: 4px; }
.bits { grid-column: 1 / -1; display: flex; gap: 2px; height: 18px; }
.bits i { flex: 0 1 11px; min-width: 4px; border-radius: 3px; }
.bits i.gap { margin-left: 4px; }
.bits i.s { background: var(--c-sign); }
.bits i.e { background: var(--c-exp); }
.bits i.m { background: var(--c-man); }
.bits i.n { background: var(--c-int); }
.fmt-legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: 12px; color: var(--text-3); margin-top: 12px; }
.fmt-legend i { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: 5px; vertical-align: -2px; }
.numline svg { width: 100%; height: auto; display: block; }
.numline text { fill: var(--text-3); font-size: 11px; font-family: var(--mono); }
.numline .lbl { fill: var(--text-2); font-size: 12px; font-family: var(--font); font-weight: 600; }
.block-viz { display: grid; gap: 16px; }
.bv-row { display: grid; grid-template-columns: 110px minmax(0, 1fr); gap: 12px; align-items: center; }
.bv-row .bname { font-family: var(--mono); font-weight: 700; font-size: 13px; }
.bv-row .bname small { display: block; font-family: var(--font); font-weight: 500; color: var(--text-3); font-size: 12px; }
.bv-cells { display: flex; align-items: flex-end; gap: 1px; flex-wrap: nowrap; overflow: hidden; }
.bv-cells i { flex: none; width: 5px; height: 14px; border-radius: 1.5px; background: var(--c-man); opacity: 0.9; }
.bv-cells i.w8 { height: 24px; background: var(--c-exp); }
.bv-cells .ell { flex: none; font-size: 11px; color: var(--text-3); margin: 0 4px; align-self: center; white-space: nowrap; }
.bv-cells .sc { flex: none; height: 24px; padding: 0 8px; border-radius: 5px; background: var(--c-scale); color: #1a1f26; font-size: 11px; font-weight: 700; display: inline-flex; align-items: center; margin-left: 6px; white-space: nowrap; }
.bv-meta { font-size: 12px; color: var(--text-3); margin-top: 4px; }
.bv-meta b { color: var(--text); }
.mmap { width: 100%; border-collapse: separate; border-spacing: 6px; }
.mmap th { font-size: 12px; color: var(--text-3); font-weight: 700; text-align: left; padding: 4px 6px; }
.mmap td { background: var(--surface-2); border-radius: 10px; padding: 10px; vertical-align: top; min-width: 150px; }
.mmap td.empty { background: repeating-linear-gradient(-45deg, transparent 0 6px, var(--surface-2) 6px 12px); }
.mchips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 2px 10px; border-radius: 99px; font-size: 12px; font-weight: 600;
  color: hsl(var(--h, 220) var(--chip-s) var(--chip-l)); background: hsl(var(--h, 220) var(--chip-s) var(--chip-bg-l));
  border: 1px solid transparent; white-space: nowrap; line-height: 1.6;
}
button.chip { cursor: pointer; }
button.chip:hover { border-color: hsl(var(--h, 220) 50% 60% / 0.5); }
.gemm-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.gemm { padding: 16px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface); }
.gemm .expr { font-family: var(--mono); font-size: 17px; font-weight: 700; margin: 6px 0 8px; }
.gemm p { margin: 0; font-size: 13px; color: var(--text-2); }
.gemm .who { display: flex; gap: 6px; margin-top: 10px; }
.cmp { width: 100%; border-collapse: collapse; font-size: 14px; }
.cmp th, .cmp td { padding: 11px 14px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: top; }
.cmp thead th { background: var(--surface-2); font-size: 13px; }
.cmp td:first-child { font-weight: 650; white-space: nowrap; color: var(--text); width: 150px; }
.cmp td { color: var(--text-2); }
.cmp-notes { display: grid; gap: 10px; margin-top: 16px; }
.cmp-notes p { margin: 0; font-size: 14px; color: var(--text-2); padding: 12px 14px; border-radius: 10px; background: var(--surface-2); }

/* ---------- papers ---------- */
.paper-charts { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 16px; }
.hbar { display: grid; grid-template-columns: 210px 1fr 32px; gap: 10px; align-items: center; font-size: 13px; padding: 3px 6px; border-radius: 6px; cursor: pointer; }
.hbar:hover { background: var(--surface-2); }
.hbar.active { background: var(--accent-soft); }
.hbar .hn { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-2); }
.hbar .hn b { font-family: var(--mono); color: hsl(var(--h) var(--chip-s) var(--chip-l)); margin-right: 6px; }
.hbar .ht { height: 10px; border-radius: 99px; background: var(--surface-3); overflow: hidden; }
.hbar .ht i { display: block; height: 100%; background: hsl(var(--h) 60% 55%); border-radius: 99px; }
.hbar .hc { text-align: right; font-family: var(--mono); color: var(--text-3); }
.group-label { font-size: 12px; font-weight: 700; color: var(--text-3); margin: 10px 6px 4px; letter-spacing: 0.04em; }
.group-label:first-child { margin-top: 0; }
.filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: 18px 0 14px; }
.seg { display: inline-flex; flex-wrap: wrap; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; background: var(--surface); }
.seg button { border: 0; background: transparent; padding: 7px 13px; font-size: 13px; cursor: pointer; color: var(--text-2); }
.seg button + button { border-left: 1px solid var(--border); }
.seg button.active { background: var(--accent-soft); color: var(--accent); font-weight: 650; }
.search { flex: 1 1 260px; position: relative; }
.search input { width: 100%; height: 38px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface); padding: 0 12px 0 36px; font-size: 14px; }
.search svg { position: absolute; left: 11px; top: 11px; width: 16px; height: 16px; color: var(--text-3); }
.active-filter { font-size: 13px; color: var(--text-3); display: flex; gap: 8px; align-items: center; }
.active-filter button { border: 0; background: none; color: var(--accent); cursor: pointer; padding: 0; font-size: 13px; }
.paper-list { display: grid; gap: 10px; }
.paper { padding: 14px 16px; display: grid; grid-template-columns: 74px minmax(0, 1fr); gap: 14px; }
.paper .pdate { font-family: var(--mono); font-size: 12px; color: var(--text-3); padding-top: 3px; }
.paper .ptitle { font-weight: 650; font-size: 15px; line-height: 1.45; }
.paper .ptitle a { color: var(--text); }
.paper .ptitle a:hover { color: var(--accent); }
.paper .pmeta { display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: center; font-size: 12px; color: var(--text-3); margin: 6px 0; }
.paper .pnote { font-size: 14px; color: var(--text-2); margin: 0; }
.paper mark { background: color-mix(in srgb, var(--c-scale) 35%, transparent); color: inherit; border-radius: 3px; padding: 0 1px; }
.more-row { text-align: center; margin-top: 14px; }

/* ---------- interview ---------- */
.iv-grid { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.iv-side { display: grid; gap: 16px; }
.mini-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.mini-list li { font-size: 14px; color: var(--text-2); }
.mini-list li b { display: block; color: var(--text); font-size: 14px; }
.steps { counter-reset: s; list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.steps li { counter-increment: s; display: grid; grid-template-columns: 24px 1fr; gap: 8px; font-size: 14px; color: var(--text-2); }
.steps li::before { content: counter(s); width: 22px; height: 22px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); font-size: 12px; font-weight: 700; display: flex; align-items: center; justify-content: center; }

/* ---------- footer ---------- */
footer { margin-top: 72px; border-top: 1px solid var(--border); padding: 28px 0 40px; color: var(--text-3); font-size: 13px; }
footer .container { display: flex; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
footer p { margin: 0; }

/* ---------- responsive ---------- */
@media (max-width: 1080px) {
  .flow { grid-template-columns: repeat(3, minmax(0, 1fr)); row-gap: 20px; padding-bottom: 8px; }
  .flow-node:nth-child(3)::after, .flow-node:nth-child(3)::before { display: none; }
  .flow-loop { display: none; }
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  .hero-grid, .stage-top, .stage-body, .mesh-wrap, .roof-wrap, .paged, .paper-charts, .iv-grid, .flow-detail { grid-template-columns: minmax(0, 1fr); }
  .stage-col + .stage-col { border-left: 0; border-top: 1px solid var(--border); }
  .grid-2, .grid-3, .gemm-grid { grid-template-columns: minmax(0, 1fr); }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hero h1 { font-size: 34px; }
  .pd-strip { grid-template-columns: minmax(0, 1fr); }
  .pd-arrow { min-width: 0; padding: 4px 0; }
}
@media (max-width: 640px) {
  .container { padding: 0 16px; }
  .brand span { display: none; }
  .calc .form { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .flow { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .flow-node::after, .flow-node::before { display: none; }
  .hbar { grid-template-columns: 140px 1fr 28px; }
  .timeline { padding: 16px 14px; }
  .tl-grid { grid-template-columns: 52px repeat(10, minmax(54px, 1fr)); min-width: 600px; }
  .tl-name { display: none; }
  .tl-week { font-size: 11px; }
  .paper { grid-template-columns: minmax(0, 1fr); gap: 4px; }
  .mesh-gpus { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .grid-4 { grid-template-columns: minmax(0, 1fr); }
}
@media print {
  .topbar, .progress-line, .btn-row, .filters { display: none; }
  section { padding-top: 24px; }
}
