:root {
  color-scheme: light;
  --bg: #fcfcfb;
  --surface: #ffffff;
  --surface-2: #f3f2ef;
  --border: #e3e1dc;
  --text: #0b0b0b;
  --text-2: #52514e;
  --muted: #8a8882;
  --accent: #2a78d6;
  --p-anthropic: #eb6834;
  --p-openai: #1baf7a;
  --p-gemini: #2a78d6;
  --p-glm: #6250d6;
  --p-kimi: #e87ba4;
  --p-qwen: #eda100;
  --seq-0: #f3f2ef;
  --seq-1: #b7d3f6;
  --seq-2: #5598e7;
  --seq-3: #184f95;
  --good: #008300;
  --warn: #c98500;
  --bad: #e34948;
  --mono: ui-monospace, SFMono-Regular, Menlo, monospace;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --serif: "Source Serif 4", Georgia, serif;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #141413; --surface: #1a1a19; --surface-2: #232321; --border: #33322f;
    --text: #f0efec; --text-2: #c3c2b7; --muted: #8f8d86; --accent: #3987e5;
    --p-anthropic: #d95926; --p-openai: #199e70; --p-gemini: #3987e5;
    --p-glm: #9085e9; --p-kimi: #d55181; --p-qwen: #c98500;
    --seq-0: #232321; --seq-1: #184f95; --seq-2: #2a78d6; --seq-3: #86b6ef;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #141413; --surface: #1a1a19; --surface-2: #232321; --border: #33322f;
  --text: #f0efec; --text-2: #c3c2b7; --muted: #8f8d86; --accent: #3987e5;
  --p-anthropic: #d95926; --p-openai: #199e70; --p-gemini: #3987e5;
  --p-glm: #9085e9; --p-kimi: #d55181; --p-qwen: #c98500;
  --seq-0: #232321; --seq-1: #184f95; --seq-2: #2a78d6; --seq-3: #86b6ef;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.55 var(--sans); }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
.wrap { max-width: 1180px; margin: 0 auto; padding: 0 16px; }

header.top { border-bottom: 1px solid var(--border); background: var(--surface); position: sticky; top: 0; z-index: 10; }
header.top .wrap { display: flex; align-items: center; gap: 24px; height: 56px; }
.brand { font-weight: 700; color: var(--text); letter-spacing: -0.01em; white-space: nowrap; }
.brand span { color: var(--muted); font-weight: 500; }
nav.main { display: flex; gap: 18px; overflow-x: auto; }
nav.main a { color: var(--text-2); font-size: 14px; white-space: nowrap; }
nav.main a.on { color: var(--text); font-weight: 600; }
.theme-btn { margin-left: auto; background: none; border: 1px solid var(--border); color: var(--text-2); border-radius: 6px; padding: 4px 10px; cursor: pointer; font-size: 13px; }

h1 { font: 600 34px/1.15 var(--serif); letter-spacing: -0.01em; margin: 36px 0 10px; }
h2 { font: 600 22px/1.25 var(--serif); margin: 40px 0 12px; }
h3 { font-size: 16px; margin: 24px 0 8px; }
.lede { color: var(--text-2); font-size: 17px; max-width: 760px; margin: 0 0 24px; }
.small { font-size: 13px; color: var(--text-2); }
.muted { color: var(--muted); }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin: 24px 0; }
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 14px 16px; }
.stat b { display: block; font: 600 28px/1.1 var(--serif); }
.stat span { color: var(--text-2); font-size: 13px; }

.panel { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 16px; }
.filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 16px 0; }
.chip { border: 1px solid var(--border); background: var(--surface); color: var(--text-2); border-radius: 999px; padding: 4px 12px; font-size: 13px; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
.chip.on { border-color: var(--text-2); color: var(--text); font-weight: 600; }
.dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; flex: none; }
input.search { border: 1px solid var(--border); background: var(--surface); color: var(--text); border-radius: 8px; padding: 6px 10px; font-size: 14px; min-width: 200px; flex: 1; max-width: 320px; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 14px 16px; display: flex; flex-direction: column; gap: 6px; color: var(--text); border-left-width: 4px; }
.card:hover { text-decoration: none; border-color: var(--text-2); }
.card .model { font-weight: 600; font-size: 16px; }
.card .meta { font-size: 12.5px; color: var(--text-2); display: flex; gap: 8px; flex-wrap: wrap; }
.tag { font-size: 11.5px; padding: 1px 7px; border-radius: 4px; background: var(--surface-2); color: var(--text-2); white-space: nowrap; }
.tag.ow { background: transparent; border: 1px solid var(--border); }

