
:root { --fg: #1b1b1f; --fg2: #3d3d45; --muted: #6b6b76; --bg: #fbfbfa; --panel: #ffffff; --line: #e6e6e3; --code: #f4f4f2;
  --accent: #5b5bd6; --accent-soft: rgb(91 91 214 / .1); --note: #2563eb; --tip: #16a34a; --warn: #d97706;
  --k: #7c3aed; --s: #0f766e; --n: #b45309; --c: #8a8a96; --f: #2563eb; }
@media (prefers-color-scheme: dark) { :root { --fg: #ececf0; --fg2: #c8c8d0; --muted: #9a9aa6; --bg: #111113; --panel: #1b1b1f; --line: #2c2c31; --code: #18181c;
  --accent: #8b8bf0; --accent-soft: rgb(139 139 240 / .14); --note: #60a5fa; --tip: #4ade80; --warn: #fbbf24;
  --k: #c4b5fd; --s: #5eead4; --n: #fcd34d; --c: #7c7c88; --f: #93c5fd; } }
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 76px; }
body { margin: 0; background: var(--bg); color: var(--fg); font: 16px/1.65 -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, sans-serif; }
a { color: var(--accent); text-decoration: none; } a:hover { text-decoration: underline; }
.top { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 14px; height: 60px; padding: 0 20px;
  background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 9px; color: var(--fg); font-weight: 700; font-size: 17px; }
.brand:hover, .brand-docs:hover { text-decoration: none; }
.brand-docs { color: var(--muted); font-weight: 600; font-size: 15px; padding-left: 12px; border-left: 1px solid var(--line); }
.search { position: relative; flex: 1; max-width: 420px; margin-left: 12px; }
.search input { width: 100%; height: 36px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--panel); color: var(--fg); font: inherit; font-size: 14px; outline: none; }
.search input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.results { position: absolute; top: 42px; left: 0; right: 0; max-height: 60vh; overflow: auto; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 20px 50px -20px rgb(0 0 0 / .3); padding: 6px; }
.results a { display: block; padding: 8px 10px; border-radius: 8px; color: var(--fg); } .results a:hover, .results a.on { background: var(--accent-soft); text-decoration: none; }
.results small { display: block; color: var(--muted); font-size: 12.5px; }
.results .empty { padding: 10px; color: var(--muted); font-size: 14px; }
.top-links { margin-left: auto; display: flex; align-items: center; gap: 16px; font-size: 14px; }
.top-links a { color: var(--fg2); }
.langs { display: flex; gap: 6px; color: var(--muted); font-size: 13px; } .langs b { color: var(--fg); }
.btn { display: inline-flex; align-items: center; height: 34px; padding: 0 14px; border-radius: 10px; background: var(--accent); color: #fff !important; font-weight: 600; }
.btn:hover { text-decoration: none; filter: brightness(1.06); }
.layout { display: grid; grid-template-columns: 250px minmax(0, 1fr) 220px; gap: 40px; max-width: 1360px; margin: 0 auto; padding: 0 20px; }
.side { position: sticky; top: 60px; align-self: start; max-height: calc(100vh - 60px); overflow: auto; padding: 28px 0; }
.side-mobile { display: none; }
.nav-group { margin-bottom: 22px; }
.nav-title { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 0 0 8px; }
.side ul, .toc ul { list-style: none; margin: 0; padding: 0; }
.side li a { display: block; padding: 5px 10px; border-radius: 8px; color: var(--fg2); font-size: 14.5px; }
.side li a:hover { background: var(--accent-soft); text-decoration: none; }
.side li a[aria-current] { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
main { min-width: 0; padding: 32px 0 80px; }
article { max-width: 760px; }
.crumbs { font-size: 13.5px; color: var(--muted); margin-bottom: 10px; } .crumbs span { margin: 0 4px; }
h1 { font-size: 38px; line-height: 1.15; letter-spacing: -.02em; margin: 0 0 12px; }
.lead { font-size: 18px; color: var(--fg2); margin: 0 0 28px; }
h2 { font-size: 26px; line-height: 1.25; letter-spacing: -.01em; margin: 44px 0 14px; padding-top: 4px; }
h3 { font-size: 19px; margin: 30px 0 10px; }
h2, h3 { position: relative; } .anchor { position: absolute; left: -22px; color: var(--muted); opacity: 0; font-weight: 400; }
h2:hover .anchor, h3:hover .anchor { opacity: 1; text-decoration: none; }
p, ul, ol { margin: 0 0 16px; } li { margin: 4px 0; } li > ul, li > ol { margin: 4px 0; }
article :not(pre) > code { font: 0.88em ui-monospace, SFMono-Regular, Menlo, monospace; background: var(--code); border: 1px solid var(--line); border-radius: 6px; padding: 1px 5px; }
article img { display: block; max-width: 100%; height: auto; border-radius: 12px; margin: 20px 0; box-shadow: 0 0 0 1px var(--line), 0 20px 50px -25px rgb(40 40 120 / .35); }
hr { border: 0; border-top: 1px solid var(--line); margin: 32px 0; }
.code { margin: 18px 0; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: var(--code); }
.code-bar { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 6px 8px 6px 14px; border-bottom: 1px solid var(--line); font-size: 12.5px; color: var(--muted); }
.code-actions { display: flex; gap: 6px; align-items: center; }
.code-actions a, .copy { font: inherit; font-size: 12.5px; padding: 3px 9px; border-radius: 7px; border: 1px solid var(--line); background: var(--panel); color: var(--fg2); cursor: pointer; }
.code-actions a:hover, .copy:hover { color: var(--accent); text-decoration: none; }
pre { margin: 0; padding: 14px 16px; overflow: auto; font: 13.5px/1.6 ui-monospace, SFMono-Regular, Menlo, monospace; }
.hljs-keyword, .hljs-built_in, .hljs-selector-tag, .hljs-type { color: var(--k); }
.hljs-string, .hljs-attr, .hljs-symbol, .hljs-template-variable { color: var(--s); }
.hljs-number, .hljs-literal, .hljs-variable { color: var(--n); }
.hljs-comment, .hljs-meta { color: var(--c); font-style: italic; }
.hljs-title, .hljs-section, .hljs-name { color: var(--f); }
.callout { margin: 18px 0; padding: 12px 16px; border-radius: 12px; border: 1px solid; background: var(--panel); }
.callout > :last-child { margin-bottom: 0; }
.callout-title { font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; margin-bottom: 4px; }
.callout.note { border-color: color-mix(in srgb, var(--note) 35%, transparent); } .callout.note .callout-title { color: var(--note); }
.callout.tip { border-color: color-mix(in srgb, var(--tip) 35%, transparent); } .callout.tip .callout-title { color: var(--tip); }
.callout.warning { border-color: color-mix(in srgb, var(--warn) 45%, transparent); } .callout.warning .callout-title { color: var(--warn); }
blockquote { margin: 18px 0; padding: 4px 16px; border-left: 3px solid var(--line); color: var(--fg2); }
.table { overflow-x: auto; margin: 18px 0; border: 1px solid var(--line); border-radius: 12px; }
table { width: 100%; border-collapse: collapse; font-size: 14.5px; }
th, td { padding: 9px 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
th { background: var(--code); font-weight: 600; } tr:last-child td { border-bottom: 0; }
.pager { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; max-width: 760px; margin-top: 56px; }
.pager a { display: block; padding: 14px 16px; border: 1px solid var(--line); border-radius: 12px; color: var(--fg); font-weight: 600; background: var(--panel); }
.pager a:hover { border-color: var(--accent); text-decoration: none; } .pager small { display: block; color: var(--muted); font-weight: 400; font-size: 13px; }
.pager .next { text-align: right; grid-column: 2; }
.toc { position: sticky; top: 60px; align-self: start; padding: 32px 0; font-size: 13.5px; max-height: calc(100vh - 60px); overflow: auto; }
.toc li a { display: block; padding: 3px 0 3px 10px; border-left: 2px solid var(--line); color: var(--muted); }
.toc li.l3 a { padding-left: 22px; } .toc li a:hover, .toc li a.on { color: var(--accent); border-color: var(--accent); text-decoration: none; }
.foot { display: flex; justify-content: space-between; gap: 12px; max-width: 1360px; margin: 0 auto; padding: 24px 20px 40px; border-top: 1px solid var(--line); color: var(--muted); font-size: 14px; }
.foot a { color: var(--muted); margin-left: 16px; }
@media (max-width: 1100px) { .layout { grid-template-columns: 220px minmax(0, 1fr); } .toc { display: none; } }
@media (max-width: 760px) {
  .layout { grid-template-columns: 1fr; gap: 0; }
  .side { position: static; max-height: none; padding: 12px 0 0; }
  .side-desktop { display: none; } .side-mobile { display: block; border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px; background: var(--panel); }
  .side-mobile summary { cursor: pointer; font-weight: 600; } .side-mobile .nav-group:first-of-type { margin-top: 12px; }
  .brand-docs, .hide-sm, .langs { display: none; } .search { margin-left: 0; }
  h1 { font-size: 30px; } .anchor { display: none; }
}
