/* ============================================================
   SPBokeh Documentation — 版式与组件
   中性纸色（只带一点黄绿倾向）+ 珊瑚红强调 + 香萃潮汐宋标题
   亮/暗两套令牌，靠 html[data-theme] 切换
   ============================================================ */

@font-face {
  font-family: "ChaoxiSong";
  src: url("./fonts/chaoxi-song-w15.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

:root {
  --font-display: "ChaoxiSong", "Songti SC", "STSong", Georgia, serif;
  --font-body: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Inter", sans-serif;
  --font-mono: ui-monospace, "SF Mono", "Menlo", monospace;

  --r-pill: 999px;
  --r-card: 16px;
  --r-field: 12px;
  --r-icon: 50%;
  --text-width: 68ch;
  --tint-clay: color-mix(in srgb, var(--clay) 8%, transparent);
  --tint-moss: color-mix(in srgb, var(--moss) 8%, transparent);
  --tint-coral: color-mix(in srgb, var(--accent) 10%, transparent);
  --ease: var(--motion-ease, ease-out);
  --head-h: 72px;

  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
  --space-7: 48px;
  --space-8: 64px;
  --space-9: 96px;
}

html[data-theme="light"] {
  color-scheme: light;
  --bg: #f6f7f0;
  --bg-raise: #eceee5;
  --bg-deep: #eceee5;
  --block: #e8eae0;
  --ink: #1a1c18;
  --ink-2: #4b4f48;
  --ink-3: #70756a;
  --accent: #b3475a;
  --text-marker: rgb(255 208 62 / 0.34);
  --moss: #5f6f3a;
  --clay: #a9702f;
  --ink-clay: #864f1e;
  --accent-hover: #9c3a4c;
  --accent-soft: #f4e7ea;
  --accent-deep: #b3475a;
  --hairline: rgba(26, 28, 24, 0.12);
  --hairline-soft: rgba(26, 28, 24, 0.07);
  --shape-fill: rgba(26, 28, 24, 0.07);
  --shape-fill-strong: rgba(26, 28, 24, 0.13);
  --nav-tint: linear-gradient(to bottom, rgba(246, 247, 240, 0.62) 0%, rgba(246, 247, 240, 0.26) 60%, transparent 100%);
}

html[data-theme="dark"] {
  color-scheme: dark;
  --bg: #171915;
  --bg-raise: #1e211c;
  --bg-deep: #14160f;
  --block: #23261f;
  --ink: #e9ece4;
  --ink-2: #b9bfb0;
  --ink-3: #9aa192;
  --accent: #f0949f;
  --text-marker: rgb(255 216 92 / 0.3);
  --moss: #a8bd7a;
  --clay: #e0a86a;
  --ink-clay: var(--clay);
  --accent-hover: #f6adb5;
  --accent-soft: #f5cad2;
  --accent-deep: #e07d8b;
  --hairline: rgba(233, 236, 228, 0.13);
  --hairline-soft: rgba(233, 236, 228, 0.07);
  --shape-fill: rgba(233, 236, 228, 0.07);
  --shape-fill-strong: rgba(233, 236, 228, 0.14);
  --nav-tint: linear-gradient(to bottom, rgba(23, 25, 21, 0.66) 0%, rgba(23, 25, 21, 0.3) 60%, transparent 100%);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--head-h) + 44px);
}

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.78;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img,
video,
svg {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  cursor: pointer;
}

input {
  font: inherit;
  color: inherit;
}

::selection {
  background: var(--accent);
  color: var(--bg);
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
  border-radius: 3px;
}

.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;
}

.doc-skip {
  position: fixed;
  top: 10px;
  left: 10px;
  z-index: 400;
  padding: 10px 16px;
  border-radius: var(--r-pill);
  background: var(--accent);
  color: var(--bg);
  font-size: 14px;
  font-weight: 600;
  transform: translateY(-180%);
  transition: transform 0.2s var(--ease);
}
.doc-skip:focus {
  transform: none;
}

