/* ------------------------------------------------------------------
   LaTeX / arXiv 论文风格
   Latin: Computer Modern（CDN，离线时回退到系统衬线）
   CJK:   宋体（正文）/ 楷体（注、判定说明）
   ------------------------------------------------------------------ */

@font-face {
  font-family: "CM Serif";
  src: url("https://cdn.jsdelivr.net/gh/aaaakshat/cm-web-fonts@latest/font/Serif/cmunrm.woff") format("woff");
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "CM Serif";
  src: url("https://cdn.jsdelivr.net/gh/aaaakshat/cm-web-fonts@latest/font/Serif/cmunbx.woff") format("woff");
  font-weight: 700; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "CM Serif";
  src: url("https://cdn.jsdelivr.net/gh/aaaakshat/cm-web-fonts@latest/font/Serif/cmunti.woff") format("woff");
  font-weight: 400; font-style: italic; font-display: swap;
}
@font-face {
  font-family: "CM Serif";
  src: url("https://cdn.jsdelivr.net/gh/aaaakshat/cm-web-fonts@latest/font/Serif/cmunbi.woff") format("woff");
  font-weight: 700; font-style: italic; font-display: swap;
}
@font-face {
  font-family: "CM Typewriter";
  src: url("https://cdn.jsdelivr.net/gh/aaaakshat/cm-web-fonts@latest/font/Typewriter/cmuntt.woff") format("woff");
  font-weight: 400; font-style: normal; font-display: swap;
}

:root {
  --paper: #fffffe;
  --ink: #111111;
  --ink-2: #4a4a48;
  --ink-3: #8a8985;
  --rule: #111111;
  --hair: #dcdbd6;
  --wash: #f4f3ef;
  --link: #1f4e9c;
  --tier-a: #9b1c1c;
  --tier-b: #8a5600;
  --tier-c: #4a4a48;
  --tier-d: #8a8985;
  --series-oa: #2a78d6;   /* 图 1：categorical slot 1（已验证） */
  --series-s2: #eb6834;   /* 图 1：categorical slot 2（已验证） */

  --serif: "CM Serif", "Latin Modern Roman", "CMU Serif", "Times New Roman",
           "Songti SC", "STSong", "Noto Serif CJK SC", "Source Han Serif SC", "SimSun", serif;
  --kai: "CM Serif", "Latin Modern Roman", "Times New Roman",
         "Kaiti SC", "STKaiti", "KaiTi", "Songti SC", serif;
  --mono: "CM Typewriter", "SF Mono", Menlo, Consolas, "Songti SC", monospace;

  --measure: 46rem;
  --wide: 62rem;
  --head-h: 2.6rem;
}

* { box-sizing: border-box; }

html {
  font-size: 17px;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--head-h) + 1rem);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--serif);
  line-height: 1.8;
  text-rendering: optimizeLegibility;
  font-kerning: normal;
}

a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 2px; }
a:focus-visible, button:focus-visible, summary:focus-visible, input:focus-visible, select:focus-visible, tr:focus-visible {
  outline: 2px solid var(--link); outline-offset: 2px; border-radius: 2px;
}
[hidden] { display: none !important; }

