/* base.css — design tokens, reset, page layout, typography */
:root {
  --bg: #0f1220; --panel: #171b2e; --panel2: #1e2340; --text: #e6e8f2; --muted: #9aa1bd;
  --accent: #7c9cff; --accent2: #5eead4; --warn: #fbbf24; --bad: #f87171; --good: #4ade80;
  --border: #2a3050; --code: #0a0d1a; --radius: 12px;
  --tok-kw: #c792ea; --tok-str: #a5e075; --tok-num: #f78c6c; --tok-com: #6b7399; --tok-fn: #82aaff;
}
:root[data-theme=light] {
  --bg: #f6f7fb; --panel: #fff; --panel2: #eef1fb; --text: #1b1f33; --muted: #5d6482;
  --accent: #3b5bdb; --accent2: #0f9d8a; --warn: #b7791f; --bad: #c53030; --good: #2f855a;
  --border: #d9ddee; --code: #f0f2fa;
  --tok-kw: #8e24aa; --tok-str: #2e7d32; --tok-num: #d84315; --tok-com: #8a90ad; --tok-fn: #1565c0;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.65 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
a { color: var(--accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

header.top { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 14px; padding: 10px 20px; background: var(--panel); border-bottom: 1px solid var(--border); }
header.top .brand { font-weight: 700; font-size: 18px; }
header.top .spacer { flex: 1; }
header.top a.home { text-decoration: none; color: var(--muted); font-size: 14px; }
header.top a.home:hover { color: var(--accent); }

.layout { display: grid; grid-template-columns: 310px 1fr; min-height: calc(100vh - 53px); }
aside.sidebar { border-right: 1px solid var(--border); padding: 16px; background: var(--panel); position: sticky; top: 53px; height: calc(100vh - 53px); overflow: auto; }
main.content { padding: 32px clamp(18px, 4vw, 56px) 80px; max-width: 980px; width: 100%; }

main h1 { margin: .1em 0 .2em; font-size: 2rem; line-height: 1.25; }
main h2 { margin-top: 1.9em; font-size: 1.3rem; border-bottom: 1px solid var(--border); padding-bottom: 6px; }
main h3 { margin-top: 1.5em; font-size: 1.1rem; color: var(--accent2); }
.kicker { color: var(--accent); font-size: 13px; text-transform: uppercase; letter-spacing: .08em; font-weight: 600; }
.meta { color: var(--muted); font-size: 14px; display: flex; gap: 16px; flex-wrap: wrap; }
code { background: var(--code); padding: 2px 6px; border-radius: 5px; font: .9em ui-monospace, Consolas, "Cascadia Mono", monospace; }
table { border-collapse: collapse; margin: 14px 0; width: 100%; font-size: 15px; display: block; overflow-x: auto; }
th, td { border: 1px solid var(--border); padding: 7px 11px; text-align: left; }
th { background: var(--panel2); }
img, canvas, svg { max-width: 100%; }

.hero { max-width: 1000px; margin: 0 auto; padding: 56px 20px; }
.hero h1 { font-size: 2.6rem; margin: 0; }
.hero p.lead { color: var(--muted); font-size: 1.15rem; max-width: 680px; }

.menu-btn { display: none; }
@media (max-width: 860px) {
  .layout { grid-template-columns: 1fr; }
  aside.sidebar { position: fixed; left: 0; top: 53px; width: 310px; z-index: 40; transform: translateX(-100%); transition: .2s; box-shadow: 0 0 30px #0008; }
  aside.sidebar.open { transform: none; }
  .menu-btn { display: inline-block; }
}
@media print {
  header.top, aside.sidebar, .pager, .no-print { display: none !important; }
  .layout { display: block; } body { background: #fff; color: #000; }
}
