*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --bg: #fbf7f0; --surface: #ffffff; --surface-2: #fbf6ee;
  --fg: #1c1813; --muted: #756b5d;
  --border: #ece1d2; --border-strong: #ddcfbb;
  --code-bg: #fdf9f2; --code-fg: #2a2419; --code-head: #f4ecdf;
  --accent: #e8590c; --accent-ink: #ffffff; --accent-soft: #fbe6d6;
  --accent-2: #3b4cca; --gpt: #0f9d76;
  --grid: rgba(120,80,30,.055);
  --glow: rgba(232,89,12,.16);
  --radius: 16px; --radius-sm: 9px;
  --shadow: 0 1px 2px rgba(60,40,20,.05), 0 14px 34px -16px rgba(120,70,20,.22);
  --font-display: "Bricolage Grotesque", "PingFang SC", "Microsoft YaHei", sans-serif;
  --font-body: "Hanken Grotesk", "PingFang SC", "Microsoft YaHei", -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SF Mono", "Cascadia Code", monospace;
  --font-pixel: "Silkscreen", var(--font-display);
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e0b08; --surface: #16120e; --surface-2: #1c1712;
    --fg: #ece4d8; --muted: #9d9285;
    --border: #2a2420; --border-strong: #3a322b;
    --code-bg: #110e0a; --code-fg: #e8dfd2; --code-head: #1d1813;
    --accent: #ff9e3d; --accent-ink: #1a1206; --accent-soft: #38280f;
    --accent-2: #8b97ff; --gpt: #2ed6a6;
    --grid: rgba(255,180,90,.05);
    --glow: rgba(255,158,61,.14);
    --shadow: 0 1px 2px rgba(0,0,0,.45), 0 22px 48px -20px rgba(0,0,0,.75);
  }
}

