:root {
  color-scheme: light;
  --bg: #f5f7fb;
  --surface: #ffffff;
  --surface-soft: #f8faff;
  --ink: #111c35;
  --muted: #66728c;
  --line: #dce3ef;
  --primary: #1769ff;
  --primary-strong: #0758e7;
  --primary-soft: #e9f1ff;
  --green: #087e5b;
  --green-soft: #e6f8f1;
  --orange: #a55700;
  --orange-soft: #fff2df;
  --code: #10182a;
  --code-ink: #e8eefc;
  --shadow: 0 16px 48px rgba(25, 48, 91, .09);
  --radius: 18px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 84px; }
body {
  margin: 0;
  background:
    radial-gradient(circle at 85% 2%, rgba(23, 105, 255, .09), transparent 26rem),
    var(--bg);
  color: var(--ink);
  font: 14px/1.65 Inter, "SF Pro Text", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
}
a { color: inherit; text-decoration: none; }
code, pre { font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace; }
code {
  border-radius: 5px;
  background: var(--primary-soft);
  color: var(--primary-strong);
  padding: .1em .36em;
}
pre {
  margin: 16px 0 0;
  overflow: auto;
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 14px;
  background: var(--code);
  color: var(--code-ink);
  padding: 18px 20px;
  font-size: 12.5px;
  line-height: 1.75;
  tab-size: 2;
}
pre code { padding: 0; background: transparent; color: inherit; }

.skip-link {
  position: fixed;
  z-index: 100;
  top: 8px;
  left: 8px;
  transform: translateY(-150%);
  border-radius: 8px;
  background: var(--ink);
  color: #fff;
  padding: 8px 12px;
}
.skip-link:focus { transform: none; }