/* ---------- 顶栏：与主站同款渐进模糊 ---------- */
.doc-head {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 100;
}
.doc-head-blur {
  position: absolute;
  /* 顶端贴视口，不外溢：Safari 对越出视口的 backdrop-filter 层取不到背景 */
  top: 0;
  right: 0;
  bottom: -24px;
  left: 0;
  z-index: -1;
  pointer-events: none;
  background: var(--nav-tint);
}
.doc-head-blur i {
  position: absolute;
  inset: 0;
  display: block;
  pointer-events: none;
}
.doc-head-blur i:nth-child(1) {
  backdrop-filter: blur(1.5px) saturate(1.05);
  -webkit-backdrop-filter: blur(1.5px) saturate(1.05);
  -webkit-mask-image: linear-gradient(to bottom, #000 0%, #000 60%, transparent 100%);
  mask-image: linear-gradient(to bottom, #000 0%, #000 60%, transparent 100%);
}
.doc-head-blur i:nth-child(2) {
  backdrop-filter: blur(3.5px);
  -webkit-backdrop-filter: blur(3.5px);
  -webkit-mask-image: linear-gradient(to bottom, #000 0%, #000 47%, transparent 92%);
  mask-image: linear-gradient(to bottom, #000 0%, #000 47%, transparent 92%);
}
.doc-head-blur i:nth-child(3) {
  backdrop-filter: blur(6.5px);
  -webkit-backdrop-filter: blur(6.5px);
  -webkit-mask-image: linear-gradient(to bottom, #000 0%, #000 33%, transparent 81%);
  mask-image: linear-gradient(to bottom, #000 0%, #000 33%, transparent 81%);
}
.doc-head-blur i:nth-child(4) {
  backdrop-filter: blur(11px);
  -webkit-backdrop-filter: blur(11px);
  -webkit-mask-image: linear-gradient(to bottom, #000 0%, #000 23%, transparent 68%);
  mask-image: linear-gradient(to bottom, #000 0%, #000 23%, transparent 68%);
}
.doc-head-blur i:nth-child(5) {
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  -webkit-mask-image: linear-gradient(to bottom, #000 0%, #000 13%, transparent 52%);
  mask-image: linear-gradient(to bottom, #000 0%, #000 13%, transparent 52%);
}
.doc-head-blur i:nth-child(6) {
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
  -webkit-mask-image: linear-gradient(to bottom, #000 0%, #000 4%, transparent 31%);
  mask-image: linear-gradient(to bottom, #000 0%, #000 4%, transparent 31%);
}
.doc-head-inner {
  display: flex;
  align-items: center;
  gap: 28px;
  width: min(100%, 1440px);
  min-height: var(--head-h);
  margin-inline: auto;
  padding: 0 32px;
}

.doc-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  flex: 0 0 auto;
  border-radius: var(--r-icon);
  background: var(--shape-fill);
  color: var(--ink-2);
  transition: color 0.2s var(--ease), background-color 0.2s var(--ease);
}
.doc-icon-btn:hover {
  color: var(--ink);
  background: var(--shape-fill-strong);
}
.doc-icon-btn svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* 主题三选一：跟随系统 / 浅色 / 深色（默认跟随系统） */
.doc-theme {
  position: relative;
  display: inline-flex;
  flex: 0 0 auto;
}
.doc-theme-menu {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  z-index: 60;
  display: grid;
  gap: 2px;
  min-width: 178px;
  padding: 6px;
  border-radius: 14px;
  background: var(--bg-raise);
  box-shadow: 0 18px 40px rgb(0 0 0 / 0.22), 0 2px 8px rgb(0 0 0 / 0.12);
}
.doc-theme-menu[hidden] {
  display: none;
}
.doc-theme-opt {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: 9px;
  color: var(--ink-2);
  font-size: 13.5px;
  line-height: 1.2;
  text-align: left;
  transition: color 0.18s var(--ease), background-color 0.18s var(--ease);
}
.doc-theme-opt:hover {
  color: var(--ink);
  background: var(--shape-fill);
}
.doc-theme-opt:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}
.doc-theme-opt[aria-checked="true"] {
  color: var(--ink);
}
.doc-theme-opt[aria-checked="true"]::after {
  content: "";
  width: 5px;
  height: 5px;
  margin-left: auto;
  border-radius: 50%;
  background: var(--accent);
}
.doc-theme-opt svg {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
}

.doc-brand {
  display: inline-flex;
  align-items: baseline;
  gap: 14px;
  flex: 0 0 auto;
  margin-right: auto;
  /* 衬线字族的字形整体压在行框下沿，纯靠 flex 居中会偏低约 2px，这里做光学补偿 */
  transform: translateY(-2px);
}
.doc-brand-name {
  font-family: var(--font-display);
  font-size: 24px;
  line-height: 1;
  letter-spacing: 0.02em;
  color: var(--ink);
}
.doc-brand-tail {
  font-size: 13px;
  line-height: 1.2;
  color: var(--ink-2);
}

.doc-topnav {
  display: flex;
  align-items: center;
  gap: 26px;
}
.doc-topnav a {
  font-size: 15px;
  color: var(--ink-2);
  transition: color 0.2s var(--ease);
}
.doc-topnav a:hover {
  color: var(--accent);
}

.doc-head-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
}

.doc-search-open {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0;
  border-radius: var(--r-icon);
  background: var(--shape-fill);
  color: var(--ink-2);
  font-size: 14px;
  transition: color 0.2s var(--ease), background-color 0.2s var(--ease);
  width: 40px;
  height: 40px;
  justify-content: center;
}
.doc-search-open:hover {
  color: var(--ink);
  background: var(--shape-fill-strong);
}
.doc-search-open-label {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
.doc-search-open kbd {
  display: none;
}
.doc-search-open svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
}
.doc-hero-search kbd {
  display: inline-flex;
  align-items: center;
  gap: 1px;
  padding: 1px 6px;
  border-radius: var(--r-pill);
  background: var(--shape-fill);
  font-family: var(--font-body);
  font-size: 11px;
  line-height: 1.6;
  color: var(--ink-3);
}

.doc-buy {
  display: inline-flex;
  align-items: center;
  padding: 8px 16px;
  border-radius: var(--r-pill);
  background: var(--accent);
  color: var(--bg);
  font-size: 13px;
  font-weight: 600;
  transition: opacity 0.2s var(--ease);
  min-height: 40px;
}
.doc-buy:hover {
  opacity: 0.86;
}
html[data-theme="dark"] .doc-buy {
  color: #231015;
}

/* ---------- 三栏骨架 ---------- */
.doc-shell {
  display: grid;
  grid-template-columns: 236px minmax(0, 820px) 176px;
  justify-content: center;
  gap: 0 64px;
  width: min(100%, 1440px);
  margin-inline: auto;
  padding: calc(var(--head-h) + 32px) 32px 96px;
}

.doc-main {
  min-width: 0;
  padding: 0;
}

.doc-sidebar {
  position: sticky;
  top: calc(var(--head-h) + 32px);
  align-self: start;
  max-height: calc(100vh - var(--head-h) - 64px);
  overflow-y: auto;
  padding-bottom: var(--space-8);
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: var(--hairline) transparent;
}
.doc-sidebar::-webkit-scrollbar {
  width: 6px;
}
.doc-sidebar::-webkit-scrollbar-thumb {
  background: var(--hairline);
  border-radius: 3px;
}

.doc-nav-head {
  padding-bottom: 12px;
  font-size: 13px;
  color: var(--ink-3);
}

.doc-nav-group,
.doc-nav-sub {
  margin-bottom: 6px;
}
.doc-nav-group > summary,
.doc-nav-sub > summary {
  -webkit-user-select: none;
  user-select: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 10px;
  font-size: 13px;
  color: var(--ink-2);
  cursor: pointer;
  list-style: none;
  transition: color 0.2s var(--ease);
  border-radius: var(--r-pill);
  font-weight: 600;
}
.doc-nav-group > summary:hover,
.doc-nav-sub > summary:hover {
  color: var(--ink);
  background: var(--bg-raise);
}
.doc-nav-group > summary::-webkit-details-marker,
.doc-nav-sub > summary::-webkit-details-marker {
  display: none;
}
/* 展开的分组：胶囊底色常驻，并用一条竖线把子项串起来 —— 组名与组内条目的层次一眼可分 */
.doc-nav-group[open] > summary,
.doc-nav-sub[open] > summary {
  color: var(--ink);
  background: color-mix(in srgb, var(--ink) 7%, transparent);
}
.doc-nav-group > .doc-disclosure,
.doc-nav-group > .doc-nav-items,
.doc-nav-sub > .doc-disclosure,
.doc-nav-sub > .doc-nav-items {
  position: relative;
}
.doc-nav-group[open] > .doc-disclosure::before,
.doc-nav-group[open] > .doc-nav-items::before {
  content: "";
  position: absolute;
  top: 2px;
  bottom: 10px;
  left: 18px;
  width: 1px;
  background: var(--hairline);
  pointer-events: none;
}
.doc-nav-sub[open] > .doc-disclosure::before,
.doc-nav-sub[open] > .doc-nav-items::before {
  content: "";
  position: absolute;
  top: 2px;
  bottom: 8px;
  left: 30px;
  width: 1px;
  background: var(--hairline);
  pointer-events: none;
}

.doc-nav-items > a {
  position: relative;
  -webkit-user-select: none;
  user-select: none;
  display: block;
  padding: 6px 10px 6px 34px;
  font-size: 14px;
  line-height: 1.5;
  color: var(--ink-2);
  transition: color 0.2s var(--ease), border-color 0.2s var(--ease);
  border-radius: var(--r-pill);
}
.doc-nav-items > a:hover {
  color: var(--ink);
  background: var(--bg-raise);
}
.doc-nav-items > a.is-active {
  color: var(--accent);
  background: var(--tint-coral);
  font-weight: 600;
}
.doc-nav-sub {
  border-top: 0;
  margin: 2px 0;
}
.doc-nav-sub > summary {
  padding: 4px 0 4px 28px;
  font-size: 13.5px;
}
.doc-nav-sub .doc-nav-items > a {
  padding-left: 46px;
  font-size: 13.5px;
}
.doc-nav-single > a {
  display: block;
  padding: 8px 10px;
  font-size: 14px;
  color: var(--ink-2);
  border-radius: var(--r-pill);
}
.doc-nav-single > a.is-active {
  color: var(--accent);
  background: var(--tint-coral);
  font-weight: 600;
}
/* ---------- 右侧大纲 ---------- */
.doc-toc {
  position: sticky;
  top: calc(var(--head-h) + 32px);
  align-self: start;
}
.doc-toc-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 12px;
  font-size: 13px;
  color: var(--ink-3);
}
.doc-toc-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: var(--r-icon);
  color: var(--ink-3);
}
.doc-toc-toggle:hover {
  color: var(--ink);
  background: var(--bg-raise);
}
.doc-toc-list {
  list-style: none;
}
.doc-toc-list a {
  display: block;
  padding: 6px 9px;
  margin-left: 0;
  font-size: 14px;
  line-height: 1.5;
  color: var(--ink-2);
  transition: color 0.2s var(--ease), border-color 0.2s var(--ease);
  border-radius: var(--r-field);
}
.doc-toc-list a:hover {
  color: var(--ink);
  background: var(--bg-raise);
}
.doc-toc-list a.is-active {
  color: var(--accent);
  background: var(--tint-coral);
}

.doc-article {
  max-width: var(--text-width);
}






.doc-intro {
  color: var(--ink-2);
}
.doc-intro > p:first-child {
  margin-top: 0;
}
.doc-intro > p + p {
  margin-top: var(--space-4);
}
.doc-intro a {
  color: var(--accent-hover);
}

.doc-section {
  scroll-margin-top: calc(var(--head-h) + 24px);
}
.doc-section h2 + p {
  margin-top: var(--space-3);
}

.doc-article strong {
  color: var(--ink);
  font-weight: 600;
}
.doc-article :is(p, li, .doc-callout-body) strong:not(a strong) {
  font-weight: inherit;
  background-color: var(--text-marker);
  padding-inline: 0.07em;
  margin-inline: -0.07em;
  border-radius: 2px;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}
/* 顶栏那支笔：关掉后荧光笔底色消失，只留粗体 */
html.doc-no-marker .doc-article :is(p, li, .doc-callout-body) strong:not(a strong) {
  background-color: transparent;
}
.doc-article a {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-color: color-mix(in srgb, var(--accent) 35%, transparent);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  transition: color 0.15s var(--ease), text-decoration-color 0.15s var(--ease);
}
.doc-article a:hover {
  color: var(--ink);
  text-decoration-color: var(--accent);
}

.doc-article li::marker {
  color: var(--accent-deep);
}

.doc-article ol {
  padding-left: 0;
  list-style: none;
  counter-reset: doc-step;
}
.doc-article ol > li {
  position: relative;
  padding-left: 2.55em;
  counter-increment: doc-step;
}
.doc-article ol > li::before {
  content: counter(doc-step);
  position: absolute;
  top: 0.3em;
  left: 0;
  min-width: 1.9em;
  padding: 0 0.35em;
  border-radius: var(--r-pill);
  background: var(--tint-coral);
  color: var(--accent);
  font-size: 0.77em;
  font-weight: 650;
  line-height: 1.65;
  text-align: center;
}
.doc-article :not(pre) > code {
  padding: 0.13em 0.32em;
  border-radius: 4px;
  background: var(--tint-clay);
  color: var(--ink-clay);
  font-size: 0.88em;
}

/* 提示块 */
.doc-callout {
  margin: var(--space-6) 0;
  padding: var(--space-4) var(--space-5);
  border-radius: var(--r-card);
  background: var(--bg-raise);
}
.doc-callout-label {
  margin: 0 0 6px;
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
  color: var(--ink-clay);
}
.doc-callout-body {
  color: var(--ink-2);
  font-size: 15px;
  line-height: 1.7;
}
.doc-callout-body p {
  margin: 0;
}
.doc-callout-important {
  background: var(--tint-clay);
}
.doc-callout-note .doc-callout-label,
.doc-callout-tip .doc-callout-label,
.doc-callout-trial .doc-callout-label,
.doc-callout-build-note .doc-callout-label {
  color: var(--ink-2);
}

/* 表格 */
.doc-table-wrap {
  margin: var(--space-5) 0;
  overflow-x: auto;
  border-radius: var(--r-card);
  background: var(--bg-raise);
  scrollbar-width: thin;
}
.doc-table {
  width: 100%;
  min-width: 520px;
  border-collapse: collapse;
  text-align: left;
}
.doc-table th {
  padding: 12px var(--space-4);
  background: var(--shape-fill-strong);
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
  color: var(--moss);
  white-space: nowrap;
}
.doc-table td {
  padding: var(--space-3) var(--space-4);
  font-size: 14px;
  line-height: 1.6;
  color: var(--ink-2);
  vertical-align: top;
}
/* 无描边：隔行与表头用色块区分行 */
.doc-table tbody tr:nth-child(even) td {
  background: var(--shape-fill);
}
.doc-table td:first-child {
  color: var(--ink);
  font-weight: 500;
}
.doc-table td:last-child {
  color: var(--ink-3);
  white-space: nowrap;
}
/* 正文表格最后一列常是整句说明，必须能换行；参数索引表的宿主标记保持单行。 */
.doc-table-wrap:not(.doc-param-table) .doc-table th:last-child,
.doc-table-wrap:not(.doc-param-table) .doc-table td:last-child {
  white-space: normal;
}
.doc-table a {
  color: var(--ink);
  text-decoration: none;
}
.doc-table a:hover {
  color: var(--accent-hover);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.doc-table tbody tr:hover td {
  background: var(--tint-moss);
}
.doc-table th:last-child,
.doc-table td:last-child {
  padding-right: var(--space-5);
}
.doc-table th:first-child,
.doc-table td:first-child {
  padding-left: var(--space-5);
}
.doc-table tbody tr:last-child td {
  border-bottom: 0;
}

.doc-table tbody tr:nth-child(even):not(:hover) td {
  background: color-mix(in srgb, var(--moss) 4%, transparent);
}

/* 代码 */
.doc-code {
  margin: var(--space-5) 0;
  padding: var(--space-4) var(--space-5);
  overflow-x: auto;
  border-radius: var(--r-card);
  background: var(--tint-clay);
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.7;
  color: var(--ink-clay);
  tab-size: 2;
}

/* 图 */
.doc-figure {
  margin: var(--space-6) 0;
  border-radius: var(--r-card);
  overflow: hidden;
  background: var(--bg-raise);
}

/* 关联 */
.doc-related {
  display: grid;
  gap: var(--space-5);
  margin-top: var(--space-7);
  padding: var(--space-5);
  border-radius: var(--r-card);
  background: var(--shape-fill);
}
.doc-related-label {
  margin: 0 0 4px;
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
  color: var(--ink-3);
}
.doc-related-links a {
  text-decoration: none;
  color: var(--moss);
}
.doc-related-links a:hover {
  text-decoration: underline;
}
.doc-related-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 22px;
  margin: 0;
  font-size: 14px;
  line-height: 2;
  color: var(--ink-2);
}

/* 上一页 / 下一页 */
.doc-pager {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-4);
  margin-top: var(--space-8);
}
.doc-pager-link {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: var(--space-4) var(--space-5);
  border-radius: var(--r-card);
  background: var(--bg-raise);
  translate: 0 calc(-2px * var(--doc-hover, 0));
  transition: background-color 0.24s var(--ease);
}
.doc-pager-link:hover {
  background: var(--block);
}
.doc-pager-next {
  text-align: right;
}
.doc-pager-dir {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
  color: var(--ink-3);
}
.doc-pager-next .doc-pager-dir {
  justify-content: flex-end;
}
.doc-pager-dir svg {
  width: 13px;
  height: 13px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.doc-pager-title {
  font-size: 15px;
  font-weight: 500;
  color: var(--ink);
}

/* ---------- 首页搜索 ---------- */
.doc-hero-search {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  width: min(100%, 520px);
  margin: 32px 0 0;
  padding: 14px 14px 14px 20px;
  border-radius: var(--r-pill);
  background: var(--bg-raise);
  color: var(--ink-3);
  text-align: left;
  transition: background-color 0.2s var(--ease);
}
.doc-hero-search:hover {
  background: color-mix(in srgb, var(--accent) 8%, var(--bg-raise));
}
.doc-hero-search svg {
  width: 19px;
  height: 19px;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
}
.doc-hero-search-ph {
  flex: 1;
  font-size: 15px;
  color: var(--ink-2);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}


.doc-card-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-4);
}
.doc-card {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  padding: var(--space-5);
  border-radius: var(--r-card);
  background: var(--bg-raise);
  translate: 0 calc(-2px * var(--doc-hover, 0));
  transition: background-color 0.24s var(--ease);
}
.doc-card:hover {
  background: var(--block);
}
.doc-card-title {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 400;
  line-height: 1.3;
  color: var(--ink);
}
.doc-card-desc {
  flex: 1;
  font-size: 14px;
  line-height: 1.65;
  color: var(--ink-2);
}
.doc-card-links {
  list-style: none;
  display: grid;
  gap: 4px;
  padding-top: var(--space-3);
}
.doc-card-links a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13.5px;
  color: var(--accent);
}
.doc-card-links a::after {
  content: "→";
  font-size: 12px;
  opacity: 0.7;
  transition: transform 0.2s var(--ease);
}
.doc-card-links a:hover::after {
  transform: translateX(3px);
}

.doc-topic-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 var(--space-8);
  list-style: none;
}
.doc-topic-list li {
  border-top: 1px solid var(--hairline);
}
.doc-topic-list a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  padding: 14px 0;
  font-size: 15px;
  color: var(--ink-2);
  transition: color 0.2s var(--ease);
}
.doc-topic-list a::after {
  content: "→";
  color: var(--ink-3);
  transition: transform 0.25s var(--ease), color 0.2s var(--ease);
}
.doc-topic-list a:hover {
  color: var(--ink);
}
.doc-topic-list a:hover::after {
  color: var(--accent);
  transform: translateX(4px);
}

/* ---------- 参数总表 ---------- */
.doc-article-index {
  max-width: 100%;
}
.doc-params-tools {
  margin: 0 0 var(--space-4);
}
.doc-params-search {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: 12px 18px;
  border-radius: var(--r-pill);
  background: var(--bg-raise);
}
.doc-params-search svg {
  width: 17px;
  height: 17px;
  flex: 0 0 auto;
  fill: none;
  stroke: var(--ink-3);
  stroke-width: 1.6;
  stroke-linecap: round;
}
.doc-params-search input {
  flex: 1;
  min-width: 0;
  border: 0;
  background: none;
  font-size: 14px;
  color: var(--ink);
}
.doc-params-search input::placeholder {
  color: var(--ink-3);
}
.doc-params-search input:focus {
  outline: none;
}
.doc-params-search:focus-within {
  background: var(--shape-fill-strong);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent);
}
.doc-params-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2) var(--space-4);
  margin-top: var(--space-3);
}
.doc-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.doc-chip {
  padding: 5px 11px;
  background: var(--shape-fill);
  border-radius: var(--r-pill);
  font-size: 12px;
  line-height: 1.4;
  color: var(--ink-2);
  white-space: nowrap;
  transition: border-color 0.15s var(--ease), background-color 0.15s var(--ease), color 0.15s var(--ease);
}
.doc-chip:hover {
  background: var(--shape-fill-strong);
  color: var(--ink);
}
.doc-chip.is-on {
  background: var(--accent);
  color: var(--bg);
  font-weight: 600;
}
.doc-params-filters .doc-chips {
  max-width: 100%;
  overflow-x: auto;
  padding-bottom: 2px;
  scrollbar-width: none;
}
.doc-params-filters .doc-chips::-webkit-scrollbar {
  display: none;
}
.doc-params-empty {
  margin-top: var(--space-3);
  font-size: 13px;
  color: var(--ink-3);
}