table { border-collapse: collapse; width: 100%; font-size: 13.5px; }
th, td { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--border); vertical-align: top; }
th { font-weight: 600; color: var(--text-2); font-size: 12.5px; background: var(--surface); position: sticky; top: 0; }
.scroll { overflow-x: auto; max-width: 100%; }
td.num { font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }

/* heatmap */
.heat { width: auto; border-collapse: separate; border-spacing: 2px; font-size: 12px; }
.heat th, .heat td { border: none; padding: 0; }
.heat th.rowh { text-align: right; padding-right: 8px; white-space: nowrap; font-weight: 500; color: var(--text); position: sticky; left: 0; background: var(--bg); z-index: 1; }
.heat th.colh { writing-mode: vertical-rl; transform: rotate(180deg); height: 150px; padding: 4px 0; font-weight: 500; white-space: nowrap; background: var(--bg); text-align: left; }
.heat td.c { width: 20px; min-width: 20px; height: 20px; border-radius: 3px; cursor: pointer; }
.heat td.c.d0 { background: var(--seq-0); }
.heat td.c.d1 { background: var(--seq-1); }
.heat td.c.d2 { background: var(--seq-2); }
.heat td.c.d3 { background: var(--seq-3); }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12.5px; color: var(--text-2); margin: 8px 0; align-items: center; }
.legend i { width: 14px; height: 14px; border-radius: 3px; display: inline-block; vertical-align: -2px; margin-right: 5px; }

.tip { position: fixed; pointer-events: none; background: var(--surface); color: var(--text); border: 1px solid var(--border); border-radius: 8px; padding: 8px 10px; font-size: 12.5px; max-width: 340px; box-shadow: 0 4px 16px rgba(0,0,0,.12); z-index: 50; display: none; }
.tip b { display: block; margin-bottom: 2px; }

/* card page */
.doc-head { display: flex; flex-wrap: wrap; gap: 12px 24px; align-items: baseline; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin: 20px 0 0; overflow-x: auto; }
.tabs button { background: none; border: none; border-bottom: 2px solid transparent; padding: 8px 14px; color: var(--text-2); cursor: pointer; font-size: 14px; white-space: nowrap; }
.tabs button.on { color: var(--text); border-bottom-color: var(--accent); font-weight: 600; }
.tabpane { display: none; padding: 20px 0; }
.tabpane.on { display: block; }
.md { font: 16px/1.65 var(--serif); max-width: 820px; overflow-wrap: anywhere; }
.md table { font: 13px/1.4 var(--sans); display: block; overflow-x: auto; }
.md img { max-width: 100%; }
.md pre { overflow-x: auto; background: var(--surface-2); padding: 10px; border-radius: 6px; font-size: 13px; }
.md code { font-family: var(--mono); font-size: 0.88em; }
.pagemark { display: block; font: 600 11px var(--sans); color: var(--muted); border-top: 1px dashed var(--border); margin: 28px 0 10px; padding-top: 4px; letter-spacing: .05em; }
.pagemark:target, .pagemark.hl { color: var(--accent); border-top-color: var(--accent); }
iframe.pdf { width: 100%; height: 80vh; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); }
.btn { display: inline-block; border: 1px solid var(--border); background: var(--surface); color: var(--text); padding: 6px 12px; border-radius: 6px; font-size: 13.5px; }
.btn:hover { text-decoration: none; border-color: var(--text-2); }

/* safety page */
.prose { max-width: 800px; font: 16.5px/1.7 var(--serif); }
.prose p, .prose li { margin: 0 0 12px; }
blockquote.q { margin: 10px 0 14px; padding: 8px 14px; border-left: 3px solid var(--border); color: var(--text-2); font: 14.5px/1.55 var(--serif); font-style: italic; }
blockquote.q cite { display: block; font: normal 12.5px var(--sans); margin-top: 4px; }
.gap { border: 1px solid var(--border); border-left: 4px solid var(--warn); border-radius: 8px; padding: 14px 16px; margin: 12px 0; background: var(--surface); }
.gap h3 { margin: 0 0 6px; font-family: var(--sans); }
.sev { font: 600 11px var(--sans); text-transform: uppercase; letter-spacing: .06em; color: var(--text-2); }
.toc { font-size: 14px; columns: 2 240px; padding-left: 18px; }

footer { border-top: 1px solid var(--border); margin-top: 60px; padding: 20px 0 40px; color: var(--muted); font-size: 13px; }

@media (max-width: 640px) {
  h1 { font-size: 27px; }
  header.top .wrap { gap: 14px; }
  .brand span { display: none; }
}
