:root {
  --bg: #ffffff;
  --sidebar-bg: #f8f8f8;
  --surface: #ffffff;
  --surface-soft: #fafafa;
  --surface-hover: #f4f4f4;
  --surface-code: #17181c;
  --text: #18181b;
  --text-muted: #71717a;
  --text-subtle: #a1a1aa;
  --border: #e4e4e7;
  --border-strong: #d4d4d8;
  --accent: #f05293;
  --accent-dark: #d9367c;
  --accent-soft: #f9e5ee;
  --blue: #3b82f6;
  --blue-soft: #eff6ff;
  --green: #168572;
  --green-soft: #e7f6f2;
  --orange: #b76a0b;
  --orange-soft: #fff7df;
  --danger: #b83d52;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 12px;
  --shell-width: calc(100% - 80px);
  --sidebar-width: 260px;
  --toc-width: 250px;
  --header-height: 58px;
  --top-offset: var(--header-height);
  --font-sans: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  --font-mono: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  min-width: 320px;
  margin: 0;
  color: var(--text);
  background: linear-gradient(90deg, var(--sidebar-bg) 0 40px, var(--bg) 40px 100%);
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
button, input { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
code, pre { font-family: var(--font-mono); }
:focus-visible { outline: 2px solid rgba(240, 82, 147, .42); outline-offset: 2px; }
::selection { color: var(--text); background: #f8cade; }

/* Header */
.topbar {
  position: fixed;
  top: 0;
  left: 50%;
  z-index: 30;
  display: grid;
  grid-template-columns: var(--sidebar-width) minmax(0, 1fr) auto;
  align-items: center;
  width: min(100%, var(--shell-width));
  height: var(--header-height);
  border-bottom: 1px solid var(--border);
  background: rgba(255, 255, 255, .97);
  backdrop-filter: blur(12px);
  transform: translateX(-50%);
}
body::before {
  position: fixed;
  inset: 0 0 auto;
  z-index: 29;
  height: var(--header-height);
  border-bottom: 1px solid var(--border);
  background: rgba(255, 255, 255, .97);
  content: "";
}
.brand {
  display: inline-flex;
  align-items: center;
  align-self: stretch;
  justify-content: flex-start;
  gap: 8px;
  padding: 0 12px 0 28px;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -.01em;
  text-decoration: none;
}
.brand-mark {
  display: block;
  flex: 0 0 auto;
  width: 25px;
  height: 25px;
  object-fit: contain;
}
.topnav {
  display: flex;
  align-items: stretch;
  align-self: stretch;
  gap: 27px;
  min-width: 0;
  overflow-x: auto;
  padding: 0 28px;
  scrollbar-width: none;
}
.topnav::-webkit-scrollbar { display: none; }
.topnav-link {
  position: relative;
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
}
.topnav-link::after {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 2px;
  background: var(--accent);
  content: "";
  transform: scaleX(0);
  transition: transform 160ms ease;
}
.topnav-link:hover, .topnav-link.active { color: var(--accent-dark); }
.topnav-link.active::after { transform: scaleX(1); }
.language-toggle, .action-button, .inline-copy {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  background: var(--surface-soft);
  cursor: pointer;
  transition: border-color 150ms ease, color 150ms ease, background 150ms ease;
}
.language-switcher { position: relative; margin-right: 18px; }
.language-toggle {
  min-width: 78px;
  padding: 7px 12px;
  border-color: #e8e8ec;
  border-radius: 9px;
  color: var(--text-muted);
  background: #fafafa;
  font-size: 14px;
  font-weight: 700;
  line-height: 1;
}
.language-toggle:hover, .action-button:hover, .inline-copy:hover { border-color: #ef9ac0; color: var(--accent-dark); background: #fff7fb; }
.language-toggle:active { transform: translateY(1px); }
.language-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 40;
  width: 164px;
  padding: 6px;
  border: 1px solid #dedee4;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 8px 24px rgba(24, 24, 27, .14);
}
.language-menu[hidden] { display: none; }
.language-menu button {
  display: flex;
  align-items: center;
  width: 100%;
  min-height: 34px;
  padding: 5px 8px;
  border: 0;
  border-radius: 8px;
  color: var(--text);
  background: transparent;
  cursor: pointer;
  font-size: 14px;
  text-align: left;
}
.language-menu button:hover:not(:disabled) { background: var(--accent-soft); color: var(--accent-dark); }
.language-menu button[aria-current="true"]::after { margin-left: auto; color: var(--text); content: "✓"; font-weight: 700; }
.language-menu button:disabled { color: var(--text); cursor: default; }

/* Three-column documentation shell */
.layout {
  display: grid;
  grid-template-columns: var(--sidebar-width) minmax(0, 1fr) var(--toc-width);
  width: min(100%, var(--shell-width));
  min-height: 100vh;
  margin: 0 auto;
  padding-top: var(--top-offset);
}
.sidebar {
  position: sticky;
  top: var(--top-offset);
  align-self: start;
  height: calc(100vh - var(--top-offset));
  overflow-y: auto;
  padding: 18px 10px 50px;
  background: var(--sidebar-bg);
  scrollbar-width: thin;
}
.sidebar .eyebrow {
  margin: 0 9px 7px;
  color: var(--text);
  font-size: 12px;
  font-weight: 700;
}
.side-link, .side-sub-link {
  display: block;
  padding: 7px 9px;
  border-radius: 7px;
  color: var(--text-muted);
  font-size: 12px;
  text-decoration: none;
  transition: color 140ms ease, background 140ms ease;
}
.side-link { font-weight: 520; }
.side-link:hover, .side-sub-link:hover { color: var(--text); background: var(--surface-hover); }
.side-link.active, .side-sub-link.active { color: var(--accent-dark); background: var(--accent-soft); }
.side-tree { margin: 2px 0 7px; }
.side-tree summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 7px 9px;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 13px;
  font-weight: 550;
  list-style: none;
}
.side-tree summary::-webkit-details-marker, .side-category > summary::-webkit-details-marker { display: none; }
.side-tree summary:hover, .side-tree[open] > summary { color: var(--text); }
.tree-chevron { color: var(--text-subtle); font-size: 16px; line-height: 1; transition: transform 160ms ease; }
.side-tree[open] .tree-chevron { transform: rotate(90deg); }
.side-group { margin: 0 0 5px 10px; padding-left: 9px; border-left: 1px solid var(--border); }
.api-sidebar .side-sub-link { padding: 6px 8px; }
.api-sidebar .side-sub-link::before { display: none; }
.side-category { margin: 2px 0; }
.side-category > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 6px 8px;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 12px;
  list-style: none;
}
.side-category > summary:hover, .side-category[open] > summary { color: var(--text); }
.category-count { color: var(--text-subtle); font-size: 10px; }
.side-endpoints { display: grid; gap: 1px; padding: 3px 0 4px 7px; }
.side-endpoint-link {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr);
  align-items: center;
  gap: 6px;
  padding: 5px 7px;
  border-radius: 6px;
  color: var(--text-muted);
  font-size: 11px;
  line-height: 1.3;
  text-decoration: none;
}
.side-endpoint-link:hover { color: var(--text); background: var(--surface-hover); }
.side-endpoint-link.active { color: var(--accent-dark); background: var(--accent-soft); }
.side-endpoint-link .method { min-width: 36px; padding: 2px 3px; font-size: 7px; }