.doc-param-group {
  margin-top: var(--space-6);
}
.doc-param-group h3 {
  margin-top: var(--space-6);
}
.doc-param-group[hidden] {
  display: none;
}
.doc-param-table tr[hidden] {
  display: none;
}

/* ---------- 搜索浮层 ---------- */
.doc-search {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 10vh var(--space-4) var(--space-4);
}
.doc-search[hidden] {
  display: none;
}
.doc-search-scrim {
  position: absolute;
  inset: 0;
  background: rgba(9, 6, 5, 0.76);
  backdrop-filter: blur(6px);
  opacity: var(--doc-search-open, 0);
}
.doc-search-panel {
  position: relative;
  width: min(100%, 720px);
  max-height: min(76vh, 720px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-radius: var(--r-card);
  background: var(--bg-raise);
  opacity: var(--doc-search-open, 0);
  transform: translateY(calc((1 - var(--doc-search-open, 0)) * -12px)) scale(calc(0.985 + var(--doc-search-open, 0) * 0.015));
}
.doc-search-form {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-4) var(--space-5);
}
.doc-search-form > svg {
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
  fill: none;
  stroke: var(--ink-3);
  stroke-width: 1.6;
  stroke-linecap: round;
}
.doc-search-form input {
  flex: 1;
  min-width: 0;
  border: 0;
  background: none;
  font-size: 18px;
  color: var(--ink);
}
.doc-search-form input::placeholder {
  color: var(--ink-3);
}
.doc-search-form input:focus {
  outline: none;
}
.doc-search-esc {
  padding: 3px 8px;
  background: var(--shape-fill);
  border-radius: var(--r-pill);
  font-size: 11px;
  color: var(--ink-3);
}
.doc-search-esc:hover {
  color: var(--ink);
  background: var(--shape-fill-strong);
}
.doc-search-hint {
  padding: var(--space-3) var(--space-5) 0;
  font-size: 12px;
  color: var(--ink-3);
}
.doc-search-filters {
  display: grid;
  gap: 6px;
  padding: var(--space-3) var(--space-5) var(--space-4);
}
.doc-search-results {
  overflow-y: auto;
}
.doc-search-result {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 2px var(--space-4);
  padding: 12px var(--space-5);
  transition: background-color 0.15s var(--ease);
}
.doc-search-result:hover,
.doc-search-result:focus-visible,
.doc-search-result.is-active {
  background: var(--tint-coral);
}
.doc-search-result-title {
  font-size: 15px;
  font-weight: 500;
  color: var(--ink);
}
.doc-search-result-meta {
  grid-row: 1;
  grid-column: 2;
  align-self: center;
  font-size: 12.5px;
  letter-spacing: 0;
  text-transform: none;
  color: var(--ink-3);
  white-space: nowrap;
}
.doc-search-result-desc {
  grid-column: 1 / -1;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  font-size: 13px;
  color: var(--ink-2);
}
.doc-search-empty,
.doc-search-suggest {
  padding: var(--space-4) var(--space-5);
  font-size: 13px;
  color: var(--ink-3);
}
.doc-search-result mark {
  background: var(--tint-coral);
  color: var(--accent);
  border-radius: 2px;
}
.doc-search-empty strong {
  color: var(--ink-2);
}