code { font-family: var(--mono); font-size: 0.92em; word-break: break-word; }
strong { font-weight: 700; }
em { font-style: italic; }
mark { background: #fbeeb8; color: inherit; padding: 0 1px; }

/* ---------- 页眉（running head） ---------- */
.runhead {
  position: sticky; top: 0; z-index: 40;
  background: rgba(255, 255, 254, 0.94);
  backdrop-filter: blur(6px);
  border-bottom: 0.8px solid var(--hair);
}
.runhead-inner {
  max-width: var(--wide);
  margin: 0 auto;
  height: var(--head-h);
  padding: 0 1.5rem;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  font-size: 0.8rem;
}
.runhead-brand {
  color: var(--ink-2);
  font-variant: small-caps;
  letter-spacing: 0.04em;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.runhead-brand:hover { color: var(--ink); text-decoration: none; }
.runhead-nav { display: flex; align-items: center; gap: 1.1rem; flex: none; }
.runhead-nav > a { color: var(--ink-3); }
.runhead-nav > a:hover { color: var(--ink); text-decoration: none; }
.runhead-nav > a[aria-current="page"] { color: var(--ink); }

.appendix-btn {
  border: 1px solid var(--ink) !important;
  color: var(--ink) !important;
  padding: 0.05rem 0.6rem;
  line-height: 1.6;
  border-radius: 2px;
  transition: background 0.15s, color 0.15s;
}
.appendix-btn:hover { background: var(--ink); color: var(--paper) !important; text-decoration: none; }

/* ---------- 阅读进度 ---------- */
.progress { position: fixed; inset: 0 0 auto 0; height: 2px; z-index: 50; }
.progress span { display: block; height: 100%; width: 0; background: var(--ink); }

/* ---------- 版心 ---------- */
.paper { max-width: var(--measure); margin: 0 auto; padding: 3.5rem 1.5rem 5rem; }
.paper-wide { max-width: var(--wide); }

/* ---------- 标题区 ---------- */
.title-block { text-align: center; margin-bottom: 2.25rem; }
.title-block h1 { font-size: 1.75rem; line-height: 1.45; font-weight: 700; margin: 0 0 1.1rem; letter-spacing: 0.01em; }
.title-block .date { margin: 0; font-size: 1.05rem; text-align: center; }

.page-head { margin-bottom: 1.5rem; }
.page-title {
  font-size: 1.6rem; font-weight: 700; line-height: 1.4; margin: 0;
  display: flex; align-items: baseline;
}

/* ---------- 摘要 ---------- */
.abstract { margin: 0 auto 2rem; max-width: 38rem; font-size: 0.94rem; }
.abstract-title { text-align: center; font-size: 0.94rem; font-weight: 700; margin: 0 0 0.4rem; letter-spacing: 0.3em; display: block; }
.abstract p { margin: 0 0 0.35rem; text-align: justify; text-indent: 2em; }

/* ---------- 首页入口按钮 ---------- */
.cta { text-align: center; margin: 0 0 2.5rem; }
.cta-bottom { margin: 3rem 0 0; }
.cta-btn {
  display: inline-flex; align-items: center; gap: 0.5rem;
  padding: 0.55rem 1.4rem;
  border: 1px solid var(--ink);
  color: var(--ink);
  font-weight: 700;
  border-radius: 2px;
  transition: background 0.15s, color 0.15s;
}
.cta-btn:hover { background: var(--ink); color: var(--paper); text-decoration: none; }
.cta-stats { margin: 0.75rem 0 0; font-size: 0.85rem; color: var(--ink-2); text-align: center; }
.cta-stats a { color: var(--ink-2); white-space: nowrap; }
.cta-stats a:hover { color: var(--ink); }
.cta-stats .sep { margin: 0 0.5rem; color: var(--ink-3); }

/* ---------- 内文目录 ---------- */
.inline-toc { margin: 0 0 2.5rem; }
.inline-toc ol { list-style: none; margin: 0; padding: 0; }
.inline-toc li { margin-top: 0.3rem; }
.inline-toc a { display: flex; gap: 0.9rem; align-items: baseline; color: var(--ink); font-weight: 700; }
.inline-toc a:hover { color: var(--link); text-decoration: none; }
.inline-toc .n { min-width: 2rem; }

/* ---------- 章节标题 ---------- */
h2 { font-size: 1.4rem; font-weight: 700; line-height: 1.4; margin: 3rem 0 1rem; display: flex; align-items: baseline; }
h3 { font-size: 1.15rem; font-weight: 700; line-height: 1.5; margin: 2.25rem 0 0.75rem; }
.secnum { flex: none; min-width: 2.2rem; font-variant-numeric: tabular-nums; }

p { margin: 0 0 0.9rem; text-align: justify; }
p.noindent { text-indent: 0; }

ol.enum, ul.itemize, .issue ul { margin: 0 0 1rem; padding-left: 2em; }
ol.enum { list-style: none; counter-reset: enum; }
ol.enum > li { counter-increment: enum; position: relative; margin-bottom: 0.45rem; }
ol.enum > li::before { content: counter(enum) "."; position: absolute; left: -1.6em; width: 1.3em; text-align: right; }
ul.itemize, .issue ul { list-style: none; }
ul.itemize > li, .issue ul > li { position: relative; margin-bottom: 0.45rem; overflow-wrap: break-word; }
ul.itemize > li::before, .issue ul > li::before { content: "•"; position: absolute; left: -1.1em; }

/* ---------- 档位标记（\fbox 风格） ---------- */
.tier {
  display: inline-block; min-width: 1.35em; padding: 0 0.28em;
  border: 1px solid currentColor;
  font-size: 0.78em; line-height: 1.35; text-align: center; font-weight: 700;
  vertical-align: 0.08em;
}
.tier-A { color: var(--tier-a); }
.tier-B { color: var(--tier-b); }
.tier-C { color: var(--tier-c); }
.tier-D { color: var(--tier-d); }
.tier-link { color: var(--ink); }

/* ---------- booktabs 三线表 ---------- */
figure { margin: 1.75rem 0 2rem; }
figcaption { font-size: 0.92rem; text-align: center; margin: 0 0 0.6rem; }
figcaption .label { font-weight: 700; margin-right: 0.7em; }
.caption-hint { color: var(--ink-3); font-size: 0.85em; }

.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }

table.booktabs {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.86rem;
  line-height: 1.6;
  border-top: 1.6px solid var(--rule);
  border-bottom: 1.6px solid var(--rule);
}
table.booktabs thead th {
  border-bottom: 0.8px solid var(--rule);
  font-weight: 700; text-align: left;
  padding: 0.45rem 0.6rem 0.4rem;
  white-space: nowrap; vertical-align: bottom;
}
table.booktabs td { padding: 0.42rem 0.6rem; vertical-align: top; text-align: left; }
table.booktabs tbody tr:first-child td { padding-top: 0.6rem; }
table.booktabs tbody tr:last-child td { padding-bottom: 0.6rem; }
table.booktabs .num, table.booktabs th.num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.nowrap { white-space: nowrap; }
.tabnum { font-variant-numeric: tabular-nums; }

.tiers-table td:first-child { min-width: 12rem; }
.issue-table td:first-child { width: 1.5rem; }
.issue-table td:nth-child(2) { min-width: 7rem; }
.issue-table td:nth-child(4) { min-width: 9rem; }
.evidence-table td:first-child { min-width: 9rem; }
.evidence-table .ev-paper { color: var(--ink); }
.evidence-table .ev-paper:hover { color: var(--link); }
.ev-result { white-space: nowrap; }

/* ---------- 搜索 / 筛选工具条 ---------- */
.toolbar { margin: 0 0 1.25rem; font-size: 0.85rem; }
.search { position: relative; margin-bottom: 0.75rem; }
.search input {
  width: 100%;
  font: inherit; font-size: 0.95rem;
  color: var(--ink);
  padding: 0.5rem 2.4rem 0.5rem 0.2rem;
  border: none;
  border-bottom: 1px solid var(--ink);
  background: transparent;
  border-radius: 0;
  -webkit-appearance: none; appearance: none;
}
.search input::placeholder { color: var(--ink-3); }
.search input:focus { outline: none; border-bottom-width: 2px; padding-bottom: calc(0.5rem - 1px); }
.search-kbd {
  position: absolute; right: 0.2rem; top: 50%; transform: translateY(-50%);
  font-family: var(--mono); font-size: 0.75rem; color: var(--ink-3);
  border: 1px solid var(--hair); padding: 0 0.35rem; border-radius: 2px;
}
.filter-row { display: flex; flex-wrap: wrap; align-items: center; gap: 0.6rem 1.4rem; }
.filter-group { display: inline-flex; align-items: center; gap: 0.4rem; flex-wrap: wrap; }
.chips { display: inline-flex; gap: 0.35rem; flex-wrap: wrap; }
select {
  font: inherit; color: var(--ink);
  background: transparent;
  border: 1px solid var(--hair);
  border-radius: 2px;
  padding: 0.1rem 1.4rem 0.1rem 0.45rem;
  line-height: 1.6;
  -webkit-appearance: none; appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--ink-2) 50%), linear-gradient(135deg, var(--ink-2) 50%, transparent 50%);
  background-position: calc(100% - 0.75rem) 55%, calc(100% - 0.45rem) 55%;
  background-size: 0.3rem 0.3rem;
  background-repeat: no-repeat;
  cursor: pointer;
}
select:hover { border-color: var(--ink-3); }
.result-row {
  display: flex; align-items: center; gap: 0.8rem;
  margin-top: 0.85rem; padding-top: 0.6rem;
  border-top: 0.8px solid var(--hair);
}
.result-count { margin: 0; color: var(--ink-2); }
.view-toggle { margin-left: auto; display: inline-flex; gap: 0.35rem; }

