
  :root {
    --bg: #f2f2f7;
    --surface: #ffffff;
    --surface-2: rgba(118, 118, 128, .12);
    --surface-3: rgba(118, 118, 128, .2);
    --line: rgba(60, 60, 67, .29);
    --text: #000000;
    --muted: rgba(60, 60, 67, .6);
    --muted-2: rgba(60, 60, 67, .3);
    --accent: #007aff;
    --accent-soft: rgba(0, 122, 255, .1);
    --ok: #248a3d;
    --ok-soft: rgba(36, 138, 61, .12);
    --err: #d70015;
    --err-soft: rgba(215, 0, 21, .1);
    --warn: #b25000;
    --warn-soft: rgba(178, 80, 0, .12);
    --radius: 16px;
    --radius-sm: 10px;
    --radius-pill: 980px;
    --shadow: 0 1px 2px rgba(0, 0, 0, .04), 0 8px 24px rgba(0, 0, 0, .06);
    --nav-bg: rgba(249, 249, 249, .82);
    --code-bg: #1c1c1e;
    --code-text: #f2f2f7;
    --sidebar: 248px;
  }
  @media (prefers-color-scheme: dark) {
    :root {
      --bg: #000000;
      --surface: #1c1c1e;
      --surface-2: rgba(118, 118, 128, .24);
      --surface-3: rgba(118, 118, 128, .36);
      --line: rgba(84, 84, 88, .65);
      --text: #ffffff;
      --muted: rgba(235, 235, 245, .6);
      --muted-2: rgba(235, 235, 245, .3);
      --accent: #0a84ff;
      --accent-soft: rgba(10, 132, 255, .18);
      --ok: #30d158;
      --ok-soft: rgba(48, 209, 88, .16);
      --err: #ff453a;
      --err-soft: rgba(255, 69, 58, .16);
      --warn: #ff9f0a;
      --warn-soft: rgba(255, 159, 10, .16);
      --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .4);
      --nav-bg: rgba(28, 28, 30, .82);
      --code-bg: #0d0d0f;
    }
  }

  * { box-sizing: border-box; }
  /* 吸顶导航高 56px，靠目标元素自己的 scroll-margin-top 让开位置。
     这里再加 scroll-padding-top 的话两者会叠加，锚点会多滚 76px。 */
  html { scroll-behavior: smooth; }
  body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", Roboto, sans-serif;
    font-size: 15px;
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
  }
  code, pre, .mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Courier New", monospace; }

  /* Top bar */
  .topbar {
    position: sticky;
    top: 0;
    z-index: 30;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    height: 56px;
    padding: 0 20px;
    border-bottom: 1px solid var(--line);
    background: var(--nav-bg);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    backdrop-filter: saturate(180%) blur(20px);
  }
  .brand { display: flex; align-items: center; gap: 10px; min-width: 0; text-decoration: none; color: inherit; }
  .brand-mark {
    display: block;
    width: 30px;
    height: 30px;
    border-radius: 8px;
    object-fit: cover;
    background: #000;
  }
  .brand-name { font-size: 15px; font-weight: 640; line-height: 1.2; }
  .brand-sub { display: block; color: var(--muted); font-size: 11px; line-height: 1.2; }
  .topbar-actions { display: flex; align-items: center; gap: 8px; }
  .top-link {
    padding: 6px 12px;
    border-radius: var(--radius-pill);
    color: var(--accent);
    font-size: 14px;
    text-decoration: none;
    white-space: nowrap;
  }
  .top-link:hover { background: var(--accent-soft); }
  .menu-btn {
    display: none;
    min-height: 32px;
    padding: 0 12px;
    border: 1px solid var(--line);
    border-radius: var(--radius-pill);
    background: var(--surface);
    color: var(--text);
    font-size: 13px;
    cursor: pointer;
  }

  /* Layout */
  .shell { display: grid; grid-template-columns: var(--sidebar) minmax(0, 1fr); gap: 32px; width: min(1200px, calc(100% - 40px)); margin: 0 auto; padding: 28px 0 96px; }
  .sidebar { position: sticky; top: 76px; align-self: start; max-height: calc(100vh - 96px); overflow-y: auto; padding-right: 4px; }
  .sidebar h4 { margin: 18px 0 6px; color: var(--muted); font-size: 11px; font-weight: 640; letter-spacing: .06em; text-transform: uppercase; }
  .sidebar h4:first-child { margin-top: 0; }
  .sidebar a {
    display: block;
    padding: 5px 10px;
    border-radius: 7px;
    color: var(--text);
    font-size: 13.5px;
    text-decoration: none;
  }
  .sidebar a:hover { background: var(--surface-2); }
  .sidebar a.active { background: var(--accent-soft); color: var(--accent); font-weight: 590; }
  .sidebar a .verb { display: inline-block; width: 40px; color: var(--muted); font-size: 10px; font-weight: 700; letter-spacing: .04em; }

  .content { min-width: 0; }
  h1 { margin: 0 0 8px; font-size: 34px; line-height: 1.14; font-weight: 700; letter-spacing: -.022em; }
  .lede { margin: 0 0 8px; color: var(--muted); font-size: 16px; }
  h2 {
    margin: 44px 0 14px;
    padding-top: 8px;
    font-size: 24px;
    font-weight: 660;
    letter-spacing: -.014em;
    scroll-margin-top: 76px;
  }
  h3 { margin: 26px 0 10px; font-size: 17px; font-weight: 620; scroll-margin-top: 76px; }
  h4 { margin: 18px 0 8px; font-size: 14px; font-weight: 620; color: var(--muted); }
  p { margin: 0 0 12px; }
  ul, ol { margin: 0 0 12px; padding-left: 22px; }
  li { margin-bottom: 5px; }
  a { color: var(--accent); }

  .card { margin-bottom: 16px; padding: 20px 22px; border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); }
  .card > :last-child { margin-bottom: 0; }

  /* Endpoint blocks */
  .endpoint { margin-bottom: 18px; padding: 0; border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); overflow: hidden; scroll-margin-top: 76px; }
  .endpoint-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 16px 22px; border-bottom: 1px solid var(--line); }
  .verb-tag {
    padding: 3px 9px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .05em;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  }
  .verb-get { background: var(--ok-soft); color: var(--ok); }
  .verb-post { background: var(--accent-soft); color: var(--accent); }
  .verb-delete { background: var(--err-soft); color: var(--err); }
  .endpoint-path { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 15px; font-weight: 600; overflow-wrap: anywhere; }
  .endpoint-title { color: var(--muted); font-size: 13.5px; }
  .endpoint-body { padding: 18px 22px; }
  .endpoint-body > :last-child { margin-bottom: 0; }

  .badge {
    display: inline-block;
    padding: 2px 9px;
    border-radius: var(--radius-pill);
    background: var(--surface-2);
    color: var(--muted);
    font-size: 11.5px;
    font-weight: 560;
    white-space: nowrap;
  }
  .badge-key { background: var(--accent-soft); color: var(--accent); }
  .badge-open { background: var(--ok-soft); color: var(--ok); }
  .badge-cost { background: var(--warn-soft); color: var(--warn); }

  /* Tables */
  table { width: 100%; margin: 0 0 14px; border-collapse: collapse; font-size: 13.5px; }
  th, td { padding: 9px 12px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); }
  th { color: var(--muted); font-size: 11.5px; font-weight: 640; letter-spacing: .04em; text-transform: uppercase; white-space: nowrap; }
  tr:last-child td { border-bottom: 0; }
  td code, p code, li code, h3 code, .card code { padding: 1px 6px; border-radius: 5px; background: var(--surface-2); font-size: 12.5px; overflow-wrap: anywhere; }
  .req { color: var(--err); font-size: 11px; font-weight: 640; }
  .opt { color: var(--muted); font-size: 11px; }
  .table-wrap { overflow-x: auto; }
  /* 参数名和它后面的「必填 / 可选」不该被拆到两行；窄屏靠 .table-wrap 横向滚动 */
  .table-wrap td:first-child { white-space: nowrap; }
  .table-wrap td:first-child code { overflow-wrap: normal; }
  .contract-table { min-width: 680px; }
  .contract-table td:first-child { white-space: normal; min-width: 180px; width: 32%; }
  .contract-table td:first-child code { display: inline-block; }

  /* Code blocks */
  pre {
    margin: 0 0 14px;
    padding: 15px 17px;
    border-radius: var(--radius-sm);
    background: var(--code-bg);
    color: var(--code-text);
    font-size: 12.5px;
    line-height: 1.65;
    overflow-x: auto;
  }
  pre code { padding: 0; background: none; font-size: inherit; color: inherit; }
  .code-block { position: relative; }
  .copy-btn {
    position: absolute;
    top: 9px;
    right: 9px;
    padding: 3px 10px;
    border: 0;
    border-radius: 6px;
    background: rgba(255, 255, 255, .14);
    color: #f2f2f7;
    font-size: 11px;
    cursor: pointer;
    opacity: 0;
    transition: opacity .15s;
  }
  .code-block:hover .copy-btn, .copy-btn:focus { opacity: 1; }
  .copy-btn:hover { background: rgba(255, 255, 255, .26); }

  /* Tabs */
  .tabs { display: flex; gap: 2px; margin-bottom: 10px; padding: 2px; border-radius: 9px; background: var(--surface-2); }
  .tab {
    flex: 1;
    min-height: 30px;
    border: 0;
    border-radius: 7px;
    background: transparent;
    color: var(--text);
    font-size: 13px;
    font-weight: 560;
    cursor: pointer;
  }
  .tab.active { background: var(--surface); box-shadow: 0 1px 2px rgba(0, 0, 0, .12); }
  .tab-panel { display: none; }
  .tab-panel.active { display: block; }

  .note {
    margin: 0 0 14px;
    padding: 12px 15px;
    border-left: 3px solid var(--accent);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    background: var(--accent-soft);
    font-size: 13.5px;
  }
  .note > :last-child { margin-bottom: 0; }
  .note.warn { border-left-color: var(--warn); background: var(--warn-soft); }
  .note.danger { border-left-color: var(--err); background: var(--err-soft); }
  .note b { font-weight: 640; }
  .hidden { display: none !important; }

  .toc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(232px, 1fr)); gap: 10px; }
  .toc-card { padding: 13px 15px; border-radius: var(--radius-sm); background: var(--surface-2); text-decoration: none; color: inherit; }
  .toc-card:hover { background: var(--surface-3); }
  .toc-card b { display: block; font-size: 14px; font-weight: 620; }
  .toc-card span { color: var(--muted); font-size: 12.5px; }

  .guide-jump {
    display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 16px;
  }
  .guide-jump a {
    padding: 6px 12px; border-radius: var(--radius-pill);
    background: var(--surface-2); color: inherit; text-decoration: none; font-size: 13px;
  }
  .guide-jump a:hover { background: var(--surface-3); }

  footer { margin-top: 48px; padding-top: 20px; border-top: 1px solid var(--line); color: var(--muted); font-size: 13px; }

  @media (max-width: 900px) {
    .shell { grid-template-columns: minmax(0, 1fr); gap: 0; width: calc(100% - 32px); }
    .menu-btn { display: block; }
    .sidebar {
      position: fixed;
      inset: 56px 0 auto;
      z-index: 25;
      max-height: calc(100vh - 56px);
      margin: 0;
      padding: 14px 20px 22px;
      border-bottom: 1px solid var(--line);
      background: var(--surface);
      box-shadow: var(--shadow);
    }
    .sidebar.hidden { display: none; }
    h1 { font-size: 28px; }
    .endpoint-head, .endpoint-body, .card { padding-left: 16px; padding-right: 16px; }
  }