/* ---------- 悬浮预览卡：停留后看目标页 ---------- */
.doc-peek {
  position: fixed;
  z-index: 400;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-radius: var(--r-card);
  background: var(--bg-raise);
  box-shadow: 0 26px 64px -26px rgba(18, 14, 10, 0.55), 0 4px 16px rgba(18, 14, 10, 0.12);
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.18s var(--ease), transform 0.18s var(--ease);
  pointer-events: none;
}
.doc-peek.is-on {
  opacity: 1;
  transform: none;
  pointer-events: auto;
}
.doc-peek-body {
  overflow-y: auto;
  padding: 16px 18px 18px;
  font-size: 13.5px;
  line-height: 1.68;
  color: var(--ink-2);
  overscroll-behavior: contain;
  scrollbar-width: thin;
}
.doc-peek-kicker {
  margin: 0;
  font-size: 10.5px;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.doc-peek-title {
  margin: 6px 0 10px;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 19px;
  line-height: 1.3;
  color: var(--ink);
}
/* 预览卡里套的是整篇文章，这里只压小字号，排印特色（衬线标题、荧光笔、图表）全部保留 */
.doc-peek .doc-article {
  max-width: none;
}
.doc-peek .doc-article h1 {
  margin: 4px 0 8px;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 22px;
  line-height: 1.25;
  color: var(--accent);
  letter-spacing: 0;
}
.doc-peek .doc-article .doc-head-block {
  margin-bottom: 4px;
}
.doc-peek .doc-article .doc-meta {
  margin: 8px 0 10px;
}
.doc-peek .doc-article .doc-meta-item {
  font-size: 11.5px;
  gap: 6px;
}
.doc-peek .doc-article .doc-meta-item dd {
  font-size: 11.5px;
}
.doc-peek .doc-article .doc-section h2,
.doc-peek .doc-article h2 {
  margin: 16px 0 5px;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 17px;
  line-height: 1.32;
  color: var(--accent);
  text-transform: none;
  letter-spacing: 0;
  padding: 0;
}
.doc-peek .doc-article h3 {
  margin: 12px 0 4px;
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
}
.doc-peek .doc-article :is(p, li, dd, dt, td, th, figcaption, .doc-callout-body, .doc-callout-label) {
  font-size: 13px;
  line-height: 1.62;
  color: var(--ink-2);
  max-width: none;
  text-wrap: pretty;
}
.doc-peek .doc-article p {
  margin: 8px 0;
}
.doc-peek .doc-article :is(ul, ol) {
  margin: 8px 0;
  padding-left: 1.05em;
}
.doc-peek .doc-article li {
  margin: 4px 0;
}
.doc-peek .doc-article :is(code, kbd) {
  font-size: 11.5px;
}
.doc-peek .doc-article .doc-intro > p {
  font-size: 13px;
  line-height: 1.62;
}
.doc-peek .doc-article .doc-spec {
  margin: 8px 0 6px;
  padding: 8px 10px;
  border-radius: 9px;
  background: var(--shape-fill);
}
.doc-peek .doc-article .doc-spec-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  padding: 3px 0;
  font-size: 11.5px;
}
.doc-peek .doc-article .doc-spec-row dt {
  flex: 0 0 auto;
  color: var(--ink-3);
  font-size: 11.5px;
}
.doc-peek .doc-article .doc-spec-row dd {
  margin: 0;
  text-align: right;
  font-size: 11.5px;
  color: var(--ink);
}
.doc-peek .doc-article .doc-fig {
  margin: 12px 0;
  max-width: none;
}
.doc-peek .doc-article .doc-fig-plate {
  padding: 10px;
  border-radius: 9px;
}
.doc-peek .doc-article .doc-fig-ctl {
  pointer-events: none;
}
/* 图示保留，但别让单张图把整张卡撑满 */
.doc-peek .doc-article .doc-fig-plate > svg {
  width: auto;
  max-width: 100%;
  max-height: 168px;
  margin-inline: auto;
  display: block;
}
.doc-peek .doc-article .doc-table-wrap {
  margin: 10px 0;
  max-width: 100%;
  overflow-x: auto;
}
.doc-peek .doc-article .doc-table {
  min-width: 380px;
  font-size: 11.5px;
}
.doc-peek .doc-article .doc-table th,
.doc-peek .doc-article .doc-table td {
  padding: 6px 8px;
}
.doc-peek .doc-article .doc-callout {
  margin: 10px 0;
  padding: 10px 12px;
  border-radius: 9px;
}
.doc-peek .doc-article .doc-callout-label {
  font-size: 11px;
  margin-bottom: 3px;
}
.doc-peek .doc-article .doc-callout-body {
  font-size: 12.5px;
}
.doc-peek .doc-article .doc-related {
  margin-top: 14px;
  padding: 12px;
  gap: var(--space-3);
  border-radius: 9px;
}
.doc-peek .doc-article .doc-related-label {
  font-size: 11px;
}
.doc-peek .doc-article .doc-related-links a {
  font-size: 12px;
}
.doc-peek .doc-article a {
  color: var(--accent);
}
.doc-peek-loading {
  margin: 8px 0 0;
  color: var(--ink-3);
}
.doc-peek-loading {
  margin: 8px 0 0;
  color: var(--ink-3);
}
.doc-search-state {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}


