:root {
  --bg: #f4f7fb; --surface: #ffffff; --text: #0e1c2b; --muted: #4a5e75; --border: #d3deea;
  --accent: #1268c4; --warn-bg: #fff4e0; --warn-border: #e0a040;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #04090f; --surface: #0a1628; --text: #e8f0fa; --muted: #9fb4ce; --border: #1d3350; --accent: #4fb3ff; --warn-bg: #2a1d07; --warn-border: #b07a20; }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
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); }
.wrap { width: min(860px, 100%); margin: 0 auto; padding: 0 16px; }
.top { background: var(--surface); border-bottom: 1px solid var(--border); }
.top .wrap { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 20px; padding-top: 12px; padding-bottom: 12px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; color: var(--text); text-decoration: none; }
.brand img { border-radius: 7px; }
.nav { display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: 15px; }
.nav a { text-decoration: none; color: var(--muted); }
.nav a[aria-current="page"] { color: var(--text); font-weight: 700; }
main { padding-top: 24px; padding-bottom: 32px; }
article { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 24px 20px; overflow-wrap: anywhere; }
h1 { font-size: 26px; line-height: 1.25; margin: 0 0 16px; }
h2 { font-size: 19px; margin: 28px 0 8px; scroll-margin-top: 16px; }
h3 { font-size: 16px; margin: 20px 0 6px; }
p, ul, ol { margin: 0 0 12px; }
ul, ol { padding-left: 22px; }
hr { border: 0; border-top: 1px solid var(--border); margin: 24px 0; }
blockquote { margin: 0 0 16px; padding: 12px 14px; background: var(--warn-bg); border: 1px solid var(--warn-border); border-radius: 8px; }
.table { overflow-x: auto; margin: 0 0 14px; }
table { border-collapse: collapse; width: 100%; font-size: 15px; }
th, td { text-align: left; vertical-align: top; padding: 8px 10px; border-bottom: 1px solid var(--border); }
th { color: var(--muted); font-weight: 600; }
.toc { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 14px 18px; margin-bottom: 16px; font-size: 15px; }
.toc ol { margin: 6px 0 0; padding-left: 0; list-style: none; columns: 2 260px; }
.toc li { break-inside: avoid; }
.cards { list-style: none; padding: 0; display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.cards a { display: block; height: 100%; padding: 14px 16px; border: 1px solid var(--border); border-radius: 10px; text-decoration: none; color: var(--text); }
.cards span { display: block; color: var(--muted); font-size: 15px; margin-top: 4px; }
.foot { color: var(--muted); font-size: 14px; padding-bottom: 32px; }
@media print { .top, .toc, .foot { display: none; } article { border: 0; padding: 0; } body { background: #fff; color: #000; } }
