:root {
  --bg: #ffffff;
  --surface: #f5f6f8;
  --text: #16181d;
  --muted: #5d6470;
  --border: #e3e6eb;
  --accent: #0a66d8;
  --code-bg: #eef1f5;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1115;
    --surface: #171a21;
    --text: #e8eaee;
    --muted: #9aa2ae;
    --border: #262b34;
    --accent: #5aa2ff;
    --code-bg: #1d2129;
  }
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-padding-top: 16px; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.65 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

header.site, main, footer.site {
  max-width: 760px;
  margin: 0 auto;
  padding-left: 16px;
  padding-right: 16px;
}

header.site {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-top: 20px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border);
}

.brand { color: var(--text); font-weight: 700; font-size: 18px; }
.brand:hover { text-decoration: none; }

header.site nav { display: flex; gap: 20px; font-size: 15px; }
header.site nav a { color: var(--muted); }
header.site nav a[aria-current="page"] { color: var(--text); font-weight: 600; }

main { padding-top: 32px; padding-bottom: 48px; }

h1 { font-size: 32px; line-height: 1.2; margin: 0 0 6px; letter-spacing: -0.01em; }
h2 { font-size: 21px; line-height: 1.3; margin: 40px 0 10px; }
h3 { font-size: 17px; line-height: 1.35; margin: 28px 0 8px; }
p, ul { margin: 0 0 14px; }
ul { padding-left: 22px; }
li { margin-bottom: 6px; }

.meta { color: var(--muted); font-size: 15px; margin-bottom: 24px; }

code {
  font: 0.9em ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  background: var(--code-bg);
  padding: 1px 5px;
  border-radius: 4px;
  overflow-wrap: anywhere;
}

.toc {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 18px;
  margin: 0 0 8px;
}
.toc-title { font-weight: 600; margin: 0 0 6px; }
.toc ol { margin: 0; padding-left: 22px; columns: 2; column-gap: 32px; font-size: 15px; }
.toc li { margin-bottom: 4px; break-inside: avoid; }

.table { overflow-x: auto; margin: 0 0 16px; }
table { width: 100%; border-collapse: collapse; font-size: 15px; }
th, td { text-align: left; vertical-align: top; padding: 9px 10px; border-bottom: 1px solid var(--border); }
th { background: var(--surface); font-weight: 600; }

footer.site {
  border-top: 1px solid var(--border);
  padding-top: 20px;
  padding-bottom: 32px;
  color: var(--muted);
  font-size: 14px;
}
footer.site p { margin: 0 0 6px; }

@media (max-width: 560px) {
  h1 { font-size: 26px; }
  .toc ol { columns: 1; }
}
