:root {
  --bg: #ffffff;
  --surface: #f6f7f9;
  --text: #1d2125;
  --muted: #5e6c84;
  --border: #dfe1e6;
  --accent: #b8860b;
  --link: #0c66e4;
  --code-bg: #f1f2f4;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #1d2125;
    --surface: #22272b;
    --text: #dee4ea;
    --muted: #9fadbc;
    --border: #38414a;
    --accent: #e2b203;
    --link: #579dff;
    --code-bg: #2c333a;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.6 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
a { color: var(--link); }
img { max-width: 100%; height: auto; }
code { background: var(--code-bg); padding: 0.1em 0.35em; border-radius: 4px; font-size: 0.92em; }

header.site {
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}
header.site .inner, main, footer.site .inner {
  max-width: 820px;
  margin: 0 auto;
  padding: 0 16px;
}
header.site .inner {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  min-height: 60px;
}
header.site .brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  color: var(--text);
  text-decoration: none;
  margin-right: auto;
}
header.site .brand img { width: 32px; height: 32px; border-radius: 7px; }
header.site nav { display: flex; gap: 16px; flex-wrap: wrap; font-size: 0.95em; }
header.site nav a { color: var(--muted); text-decoration: none; }
header.site nav a:hover, header.site nav a[aria-current="page"] { color: var(--text); }

main { padding-top: 32px; padding-bottom: 48px; }
h1 { font-size: 2rem; line-height: 1.25; margin: 0 0 8px; }
h2 { font-size: 1.35rem; margin: 40px 0 8px; padding-top: 8px; border-top: 1px solid var(--border); }
h3 { font-size: 1.1rem; margin: 24px 0 4px; }
.lede { font-size: 1.15rem; color: var(--muted); margin-top: 0; }
.meta { color: var(--muted); font-size: 0.9em; }

figure { margin: 20px 0; }
figure img { border: 1px solid var(--border); border-radius: 8px; display: block; }
figcaption { color: var(--muted); font-size: 0.9em; margin-top: 6px; }

.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin: 24px 0; }
.card {
  display: block;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 14px 16px;
  background: var(--surface);
  color: var(--text);
  text-decoration: none;
}
.card strong { display: block; margin-bottom: 2px; }
.card span { color: var(--muted); font-size: 0.92em; }
.card:hover { border-color: var(--accent); }

table { border-collapse: collapse; width: 100%; margin: 12px 0; font-size: 0.95em; display: block; overflow-x: auto; }
th, td { border: 1px solid var(--border); padding: 6px 10px; text-align: left; vertical-align: top; }
th { background: var(--surface); }

.note {
  border-left: 3px solid var(--accent);
  background: var(--surface);
  padding: 10px 14px;
  border-radius: 0 6px 6px 0;
  margin: 16px 0;
}

footer.site { border-top: 1px solid var(--border); color: var(--muted); font-size: 0.88em; }
footer.site .inner { padding-top: 20px; padding-bottom: 28px; }
footer.site a { color: var(--muted); }
