:root {
  --primary: #3b82f6;
  --font: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  --mono: ui-monospace, "JetBrains Mono", "SFMono-Regular", Menlo, Consolas, "Liberation Mono", monospace;
  --bg: #ffffff;
  --bg-soft: #f8f9fb;
  --bg-muted: #f1f3f6;
  --bg-elev: #ffffff;
  --border: #e7e9ee;
  --border-strong: #d6dae1;
  --text: #16191f;
  --text-soft: #464d59;
  --text-muted: #737b88;
  --code-bg: #f6f7f9;
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, .05);
  --shadow: 0 1px 3px rgba(16, 24, 40, .06), 0 8px 24px -6px rgba(16, 24, 40, .10);
  --shadow-lg: 0 24px 64px -12px rgba(16, 24, 40, .28);
  --primary-soft: color-mix(in srgb, var(--primary) 9%, transparent);
  --primary-softer: color-mix(in srgb, var(--primary) 5%, transparent);
  --primary-border: color-mix(in srgb, var(--primary) 30%, transparent);
  --primary-text: color-mix(in srgb, var(--primary) 82%, #000);
  --radius: 10px;
  --radius-sm: 7px;
  --topbar-h: 64px;
  --sidebar-w: 288px;
  --toc-w: 248px;
  --ease: cubic-bezier(.2, .7, .2, 1);
  --info: #3b82f6; --info-bg: #eff6ff; --info-border: #cfe0fd;
  --warning: #d97706; --warning-bg: #fffbeb; --warning-border: #fbe3b0;
  --success: #16a34a; --success-bg: #f0fdf4; --success-border: #c4ecd0;
  --danger: #dc2626; --danger-bg: #fef2f2; --danger-border: #f8cccc;
  color-scheme: light;
}
[data-theme="dark"] {
  --bg: #0e1014;
  --bg-soft: #13161c;
  --bg-muted: #1a1e26;
  --bg-elev: #171a21;
  --border: #252a33;
  --border-strong: #333a45;
  --text: #e8eaee;
  --text-soft: #b9bfc9;
  --text-muted: #8a919d;
  --code-bg: #12151b;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4);
  --shadow: 0 1px 3px rgba(0, 0, 0, .4), 0 8px 24px -6px rgba(0, 0, 0, .5);
  --shadow-lg: 0 24px 64px -12px rgba(0, 0, 0, .7);
  --primary-soft: color-mix(in srgb, var(--primary) 16%, transparent);
  --primary-softer: color-mix(in srgb, var(--primary) 8%, transparent);
  --primary-border: color-mix(in srgb, var(--primary) 40%, transparent);
  --primary-text: color-mix(in srgb, var(--primary) 70%, #fff);
  --info-bg: rgba(59, 130, 246, .10); --info-border: rgba(59, 130, 246, .28); --info: #60a5fa;
  --warning-bg: rgba(217, 119, 6, .10); --warning-border: rgba(217, 119, 6, .30); --warning: #fbbf24;
  --success-bg: rgba(22, 163, 74, .10); --success-border: rgba(22, 163, 74, .30); --success: #4ade80;
  --danger-bg: rgba(220, 38, 38, .10); --danger-border: rgba(220, 38, 38, .32); --danger: #f87171;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--topbar-h) + 24px); }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font-family: var(--font); font-size: 16px; line-height: 1.65;
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  transition: background-color .25s var(--ease), color .25s var(--ease);
}
img, video, iframe { max-width: 100%; }
a { color: var(--primary-text); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; border-radius: 4px; }
::selection { background: color-mix(in srgb, var(--primary) 25%, transparent); }
.skip-link { position: absolute; left: -9999px; top: 8px; z-index: 1000; background: var(--bg); padding: 8px 14px; border-radius: 8px; box-shadow: var(--shadow); }
.skip-link:focus { left: 8px; }
.muted { color: var(--text-muted); }
.small { font-size: 13px; }
.grow { flex: 1 1 auto; }
[hidden] { display: none !important; }

.icon-img { object-fit: contain; image-rendering: pixelated; border-radius: 4px; flex: none; }
.icon-emoji { flex: none; line-height: 1; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  height: 38px; padding: 0 16px; border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong); background: var(--bg-elev); color: var(--text);
  font-size: 14px; font-weight: 500; cursor: pointer; white-space: nowrap; text-decoration: none !important;
  transition: background-color .15s, border-color .15s, box-shadow .15s, transform .05s;
  box-shadow: var(--shadow-sm);
}
.btn:hover { background: var(--bg-muted); }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn-primary:hover { background: color-mix(in srgb, var(--primary) 88%, #000); }
.btn-ghost { background: transparent; border-color: transparent; box-shadow: none; color: var(--text-soft); }
.btn-ghost:hover { background: var(--bg-muted); color: var(--text); }
.btn-sm { height: 32px; padding: 0 11px; font-size: 13px; }
.btn-block { width: 100%; }
.btn.danger, .danger { color: var(--danger) !important; }
.icon-btn {
  display: inline-flex; align-items: center; justify-content: center; flex: none;
  width: 36px; height: 36px; border-radius: 8px; border: 0; background: transparent; color: var(--text-soft);
  cursor: pointer; transition: background-color .15s, color .15s; list-style: none; text-decoration: none !important;
}
.icon-btn:hover { background: var(--bg-muted); color: var(--text); }
.icon-btn.sm { width: 28px; height: 28px; font-size: 13px; }
summary.icon-btn::-webkit-details-marker { display: none; }

.topbar {
  position: sticky; top: 0; z-index: 50; height: var(--topbar-h);
  background: color-mix(in srgb, var(--bg) 85%, transparent);
  backdrop-filter: saturate(180%) blur(12px); -webkit-backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--border);
}
.topbar-inner { max-width: 1480px; margin: 0 auto; height: 100%; display: flex; align-items: center; gap: 10px; padding: 0 20px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); font-weight: 650; font-size: 16.5px; letter-spacing: -.01em; text-decoration: none !important; min-width: 0; }
.brand-logo { width: 32px; height: 32px; object-fit: contain; border-radius: 7px; image-rendering: auto; }
.brand-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.logo-dark { display: none; }
[data-theme="dark"] .logo-dark { display: block; }
[data-theme="dark"] .logo-light { display: none; }
.topbar-spacer { flex: 1; }
.menu-toggle { display: none; margin-left: -6px; }
.topbar-links { display: flex; gap: 4px; }
.topbar-links a { color: var(--text-soft); font-size: 14px; font-weight: 500; padding: 6px 10px; border-radius: 7px; }
.topbar-links a:hover { background: var(--bg-muted); color: var(--text); text-decoration: none; }
.search-trigger {
  display: flex; align-items: center; gap: 9px; width: 300px; max-width: 34vw; height: 38px; padding: 0 8px 0 12px;
  border: 1px solid var(--border); border-radius: 9px; background: var(--bg-soft); color: var(--text-muted);
  cursor: pointer; font-size: 14px; transition: border-color .15s, background-color .15s, box-shadow .15s;
}
.search-trigger:hover { border-color: var(--border-strong); background: var(--bg-elev); box-shadow: var(--shadow-sm); }
.search-trigger-text { flex: 1; text-align: left; }
kbd, .search-kbd {
  font-family: var(--font); font-size: 11.5px; font-weight: 500; color: var(--text-muted);
  border: 1px solid var(--border-strong); border-bottom-width: 2px; border-radius: 5px; padding: 1px 6px; background: var(--bg-elev); white-space: nowrap;
}
.theme-toggle .i-moon { display: none; }
[data-theme="dark"] .theme-toggle .i-sun { display: none; }
[data-theme="dark"] .theme-toggle .i-moon { display: block; }
.lang-code { font-size: 12.5px; font-weight: 650; letter-spacing: .03em; }
.avatar {
  width: 34px; height: 34px; border-radius: 50%; background: var(--primary); color: #fff; display: grid; place-items: center;
  font-weight: 600; font-size: 14px; cursor: pointer; list-style: none; user-select: none;
}
.avatar::-webkit-details-marker { display: none; }

