:root {
  color-scheme: light;
  --theme-page: #f7f7fc;
  --theme-surface: #fff;
  --theme-raised: #fcfbff;
  --theme-ink: #201a32;
  --theme-muted: #625e75;
  --theme-line: #e7e5ef;
  --theme-control: #9286a3;
  --theme-accent: #6542d8;
  --theme-accent-hover: #5431bd;
  --theme-link: #5431bd;
  --theme-tint: #f1edff;
  --theme-focus: #8762e6;
  --theme-success: #126844;
  --theme-success-bg: #eaf8f1;
  --theme-error: #ab283f;
  --theme-error-bg: #fff0f2;
  --theme-glow: #ece5ff;
  --theme-shadow-color: #201a3210;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --theme-page: #14111e;
  --theme-surface: #1d1929;
  --theme-raised: #241e32;
  --theme-ink: #f2edf9;
  --theme-muted: #bcb2ce;
  --theme-line: #3c334c;
  --theme-control: #7a6d8c;
  --theme-accent: #704ada;
  --theme-accent-hover: #7952e2;
  --theme-link: #c6b4ff;
  --theme-tint: #302447;
  --theme-focus: #b7a0ff;
  --theme-success: #91e2b8;
  --theme-success-bg: #1e382f;
  --theme-error: #ffabc1;
  --theme-error-bg: #482635;
  --theme-glow: #2d2047;
  --theme-shadow-color: #0005;
}

select.theme-select {
  flex: 0 0 auto;
  width: auto;
  height: 38px;
  min-height: 38px;
  padding: 0 8px;
  border: 1px solid var(--theme-control);
  border-radius: 8px;
  color: var(--theme-link);
  background: var(--theme-surface);
  font: inherit;
  font-weight: 650;
  cursor: pointer;
}

.theme-select[hidden] { display: none; }
select.theme-select:hover { background: var(--theme-tint); }
select.theme-select:focus-visible { outline: 2px solid var(--theme-focus); outline-offset: 2px; }

