:root {
  color-scheme: light dark;
  --bg: #ffffff;
  --surface: #ffffff;
  --surface-soft: #f7f8fa;
  --surface-raised: #ffffff;
  --panel: #f5f6f8;
  --ink: #1f2329;
  --heading: #171923;
  --strong: #171923;
  --muted: #707277;
  --nav: #505257;
  --top-nav: #303236;
  --line: #e6e8ec;
  --accent: #134cff;
  --accent-strong: #134cff;
  --link: #134cff;
  --soft: #e8efff;
  --code: #f4f6fa;
  --code-line: transparent;
  --pre-bg: #0f172a;
  --pre-ink: #eef3ff;
  --warn: #9a5b12;
  --quote-bg: #fff8ed;
  --topbar-bg: rgba(255, 255, 255, 0.98);
  --input-bg: #ffffff;
  --method-get-bg: #daf8e7;
  --method-get-ink: #16804b;
  --method-post-bg: #e5efff;
  --method-post-ink: #1d63e9;
  --method-put-bg: #fff1ce;
  --method-put-ink: #a56613;
  --method-delete-bg: #ffe3e3;
  --method-delete-ink: #d84343;
  --method-unknown-bg: #edf1f3;
  --method-unknown-ink: #5d6870;
  --shadow: 0 20px 48px rgba(15, 23, 42, 0.10);
  --layout-max: 1408px;
  --layout-gap: 43px;
  --sidebar-width: 288px;
  --content-width: 721px;
  --toc-width: 304px;
  --topbar-height: 112px;
  --content-offset: 40px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b0f19;
    --surface: #0f1523;
    --surface-soft: #111827;
    --surface-raised: #141c2c;
    --panel: #161f31;
    --ink: #e5e7eb;
    --heading: #f4f7fb;
    --strong: #f0f4fa;
    --muted: #9aa4b2;
    --nav: #b6bfcc;
    --top-nav: #c7ced9;
    --line: #263244;
    --accent: #7aa2ff;
    --accent-strong: #a8c0ff;
    --link: #8ab4ff;
    --soft: rgba(83, 131, 255, 0.18);
    --code: #151f2e;
    --code-line: #2b3a50;
    --pre-bg: #050812;
    --pre-ink: #e8eefc;
    --warn: #f5b35b;
    --quote-bg: rgba(245, 179, 91, 0.11);
    --topbar-bg: rgba(11, 15, 25, 0.96);
    --input-bg: #0f1726;
    --method-get-bg: rgba(31, 160, 92, 0.20);
    --method-get-ink: #73d99e;
    --method-post-bg: rgba(72, 126, 255, 0.20);
    --method-post-ink: #91b5ff;
    --method-put-bg: rgba(245, 179, 91, 0.20);
    --method-put-ink: #f5c56f;
    --method-delete-bg: rgba(248, 113, 113, 0.18);
    --method-delete-ink: #ff9a9a;
    --method-unknown-bg: rgba(156, 163, 175, 0.18);
    --method-unknown-ink: #cbd5e1;
    --shadow: 0 20px 52px rgba(0, 0, 0, 0.45);
  }
}

html[data-theme="light"] {
  color-scheme: light;
  --bg: #ffffff;
  --surface: #ffffff;
  --surface-soft: #f7f8fa;
  --surface-raised: #ffffff;
  --panel: #f5f6f8;
  --ink: #1f2329;
  --heading: #171923;
  --strong: #171923;
  --muted: #707277;
  --nav: #505257;
  --top-nav: #303236;
  --line: #e6e8ec;
  --accent: #134cff;
  --accent-strong: #134cff;
  --link: #134cff;
  --soft: #e8efff;
  --code: #f4f6fa;
  --code-line: transparent;
  --pre-bg: #0f172a;
  --pre-ink: #eef3ff;
  --warn: #9a5b12;
  --quote-bg: #fff8ed;
  --topbar-bg: rgba(255, 255, 255, 0.98);
  --input-bg: #ffffff;
  --method-get-bg: #daf8e7;
  --method-get-ink: #16804b;
  --method-post-bg: #e5efff;
  --method-post-ink: #1d63e9;
  --method-put-bg: #fff1ce;
  --method-put-ink: #a56613;
  --method-delete-bg: #ffe3e3;
  --method-delete-ink: #d84343;
  --method-unknown-bg: #edf1f3;
  --method-unknown-ink: #5d6870;
  --shadow: 0 20px 48px rgba(15, 23, 42, 0.10);
}