.dropdown { position: relative; }
.dropdown > summary { list-style: none; cursor: pointer; }
.dropdown > summary::-webkit-details-marker { display: none; }
.dropdown-menu {
  position: absolute; top: calc(100% + 6px); left: 0; z-index: 60; min-width: 220px; padding: 6px;
  background: var(--bg-elev); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow);
  animation: pop .14s var(--ease);
}
.dropdown-right { left: auto; right: 0; }
.dropdown-item {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; border: 0; background: none; border-radius: 7px;
  color: var(--text); font-size: 14px; text-align: left; cursor: pointer; text-decoration: none !important;
}
.dropdown-item:hover { background: var(--bg-muted); }
.dropdown-item.active { background: var(--primary-soft); color: var(--primary-text); }
.dropdown-item small { display: block; color: var(--text-muted); font-size: 12px; }
.dropdown-head { padding: 8px 10px 10px; border-bottom: 1px solid var(--border); margin-bottom: 4px; }
.dropdown-head small { display: block; color: var(--text-muted); }
.dd-icon { width: 22px; height: 22px; font-size: 18px; }
.chip { display: inline-flex; align-items: center; gap: 7px; padding: 5px 10px; border-radius: 8px; border: 1px solid var(--border); font-size: 14px; font-weight: 500; color: var(--text-soft); }
.chip:hover { background: var(--bg-muted); }
.chip-icon { width: 18px; height: 18px; font-size: 15px; }
@keyframes pop { from { opacity: 0; transform: translateY(-4px) scale(.98); } to { opacity: 1; transform: none; } }

.docs-layout {
  max-width: 1480px; margin: 0 auto; display: grid;
  grid-template-columns: var(--sidebar-w) minmax(0, 1fr) var(--toc-w);
  min-height: calc(100vh - var(--topbar-h));
}
.sidebar { position: sticky; top: var(--topbar-h); height: calc(100vh - var(--topbar-h)); border-right: 1px solid var(--border); }
.sidebar-inner { height: 100%; overflow-y: auto; padding: 24px 14px 40px 20px; scrollbar-width: thin; scrollbar-color: var(--border-strong) transparent; }
.sidebar-space { display: flex; align-items: center; gap: 9px; padding: 0 10px 14px; margin-bottom: 8px; border-bottom: 1px solid var(--border); font-weight: 600; font-size: 14px; }
.sidebar-actions { margin-top: 22px; padding-top: 14px; border-top: 1px solid var(--border); display: grid; gap: 4px; }
.sidebar-actions .btn { justify-content: flex-start; }
.sidebar-backdrop { display: none; }

