:root {
  --accent: #7c3aed; --accent-ink: #6d28d9; --accent-soft: #f5f3ff;
  --bg: #f7f7fa; --surface: #fff; --text: #26232e; --muted: #706b7c; --border: #e6e3eb;
  --pass-bg: #e8f5ed; --pass-ink: #22643e; --warn-bg: #fff5dc; --warn-ink: #815607;
  --bad-bg: #fdebed; --bad-ink: #a12840; --side-w: 272px; --reading-size: 16.5px;
  --font-sans: "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  --font-serif: "Noto Serif SC", "Source Han Serif SC", "Songti SC", SimSun, Georgia, serif;
  --reading-font: var(--font-sans); color-scheme: light;
}
/* System mode also works without JavaScript and updates with OS preference changes. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --accent: #a78bfa; --accent-ink: #c4b5fd; --accent-soft: #241d38;
    --bg: #15141a; --surface: #1c1b23; --text: #e9e6f0; --muted: #aaa4b9; --border: #34303f;
    --pass-bg: #193529; --pass-ink: #9cd6b1; --warn-bg: #3b301b; --warn-ink: #ead18b;
    --bad-bg: #3d232b; --bad-ink: #f1a4b2; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --accent: #a78bfa; --accent-ink: #c4b5fd; --accent-soft: #241d38;
  --bg: #15141a; --surface: #1c1b23; --text: #e9e6f0; --muted: #aaa4b9; --border: #34303f;
  --pass-bg: #193529; --pass-ink: #9cd6b1; --warn-bg: #3b301b; --warn-ink: #ead18b;
  --bad-bg: #3d232b; --bad-ink: #f1a4b2; color-scheme: dark;
}
:root[data-fs="s"] { --reading-size: 15px; }
:root[data-fs="l"] { --reading-size: 18px; }
:root[data-fs="xl"] { --reading-size: 19.5px; }
:root[data-font="serif"] { --reading-font: var(--font-serif); }
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 85px; }
body { margin: 0; background: var(--surface); color: var(--text); font: var(--reading-size)/1.85 var(--reading-font); -webkit-font-smoothing: antialiased; }
[hidden] { display: none !important; }
button, input { font: inherit; }
button { cursor: pointer; border: 1px solid var(--border); background: var(--surface); color: var(--text); border-radius: 8px; padding: 7px 12px; }
button:hover { border-color: var(--accent); color: var(--accent-ink); }
input { width: 100%; min-width: 0; padding: 10px 13px; border: 1px solid var(--border); border-radius: 8px; color: var(--text); background: var(--surface); }
input::placeholder { color: var(--muted); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
a { color: var(--accent-ink); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { text-decoration: underline; }
h1, h2, h3 { line-height: 1.4; overflow-wrap: anywhere; }
h1 { font-size: 1.95em; letter-spacing: -.025em; }
h2 { font-size: 1.3em; }
h3 { font-size: 1.08em; }
p { margin: 1em 0; }
small, .muted { color: var(--muted); }
small { display: block; font-size: .85em; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip-link { position: fixed; top: -100px; left: 12px; z-index: 100; background: var(--surface); padding: 10px; }
.skip-link:focus { top: 10px; }
.sidebar { position: fixed; inset: 0 auto 0 0; width: var(--side-w); overflow-y: auto; background: var(--bg); border-right: 1px solid var(--border); padding: 26px 20px 100px; z-index: 40; font: 14px/1.6 var(--font-sans); scrollbar-width: thin; }
.side-home { margin-bottom: 28px; position: sticky; top: -26px; background: var(--bg); padding: 6px 0; z-index: 1; }
.side-home a { font-size: 12px; color: var(--muted); text-decoration: none; }
.side-brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); font-size: 18px; font-weight: 650; }
.side-brand small { font-size: 8px; letter-spacing: 1.2px; margin-top: 4px; font-weight: 500; }
.brand-mark { display: grid; place-items: center; width: 42px; height: 46px; background: var(--accent-soft); border: 1px solid var(--border); color: var(--accent-ink); border-radius: 12px; font: 28px Georgia, serif; }
.side-sub { font-size: 12px; margin: 16px 0 22px; color: var(--muted); }
#side-filter { font-size: 13px; padding: 8px 10px; }
.side-nav-group { margin-top: 25px; }
.side-nav-group h2 { font-size: 11px; letter-spacing: 1.4px; color: var(--muted); margin: 0 10px 10px; }
.side-nav-link { display: block; padding: 10px 12px; margin: 3px 0; border-left: 2px solid transparent; border-radius: 7px; text-decoration: none; color: var(--text); }
.side-nav-link small { font-size: 10px; margin-top: 2px; }
.side-nav-link:hover, .side-nav-link.active { background: var(--accent-soft); color: var(--accent-ink); text-decoration: none; }
.side-nav-link.active { border-left-color: var(--accent); font-weight: 650; }
.side-foot { margin: 30px 12px 0; padding-top: 18px; border-top: 1px solid var(--border); font-size: 11px; color: var(--muted); line-height: 2; }
.content-wrap { margin-left: var(--side-w); padding: 55px clamp(24px, 4vw, 72px) 50px; min-width: 0; }
.content-wrap > * { max-width: 1280px; margin-left: auto; margin-right: auto; }
.content-wrap.reading > * { max-width: 850px; margin-left: auto; margin-right: auto; }
.page-hero { padding-bottom: 24px; border-bottom: 1px solid var(--border); margin-bottom: 28px; }
.eyebrow { font: 11px/1.7 var(--font-sans); letter-spacing: 2px; color: var(--accent-ink); margin: 0 0 14px; }
.page-hero h1 { margin: 12px 0; }
.lead { max-width: 720px; color: var(--muted); margin-bottom: 0; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); padding: 20px 0 28px; border-bottom: 1px solid var(--border); }
.stats > div { padding: 0 28px; border-right: 1px solid var(--border); }
.stats > div:first-child { padding-left: 0; }
.stats > div:last-child { border: 0; }
.stats strong { display: block; font: 44px/1.3 Georgia, serif; color: var(--accent-ink); }
.stats span { font-size: 12px; color: var(--muted); }
.status-line { font-size: 12px; margin: 20px auto 30px; line-height: 2.5; }
.cards-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.card { display: flex; flex-direction: column; border: 1px solid var(--border); border-radius: 12px; padding: 26px; color: var(--text); text-decoration: none; background: var(--surface); transition: border-color .16s, transform .16s; }
.card:hover { border-color: var(--accent); transform: translateY(-2px); text-decoration: none; }
.card h2 { font-size: 1.16em; margin: 0; }
.card p { font-size: .85em; color: var(--muted); flex: 1; }
.card .eyebrow { font-size: 10px; letter-spacing: 1px; }
.card-meta { color: var(--accent-ink); font-size: 12px; }
.filter-panel { padding: 18px 22px; background: var(--bg); border: 1px solid var(--border); border-radius: 12px; }
.filter-panel h2 { font: 600 12px var(--font-sans); color: var(--muted); margin: 0 0 12px; }
.filter-panel h2:not(:first-child) { margin-top: 20px; }
.pills { display: flex; gap: 8px; flex-wrap: wrap; font: 12px/1.6 var(--font-sans); }
.pills button { border-radius: 20px; padding: 7px 12px; text-align: left; }
button[aria-pressed="true"] { background: var(--accent-soft); border-color: var(--accent); color: var(--accent-ink); }
.filter-note { color: var(--muted); font-size: 11px; margin-bottom: 0; }
.filter-bar { display: flex; gap: 10px; margin-top: 24px; font-size: 14px; }
.filter-bar button { flex-shrink: 0; }
.result-count { color: var(--muted); font-size: 12px; min-height: 22px; margin: 12px auto; }
.empty-state { padding: 25px; border: 1px dashed var(--border); border-radius: 8px; color: var(--muted); }
.table-scroll { width: 100%; overflow-x: auto; border: 1px solid var(--border); border-radius: 10px; margin: 20px 0; }
table { width: 100%; border-collapse: collapse; font-size: .86em; text-align: left; line-height: 1.65; }
th { background: var(--bg); font-size: .88em; font-weight: 600; white-space: nowrap; }
th, td { padding: 14px 16px; border-bottom: 1px solid var(--border); vertical-align: top; }
tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: var(--accent-soft); }
.explorer-table { min-width: 880px; }
.explorer-table a { text-decoration: none; }
.explorer-table a:hover { text-decoration: underline; }
.explorer-table small { margin-top: 5px; }
.explorer-table td:first-child code { white-space: nowrap; overflow-wrap: normal; }
.papers-table .paper-title { min-width: 250px; width: 38%; font-weight: 550; }
.papers-table td:nth-child(4) { min-width: 125px; }
code { font-size: .88em; background: var(--bg); padding: 2px 5px; border-radius: 4px; overflow-wrap: anywhere; }
.badge { display: inline-block; border-radius: 5px; padding: 2px 7px; font: 11px/1.7 var(--font-sans); white-space: nowrap; background: var(--bg); color: var(--muted); }
.badge-pass { background: var(--pass-bg); color: var(--pass-ink); }
.badge-flagged { background: var(--warn-bg); color: var(--warn-ink); }
.badge-blocked { background: var(--bad-bg); color: var(--bad-ink); }
.topic-tag { display: inline-block; font-size: 10px; padding: 2px 6px; border: 1px solid var(--border); border-radius: 4px; color: var(--muted); margin: 0 4px 4px 0; }
.crumb { position: sticky; top: 0; z-index: 20; padding: 13px 0; background: var(--surface); border-bottom: 1px solid var(--border); font: 12px/1.6 var(--font-sans); display: flex; gap: 5px; margin-top: -38px; }
.crumb a { flex-shrink: 0; text-decoration: none; }
.crumb span { color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.paper-header { padding: 30px 0 10px; }
.paper-header h1 { font-size: 1.8em; }
.metadata { display: flex; flex-wrap: wrap; gap: 18px 28px; padding: 20px; border: 1px solid var(--border); background: var(--bg); border-radius: 10px; font-size: .8em; }
.metadata dt { color: var(--muted); font-size: .85em; }
.metadata dd { margin: 4px 0 0; }
.paper-header > .muted { font-size: .75em; }
.notice { padding: 16px 20px; background: var(--warn-bg); color: var(--warn-ink); border-radius: 8px; font-size: .85em; }
.toc { background: var(--bg); border: 1px solid var(--border); border-radius: 10px; padding: 15px 20px; margin: 24px 0; }
.toc summary { cursor: pointer; color: var(--accent-ink); font-size: .88em; font-weight: 600; }
.toc ol { padding-left: 1.5em; margin-bottom: 0; font-size: .82em; }
.toc a { color: var(--text); text-decoration: none; }
.toc a:hover { color: var(--accent-ink); text-decoration: underline; }
.toc ol ol { font-size: 1em; margin-top: 5px; }
.toc .toc-h3 { font-size: .94em; list-style-type: circle; }
.md-body { overflow-wrap: anywhere; }
.md-body h1 { font-size: 1.65em; margin: 30px 0 22px; }
.md-body h1 + h1 { font-size: 1.05em; color: var(--muted); }
.md-body h2 { margin: 44px 0 18px; border-left: 3px solid var(--accent); padding-left: 13px; }
.md-body h3 { margin-top: 28px; color: var(--accent-ink); }
.md-body li { margin: 6px 0; }
.md-body ul, .md-body ol { padding-left: 1.5em; }
.md-body blockquote { margin: 22px 0; background: var(--accent-soft); border-left: 3px solid var(--accent); padding: 14px 20px; border-radius: 0 8px 8px 0; font-size: .9em; }
.md-body blockquote p { margin: 5px 0; }
.md-body img { display: block; max-width: 100%; height: auto; margin: 26px auto; border: 1px solid var(--border); border-radius: 8px; background: white; cursor: zoom-in; }
.md-body pre { overflow: auto; padding: 16px; background: var(--bg); border-radius: 8px; }
.md-body hr { border: 0; border-top: 1px solid var(--border); margin: 32px 0; }
.verification { padding: 4px 22px 22px; margin-top: 45px; border: 1px solid var(--border); border-radius: 12px; background: var(--bg); font-size: .88em; }
.verification h2 { margin-top: 24px; }
.audit-card { padding: 14px 0; border-top: 1px solid var(--border); }
.audit-card summary { cursor: pointer; }
.audit-card summary h3 { display: inline; font-size: 1em; }
.trace-link { font-size: .8em; }
.prevnext { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 16px; border-top: 1px solid var(--border); padding-top: 24px; margin-top: 40px; font-size: .8em; }
.prevnext a { text-decoration: none; }
.prevnext span { color: var(--muted); }
.figure-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.figure-card { min-width: 0; border: 1px solid var(--border); border-radius: 12px; padding: 20px; content-visibility: auto; contain-intrinsic-size: auto 520px; }
.figure-card h2 { font-size: 14px; margin-top: 0; }
.figure-card img { width: 100%; height: 260px; object-fit: contain; background: #fff; border-radius: 6px; cursor: zoom-in; }
.figure-card p { font-size: 12px; color: var(--muted); overflow-wrap: anywhere; }
.claim-links { line-height: 2; }
footer { border-top: 1px solid var(--border); padding-top: 20px; margin-top: 48px; font: 11px/1.8 var(--font-sans); color: var(--muted); }
#pref-btn { position: fixed; left: 22px; bottom: 22px; z-index: 45; box-shadow: 0 4px 20px #0000000a; font: 16px var(--font-sans); padding: 12px 16px; }
#pref-btn span { font-size: 12px; margin-left: 8px; }
#pref-panel { position: fixed; left: 18px; bottom: 78px; z-index: 55; width: 310px; max-width: calc(100vw - 36px); background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 18px; box-shadow: 0 12px 50px #0003; font: 13px/1.6 var(--font-sans); }
.pref-heading { display: flex; justify-content: space-between; align-items: center; font-weight: 600; }
#pref-close { padding: 0 8px; font-size: 20px; border: 0; }
fieldset { border: 0; margin: 12px 0 0; padding: 0; }
legend { color: var(--muted); margin-bottom: 6px; font-size: 11px; }
fieldset button { padding: 6px 10px; margin: 2px 0; }
.mobile-bar { display: none; }
#lightbox { position: fixed; inset: 0; width: 100vw; max-width: 100vw; height: 100dvh; max-height: 100dvh; padding: 64px 24px 70px; margin: 0; border: 0; background: #0c0b10ee; color: white; }
#lightbox::backdrop { background: #0009; }
.lightbox-stage { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; overflow: auto; }
#lightbox-image { max-width: 100%; max-height: 100%; object-fit: contain; background: white; }
#lightbox.zoomed .lightbox-stage { display: block; }
#lightbox.zoomed img { max-width: none; max-height: none; }
#lightbox-close { position: absolute; right: 20px; top: 14px; font-size: 24px; background: #28252f; color: white; border-color: #5b546b; }
#lightbox-caption { position: absolute; left: 24px; bottom: 12px; font-size: 12px; max-width: 50%; }
#lightbox-zoom { position: absolute; right: 24px; bottom: 18px; font-size: 12px; background: #28252f; color: white; border-color: #5b546b; }
body.overlay-open { overflow: hidden; }
@media (min-width: 861px) { #nav-mask { display: none; } }
@media (max-width: 1100px) { :root { --side-w: 242px; } .content-wrap { padding-left: 28px; padding-right: 28px; } }
@media (max-width: 860px) {
  .mobile-bar { display: flex; position: sticky; top: 0; height: 56px; z-index: 30; align-items: center; justify-content: space-between; padding: 8px 16px; background: var(--surface); border-bottom: 1px solid var(--border); font: 13px var(--font-sans); }
  .mobile-bar a { text-decoration: none; color: var(--muted); }
  .sidebar { width: min(300px, 84vw); transform: translateX(-100%); visibility: hidden; transition: transform .2s, visibility .2s; }
  body.nav-open .sidebar { transform: translateX(0); visibility: visible; }
  #nav-mask { position: fixed; inset: 0; z-index: 35; border: 0; border-radius: 0; background: #11101d88; }
  .content-wrap { margin-left: 0; padding: 30px 20px 70px; }
  .crumb { top: 56px; margin-top: -30px; }
  #pref-btn { left: auto; right: 16px; bottom: 16px; padding: 10px 12px; }
  #pref-panel { left: auto; right: 16px; bottom: 68px; }
  .stats strong { font-size: 36px; }
}
@media (max-width: 540px) {
  h1 { font-size: 1.6em; }
  .paper-header h1 { font-size: 1.5em; }
  .cards-grid, .figure-grid { grid-template-columns: 1fr; }
  .card { padding: 22px; }
  .stats > div { padding: 0 12px; }
  .stats strong { font-size: 30px; }
  .stats span { font-size: 10px; }
  .filter-panel { padding: 16px; }
  .filter-bar { gap: 6px; font-size: 12px; }
  .filter-bar button { padding: 7px; }
  .metadata { gap: 12px 20px; }
  .verification { padding-left: 14px; padding-right: 14px; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } *, *::before, *::after { transition: none !important; } }
@media print {
  .sidebar, .mobile-bar, #pref-btn, #pref-panel, #nav-mask, .skip-link, #lightbox { display: none !important; }
  .content-wrap { margin: 0; padding: 0; } .crumb { position: static; } .table-scroll { overflow: visible; }
  .figure-card { content-visibility: visible; } body { background: white; color: black; }
}