/* ---------- 正文排版（覆盖旧尺寸） ---------- */
.doc-crumbs-wrap {
  margin-bottom: var(--space-6);
}
.doc-crumbs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--ink-3);
}
.doc-crumbs i {
  font-style: normal;
  color: var(--hairline);
}

.doc-head-block {
  margin-bottom: var(--space-6);
}
.doc-kicker {
  margin-bottom: 14px;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
  color: var(--ink-3);
}
.doc-article h1 {
  margin-bottom: var(--space-4);
  font-family: var(--font-display);
  font-size: clamp(38px, 4.2vw, 56px);
  font-weight: 400;
  line-height: 1.1;
  letter-spacing: -0.022em;
  color: var(--accent);
  text-wrap: balance;
}
.doc-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 44px;
  margin-top: 32px;
  padding: 0;
  border: 0;
}
.doc-meta-item dt {
  margin-bottom: 0;
  font-size: 13px;
  font-weight: 400;
  letter-spacing: 0;
  text-transform: none;
  color: var(--ink-3);
}
.doc-meta-item dd {
  font-size: 14px;
  color: var(--ink);
}
.doc-meta-item {
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.doc-spec {
  margin-top: 28px;
  padding: 8px var(--space-4);
  border-radius: var(--r-card);
  background: var(--shape-fill);
}
.doc-spec-row {
  display: grid;
  grid-template-columns: 190px minmax(0, 1fr);
  gap: 16px;
  padding: 8px 0;
  font-size: 15px;
}
.doc-spec-row dt {
  color: var(--ink-3);
}
.doc-spec-row dd {
  color: var(--ink);
}

.doc-intro > p {
  font-size: 17px;
  line-height: 1.78;
  text-wrap: pretty;
}
.doc-article p {
  margin: 18px 0;
  font-size: 17px;
  line-height: 1.78;
  color: var(--ink);
  text-wrap: pretty;
  max-width: var(--text-width);
}
.doc-article ul,
.doc-article ol {
  margin: 18px 0;
  padding-left: 1.3em;
  color: var(--ink);
  max-width: var(--text-width);
}
.doc-article li {
  margin: 8px 0;
}

.doc-section h2 {
  margin: 48px 0 12px;
  font-family: var(--font-display);
  font-size: clamp(22px, 2.3vw, 28px);
  font-weight: 400;
  line-height: 1.24;
  letter-spacing: -0.012em;
  color: var(--accent);
  text-wrap: balance;
}
.doc-section h3 {
  margin: 28px 0 8px;
  font-size: 17px;
  font-weight: 600;
  color: var(--ink);
}

.doc-article .doc-intro p:first-child {
  color: var(--ink-2);
}
.doc-article .doc-callout-body p {
  margin: 0;
}

/* ---------- 插图 ---------- */
.doc-fig {
  --fig-w: 460px;
  --fig-mask-white: #fff;
  --fig-mask-black: #000;
  --fig-track: color-mix(in srgb, var(--ink) 15%, transparent);
  margin: 24px auto;
  max-width: var(--fig-w);
}
.doc-fig-plate {
  position: relative;
  padding: 16px;
  background: var(--bg-raise);
  border-radius: var(--r-field);
}
.doc-fig-plate > svg {
  width: 100%;
  height: auto;
}
.doc-fig-controls,
.doc-fig-interaction {
  display: none;
}
[data-fig-ready] .doc-fig-controls {
  display: grid;
  gap: 4px;
  padding: 12px 0 0;
}
.doc-fig-ctl {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: baseline;
  gap: 0 12px;
  padding-inline: 4px;
  font-size: 13px;
}
.doc-fig-ctl-name {
  color: var(--ink-2);
  font-weight: 550;
}
.doc-fig-ctl-val {
  font-family: var(--font-mono);
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}
.doc-fig-ctl input[type="range"] {
  grid-column: 1 / -1;
  width: 100%;
  height: 34px;
  accent-color: var(--accent);
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
  background: transparent;
  --fig-thumb-w: 27px;
  --fig-thumb-h: 16px;
  --fig-rail: linear-gradient(to right, var(--accent) var(--fig-fill, 0%), var(--fig-track) 0%);
}
.doc-fig-ctl input[type="range"]::-webkit-slider-runnable-track {
  height: 6px;
  background: var(--fig-rail);
  border-radius: var(--r-pill);
}
.doc-fig-ctl input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: var(--fig-thumb-w);
  height: var(--fig-thumb-h);
  margin-top: calc((6px - var(--fig-thumb-h)) / 2);
  border-radius: var(--r-pill);
  background: var(--accent);
  transform: scale(var(--doc-thumb-scale, 1));
}
.doc-fig-ctl input[type="range"]::-moz-range-track {
  height: 6px;
  background: var(--fig-rail);
  border-radius: var(--r-pill);
}
.doc-fig-ctl input[type="range"]::-moz-range-thumb {
  width: var(--fig-thumb-w);
  height: var(--fig-thumb-h);
  border: 0;
  border-radius: var(--r-pill);
  background: var(--accent);
  transform: scale(var(--doc-thumb-scale, 1));
}