.controls { display: flex; flex-wrap: wrap; align-items: center; gap: 0.35rem 0.4rem; margin: 0 0 0.7rem; font-size: 0.82rem; }
.controls-label { color: var(--ink-3); margin-right: 0.15rem; }
.chip {
  font: inherit; color: var(--ink-2);
  background: transparent;
  border: 1px solid var(--hair); border-radius: 2px;
  padding: 0.1rem 0.55rem; cursor: pointer; line-height: 1.6;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}
.chip:hover { border-color: var(--ink-3); color: var(--ink); }
.chip.is-active { border-color: var(--ink); color: var(--ink); background: var(--wash); }
.chip .tier { font-size: 0.72rem; margin-right: 0.1rem; }
.chip-count { color: var(--ink-3); font-variant-numeric: tabular-nums; font-size: 0.9em; }

.text-btn { all: unset; cursor: pointer; color: var(--link); }
.text-btn:hover { text-decoration: underline; }

.empty { text-align: center; color: var(--ink-2); padding: 3rem 0; }

/* ---------- 总排序表 ---------- */
.ranking-table { font-size: 0.85rem; }
.ranking-table tbody tr { cursor: pointer; transition: background-color 0.12s ease; }
.ranking-table tbody tr:hover, .ranking-table tbody tr:focus-visible { background: var(--wash); }
.ranking-table tbody tr.group-start td { border-top: 0.6px solid var(--hair); }
.ranking-table .paper-name { min-width: 8rem; }
.ranking-table .paper-name a { color: var(--ink); font-weight: 700; }
.ranking-table tbody tr:hover .paper-name a { color: var(--link); }
.ranking-table .summary { min-width: 16rem; }
.ranking-table .action { min-width: 8rem; }
.ranking-table .venue { color: var(--ink-2); }
.ranking-table tbody tr[data-tier="A"] .pri { color: var(--tier-a); }
.deep-match { display: block; font-size: 0.75rem; color: var(--ink-3); font-weight: 400; }
.th-sort { all: unset; cursor: pointer; font-weight: 700; display: inline-flex; gap: 0.3em; align-items: baseline; }
.th-sort::after { content: "↕"; font-weight: 400; color: var(--ink-3); font-size: 0.85em; }
.th-sort.is-sorted::after { content: "↓"; color: var(--ink); }
.th-sort[data-sort="p"].is-sorted::after { content: "↑"; }
.th-sort[data-key]:not([data-key=""])::before { content: attr(data-key); order: 2; font-weight: 400; color: var(--ink-2); font-size: 0.85em; }