html { scroll-behavior: smooth; }
body {
  font-family: var(--font-body);
  background: var(--bg); color: var(--fg);
  line-height: 1.72; font-size: 15.5px;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
  background-image:
    radial-gradient(120% 80% at 100% -8%, var(--glow) 0%, transparent 46%),
    radial-gradient(90% 55% at -8% 2%, rgba(59,76,202,.07) 0%, transparent 42%);
  background-attachment: fixed;
  min-height: 100vh;
}
body::before {
  content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background-image: radial-gradient(var(--grid) 1px, transparent 1.1px);
  background-size: 22px 22px;
  -webkit-mask-image: linear-gradient(180deg, #000 0%, transparent 75%);
  mask-image: linear-gradient(180deg, #000 0%, transparent 75%);
}

.wrap { max-width: 1060px; margin: 0 auto; padding: 1.5rem 1.5rem 4rem; }
::selection { background: var(--accent); color: var(--accent-ink); }

a { color: var(--accent-2); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 2px; }
strong { font-weight: 700; }

/* ===== Top bar ===== */
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .25rem 0 2rem; }
.brand { display: inline-flex; align-items: center; gap: .65rem; text-decoration: none; color: var(--fg); }
.brand:hover { text-decoration: none; }
.brand img {
  width: 40px; height: 40px; image-rendering: pixelated;
  border: 2px solid var(--border-strong); border-radius: 10px; padding: 3px;
  background: var(--surface); box-shadow: var(--shadow);
}
.brand-name { font-family: var(--font-pixel); font-size: .72rem; line-height: 1.25; letter-spacing: .02em; }
.brand-name b { color: var(--accent); }
.brand-name .cn { display: block; font-family: var(--font-display); font-weight: 700; font-size: .82rem; letter-spacing: 0; margin-top: 1px; }

.nav-actions { display: flex; align-items: center; gap: .5rem; }
.nav-link {
  font-family: var(--font-display); font-weight: 600; font-size: .85rem; color: var(--muted);
  padding: .45rem .75rem; border-radius: 999px; transition: color .15s, background .15s;
}
.nav-link:hover { color: var(--fg); background: var(--surface-2); text-decoration: none; }

.lang-toggle {
  display: inline-flex; gap: 2px; padding: 3px;
  border: 1px solid var(--border-strong); border-radius: 999px; background: var(--surface);
}
.lang-toggle button {
  font-family: var(--font-pixel); background: none; border: none; cursor: pointer;
  padding: .32rem .65rem; font-size: .58rem; color: var(--muted); border-radius: 999px;
  transition: background .18s, color .18s;
}
.lang-toggle button.active { background: var(--accent); color: var(--accent-ink); }

/* ===== Buttons ===== */
.btn {
  font-family: var(--font-display); font-weight: 700; font-size: .92rem;
  padding: .68rem 1.3rem; border-radius: 999px; cursor: pointer;
  display: inline-flex; align-items: center; gap: .5rem;
  border: 1px solid var(--border-strong); background: var(--surface); color: var(--fg);
  box-shadow: var(--shadow); transition: transform .18s, background .18s, border-color .18s;
}
.btn:hover { transform: translateY(-2px); text-decoration: none; }
.btn svg { width: 17px; height: 17px; }
.btn-primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.btn-primary:hover { filter: brightness(1.05); }
.btn-sm { font-size: .82rem; padding: .42rem .95rem; }

/* ===== Hero ===== */
.hero { position: relative; padding: 1.5rem 0 1rem; }
.eyebrow {
  font-family: var(--font-pixel); font-size: .64rem; letter-spacing: .12em;
  color: var(--accent); display: inline-flex; align-items: center; gap: .55rem; margin-bottom: 1.2rem;
}
.eyebrow::before { content: ""; width: 26px; height: 2px; background: var(--accent); display: inline-block; }
.hero h1 {
  font-family: var(--font-display); font-weight: 800;
  font-size: clamp(2.3rem, 6.4vw, 3.8rem); line-height: 1.02; letter-spacing: -.025em;
  margin-bottom: 1.1rem; max-width: 16ch;
}
.hero h1 .hl {
  background: linear-gradient(100deg, var(--accent), #ff7a3d 55%, var(--accent-2));
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.lead { font-size: 1.12rem; color: var(--muted); max-width: 50ch; }
.chips { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: 1.6rem; }
.chip {
  font-family: var(--font-mono); font-size: .72rem; padding: .4rem .7rem;
  border: 1px solid var(--border-strong); border-radius: 999px; background: var(--surface);
  color: var(--fg); display: inline-flex; align-items: center; gap: .4rem; box-shadow: var(--shadow);
}
.chip.accent { border-color: var(--accent); color: var(--accent); }
.chip .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); }
.chip.gpt .dot { background: var(--gpt); }
.cta-row { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 1.9rem; }

/* ===== Section headings ===== */
h2 {
  font-family: var(--font-display); font-size: 1.55rem; font-weight: 700; letter-spacing: -.02em;
  margin: 3.2rem 0 1rem; display: flex; align-items: baseline; gap: .7rem;
}
h2 .num { font-family: var(--font-pixel); font-size: .8rem; color: var(--accent); transform: translateY(-2px); }
h3 { font-family: var(--font-display); font-size: 1.05rem; font-weight: 600; margin: 0 0 .4rem; }
.lead-sub { color: var(--muted); margin-bottom: 1.1rem; }
.muted { color: var(--muted); }
p code, li code, td code {
  background: var(--code-bg); padding: .12em .4em; border-radius: 5px;
  font-size: .85em; border: 1px solid var(--border); font-family: var(--font-mono);
}

/* ===== Cards / features ===== */
.feature-grid { display: grid; gap: 1rem; grid-template-columns: repeat(3, 1fr); margin: 1rem 0; }
.card {
  border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--surface); box-shadow: var(--shadow); padding: 1.5rem 1.5rem;
}
.feature .f-icon {
  width: 46px; height: 46px; border-radius: 13px; display: flex; align-items: center; justify-content: center;
  background: var(--accent-soft); color: var(--accent); margin-bottom: 1rem;
}
.feature .f-icon svg { width: 24px; height: 24px; }
.feature p { color: var(--muted); font-size: .92rem; margin: 0; }