html[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0b0f19;
  --surface: #0f1523;
  --surface-soft: #111827;
  --surface-raised: #141c2c;
  --panel: #161f31;
  --ink: #e5e7eb;
  --heading: #f4f7fb;
  --strong: #f0f4fa;
  --muted: #9aa4b2;
  --nav: #b6bfcc;
  --top-nav: #c7ced9;
  --line: #263244;
  --accent: #7aa2ff;
  --accent-strong: #a8c0ff;
  --link: #8ab4ff;
  --soft: rgba(83, 131, 255, 0.18);
  --code: #151f2e;
  --code-line: #2b3a50;
  --pre-bg: #050812;
  --pre-ink: #e8eefc;
  --warn: #f5b35b;
  --quote-bg: rgba(245, 179, 91, 0.11);
  --topbar-bg: rgba(11, 15, 25, 0.96);
  --input-bg: #0f1726;
  --method-get-bg: rgba(31, 160, 92, 0.20);
  --method-get-ink: #73d99e;
  --method-post-bg: rgba(72, 126, 255, 0.20);
  --method-post-ink: #91b5ff;
  --method-put-bg: rgba(245, 179, 91, 0.20);
  --method-put-ink: #f5c56f;
  --method-delete-bg: rgba(248, 113, 113, 0.18);
  --method-delete-ink: #ff9a9a;
  --method-unknown-bg: rgba(156, 163, 175, 0.18);
  --method-unknown-ink: #cbd5e1;
  --shadow: 0 20px 52px rgba(0, 0, 0, 0.45);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
html { scroll-padding-top: calc(var(--topbar-height) + 18px); }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.75;
  overflow-x: hidden;
}
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }

.topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 30;
  display: block;
  min-height: 0;
  padding: 0;
  background: var(--topbar-bg);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(12px);
}
.topbar-main {
  display: grid;
  grid-template-columns: var(--sidebar-width) minmax(0, 1fr) max-content;
  gap: var(--layout-gap);
  align-items: center;
  width: min(var(--layout-max), calc(100vw - 64px));
  height: 64px;
  margin: 0 auto;
}
.brand {
  justify-self: start;
  grid-column: 1;
  grid-row: 1;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: var(--ink);
  font-size: 20px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0;
  white-space: nowrap;
}
.brand:hover { text-decoration: none; }
.brand img {
  width: 28px;
  height: 28px;
  display: block;
  flex: 0 0 auto;
}
.top-nav {
  width: min(var(--layout-max), calc(100vw - 64px));
  height: 48px;
  margin: 0 auto;
  display: flex;
  gap: 24px;
  align-items: center;
  min-width: 0;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 0;
  border-top: 1px solid var(--line);
  scrollbar-width: thin;
}
.top-nav-link {
  flex: 0 0 auto;
  color: var(--top-nav);
  border-bottom: 2px solid transparent;
  padding: 14px 0 13px;
  font-size: 14px;
  font-weight: 500;
  line-height: 20px;
  white-space: nowrap;
}
.top-nav-link:hover {
  color: var(--ink);
  text-decoration: none;
}
.top-nav-link.active {
  background: transparent;
  border-bottom-color: var(--accent);
  color: var(--accent-strong);
  font-weight: 700;
}
.search-label {
  grid-column: 1 / -1;
  grid-row: 1;
  justify-self: center;
  display: block;
  width: min(450px, 100%);
  align-items: center;
  color: var(--muted);
  font-size: 14px;
}
.search-label span {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}
.search-label input {
  width: 100%;
  height: 36px;
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 7px 14px;
  font: inherit;
  color: var(--ink);
  background: var(--input-bg);
}
.search-label input:focus {
  outline: 3px solid rgba(36, 88, 255, 0.11);
  border-color: rgba(36, 88, 255, 0.38);
}
.top-actions {
  grid-column: 3;
  grid-row: 1;
  justify-self: end;
  display: flex;
  gap: 18px;
  align-items: center;
  color: var(--top-nav);
  font-size: 14px;
  line-height: 20px;
  white-space: nowrap;
}
.language-links {
  display: inline-flex;
  gap: 12px;
  align-items: center;
}
.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 30px;
  height: 30px;
  border: 0;
  border-radius: 999px;
  padding: 0 8px;
  color: var(--muted);
  background: transparent;
  font: inherit;
  line-height: 1;
  cursor: pointer;
}
.theme-toggle:hover {
  color: var(--ink);
  background: var(--panel);
}