/* 图中颜色跟随主题；描边与图板同一缩放倍率。 */
.doc-fig svg text {
  font-family: var(--font-body);
  font-size: 13px;
  fill: var(--ink-2);
}
.doc-fig svg .fig-accent-text {
  fill: var(--accent);
  font-weight: 650;
}
.doc-fig .frame,
.doc-fig .gridline,
.doc-fig .leader,
.doc-fig .shape,
.doc-fig .shape-accent,
.doc-fig .fig-selection-ring,
.doc-fig .curve,
.doc-fig .curve-accent,
.doc-fig .curve-cool,
.doc-fig .mask,
.doc-fig .fig-detail,
.doc-fig .fig-handle-line,
.doc-fig .fig-fringe-warm,
.doc-fig .fig-fringe-cool {
  fill: none;
  stroke-width: 1.2;
}
.doc-fig .frame,
.doc-fig .gridline,
.doc-fig .leader {
  stroke: var(--fig-track);
}
.doc-fig .leader {
  stroke: color-mix(in srgb, var(--ink) 32%, transparent);
}
.doc-fig .shape {
  fill: var(--shape-fill);
  stroke: var(--ink-2);
}
.doc-fig .fig-ab-spot {
  fill: color-mix(in srgb, var(--ink) 17%, transparent);
}
.doc-fig .shape-accent,
.doc-fig .fig-selection-ring {
  stroke: var(--accent);
}
.doc-fig .fig-selected {
  fill: var(--tint-coral);
}
.doc-fig .curve {
  stroke: var(--ink-3);
  stroke-dasharray: 5 5;
}
.doc-fig .curve-accent {
  stroke: var(--accent);
}
.doc-fig .curve-cool {
  stroke: var(--moss);
}
.doc-fig .dot {
  fill: var(--accent);
}
.doc-fig .mask {
  stroke: var(--moss);
  stroke-dasharray: 3 4;
}
.doc-fig .fig-inset,
.doc-fig .fig-scene {
  fill: var(--bg);
}
.doc-fig .fig-fringe-warm {
  stroke: var(--accent);
}
.doc-fig .fig-fringe-cool {
  stroke: var(--moss);
}
.doc-fig .fig-detail {
  stroke: var(--ink-2);
}
.doc-fig[data-fig="foreground"] {
  --fg-person: color-mix(in srgb, var(--moss) 76%, var(--bg));
}
.doc-fig .fg-water {
  fill: color-mix(in srgb, var(--ink-3) 8%, var(--bg));
}
.doc-fig .fg-ridge {
  fill: color-mix(in srgb, var(--moss) 14%, var(--bg));
  stroke: color-mix(in srgb, var(--ink-2) 64%, var(--bg));
  stroke-width: 1.2;
  stroke-linejoin: round;
}
.doc-fig .fg-ripples {
  fill: none;
  stroke: color-mix(in srgb, var(--ink-3) 56%, var(--bg));
  stroke-width: 1.2;
  stroke-linecap: round;
}
.doc-fig .fg-person {
  fill: var(--fg-person);
}
.doc-fig .fg-head {
  fill: color-mix(in srgb, var(--fg-person) 82%, var(--ink-2));
}
.doc-fig .fig-handle-face {
  fill: var(--accent);
}
.doc-fig .fig-handle-line {
  stroke: var(--bg);
  stroke-linecap: round;
  stroke-linejoin: round;
}
.doc-fig .fig-divider > .fig-handle-line:first-child {
  stroke: var(--accent);
  opacity: 0.68;
}
.doc-fig .fig-coral {
  --fig-curve: var(--accent);
}
.doc-fig .fig-plot-guide {
  stroke: var(--fig-curve);
  stroke-width: 1.2;
}
.doc-fig .fig-plot-point {
  fill: var(--fig-curve);
}
[data-fig-ready] [data-fig-drag="edgeEnhance"] {
  cursor: ns-resize;
}
.doc-fig .fig-moss {
  --fig-curve: var(--moss);
}
.doc-fig .fig-cursor > path {
  fill: none;
  stroke: var(--fig-curve);
  stroke-width: 1.2;
}
.doc-fig .fig-cursor rect:not(.fig-hit) {
  fill: var(--fig-curve);
}
.doc-fig svg .fig-cursor-value {
  fill: var(--bg);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 650;
}
.doc-fig .fig-hit {
  fill: transparent;
}
[data-fig-ready] [data-fig-drag] {
  touch-action: none;
  cursor: ew-resize;
}
[data-fig-ready] .fig-center-handle {
  cursor: grab;
}
.doc-fig [data-dragging="center"] {
  cursor: grabbing;
}
.doc-fig .fig-drag-hint {
  display: none;
}
[data-drag-hint] .fig-drag-hint {
  display: block;
  pointer-events: none;
}
.fig-drag-hint rect {
  fill: var(--bg);
}

