:root {
  --bg: #07131a;
  --panel: #0d2028;
  --panel-2: #102b32;
  --line: #2c4f4c;
  --muted: #9bbab5;
  --text: #eaf6ed;
  --accent: #70dec1;
  --gold: #f3c976;
  font-family: "Noto Sans SC", "PingFang SC", system-ui, sans-serif;
}
* { box-sizing: border-box; }
/* 细滚动条（#603）：侧栏、表格、页面都用暗色细条，不再是系统粗滚动条；滚轮、拖动和键盘照常 */
* { scrollbar-width: thin; scrollbar-color: var(--line) transparent; }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--line); border-radius: 4px; border: 2px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background-color: var(--muted); }
::-webkit-scrollbar-corner { background: transparent; }
html { scroll-behavior: smooth; scroll-padding-top: 80px; }
body { margin: 0; color: var(--text); background: var(--bg); line-height: 1.7; }
a { color: var(--accent); }
a:focus-visible, input:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.skip { position: absolute; left: -999px; top: 8px; background: var(--gold); color: var(--bg); padding: 6px 12px; z-index: 50; }
.skip:focus { left: 8px; }
code { font-family: ui-monospace, Menlo, monospace; font-size: .9em; background: #0004; padding: 1px 5px; border-radius: 4px; }

.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 24px; height: 64px; padding: 0 24px;
  border-bottom: 1px solid var(--line); background: #081a22f0; backdrop-filter: blur(14px); }
.brand { display: flex; gap: 10px; align-items: center; color: var(--text); text-decoration: none; min-width: 200px; }
.brand-mark { width: 30px; height: 30px; border-radius: 8px; object-fit: cover; }
.brand strong { display: block; font-size: 15px; letter-spacing: .06em; }
.brand small { display: block; color: var(--muted); font-size: 12px; }
.search { position: relative; flex: 1; max-width: 520px; }
.search input { width: 100%; padding: 8px 36px 8px 12px; color: var(--text); background: var(--panel); border: 1px solid var(--line); border-radius: 8px; font: inherit; }
.search kbd { position: absolute; right: 10px; top: 8px; color: var(--muted); font-size: 12px; }
.version { color: var(--muted); font-size: 12px; margin-left: auto; }

.layout { display: grid; grid-template-columns: 260px 1fr; }
.sidebar { position: sticky; top: 64px; height: calc(100vh - 64px); overflow-y: auto; padding: 16px 12px; border-right: 1px solid var(--line); }
.sidebar a { display: flex; gap: 6px; align-items: baseline; padding: 5px 10px; border-radius: 6px; color: var(--text); text-decoration: none; font-size: 14px; }
.sidebar a:hover { background: var(--panel); }
.sidebar a.active { background: var(--panel-2); color: var(--accent); }
.side-label { margin: 16px 10px 6px; color: var(--muted); font-size: 12px; letter-spacing: .1em; }
.count { margin-left: auto; color: var(--muted); font-size: 12px; }
.no { color: var(--gold); margin-right: 6px; font-variant-numeric: tabular-nums; }

main { padding: 28px 40px 80px; max-width: 1180px; outline: none; }
h1 { margin: 0 0 8px; font-size: 30px; }
h2 { font-size: 24px; margin: 0 0 14px; }
h3 { font-size: 18px; margin: 24px 0 8px; }
.lead { color: var(--muted); }
.section p, .section li { max-width: 78ch; }
.source { color: var(--muted); font-size: 12px; margin-top: 28px; }
.table { overflow-x: auto; margin: 12px 0; }
table { border-collapse: collapse; font-size: 14px; min-width: 100%; }
th, td { border: 1px solid var(--line); padding: 6px 10px; text-align: left; vertical-align: top; }
th { background: var(--panel-2); white-space: nowrap; }
td img { display: block; max-width: 120px; border-radius: 4px; }

.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; margin: 20px 0 28px; }
.tile { display: flex; flex-direction: column; padding: 16px; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; color: var(--text); text-decoration: none; }
.tile strong { font-size: 28px; color: var(--accent); }
.toc { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 6px; margin-top: 28px; }
.toc a, .hit { display: block; padding: 8px 12px; background: var(--panel); border-radius: 8px; color: var(--text); text-decoration: none; }
.hit small { display: block; color: var(--muted); }
.hits { display: grid; gap: 6px; margin-bottom: 20px; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.grid.model { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.card { margin: 0; padding: 14px 16px; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; }
.card header { display: flex; flex-wrap: wrap; gap: 8px; align-items: baseline; }
.card h3 { margin: 0; font-size: 17px; }
.card .sub { color: var(--gold); font-size: 13px; }
.card .tag { margin-left: auto; font-size: 12px; }
.card p { margin: 8px 0 0; }
.card dl { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; margin: 10px 0 0; font-size: 14px; }
.card dt { color: var(--muted); }
.card dd { margin: 0; }
.card.model { padding: 0; overflow: hidden; }
.card.model img, .card.model .noimg { width: 100%; aspect-ratio: 1; object-fit: cover; background: #0006; display: grid; place-items: center; }
.card.model figcaption { padding: 10px 12px; font-size: 13px; display: grid; gap: 4px; }
.card.model small { color: var(--muted); }

@media (max-width: 860px) {
  .layout { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; border-right: 0; border-bottom: 1px solid var(--line); }
  main { padding: 20px; }
  .version { display: none; }
}
.xref { font-size: 13px; color: var(--muted); }
/* 卡牌页（#513） */
.cardx { border-left: 4px solid var(--fc, var(--accent)); }
.cardx.gold { border-color: var(--gold); box-shadow: inset 0 0 0 1px var(--gold); }
.cardx:target, .cardx.focus { outline: 2px solid var(--gold); }
.matrix th small { display: block; color: var(--muted); font-weight: normal; }
.matrix tbody th { border-left: 4px solid var(--fc); }
.graph { width: 100%; max-width: 900px; margin: 8px 0 24px; }
.graph path { fill: none; stroke-width: 2; opacity: .7; }
.graph rect { fill: var(--panel); stroke-width: 2; }
.graph text { fill: var(--text); font-size: 14px; text-anchor: middle; }
.graph a:hover rect, .graph a:focus rect { fill: var(--panel-2); }
.grid.memory { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
/* 条目图（#518） */
.card > .shot { display: block; width: calc(100% + 32px); margin: -14px -16px 12px; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 10px 10px 0 0; background: #0006; }
.grid.stage { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
/* 特效页（#520） */
.grid.vfx { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.card.vfx img { aspect-ratio: 16 / 9; }
.card.vfx code { font-size: 11px; color: var(--muted); word-break: break-all; }