.content {
  min-width: 0;
  max-width: 1120px;
  padding: 62px 68px 100px;
}
.toc {
  position: sticky;
  top: calc(var(--top-offset) + 28px);
  align-self: start;
  max-height: calc(100vh - var(--top-offset) - 48px);
  overflow-y: auto;
  margin-top: 30px;
  padding: 0 18px 24px;
  border-left: 1px solid var(--border);
}
.toc-title { display: flex; align-items: center; gap: 7px; margin: 0 0 8px; color: var(--text-muted); font-size: 12px; font-weight: 650; }
.toc-title::before { content: "☰"; font-size: 10px; }
.toc a { display: block; padding: 5px 0; color: var(--text-muted); font-size: 12px; text-decoration: none; }
.toc a:hover, .toc a.active { color: var(--accent-dark); }
.toc a.active { margin-left: -19px; padding-left: 18px; border-left: 2px solid var(--accent); }

/* Document heading */
.hero {
  position: relative;
  min-height: 0;
  padding: 0 0 30px;
  border-bottom: 1px solid var(--border);
  color: var(--text);
  background: transparent;
}
.hero::before, .hero::after, .hero-visual { display: none; }
.eyebrow, .section-kicker { color: var(--accent-dark); font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.hero .eyebrow { display: none; }
h1, h2, h3 { color: var(--text); }
h1 { max-width: 760px; margin: 0 0 8px; font-size: clamp(28px, 3vw, 36px); line-height: 1.25; letter-spacing: -.035em; }
h2 { margin: 0 0 16px; font-size: 24px; line-height: 1.35; letter-spacing: -.025em; }
h3 { margin: 28px 0 9px; font-size: 17px; line-height: 1.4; }
p { margin: 0 0 17px; color: var(--text-muted); }
.hero h1 { color: var(--text); }
.hero p { max-width: 650px; color: var(--text-muted); font-size: 16px; }
.hero-actions, .doc-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 20px; }
.button, .action-button { display: inline-flex; align-items: center; justify-content: center; min-height: 32px; padding: 5px 12px; border-radius: 6px; font-size: 12px; font-weight: 650; text-decoration: none; transition: border-color 150ms ease, background 150ms ease, color 150ms ease; }
.button.primary { border: 1px solid var(--border); color: var(--text); background: var(--surface-soft); }
.button.primary:hover { border-color: #ef9ac0; color: var(--accent-dark); background: #fff7fb; }
.button.secondary { border: 1px solid var(--border); color: var(--text); background: var(--surface-soft); }
.button.secondary:hover { border-color: var(--border-strong); background: var(--surface-hover); }
.doc-section { padding: 42px 0 4px; scroll-margin-top: calc(var(--header-height) + 24px); }
.doc-section + .doc-section { margin-top: 16px; border-top: 1px solid var(--border); }
.section-kicker { margin-bottom: 7px; }

/* Endpoint content */
.endpoint-breadcrumb { display: flex; align-items: center; gap: 8px; margin: 0 0 24px; color: var(--text-subtle); font-size: 12px; }
.endpoint-breadcrumb a { color: var(--accent-dark); text-decoration: none; }
.endpoint-breadcrumb strong { overflow: hidden; color: var(--text-muted); font-weight: 500; text-overflow: ellipsis; white-space: nowrap; }
.endpoint-hero { min-height: 0; }
.endpoint-hero h1 { font-size: clamp(28px, 3vw, 36px); }
.request-label-large { display: inline-flex; margin-top: 12px; padding: 7px 10px; border: 1px solid var(--border); border-radius: 6px; background: var(--surface-soft); font-size: 13px; }
.request-label-large code { color: var(--text); }
.endpoint-content { max-width: 100%; }
.endpoint-content h2 { margin-top: 0; }
.endpoint-content h2:not(:first-child) { margin-top: 44px; }
.parameter-list { display: grid; gap: 0; margin-bottom: 34px; border-top: 1px solid var(--border); }
.parameter-card, .response-card { padding: 16px 4px; border-bottom: 1px solid var(--border); background: transparent; }
.parameter-heading, .response-status { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.parameter-heading code { color: var(--text); font-size: 13px; font-weight: 700; }
.parameter-required, .parameter-optional, .parameter-location, .response-status span { padding: 2px 7px; border-radius: 999px; font-size: 9px; font-weight: 700; }
.parameter-required { color: var(--accent-dark); background: var(--accent-soft); }
.parameter-optional, .parameter-location { color: var(--text-muted); background: var(--surface-hover); }
.parameter-card p, .response-card p { margin: 7px 0 0; font-size: 13px; }

/* Cards and content elements */
.feature-grid, .api-table { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 11px; margin-top: 24px; }
.feature-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.feature-grid article, .api-table a, .endpoint-card { border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface-soft); transition: border-color 160ms ease, background 160ms ease, box-shadow 160ms ease; }
.feature-grid article { min-height: 120px; padding: 17px; }
.feature-grid article:hover, .api-table a:hover, .endpoint-card:hover { border-color: var(--border-strong); background: var(--surface); box-shadow: 0 6px 18px rgba(24,24,27,.06); }
.feature-grid b, .api-table b { color: var(--text); }
.feature-grid p, .api-table small { margin: 5px 0 0; color: var(--text-muted); font-size: 12px; }
.number-list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 11px; margin: 22px 0 28px; padding: 0; list-style: none; counter-reset: steps; }
.number-list li { position: relative; min-height: 104px; padding: 48px 16px 16px; border: 1px solid var(--border); border-radius: var(--radius-lg); color: var(--text-muted); background: var(--surface-soft); counter-increment: steps; }
.number-list li::before { position: absolute; top: 14px; left: 16px; display: grid; place-items: center; width: 25px; height: 25px; border: 1px solid var(--border); border-radius: 7px; color: var(--accent-dark); background: #fff; font-size: 10px; font-weight: 750; content: counter(steps); }
.callout { display: flex; align-items: center; gap: 11px; flex-wrap: wrap; padding: 12px 14px; border: 1px solid #cfe1fb; border-left: 3px solid var(--blue); border-radius: 8px; color: #536277; background: var(--blue-soft); font-size: 13px; box-shadow: 0 4px 12px rgba(24,24,27,.05); }
.callout strong { color: var(--text); }
.callout code { color: var(--green); }
.callout.warning { border-color: #f1dda5; border-left-color: #e5a31f; color: #795b22; background: var(--orange-soft); }
.callout.warning strong { color: var(--orange); }
.inline-copy { margin-left: auto; padding: 4px 9px; font-size: 11px; }
.request-label { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 18px; }
.request-label code, .api-table code { overflow-wrap: anywhere; color: #52525b; font-size: 11px; }
.method { display: inline-flex; align-items: center; justify-content: center; min-width: 42px; padding: 3px 6px; border-radius: 5px; font-size: 8px; font-weight: 800; letter-spacing: .04em; }
.method.get { color: #087565; background: #daf2ec; }
.method.post { color: #c83d7a; background: #f9e3ed; }
.method.put, .method.patch { color: #90600a; background: #faedc8; }
.method.delete { color: var(--danger); background: #fae4e8; }
.api-category-section { margin-top: 34px; }
.api-category-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 11px; }
.api-category-heading h3 { margin: 0; color: var(--text); font-size: 17px; }
.api-category-heading span { color: var(--text-subtle); font-size: 10px; }
.api-base-url { margin: 20px 0 0; }
.api-table a { position: relative; display: grid; grid-template-columns: 48px minmax(0, 1fr); align-items: center; min-height: 104px; column-gap: 10px; padding: 15px; text-decoration: none; }
.api-table a::after { position: absolute; top: 13px; right: 14px; color: var(--text-subtle); font-size: 13px; content: "›"; }
.api-table .method { grid-row: span 2; }
.api-table code, .api-table b, .api-table small { grid-column: 2; }
.api-table b { padding-right: 18px; font-size: 13px; }
.endpoint-card { margin: 16px 0; padding: 18px; }
.endpoint-card h3 { margin-top: 8px; }
.endpoint-card p { margin-bottom: 0; }
pre { position: relative; overflow: auto; margin: 18px 0; padding: 22px; border: 1px solid #27272a; border-radius: 10px; color: #e4e4e7; background: var(--surface-code); font-size: 12px; line-height: 1.75; }
.code-copy { position: absolute; top: 10px; right: 10px; z-index: 2; padding: 4px 9px; border: 1px solid #3f3f46; border-radius: 5px; color: #d4d4d8; background: #27272a; cursor: pointer; font-size: 10px; }
.code-copy:hover { border-color: #71717a; color: #fff; }
footer { display: flex; justify-content: space-between; gap: 20px; margin-top: 70px; padding-top: 20px; border-top: 1px solid var(--border); color: var(--text-subtle); font-size: 11px; }

@media (max-width: 1180px) {
  :root { --toc-width: 0px; }
  .layout { grid-template-columns: var(--sidebar-width) minmax(0, 1fr); }
  .content { max-width: none; }
  .toc { display: none; }
}
@media (max-width: 820px) {
  :root { --sidebar-width: 220px; }
  .content { padding-right: 32px; padding-left: 32px; }
  .number-list, .feature-grid { grid-template-columns: 1fr; }
}
@media (max-width: 680px) {
  :root { --shell-width: 100%; --header-height: 52px; }
  .topbar { grid-template-columns: auto minmax(0, 1fr) auto; }
  .brand { padding: 0 14px; border-right: 0; }
  .brand > span:last-child { display: none; }
  .topnav { justify-content: center; gap: 18px; padding: 0 8px; }
  .topnav-link { font-size: 12px; }
  .language-switcher { margin-right: 10px; }
  .layout { display: block; padding-top: var(--header-height); }
  .sidebar { position: static; display: flex; gap: 4px; width: 100%; height: auto; max-height: none; overflow-x: auto; padding: 9px 14px; border-right: 0; border-bottom: 1px solid var(--border); white-space: nowrap; }
  .sidebar-search, .sidebar .eyebrow { display: none; }
  .api-sidebar { display: block; max-height: 30vh; overflow: auto; white-space: normal; }
  .side-link, .side-sub-link { flex: 0 0 auto; }
  .side-tree { display: inline-block; min-width: 180px; vertical-align: top; }
  .side-group { border-left: 0; }
  .content { padding: 34px 20px 64px; }
  h1 { font-size: 29px; }
  h2 { font-size: 22px; }
  .doc-section { padding-top: 36px; }
  .api-table { grid-template-columns: 1fr; }
  .number-list { grid-template-columns: 1fr; }
  .callout { align-items: flex-start; }
  .inline-copy { margin-left: 0; }
  footer { display: block; }
  footer span { display: block; margin-bottom: 4px; }
}
@media (max-width: 390px) {
  .topnav { gap: 12px; }
  .topnav-link { font-size: 11px; }
  .language-toggle { min-width: 34px; padding-right: 6px; padding-left: 6px; }
  .hero-actions .button { flex: 1 1 auto; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; }
}