.tree ul { list-style: none; margin: 0; padding: 0; }
.tree-group { margin: 22px 0 6px; }
.tree-group:first-child { margin-top: 0; }
.tree-group-title {
  display: flex; align-items: center; gap: 8px; padding: 4px 10px; margin-bottom: 4px;
  font-size: 12px; font-weight: 650; text-transform: uppercase; letter-spacing: .06em; color: var(--text-muted);
  text-decoration: none !important; border-radius: 6px;
}
.tree-group-title:hover { color: var(--text); }
.tree-group.current > .tree-group-title { color: var(--primary-text); }
.tree-group-title .tree-icon { width: 16px; height: 16px; font-size: 13px; }
.tree-row { position: relative; display: flex; align-items: center; }
.tree-link {
  flex: 1; display: flex; align-items: center; gap: 9px; min-width: 0; padding: 6px 10px; border-radius: 8px;
  color: var(--text-soft); font-size: 14.5px; line-height: 1.45; text-decoration: none !important;
  transition: background-color .15s, color .15s;
}
.tree-item.has-children > .tree-row > .tree-link { padding-right: 34px; }
.tree-link:hover { background: var(--bg-muted); color: var(--text); }
.tree-item.current > .tree-row > .tree-link { background: var(--primary-soft); color: var(--primary-text); font-weight: 560; }
.tree-icon { width: 20px; height: 20px; font-size: 16px; display: inline-grid; place-items: center; }
.tree-text { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.tree-toggle {
  position: absolute; right: 4px; width: 26px; height: 26px; display: grid; place-items: center; border: 0; background: none;
  color: var(--text-muted); border-radius: 6px; cursor: pointer; transition: background-color .15s, color .15s;
}
.tree-toggle:hover { background: color-mix(in srgb, var(--text) 8%, transparent); color: var(--text); }
.tree-toggle svg { transition: transform .2s var(--ease); }
.tree-item.open > .tree-row > .tree-toggle svg { transform: rotate(90deg); }
.tree-children { display: none; margin-left: 19px !important; padding-left: 8px !important; border-left: 1px solid var(--border); }
.tree-item.open > .tree-children { display: block; animation: slide .2s var(--ease); }
.tree-children .tree-link { font-size: 14px; }
@keyframes slide { from { opacity: 0; transform: translateY(-3px); } to { opacity: 1; transform: none; } }
.badge {
  display: inline-flex; align-items: center; gap: 4px; padding: 1px 7px; border-radius: 999px; font-size: 11px; font-weight: 600;
  background: var(--bg-muted); color: var(--text-muted); border: 1px solid var(--border); white-space: nowrap; line-height: 1.6;
}
.badge-draft { background: var(--warning-bg); color: var(--warning); border-color: var(--warning-border); }
.badge-warn { background: var(--info-bg); color: var(--info); border-color: var(--info-border); }
.badge-ok { background: var(--success-bg); color: var(--success); border-color: var(--success-border); }
.lock { color: var(--text-muted); display: inline-flex; }

.content { min-width: 0; padding: 44px 56px 32px; display: flex; flex-direction: column; }
.content > * { width: 100%; max-width: 780px; margin-left: auto; margin-right: auto; }
.page-header { margin-bottom: 30px; }
.breadcrumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-bottom: 12px; font-size: 13.5px; font-weight: 600; }
.breadcrumbs a { color: var(--primary-text); display: inline-flex; align-items: center; gap: 6px; }
.bc-icon { width: 16px; height: 16px; font-size: 13px; }
.bc-sep { color: var(--text-muted); }
.page-title-row { display: flex; align-items: flex-start; gap: 16px; }
.page-title {
  flex: 1; margin: 0; display: flex; align-items: center; gap: 14px;
  font-size: clamp(28px, 3.4vw, 38px); line-height: 1.18; font-weight: 720; letter-spacing: -.025em;
}
.page-icon { width: 44px; height: 44px; font-size: 36px; display: inline-grid; place-items: center; }
.page-icon.icon-img { border-radius: 8px; }
.page-actions { display: flex; gap: 4px; align-items: center; padding-top: 4px; }
.page-description { margin: 14px 0 0; font-size: 18px; line-height: 1.55; color: var(--text-soft); }
.draft-banner {
  display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: center; padding: 10px 14px; margin-bottom: 24px; font-size: 14px;
  border-radius: var(--radius-sm); background: var(--warning-bg); border: 1px solid var(--warning-border); color: var(--text);
}
.draft-banner-soft { background: var(--info-bg); border-color: var(--info-border); }

