/* V需API docs v3. Fonts: Chakra Petch, Noto Sans SC (SIL OFL 1.1), subset to this page. */
@font-face { font-family: "Chakra Petch"; font-style: normal; font-weight: 600; font-display: swap; src: url("/site-assets/docs-v3/chakra-petch-600.4efa07169605.woff2") format("woff2"); }
@font-face { font-family: "VN Sans SC"; font-style: normal; font-weight: 400; font-display: swap; src: url("/site-assets/docs-v3/vn-sans-sc-400.ee6c52f36de0.woff2") format("woff2"); }
@font-face { font-family: "VN Sans SC"; font-style: normal; font-weight: 700; font-display: swap; src: url("/site-assets/docs-v3/vn-sans-sc-700.bf4110a0ecc0.woff2") format("woff2"); }
@font-face { font-family: "VN Sans SC"; font-style: normal; font-weight: 900; font-display: swap; src: url("/site-assets/docs-v3/vn-sans-sc-900.ec8218e333e2.woff2") format("woff2"); }

  /* Layout: the homepage's console language applied to long-form reading — a sticky table of
     contents on a hairline rail, one reading column, code in terminal frames. Same tokens as
     /site-assets/homepage-v3 so the two pages read as one site. */
  :root {
    color-scheme: dark;
    --bg: #05080f;
    --bg-raise: #080d18;
    --panel: #0b1221;
    --panel-2: #101a2d;
    --line: rgba(122, 156, 255, 0.10);
    --line-2: rgba(122, 156, 255, 0.18);
    --fg: #e8eefb;
    --fg-2: #a2adc6;
    --fg-3: #66718b;
    --blue: #2f6bff;
    --blue-hi: #5d8dff;
    --cyan: #3ad7f3;
    --ok: #36d39a;
    --warn: #f5b84a;
    --on-blue: #ffffff;

    --f-cn: "VN Sans SC", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
    --f-display: "Chakra Petch", "VN Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
    --f-mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;

    --wrap: 1200px;
    --curve: cubic-bezier(0.2, 0, 0, 1);
  }

  * { box-sizing: border-box; }
  html { scroll-behavior: smooth; }
  body { margin: 0; background: var(--bg); color: var(--fg); font: 400 15px/1.75 var(--f-cn); -webkit-font-smoothing: antialiased; }
  a { color: inherit; text-decoration: none; }
  img { max-width: 100%; height: auto; display: block; }
  h1, h2, h3 { margin: 0; text-wrap: balance; }
  :focus-visible { outline: 2px solid var(--blue-hi); outline-offset: 3px; border-radius: 6px; }
  .wrap { width: 100%; max-width: var(--wrap); margin-inline: auto; padding-inline: 24px; }
  .icon { width: 16px; height: 16px; flex: none; stroke: currentColor; stroke-width: 1.5; fill: none; stroke-linecap: round; stroke-linejoin: round; }
  .skip-link { position: absolute; left: 16px; top: -48px; z-index: 50; padding: 8px 12px; border-radius: 8px; background: var(--blue); color: var(--on-blue); font-size: 14px; }
  .skip-link:focus { top: 12px; }

  .kicker {
    display: inline-flex; align-items: center; gap: 10px;
    font: 500 12px/1 var(--f-mono); letter-spacing: 0.16em; text-transform: uppercase; color: var(--cyan);
  }
  .kicker::before { content: ""; width: 22px; height: 1px; background: currentColor; opacity: 0.7; }

  /* ---------- header / footer (same as homepage v3) ---------- */
  .btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    height: 36px; padding-inline: 14px; border-radius: 8px; border: 0; cursor: pointer;
    font: 500 14px/1 var(--f-cn); white-space: nowrap;
    transition-property: background-color, box-shadow, scale; transition-duration: 150ms; transition-timing-function: var(--curve);
  }
  .btn:active { scale: 0.96; }
  .btn-primary { background: var(--blue); color: var(--on-blue); box-shadow: 0 0 0 1px rgba(255,255,255,0.10) inset, 0 8px 24px -8px rgba(47,107,255,0.65); }
  .btn-primary:hover { background: #3b77ff; }
  .site-header {
    position: sticky; top: env(safe-area-inset-top, 0px); z-index: 20;
    background: rgba(5, 8, 15, 0.72);
    backdrop-filter: saturate(140%) blur(14px); -webkit-backdrop-filter: saturate(140%) blur(14px);
    border-bottom: 1px solid var(--line);
  }
  .header-inner { display: flex; align-items: center; gap: 32px; height: 68px; }
  .brand img { width: 116px; }
  .nav { display: flex; gap: 28px; margin-inline-start: 8px; }
  .nav a { font-size: 14px; color: var(--fg-2); transition: color 150ms var(--curve); }
  .nav a:hover, .nav a[aria-current="page"] { color: var(--fg); }
  .nav a[aria-current="page"] { position: relative; }
  .nav a[aria-current="page"]::after { content: ""; position: absolute; left: 0; right: 0; bottom: -24px; height: 2px; background: var(--cyan); box-shadow: 0 0 10px rgba(58,215,243,0.7); }
  .header-actions { margin-inline-start: auto; display: flex; align-items: center; gap: 18px; }
  .header-actions .login { font-size: 14px; color: var(--fg-2); transition: color 150ms var(--curve); }
  .header-actions .login:hover { color: var(--fg); }
  .site-footer { border-top: 1px solid var(--line); }
  .footer-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding-block: 28px; color: var(--fg-3); font-size: 13px; }
  .footer-inner img { width: 92px; opacity: 0.85; }

  /* ---------- layout ---------- */
  /* Decoration sits in its own clipped layer: an overflow:hidden ancestor would stop the
     sticky table of contents from sticking. */
  .docs-top { position: relative; }
  .docs-deco { position: absolute; inset: 0 0 auto 0; height: 560px; overflow: hidden; pointer-events: none; }
  .docs-deco::before {
    content: ""; position: absolute; inset: 0; pointer-events: none;
    background-image: linear-gradient(var(--line) 1px, transparent 1px), linear-gradient(90deg, var(--line) 1px, transparent 1px);
    background-size: 56px 56px; background-position: -1px -1px;
    -webkit-mask-image: radial-gradient(ellipse 60% 90% at 80% 0%, #000 15%, transparent 70%);
            mask-image: radial-gradient(ellipse 60% 90% at 80% 0%, #000 15%, transparent 70%);
  }
  .docs-deco::after {
    content: ""; position: absolute; pointer-events: none; width: 640px; height: 360px; right: -80px; top: -160px;
    background: radial-gradient(closest-side, rgba(47,107,255,0.20), rgba(58,215,243,0.05) 60%, transparent);
  }
  .docs-layout {
    position: relative;
    display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 56px; align-items: start;
    padding-block: 0 96px;
  }

  /* ---------- table of contents ---------- */
  .docs-toc { position: sticky; top: calc(68px + 32px + env(safe-area-inset-top, 0px)); padding-top: 48px; }
  /* Chinese label: no tracking, no mono — both make CJK look scattered */
  .docs-toc-label { font: 500 12px/1 var(--f-cn); color: var(--fg-3); margin-bottom: 16px; }
  #toc { display: grid; border-left: 1px solid var(--line-2); }
  #toc a {
    position: relative; display: block; padding: 7px 0 7px 16px; font-size: 14px; line-height: 1.5; color: var(--fg-2);
    transition: color 150ms var(--curve);
  }
  #toc a:hover { color: var(--fg); }
  #toc a.is-active { color: var(--fg); }
  #toc a.is-active::before {
    content: ""; position: absolute; left: -1px; top: 8px; bottom: 8px; width: 2px; border-radius: 2px;
    background: var(--cyan); box-shadow: 0 0 10px rgba(58,215,243,0.8);
  }

  /* ---------- body ---------- */
  .docs-body { min-width: 0; max-width: 820px; }
  .docs-hero { position: relative; display: grid; gap: 18px; justify-items: start; padding-block: 56px 44px; margin-bottom: 8px; }
  .docs-hero h1 { font: 900 clamp(34px, 4.6vw, 52px)/1.12 var(--f-cn); letter-spacing: -0.025em; }
  .docs-hero p { margin: 0; color: var(--fg-2); font-size: 17px; max-width: 36em; }

  .docs-section { padding-top: 40px; scroll-margin-top: calc(68px + 16px); }
  .docs-section + .docs-section { border-top: 1px solid var(--line); margin-top: 16px; }
  .docs-section > h2 { display: flex; align-items: center; gap: 14px; margin: 0 0 14px; font: 700 24px/1.3 var(--f-cn); letter-spacing: -0.01em; }
  .docs-section > h2 .num {
    flex: none; display: inline-grid; place-items: center; min-width: 38px; height: 26px; padding-inline: 8px; border-radius: 7px;
    font: 600 13px/1 var(--f-display); letter-spacing: 0.04em; font-variant-numeric: tabular-nums;
    color: var(--cyan); background: rgba(58,215,243,0.07); box-shadow: 0 0 0 1px rgba(58,215,243,0.22) inset;
  }
  .docs-section > p { margin: 0 0 18px; color: var(--fg-2); max-width: 44em; }
  .docs-section h3 { margin: 36px 0 12px; font: 700 17px/1.4 var(--f-cn); color: var(--fg); }
  .docs-section h3:first-of-type { margin-top: 28px; }
  .docs-body strong { color: var(--fg); font-weight: 700; }
  .docs-muted { color: var(--fg-3); }
  .docs-link { color: var(--blue-hi); font-weight: 500; border-bottom: 1px solid rgba(93,141,255,0.35); transition: color 150ms var(--curve), border-color 150ms var(--curve); }
  .docs-link:hover { color: var(--cyan); border-color: rgba(58,215,243,0.5); }

  /* inline code */
  .docs-body :not(pre) > code {
    font: 400 0.88em/1.5 var(--f-mono); color: var(--fg);
    background: rgba(122,156,255,0.08); box-shadow: 0 0 0 1px var(--line) inset;
    border-radius: 5px; padding: 2px 6px; overflow-wrap: anywhere;
  }

  /* ---------- card / notes ---------- */
  .docs-card {
    margin: 0 0 18px; padding: 18px 20px; border-radius: 12px;
    background: var(--panel); box-shadow: 0 0 0 1px var(--line-2) inset, 0 20px 40px -28px rgba(0,0,0,0.9);
    color: var(--fg-2);
  }
  .docs-card p { margin: 0; }
  .docs-formula { font: 700 17px/1.6 var(--f-cn); color: var(--fg); }
  .docs-formula strong { font-weight: 700; }

  .docs-note { display: flex; gap: 12px; margin: 0 0 18px; padding: 14px 16px; border-radius: 10px; font-size: 14px; line-height: 1.7; color: var(--fg-2); }
  .docs-note .ico { flex: none; width: 18px; height: 18px; margin-top: 3px; stroke-width: 1.75; }
  .docs-note p { margin: 0; }
  .docs-note p + p { margin-top: 6px; }
  .docs-note-key { background: rgba(47,107,255,0.08); box-shadow: 0 0 0 1px rgba(93,141,255,0.22) inset; }
  .docs-note-key .ico { color: var(--blue-hi); }
  .docs-note-warn { background: rgba(245,184,74,0.07); box-shadow: 0 0 0 1px rgba(245,184,74,0.24) inset; }
  .docs-note-warn .ico { color: var(--warn); }

  /* ---------- code frames ---------- */
  .docs-code {
    position: relative; margin: 0 0 16px; padding: 5px; border-radius: 12px; overflow: hidden;
    background: var(--panel); box-shadow: 0 0 0 1px var(--line-2) inset, 0 24px 48px -30px rgba(0,0,0,0.9);
  }
  .docs-code-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 6px 8px 9px 10px; }
  .docs-code-head::before { content: ""; flex: none; width: 34px; height: 8px; background: radial-gradient(circle at 4px 4px, rgba(122,156,255,0.22) 3.5px, transparent 4px) 0 0 / 13px 8px repeat-x; }
  .docs-code-path { flex: 1; min-width: 0; font: 400 12px/1.4 var(--f-mono); color: var(--fg-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .docs-copy {
    flex: none; height: 26px; padding-inline: 10px; border-radius: 6px; border: 0; cursor: pointer;
    background: rgba(122,156,255,0.08); color: var(--fg-2); font: 500 12px/1 var(--f-cn);
    transition-property: background-color, color, scale; transition-duration: 150ms; transition-timing-function: var(--curve);
  }
  .docs-copy:hover { background: rgba(122,156,255,0.15); color: var(--fg); }
  .docs-copy:active { scale: 0.96; }
  .docs-copy[data-state="done"] { color: var(--ok); background: rgba(54,211,154,0.10); }
  .docs-copy[data-state="fail"] { color: var(--warn); }
  .docs-code pre { margin: 0; padding: 16px 18px; overflow-x: auto; border-radius: 8px; background: #060a13; box-shadow: 0 0 0 1px var(--line) inset; }
  .docs-code code { display: block; white-space: pre; font: 400 13.5px/1.75 var(--f-mono); color: var(--fg); }
  .docs-code .k { color: #8fb1ff; }
  .docs-code .s { color: #7fe0c4; }
  .docs-code .c { color: #4f5b75; }

  /* ---------- tables ---------- */
  .docs-table-wrap {
    margin: 0 0 18px; overflow-x: auto; border-radius: 12px;
    background: var(--panel); box-shadow: 0 0 0 1px var(--line-2) inset;
  }
  .docs-table { width: 100%; min-width: 520px; border-collapse: collapse; font-size: 14px; }
  .docs-table th, .docs-table td { padding: 12px 16px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); }
  /* colour and weight only — Chinese headers must not be widened by tracking or caps */
  .docs-table thead th { font-size: 13px; font-weight: 500; color: var(--fg-3); white-space: nowrap; background: rgba(122,156,255,0.03); }
  .docs-table td { color: var(--fg-2); }
  .docs-table tbody tr { transition: background-color 150ms var(--curve); }
  .docs-table tbody tr:hover { background: rgba(122,156,255,0.035); }
  .docs-table tbody tr:last-child td { border-bottom: 0; }
  .docs-table td code { white-space: nowrap; }
  .docs-table .col-tight { white-space: nowrap; color: var(--fg); }

  /* ---------- steps ---------- */
  .docs-steps { list-style: none; margin: 0 0 8px; padding: 0; counter-reset: s; }
  .docs-steps > li { position: relative; counter-increment: s; margin-left: 14px; padding: 0 0 22px 34px; border-left: 1px solid rgba(58,215,243,0.25); }
  .docs-steps > li:last-child { border-left-color: transparent; padding-bottom: 0; }
  .docs-steps > li::before {
    content: counter(s, decimal-leading-zero); position: absolute; left: -15px; top: -2px;
    width: 29px; height: 29px; border-radius: 50%; display: grid; place-items: center;
    background: var(--bg); color: var(--cyan); font: 600 11.5px/1 var(--f-display);
    box-shadow: 0 0 0 1px rgba(58,215,243,0.4) inset, 0 0 0 5px var(--bg);
  }
  .docs-steps strong { display: block; margin-bottom: 4px; font-size: 15px; }
  .docs-steps p { margin: 0; color: var(--fg-2); font-size: 14px; }

  /* ---------- OS tabs ---------- */
  .docs-tabs { display: inline-flex; flex-wrap: wrap; gap: 2px; margin: 0 0 12px; padding: 3px; border-radius: 10px; background: var(--bg-raise); box-shadow: 0 0 0 1px var(--line-2) inset; }
  .docs-tab {
    height: 30px; padding-inline: 12px; border-radius: 7px; border: 0; cursor: pointer;
    background: transparent; color: var(--fg-2); font: 500 13px/1 var(--f-cn);
    transition: background-color 150ms var(--curve), color 150ms var(--curve);
  }
  .docs-tab:hover { color: var(--fg); }
  .docs-tab[aria-selected="true"] { background: var(--panel-2); color: var(--fg); box-shadow: 0 0 0 1px var(--line-2) inset; }
  .docs-panel[hidden] { display: none; }

  /* ---------- section footer ---------- */
  .docs-foot {
    display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px;
    margin-top: 32px; padding-top: 24px; border-top: 1px solid var(--line); color: var(--fg-3); font-size: 14px;
  }
  .docs-foot a { color: var(--blue-hi); transition: color 150ms var(--curve); }
  .docs-foot a:hover { color: var(--cyan); }

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

  /* ---------- responsive ---------- */
  @media (max-width: 1000px) {
    .nav { display: none; }
    .docs-layout { grid-template-columns: minmax(0, 1fr); gap: 0; }
    /* the TOC becomes a sticky, scrollable chip row under the header */
    .docs-toc {
      position: sticky; top: calc(68px + env(safe-area-inset-top, 0px)); z-index: 10; padding-top: 0;
      margin-inline: -24px; padding-inline: 24px; background: rgba(5,8,15,0.88);
      backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-bottom: 1px solid var(--line);
    }
    .docs-toc-label { display: none; }
    #toc { display: flex; gap: 6px; border-left: 0; overflow-x: auto; padding-block: 10px; scrollbar-width: none; }
    #toc::-webkit-scrollbar { display: none; }
    #toc a { flex: none; padding: 6px 12px; border-radius: 999px; font-size: 13px; white-space: nowrap; box-shadow: 0 0 0 1px var(--line-2) inset; }
    #toc a.is-active { background: rgba(58,215,243,0.08); box-shadow: 0 0 0 1px rgba(58,215,243,0.35) inset; }
    #toc a.is-active::before { display: none; }
    .docs-section { scroll-margin-top: calc(68px + 56px); }
  }
  @media (max-width: 720px) {
    .wrap { padding-inline: 16px; }
    .docs-toc { margin-inline: -16px; padding-inline: 16px; }
    .header-actions .login { display: none; }
    .docs-hero { padding-block: 36px 28px; }
    .docs-section > h2 { font-size: 21px; }
  }