/* 分组折叠：内容一直保有自然高度，由网格逐帧裁剪。 */
.doc-disclosure { display: grid; grid-template-rows: minmax(0, var(--doc-disclosure-track, 1fr)); }
.doc-disclosure[hidden] { display: none; }
.doc-disclosure > * { min-height: 0; overflow: clip; }

/* 同一条弹簧同时驱动侧栏宽度、间距及透明度。 */
@media screen and (min-width: 1081px) {
  .doc-shell {
    --doc-side-width: 250px;
    --doc-side-gap: 64px;
    --doc-toc-width: 176px;
    --doc-toc-gap: 64px;
    grid-template-columns:
      calc(var(--doc-side-width) * var(--doc-side-open, 1))
      calc(var(--doc-side-gap) * var(--doc-side-open, 1))
      minmax(0, 820px) var(--doc-toc-gap) var(--doc-toc-width);
    gap: 0;
  }
  .doc-sidebar { grid-column: 1; min-width: 0; overflow-x: hidden; opacity: var(--doc-side-open, 1); }
  /* 宽度留出滚动条与右侧余量，条目 pill 不再被右缘裁掉；
     展开时内容从左侧画面外滑入，同时列宽增长把正文往右推。 */
  .doc-sidebar .doc-nav {
    width: var(--doc-side-width);
    padding-right: 10px;
    transform: translateX(calc((var(--doc-side-open, 1) - 1) * 100%));
  }
  .doc-main { grid-column: 3; }
  .doc-toc { grid-column: 5; }
  @media (max-width: 1280px) {
    .doc-shell {
      --doc-side-width: 224px;
      --doc-side-gap: 40px;
      --doc-toc-width: 0px;
      --doc-toc-gap: 0px;
    }
  }
}

/* ---------- 页脚 ---------- */
.doc-foot {
  border-top: 1px solid var(--hairline);
}
.doc-foot-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px 32px;
  width: min(100%, 1440px);
  margin-inline: auto;
  padding: 26px 32px;
  font-size: 13px;
  color: var(--ink-3);
}
.doc-foot-copy { flex: none; }
/* 右下角一整组：社媒与邮箱在前，站点链接在后；放不下就折成两行，仍靠右对齐 */
.doc-foot-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 10px 22px;
  min-width: 0;
}
.doc-foot a:hover {
  color: var(--ink);
}
.doc-foot-links a,
.doc-foot-email {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  color: inherit;
  cursor: pointer;
  transition: color 0.2s var(--ease);
}
.doc-foot-links a:hover,
.doc-foot-email:hover {
  color: var(--ink);
}
.doc-foot-links .doc-icon {
  width: 15px;
  height: 15px;
}
.doc-foot-email-addr {
  color: var(--accent);
  cursor: pointer;
  word-break: break-all;
}
.doc-foot-email-addr[hidden] {
  display: none;
}

/* ---------- 抽屉遮罩 ---------- */
.doc-nav-scrim {
  position: fixed;
  inset: 0;
  z-index: 110;
  background: rgba(12, 14, 10, 0.5);
  backdrop-filter: blur(2px);
  opacity: var(--doc-drawer-open, 0);
  pointer-events: none;
}
body.doc-nav-open .doc-nav-scrim {
  pointer-events: auto;
}
.doc-nav-scrim[hidden] {
  display: none;
}

.doc-body:not(:has(.doc-sidebar)) .doc-menu-btn { display: none; }

/* 两个主题快照叠放，旧快照按弹簧曲线离场。 */
html.doc-theme-transition::view-transition-old(root) {
  animation: doc-theme-out 0.55s var(--ease) both;
  mix-blend-mode: normal;
  z-index: 1;
}
html.doc-theme-transition::view-transition-new(root) {
  animation: none;
  mix-blend-mode: normal;
}
html.doc-theme-transition::view-transition { pointer-events: none; }
@keyframes doc-theme-out { to { opacity: 0; } }

/* ---------- 响应式 ---------- */
@media (max-width: 1280px) {
  .doc-toc {
    display: none;
  }
}

@media (max-width: 1080px) {
  .doc-head { z-index: 130; }
  .doc-menu-btn {
    display: inline-flex;
  }
  .doc-topnav {
    display: none;
  }
  .doc-shell {
    display: block;
    padding: calc(var(--head-h) + 24px) 24px 80px;
  }
  .doc-main {
    max-width: 760px;
    margin-inline: auto;
  }
  .doc-sidebar {
    position: fixed;
    z-index: 120;
    top: 0;
    left: 0;
    width: min(84vw, 340px);
    height: 100vh;
    max-height: none;
    padding: calc(var(--head-h) + 20px) 24px var(--space-8);
    background: var(--bg);
    transform: translateX(calc(-101% * (1 - var(--doc-drawer-open, 0))));
  }
  body.doc-nav-open {
    overflow: hidden;
  }
  .doc-brand-tail {
    display: none;
  }
}