:root:where(.docs-page) {
  font: 15px/1.65 Inter, system-ui, "Segoe UI", "Microsoft YaHei", sans-serif;
}
:where(html.docs-page) * { box-sizing: border-box; }
:where(html.docs-page) body { margin: 0; background: var(--theme-page); color: var(--theme-ink); }
:where(html.docs-page) h1, :where(html.docs-page) h2, :where(html.docs-page) h3, :where(html.docs-page) p, :where(html.docs-page) pre { margin: 0; }
:where(html.docs-page) a { color: var(--theme-link); text-underline-offset: .16em; }
:where(html.docs-page) :focus-visible { outline: 3px solid var(--theme-focus); outline-offset: 3px; }
:where(html.docs-page) .wrap { width: min(1080px, calc(100% - 48px)); margin-inline: auto; }
:where(html.docs-page) .top { background: var(--theme-surface); border-bottom: 1px solid var(--theme-line); }
:where(html.docs-page) .top .wrap { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 8px 18px; padding-block: 12px; }
:where(html.docs-page) .brand { display: flex; align-items: center; gap: 10px; color: var(--theme-ink); font-size: 17px; font-weight: 750; text-decoration: none; }
:where(html.docs-page) .brand-mark { display: block; width: 36px; height: 36px; flex: 0 0 auto; border-radius: 10px; box-shadow: 0 3px 8px var(--theme-glow); }
:where(html.docs-page) .nav { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; }
:where(html.docs-page) .nav a { display: inline-block; padding: 7px 10px; border-radius: 8px; color: var(--theme-muted); font-size: 14px; font-weight: 650; text-decoration: none; }
:where(html.docs-page) .nav a:is(:hover, :focus-visible, [aria-current="page"]) { color: var(--theme-link); background: var(--theme-tint); }
:where(html.docs-page) main { padding-block: 33px 56px; }
:where(html.docs-page) .intro { margin-bottom: 24px; }
:where(html.docs-page) h1 { font-size: clamp(30px, 5vw, 43px); line-height: 1.2; letter-spacing: -.04em; }
:where(html.docs-page) .intro p { color: var(--theme-muted); margin-top: 9px; }
:where(html.docs-page) .layout { display: grid; grid-template-columns: 190px minmax(0, 1fr); align-items: start; gap: 20px; }
:where(html.docs-page) .toc, :where(html.docs-page) article { min-width: 0; border: 1px solid var(--theme-line); border-radius: 16px; background: var(--theme-surface); box-shadow: 0 6px 20px var(--theme-shadow-color); }
:where(html.docs-page) .toc { position: sticky; top: 16px; display: grid; padding: 13px; gap: 3px; }
:where(html.docs-page) .toc strong { padding: 2px 7px 5px; font-size: 13px; }
:where(html.docs-page) .toc a { padding: 5px 7px; border-radius: 7px; color: var(--theme-muted); font-size: 14px; text-decoration: none; }
:where(html.docs-page) .toc a:is(:hover, :focus-visible) { color: var(--theme-link); background: var(--theme-tint); }
:where(html.docs-page) article { padding: clamp(17px, 4vw, 28px); overflow-wrap: anywhere; }
:where(html.docs-page) section { scroll-margin-top: 16px; }
:where(html.docs-page) section + section { border-top: 1px solid var(--theme-line); margin-top: 26px; padding-top: 23px; }
:where(html.docs-page) h2 { position: relative; font-size: 21px; line-height: 1.35; margin-bottom: 10px; }
:where(html.docs-page) h2::before {
  content: "";
  position: absolute;
  inset: .22em auto .22em -10px;
  width: 3px;
  border-radius: 3px;
  background: var(--theme-link);
  opacity: 0;
  transform: scaleY(.45);
}
:where(html.docs-page) section:target > h2 { color: var(--theme-link); }
:where(html.docs-page) section:target > h2::before { opacity: 1; transform: scaleY(1); }
:where(html.docs-page) h3 { font-size: 15px; margin-top: 15px; }
:where(html.docs-page) p + p, :where(html.docs-page) p + pre { margin-top: 9px; }
:where(html.docs-page) ul, :where(html.docs-page) ol { margin: 8px 0 0; padding-left: 22px; }
:where(html.docs-page) li + li { margin-top: 6px; }
:where(html.docs-page) code { font: .91em/1.55 ui-monospace, Consolas, monospace; }
:where(html.docs-page) :not(pre) > code { padding: 2px 4px; border-radius: 4px; background: var(--theme-tint); color: var(--theme-link); }
:where(html.docs-page) pre { padding: 12px 14px; border: 1px solid var(--theme-line); border-radius: 9px; background: var(--theme-raised); white-space: pre-wrap; }
:where(html.docs-page) .table-scroll { overflow-x: auto; margin-top: 10px; }
:where(html.docs-page) table { border-collapse: collapse; width: 100%; font-size: 14px; }
:where(html.docs-page) th, :where(html.docs-page) td { padding: 9px 10px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--theme-line); }
:where(html.docs-page) th { background: var(--theme-raised); }
:where(html.docs-page) th:first-child { width: 27%; }
:where(html.docs-page) .hint { padding: 10px 13px; border-radius: 9px; color: var(--theme-link); background: var(--theme-tint); }
@media (prefers-reduced-motion: no-preference) {
  html:where(.docs-page) { scroll-behavior: smooth; }
  :where(html.docs-page) .intro { animation: docs-enter .3s ease-out; }
  :where(html.docs-page) .nav a, :where(html.docs-page) .toc a { transition: background-color .16s ease, color .16s ease, transform .16s ease; }
  :where(html.docs-page) .nav a:active, :where(html.docs-page) .toc a:active { transform: translateY(1px); }
  :where(html.docs-page) h2 { transition: color .2s ease; }
  :where(html.docs-page) h2::before { transition: opacity .2s ease, transform .2s ease; }
}
@keyframes docs-enter {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}
@media (max-width: 680px) {
  :where(html.docs-page) .wrap { width: calc(100% - 32px); }
  :where(html.docs-page) .nav a { padding-inline: 6px; }
  :where(html.docs-page) main { padding-block: 24px 36px; }
  :where(html.docs-page) .layout { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  :where(html.docs-page) .toc { position: static; display: flex; flex-wrap: wrap; align-items: center; padding: 9px; }
  :where(html.docs-page) .toc strong { padding-block: 5px; }
  :where(html.docs-page) th, :where(html.docs-page) td { padding-inline: 7px; }
}