.markdown { font-size: 16px; line-height: 1.72; color: var(--text); overflow-wrap: break-word; }
.markdown > :first-child { margin-top: 0; }
.markdown p { margin: 0 0 1.05em; }
.markdown h1, .markdown h2, .markdown h3, .markdown h4, .markdown h5, .markdown h6 {
  position: relative; margin: 2.1em 0 .6em; line-height: 1.3; font-weight: 680; letter-spacing: -.015em; scroll-margin-top: calc(var(--topbar-h) + 20px);
}
.markdown h1 { font-size: 30px; }
.markdown h2 { font-size: 24px; padding-bottom: 2px; }
.markdown h3 { font-size: 19.5px; margin-top: 1.8em; }
.markdown h4 { font-size: 17px; }
.markdown h5, .markdown h6 { font-size: 15px; color: var(--text-soft); }
.anchor {
  position: absolute; left: -26px; top: 50%; transform: translateY(-50%); width: 22px; text-align: center;
  color: var(--text-muted); opacity: 0; font-weight: 500; text-decoration: none !important; transition: opacity .15s, color .15s;
}
.heading:hover .anchor, .anchor:focus { opacity: 1; }
.anchor:hover { color: var(--primary); }
.markdown ul, .markdown ol { margin: 0 0 1.1em; padding-left: 1.55em; }
.markdown li { margin: .3em 0; }
.markdown li > ul, .markdown li > ol { margin: .3em 0 .2em; }
.markdown li::marker { color: var(--text-muted); }
.markdown ul.task-list { list-style: none; padding-left: .2em; }
.task-item { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.task-item > input { flex: none; width: 16px; height: 16px; margin: 0; transform: translateY(2px); accent-color: var(--primary); }
.task-item.done { color: var(--text-muted); text-decoration: line-through; text-decoration-color: color-mix(in srgb, var(--text-muted) 60%, transparent); }
.markdown blockquote {
  margin: 0 0 1.2em; padding: 4px 0 4px 18px; border-left: 3px solid var(--border-strong); color: var(--text-soft);
}
.markdown blockquote > :last-child { margin-bottom: 0; }
.markdown hr { border: 0; height: 1px; background: var(--border); margin: 2.4em 0; }
.markdown a { color: var(--primary-text); text-decoration: underline; text-decoration-color: var(--primary-border); text-underline-offset: 3px; text-decoration-thickness: 1px; transition: text-decoration-color .15s; }
.markdown a:hover { text-decoration-color: currentColor; }
.markdown strong { font-weight: 650; }
.markdown mark { background: color-mix(in srgb, #facc15 40%, transparent); color: inherit; padding: 0 3px; border-radius: 3px; }
.markdown code {
  font-family: var(--mono); font-size: .86em; padding: .15em .4em; border-radius: 6px;
  background: var(--bg-muted); border: 1px solid var(--border); color: var(--text);
}
.markdown kbd { font-size: .82em; }
.markdown img { height: auto; border-radius: 8px; }
.markdown .figure, .markdown figure { margin: 1.6em 0; text-align: center; }
.markdown figure img { border: 1px solid var(--border); }
.markdown figcaption { margin-top: 8px; font-size: 13.5px; color: var(--text-muted); }
.markdown img[src$=".png"][width] { image-rendering: pixelated; }

.table-wrap { margin: 0 0 1.4em; overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); }
.markdown table { width: 100%; border-collapse: collapse; font-size: 14.5px; line-height: 1.55; }
.markdown th, .markdown td { padding: 10px 14px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--border); }
.markdown th { background: var(--bg-soft); font-weight: 620; font-size: 13.5px; color: var(--text-soft); white-space: nowrap; }
.markdown tr:last-child td { border-bottom: 0; }
.markdown tbody tr { transition: background-color .12s; }
.markdown tbody tr:hover { background: var(--primary-softer); }
.markdown td img { vertical-align: middle; border-radius: 3px; image-rendering: pixelated; }

.code-block { margin: 0 0 1.4em; border: 1px solid var(--border); border-radius: var(--radius); background: var(--code-bg); overflow: hidden; }
.code-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; height: 38px; padding: 0 8px 0 14px; border-bottom: 1px solid var(--border); background: color-mix(in srgb, var(--bg-muted) 55%, var(--code-bg)); }
.code-lang { font-family: var(--mono); font-size: 12px; color: var(--text-muted); text-transform: lowercase; }
.code-file { text-transform: none; color: var(--text-soft); }
.code-copy {
  display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 9px; border-radius: 6px; border: 0; background: transparent;
  color: var(--text-muted); font-size: 12px; cursor: pointer; transition: background-color .15s, color .15s;
}
.code-copy:hover { background: color-mix(in srgb, var(--text) 8%, transparent); color: var(--text); }
.code-copy.copied { color: var(--success); }
.code-block pre { margin: 0; padding: 14px 16px; overflow-x: auto; font-family: var(--mono); font-size: 13.5px; line-height: 1.65; tab-size: 4; }
.code-block pre code { padding: 0; border: 0; background: none; font-size: inherit; color: var(--text); white-space: pre; }
.line-numbers pre code { counter-reset: ln; }
.line-numbers .ln { counter-increment: ln; }
.line-numbers .ln::before { content: counter(ln); display: inline-block; width: 2.4em; margin-right: 12px; text-align: right; color: var(--text-muted); opacity: .6; user-select: none; }
.tok-c { color: #6a737d; font-style: italic; }
.tok-s { color: #0a7f3f; }
.tok-n { color: #b45309; }
.tok-k { color: #a626a4; font-weight: 500; }
.tok-f { color: #2563eb; }
.tok-t { color: #0e7490; }
.tok-p { color: #64748b; }
.tok-v { color: #c2410c; }
.tok-a { color: #7c3aed; }
.tok-sel { color: #db2777; font-weight: 500; }
.tok-ns { color: #0369a1; }
[data-theme="dark"] .tok-c { color: #7d8590; }
[data-theme="dark"] .tok-s { color: #7ee2a8; }
[data-theme="dark"] .tok-n { color: #fbbf77; }
[data-theme="dark"] .tok-k { color: #e0a3ff; }
[data-theme="dark"] .tok-f { color: #82b4ff; }
[data-theme="dark"] .tok-t { color: #67e8f9; }
[data-theme="dark"] .tok-p { color: #94a3b8; }
[data-theme="dark"] .tok-v { color: #fdba74; }
[data-theme="dark"] .tok-a { color: #c4b5fd; }
[data-theme="dark"] .tok-sel { color: #f9a8d4; }
[data-theme="dark"] .tok-ns { color: #7dd3fc; }

.hint { display: flex; gap: 12px; margin: 0 0 1.3em; padding: 14px 16px; border-radius: var(--radius); border: 1px solid; font-size: 15px; line-height: 1.65; }
.hint-icon { flex: none; display: inline-flex; padding-top: 3px; }
.hint-body { flex: 1; min-width: 0; }
.hint-body > :last-child { margin-bottom: 0; }
.hint-title { font-weight: 650; margin-bottom: 4px; }
.hint-info { background: var(--info-bg); border-color: var(--info-border); } .hint-info .hint-icon { color: var(--info); }
.hint-warning { background: var(--warning-bg); border-color: var(--warning-border); } .hint-warning .hint-icon { color: var(--warning); }
.hint-success { background: var(--success-bg); border-color: var(--success-border); } .hint-success .hint-icon { color: var(--success); }
.hint-danger { background: var(--danger-bg); border-color: var(--danger-border); } .hint-danger .hint-icon { color: var(--danger); }
.hint code { background: color-mix(in srgb, var(--bg) 60%, transparent); }

.tabs { margin: 0 0 1.4em; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.tabs-nav { display: flex; gap: 2px; padding: 0 6px; overflow-x: auto; background: var(--bg-soft); border-bottom: 1px solid var(--border); scrollbar-width: none; }
.tab-btn {
  position: relative; padding: 11px 14px; border: 0; background: none; color: var(--text-muted); font-size: 14px; font-weight: 550;
  cursor: pointer; white-space: nowrap; transition: color .15s;
}
.tab-btn::after { content: ""; position: absolute; left: 10px; right: 10px; bottom: -1px; height: 2px; border-radius: 2px; background: var(--primary); transform: scaleX(0); transition: transform .22s var(--ease); }
.tab-btn:hover { color: var(--text); }
.tab-btn.active { color: var(--text); }
.tab-btn.active::after { transform: scaleX(1); }
.tabs-body { padding: 18px 20px 4px; }
.tab-panel.active { animation: fade .2s var(--ease); }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

.expandable { margin: 0 0 1em; border: 1px solid var(--border); border-radius: var(--radius); background: var(--bg); transition: box-shadow .2s; }
.expandable + .expandable { margin-top: -6px; }
.expandable > summary {
  display: flex; align-items: center; gap: 10px; padding: 12px 16px; cursor: pointer; list-style: none; font-weight: 580; user-select: none;
}
.expandable > summary::-webkit-details-marker { display: none; }
.expandable > summary:hover { background: var(--bg-soft); border-radius: var(--radius); }
.exp-chevron { width: 8px; height: 8px; border-right: 2px solid var(--text-muted); border-bottom: 2px solid var(--text-muted); transform: rotate(-45deg); transition: transform .2s var(--ease); flex: none; margin-right: 2px; }
.expandable[open] > summary .exp-chevron { transform: rotate(45deg); }
.expandable[open] { box-shadow: var(--shadow-sm); }
.expandable-body { padding: 2px 18px 6px 36px; animation: fade .2s var(--ease); }

.cards { display: grid; gap: 14px; margin: 0 0 1.4em; }
.cards-1 { grid-template-columns: 1fr; }
.cards-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.cards-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.cards-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.card {
  position: relative; display: flex; flex-direction: column; border: 1px solid var(--border); border-radius: 12px; background: var(--bg-elev);
  overflow: hidden; color: var(--text); text-decoration: none !important; transition: border-color .2s, box-shadow .2s, transform .2s var(--ease);
}
.card-link:hover { border-color: var(--primary-border); box-shadow: var(--shadow); transform: translateY(-2px); }
.card-image { aspect-ratio: 16 / 8; background: var(--bg-muted); overflow: hidden; }
.card-image img { width: 100%; height: 100%; object-fit: cover; border-radius: 0; border: 0; image-rendering: auto; }
.card-content { padding: 16px 18px; flex: 1; }
.card-icon { width: 30px; height: 30px; font-size: 24px; margin-bottom: 10px; display: block; }
.card-title { font-weight: 640; font-size: 15.5px; margin-bottom: 4px; padding-right: 20px; }
.card-text { font-size: 14px; color: var(--text-soft); line-height: 1.55; }
.card-text > :last-child { margin-bottom: 0; }
.card-arrow { position: absolute; top: 15px; right: 16px; color: var(--text-muted); transition: transform .2s var(--ease), color .2s; }
.card-link:hover .card-arrow { transform: translateX(3px); color: var(--primary); }
.child-cards { margin-top: 8px; }

.columns { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 24px; margin: 0 0 1.2em; }
.column > :last-child { margin-bottom: 0; }
.stepper { list-style: none; counter-reset: step; padding: 0 !important; margin: 0 0 1.4em; }
.step { position: relative; counter-increment: step; padding: 0 0 18px 48px; margin: 0 !important; }
.step::before { content: counter(step); position: absolute; left: 0; top: 0; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--primary-soft); color: var(--primary-text); font-weight: 700; font-size: 14px; border: 1px solid var(--primary-border); }
.step::after { content: ""; position: absolute; left: 15px; top: 34px; bottom: 4px; width: 1px; background: var(--border); }
.step:last-child::after { display: none; }
.step-body > :first-child { margin-top: 2px; }
.step-body > :last-child { margin-bottom: 0; }

.btn-row { margin: 0 0 1.2em; display: flex; flex-wrap: wrap; gap: 10px; }
.markdown .btn-link {
  display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 18px; border-radius: 9px; font-weight: 580; font-size: 15px;
  text-decoration: none; transition: background-color .15s, box-shadow .15s, transform .1s;
}
.markdown .btn-primary { background: var(--primary); color: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.08), inset 0 1px 0 rgba(255,255,255,.12); }
.markdown .btn-primary:hover { background: color-mix(in srgb, var(--primary) 88%, #000); }
.markdown .btn-secondary { border: 1px solid var(--border-strong); color: var(--text); background: var(--bg-elev); }
.markdown .btn-secondary:hover { background: var(--bg-muted); }

.embed { margin: 1.4em 0; }
.embed-ratio { position: relative; aspect-ratio: 16 / 9; border-radius: var(--radius); overflow: hidden; background: #000; border: 1px solid var(--border); }
.embed-ratio iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.embed video { width: 100%; border-radius: var(--radius); }
.embed audio { width: 100%; }
.markdown .embed-link {
  display: flex; align-items: center; gap: 14px; margin: 0 0 1.2em; padding: 14px 16px; border: 1px solid var(--border); border-radius: var(--radius);
  color: var(--text); text-decoration: none; transition: border-color .2s, box-shadow .2s;
}
.markdown .embed-link:hover { border-color: var(--primary-border); box-shadow: var(--shadow-sm); }
.embed-link-icon { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 9px; background: var(--primary-soft); color: var(--primary-text); flex: none; }
.embed-link-text { display: flex; flex-direction: column; min-width: 0; }
.embed-link-title { font-weight: 600; }
.embed-link-url { font-size: 13px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.page-bottom { margin-top: 48px; }
.feedback { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 0; border-top: 1px solid var(--border); }
.feedback-q { font-weight: 560; color: var(--text-soft); font-size: 15px; }
.feedback-btns { display: flex; gap: 8px; }
.fb-btn {
  display: inline-flex; align-items: center; gap: 7px; height: 36px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--border-strong);
  background: var(--bg-elev); color: var(--text-soft); cursor: pointer; font-size: 14px; transition: all .15s;
}
.fb-btn:hover { border-color: var(--primary-border); color: var(--primary-text); background: var(--primary-softer); }
.pager { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin: 18px 0 8px; }
.pager-link {
  display: flex; flex-direction: column; gap: 3px; padding: 14px 18px; border: 1px solid var(--border); border-radius: 12px;
  color: var(--text); text-decoration: none !important; transition: border-color .2s, box-shadow .2s, transform .2s var(--ease);
}
.pager-link:hover { border-color: var(--primary-border); box-shadow: var(--shadow); }
.pager-next { text-align: right; grid-column: 2; }
.pager-dir { font-size: 13px; color: var(--text-muted); }
.pager-title { font-weight: 620; color: var(--primary-text); }
.last-updated { font-size: 13px; color: var(--text-muted); margin: 18px 0 0; }
.docs-footer { margin-top: auto !important; padding-top: 48px; font-size: 13px; color: var(--text-muted); }
.docs-footer a { color: var(--text-soft); }
.site-footer { border-top: 1px solid var(--border); padding: 28px 20px; font-size: 13px; color: var(--text-muted); }
.site-footer-inner { max-width: 1100px; margin: 0 auto; }

.toc { position: sticky; top: var(--topbar-h); height: calc(100vh - var(--topbar-h)); }
.toc-inner { max-height: 100%; overflow-y: auto; padding: 44px 24px 40px 8px; scrollbar-width: thin; }
.toc-title { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 650; color: var(--text); margin-bottom: 10px; }
.toc-list { list-style: none; margin: 0; padding: 0; border-left: 1px solid var(--border); }
.toc-list a {
  display: block; margin-left: -1px; padding: 5px 0 5px 14px; border-left: 2px solid transparent; font-size: 13.5px; line-height: 1.45;
  color: var(--text-muted); text-decoration: none !important; transition: color .15s, border-color .15s;
}
.toc-l3 a { padding-left: 26px; font-size: 13px; }
.toc-list a:hover { color: var(--text); }
.toc-list a.active { color: var(--primary-text); border-left-color: var(--primary); font-weight: 560; }

.search-modal { position: fixed; inset: 0; z-index: 100; display: flex; justify-content: center; align-items: flex-start; padding: 10vh 16px 16px; }
.search-backdrop { position: absolute; inset: 0; background: rgba(10, 14, 20, .45); backdrop-filter: blur(3px); animation: fade .15s; }
.search-panel {
  position: relative; width: 100%; max-width: 640px; max-height: 76vh; display: flex; flex-direction: column;
  background: var(--bg-elev); border: 1px solid var(--border); border-radius: 16px; box-shadow: var(--shadow-lg); overflow: hidden;
  animation: pop .18s var(--ease);
}
.search-input-wrap { display: flex; align-items: center; gap: 12px; padding: 0 16px; height: 60px; border-bottom: 1px solid var(--border); color: var(--text-muted); }
.search-input-wrap input { flex: 1; border: 0; outline: 0; background: none; font-size: 17px; color: var(--text); height: 100%; }
.search-input-wrap input::-webkit-search-cancel-button { display: none; }
.search-input-wrap kbd { cursor: pointer; }
.search-results { overflow-y: auto; padding: 8px; flex: 1; }
.search-empty { padding: 28px 12px; text-align: center; color: var(--text-muted); font-size: 14px; }
.search-item {
  display: block; padding: 10px 12px; border-radius: 10px; color: var(--text); text-decoration: none !important; scroll-margin: 8px;
}
.search-item.active, .search-item:hover { background: var(--primary-soft); }
.search-item-title { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 15px; }
.search-item-title .sr-icon { width: 18px; height: 18px; font-size: 15px; }
.search-item-path { font-size: 12px; color: var(--text-muted); margin-top: 1px; }
.search-item-snippet { font-size: 13.5px; color: var(--text-soft); margin-top: 3px; line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.search-item mark { background: color-mix(in srgb, var(--primary) 22%, transparent); color: inherit; border-radius: 3px; padding: 0 1px; }
.search-foot { display: flex; gap: 18px; padding: 10px 16px; border-top: 1px solid var(--border); font-size: 12px; color: var(--text-muted); background: var(--bg-soft); }
.search-foot kbd { margin-right: 3px; }
.search-page { max-width: 780px; margin: 0 auto; padding: 48px 20px; }
.search-form { display: flex; gap: 10px; margin-bottom: 16px; }
.search-form input { flex: 1; height: 42px; padding: 0 14px; border-radius: 9px; border: 1px solid var(--border-strong); background: var(--bg-elev); }
.search-page-results { list-style: none; padding: 0; }
.search-page-results a { display: block; padding: 14px 0; border-bottom: 1px solid var(--border); color: var(--text); text-decoration: none; }
.sr-title { display: flex; gap: 8px; align-items: center; font-weight: 620; color: var(--primary-text); }
.sr-icon { width: 18px; height: 18px; }
.sr-path { display: block; font-size: 12.5px; color: var(--text-muted); }
.sr-snippet { display: block; font-size: 14px; color: var(--text-soft); }

.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; min-width: 0; }
.field > span { font-size: 13.5px; font-weight: 560; color: var(--text-soft); }
.field input[type=text], .field input[type=password], .field input[type=email], .field input[type=number], .field input[type=search], .field select, .field textarea, .search-page input, select, input[type=search] {
  height: 40px; padding: 0 12px; border-radius: 8px; border: 1px solid var(--border-strong); background: var(--bg-elev); color: var(--text);
  transition: border-color .15s, box-shadow .15s; width: 100%;
}
.field textarea { height: auto; padding: 10px 12px; line-height: 1.5; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus, select:focus, input[type=search]:focus { outline: 0; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.check { display: flex; align-items: center; gap: 9px; margin-bottom: 14px; font-size: 14.5px; cursor: pointer; }
.check input { width: 16px; height: 16px; accent-color: var(--primary); }
.alert { padding: 11px 14px; border-radius: 8px; margin-bottom: 16px; font-size: 14px; border: 1px solid; }
.alert-error { background: var(--danger-bg); border-color: var(--danger-border); }
.alert-warning { background: var(--warning-bg); border-color: var(--warning-border); }
.auth-wrap { min-height: calc(100vh - var(--topbar-h)); display: grid; place-items: center; padding: 32px 16px; background: radial-gradient(1200px 500px at 50% -10%, var(--primary-soft), transparent); }
.auth-card { width: 100%; max-width: 400px; padding: 32px; background: var(--bg-elev); border: 1px solid var(--border); border-radius: 16px; box-shadow: var(--shadow); }
.auth-brand { text-align: center; margin-bottom: 24px; }
.auth-brand img { width: 56px; height: 56px; object-fit: contain; image-rendering: pixelated; margin-bottom: 10px; }
.auth-brand h1 { margin: 0; font-size: 24px; letter-spacing: -.02em; }
.auth-brand p { margin: 4px 0 0; color: var(--text-muted); }
.error-page, .empty-state { max-width: 560px; margin: 0 auto; padding: 14vh 20px; text-align: center; }
.error-code { font-size: 88px; font-weight: 800; letter-spacing: -.04em; line-height: 1; background: linear-gradient(135deg, var(--primary), color-mix(in srgb, var(--primary) 40%, #ec4899)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.error-actions { display: flex; gap: 10px; justify-content: center; margin-top: 20px; }

.toast {
  position: fixed; right: 20px; bottom: 20px; z-index: 200; max-width: 380px; padding: 12px 16px; border-radius: 10px;
  background: var(--bg-elev); border: 1px solid var(--border); box-shadow: var(--shadow); font-size: 14px; animation: toast-in .3s var(--ease);
}
.toast + .toast { bottom: 76px; }
.toast-success { border-left: 4px solid var(--success); }
.toast-error { border-left: 4px solid var(--danger); }
.toast-info { border-left: 4px solid var(--info); }
.toast.hide { opacity: 0; transform: translateY(8px); transition: all .3s; }
@keyframes toast-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

.lightbox { position: fixed; inset: 0; z-index: 150; background: rgba(8, 10, 14, .85); display: grid; place-items: center; padding: 24px; cursor: zoom-out; animation: fade .2s; }
.lightbox img { max-width: 100%; max-height: 100%; border-radius: 8px; box-shadow: var(--shadow-lg); }
.markdown figure img, .markdown p > img { cursor: zoom-in; }

@media (max-width: 1240px) {
  .docs-layout { grid-template-columns: var(--sidebar-w) minmax(0, 1fr); }
  .toc { display: none; }
}
@media (max-width: 1000px) {
  .docs-layout { grid-template-columns: minmax(0, 1fr); }
  .menu-toggle { display: inline-flex; }
  .sidebar {
    position: fixed; top: var(--topbar-h); left: 0; bottom: 0; z-index: 45; width: min(320px, 86vw); height: auto;
    background: var(--bg); transform: translateX(-102%); transition: transform .28s var(--ease); box-shadow: var(--shadow-lg);
  }
  body.sidebar-open .sidebar { transform: none; }
  .sidebar-backdrop { display: block; position: fixed; inset: var(--topbar-h) 0 0 0; z-index: 44; background: rgba(10, 14, 20, .4); opacity: 0; pointer-events: none; transition: opacity .25s; }
  body.sidebar-open .sidebar-backdrop { opacity: 1; pointer-events: auto; }
  .content { padding: 32px 28px 28px; }
  .search-trigger { width: auto; }
}
@media (max-width: 680px) {
  :root { --topbar-h: 58px; }
  .topbar-inner { padding: 0 12px; gap: 4px; }
  .search-trigger { width: 38px; padding: 0; justify-content: center; border-color: transparent; background: transparent; }
  .search-trigger-text, .search-kbd, .topbar-links, .space-switcher { display: none; }
  .brand-name { max-width: 46vw; }
  .content { padding: 24px 18px 24px; }
  .page-title-row { gap: 6px; }
  .page-title { gap: 10px; }
  .page-actions { padding-top: 0; }
  .page-icon { width: 36px; height: 36px; font-size: 30px; }
  .cards-2, .cards-3, .cards-4 { grid-template-columns: 1fr; }
  .pager { grid-template-columns: 1fr; }
  .pager-next { grid-column: 1; }
  .anchor { display: none; }
  .tabs-body { padding: 14px 14px 2px; }
  .expandable-body { padding-left: 18px; }
  .search-modal { padding: 0; }
  .search-panel { max-width: none; max-height: 100vh; height: 100%; border-radius: 0; }
  .login-link { padding: 0 8px; }
}

@media print {
  @page { margin: 16mm 14mm; }
  .topbar, .sidebar, .toc, .page-actions, .feedback, .pager, .draft-banner, .sidebar-backdrop, .search-modal, .code-copy, .anchor, .toast, .docs-footer { display: none !important; }
  .docs-layout { display: block; }
  .content { padding: 0; }
  .content > * { max-width: none; }
  body { background: #fff; color: #000; font-size: 12pt; }
  .tab-panel[hidden] { display: block !important; }
  .tabs-nav { display: none; }
  .tab-panel { border-top: 1px dashed #ccc; padding-top: 8px; }
  details.expandable > *:not(summary) { display: block !important; }
  .code-block, .hint, .table-wrap, figure, .card { break-inside: avoid; }
  a { color: #000; }
  .markdown a[href^="http"]::after { content: " (" attr(href) ")"; font-size: 9pt; color: #555; }
}

.markdown td img, .markdown th img { height: 32px; width: auto; vertical-align: middle; margin: 0 6px 0 0; border-radius: 0; box-shadow: none; image-rendering: pixelated; display: inline-block; }
.ico { display: inline-block; vertical-align: -3px; flex: none; }