/* ---------- 图 1 ---------- */
.chart-figure { position: relative; }
.chart-caption-top { margin-bottom: 0.4rem; }
.legend { display: flex; justify-content: flex-end; gap: 0.9rem; color: var(--ink-2); font-size: 0.82rem; margin-bottom: 0.5rem; }
.legend-item { display: inline-flex; align-items: center; gap: 0.35rem; }
.swatch { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }
.swatch-oa { background: var(--series-oa); }
.swatch-s2 { background: var(--series-s2); }

.chart { width: 100%; }
.chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart text { font-family: var(--serif); fill: var(--ink); }
.chart .axis-text { fill: var(--ink-3); font-size: 11px; font-variant-numeric: tabular-nums; }
.chart .grid { stroke: #ebeae5; stroke-width: 1; }
.chart .baseline { stroke: #c3c2b7; stroke-width: 1; }
.chart .row-label { font-size: 12.5px; }
.chart .row-label .pri { fill: var(--ink-3); }
.chart .tier-tag { font-size: 10px; font-weight: 700; }
.chart .tier-tag-box { fill: none; stroke-width: 1; }
.chart .link-line { stroke: #c9c8c2; stroke-width: 2; stroke-linecap: round; }
.chart .dot { stroke: var(--paper); stroke-width: 2; }
.chart .dot-oa { fill: var(--series-oa); }
.chart .dot-s2 { fill: var(--series-s2); }
.chart .row { cursor: pointer; }
.chart .row .hit { fill: transparent; }
.chart .row.is-hot .hit { fill: var(--wash); }
.chart .group-rule { stroke: var(--hair); stroke-width: 1; }
.chart .axis-title { fill: var(--ink-3); font-size: 11px; }

.tooltip {
  position: absolute; pointer-events: none;
  background: var(--paper); border: 1px solid var(--ink);
  padding: 0.4rem 0.6rem; font-size: 0.8rem; line-height: 1.55;
  min-width: 11rem; z-index: 5;
  box-shadow: 2px 2px 0 rgba(0,0,0,0.06);
}
.tooltip .tt-title { font-weight: 700; }
.tooltip .tt-row { display: flex; justify-content: space-between; gap: 1rem; }
.tooltip .tt-row .k { display: inline-flex; align-items: center; gap: 0.35rem; color: var(--ink-2); }
.tooltip .tt-row .v { font-variant-numeric: tabular-nums; font-weight: 700; }

/* ---------- 详情页 ---------- */
.crumbs { font-size: 0.85rem; margin-bottom: 1.75rem; }
.crumbs a { color: var(--ink-2); }
.crumbs a:hover { color: var(--ink); }
.detail-head { margin-bottom: 1.5rem; }
.eyebrow { font-size: 0.88rem; color: var(--ink-2); margin: 0 0 0.4rem; }
.eyebrow a { color: var(--ink-2); }
.eyebrow a:hover { color: var(--ink); }
.paper-title { font-size: 1.7rem; font-weight: 700; line-height: 1.4; margin: 0 0 0.3rem; }
.paper-subtitle { font-size: 1.12rem; margin: 0 0 0.8rem; font-weight: 700; color: var(--ink-2); }
.paper-meta { font-size: 0.92rem; color: var(--ink-2); margin: 0; text-align: left; }

.overview { margin-top: 1.25rem; }
.overview figcaption { text-align: left; }
.kv-table th[scope="row"] {
  text-align: left; font-weight: 700; white-space: nowrap; vertical-align: top;
  width: 7.5rem; padding: 0.42rem 0.6rem;
}
.kv-table tbody tr:first-child th { padding-top: 0.6rem; }
.kv-table tbody tr:last-child th { padding-bottom: 0.6rem; }

.detail-h2 { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; margin: 2.5rem 0 1rem; }
.detail-h2 h2 { margin: 0; }
.expand-controls { display: flex; gap: 0.5rem; font-size: 0.8rem; color: var(--ink-3); }

details.issue { margin: 0 0 0.9rem; border-top: 1px solid var(--hair); padding-top: 0.55rem; }
details.issue > summary {
  list-style: none; cursor: pointer; font-weight: 700; line-height: 1.65;
  padding-left: 1.4rem; position: relative; margin-bottom: 0.4rem;
}
details.issue > summary::-webkit-details-marker { display: none; }
details.issue > summary::before {
  content: "▸"; position: absolute; left: 0.1rem; top: 0;
  font-weight: 400; color: var(--ink-3); transition: transform 0.15s ease;
}
details.issue[open] > summary::before { transform: rotate(90deg); }
.issue-n { margin-right: 0.15em; }
.sev-1 .sev { color: var(--tier-a); }
.sev-2 .sev { color: var(--tier-b); }
.sev-3 .sev { color: var(--ink-2); }
.agent-note { font-weight: 400; color: var(--ink-2); font-size: 0.92em; }
details.issue > ul { padding-left: 3.4em; font-size: 0.97rem; }

.compare { display: flex; align-items: center; justify-content: center; gap: 1.5rem; margin: 0.75rem 0 1.1rem 1.4rem; font-size: 0.88rem; }
.compare-col { text-align: center; min-width: 9rem; }
.compare-head { margin: 0 0 0.25rem; padding-bottom: 0.2rem; border-bottom: 0.8px solid var(--rule); font-weight: 700; text-align: center; }
.compare-row { margin: 0; text-align: center; color: var(--ink-2); }
.compare-row span { color: var(--ink); font-weight: 700; font-variant-numeric: tabular-nums; }
.compare-arrow { color: var(--ink-3); font-size: 1.2rem; }

.hitrate { margin: 0.5rem 0 1.5rem; font-size: 0.84rem; }
.hitrate-title { text-align: center; margin: 0 0 0.5rem; color: var(--ink-2); }
.hitrate-row { display: grid; grid-template-columns: 8rem 1fr 13.5rem; gap: 0.75rem; align-items: center; margin-bottom: 0.3rem; }
.hr-src { text-align: right; color: var(--ink-2); }
.hr-track {
  position: relative; height: 16px;
  background: repeating-linear-gradient(to right, #ebeae5 0 1px, transparent 1px 20%);
  border-left: 1px solid #c3c2b7;
}
.hr-track .seg { position: absolute; top: 7px; height: 2px; background: var(--ink-3); }
.hr-track .d0, .hr-track .d1 { position: absolute; top: 3px; width: 10px; height: 10px; margin-left: -5px; border-radius: 50%; }
.hr-track .d0 { border: 1.5px solid var(--ink-2); background: var(--paper); }
.hr-track .d1 { background: var(--ink); box-shadow: 0 0 0 2px var(--paper); }
.hitrate-axis { margin-top: -0.1rem; }
.hr-ticks { position: relative; height: 1.1rem; font-size: 0.72rem; color: var(--ink-3); }
.hr-ticks span { position: absolute; transform: translateX(-50%); font-variant-numeric: tabular-nums; }
.hr-val { font-variant-numeric: tabular-nums; white-space: nowrap; }

.remark, .verdict { margin: 1.5rem 0; font-family: var(--kai); }
.remark p, .verdict p { margin: 0; text-align: left; }
.remark-head, .verdict-head { font-family: var(--serif); font-weight: 700; font-style: normal; margin-right: 0.5em; }
.remark { padding-left: 1rem; border-left: 1px solid var(--ink-3); color: var(--ink-2); }
.verdict { padding: 0.8rem 1rem; border: 1px solid var(--hair); background: #fcfcfa; }
.verdict em.note { font-style: italic; color: var(--ink-2); }

.related { margin-top: 2.5rem; }
.related h2 { font-size: 1.15rem; margin: 0 0 0.6rem; }
.related-list { margin: 0 0 0.6rem; padding-left: 1.2rem; font-size: 0.9rem; }
.related-list li { margin-bottom: 0.15rem; }
.appendix-link { font-size: 0.88rem; }

.pager {
  display: grid; grid-template-columns: 1fr 1fr; gap: 1rem;
  margin-top: 3rem; padding-top: 1rem;
  border-top: 1.6px solid var(--rule);
}
.pager a { display: flex; flex-direction: column; color: var(--ink); padding: 0.2rem 0; }
.pager a:hover { text-decoration: none; }
.pager a:hover .pager-name { color: var(--link); }
.pager-next { text-align: right; align-items: flex-end; }
.pager-dir { font-size: 0.8rem; color: var(--ink-3); }
.pager-name { font-weight: 700; font-size: 0.95rem; }

/* ---------- 附录 ---------- */
.return-bar {
  display: flex; align-items: baseline; gap: 0.5rem;
  margin: -1rem 0 2rem;
  padding: 0.55rem 0.9rem;
  background: var(--wash);
  border-left: 2px solid var(--ink);
  font-size: 0.9rem;
}
.return-bar a { color: var(--ink); font-weight: 700; }
.return-hint { color: var(--ink-3); font-size: 0.8rem; }
.ok { font-weight: 700; }
.file code { color: var(--link); }

/* 跳转目标高亮 */
:target, .flash { animation: flash 1.6s ease-out 1; }
@keyframes flash { 0% { background: #fbf3d5; } 100% { background: transparent; } }

.to-top {
  position: fixed; right: 1.5rem; bottom: 1.5rem;
  width: 2.2rem; height: 2.2rem; display: grid; place-items: center;
  border: 1px solid var(--hair); background: var(--paper); color: var(--ink-2);
  opacity: 0; pointer-events: none; transition: opacity 0.2s ease; z-index: 25;
}
.to-top.is-visible { opacity: 1; pointer-events: auto; }
.to-top:hover { color: var(--ink); border-color: var(--ink); text-decoration: none; }

@media (max-width: 640px) {
  html { font-size: 16px; }
  .runhead-inner { padding: 0 1rem; }
  .runhead-brand { font-size: 0.75rem; }
  .runhead-nav { gap: 0.8rem; }
  .paper { padding: 2.25rem 1.1rem 4rem; }
  .title-block h1 { font-size: 1.4rem; }
  .page-title, .paper-title { font-size: 1.35rem; }
  h2 { font-size: 1.22rem; }
  .filter-row { gap: 0.6rem 1rem; }
  .search-kbd { display: none; }
  .caption-hint { display: block; }
  details.issue > ul { padding-left: 1.6em; }
  .compare { gap: 0.8rem; margin-left: 0; }
  .compare-col { min-width: 0; }
  .hitrate-row { grid-template-columns: 5.5rem 1fr; }
  .hr-val { grid-column: 2; font-size: 0.8rem; margin-top: -0.2rem; }
  .detail-h2 { flex-direction: column; gap: 0.2rem; }
  .pager { grid-template-columns: 1fr; }
  .pager-next { text-align: left; align-items: flex-start; }
  p, ol.enum > li, ul.itemize > li, .issue ul > li { text-align: left; }
  .return-bar { flex-direction: column; gap: 0; }
}

/* 手机：总排序表改为卡片 */
@media (max-width: 640px) {
  .ranking-table { border-bottom: none; }
  .ranking-table thead { display: none; }
  .ranking-table, .ranking-table tbody { display: block; }
  .ranking-table tbody tr {
    display: grid;
    grid-template-columns: auto 1fr auto;
    grid-template-areas: "pri name cite" "meta meta meta" "sum sum sum" "act act act";
    gap: 0.15rem 0.6rem;
    padding: 0.75rem 0.1rem;
    border-bottom: 0.6px solid var(--hair);
  }
  .ranking-table tbody tr:last-child { border-bottom: 1.6px solid var(--rule); }
  .ranking-table tbody tr.group-start td { border-top: none; }
  .ranking-table tbody td { padding: 0 !important; min-width: 0 !important; }
  .ranking-table td.pri { grid-area: pri; }
  .ranking-table td.paper-name { grid-area: name; }
  .ranking-table td.num { grid-area: cite; color: var(--ink-2); }
  .ranking-table td.venue { grid-area: meta; display: inline; }
  .ranking-table td:nth-child(4) { grid-area: meta; justify-self: end; }
  .ranking-table td.summary { grid-area: sum; }
  .ranking-table td.action { grid-area: act; color: var(--ink-2); }
  .ranking-table td.action::before { content: "建议动作："; color: var(--ink-3); }
}

@media print {
  @page { margin: 2cm; }
  html { font-size: 10.5pt; }
  .runhead, .progress, .to-top, .toolbar, .controls, .expand-controls, .cta, .return-bar, .pager { display: none !important; }
  .paper { max-width: none; padding: 0; }
  a { color: var(--ink); }
  details.issue > summary::before { display: none; }
  details.issue > summary { padding-left: 0; }
  figure, details, .verdict, tr { break-inside: avoid; }
  h2, h3 { break-after: avoid; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; animation: none !important; }
}