/* ===== Badge ===== */
.badge {
  font-family: var(--font-mono); display: inline-block; background: var(--accent); color: var(--accent-ink);
  font-size: .64rem; padding: .12em .5em; border-radius: 5px; vertical-align: middle; margin-left: .3rem; font-weight: 600;
}
.badge-gpt { background: var(--gpt); color: #042; }

/* ===== Tabs ===== */
.tabs { margin-bottom: 1rem; }
.tab-bar {
  display: inline-flex; gap: 3px; padding: 4px; margin-bottom: 1rem;
  background: var(--surface-2); border: 1px solid var(--border); border-radius: 999px;
}
.tab {
  font-family: var(--font-display); font-weight: 600; font-size: .82rem; cursor: pointer;
  border: none; background: none; color: var(--muted);
  padding: .4rem 1.1rem; border-radius: 999px; transition: all .18s;
}
.tab:hover { color: var(--fg); }
.tab.active { background: var(--accent); color: var(--accent-ink); box-shadow: var(--shadow); }
.tab.gpt.active { background: var(--gpt); color: #042; }
.tab-panel { display: none; animation: fade .25s ease; }
.tab-panel.active { display: block; }
@keyframes fade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

/* ===== Table ===== */
.table-wrap { border: 1px solid var(--border-strong); border-radius: var(--radius-sm); overflow: hidden; margin-bottom: 1rem; box-shadow: var(--shadow); }
table { width: 100%; border-collapse: collapse; font-size: .88rem; }
th, td { text-align: left; padding: .62rem .9rem; }
thead th { background: var(--code-head); font-family: var(--font-mono); font-weight: 600; color: var(--muted); font-size: .68rem; text-transform: uppercase; letter-spacing: .05em; }
tbody tr { border-top: 1px solid var(--border); }
tbody tr:nth-child(even) { background: var(--surface-2); }
td.num-col { font-family: var(--font-mono); color: var(--muted); }

/* ===== Code blocks ===== */
pre {
  background: var(--code-bg); color: var(--code-fg);
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
  padding: 1rem 1.2rem; overflow-x: auto; font-size: .82rem; line-height: 1.65; font-family: var(--font-mono);
}
.code-block { border: 1px solid var(--border-strong); border-radius: var(--radius-sm); margin-bottom: 1rem; overflow: hidden; box-shadow: var(--shadow); }
.code-head { display: flex; align-items: center; justify-content: space-between; background: var(--code-head); border-bottom: 1px solid var(--border); padding: .4rem .55rem .4rem .9rem; }
.code-lang { font-family: var(--font-mono); font-size: .68rem; color: var(--muted); letter-spacing: .03em; }
.code-lang::before { content: "●  "; color: var(--accent); font-size: .7em; }
.copy-btn { font-family: var(--font-mono); font-size: .68rem; cursor: pointer; border: 1px solid var(--border-strong); background: var(--surface); color: var(--muted); padding: .28rem .6rem; border-radius: 6px; transition: all .15s; }
.copy-btn:hover { color: var(--accent); border-color: var(--accent); }
.copy-btn.copied { color: var(--gpt); border-color: var(--gpt); }
code { font-family: var(--font-mono); }

/* ===== Pills row (tools / providers) ===== */
.pill-row { display: flex; flex-wrap: wrap; gap: .6rem; margin: .4rem 0 1rem; }
.pill {
  display: inline-flex; align-items: center; gap: .6rem; padding: .5rem .9rem;
  border: 1px solid var(--border); border-radius: 12px; background: var(--surface); box-shadow: var(--shadow);
  font-size: .88rem; font-weight: 500;
}
.pill .ic {
  width: 26px; height: 26px; border-radius: 8px; display: flex; align-items: center; justify-content: center;
  font-family: var(--font-pixel); font-size: .6rem; color: #fff;
}
.pill small { color: var(--muted); font-family: var(--font-mono); font-size: .64rem; border: 1px solid var(--border); border-radius: 999px; padding: .05rem .4rem; }

/* ===== Callout ===== */
.callout {
  border: 1px solid var(--border); border-left: 3px solid var(--accent);
  background: var(--surface-2); border-radius: var(--radius-sm);
  padding: .9rem 1.1rem; margin: 1rem 0; font-size: .92rem;
}
.callout strong { color: var(--accent); }

footer { margin-top: 3.5rem; padding-top: 1.5rem; border-top: 1px solid var(--border); color: var(--muted); font-size: .82rem; display: flex; flex-wrap: wrap; align-items: center; gap: .6rem 1rem; }
footer img { width: 22px; height: 22px; image-rendering: pixelated; }
footer .sp { flex: 1; }

/* ===== Scroll reveal ===== */
.reveal { opacity: 0; transform: translateY(14px); transition: opacity .5s ease, transform .5s ease; }
.reveal.in { opacity: 1; transform: none; }

/* ===== Mobile ===== */
@media (max-width: 760px) {
  .feature-grid { grid-template-columns: 1fr; }
  .lead { max-width: none; }
  .brand-name { display: none; }
  .nav-link { padding: .45rem .55rem; }
}

/* ===== Bilingual ===== */
[data-lang="zh"] { display: none; }
.lang-zh [data-lang="en"] { display: none; }
.lang-zh [data-lang="zh"] { display: revert; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal, .tab-panel, [style*="animation"] { animation: none !important; transition: none !important; opacity: 1 !important; transform: none !important; }
}
/* ===== Extracted shared enhancements ===== */
:root {
  color-scheme: light dark;
  --claude: #d97706;
  --glm: #e8590c;
  --topbar-h: 64px;
  --topbar-bg: rgba(251,247,240,.82);
  --syn-key: #b45309;
  --syn-str: #0f766e;
  --syn-num: #c2410c;
  --syn-bool: #7c3aed;
  --syn-comment: #8a8074;
  --syn-punct: #756b5d;
}
[data-theme="light"] {
  color-scheme: light;
  --bg: #fbf7f0; --surface: #ffffff; --surface-2: #fbf6ee;
  --fg: #1c1813; --muted: #5c5348;
  --border: #ece1d2; --border-strong: #ddcfbb;
  --code-bg: #fdf9f2; --code-fg: #2a2419; --code-head: #f4ecdf;
  --accent: #e8590c; --accent-ink: #ffffff; --accent-soft: #fbe6d6;
  --accent-2: #3b4cca; --gpt: #0f9d76; --claude: #d97706; --glm: #e8590c;
  --grid: rgba(120,80,30,.055); --glow: rgba(232,89,12,.16);
  --topbar-bg: rgba(251,247,240,.82);
}
[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0e0b08; --surface: #16120e; --surface-2: #1c1712;
  --fg: #ece4d8; --muted: #a89e90;
  --border: #2a2420; --border-strong: #3a322b;
  --code-bg: #110e0a; --code-fg: #e8dfd2; --code-head: #1d1813;
  --accent: #ff9e3d; --accent-ink: #1a1206; --accent-soft: #38280f;
  --accent-2: #8b97ff; --gpt: #2ed6a6; --claude: #fbbf24; --glm: #ff9e3d;
  --grid: rgba(255,180,90,.05); --glow: rgba(255,158,61,.14);
  --topbar-bg: rgba(14,11,8,.84);
  --shadow: 0 1px 2px rgba(0,0,0,.45), 0 22px 48px -20px rgba(0,0,0,.75);
  --syn-key: #fbbf24; --syn-str: #5eead4; --syn-num: #fdba74;
  --syn-bool: #c4b5fd; --syn-comment: #7a7168; --syn-punct: #9d9285;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --muted: #a89e90; --claude: #fbbf24; --glm: #ff9e3d;
    --topbar-bg: rgba(14,11,8,.84);
    --syn-key: #fbbf24; --syn-str: #5eead4; --syn-num: #fdba74;
    --syn-bool: #c4b5fd; --syn-comment: #7a7168; --syn-punct: #9d9285;
  }
}

/* Sticky topbar: the outer layer owns viewport width; the inner layer owns content width. */
.wrap { max-width: 1060px; margin: 0 auto; padding: 0 1.5rem 4rem; }
.topbar-wrap {
  position: sticky;
  top: 0;
  z-index: 50;
  width: 100%;
  margin: 0 0 .25rem;
  padding: 0;
  background: var(--topbar-bg);
  -webkit-backdrop-filter: blur(12px) saturate(1.2);
  backdrop-filter: blur(12px) saturate(1.2);
  border-bottom: 1px solid transparent;
  transition: border-color .2s, box-shadow .2s;
}
.topbar-wrap.scrolled {
  border-bottom-color: var(--border);
  box-shadow: 0 8px 24px -18px rgba(60,40,20,.35);
}
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  width: 100%;
  min-height: var(--topbar-h);
  max-width: var(--content-max, 1060px);
  margin: 0 auto;
  padding: .5rem 1.5rem;
}
.page-docs { --content-max: 980px; }
.page-home { --content-max: 1060px; }
.nav-actions { display: flex; align-items: center; justify-content: flex-end; gap: .4rem; flex-wrap: nowrap; }
.skip-link {
  position: absolute; left: 1rem; top: -100px; z-index: 1000;
  padding: .55rem 1rem; border-radius: 999px;
  background: var(--accent); color: var(--accent-ink);
  font-family: var(--font-display); font-weight: 700; font-size: .85rem;
}
.skip-link:focus { top: 1rem; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.icon-btn {
  width: 36px; height: 36px; flex: 0 0 auto; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--border-strong); background: var(--surface); color: var(--muted);
  display: inline-flex; align-items: center; justify-content: center;
}
.icon-btn:hover { color: var(--accent); border-color: var(--accent); }
.icon-btn svg { width: 16px; height: 16px; }
.icon-btn .icon-sun { display: none; }
.icon-btn .icon-moon { display: block; }
[data-theme="dark"] .icon-btn .icon-moon { display: none; }
[data-theme="dark"] .icon-btn .icon-sun { display: block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .icon-btn .icon-moon { display: none; }
  :root:not([data-theme="light"]) .icon-btn .icon-sun { display: block; }
}