.layout {
  display: grid;
  grid-template-columns: var(--sidebar-width) minmax(0, var(--content-width)) var(--toc-width);
  gap: var(--layout-gap);
  max-width: var(--layout-max);
  width: min(var(--layout-max), calc(100vw - 64px));
  margin: 0 auto;
  padding: calc(var(--topbar-height) + var(--content-offset)) 0 72px;
}
.sidebar, .toc {
  position: sticky;
  top: calc(var(--topbar-height) + var(--content-offset));
  align-self: start;
  max-height: calc(100vh - var(--topbar-height) - var(--content-offset));
  overflow: auto;
  scrollbar-width: thin;
}
.sidebar {
  grid-column: 1;
  padding-right: 32px;
}
.nav-section, .toc-title {
  color: var(--heading);
  font-size: 14px;
  font-weight: 700;
  line-height: 20px;
  letter-spacing: 0;
  margin: 28px 0 10px;
}
.nav-section:first-child { margin-top: 0; }
.toc-title {
  display: flex;
  gap: 10px;
  align-items: center;
  margin: 0 0 6px;
  color: var(--heading);
  font-size: 14px;
  font-weight: 600;
  line-height: 20px;
}
.toc-title::before {
  content: "☰";
  display: inline-block;
  color: var(--nav);
  font-size: 14px;
  line-height: 1;
  transform: rotate(90deg);
}
.nav-link, .toc a {
  display: block;
  border-radius: 10px;
  padding: 8px 16px;
  color: var(--nav);
  font-size: 14px;
  font-weight: 400;
  line-height: 20px;
}
.nav-link:hover, .toc a:hover {
  background: var(--panel);
  color: var(--ink);
  text-decoration: none;
}
.nav-link.active {
  background: var(--soft);
  color: var(--accent-strong);
  font-weight: 600;
}
.api-nav-link {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
}
.api-nav-link span:last-child {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.api-method {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 42px;
  height: 21px;
  border-radius: 7px;
  font-size: 11px;
  font-weight: 760;
  line-height: 1;
  letter-spacing: 0;
}
.api-method-get {
  color: var(--method-get-ink);
  background: var(--method-get-bg);
}
.api-method-post {
  color: var(--method-post-ink);
  background: var(--method-post-bg);
}
.api-method-put {
  color: var(--method-put-ink);
  background: var(--method-put-bg);
}
.api-method-delete,
.api-method-del {
  color: var(--method-delete-ink);
  background: var(--method-delete-bg);
}
.api-method-unknown {
  color: var(--method-unknown-ink);
  background: var(--method-unknown-bg);
}
.toc a {
  color: var(--muted);
  font-size: 14px;
  line-height: 20px;
  padding: 6px 0;
  border-radius: 0;
}
.toc a:hover {
  background: transparent;
  color: var(--accent);
}
.toc a.active {
  color: var(--accent);
  font-weight: 500;
}
.toc-l2 { color: var(--nav) !important; font-weight: 500; }
.toc-l2.active { color: var(--accent) !important; }
.toc-l3 { padding-left: 16px !important; }

.content {
  grid-column: 2;
  min-width: 0;
}
.toc {
  grid-column: 3;
  margin-left: 9px;
  width: var(--toc-width);
}
article {
  max-width: var(--content-width);
  padding: 0;
}
.article-eyebrow {
  color: var(--accent);
  font-size: 14px;
  font-weight: 600;
  line-height: 20px;
  margin: 4px 0 8px;
}
h1, h2, h3, h4 {
  letter-spacing: 0;
  color: var(--heading);
  scroll-margin-top: calc(var(--topbar-height) + var(--content-offset));
}
h1 {
  margin: 0 0 22px;
  font-size: 30px;
  font-weight: 700;
  line-height: 36px;
}
h2 {
  margin: 52px 0 18px;
  padding-top: 30px;
  border-top: 1px solid var(--line);
  font-size: 24px;
  font-weight: 700;
  line-height: 32px;
}
h3 {
  margin: 38px 0 12px;
  font-size: 20px;
  font-weight: 700;
  line-height: 28px;
}
h1 + h2,
h1 + p + h2,
h1 + figure + h2 {
  border-top: 0;
  padding-top: 0;
}
h4 {
  margin: 28px 0 10px;
  font-size: 16px;
  line-height: 24px;
}
p, ul, ol {
  margin: 0 0 20px;
  color: var(--nav);
  line-height: 28px;
}
li { margin: 6px 0; }
strong { color: var(--strong); }
code {
  background: var(--code);
  border: 1px solid var(--code-line);
  padding: 2px 6px;
  border-radius: 6px;
  color: var(--heading);
  font-size: 0.9em;
  font-weight: 600;
}
pre {
  overflow: auto;
  margin: 20px 0 28px;
  padding: 16px;
  background: #0f172a;
  color: var(--pre-ink);
  border: 1px solid rgba(15, 23, 42, 0.18);
  border-radius: 16px;
  line-height: 24px;
  font-size: 14px;
}
pre code {
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
}
figure { margin: 28px 0; }
figure img {
  display: block;
  width: 100%;
  max-height: 720px;
  object-fit: contain;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
}
figcaption {
  margin-top: 8px;
  color: var(--muted);
  font-size: 14px;
}
.table-wrap {
  overflow-x: auto;
  margin: 18px 0 28px;
  border: 0;
  border-radius: 0;
}
table {
  width: 100%;
  min-width: 680px;
  border-collapse: collapse;
  background: var(--surface);
  font-size: 14px;
  line-height: 20px;
}
th, td {
  padding: 14px 8px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
  text-align: left;
}
th {
  background: transparent;
  color: var(--heading);
  font-weight: 700;
}
tr:last-child td { border-bottom: 0; }
blockquote {
  margin: 18px 0;
  padding: 12px 16px;
  border-left: 3px solid var(--warn);
  background: var(--quote-bg);
  border-radius: 0 10px 10px 0;
}
.article-footer {
  max-width: var(--content-width);
  color: var(--muted);
  font-size: 13px;
  line-height: 22px;
  padding: 24px 0 0;
  margin-top: 44px;
  border-top: 1px solid var(--line);
}
.search-results {
  position: fixed;
  top: 124px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 30;
  width: min(760px, calc(100vw - 28px));
  max-height: 70vh;
  overflow: auto;
  background: var(--surface-raised);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow);
  padding: 10px;
}
.result-item {
  display: block;
  padding: 11px 12px;
  border-radius: 10px;
  color: var(--ink);
}
.result-item:hover {
  background: var(--soft);
  text-decoration: none;
}
.result-title { font-weight: 720; }
.result-desc { color: var(--muted); font-size: 14px; }

