:root {
  color-scheme: dark;
  --bg: #0a0a0a;
  --text: #fafafa;
  --muted: #9ca3af;
  --dim: #6b7280;
  --border: #2a2a2a;
  --accent: #10b981;
  --cyan: #06b6d4;
  --surface: #111;
}

html[data-theme="light"] {
  color-scheme: light;
  --bg: #f5f5f4;
  --text: #171717;
  --muted: #57534e;
  --dim: #78716c;
  --border: #e7e5e4;
  --accent: #059669;
  --cyan: #0891b2;
  --surface: #fff;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: "IBM Plex Mono", ui-monospace, "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 15px;
  line-height: 1.7;
}
.site {
  max-width: 1000px;
  margin: 0 auto;
  padding: 32px 20px 56px;
}
.topbar, .footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.brand {
  color: var(--accent);
  font-weight: 700;
  text-decoration: none;
}
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  padding: 8px 14px;
  border-radius: 4px;
  background: transparent;
  color: var(--text);
  text-decoration: none;
  cursor: pointer;
  font: inherit;
}
.btn:hover { border-color: var(--accent); color: var(--accent); }
.doc-back { margin: 24px 0 12px; }
.doc-back a, .footer a { color: var(--accent); text-decoration: none; }
.doc-back a:hover, .footer a:hover { text-decoration: underline; }
.doc-prose {
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 24px;
  background: var(--surface);
}
h1, h2, h3 { line-height: 1.35; }
h1 { margin-top: 0; font-size: 30px; }
h2 { margin-top: 28px; font-size: 20px; }
h3 { margin-top: 22px; font-size: 16px; }
p, li { color: var(--muted); }
code, pre {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 13px;
}
code {
  background: rgba(127, 127, 127, 0.12);
  padding: 2px 6px;
  border-radius: 4px;
}
pre {
  margin: 12px 0;
  padding: 14px;
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #0f172a;
  color: #e5e7eb;
}
.mode-switch {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 18px 0 24px;
}
.mode-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #08130f;
  font-weight: 700;
}
.mode-note {
  border-left: 3px solid var(--accent);
  padding-left: 12px;
  color: var(--text);
}
.list-compact li { margin: 4px 0; }
.footer {
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
  color: var(--dim);
}