.topbar {
  position: sticky;
  z-index: 20;
  top: 0;
  display: flex;
  min-height: 68px;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  border-bottom: 1px solid rgba(220, 227, 239, .86);
  background: rgba(255, 255, 255, .9);
  padding: 10px clamp(18px, 3vw, 44px);
  backdrop-filter: blur(18px);
}
.brand { display: inline-flex; align-items: center; gap: 11px; }
.brand-mark {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 11px;
  background: linear-gradient(145deg, #2b82ff, #0758e7);
  color: white;
  font-size: 20px;
  box-shadow: 0 9px 22px rgba(23,105,255,.25);
}
.brand strong { display: block; font-size: 16px; line-height: 1.2; }
.brand small { display: block; margin-top: 3px; color: var(--muted); font-size: 9px; letter-spacing: .1em; }
.top-actions { display: flex; align-items: center; gap: 8px; }
.top-actions a, .version {
  border-radius: 9px;
  padding: 7px 10px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
}
.top-actions a:hover { background: var(--primary-soft); color: var(--primary); }
.top-actions .primary-link { background: var(--ink); color: #fff; }

.docs-shell {
  display: grid;
  grid-template-columns: 230px minmax(0, 960px);
  justify-content: center;
  gap: clamp(24px, 4vw, 56px);
  padding: 34px clamp(18px, 3vw, 44px) 70px;
}
.sidebar {
  position: sticky;
  top: 102px;
  align-self: start;
  max-height: calc(100vh - 124px);
  overflow: auto;
  padding: 6px 12px 20px 0;
  scrollbar-width: thin;
}
.sidebar a {
  display: flex;
  min-height: 34px;
  align-items: center;
  gap: 7px;
  border-radius: 8px;
  color: var(--muted);
  padding: 6px 9px;
  font-size: 12px;
  font-weight: 620;
}
.sidebar a:hover { background: var(--primary-soft); color: var(--primary); }
.eyebrow {
  margin: 18px 9px 7px;
  color: #9aa4b9;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .13em;
  text-transform: uppercase;
}
.eyebrow:first-child { margin-top: 0; }
.method {
  display: inline-flex;
  min-width: 40px;
  justify-content: center;
  border-radius: 6px;
  padding: 2px 5px;
  font-size: 8px;
  font-weight: 900;
  letter-spacing: .04em;
}
.method.get { background: var(--green-soft); color: var(--green); }
.method.post { background: var(--primary-soft); color: var(--primary); }

.content { min-width: 0; }
.hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(260px, .65fr);
  align-items: center;
  gap: clamp(28px, 5vw, 64px);
  overflow: hidden;
  border-radius: 26px;
  background:
    radial-gradient(circle at 82% 12%, rgba(255,255,255,.2), transparent 18rem),
    linear-gradient(135deg, #0758e7, #247dff 62%, #09a7d8);
  color: #fff;
  padding: clamp(30px, 5vw, 54px);
  box-shadow: 0 26px 70px rgba(7,88,231,.22);
}
.hero::after {
  position: absolute;
  right: -90px;
  bottom: -140px;
  width: 330px;
  height: 330px;
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 50%;
  box-shadow: 0 0 0 46px rgba(255,255,255,.04), 0 0 0 92px rgba(255,255,255,.03);
  content: "";
}
.hero > * { position: relative; z-index: 1; }
.pill {
  display: inline-flex;
  border: 1px solid rgba(255,255,255,.28);
  border-radius: 999px;
  background: rgba(255,255,255,.1);
  padding: 5px 10px;
  font-size: 10px;
  font-weight: 750;
}
.hero h1 { margin: 14px 0 10px; font-size: clamp(30px, 5vw, 48px); line-height: 1.08; letter-spacing: -.035em; }
.hero p { max-width: 640px; margin: 0; color: rgba(255,255,255,.82); font-size: 15px; line-height: 1.8; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 24px; }
.button {
  display: inline-flex;
  min-height: 40px;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255,255,255,.3);
  border-radius: 10px;
  background: rgba(255,255,255,.09);
  color: #fff;
  padding: 8px 14px;
  font-weight: 750;
}
.button.primary { border-color: #fff; background: #fff; color: var(--primary-strong); }
.endpoint-card {
  display: grid;
  gap: 7px;
  border: 1px solid rgba(255,255,255,.2);
  border-radius: 18px;
  background: rgba(6,37,99,.25);
  padding: 20px;
  backdrop-filter: blur(14px);
}
.endpoint-card span { color: rgba(255,255,255,.64); font-size: 10px; font-weight: 750; }
.endpoint-card code {
  overflow-wrap: anywhere;
  background: rgba(0,0,0,.16);
  color: #fff;
  padding: 8px 10px;
}
.endpoint-card strong { font-size: 13px; }

.notice {
  display: flex;
  gap: 9px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-soft);
  padding: 12px 14px;
  color: var(--muted);
  font-size: 12px;
}
.notice strong { flex: none; color: var(--ink); }
.security-notice { margin-top: 18px; border-color: #bcd3ff; background: var(--primary-soft); }
.warning { margin-top: 16px; border-color: #f1cf9b; background: var(--orange-soft); }

.doc-section {
  margin-top: 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  padding: clamp(20px, 3vw, 30px);
  box-shadow: 0 8px 26px rgba(25,48,91,.035);
}
.section-heading { display: flex; gap: 14px; align-items: flex-start; margin-bottom: 22px; }
.section-heading > span {
  display: grid;
  width: 32px;
  height: 32px;
  flex: none;
  place-items: center;
  border-radius: 10px;
  background: var(--primary-soft);
  color: var(--primary);
  font-size: 11px;
  font-weight: 850;
}
.section-heading h2 { margin: 0; font-size: 22px; line-height: 1.25; letter-spacing: -.015em; }
.section-heading p { margin: 5px 0 0; color: var(--muted); font-size: 12px; }
.code-card { overflow: hidden; border-radius: 14px; background: var(--code); }
.code-card pre { margin: 0; border: 0; border-radius: 0; }
.code-title { display: flex; justify-content: space-between; border-bottom: 1px solid rgba(255,255,255,.08); color: #9cabc9; padding: 9px 16px; font-size: 10px; }
.response-grid, .feature-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 14px;
}
.feature-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.response-grid article, .feature-grid article {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-soft);
  padding: 15px;
}
.response-grid strong, .feature-grid h3 { display: block; margin: 0 0 5px; font-size: 13px; }
.response-grid p, .feature-grid p { margin: 0; color: var(--muted); font-size: 11px; }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; }
table { width: 100%; border-collapse: collapse; min-width: 620px; }
th, td { border-bottom: 1px solid var(--line); padding: 11px 13px; text-align: left; vertical-align: top; font-size: 12px; }
th { background: var(--surface-soft); color: var(--muted); font-size: 10px; letter-spacing: .03em; }
tbody tr:last-child td { border-bottom: 0; }

.endpoint { scroll-margin-top: 88px; border-top: 1px solid var(--line); padding: 24px 0; }
.endpoint:first-of-type { border-top: 0; padding-top: 0; }
.endpoint:last-child { padding-bottom: 0; }
.endpoint-title { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
.endpoint-title .method { min-width: 50px; padding: 4px 7px; font-size: 9px; }
.endpoint-title h3 { margin: 0; font-size: 17px; font-family: "SFMono-Regular", Consolas, monospace; }
.scope {
  margin-left: auto;
  border-radius: 999px;
  background: var(--primary-soft);
  color: var(--primary);
  padding: 4px 8px;
  font-size: 9px;
  font-weight: 800;
}
.scope.none { background: var(--green-soft); color: var(--green); }
.endpoint > p { margin: 10px 0 0; color: var(--muted); }

.signature-flow { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.signature-flow article { border: 1px solid var(--line); border-radius: 12px; padding: 13px; }
.signature-flow article > span {
  display: grid;
  width: 24px;
  height: 24px;
  place-items: center;
  border-radius: 7px;
  background: var(--primary);
  color: #fff;
  font-size: 10px;
  font-weight: 850;
}
.signature-flow strong { display: block; margin-top: 10px; font-size: 12px; }
.signature-flow p, .fine-print { margin: 4px 0 0; color: var(--muted); font-size: 10.5px; }
.checklist ul { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px 28px; margin: 0; padding: 0; list-style: none; }
.checklist li { position: relative; color: var(--muted); padding-left: 24px; font-size: 12px; }
.checklist li::before {
  position: absolute;
  top: .22em;
  left: 0;
  display: grid;
  width: 16px;
  height: 16px;
  place-items: center;
  border-radius: 5px;
  background: var(--green-soft);
  color: var(--green);
  content: "✓";
  font-size: 10px;
  font-weight: 900;
}
footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-top: 24px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  padding: 24px 3px 0;
}
footer strong { color: var(--ink); }
footer p { margin: 3px 0 0; font-size: 11px; }
footer a { color: var(--primary); font-weight: 750; }

@media (max-width: 900px) {
  .docs-shell { grid-template-columns: 170px minmax(0, 1fr); gap: 22px; }
  .hero { grid-template-columns: 1fr; }
  .signature-flow { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .version { display: none; }
}

@media (max-width: 680px) {
  html { scroll-padding-top: 68px; }
  .topbar { min-height: 60px; padding: 9px 13px; }
  .brand-mark { width: 34px; height: 34px; }
  .brand strong { font-size: 14px; }
  .brand small { display: none; }
  .top-actions { gap: 3px; }
  .top-actions a { padding: 7px; font-size: 10px; }
  .docs-shell { display: block; padding: 16px 12px 44px; }
  .sidebar { position: static; display: flex; max-height: none; gap: 5px; overflow-x: auto; margin: 0 0 12px; padding: 2px 0 7px; }
  .sidebar .eyebrow { display: none; }
  .sidebar a { flex: none; min-height: 30px; border: 1px solid var(--line); background: var(--surface); padding: 5px 8px; }
  .sidebar .method { display: none; }
  .hero { border-radius: 18px; padding: 25px 20px; }
  .hero h1 { font-size: 31px; }
  .hero p { font-size: 13px; }
  .endpoint-card { padding: 14px; }
  .doc-section { margin-top: 14px; border-radius: 15px; padding: 18px 15px; }
  .section-heading { gap: 10px; margin-bottom: 16px; }
  .section-heading h2 { font-size: 19px; }
  .section-heading p { font-size: 11px; }
  .response-grid, .feature-grid, .signature-flow, .checklist ul { grid-template-columns: 1fr; }
  pre { padding: 15px; font-size: 11px; }
  .notice { align-items: flex-start; flex-direction: column; gap: 3px; }
  .scope { width: 100%; margin-left: 0; }
  footer { align-items: flex-start; flex-direction: column; }
}

@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --bg: #0d1422;
    --surface: #141e2e;
    --surface-soft: #182436;
    --ink: #edf3ff;
    --muted: #a2afc6;
    --line: #2b3a50;
    --primary: #6ca5ff;
    --primary-strong: #a8c8ff;
    --primary-soft: #1b3154;
    --green: #60d4ae;
    --green-soft: #173a32;
    --orange: #ffbd68;
    --orange-soft: #3f2e1d;
    --code: #080d17;
    --code-ink: #e7efff;
    --shadow: 0 16px 48px rgba(0,0,0,.22);
  }
  body { background: radial-gradient(circle at 85% 2%, rgba(53,126,255,.12), transparent 26rem), var(--bg); }
  .topbar { border-color: rgba(43,58,80,.9); background: rgba(13,20,34,.9); }
  .top-actions .primary-link { background: #edf3ff; color: #111c35; }
  .hero { box-shadow: 0 26px 70px rgba(0,0,0,.32); }
  .doc-section { box-shadow: 0 8px 26px rgba(0,0,0,.08); }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}