@media (max-width: 1180px) {
  :root {
    --layout-gap: 28px;
    --sidebar-width: 250px;
  }
  .topbar {
    grid-template-columns: max-content minmax(220px, 1fr);
  }
  .top-actions { grid-column: 1 / -1; }
  .layout {
    grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
  }
  .sidebar, .toc {
    top: 164px;
    max-height: calc(100vh - 184px);
  }
  .search-results { top: 150px; }
  .toc { display: none; }
}

@media (min-width: 821px) and (max-width: 1408px) {
  .toc { margin-left: 0; }
}

@media (min-width: 821px) {
  html {
    overflow-x: clip;
    overflow-y: auto;
  }
  body {
    overflow: visible;
  }
  .topbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
  }
  .layout {
    width: min(var(--layout-max), calc(100vw - 64px));
    align-items: start;
    overflow: visible;
    padding-top: calc(var(--topbar-height) + var(--content-offset));
  }
  .sidebar {
    position: fixed;
    top: var(--topbar-height);
    bottom: auto;
    left: max(32px, calc((100vw - var(--layout-max)) / 2));
    width: var(--sidebar-width);
    max-height: calc(100vh - var(--topbar-height));
    height: calc(100vh - var(--topbar-height));
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding-top: 30px;
    padding-bottom: 72px;
  }
  .toc {
    position: sticky;
    top: calc(var(--topbar-height) + var(--content-offset));
    align-self: start;
    max-height: calc(100vh - var(--topbar-height) - var(--content-offset));
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding-left: 40px;
  }
  .content {
    overflow: visible;
  }
  article {
    scroll-margin-top: calc(var(--topbar-height) + 18px);
  }
}