/* Home hero terminal */
.hero-grid { display: grid; grid-template-columns: minmax(0,1.15fr) minmax(300px,.85fr); gap: 3.5rem; align-items: center; }
.hero-visual { position: relative; }
.term {
  overflow: hidden; transform: rotate(.4deg);
  border: 1px solid var(--border-strong); border-radius: 14px;
  background: var(--surface); box-shadow: 0 2px 4px rgba(60,40,20,.06), 0 18px 40px -14px rgba(120,70,20,.28);
}
.term-bar {
  display: flex; align-items: center; gap: .4rem;
  padding: .55rem .85rem; background: var(--code-head); border-bottom: 1px solid var(--border);
}
.term-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--border-strong); }
.term-dot.r { background: #ff5f57; }
.term-dot.y { background: #febc2e; }
.term-dot.g { background: #28c840; }
.term-title { margin-left: .4rem; font-family: var(--font-mono); font-size: .68rem; color: var(--muted); }
.term-body { padding: .9rem 1rem 1.05rem; font-family: var(--font-mono); font-size: .74rem; line-height: 1.65; color: var(--code-fg); background: var(--code-bg); }
.term-body .prompt { color: var(--accent); }
.term-body .ok { color: var(--gpt); }
.term-body .dim { color: var(--muted); }
.term-body .route { display: flex; align-items: center; gap: .45rem; margin: .35rem 0; padding: .35rem .55rem; border-radius: 7px; background: var(--surface-2); border: 1px solid var(--border); }
.term-body .route .tag { font-size: .6rem; padding: .08em .4em; border-radius: 4px; font-weight: 600; }
.tag-gpt { background: rgba(15,157,118,.15); color: var(--gpt); }
.tag-glm { background: var(--accent-soft); color: var(--accent); }
.tag-claude { background: rgba(217,119,6,.14); color: var(--claude); }
.hero-mascot {
  position: absolute; right: -10px; bottom: -14px; width: 52px; height: 52px;
  image-rendering: pixelated; border: 2px solid var(--border-strong); border-radius: 12px;
  padding: 4px; background: var(--surface); box-shadow: var(--shadow);
  animation: cat-bob 2.8s ease-in-out infinite;
}
@keyframes cat-bob { 50% { transform: translateY(-5px); } }

/* Shared interaction affordances */
button.chip, .chip.copyable {
  cursor: pointer; user-select: none; appearance: none;
  border: 1px solid var(--border-strong); background: var(--surface);
  font-family: var(--font-mono); font-size: .72rem; color: inherit; line-height: inherit;
}
.chip.copyable:hover { border-color: var(--accent); color: var(--accent); transform: translateY(-1px); }
.chip.copyable.copied { border-color: var(--gpt); color: var(--gpt); }
.chip .copy-hint { font-size: .6rem; opacity: .7; margin-left: .15rem; }
.badge-claude { background: var(--claude); color: #1a1000; }
.tab.claude.active { background: var(--claude); color: #1a1000; }
.feature .f-icon { color: var(--accent); background: var(--accent-soft); }
.card.feature { transition: transform .2s, box-shadow .2s, border-color .2s; }
.card.feature:hover { transform: translateY(-3px); border-color: var(--border-strong); }
.card-recommend { border-color: var(--accent); border-width: 2px; margin-bottom: 1.5rem; }

/* Enhanced tables */
.table-wrap { overflow: auto; -webkit-overflow-scrolling: touch; position: relative; }
table { min-width: 420px; }
th, td { white-space: nowrap; }
td.num-col, th.num-col { text-align: right; font-variant-numeric: tabular-nums; }
table.sticky-col th:first-child,
table.sticky-col td:first-child { position: sticky; left: 0; z-index: 2; background: var(--surface); }
table.sticky-col thead th:first-child { z-index: 3; background: var(--code-head); }
table.sticky-col tbody tr:nth-child(even) td:first-child { background: var(--surface-2); }
tr.row-gpt td:first-child::before,
tr.row-glm td:first-child::before,
tr.row-claude td:first-child::before {
  content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%;
  margin-right: .45rem; vertical-align: middle;
}
tr.row-gpt td:first-child::before { background: var(--gpt); }
tr.row-glm td:first-child::before { background: var(--glm); }
tr.row-claude td:first-child::before { background: var(--claude); }

/* Docs-only layout and components */
.container {
  display: grid; grid-template-columns: minmax(0,1fr) 210px; gap: 3rem;
  max-width: 980px; margin: 0 auto; padding: 0 1.5rem 5rem;
}
.container main { min-width: 0; }
.config-file {
  font-family: var(--font-mono); font-size: .78rem; color: var(--muted);
  display: inline-flex; align-items: center; gap: .45rem; margin-bottom: 1.1rem;
}
.config-file::before { content: "›"; color: var(--accent); font-weight: 700; }
.config-file code { background: var(--code-bg); padding: .15em .45em; border-radius: 5px; border: 1px solid var(--border); }
.callout.warn { border-left-color: #f59e0b; background: rgba(245,158,11,.08); }
.callout.warn strong { color: #f59e0b; }
.side-nav {
  position: sticky; top: calc(var(--topbar-h) + .75rem); align-self: start;
  max-height: calc(100vh - var(--topbar-h) - 1.5rem); overflow-y: auto;
}
.side-nav .nav-title { font-family: var(--font-pixel); font-size: .62rem; color: var(--muted); letter-spacing: .08em; margin-bottom: .8rem; padding-left: .65rem; }
.side-nav ul { list-style: none; padding: 0; margin: 0; border-left: 1px solid var(--border); }
.side-nav li { margin: 0; }
.side-nav a { display: block; padding: .32rem .85rem; text-decoration: none; font-size: .82rem; color: var(--muted); margin-left: -1px; border-left: 2px solid transparent; }
.side-nav a:hover { color: var(--fg); text-decoration: none; }
.side-nav a.active { color: var(--accent); border-left-color: var(--accent); font-weight: 600; }
.card { margin-bottom: 1rem; }
p { margin-bottom: .85rem; }
ul { padding-left: 1.2rem; margin-bottom: 1rem; }
li { margin-bottom: .45rem; }
li::marker { color: var(--accent); }
hr { border: none; border-top: 1px solid var(--border); margin: 2rem 0; }

/* Syntax highlight tokens */
.tok-key { color: var(--syn-key); }
.tok-str { color: var(--syn-str); }
.tok-num { color: var(--syn-num); }
.tok-bool { color: var(--syn-bool); }
.tok-comment { color: var(--syn-comment); font-style: italic; }
.tok-punct { color: var(--syn-punct); }

@media (max-width: 860px) {
  .container { grid-template-columns: 1fr; gap: 0; padding: 0 1.1rem 4rem; }
  .side-nav { position: static; max-height: none; order: -1; margin-bottom: 1.25rem; padding-bottom: 1rem; border-bottom: 1px solid var(--border); }
  .side-nav .nav-title { display: none; }
  .side-nav ul { display: flex; flex-wrap: wrap; gap: .25rem; border-left: none; }
  .side-nav a { border-left: none; border: 1px solid var(--border); border-radius: 999px; padding: .3rem .7rem; font-size: .76rem; margin: 0; }
  .side-nav a.active { border-color: var(--accent); }
  .hero-grid { grid-template-columns: 1fr; }
  .hero-visual { max-width: 420px; }
}

@media (max-width: 760px) {
  .wrap { padding: 0 1.1rem 3.5rem; }
  .topbar { padding-left: 1.1rem; padding-right: 1.1rem; }
  .brand-name { display: none; }
  .hero h1 { max-width: none; }
}

/* At phone widths, keep the topbar one line by retaining only primary actions. */
@media (max-width: 620px) {
  .page-home .topbar { gap: .45rem; }
  .page-home .nav-actions { gap: .3rem; }
  .page-home .nav-actions .nav-link { display: none; }
  .page-home .btn-sm { white-space: nowrap; padding: .42rem .8rem; }
  .topbar-wrap { width: 100%; margin-left: 0; margin-right: 0; }
  .table-cards { border: none; box-shadow: none; overflow: visible; }
  .table-cards table, .table-cards thead, .table-cards tbody,
  .table-cards th, .table-cards td, .table-cards tr { display: block; min-width: 0; white-space: normal; }
  .table-cards thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }
  .table-cards tr { border: 1px solid var(--border-strong); border-radius: var(--radius-sm); margin-bottom: .65rem; padding: .55rem .75rem .35rem; background: var(--surface); box-shadow: var(--shadow); }
  .table-cards td { display: flex; justify-content: space-between; gap: 1rem; align-items: baseline; padding: .35rem 0; border: none; text-align: right; }
  .table-cards td::before { content: attr(data-label); font-family: var(--font-mono); font-size: .64rem; color: var(--muted); text-transform: uppercase; text-align: left; flex-shrink: 0; }
  .table-cards td:first-child { position: static; box-shadow: none; background: transparent !important; font-weight: 600; padding-bottom: .5rem; margin-bottom: .25rem; border-bottom: 1px solid var(--border); justify-content: flex-start; text-align: left; }
  .table-cards td:first-child::before { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .hero-mascot { animation: none !important; }
}
