/* Cyber-JEV project page. The page reads like a reviewed patch:
   comparisons are diff lines (− before, + after), notes are code comments,
   the method is a commit graph and navigation is a set of editor tabs. */
:root {
  --bg: #f5f4ee;
  --bg-alt: #ecefe8;
  --surface: #fffefb;
  --ink: #0f1f22;
  --ink-2: #2c3d3f;
  --muted: #56645f;
  --line: #e2e3db;
  --line-strong: #cbd0c6;
  --night: #0b1618;
  --night-line: rgba(255, 255, 255, .09);
  --night-text: #e8efeb;
  --night-muted: #9db0ab;
  --vuln: #e2552d;
  --vuln-bright: #ff8462;
  --vuln-ink: #b5482a;
  --vuln-tint: rgba(226, 85, 45, .08);
  --fix: #1f8a66;
  --fix-bright: #5fd3a2;
  --fix-tint: rgba(31, 138, 102, .09);
  --alt: #3d6fa3;
  --hunk: #e3ecee;
  --hunk-ink: #3c6779;
  --sans: Inter, "Segoe UI", system-ui, -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
  --serif: "Iowan Old Style", Georgia, "Times New Roman", "Songti SC", serif;
  --mono: ui-monospace, "JetBrains Mono", "Cascadia Code", "SF Mono", Consolas, monospace;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 84px; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: var(--sans); font-size: 17px; line-height: 1.7;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
  display: flex; flex-direction: column; min-height: 100vh;
}
main { flex: 1; }
button, a { -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
button { font: inherit; cursor: pointer; }
a { color: inherit; text-decoration: none; }
a:focus-visible, button:focus-visible { outline: 2px solid var(--vuln); outline-offset: 4px; border-radius: 4px; }
::selection { background: rgba(95, 211, 162, .3); }
.wrap { width: min(1200px, calc(100% - 96px)); margin-inline: auto; }
.section { padding-top: 104px; padding-bottom: 104px; }
code, .mono { font-family: var(--mono); font-variant-ligatures: none; }

/* ---------- Header: editor tabs ---------- */
.header { position: sticky; top: 0; z-index: 30; color: var(--night-text); background: rgba(11, 22, 24, .9); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-bottom: 1px solid var(--night-line); }
.header-inner { height: 64px; max-width: 1296px; margin: auto; padding: 0 48px; display: flex; align-items: stretch; gap: 32px; }
.wordmark { display: inline-flex; align-items: center; gap: 11px; font-weight: 700; font-size: 19px; letter-spacing: -.4px; }
.wordmark:hover { color: #fff; }
.brand-mark { width: 30px; height: 30px; flex-shrink: 0; }
.brand-mark > rect:first-child { fill: none; stroke: rgba(255, 255, 255, .35); stroke-width: 1.5; }
.bm-del { fill: var(--vuln-bright); }
.bm-add { fill: var(--fix-bright); }
.header nav { display: flex; align-items: stretch; border-left: 1px solid var(--night-line); }
.header nav a { position: relative; display: flex; align-items: center; gap: 9px; padding: 0 22px; font-size: 16px; color: var(--night-muted); border-right: 1px solid var(--night-line); transition: color .2s, background .2s; }
.header nav a::before { content: ""; width: 8px; height: 8px; border-radius: 2px; background: rgba(255, 255, 255, .18); }
.header nav a:hover { color: #fff; background: rgba(255, 255, 255, .04); }
.header nav a[aria-current=page] { color: #fff; background: rgba(255, 255, 255, .07); }
.header nav a[aria-current=page]::before { background: var(--fix-bright); }
.header nav a[aria-current=page]::after { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 2px; background: var(--fix-bright); }
.language { margin-left: auto; align-self: center; display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--night-line); background: transparent; color: var(--night-text); border-radius: 8px; padding: 6px 14px; font-size: 15px; transition: background .2s; }
.language:hover { background: rgba(255, 255, 255, .08); }
.language svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.6; opacity: .75; }

/* ---------- Shared vocabulary ---------- */
.eyebrow { font-size: 15px; font-weight: 600; letter-spacing: .02em; display: flex; align-items: center; gap: 10px; margin: 0 0 18px; color: var(--fix); }
.path { font-family: var(--mono); font-size: 16px; color: var(--night-muted); margin: 0 0 22px; }
.path b { font-weight: 500; color: var(--fix-bright); }
.section-title { font-family: var(--serif); font-size: 46px; line-height: 1.12; letter-spacing: -.025em; font-weight: 400; margin: 0; }
.lead { font-size: 20px; line-height: 1.7; margin: 24px 0 0; color: var(--ink-2); }
.comment { display: grid; grid-template-columns: 34px 1fr; font-size: 16px; line-height: 1.8; color: var(--muted); max-width: 940px; margin: 26px 0 0; }
.comment::before { content: "//"; font-family: var(--mono); font-weight: 600; color: var(--fix); }

/* Hunk header + diff panel */
.hunk { font-family: var(--mono); font-size: 15px; color: var(--hunk-ink); background: var(--hunk); border: 1px solid var(--line-strong); border-bottom: 0; border-radius: 12px 12px 0 0; padding: 9px 20px; }
.hunk .at { color: #7c9aa7; }
.diff-panel { display: grid; grid-template-columns: repeat(3, 1fr); background: var(--surface); border: 1px solid var(--line-strong); border-radius: 0 0 12px 12px; overflow: hidden; }
.diff-panel.two { grid-template-columns: 1fr 1fr; }
.dgroup { padding: 22px 0 20px; border-left: 1px solid var(--line); min-width: 0; }
.dgroup:first-child { border-left: 0; }
.dgroup-title { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; font-size: 18px; font-weight: 650; margin: 0 24px 14px; }
.dgroup-title em { font-style: normal; font-size: 16px; font-weight: 700; color: var(--fix); white-space: nowrap; }
.drow { position: relative; display: grid; grid-template-columns: 46px auto 1fr; align-items: baseline; column-gap: 12px; padding: 4px 22px 4px 0; border-left: 3px solid transparent; }
.drow .sign { font-family: var(--mono); font-size: 26px; font-weight: 600; text-align: center; }
.drow .val { font-size: clamp(46px, 5vw, 70px); line-height: 1.12; font-weight: 750; letter-spacing: -.045em; font-variant-numeric: tabular-nums; }
.drow .who { font-size: 16px; color: var(--muted); }
.minus { background: var(--vuln-tint); border-left-color: var(--vuln); }
.minus .sign { color: var(--vuln); }
.minus .val { color: #b7867a; text-decoration: line-through; text-decoration-thickness: 3px; text-decoration-color: rgba(226, 85, 45, .5); }
.plus { background: var(--fix-tint); border-left-color: var(--fix); }
.plus .sign, .plus .val { color: var(--fix); }
.plus .who { color: var(--ink-2); font-weight: 600; }
.ctx .sign { color: var(--line-strong); }
.dnote { margin: 14px 24px 0; font-size: 15px; color: var(--muted); }

/* ---------- Home hero ---------- */
.hero-band, .page-band, .paper-section {
  position: relative; overflow: hidden; color: var(--night-text);
  background:
    radial-gradient(55% 60% at 88% 18%, rgba(95, 211, 162, .14), transparent 70%),
    radial-gradient(45% 55% at 4% 100%, rgba(226, 85, 45, .13), transparent 70%),
    var(--night);
}
.hero-band::before, .page-band::before, .paper-section::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image: linear-gradient(rgba(255, 255, 255, .045) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, .045) 1px, transparent 1px);
  background-size: 56px 56px;
  -webkit-mask-image: radial-gradient(ellipse 80% 70% at 60% 30%, #000 20%, transparent 75%);
  mask-image: radial-gradient(ellipse 80% 70% at 60% 30%, #000 20%, transparent 75%);
}
.hero-band { padding-bottom: 36px; }
.hero { position: relative; display: grid; grid-template-columns: 1.05fr 1fr; gap: 72px; padding-top: 88px; padding-bottom: 56px; align-items: center; }
.hero-band .eyebrow, .page-band .eyebrow, .paper-section .eyebrow { color: var(--fix-bright); }
.dot { width: 8px; height: 8px; background: var(--fix-bright); border-radius: 50%; display: inline-block; box-shadow: 0 0 0 4px rgba(95, 211, 162, .16); animation: pulse 2.8s ease-in-out infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 7px rgba(95, 211, 162, 0); } }
.hero h1 {
  font-size: clamp(64px, 7.4vw, 104px); line-height: 1; letter-spacing: -.05em; margin: 0 0 22px; font-weight: 750;
  background: linear-gradient(180deg, #ffffff 30%, #b9cbc4); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.title-dot { color: var(--vuln); -webkit-text-fill-color: var(--vuln); }
.hero-subtitle { font-family: var(--serif); font-size: clamp(32px, 3.3vw, 46px); letter-spacing: -.02em; line-height: 1.16; margin: 0 0 26px; color: #d4e0da; }
.hero-subtitle em { font-style: italic; color: var(--fix-bright); }
.hero-description { font-size: 19px; line-height: 1.7; max-width: 500px; color: var(--night-muted); margin: 0 0 36px; }
.hero-actions { display: flex; gap: 28px; align-items: center; flex-wrap: wrap; }
.button { display: inline-flex; align-items: center; gap: 22px; font-size: 16px; font-weight: 600; padding: 14px 22px 14px 24px; border-radius: 10px; border: 1px solid transparent; transition: background .2s, transform .2s, box-shadow .2s; }
.button:hover { transform: translateY(-2px); }
.primary { background: var(--vuln); color: #fff; box-shadow: 0 10px 28px -10px rgba(226, 85, 45, .7), inset 0 1px 0 rgba(255, 255, 255, .18); }
.primary:hover { background: #ef6339; color: #fff; }
.text-link { font-size: 16px; font-weight: 500; display: inline-flex; gap: 12px; align-items: center; color: var(--night-text); border-bottom: 1px solid rgba(255, 255, 255, .3); padding-bottom: 3px; }
.text-link:hover { color: var(--fix-bright); border-color: var(--fix-bright); }

.hero-visual { position: relative; margin: 0; padding: 22px; border-radius: 20px; background: linear-gradient(180deg, rgba(255, 255, 255, .055), rgba(255, 255, 255, .02)); border: 1px solid var(--night-line); box-shadow: 0 40px 80px -40px rgba(0, 0, 0, .8), inset 0 1px 0 rgba(255, 255, 255, .06); }
.visual-title { margin: 0 4px 14px; font-size: 16px; font-weight: 600; color: var(--night-text); }
.code-window { background: #08100f; border: 1px solid rgba(255, 255, 255, .08); border-radius: 12px; overflow: hidden; }
.window-heading { padding: 11px 14px; border-bottom: 1px solid rgba(255, 255, 255, .07); display: flex; align-items: center; gap: 12px; color: #b4c4bf; font-size: 14px; }
.window-dots { display: inline-flex; gap: 6px; }
.window-dots i { width: 10px; height: 10px; border-radius: 50%; background: rgba(255, 255, 255, .14); }
.window-dots i:first-child { background: rgba(226, 85, 45, .75); }
.window-dots i:last-child { background: rgba(95, 211, 162, .6); }
.window-tag { margin-left: auto; font-family: var(--mono); color: #8a9f9a; font-size: 13px; }
.diff { padding: 10px 0 12px; font-family: var(--mono); font-size: 13.5px; line-height: 1.85; color: #cfdcd7; overflow-x: auto; font-variant-ligatures: none; }
.dl { display: grid; grid-template-columns: 40px 18px 1fr; align-items: center; border-left: 2px solid transparent; padding-right: 12px; }
.dl code { font: inherit; white-space: pre; }
.ln { text-align: right; padding-right: 12px; color: #4f6460; user-select: none; }
.sg { text-align: center; user-select: none; }
.dl.del { background: rgba(226, 85, 45, .13); border-left-color: var(--vuln); }
.dl.del .sg, .dl.del .ln { color: var(--vuln-bright); }
.dl.del code { text-decoration: line-through; text-decoration-color: rgba(255, 132, 98, .45); }
.dl.add { background: rgba(95, 211, 162, .11); border-left-color: var(--fix-bright); }
.dl.add .sg, .dl.add .ln { color: var(--fix-bright); }
.diff b { font-weight: 400; }
.diff .k { color: #8ab8ff; }
.diff .f { color: #f2d48b; }
.diff .n { color: #f5a97f; }
.pair { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 14px; }
.pair-item { padding: 14px; display: flex; align-items: flex-start; gap: 11px; border-radius: 12px; border: 1px solid; }
.vulnerable.pair-item { background: rgba(226, 85, 45, .08); border-color: rgba(226, 85, 45, .3); }
.patched.pair-item { background: rgba(95, 211, 162, .06); border-color: rgba(95, 211, 162, .25); }
.pair-text { flex: 1; min-width: 0; }
.pair-item small { display: block; font-size: 14px; color: var(--night-muted); line-height: 1.4; }
.pair-item strong { display: block; font-size: 17px; font-weight: 600; color: #fff; }
.pair-symbol { display: flex; align-items: center; justify-content: center; font-family: var(--mono); font-size: 17px; width: 28px; height: 28px; border-radius: 8px; flex-shrink: 0; margin-top: 2px; }
.vulnerable .pair-symbol { color: #fff; background: var(--vuln); }
.patched .pair-symbol { color: #06150f; background: var(--fix-bright); }
.meter { display: block; height: 5px; border-radius: 4px; background: rgba(255, 255, 255, .08); margin-top: 10px; overflow: hidden; }
.meter i { display: block; height: 100%; border-radius: inherit; }
.vulnerable .meter i { width: 88%; background: linear-gradient(90deg, #b8401f, var(--vuln-bright)); }
.patched .meter i { width: 26%; background: linear-gradient(90deg, #1d7a5a, var(--fix-bright)); }
.visual-output { margin: 14px 4px 2px; font-size: 15px; line-height: 1.6; color: var(--night-muted); }
.visual-output strong { color: #fff; font-weight: 600; }
.authors { position: relative; font-size: 16px; line-height: 1.8; display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; padding-top: 24px; border-top: 1px solid var(--night-line); color: #c3d0cb; }
.authors p { margin: 0; }
.authors > span { font-size: 15px; white-space: nowrap; color: var(--night-muted); }
.star { color: var(--vuln-bright); margin-left: 1px; }

/* ---------- Home ---------- */
.home-diff { padding-top: 80px; }
.problem { display: grid; grid-template-columns: 1.15fr 1fr; gap: 64px; align-items: start; }
.findings { list-style: none; margin: 0; padding: 0; }
.findings li { display: grid; grid-template-columns: 48px 1fr; gap: 14px; padding: 26px 0; border-top: 1px solid var(--line-strong); }
.findings li:last-child { border-bottom: 1px solid var(--line-strong); }
.flag { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: var(--vuln); color: #fff; font-family: var(--mono); font-weight: 700; font-size: 18px; margin-top: 2px; }
.findings li:nth-child(2) .flag { background: #d4882a; }
.findings h3 { font-size: 20px; font-weight: 650; margin: 0 0 6px; }
.findings p { font-size: 16.5px; color: var(--muted); margin: 0; }

.tree-section { padding-bottom: 110px; }
.tree { margin-top: 30px; font-family: var(--mono); font-variant-ligatures: none; }
.tree-root { font-size: 17px; color: var(--muted); margin: 0 0 6px 12px; }
.tree-row { display: grid; grid-template-columns: 40px 170px 1fr 40px; gap: 18px; align-items: center; padding: 24px 12px; border-top: 1px solid var(--line); border-left: 3px solid transparent; transition: background .2s, border-color .2s; }
.tree-row:last-child { border-bottom: 1px solid var(--line); }
.tree-row:hover { background: var(--fix-tint); border-left-color: var(--fix); }
.branch { font-size: 22px; color: var(--line-strong); }
.tree-name { font-size: 26px; font-weight: 700; letter-spacing: -.02em; color: var(--ink); }
.tree-desc { font-family: var(--sans); font-size: 17px; color: var(--muted); }
.tree-go { justify-self: end; font-size: 24px; color: var(--fix); transition: transform .2s; }
.tree-row:hover .tree-go { transform: translateX(4px); }

/* ---------- Inner page header ---------- */
.page-head { position: relative; padding-top: 72px; padding-bottom: 72px; }
.page-title { font-family: var(--serif); font-size: clamp(44px, 5.4vw, 72px); line-height: 1.06; letter-spacing: -.03em; font-weight: 400; margin: 0; color: #fff; }
.page-intro { font-size: 20px; color: var(--night-muted); max-width: 640px; margin: 24px 0 0; }

/* ---------- Method: commit graph ---------- */
.graph { list-style: none; margin: 0; padding: 0 0 0 64px; position: relative; }
.graph::before { content: ""; position: absolute; left: 17px; top: 14px; bottom: 40px; width: 2px; background: linear-gradient(var(--vuln), var(--fix) 55%, var(--line-strong)); }
.commit { position: relative; padding-bottom: 88px; }
.commit:last-child { padding-bottom: 0; }
.node { position: absolute; left: -56px; top: 6px; width: 20px; height: 20px; border-radius: 50%; background: var(--bg); border: 4px solid var(--fix); }
.commit:first-child .node { border-color: var(--vuln); }
.commit-tag { display: inline-flex; gap: 10px; align-items: center; font-family: var(--mono); font-size: 15px; color: var(--ink-2); margin: 0 0 14px; }
.commit-tag b { font-weight: 600; color: var(--fix); border: 1px solid rgba(31, 138, 102, .4); background: var(--fix-tint); padding: 1px 10px; border-radius: 6px; }
.commit-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 64px; align-items: start; }
.commit h2 { font-size: 34px; font-weight: 700; letter-spacing: -.025em; line-height: 1.2; margin: 0 0 12px; }
.commit-text > p { font-size: 18px; color: var(--ink-2); margin: 0; }
.figure-line { display: flex; align-items: baseline; gap: 16px; flex-wrap: wrap; margin: 28px 0 0; padding-top: 22px; border-top: 1px solid var(--line-strong); }
.figure-line strong { font-size: clamp(56px, 6vw, 80px); line-height: 1; font-weight: 750; letter-spacing: -.045em; color: var(--ink); }
.figure-line span { font-size: 17px; color: var(--muted); max-width: 260px; }

.mini-diff, .queue { background: var(--surface); border: 1px solid var(--line-strong); border-radius: 12px; overflow: hidden; font-family: var(--mono); font-variant-ligatures: none; }
.mini-head { font-size: 15px; color: var(--hunk-ink); background: var(--hunk); padding: 8px 16px; border-bottom: 1px solid var(--line-strong); }
.mrow { display: grid; grid-template-columns: 44px 1fr; align-items: center; padding: 14px 16px 14px 0; font-size: 17px; border-left: 3px solid transparent; }
.mrow > span:first-child { text-align: center; font-weight: 700; }
.mrow.minus { color: var(--vuln-ink); }
.mrow.plus { color: #186447; }
.mrow.ctx { color: var(--muted); border-top: 1px dashed var(--line); }
.formula { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 10px 12px; font-family: var(--mono); font-size: 17px; }
.formula b { font-weight: 400; font-size: 24px; color: var(--muted); text-align: center; }
.formula b:last-of-type { grid-column: 1 / -1; line-height: 1; transform: rotate(90deg); }
.term { padding: 16px 18px; border-radius: 10px; border: 1px solid; background: var(--surface); text-align: center; }
.t-model { grid-column: 1 / -1; }
.t-cls { color: #2c4a66; border-color: #c5d6e7; }
.t-rank { color: #186447; border-color: #b9e0cc; }
.t-model { color: #fff; background: var(--ink); border-color: var(--ink); }
.queue { padding: 10px 0; }
.q { display: grid; grid-template-columns: 136px 1fr; gap: 14px; align-items: center; padding: 7px 18px; font-size: 15px; color: var(--ink-2); }
.q i { height: 12px; border-radius: 4px; background: linear-gradient(90deg, var(--vuln) var(--s), var(--bg-alt) var(--s)); }
.q.out { color: var(--muted); }
.q.out i { background: linear-gradient(90deg, var(--line-strong) var(--s), var(--bg-alt) var(--s)); }
.cut { position: relative; margin: 10px 18px; border-top: 2px dashed var(--vuln); }
.cut span { position: absolute; right: 0; top: -13px; background: var(--surface); padding: 0 8px; font-family: var(--sans); font-size: 14px; font-weight: 600; color: var(--vuln); }
.graph-note { padding-left: 64px; }

/* ---------- Results ---------- */
.chapter { padding-top: 88px; }
.chapter-title { display: flex; align-items: center; gap: 18px; font-size: 38px; font-weight: 700; letter-spacing: -.025em; line-height: 1.2; margin: 0 0 10px; }
.chapter-no { font-family: var(--mono); font-size: 18px; font-weight: 600; color: var(--fix); border: 1px solid rgba(31, 138, 102, .4); background: var(--fix-tint); border-radius: 8px; padding: 2px 11px; }
.chapter-intro { font-size: 18px; color: var(--ink-2); margin: 0 0 32px; max-width: 760px; }

.cells-block { background: var(--surface); border: 1px solid var(--line-strong); border-radius: 0 0 12px 12px; padding: 26px 26px 20px; }
.cells-row { display: grid; grid-template-columns: 150px 1fr 150px; gap: 26px; align-items: center; padding: 14px 0; }
.cells-row + .cells-row { border-top: 1px dashed var(--line); }
.cells-label { display: flex; align-items: center; gap: 12px; font-size: 18px; font-weight: 600; }
.cells-label .sign { font-family: var(--mono); font-size: 24px; }
.cells-row.minus, .cells-row.plus { background: none; border-left: 0; }
.cells { display: grid; grid-template-columns: repeat(auto-fill, 11px); gap: 3px; }
.cells i { width: 11px; height: 11px; border-radius: 2px; background: #c3cbc6; }
.cells-row.plus .cells i { background: var(--fix); }
.cells i.missed, .cells-row.plus .cells i.missed { background: var(--vuln); }
.cells-count { margin: 0; text-align: right; }
.cells-count strong { display: block; font-size: 60px; line-height: 1; font-weight: 750; letter-spacing: -.045em; color: var(--vuln); }
.cells-row.minus .cells-count strong { color: #c99686; text-decoration: line-through; text-decoration-thickness: 3px; text-decoration-color: rgba(226, 85, 45, .45); }
.cells-count span { font-size: 16px; color: var(--muted); }
.legend { display: flex; flex-wrap: wrap; gap: 10px 26px; align-items: center; font-size: 15.5px; color: var(--ink-2); }
.cells-block .legend { margin-top: 12px; padding-top: 16px; border-top: 1px solid var(--line); }
.key { display: inline-flex; align-items: center; gap: 9px; }
.key::before { content: ""; width: 13px; height: 13px; border-radius: 3px; }
.key-found::before { background: var(--fix); }
.key-missed::before { background: var(--vuln); }
.legend-note { color: var(--muted); }
.stack-gap { margin-top: 22px; }

.sign-key { display: inline-flex; align-items: center; gap: 10px; }
.sign-key b { font-family: var(--mono); font-size: 22px; font-weight: 600; width: 18px; text-align: center; }
.sign-key.k-minus b { color: var(--vuln); }
.sign-key.k-plus b { color: var(--fix); }
.sign-key.k-alt b { color: var(--alt); }
.patch-legend { margin: 0; padding: 12px 20px; background: var(--hunk); border: 1px solid var(--line-strong); border-bottom: 0; border-radius: 12px 12px 0 0; }
.fill { background: var(--surface); }
.fill::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: var(--v); }
.fill > * { position: relative; }
.fill.minus::before { background: rgba(226, 85, 45, .14); }
.fill.plus::before { background: rgba(31, 138, 102, .18); }
.fill.alt { border-left-color: var(--alt); }
.fill.alt::before { background: rgba(61, 111, 163, .13); }
.fill.alt .sign, .fill.alt .val { color: var(--alt); }
.fill .val { font-size: clamp(40px, 4vw, 54px); }
.fill.minus .val { text-decoration: none; color: #b7867a; }
.set-sub { font-size: 15px; font-weight: 400; color: var(--muted); }

.doc-comment { margin-top: 72px; padding: 6px 0 6px 26px; border-left: 3px solid var(--line-strong); font-size: 17.5px; color: var(--ink-2); max-width: 980px; }
.doc-comment::before { content: "/* evaluation protocol */"; display: block; font-family: var(--mono); font-size: 15px; color: var(--fix); margin-bottom: 8px; }
.scope-section { display: grid; grid-template-columns: 1fr 1.05fr; gap: 72px; padding: 96px 0 0; align-items: center; }
.scope-section .eyebrow { color: var(--vuln); }
.scope-body { padding: 4px 0 4px 32px; border-left: 4px solid var(--vuln); }
.scope-body .lead { margin: 0 0 16px; }
.scope-body > p:last-child { font-size: 17px; color: var(--muted); margin: 0; }

.next-file { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 20px; margin-top: 80px; padding: 30px 12px; border-top: 1px solid var(--line-strong); border-bottom: 1px solid var(--line-strong); border-left: 3px solid transparent; transition: background .2s, border-color .2s; }
.next-file:hover { background: var(--fix-tint); border-left-color: var(--fix); }
.next-label { font-size: 17px; color: var(--muted); }
.next-name { font-family: var(--mono); font-size: 30px; font-weight: 700; letter-spacing: -.02em; color: var(--ink); }
.next-name i { font-style: normal; color: var(--fix); margin-left: 12px; }
.page-end { padding-bottom: 104px; }

/* ---------- Paper ---------- */
.paper-main { display: flex; }
.paper-section { flex: 1; display: flex; align-items: center; }
.paper-inner { position: relative; display: grid; grid-template-columns: .95fr 1.05fr; gap: 80px; padding-top: 88px; padding-bottom: 88px; align-items: center; }
.paper-section h1 { font-family: var(--serif); font-size: clamp(44px, 5vw, 64px); line-height: 1.06; font-weight: 400; letter-spacing: -.03em; margin: 0 0 36px; color: #fff; }
.paper-facts { display: flex; gap: 44px; margin-bottom: 36px; }
.paper-facts strong { display: block; font-size: 52px; line-height: 1; font-weight: 750; letter-spacing: -.04em; color: #fff; }
.paper-facts span { display: block; font-size: 16px; color: var(--night-muted); margin-top: 8px; }
.paper-meta { font-size: 16px; color: var(--night-muted); margin: 20px 0 0; }
.citation-card { background: #08100f; border: 1px solid var(--night-line); border-radius: 14px; overflow: hidden; box-shadow: 0 40px 80px -40px rgba(0, 0, 0, .9); }
.citation-header { display: flex; align-items: center; padding: 12px 14px 12px 18px; border-bottom: 1px solid rgba(255, 255, 255, .07); gap: 14px; font-size: 16px; color: #c3d0cb; }
.citation-file { font-family: var(--mono); color: var(--fix-bright); }
.citation-title { flex: 1; color: var(--night-muted); }
.citation-header button { font-size: 15px; background: rgba(255, 255, 255, .06); border: 1px solid rgba(255, 255, 255, .16); color: var(--night-text); border-radius: 8px; padding: 7px 14px; transition: background .2s; }
.citation-header button:hover { background: rgba(95, 211, 162, .14); }
.citation-card pre { font-family: var(--mono); font-size: 14.5px; line-height: 1.75; color: #c3d2cc; overflow: auto; margin: 0; padding: 24px 24px 18px; white-space: pre-wrap; overflow-wrap: anywhere; }
.citation-card > a { display: inline-block; color: var(--fix-bright); font-size: 16px; margin: 0 24px 22px; }
.citation-card > a:hover { color: #fff; }

/* ---------- Footer ---------- */
.footer { background: var(--night); color: var(--night-text); border-top: 1px solid var(--night-line); }
.footer-inner { padding-top: 44px; padding-bottom: 44px; display: flex; justify-content: space-between; gap: 55px; }
.footer-brand { font-size: 24px; font-weight: 700; letter-spacing: -.5px; }
.footer-brand span { color: var(--vuln); }
.footer p { font-size: 15px; color: var(--night-muted); max-width: 480px; margin: 8px 0 0; }
.footer-right { text-align: right; align-self: flex-end; }
.footer-right > a { font-size: 16px; color: var(--night-text); }
.footer a:hover { color: var(--fix-bright); }

.skip { position: absolute; top: -80px; left: 12px; z-index: 40; background: var(--vuln); color: #fff; padding: 10px 15px; border-radius: 8px; }
.skip:focus { top: 10px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

.reveal { opacity: 0; transform: translateY(18px); transition: opacity .7s ease, transform .7s cubic-bezier(.2, .7, .2, 1); }
.reveal.in { opacity: 1; transform: none; }

/* Chinese typography */
html[lang=zh-CN] .hero-subtitle { font-family: var(--sans); font-size: 42px; line-height: 1.35; letter-spacing: 0; font-weight: 500; }
html[lang=zh-CN] .hero-subtitle em { font-style: normal; }
html[lang=zh-CN] .section-title, html[lang=zh-CN] .page-title, html[lang=zh-CN] .paper-section h1 { font-family: var(--sans); line-height: 1.3; font-weight: 600; letter-spacing: 0; }
html[lang=zh-CN] .section-title { font-size: 38px; }
html[lang=zh-CN] .page-title, html[lang=zh-CN] .paper-section h1 { font-size: clamp(38px, 4.4vw, 56px); }
html[lang=zh-CN] .doc-comment::before { content: "/* 评测协议 */"; }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  .hero { gap: 40px; }
  .section-title { font-size: 40px; }
  .problem, .scope-section { gap: 52px; }
  .commit-grid { gap: 40px; }
  .cells-row { grid-template-columns: 130px 1fr 120px; gap: 20px; }
  .paper-inner { gap: 48px; }
  .diff { font-size: 12.5px; }
}
@media (max-width: 860px) {
  .wrap { width: calc(100% - 48px); }
  .header-inner { padding: 0 24px; gap: 20px; }
  .header nav a { padding: 0 14px; }
  .hero { grid-template-columns: 1fr; gap: 44px; padding-top: 56px; padding-bottom: 40px; }
  .hero-copy, .hero-visual { max-width: 640px; }
  .authors { display: block; }
  .authors > span { display: block; margin-top: 4px; }
  .home-diff { padding-top: 56px; }
  .diff-panel, .diff-panel.two { grid-template-columns: 1fr; }
  .dgroup { border-left: 0; border-top: 1px solid var(--line); }
  .dgroup:first-child { border-top: 0; }
  .section { padding-block: 76px; }
  .problem, .scope-section { grid-template-columns: 1fr; gap: 32px; }
  .tree-row { grid-template-columns: 30px 1fr 30px; row-gap: 4px; }
  .tree-desc { grid-column: 2 / 3; grid-row: 2; }
  .tree-go { grid-row: 1 / 3; grid-column: 3; }
  .graph { padding-left: 44px; }
  .graph::before { left: 9px; }
  .node { left: -44px; }
  .graph-note { padding-left: 44px; }
  .commit-grid { grid-template-columns: 1fr; gap: 28px; }
  .chapter { padding-top: 64px; }
  .cells-row { grid-template-columns: 1fr auto; gap: 12px 16px; }
  .cells-row .cells { grid-column: 1 / 3; grid-row: 2; }
  .cells-count { display: flex; align-items: baseline; gap: 8px; }
  .cells-count strong { display: inline; font-size: 44px; }
  .paper-inner { grid-template-columns: 1fr; gap: 44px; padding-block: 64px; }
  .paper-section h1 br { display: none; }
  .footer-right { min-width: 180px; }
}
@media (max-width: 560px) {
  body { font-size: 16px; }
  .wrap { width: calc(100% - 32px); }
  .header-inner { height: auto; padding: 0 16px; flex-wrap: wrap; gap: 0; }
  .wordmark { height: 54px; font-size: 17px; gap: 9px; }
  .brand-mark { width: 26px; height: 26px; }
  .language { padding: 5px 11px; font-size: 14px; }
  .header nav { order: 3; width: calc(100% + 32px); margin: 0 -16px; border-left: 0; border-top: 1px solid var(--night-line); height: 46px; }
  .header nav a { flex: 1; justify-content: center; padding: 0 6px; font-size: 15px; }
  .header nav a:last-child { border-right: 0; }
  .hero { padding-top: 40px; gap: 36px; }
  .hero h1 { font-size: 60px; }
  .hero-subtitle { font-size: 34px; }
  .hero-description { font-size: 17px; margin-bottom: 28px; }
  .eyebrow { font-size: 14px; }
  .hero-visual { padding: 14px 12px 12px; border-radius: 18px; }
  .visual-title { font-size: 15px; margin: 2px 4px 12px; }
  .diff { font-size: 11px; }
  .dl { grid-template-columns: 28px 14px 1fr; padding-right: 8px; }
  .ln { padding-right: 8px; }
  .pair { gap: 8px; }
  .pair-item { padding: 12px 10px; gap: 8px; }
  .pair-item strong { font-size: 16px; }
  .pair-symbol { width: 24px; height: 24px; font-size: 15px; border-radius: 6px; }
  .authors { font-size: 15px; }
  .hunk { font-size: 14px; padding: 8px 14px; }
  .dgroup-title { margin: 0 16px 12px; font-size: 17px; }
  .drow { grid-template-columns: 36px auto 1fr; padding-right: 14px; }
  .drow .sign { font-size: 22px; }
  .drow .val { font-size: 50px; }
  .dnote { margin: 12px 16px 0; }
  .section-title { font-size: 34px; }
  .lead { font-size: 18px; }
  .tree-row { padding: 20px 8px; gap: 4px 12px; }
  .tree-name { font-size: 22px; }
  .tree-desc { font-size: 16px; }
  .page-head { padding-top: 48px; padding-bottom: 52px; }
  .page-title { font-size: 42px; }
  .page-intro { font-size: 17px; }
  .path { font-size: 15px; }
  .commit h2 { font-size: 27px; }
  .commit-text > p { font-size: 17px; }
  .commit { padding-bottom: 64px; }
  .q { grid-template-columns: 112px 1fr; padding: 6px 14px; font-size: 14px; }
  .formula { font-size: 15px; gap: 8px; }
  .term { padding: 12px 14px; }
  .chapter-title { font-size: 28px; gap: 12px; }
  .chapter-no { font-size: 16px; }
  .chapter-intro { font-size: 16.5px; }
  .cells-block { padding: 18px 16px 16px; }
  .cells { grid-template-columns: repeat(auto-fill, 8px); gap: 2px; }
  .cells i { width: 8px; height: 8px; }
  .patch-legend { padding: 10px 14px; gap: 6px 18px; font-size: 15px; }
  .fill .val { font-size: 44px; }
  .doc-comment { padding-left: 18px; font-size: 16.5px; }
  .scope-body { padding-left: 22px; }
  .next-file { padding: 24px 8px; margin-top: 60px; }
  .next-name { font-size: 24px; }
  .paper-inner { padding-block: 52px; }
  .paper-facts { gap: 28px; }
  .paper-facts strong { font-size: 44px; }
  .citation-card pre { font-size: 12.5px; padding: 18px 16px 14px; }
  .citation-card > a { margin: 0 16px 18px; }
  .citation-header { padding: 11px 12px 11px 16px; font-size: 15px; }
  .citation-title { display: none; }
  .citation-header button { margin-left: auto; }
  .footer-inner { display: block; padding-block: 34px; }
  .footer-right { text-align: left; margin-top: 22px; }
  html[lang=zh-CN] .hero-subtitle { font-size: 32px; }
  html[lang=zh-CN] .section-title { font-size: 30px; }
  html[lang=zh-CN] .page-title, html[lang=zh-CN] .paper-section h1 { font-size: 36px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .button, .tree-row, .tree-go, .next-file { transition: none; }
  .button:hover { transform: none; }
  .dot { animation: none; }
  .reveal { opacity: 1; transform: none; transition: none; }
}