@media (max-width: 820px) {
  :root {
    --layout-gap: 0;
    --topbar-height: 0px;
    --content-offset: 0px;
  }
  .topbar {
    position: static;
    min-height: 0;
    padding: 0;
  }
  .topbar-main {
    width: auto;
    height: auto;
    display: grid;
    grid-template-columns: 1fr;
    gap: 9px;
    padding: 12px 14px 0;
  }
  .brand {
    grid-column: auto;
    grid-row: auto;
    justify-self: start;
    font-size: 18px;
  }
  .search-label {
    grid-column: auto;
    grid-row: auto;
    justify-self: stretch;
    width: 100%;
  }
  .top-actions {
    grid-column: auto;
    grid-row: auto;
    justify-self: start;
  }
  .top-nav {
    width: auto;
    height: auto;
    gap: 18px;
    padding: 8px 14px 0;
  }
  .top-nav-link { padding: 9px 0 11px; }
  .top-actions {
    overflow-x: auto;
    padding-bottom: 2px;
  }
  .layout {
    display: block;
    width: auto;
    max-width: none;
    padding: 12px 14px 44px;
  }
  .content {
    height: auto;
    overflow: visible;
    padding: 0;
  }
  .sidebar {
    position: static;
    max-height: none;
    display: flex;
    gap: 6px;
    overflow-x: auto;
    overflow-y: hidden;
    overscroll-behavior-x: contain;
    padding: 8px 0 14px;
    margin-bottom: 4px;
  }
  .nav-section { display: none; }
  .nav-link {
    flex: 0 0 auto;
    white-space: nowrap;
    border: 1px solid var(--line);
    background: var(--surface);
    padding: 7px 11px;
  }
  .api-nav-link {
    grid-template-columns: 42px minmax(88px, auto);
  }
  article { padding-top: 4px; }
  h1 { font-size: 28px; }
  h2 { font-size: 22px; margin-top: 36px; padding-top: 22px; }
  h3 { font-size: 18px; }
  table { min-width: 620px; }
  .search-results { top: 104px; }
}
