:root {
  --bg: #fbfaf7; --fg: #1d1d1f; --muted: #6b6b70; --line: #e4e1da; --accent: #b3541e;
  --code-bg: #f1eee8; --side: #f5f3ee;
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #141417; --fg: #e9e7e2; --muted: #9a9aa2; --line: #2c2c32; --accent: #f0a45d; --code-bg: #1f1f24; --side: #19191d; }
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--fg); line-height: 1.6; }
header { display: flex; justify-content: space-between; align-items: center; padding: 0.7rem 1.2rem; border-bottom: 1px solid var(--line); }
header a { color: var(--fg); text-decoration: none; }
.brand { font-weight: 700; letter-spacing: 0.04em; }
.page { display: grid; grid-template-columns: 15rem minmax(0, 1fr) 13rem; gap: 2rem; max-width: 84rem; margin: 0 auto; padding: 0 1.2rem; }
.menu, .toc { position: sticky; top: 0; align-self: start; max-height: 100vh; overflow-y: auto; padding: 1rem 0; font-size: 0.9rem; }
.menu h3, .toc h3 { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); margin: 1rem 0 0.3rem; }
.menu ul, .toc ul { list-style: none; margin: 0; padding: 0; }
.menu a, .toc a { display: block; padding: 0.15rem 0; color: var(--fg); text-decoration: none; }
.menu a.current { color: var(--accent); font-weight: 600; }
main { padding: 1rem 0 4rem; min-width: 0; }
main a { color: var(--accent); }
h1 { font-size: 2rem; line-height: 1.2; margin-top: 0.8rem; }
h2 { margin-top: 2.2rem; padding-top: 0.4rem; border-top: 1px solid var(--line); }
code { font-family: ui-monospace, "Cascadia Code", Consolas, monospace; font-size: 0.88em; background: var(--code-bg); padding: 0.08em 0.3em; border-radius: 3px; }
pre { background: var(--code-bg); padding: 0.8rem 1rem; overflow-x: auto; border-radius: 6px; }
pre code { background: none; padding: 0; }
.table { overflow-x: auto; }
table { border-collapse: collapse; margin: 1rem 0; font-size: 0.92rem; }
th, td { border: 1px solid var(--line); padding: 0.35rem 0.6rem; text-align: left; vertical-align: top; }
th { background: var(--side); }
@media (max-width: 70rem) { .page { grid-template-columns: 13rem minmax(0, 1fr); } .toc { display: none; } }
@media (max-width: 48rem) {
  .page { display: block; padding: 0 1rem; }
  .menu { position: static; max-height: none; border-bottom: 1px solid var(--line); }
  .menu ul { display: flex; flex-wrap: wrap; gap: 0 1rem; }
}
.tabs { display: flex; gap: 1.2rem; }
.tabs a { color: var(--muted); }
.tabs a.on { color: var(--fg); font-weight: 600; }
.menu p { margin: 1rem 0 0.3rem; }
.menu p strong { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); }
.menu p:first-child strong { font-size: 0.9rem; text-transform: none; letter-spacing: 0; }
.menu p a { color: inherit; }
blockquote { margin: 1rem 0; padding: 0.2rem 1rem; border-left: 3px solid var(--accent); background: var(--side); }
img { max-width: 100%; height: auto; image-rendering: pixelated; }
main footer { margin-top: 3rem; padding-top: 0.6rem; border-top: 1px solid var(--line); color: var(--muted); font-size: 0.85rem; }
