/* 代码高亮：亮色 */
.chroma { background-color: #f7f7f7; -webkit-text-size-adjust: none; }
.chroma .err { color: #f6f8fa; background-color: #82071e; }
.chroma .lnlinks { outline: none; text-decoration: none; color: inherit; }
.chroma .lntd { vertical-align: top; padding: 0; margin: 0; border: 0; }
.chroma .lntable { border-spacing: 0; padding: 0; margin: 0; border: 0; }
.chroma .hl { background-color: #dedede; }
.chroma .lnt { white-space: pre; -webkit-user-select: none; user-select: none; margin-right: 0.4em; padding: 0 0.4em 0 0.4em; color: #7f7f7f; }
.chroma .ln { white-space: pre; -webkit-user-select: none; user-select: none; margin-right: 0.4em; padding: 0 0.4em 0 0.4em; color: #7f7f7f; }
.chroma .line { display: flex; }
.chroma .k { color: #cf222e; }
.chroma .kc { color: #cf222e; }
.chroma .kd { color: #cf222e; }
.chroma .kn { color: #cf222e; }
.chroma .kp { color: #cf222e; }
.chroma .kr { color: #cf222e; }
.chroma .kt { color: #cf222e; }
.chroma .na { color: #1f2328; }
.chroma .nc { color: #1f2328; }
.chroma .no { color: #0550ae; }
.chroma .nd { color: #0550ae; }
.chroma .ni { color: #6639ba; }
.chroma .nl { color: #990000; font-weight: bold; }
.chroma .nn { color: #24292e; }
.chroma .nx { color: #1f2328; }
.chroma .nt { color: #0550ae; }
.chroma .nb { color: #6639ba; }
.chroma .bp { color: #6a737d; }
.chroma .nv { color: #953800; }
.chroma .vc { color: #953800; }
.chroma .vg { color: #953800; }
.chroma .vi { color: #953800; }
.chroma .vm { color: #953800; }
.chroma .nf { color: #6639ba; }
.chroma .fm { color: #6639ba; }
.chroma .s { color: #0a3069; }
.chroma .sa { color: #0a3069; }
.chroma .sb { color: #0a3069; }
.chroma .sc { color: #0a3069; }
.chroma .dl { color: #0a3069; }
.chroma .sd { color: #0a3069; }
.chroma .s2 { color: #0a3069; }
.chroma .se { color: #0a3069; }
.chroma .sh { color: #0a3069; }
.chroma .si { color: #0a3069; }
.chroma .sx { color: #0a3069; }
.chroma .sr { color: #0a3069; }
.chroma .s1 { color: #0a3069; }
.chroma .ss { color: #032f62; }
.chroma .m { color: #0550ae; }
.chroma .mb { color: #0550ae; }
.chroma .mf { color: #0550ae; }
.chroma .mh { color: #0550ae; }
.chroma .mi { color: #0550ae; }
.chroma .il { color: #0550ae; }
.chroma .mo { color: #0550ae; }
.chroma .o { color: #0550ae; }
.chroma .ow { color: #0550ae; }
.chroma .or { color: #0550ae; }
.chroma .p { color: #1f2328; }
.chroma .c { color: #57606a; }
.chroma .ch { color: #57606a; }
.chroma .cm { color: #57606a; }
.chroma .c1 { color: #57606a; }
.chroma .cs { color: #57606a; }
.chroma .cp { color: #57606a; }
.chroma .cpf { color: #57606a; }
.chroma .gd { color: #82071e; background-color: #ffebe9; }
.chroma .ge { color: #1f2328; }
.chroma .gi { color: #116329; background-color: #dafbe1; }
.chroma .go { color: #1f2328; }
.chroma .gl { text-decoration: underline; }
.chroma .w { color: #ffffff; }
/* 代码高亮：暗色 */
html.dark .chroma { color: #e6edf3; background-color: #0d1117; -webkit-text-size-adjust: none; }
html.dark .chroma .err { color: #f85149; background-color: transparent; }
html.dark .chroma .lnlinks { outline: none; text-decoration: none; color: inherit; }
html.dark .chroma .lntd { vertical-align: top; padding: 0; margin: 0; border: 0; }
html.dark .chroma .lntable { border-spacing: 0; padding: 0; margin: 0; border: 0; }
html.dark .chroma .hl { background-color: #6e7681; }
html.dark .chroma .lnt { white-space: pre; -webkit-user-select: none; user-select: none; margin-right: 0.4em; padding: 0 0.4em 0 0.4em; color: #737679; }
html.dark .chroma .ln { white-space: pre; -webkit-user-select: none; user-select: none; margin-right: 0.4em; padding: 0 0.4em 0 0.4em; color: #6e7681; }
html.dark .chroma .line { display: flex; }
html.dark .chroma .k { color: #ff7b72; }
html.dark .chroma .kc { color: #79c0ff; }
html.dark .chroma .kd { color: #ff7b72; }
html.dark .chroma .kn { color: #ff7b72; }
html.dark .chroma .kp { color: #79c0ff; }
html.dark .chroma .kr { color: #ff7b72; }
html.dark .chroma .kt { color: #ff7b72; }
html.dark .chroma .nc { color: #f0883e; font-weight: bold; }
html.dark .chroma .no { color: #79c0ff; font-weight: bold; }
html.dark .chroma .nd { color: #d2a8ff; font-weight: bold; }
html.dark .chroma .ni { color: #ffa657; }
html.dark .chroma .ne { color: #f0883e; font-weight: bold; }
html.dark .chroma .nl { color: #79c0ff; font-weight: bold; }
html.dark .chroma .nn { color: #ff7b72; }
html.dark .chroma .py { color: #79c0ff; }
html.dark .chroma .nt { color: #7ee787; }
html.dark .chroma .nv { color: #79c0ff; }
html.dark .chroma .vc { color: #79c0ff; }
html.dark .chroma .vg { color: #79c0ff; }
html.dark .chroma .vi { color: #79c0ff; }
html.dark .chroma .vm { color: #79c0ff; }
html.dark .chroma .nf { color: #d2a8ff; font-weight: bold; }
html.dark .chroma .fm { color: #d2a8ff; font-weight: bold; }
html.dark .chroma .l { color: #a5d6ff; }
html.dark .chroma .ld { color: #79c0ff; }
html.dark .chroma .s { color: #a5d6ff; }
html.dark .chroma .sa { color: #79c0ff; }
html.dark .chroma .sb { color: #a5d6ff; }
html.dark .chroma .sc { color: #a5d6ff; }
html.dark .chroma .dl { color: #79c0ff; }
html.dark .chroma .sd { color: #a5d6ff; }
html.dark .chroma .s2 { color: #a5d6ff; }
html.dark .chroma .se { color: #79c0ff; }
html.dark .chroma .sh { color: #79c0ff; }
html.dark .chroma .si { color: #a5d6ff; }
html.dark .chroma .sx { color: #a5d6ff; }
html.dark .chroma .sr { color: #79c0ff; }
html.dark .chroma .s1 { color: #a5d6ff; }
html.dark .chroma .ss { color: #a5d6ff; }
html.dark .chroma .m { color: #a5d6ff; }
html.dark .chroma .mb { color: #a5d6ff; }
html.dark .chroma .mf { color: #a5d6ff; }
html.dark .chroma .mh { color: #a5d6ff; }
html.dark .chroma .mi { color: #a5d6ff; }
html.dark .chroma .il { color: #a5d6ff; }
html.dark .chroma .mo { color: #a5d6ff; }
html.dark .chroma .o { color: #ff7b72; font-weight: bold; }
html.dark .chroma .ow { color: #ff7b72; font-weight: bold; }
html.dark .chroma .or { color: #ff7b72; font-weight: bold; }
html.dark .chroma .c { color: #8b949e; font-style: italic; }
html.dark .chroma .ch { color: #8b949e; font-style: italic; }
html.dark .chroma .cm { color: #8b949e; font-style: italic; }
html.dark .chroma .c1 { color: #8b949e; font-style: italic; }
html.dark .chroma .cs { color: #8b949e; font-weight: bold; font-style: italic; }
html.dark .chroma .cp { color: #8b949e; font-weight: bold; font-style: italic; }
html.dark .chroma .cpf { color: #8b949e; font-weight: bold; font-style: italic; }
html.dark .chroma .gd { color: #ffa198; background-color: #490202; }
html.dark .chroma .ge { font-style: italic; color: inherit; }
html.dark .chroma .gr { color: #ffa198; }
html.dark .chroma .gh { color: #79c0ff; font-weight: bold; }
html.dark .chroma .gi { color: #56d364; background-color: #0f5323; }
html.dark .chroma .go { color: #8b949e; }
html.dark .chroma .gp { color: #8b949e; }
html.dark .chroma .gs { font-weight: bold; }
html.dark .chroma .gu { color: #79c0ff; }
html.dark .chroma .gt { color: #ff7b72; }
html.dark .chroma .gl { text-decoration: underline; }
html.dark .chroma .w { color: #6e7681; }
html.dark .chroma .na { color: inherit; }
html.dark .chroma .nx { color: inherit; }
html.dark .chroma .nb { color: inherit; }
html.dark .chroma .bp { color: inherit; }
html.dark .chroma .p { color: inherit; }
@media (prefers-color-scheme: dark) {
html:not(.light) .chroma { color: #e6edf3; background-color: #0d1117; -webkit-text-size-adjust: none; }
html:not(.light) .chroma .err { color: #f85149; background-color: transparent; }
html:not(.light) .chroma .lnlinks { outline: none; text-decoration: none; color: inherit; }
html:not(.light) .chroma .lntd { vertical-align: top; padding: 0; margin: 0; border: 0; }
html:not(.light) .chroma .lntable { border-spacing: 0; padding: 0; margin: 0; border: 0; }
html:not(.light) .chroma .hl { background-color: #6e7681; }
html:not(.light) .chroma .lnt { white-space: pre; -webkit-user-select: none; user-select: none; margin-right: 0.4em; padding: 0 0.4em 0 0.4em; color: #737679; }
html:not(.light) .chroma .ln { white-space: pre; -webkit-user-select: none; user-select: none; margin-right: 0.4em; padding: 0 0.4em 0 0.4em; color: #6e7681; }
html:not(.light) .chroma .line { display: flex; }
html:not(.light) .chroma .k { color: #ff7b72; }
html:not(.light) .chroma .kc { color: #79c0ff; }
html:not(.light) .chroma .kd { color: #ff7b72; }
html:not(.light) .chroma .kn { color: #ff7b72; }
html:not(.light) .chroma .kp { color: #79c0ff; }
html:not(.light) .chroma .kr { color: #ff7b72; }
html:not(.light) .chroma .kt { color: #ff7b72; }
html:not(.light) .chroma .nc { color: #f0883e; font-weight: bold; }
html:not(.light) .chroma .no { color: #79c0ff; font-weight: bold; }
html:not(.light) .chroma .nd { color: #d2a8ff; font-weight: bold; }
html:not(.light) .chroma .ni { color: #ffa657; }
html:not(.light) .chroma .ne { color: #f0883e; font-weight: bold; }
html:not(.light) .chroma .nl { color: #79c0ff; font-weight: bold; }
html:not(.light) .chroma .nn { color: #ff7b72; }
html:not(.light) .chroma .py { color: #79c0ff; }
html:not(.light) .chroma .nt { color: #7ee787; }
html:not(.light) .chroma .nv { color: #79c0ff; }
html:not(.light) .chroma .vc { color: #79c0ff; }
html:not(.light) .chroma .vg { color: #79c0ff; }
html:not(.light) .chroma .vi { color: #79c0ff; }
html:not(.light) .chroma .vm { color: #79c0ff; }
html:not(.light) .chroma .nf { color: #d2a8ff; font-weight: bold; }
html:not(.light) .chroma .fm { color: #d2a8ff; font-weight: bold; }
html:not(.light) .chroma .l { color: #a5d6ff; }
html:not(.light) .chroma .ld { color: #79c0ff; }
html:not(.light) .chroma .s { color: #a5d6ff; }
html:not(.light) .chroma .sa { color: #79c0ff; }
html:not(.light) .chroma .sb { color: #a5d6ff; }
html:not(.light) .chroma .sc { color: #a5d6ff; }
html:not(.light) .chroma .dl { color: #79c0ff; }
html:not(.light) .chroma .sd { color: #a5d6ff; }
html:not(.light) .chroma .s2 { color: #a5d6ff; }
html:not(.light) .chroma .se { color: #79c0ff; }
html:not(.light) .chroma .sh { color: #79c0ff; }
html:not(.light) .chroma .si { color: #a5d6ff; }
html:not(.light) .chroma .sx { color: #a5d6ff; }
html:not(.light) .chroma .sr { color: #79c0ff; }
html:not(.light) .chroma .s1 { color: #a5d6ff; }
html:not(.light) .chroma .ss { color: #a5d6ff; }
html:not(.light) .chroma .m { color: #a5d6ff; }
html:not(.light) .chroma .mb { color: #a5d6ff; }
html:not(.light) .chroma .mf { color: #a5d6ff; }
html:not(.light) .chroma .mh { color: #a5d6ff; }
html:not(.light) .chroma .mi { color: #a5d6ff; }
html:not(.light) .chroma .il { color: #a5d6ff; }
html:not(.light) .chroma .mo { color: #a5d6ff; }
html:not(.light) .chroma .o { color: #ff7b72; font-weight: bold; }
html:not(.light) .chroma .ow { color: #ff7b72; font-weight: bold; }
html:not(.light) .chroma .or { color: #ff7b72; font-weight: bold; }
html:not(.light) .chroma .c { color: #8b949e; font-style: italic; }
html:not(.light) .chroma .ch { color: #8b949e; font-style: italic; }
html:not(.light) .chroma .cm { color: #8b949e; font-style: italic; }
html:not(.light) .chroma .c1 { color: #8b949e; font-style: italic; }
html:not(.light) .chroma .cs { color: #8b949e; font-weight: bold; font-style: italic; }
html:not(.light) .chroma .cp { color: #8b949e; font-weight: bold; font-style: italic; }
html:not(.light) .chroma .cpf { color: #8b949e; font-weight: bold; font-style: italic; }
html:not(.light) .chroma .gd { color: #ffa198; background-color: #490202; }
html:not(.light) .chroma .ge { font-style: italic; color: inherit; }
html:not(.light) .chroma .gr { color: #ffa198; }
html:not(.light) .chroma .gh { color: #79c0ff; font-weight: bold; }
html:not(.light) .chroma .gi { color: #56d364; background-color: #0f5323; }
html:not(.light) .chroma .go { color: #8b949e; }
html:not(.light) .chroma .gp { color: #8b949e; }
html:not(.light) .chroma .gs { font-weight: bold; }
html:not(.light) .chroma .gu { color: #79c0ff; }
html:not(.light) .chroma .gt { color: #ff7b72; }
html:not(.light) .chroma .gl { text-decoration: underline; }
html:not(.light) .chroma .w { color: #6e7681; }
html:not(.light) .chroma .na { color: inherit; }
html:not(.light) .chroma .nx { color: inherit; }
html:not(.light) .chroma .nb { color: inherit; }
html:not(.light) .chroma .bp { color: inherit; }
html:not(.light) .chroma .p { color: inherit; }
}


/* 色板：中性冷灰为底，主题色只用于当前项、链接、焦点与主按钮 */
:root {
  --brand: #2563eb;
  --brand-text: var(--brand);
  --brand-hover: var(--brand);
  --brand-soft: rgba(37, 99, 235, 0.1);
  --brand-line: rgba(37, 99, 235, 0.35);
  --bg: #ffffff;
  --bg-alt: #f8f9fa;
  --bg-soft: #f4f5f7;
  --bg-elv: #ffffff;
  --text-1: #1a1d21;
  --text-2: #565d67;
  --text-3: #8a9099;
  --divider: #e8eaed;
  --border: #d5d9de;
  --default-soft: rgba(110, 118, 131, 0.1);
  --default-hover: rgba(110, 118, 131, 0.18);
  --code-bg: #f6f7f9;
  --code-inline-bg: rgba(110, 118, 131, 0.12);
  --code-hl: rgba(110, 118, 131, 0.14);
  --info-text: #2f6fdb;
  --info-soft: rgba(47, 111, 219, 0.07);
  --info-line: rgba(47, 111, 219, 0.28);
  --warning-text: #9a5b06;
  --warning-soft: rgba(234, 160, 8, 0.09);
  --warning-line: rgba(234, 160, 8, 0.38);
  --danger-text: #c0262d;
  --danger-soft: rgba(229, 57, 53, 0.07);
  --danger-line: rgba(229, 57, 53, 0.32);
  --success-text: #16794c;
  --success-soft: rgba(22, 163, 74, 0.1);
  --shadow: 0 16px 40px rgba(15, 23, 42, 0.12), 0 2px 6px rgba(15, 23, 42, 0.06);
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.05);
  --backdrop: rgba(15, 17, 21, 0.45);
  --header-h: 60px;
  --layout-w: 1760px;
  --sidebar-w: 280px;
  --aside-w: 240px;
  --content-w: 960px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", "JetBrains Mono", Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  color-scheme: light;
}
html.dark {
  --brand-text: #8db3ff;
  --brand-soft: rgba(37, 99, 235, 0.18);
  --brand-line: rgba(37, 99, 235, 0.5);
  --bg: #0f1115;
  --bg-alt: #13161b;
  --bg-soft: #181b21;
  --bg-elv: #171a20;
  --text-1: #e8eaed;
  --text-2: #a2a8b1;
  --text-3: #6f7680;
  --divider: #23272e;
  --border: #323843;
  --default-soft: rgba(148, 158, 172, 0.1);
  --default-hover: rgba(148, 158, 172, 0.18);
  --code-bg: #14171c;
  --code-inline-bg: rgba(148, 158, 172, 0.14);
  --code-hl: rgba(148, 158, 172, 0.14);
  --info-text: #7fb0ff;
  --info-soft: rgba(80, 140, 255, 0.1);
  --info-line: rgba(80, 140, 255, 0.32);
  --warning-text: #f4bd5c;
  --warning-soft: rgba(234, 160, 8, 0.1);
  --warning-line: rgba(234, 160, 8, 0.36);
  --danger-text: #ff8a8f;
  --danger-soft: rgba(244, 63, 94, 0.1);
  --danger-line: rgba(244, 63, 94, 0.36);
  --success-text: #4ade9a;
  --success-soft: rgba(16, 185, 129, 0.14);
  --shadow: 0 16px 40px rgba(0, 0, 0, 0.5), 0 2px 6px rgba(0, 0, 0, 0.35);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --backdrop: rgba(0, 0, 0, 0.6);
  color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  html:not(.light) {
    --brand-text: #8db3ff;
    --brand-soft: rgba(37, 99, 235, 0.18);
    --brand-line: rgba(37, 99, 235, 0.5);
    --bg: #0f1115;
    --bg-alt: #13161b;
    --bg-soft: #181b21;
    --bg-elv: #171a20;
    --text-1: #e8eaed;
    --text-2: #a2a8b1;
    --text-3: #6f7680;
    --divider: #23272e;
    --border: #323843;
    --default-soft: rgba(148, 158, 172, 0.1);
    --default-hover: rgba(148, 158, 172, 0.18);
    --code-bg: #14171c;
    --code-inline-bg: rgba(148, 158, 172, 0.14);
    --code-hl: rgba(148, 158, 172, 0.14);
    --info-text: #7fb0ff;
    --info-soft: rgba(80, 140, 255, 0.1);
    --info-line: rgba(80, 140, 255, 0.32);
    --warning-text: #f4bd5c;
    --warning-soft: rgba(234, 160, 8, 0.1);
    --warning-line: rgba(234, 160, 8, 0.36);
    --danger-text: #ff8a8f;
    --danger-soft: rgba(244, 63, 94, 0.1);
    --danger-line: rgba(244, 63, 94, 0.36);
    --success-text: #4ade9a;
    --success-soft: rgba(16, 185, 129, 0.14);
    --shadow: 0 16px 40px rgba(0, 0, 0, 0.5), 0 2px 6px rgba(0, 0, 0, 0.35);
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
    --backdrop: rgba(0, 0, 0, 0.6);
    color-scheme: dark;
  }
}
/* 支持 color-mix 的浏览器：主题色的浅底、描边与悬停色按产品主题色计算 */
@supports (color: color-mix(in srgb, red, blue)) {
  :root {
    --brand-hover: color-mix(in srgb, var(--brand) 86%, #000);
    --brand-soft: color-mix(in srgb, var(--brand) 9%, transparent);
    --brand-line: color-mix(in srgb, var(--brand) 32%, transparent);
    --code-hl: color-mix(in srgb, var(--brand) 9%, transparent);
  }
  html.dark {
    --brand-text: color-mix(in srgb, var(--brand) 62%, #fff);
    --brand-hover: color-mix(in srgb, var(--brand) 82%, #fff);
    --brand-soft: color-mix(in srgb, var(--brand) 16%, transparent);
    --brand-line: color-mix(in srgb, var(--brand) 45%, transparent);
    --code-hl: color-mix(in srgb, var(--brand) 16%, transparent);
  }
  @media (prefers-color-scheme: dark) {
    html:not(.light) {
      --brand-text: color-mix(in srgb, var(--brand) 62%, #fff);
      --brand-hover: color-mix(in srgb, var(--brand) 82%, #fff);
      --brand-soft: color-mix(in srgb, var(--brand) 16%, transparent);
      --brand-line: color-mix(in srgb, var(--brand) 45%, transparent);
      --code-hl: color-mix(in srgb, var(--brand) 16%, transparent);
    }
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--header-h) + 20px); }
body {
  margin: 0;
  min-height: 100vh;
  display: flex; flex-direction: column;
  background: var(--bg);
  color: var(--text-1);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; }
img, svg, video { vertical-align: middle; }
:focus-visible { outline: 2px solid var(--brand-text); outline-offset: 2px; }
::selection { background: var(--brand-soft); }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip-link {
  position: absolute; top: -100px; left: 8px; z-index: 100;
  padding: 8px 16px; border-radius: 8px;
  background: var(--bg-elv); color: var(--brand-text); box-shadow: var(--shadow);
  font-size: 14px; font-weight: 600;
}
.skip-link:focus { top: 8px; }

/* 顶栏：品牌 | 居中搜索 | 链接与主题 */
.site-header {
  position: sticky; top: 0; z-index: 30;
  height: var(--header-h);
  background: var(--bg);
  border-bottom: 1px solid var(--divider);
}
@supports ((-webkit-backdrop-filter: blur(1px)) or (backdrop-filter: blur(1px))) and (color: color-mix(in srgb, red, blue)) {
  .site-header {
    background: color-mix(in srgb, var(--bg) 84%, transparent);
    -webkit-backdrop-filter: saturate(1.8) blur(14px); backdrop-filter: saturate(1.8) blur(14px);
  }
}
.header-inner {
  display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: 16px;
  height: 100%; max-width: var(--layout-w); margin: 0 auto; padding: 0 24px;
}
.header-brand { display: flex; align-items: center; gap: 4px; min-width: 0; }
.site-title { display: inline-flex; align-items: center; gap: 10px; min-width: 0; font-size: 15px; font-weight: 650; letter-spacing: -0.01em; color: var(--text-1); }
.site-title .logo { flex: none; display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 8px; background: var(--brand); color: #fff; box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.12); }
.site-title .logo svg { width: 17px; height: 17px; }
.site-title .site-icon { flex: none; width: 30px; height: 30px; border-radius: 8px; object-fit: contain; }
.site-title .site-logo { display: block; height: 30px; width: auto; max-width: 220px; object-fit: contain; object-position: left center; }
.site-title .name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.header-search { display: flex; justify-content: center; min-width: 0; }
.header-right { display: flex; align-items: center; justify-content: flex-end; gap: 4px; min-width: 0; }
.header-nav { display: flex; align-items: center; min-width: 0; }
.header-nav a { display: inline-flex; align-items: center; gap: 4px; padding: 0 10px; line-height: var(--header-h); font-size: 14px; font-weight: 500; color: var(--text-2); white-space: nowrap; transition: color 0.15s; }
.header-nav a:hover { color: var(--text-1); }
.nav-menu { position: relative; }
.nav-menu > summary {
  display: inline-flex; align-items: center; gap: 6px; padding: 0 10px;
  line-height: var(--header-h); font-size: 14px; font-weight: 500; color: var(--text-2);
  white-space: nowrap; list-style: none; cursor: pointer; user-select: none; transition: color 0.15s;
}
.nav-menu > summary::-webkit-details-marker { display: none; }
.nav-menu > summary::after {
  content: ""; width: 5px; height: 5px; margin-top: -3px;
  border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor;
  transform: rotate(45deg); transition: transform 0.15s;
}
.nav-menu[open] > summary::after { margin-top: 3px; transform: rotate(225deg); }
.nav-menu > summary:hover, .nav-menu[open] > summary { color: var(--text-1); }
.nav-menu-list {
  position: absolute; top: calc(100% - 8px); right: 0; z-index: 35;
  min-width: 180px; padding: 6px;
  border: 1px solid var(--divider); border-radius: 12px;
  background: var(--bg-elv); box-shadow: var(--shadow);
}
.header-nav .nav-menu-list a { display: flex; padding: 0 10px; border-radius: 8px; line-height: 34px; color: var(--text-1); }
.header-nav .nav-menu-list a:hover { background: var(--default-soft); }
/* 可悬停的设备：悬停即展开（支持 ::details-content 的浏览器；其余仍可点击展开） */
@media (hover: hover) and (pointer: fine) {
  .nav-menu:hover > summary { color: var(--text-1); }
  .nav-menu:hover::details-content { content-visibility: visible; }
}
.header-nav + .theme-toggle { margin-left: 4px; }
.icon-btn {
  display: inline-grid; place-items: center; flex: none;
  width: 36px; height: 36px; padding: 0;
  border: 0; border-radius: 8px;
  background: transparent; color: var(--text-2);
  cursor: pointer; transition: color 0.15s, background-color 0.15s;
}
.icon-btn:hover { color: var(--text-1); background: var(--default-soft); }
.icon-btn svg { width: 19px; height: 19px; }
.theme-toggle, .menu-btn { display: none; }
html.js .theme-toggle { display: inline-grid; }
.theme-toggle .icon-sun { display: none; }
html.dark .theme-toggle .icon-sun { display: block; }
html.dark .theme-toggle .icon-moon { display: none; }
.ext-icon { flex: none; width: 12px; height: 12px; color: var(--text-3); }

/* 搜索：顶栏中间的搜索框（脚本去掉 hidden 后显示）、搜索对话框与提示 */
.search-btn {
  display: inline-flex; align-items: center; gap: 10px;
  width: clamp(240px, 32vw, 420px); height: 38px; padding: 0 6px 0 12px;
  border: 1px solid var(--divider); border-radius: 10px;
  background: var(--bg-alt); color: var(--text-3); box-shadow: var(--shadow-sm);
  font-size: 14px; line-height: 1; cursor: pointer;
  transition: border-color 0.15s, color 0.15s, background-color 0.15s;
}
.search-btn[hidden] { display: none; }
.search-btn:hover { border-color: var(--border); color: var(--text-2); background: var(--bg); }
.search-btn svg { flex: none; width: 16px; height: 16px; }
.search-label { flex: 1; min-width: 0; text-align: left; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.search-kbd {
  padding: 0 6px; border: 1px solid var(--divider); border-radius: 6px;
  background: var(--bg); color: var(--text-3);
  font-family: var(--font); font-size: 12px; line-height: 22px; white-space: nowrap;
}
html.search-open { overflow: hidden; }
.search-dialog {
  width: min(680px, calc(100vw - 32px)); max-width: none; max-height: min(620px, calc(100vh - 120px));
  margin: 72px auto auto; padding: 0;
  border: 1px solid var(--divider); border-radius: 14px;
  background: var(--bg-elv); color: var(--text-1); box-shadow: var(--shadow);
  overflow: hidden;
}
.search-dialog[open] { display: flex; flex-direction: column; }
.search-dialog::backdrop { background: var(--backdrop); }
.search-bar { display: flex; flex: none; align-items: center; gap: 10px; padding: 10px 12px 10px 16px; border-bottom: 1px solid var(--divider); }
.search-bar svg { flex: none; width: 20px; height: 20px; color: var(--text-3); }
.search-input { flex: 1; min-width: 0; height: 40px; padding: 0; border: 0; outline: none; background: transparent; color: var(--text-1); font: inherit; font-size: 16px; }
.search-input::placeholder { color: var(--text-3); }
.search-close { flex: none; padding: 0 8px; border: 1px solid var(--divider); border-radius: 6px; background: transparent; color: var(--text-2); font-size: 12px; line-height: 22px; cursor: pointer; }
.search-close:hover { color: var(--text-1); border-color: var(--border); }
.search-body { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 8px; }
.search-status { margin: 0; padding: 36px 16px; font-size: 14px; line-height: 22px; text-align: center; color: var(--text-2); }
.search-status[hidden] { display: none; }
.search-list, .search-group-list { margin: 0; padding: 0; list-style: none; }
.search-group + .search-group { margin-top: 10px; }
.search-group-title { padding: 6px 12px 4px; font-size: 12px; line-height: 18px; font-weight: 600; color: var(--text-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.search-hit { display: block; padding: 9px 12px; border-radius: 10px; color: var(--text-1); cursor: pointer; }
.search-option[aria-selected="true"] > .search-hit { background: var(--brand-soft); }
.search-hit-title { display: block; font-size: 14px; line-height: 22px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.search-hash { margin-right: 4px; font-weight: 500; color: var(--brand-text); }
.search-hit-text {
  display: -webkit-box; margin-top: 2px; overflow: hidden;
  -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  font-size: 13px; line-height: 20px; color: var(--text-2); overflow-wrap: anywhere;
}
.search-hit mark { background: transparent; color: var(--brand-text); font-weight: 600; }
.search-foot { display: flex; flex: none; flex-wrap: wrap; gap: 4px 16px; padding: 9px 16px; border-top: 1px solid var(--divider); background: var(--bg-alt); font-size: 12px; line-height: 20px; color: var(--text-3); }
.search-foot kbd {
  display: inline-block; min-width: 20px; margin-right: 4px; padding: 0 4px;
  border: 1px solid var(--divider); border-radius: 4px; background: var(--bg);
  font-family: var(--font); font-size: 11px; line-height: 18px; text-align: center;
}
.search-toast {
  position: fixed; top: calc(var(--header-h) + 12px); left: 50%; z-index: 60; transform: translateX(-50%);
  max-width: calc(100vw - 32px); padding: 8px 16px; border-radius: 10px;
  background: var(--text-1); color: var(--bg); box-shadow: var(--shadow);
  font-size: 13px; line-height: 20px; pointer-events: none;
}
.search-toast[hidden] { display: none; }
@media (hover: none) {
  .search-kbd, .search-foot { display: none; }
}

/* 三栏：左导航 | 正文 | 右目录；没有目录的页面不留目录栏，正文加宽到原来目录的位置（左边缘与有目录的页面对齐） */
.layout { flex: 1 0 auto; display: grid; grid-template-columns: var(--sidebar-w) minmax(0, 1fr) var(--aside-w); width: 100%; max-width: var(--layout-w); margin: 0 auto; }
.layout.is-home, .layout.is-page { display: block; max-width: none; }
.sidebar {
  position: sticky; top: var(--header-h); align-self: start;
  height: calc(100vh - var(--header-h));
  overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: var(--divider) transparent;
  padding: 28px 16px 96px 20px;
}
.drawer-head, .drawer-links, .backdrop, .local-nav { display: none; }
.content { min-width: 0; padding: 40px 56px 96px; }
.content-inner { max-width: var(--content-w); margin: 0 auto; }
.no-toc .content-inner { max-width: calc(var(--content-w) + var(--aside-w)); }
.aside {
  position: sticky; top: var(--header-h); align-self: start;
  max-height: calc(100vh - var(--header-h));
  overflow-y: auto; scrollbar-width: thin;
  padding: 44px 24px 32px 0;
}

/* 左侧导航：分组标题 + 圆角条目，当前页以主题色浅底标出 */
.nav-tree, .nav-items, .toc-list { margin: 0; padding: 0; list-style: none; }
.nav-tree > li + li { margin-top: 2px; }
.nav-tree > .nav-group:not(:first-child) { margin-top: 24px; }
.nav-tree > .nav-group + .nav-single { margin-top: 20px; }
.nav-link, .nav-text {
  display: flex; align-items: center; gap: 6px;
  padding: 6px 10px; border-radius: 8px;
  font-size: 14px; line-height: 20px; color: var(--text-2);
  transition: color 0.15s, background-color 0.15s;
}
.nav-label { min-width: 0; overflow-wrap: anywhere; }
.nav-link:hover { color: var(--text-1); background: var(--default-soft); }
.nav-link.active { color: var(--brand-text); background: var(--brand-soft); font-weight: 600; }
.nav-group-title { margin-bottom: 4px; }
.nav-group-title .nav-link, .nav-group-title .nav-text { padding-top: 4px; padding-bottom: 4px; font-size: 13px; font-weight: 650; color: var(--text-1); }
.nav-group-title .nav-link.active { color: var(--brand-text); }
.nav-single > .nav-link, .nav-single > .nav-text { font-weight: 500; color: var(--text-1); }
.nav-single > .nav-link.active { color: var(--brand-text); font-weight: 600; }
.nav-items { display: grid; gap: 1px; }
.nav-items.nested { margin: 2px 0 4px 18px; padding-left: 8px; border-left: 1px solid var(--divider); }
.nav-items.nested .nav-link { padding-top: 5px; padding-bottom: 5px; }
.nav-collapse > summary { display: flex; align-items: center; list-style: none; cursor: pointer; border-radius: 8px; }
.nav-collapse > summary::-webkit-details-marker { display: none; }
.nav-collapse > summary > .nav-link, .nav-collapse > summary > .nav-text { flex: 1; min-width: 0; }
.nav-collapse > summary::after {
  content: ""; flex: none; width: 6px; height: 6px; margin: 0 12px 0 4px;
  border-right: 1.5px solid var(--text-3); border-bottom: 1.5px solid var(--text-3);
  transform: rotate(-45deg); transition: transform 0.15s;
}
.nav-collapse[open] > summary::after { transform: rotate(45deg); }
.nav-collapse > summary:hover::after { border-color: var(--text-1); }

/* 右侧本页目录 */
.toc-title { margin: 0 0 8px; font-size: 13px; line-height: 20px; font-weight: 650; color: var(--text-1); }
.toc-list { display: grid; gap: 1px; }
.toc-link {
  display: block; padding: 4px 0 4px 12px;
  border-left: 1px solid var(--divider);
  font-size: 13px; line-height: 20px; color: var(--text-2);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  transition: color 0.15s, border-color 0.15s;
}
.toc-l3 .toc-link { padding-left: 24px; }
.toc-link:hover { color: var(--text-1); }
.toc-link.active { color: var(--brand-text); border-left: 2px solid var(--brand-text); padding-left: 11px; font-weight: 500; }
.toc-l3 .toc-link.active { padding-left: 23px; }

/* 面包屑、标题与描述 */
.breadcrumbs ol { display: flex; flex-wrap: wrap; align-items: center; margin: 0 0 10px; padding: 0; list-style: none; font-size: 13px; line-height: 20px; font-weight: 500; color: var(--text-3); }
.breadcrumbs li + li::before { content: ""; display: inline-block; width: 5px; height: 5px; margin: 0 10px 1px 6px; border-right: 1.5px solid var(--text-3); border-top: 1.5px solid var(--text-3); transform: rotate(45deg); }
.breadcrumbs a { color: var(--brand-text); transition: opacity 0.15s; }
.breadcrumbs a:hover { opacity: 0.8; }
.breadcrumbs [aria-current] { color: var(--text-2); }
.doc-head { margin-bottom: 32px; }
.doc-title { margin: 0; font-size: 32px; line-height: 1.25; font-weight: 700; letter-spacing: -0.025em; color: var(--text-1); overflow-wrap: anywhere; }
.doc-desc { margin: 10px 0 0; font-size: 17px; line-height: 1.65; color: var(--text-2); }

/* 正文排版 */
.prose { font-size: 16px; line-height: 1.8; overflow-wrap: break-word; color: var(--text-1); }
.prose > :first-child { margin-top: 0; }
.prose h1, .prose h2, .prose h3, .prose h4, .prose h5, .prose h6 { position: relative; font-weight: 650; color: var(--text-1); outline: none; scroll-margin-top: calc(var(--header-h) + 20px); }
.prose h1 { margin: 40px 0 16px; font-size: 30px; line-height: 1.3; letter-spacing: -0.025em; font-weight: 700; }
.prose h2 { margin: 48px 0 14px; font-size: 23px; line-height: 1.35; letter-spacing: -0.02em; }
.prose h3 { margin: 32px 0 10px; font-size: 19px; line-height: 1.4; letter-spacing: -0.01em; }
.prose h4 { margin: 24px 0 8px; font-size: 17px; line-height: 1.5; }
.prose h5, .prose h6 { margin: 20px 0 8px; font-size: 15px; line-height: 1.5; color: var(--text-2); }
.prose .header-anchor {
  position: absolute; top: 0; left: 0; margin-left: -1em; padding-right: 0.25em;
  font-weight: 500; color: var(--text-3); text-decoration: none;
  user-select: none; opacity: 0; transition: opacity 0.15s, color 0.15s;
}
.prose .header-anchor:hover { color: var(--brand-text); }
.prose h1:hover .header-anchor, .prose h2:hover .header-anchor, .prose h3:hover .header-anchor,
.prose h4:hover .header-anchor, .prose h5:hover .header-anchor, .prose h6:hover .header-anchor, .prose .header-anchor:focus-visible { opacity: 1; }
.prose p, .prose summary { margin: 14px 0; }
.prose a { color: var(--brand-text); font-weight: 500; text-decoration: underline; text-decoration-color: var(--brand-line); text-decoration-thickness: 1px; text-underline-offset: 3px; transition: text-decoration-color 0.15s; }
.prose a:hover { text-decoration-color: currentColor; }
.prose a.external::after { content: "\2197"; margin-left: 2px; font-size: 0.8em; text-decoration: none; display: inline-block; }
.prose strong { font-weight: 650; color: var(--text-1); }
.prose blockquote { margin: 18px 0; padding: 2px 0 2px 16px; border-left: 3px solid var(--divider); color: var(--text-2); }
.prose blockquote > p { margin: 0; }
.prose blockquote > p + p { margin-top: 8px; }
.prose ul, .prose ol { margin: 14px 0; padding-left: 1.4em; }
.prose ul { list-style: disc; }
.prose ol { list-style: decimal; }
.prose li::marker { color: var(--text-3); }
.prose ol > li::marker { font-weight: 600; }
.prose li + li { margin-top: 6px; }
.prose li > ul, .prose li > ol { margin: 6px 0 0; }
.prose li > p { margin: 6px 0; }
.prose li:has(> input[type="checkbox"]:first-child) { list-style: none; }
.prose li > input[type="checkbox"]:first-child { margin: 0 0.45em 0 -1.4em; vertical-align: middle; accent-color: var(--brand); }
.prose hr { margin: 32px 0; border: none; border-top: 1px solid var(--divider); }
.prose img, .prose video { max-width: 100%; height: auto; border-radius: 10px; }
.prose p > img:only-child { display: block; margin: 20px 0; border: 1px solid var(--divider); }
.prose iframe { max-width: 100%; }
.prose table { display: block; width: max-content; max-width: 100%; margin: 20px 0; border: 1px solid var(--divider); border-radius: 10px; border-collapse: separate; border-spacing: 0; overflow-x: auto; }
.prose .table-wrap { margin: 20px 0; border: 1px solid var(--divider); border-radius: 10px; overflow-x: auto; }
.prose .table-wrap > table { display: table; width: 100%; min-width: 560px; max-width: none; margin: 0; border: 0; border-radius: 0; overflow: visible; }
.prose th, .prose td { padding: 9px 16px; font-size: 14px; line-height: 1.6; text-align: left; vertical-align: top; }
.prose th { font-weight: 600; color: var(--text-1); background: var(--bg-alt); border-bottom: 1px solid var(--divider); white-space: nowrap; }
.prose td { border-top: 1px solid var(--divider); }
.prose tr:first-child > td { border-top: 0; }
.prose th + th, .prose td + td { border-left: 1px solid var(--divider); }
.prose kbd { padding: 1px 6px; border: 1px solid var(--divider); border-bottom-width: 2px; border-radius: 5px; background: var(--bg-alt); font-family: var(--mono); font-size: 0.82em; }
.prose :not(pre) > code {
  padding: 2px 6px; border-radius: 6px;
  font-family: var(--mono); font-size: 0.86em;
  color: var(--text-1); background: var(--code-inline-bg);
}
.prose a > code { color: inherit; }
.prose h1 > code, .prose h2 > code, .prose h3 > code { font-size: 0.88em; }
.prose details:not(.custom-block) { margin: 16px 0; padding: 10px 16px; border: 1px solid var(--divider); border-radius: 10px; }
.prose details:not(.custom-block) > summary { margin: 0; font-weight: 600; cursor: pointer; }
.prose details:not(.custom-block)[open] > summary { margin-bottom: 8px; }

/* 代码块：描边圆角、标题栏、语言标记、行高亮、复制按钮 */
.prose .code-block { position: relative; margin: 18px 0; border: 1px solid var(--divider); border-radius: 12px; background: var(--code-bg); overflow: hidden; }
.prose .code-block[data-lang]::before {
  content: attr(data-lang); position: absolute; top: 6px; right: 12px; z-index: 2;
  font-family: var(--mono); font-size: 11px; font-weight: 500; color: var(--text-3);
  user-select: none; transition: opacity 0.15s;
}
.prose .code-block:has(> .code-title)::before { display: none; }
.prose .code-title { display: flex; align-items: center; gap: 8px; padding: 0 14px; border-bottom: 1px solid var(--divider); background: var(--bg-alt); font-family: var(--mono); font-size: 12.5px; line-height: 38px; color: var(--text-2); }
.prose .code-title::before { content: ""; flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--brand); opacity: 0.7; }
html .prose .chroma { margin: 0; padding: 16px 0; overflow-x: auto; background: transparent; }
.prose .chroma code {
  display: block; width: fit-content; min-width: 100%; padding: 0 18px;
  font-family: var(--mono); font-size: 13.5px; line-height: 1.7;
  color: inherit; background: transparent;
}
html .prose .chroma .hl { margin: 0 -18px; padding: 0 15px; border-left: 3px solid var(--brand); background: var(--code-hl); }
.prose .copy-btn {
  position: absolute; top: 8px; right: 8px; z-index: 3;
  padding: 3px 10px; border: 1px solid var(--divider); border-radius: 7px;
  background: var(--bg-elv); color: var(--text-2); box-shadow: var(--shadow-sm);
  font-size: 12px; line-height: 18px; cursor: pointer;
  opacity: 0; transition: opacity 0.15s, color 0.15s, border-color 0.15s;
}
.prose .code-title ~ .copy-btn { top: 46px; }
.prose .code-block:hover .copy-btn, .prose .copy-btn:focus-visible, .prose .copy-btn.copied { opacity: 1; }
.prose .code-block:hover::before { opacity: 0; }
.prose .copy-btn:hover { color: var(--text-1); border-color: var(--border); }
.prose .copy-btn.copied { color: var(--success-text); border-color: var(--success-text); }
@media (hover: none) {
  .prose .copy-btn { opacity: 1; }
  .prose .code-block[data-lang]::before { display: none; }
}

/* 代码分组：脚本生成标签页后（html.js 且 .is-tabbed）只显示选中的代码块、标题栏换成标签；无脚本时各代码块依次显示 */
.prose .code-group { margin: 18px 0; }
.prose .code-group > .code-block { margin: 10px 0; }
html.js .prose .code-group.is-tabbed { border: 1px solid var(--divider); border-radius: 12px; background: var(--code-bg); overflow: hidden; }
html.js .prose .code-group.is-tabbed > .code-block { margin: 0; border: 0; border-radius: 0; }
html.js .prose .code-group.is-tabbed > .code-block:not(.is-active) { display: none; }
html.js .prose .code-group.is-tabbed > .code-block > .code-title { display: none; }
html.js .prose .code-group.is-tabbed .code-title ~ .copy-btn { top: 8px; }
.prose .code-tabs {
  display: flex; gap: 2px; padding: 0 8px;
  border-bottom: 1px solid var(--divider); background: var(--bg-alt);
  overflow-x: auto; scrollbar-width: none;
}
.prose .code-tabs::-webkit-scrollbar { display: none; }
.prose .code-tab {
  position: relative; flex: none; padding: 0 12px;
  border: 0; background: transparent; color: var(--text-3);
  font-family: var(--mono); font-size: 12.5px; line-height: 38px; white-space: nowrap;
  cursor: pointer; transition: color 0.15s;
}
.prose .code-tab:hover, .prose .code-tab[aria-selected="true"] { color: var(--text-1); }
.prose .code-tab[aria-selected="true"]::after {
  content: ""; position: absolute; left: 10px; right: 10px; bottom: -1px;
  height: 2px; border-radius: 2px; background: var(--brand-text);
}
.prose .code-tab:focus-visible { outline-offset: -2px; }

/* Mermaid 流程图：无脚本、加载中或渲染失败时显示源码；渲染成功后隐藏源码，显示 SVG */
.prose pre.mermaid {
  margin: 18px 0; padding: 16px 20px; border: 1px solid var(--divider); border-radius: 12px;
  background: var(--code-bg); color: var(--text-2);
  font-family: var(--mono); font-size: 13px; line-height: 1.6;
  white-space: pre; overflow-x: auto;
}
.prose .mermaid-diagram { position: relative; margin: 18px 0; padding: 16px; border: 1px solid var(--divider); border-radius: 12px; overflow-x: auto; text-align: center; }
.prose .mermaid-diagram svg { max-width: 100%; height: auto; }
.prose .mermaid-error { margin: -8px 0 16px; font-size: 13px; line-height: 20px; color: var(--danger-text); }

/* 放大查看：流程图与正文图片点击后全屏查看，可缩放、拖动（脚本 initZoom） */
.prose .zoomable { cursor: zoom-in; }
.zoom-trigger {
  position: absolute; top: 8px; right: 8px; z-index: 2;
  display: inline-flex; align-items: center; gap: 4px; height: 28px; padding: 0 10px;
  border: 1px solid var(--divider); border-radius: 7px;
  background: var(--bg-elv); color: var(--text-2);
  font: inherit; font-size: 12px; line-height: 1; cursor: pointer;
  opacity: 0; transition: opacity 0.15s, color 0.15s, border-color 0.15s;
}
.zoom-trigger svg { width: 14px; height: 14px; }
.zoom-trigger:hover { color: var(--text-1); border-color: var(--border); }
.prose .mermaid-diagram:hover .zoom-trigger, .zoom-trigger:focus-visible { opacity: 1; }
@media (hover: none) { .zoom-trigger { opacity: 1; } }
html.zoom-open { overflow: hidden; }
.zoom-dialog {
  width: 100vw; height: 100%; max-width: none; max-height: none; margin: 0; padding: 0;
  border: 0; background: var(--bg); color: var(--text-1); overflow: hidden;
}
.zoom-dialog[open] { display: flex; flex-direction: column; }
.zoom-dialog::backdrop { background: var(--backdrop); }
.zoom-bar { display: flex; flex: none; align-items: center; gap: 2px; height: 52px; padding: 0 8px 0 16px; border-bottom: 1px solid var(--divider); }
.zoom-title { flex: 1; min-width: 0; margin-right: 8px; font-size: 14px; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.zoom-level {
  min-width: 56px; height: 32px; padding: 0 6px; border: 0; border-radius: 8px;
  background: transparent; color: var(--text-2); font: inherit; font-size: 13px; font-variant-numeric: tabular-nums; cursor: pointer;
}
.zoom-level:hover { color: var(--text-1); background: var(--default-soft); }
.zoom-stage { position: relative; flex: 1; min-height: 0; overflow: hidden; background: var(--bg-alt); touch-action: none; cursor: grab; user-select: none; -webkit-user-select: none; }
.zoom-stage.is-dragging { cursor: grabbing; }
.zoom-stage:focus { outline: none; }
.zoom-content { position: absolute; top: 0; left: 0; transform-origin: 0 0; }
.zoom-content > svg, .zoom-content > img { display: block; max-width: none !important; max-height: none !important; border-radius: 0; }
.zoom-content > img { background: var(--bg); }
.zoom-hint { position: absolute; bottom: 12px; left: 50%; transform: translateX(-50%); margin: 0; padding: 2px 10px; border-radius: 999px; background: var(--bg-elv); color: var(--text-3); font-size: 12px; white-space: nowrap; pointer-events: none; box-shadow: var(--shadow); }
@media (hover: none) { .zoom-hint { display: none; } }

/* 提示框：描边 + 浅底，标题前带圆形标记（tip ✓、info i、warning / danger !）；details 可折叠 */
.prose .custom-block {
  margin: 18px 0; padding: 12px 16px;
  border: 1px solid var(--divider); border-radius: 12px;
  font-size: 15px; line-height: 1.7; color: var(--text-1);
  background: var(--bg-alt);
}
.prose .custom-block p { margin: 6px 0; }
.prose .custom-block > :last-child { margin-bottom: 0; }
.prose .custom-block p.custom-block-title { display: flex; align-items: center; gap: 8px; margin: 0 0 4px; font-weight: 650; }
.prose .custom-block p.custom-block-title::before {
  content: "i"; flex: none; display: inline-grid; place-items: center;
  width: 18px; height: 18px; border-radius: 50%;
  background: currentColor; color: inherit;
  font-family: var(--font); font-size: 12px; font-weight: 700; line-height: 1;
}
.prose .custom-block.tip { border-color: var(--brand-line); background: var(--brand-soft); }
.prose .custom-block.tip .custom-block-title { color: var(--brand-text); }
.prose .custom-block.tip .custom-block-title::before { content: "\2713"; }
.prose .custom-block.info { border-color: var(--info-line); background: var(--info-soft); }
.prose .custom-block.info .custom-block-title { color: var(--info-text); }
.prose .custom-block.warning { border-color: var(--warning-line); background: var(--warning-soft); }
.prose .custom-block.warning .custom-block-title { color: var(--warning-text); }
.prose .custom-block.warning .custom-block-title::before, .prose .custom-block.danger .custom-block-title::before { content: "!"; }
.prose .custom-block.danger { border-color: var(--danger-line); background: var(--danger-soft); }
.prose .custom-block.danger .custom-block-title { color: var(--danger-text); }
/* 圆形标记里的字用背景色反白 */
.prose .custom-block p.custom-block-title::before { -webkit-text-fill-color: var(--bg); }
.prose .custom-block.details { padding: 0; }
.prose .custom-block.details > summary { margin: 0; padding: 12px 16px; font-weight: 650; cursor: pointer; user-select: none; }
.prose .custom-block.details[open] > summary { border-bottom: 1px solid var(--divider); }
.prose .custom-block.details > :not(summary) { margin-left: 16px; margin-right: 16px; }
.prose .custom-block.details > :last-child { margin-bottom: 14px; }
.prose .custom-block a { color: inherit; font-weight: 600; text-decoration-color: currentColor; }
.prose .custom-block :not(pre) > code { font-size: 13px; }
.prose .custom-block .code-block { margin: 10px 0; }
.prose .custom-block ul, .prose .custom-block ol { margin: 6px 0; }

/* 更新日志自动页：版本标题下的日期与标记、带类型标签的条目、补充说明 */
.prose .changelog-release { margin-bottom: 36px; }
.prose .changelog-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; margin: 6px 0 12px; font-size: 13px; line-height: 20px; color: var(--text-2); }
.prose .changelog-badge { padding: 0 8px; border-radius: 6px; background: var(--default-soft); color: var(--text-2); font-size: 12px; line-height: 20px; font-weight: 500; }
.prose .changelog-badge.latest { background: var(--brand-soft); color: var(--brand-text); }
.prose .changelog-badge.prerelease { background: var(--warning-soft); color: var(--warning-text); }
.prose .changelog-badge.force { background: var(--danger-soft); color: var(--danger-text); }
.prose ul.changelog-entries { padding-left: 0; list-style: none; }
.prose .changelog-entries > li { padding-left: 0; }
.prose .changelog-tag {
  display: inline-block; min-width: 40px; margin-right: 8px; padding: 0 6px; border-radius: 5px;
  background: var(--default-soft); color: var(--text-2);
  font-size: 12px; line-height: 20px; font-weight: 600; text-align: center; vertical-align: 1px;
}
.prose .changelog-tag.add { background: var(--success-soft); color: var(--success-text); }
.prose .changelog-tag.fix { background: var(--brand-soft); color: var(--brand-text); }
.prose .changelog-tag.change { background: var(--warning-soft); color: var(--warning-text); }
.prose .changelog-tag.remove { background: var(--danger-soft); color: var(--danger-text); }
.prose .changelog-scope { color: var(--text-2); }
.prose .changelog-notes { margin-top: 12px; padding-left: 16px; border-left: 3px solid var(--divider); }
.prose .changelog-notes > :first-child { margin-top: 0; }
.prose .changelog-empty { color: var(--text-3); }

/* 页尾：更新时间与上一篇 / 下一篇 */
.doc-footer { margin-top: 64px; }
.last-updated { margin: 0 0 20px; font-size: 13px; line-height: 20px; color: var(--text-3); }
.pager { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; padding-top: 24px; border-top: 1px solid var(--divider); }
.pager-link {
  position: relative; display: block; padding: 14px 18px;
  border: 1px solid var(--divider); border-radius: 12px;
  transition: border-color 0.15s, background-color 0.15s;
}
.pager-link:hover { border-color: var(--brand-line); background: var(--brand-soft); }
.pager-link.prev { padding-left: 40px; }
.pager-link.next { grid-column: 2; padding-right: 40px; text-align: right; }
.pager-link::before {
  content: ""; position: absolute; top: 50%; width: 7px; height: 7px; margin-top: -4px;
  border-right: 1.5px solid var(--text-3); border-bottom: 1.5px solid var(--text-3);
  transition: border-color 0.15s;
}
.pager-link.prev::before { left: 20px; transform: rotate(135deg); }
.pager-link.next::before { right: 20px; transform: rotate(-45deg); }
.pager-link:hover::before { border-color: var(--brand-text); }
.pager-link .desc { display: block; font-size: 12px; line-height: 18px; color: var(--text-3); }
.pager-link .title { display: block; margin-top: 2px; font-size: 15px; line-height: 22px; font-weight: 600; color: var(--text-1); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* 首页：左对齐主视觉 + 右侧最新版本面板，下方特性卡片与正文 */
.home { padding: 0 24px 96px; }
.hero { display: grid; grid-template-columns: minmax(0, 1fr); gap: 40px; max-width: 1180px; margin: 0 auto; padding: 72px 0 56px; }
.hero-title { margin: 0; max-width: 14em; font-size: 40px; line-height: 1.12; font-weight: 750; letter-spacing: -0.035em; color: var(--text-1); overflow-wrap: anywhere; }
.hero-tagline { max-width: 34em; margin: 18px 0 0; font-size: 18px; line-height: 1.65; color: var(--text-2); }
.hero-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 32px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  height: 42px; padding: 0 20px; border: 1px solid transparent; border-radius: 10px;
  font-size: 15px; font-weight: 600; white-space: nowrap;
  transition: color 0.15s, border-color 0.15s, background-color 0.15s;
}
.btn.brand { background: var(--brand); color: #fff; box-shadow: var(--shadow-sm), inset 0 -1px 0 rgba(0, 0, 0, 0.12); }
.btn.brand:hover { background: var(--brand-hover); }
.btn.alt { border-color: var(--border); background: var(--bg); color: var(--text-1); box-shadow: var(--shadow-sm); }
.btn.alt:hover { border-color: var(--text-3); background: var(--bg-alt); }

/* 最新版本面板：每个通道一行，版本号用等宽字体，整行可点 */
.release-panel { align-self: center; border: 1px solid var(--divider); border-radius: 16px; background: var(--bg-elv); box-shadow: var(--shadow-sm); overflow: hidden; }
.release-panel-title { margin: 0; padding: 14px 20px; border-bottom: 1px solid var(--divider); background: var(--bg-alt); font-size: 13px; line-height: 20px; font-weight: 650; color: var(--text-2); }
.release-list { margin: 0; padding: 6px; list-style: none; }
.release-row {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "channel go" "version go" "time go"; align-items: center;
  padding: 12px 14px; border-radius: 10px; transition: background-color 0.15s;
}
.release-row:hover { background: var(--brand-soft); }
.release-channel { grid-area: channel; font-size: 13px; line-height: 20px; font-weight: 500; color: var(--text-2); }
.release-version { grid-area: version; font-family: var(--mono); font-size: 22px; line-height: 1.35; font-weight: 600; letter-spacing: -0.01em; color: var(--text-1); overflow-wrap: anywhere; }
.release-time { grid-area: time; font-size: 12px; line-height: 18px; color: var(--text-3); }
.release-go { grid-area: go; width: 18px; height: 18px; margin-left: 12px; color: var(--text-3); transition: color 0.15s, transform 0.15s; }
.release-row:hover .release-go { color: var(--brand-text); transform: translateX(2px); }
.release-list > li + li { border-top: 1px solid var(--divider); }

.features { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; max-width: 1180px; margin: 0 auto; }
.feature {
  position: relative; display: flex; flex-direction: column; height: 100%; padding: 22px;
  border: 1px solid var(--divider); border-radius: 14px;
  background: var(--bg); color: var(--text-1);
  transition: border-color 0.15s, background-color 0.15s;
}
a.feature:hover { border-color: var(--brand-line); background: var(--brand-soft); }
a.feature::after {
  content: ""; position: absolute; top: 26px; right: 24px; width: 7px; height: 7px;
  border-right: 1.5px solid var(--text-3); border-top: 1.5px solid var(--text-3); transform: rotate(45deg);
  transition: border-color 0.15s;
}
a.feature:hover::after { border-color: var(--brand-text); }
.feature-icon { display: flex; align-items: center; justify-content: center; width: 40px; height: 40px; margin-bottom: 16px; border: 1px solid var(--divider); border-radius: 10px; background: var(--bg-alt); font-size: 20px; line-height: 1; }
.feature-title { margin: 0; padding-right: 20px; font-size: 16px; line-height: 24px; font-weight: 650; }
.feature-details { flex-grow: 1; margin: 6px 0 0; font-size: 14px; line-height: 1.7; color: var(--text-2); }
.home-body { max-width: var(--content-w); margin: 64px auto 0; }

/* page 版式：顶栏 + 全宽正文（标题由正文自己写） */
.page { min-width: 0; padding: 48px 32px 96px; }
.page-body { max-width: 1180px; margin: 0 auto; }
.page-body.prose > h1:first-child { margin-top: 0; font-size: 34px; }

/* 页脚：站点名与独立页面 */
.site-footer { flex: none; border-top: 1px solid var(--divider); background: var(--bg-alt); }
.footer-inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 24px; max-width: var(--layout-w); margin: 0 auto; padding: 24px; }
.footer-title { font-size: 14px; font-weight: 600; color: var(--text-2); }
.footer-title:hover { color: var(--text-1); }
.footer-links { display: flex; flex-wrap: wrap; gap: 8px 20px; font-size: 14px; line-height: 22px; }
.footer-links a { color: var(--text-2); transition: color 0.15s; }
.footer-links a:hover { color: var(--brand-text); }

@media (min-width: 1280px) {
  .layout.no-toc { grid-template-columns: var(--sidebar-w) minmax(0, 1fr); }
}
/* 宽屏以下：右侧目录收进正文顶部的下拉 */
@media (max-width: 1279px) {
  .layout { grid-template-columns: var(--sidebar-w) minmax(0, 1fr); }
  .aside { display: none; }
  html:has(.local-nav) { scroll-padding-top: calc(var(--header-h) + 68px); }
  .local-nav {
    display: flex; align-items: center;
    position: sticky; top: var(--header-h); z-index: 20;
    height: 48px; margin: -40px -56px 28px; padding: 0 56px;
    background: var(--bg); border-bottom: 1px solid var(--divider);
  }
  .local-toc { position: relative; }
  .local-toc > summary {
    display: inline-flex; align-items: center; gap: 6px;
    font-size: 13px; line-height: 48px; font-weight: 500; color: var(--text-2);
    list-style: none; cursor: pointer;
  }
  .local-toc > summary::-webkit-details-marker { display: none; }
  .local-toc > summary::after {
    content: ""; width: 5px; height: 5px; margin-top: -3px;
    border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor;
    transform: rotate(45deg); transition: transform 0.15s;
  }
  .local-toc[open] > summary::after { margin-top: 3px; transform: rotate(225deg); }
  .local-toc > summary:hover { color: var(--text-1); }
  .local-toc-panel {
    position: absolute; top: 44px; left: 0; z-index: 25;
    width: min(320px, calc(100vw - 48px)); max-height: 60vh; overflow-y: auto;
    padding: 12px 14px;
    border: 1px solid var(--divider); border-radius: 12px;
    background: var(--bg-elv); box-shadow: var(--shadow);
  }
}

/* 平板与手机：左侧导航变为抽屉（无脚本时由 :target 打开） */
@media (min-width: 960px) {
  .is-home .sidebar, .is-page .sidebar { display: none; }
  .hero.has-latest { grid-template-columns: minmax(0, 1fr) minmax(300px, 380px); gap: 56px; align-items: center; }
}
@media (max-width: 959px) {
  .layout { grid-template-columns: minmax(0, 1fr); }
  .header-inner { display: flex; gap: 8px; padding: 0 12px; }
  .header-brand { flex: 1; }
  .menu-btn { display: inline-grid; }
  .sidebar {
    position: fixed; top: 0; bottom: 0; left: 0; z-index: 50;
    align-self: stretch; width: min(320px, 86vw); height: auto;
    padding: 0 16px 64px;
    background: var(--bg); box-shadow: var(--shadow);
    transform: translateX(-100%); visibility: hidden;
    transition: transform 0.25s ease, visibility 0.25s;
  }
  html.nav-open .sidebar, .sidebar:target { transform: none; visibility: visible; }
  html.nav-open { overflow: hidden; }
  .drawer-head {
    display: flex; align-items: center; justify-content: space-between;
    position: sticky; top: 0; z-index: 1;
    height: var(--header-h); margin: 0 -16px 12px; padding: 0 8px 0 20px;
    background: var(--bg); border-bottom: 1px solid var(--divider);
    font-weight: 650;
  }
  .drawer-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .backdrop {
    display: block; position: fixed; inset: 0; z-index: 40;
    background: var(--backdrop); opacity: 0; pointer-events: none;
    transition: opacity 0.25s;
  }
  html.nav-open .backdrop, .sidebar:target ~ .backdrop { opacity: 1; pointer-events: auto; }
  .content { padding: 28px 32px 64px; }
  .local-nav { margin: -28px -32px 24px; padding: 0 32px; }
}
@media (max-width: 767px) {
  .header-nav { display: none; }
  .drawer-links { display: block; margin-bottom: 12px; padding-bottom: 12px; border-bottom: 1px solid var(--divider); }
  .drawer-links a { display: flex; align-items: center; gap: 4px; padding: 8px 10px; border-radius: 8px; font-size: 15px; font-weight: 500; color: var(--text-1); }
  .drawer-links a:hover { background: var(--default-soft); }
  .drawer-group { padding: 4px 0; }
  .drawer-group-title { margin: 0; padding: 8px 10px 2px; font-size: 13px; font-weight: 650; color: var(--text-3); }
  .drawer-group-title a { padding: 0; font-size: 13px; font-weight: 650; color: var(--text-3); }
  .drawer-group > a { padding-left: 18px; }
  .page { padding: 32px 20px 64px; }
  .content { padding: 24px 20px 64px; }
  .local-nav { margin: -24px -20px 20px; padding: 0 20px; }
  .doc-title { font-size: 27px; }
  .doc-desc { font-size: 16px; }
  .prose .code-block { margin: 16px -20px; border-left: 0; border-right: 0; border-radius: 0; }
  .prose .custom-block .code-block { margin: 10px 0; border: 1px solid var(--divider); border-radius: 10px; }
  .prose .code-group > .code-block { margin: 10px -20px; }
  html.js .prose .code-group.is-tabbed { margin: 16px -20px; border-left: 0; border-right: 0; border-radius: 0; }
  html.js .prose .custom-block .code-group.is-tabbed { margin: 10px 0; border: 1px solid var(--divider); border-radius: 10px; }
  .search-btn { width: 36px; height: 36px; padding: 0; justify-content: center; border: 0; background: transparent; box-shadow: none; color: var(--text-2); }
  .search-btn:hover { background: var(--default-soft); }
  .search-btn svg { width: 19px; height: 19px; }
  .search-label, .search-kbd { display: none; }
  .search-dialog { width: 100vw; height: 100%; max-height: none; margin: 0; border: 0; border-radius: 0; }
  .pager { grid-template-columns: minmax(0, 1fr); }
  .pager-link.next { grid-column: auto; }
  .home { padding: 0 20px 64px; }
  .hero { padding: 40px 0 36px; }
  .footer-inner { padding: 20px; }
}
@media (min-width: 640px) {
  .hero-title { font-size: 48px; }
  .hero-tagline { font-size: 19px; }
  .features { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .features.n1 { grid-template-columns: minmax(0, 1fr); max-width: 560px; margin-left: auto; margin-right: auto; }
}
@media (min-width: 960px) {
  .home { padding: 0 48px 96px; }
  .hero { padding: 96px 0 72px; }
  .hero-title { font-size: 56px; }
  .hero-tagline { font-size: 20px; }
  .features { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .features.n2, .features.n4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0.01ms !important; }
}
@media print {
  .site-header, .sidebar, .backdrop, .aside, .local-nav, .pager, .copy-btn, .zoom-trigger, .skip-link, .site-footer, .code-tabs { display: none !important; }
  html.js .prose .code-group.is-tabbed > .code-block, html.js .prose .code-group.is-tabbed > .code-block > .code-title { display: block !important; }
  .layout { display: block; }
  .content { padding: 0; }
}