@media (max-width: 760px) {
  :root {
    --head-h: 62px;
  }
  .doc-head-inner {
    gap: 12px;
    padding: 0 18px;
  }
  .doc-shell {
    padding: calc(var(--head-h) + 16px) 18px 64px;
  }
  .doc-brand-name {
    font-size: 21px;
  }
  .doc-spec-row {
    grid-template-columns: 1fr;
    gap: 2px;
  }
  .doc-foot-inner {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
    padding-inline: 18px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}

/* ---------- 打印 ---------- */
@media print {
  body {
    background: #fff;
    color: #111;
  }
  .doc-head,
  .doc-sidebar,
  .doc-toc,
  .doc-foot,
  .doc-search,
  .doc-pager,
  .doc-nav-scrim,
  .doc-fig-interaction,
  .doc-inline-search,
  .doc-skip,
  .doc-fig-controls {
    display: none !important;
  }
  .doc-shell {
    display: block;
    padding: 0;
  }
  .doc-article {
    max-width: none;
  }
  .doc-article h1,
  .doc-section h2,
  .doc-article p,
  .doc-article li,
  .doc-article td {
    color: #111;
  }
  .doc-article a {
    color: #111;
  }
}

html[data-theme="dark"] .doc-chip.is-on,
html[data-theme="dark"] .doc-buy {
  color: #231015;
}

/* ---------- 首页版式统一为左对齐编辑体 ---------- */
.doc-home-wrap {
  width: min(100%, 1120px);
  margin-inline: auto;
  padding: calc(var(--head-h) + 40px) 32px 96px;
}
.doc-main-home {
  padding: 0;
}
.doc-hero {
  max-width: 820px;
  margin: 0;
  text-align: left;
}
.doc-hero-title {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(38px, 4.2vw, 56px);
  line-height: 1.03;
  letter-spacing: -0.024em;
  text-wrap: balance;
  color: var(--accent);
}
.doc-hero-lead {
  max-width: var(--text-width);
  margin: 24px 0 0;
  font-size: 17px;
  line-height: 1.78;
  color: var(--ink-2);
}
.doc-home-heading {
  font-family: var(--font-display);
  font-weight: 400;
  line-height: 1.25;
  margin-bottom: 20px;
  font-size: clamp(22px, 2.3vw, 28px);
  text-align: left;
  color: var(--accent);
}
.doc-home-block {
  margin-bottom: 72px;
}
.doc-card-grid {
  align-items: stretch;
}
.doc-card {
  gap: 12px;
}
.doc-card-desc {
  flex: 0 0 auto;
}
.doc-card-links {
  margin-top: auto;
}

/* 首页卡片：链接区不再画分隔线（各卡行数不同，线会对不齐） */
.doc-card-links {
  padding-top: 0;
  border-top: 0;
}


@media (max-width: 760px) {
  .doc-home-wrap {
    padding-inline: 18px;
  }
  .doc-home-block {
    margin-bottom: 48px;
  }
  .doc-card-grid,
  .doc-topic-list {
    grid-template-columns: 1fr;
  }
}

/* ---------- 共用线条图标 ---------- */
.doc-icon {
  display: inline-block;
  width: 16px;
  height: 16px;
  flex: none;
  vertical-align: -0.15em;
}
.doc-nav-group > summary > span,
.doc-nav-sub > summary > span,
.doc-nav-single > a {
  display: flex;
  align-items: center;
  gap: 8px;
}
.doc-nav-group > summary > .doc-icon,
.doc-nav-sub > summary > .doc-icon {
  width: 12px;
  height: 12px;
  margin-right: 2px;
  color: var(--ink-3);
  transform: rotate(calc(45deg + var(--doc-chevron-angle, -45deg)));
}
.doc-nav-group[open] > summary > .doc-icon,
.doc-nav-sub[open] > summary > .doc-icon {
  transform: rotate(calc(45deg + var(--doc-chevron-angle, 45deg)));
}
.doc-toc-toggle > .doc-icon {
  width: 14px;
  height: 14px;
  transform: rotate(calc(-45deg + var(--doc-chevron-angle, 45deg)));
}
.doc-article .doc-callout-label {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 6px;
  font-size: 14px;
  line-height: 1.5;
  color: var(--ink-2);
}
.doc-callout-label > .doc-icon {
  color: var(--ink-3);
}
.doc-callout-important .doc-callout-label > .doc-icon,
.doc-callout-warning .doc-callout-label > .doc-icon {
  color: var(--ink-clay);
}
.doc-article a[target="_blank"] > .doc-icon {
  width: 0.8em;
  height: 0.8em;
  margin-left: 0.18em;
}
.doc-related-links a {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.doc-related-links a > .doc-icon {
  width: 13px;
  height: 13px;
}
.doc-inline-gap {
  display: inline-block;
  width: 1em;
}

/* ---------- 首页原位搜索 ---------- */
.doc-hero-search-slot {
  width: min(100%, 520px);
  margin-top: 32px;
}
.doc-hero-search-slot > .doc-hero-search {
  width: 100%;
  min-height: 52px;
  margin: 0;
  padding-block: 8px;
}
.doc-hero-search-slot > [hidden],
.doc-home-stage > [hidden] {
  display: none;
}
.doc-hero-search-active:focus-within {
  background: color-mix(in srgb, var(--accent) 8%, var(--bg-raise));
}
.doc-hero-search-active input {
  flex: 1;
  min-width: 0;
  background: transparent;
  border: 0;
  font-size: 15px;
  outline: 0;
}
.doc-hero-search-active input::placeholder {
  color: var(--ink-3);
}
.doc-hero-search-active input::-webkit-search-cancel-button {
  display: none;
}
.doc-hero-search-close {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: var(--r-icon);
}
.doc-hero-search-close:hover {
  background: var(--tint-coral);
  color: var(--accent);
}
.doc-home-stage {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: start;
}
.doc-home-stage > * {
  grid-area: 1 / 1;
}
.doc-home-browse {
  opacity: calc(1 - var(--doc-search-open, 0));
  translate: 0 calc(28px * var(--doc-search-open, 0));
}
.doc-home-browse > .doc-home-block:first-of-type {
  margin-top: 56px;
}
.doc-inline-search {
  width: min(100%, 720px);
  margin-top: 16px;
  opacity: var(--doc-search-open, 0);
  translate: 0 calc(12px * (1 - var(--doc-search-open, 0)));
}
.doc-inline-search .doc-search-results {
  display: grid;
  gap: 6px;
  overflow: visible;
  border: 0;
}
.doc-inline-search .doc-search-result {
  padding: 11px 16px;
  border: 0;
  border-radius: var(--r-field);
  background: var(--bg-raise);
}
.doc-inline-search .doc-search-result:hover,
.doc-inline-search .doc-search-result:focus-visible,
.doc-inline-search .doc-search-result.is-active {
  background: color-mix(in srgb, var(--accent) 11%, var(--bg-raise));
}
.doc-search-result-meta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.doc-search-result-meta > .doc-icon {
  width: 13px;
  height: 13px;
}
.doc-inline-search .doc-search-result-desc {
  -webkit-line-clamp: 2;
}
.doc-inline-search .doc-search-empty {
  padding-inline: 0;
  border: 0;
}
.doc-inline-search .doc-search-result.is-active,
.doc-search-result.is-active {
  color: var(--accent);
}

/* ---------- 图板操作 ---------- */
.doc-fig :is(.doc-fig-reset, .doc-lens-toggle) {
  scale: calc(1 + 0.07 * var(--doc-hover, 0));
}
[data-fig-ready] .doc-fig-reset {
  display: grid;
  place-items: center;
  position: absolute;
  top: 7px;
  right: 7px;
  width: 33px;
  height: 33px;
  border: 0;
  background: var(--bg);
}
.doc-fig-reset:hover {
  background: var(--tint-coral);
  color: var(--accent);
}
[data-fig-ready] .doc-lens-toggle {
  display: block;
  margin: 12px 0 0 auto;
}
.doc-lens-toggle[aria-pressed="true"] {
  background: var(--tint-coral);
  border-color: var(--accent);
  color: var(--accent);
}
.doc-fig [data-dragging="center"] .fig-center-handle {
  cursor: grabbing;
}

@media (max-width: 760px) {
  .doc-home-browse > .doc-home-block:first-of-type {
    margin-top: 36px;
  }
}

.doc-nav-group > summary > span,
.doc-nav-sub > summary > span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
/* 条目长标题改为自行换行：不再单行省略被裁，换行按词组折，不断词 */
.doc-nav-items > a {
  min-width: 0;
  overflow-wrap: break-word;
  text-wrap: pretty;
}
.doc-nav-group > summary > span > .doc-icon {
  flex-shrink: 0;
}

.doc-fig .fig-focus-band,
.doc-fig .fig-edge-sample {
  fill: color-mix(in srgb, var(--accent) 23%, transparent);
}

@media (max-width: 760px) {
  .doc-param-table .doc-table {
    min-width: 0;
    table-layout: fixed;
  }
  .doc-param-table .doc-table th:first-child {
    width: 29%;
  }
  .doc-param-table .doc-table th:last-child {
    width: 19%;
  }
  .doc-param-table .doc-table th,
  .doc-param-table .doc-table td {
    padding-inline: 12px;
    overflow-wrap: anywhere;
    white-space: normal;
  }
}
