:root {
  --bg: #ffffff;
  --surface: #ffffff;
  --surface-soft: #f4f7fb;
  --text: #172033;
  --muted: #667085;
  --line: #d9e2ef;
  --primary: #1457d9;
  --primary-dark: #0f3f9c;
  --accent: #f97316;
  --ok: #138a55;
  --warn: #b45309;
  --danger: #be123c;
  --code-bg: #101828;
  --shadow: 0 16px 40px rgba(23, 32, 51, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
  font-size: 17px;
  line-height: 1.72;
}

a {
  color: var(--primary);
  text-decoration: none;
}

a:hover {
  color: var(--primary-dark);
  text-decoration: underline;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 64px;
  padding: 0 32px;
  background: rgba(255, 255, 255, 0.94);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(12px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 16px;
  font-weight: 800;
  color: var(--text);
}

.brand-mark {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 8px;
  background: var(--primary);
  color: #ffffff;
  font-weight: 900;
}

.nav {
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav a {
  padding: 8px 11px;
  border-radius: 8px;
  color: #344054;
  font-size: 15px;
  font-weight: 700;
}

.nav a.active,
.nav a:hover {
  background: var(--surface-soft);
  color: var(--primary-dark);
  text-decoration: none;
}

.shell {
  width: min(1680px, 100vw);
  margin: 0 auto;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(320px, 0.9fr);
  gap: 36px;
  align-items: center;
  padding: 64px 0 34px;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
  padding: 5px 10px;
  border: 1px solid #bfdbfe;
  border-radius: 999px;
  background: #eff6ff;
  color: var(--primary-dark);
  font-size: 13px;
  font-weight: 800;
}

h1 {
  margin: 0 0 18px;
  font-size: clamp(38px, 4.4vw, 58px);
  line-height: 1.08;
  letter-spacing: 0;
}

h2 {
  margin: 44px 0 16px;
  font-size: 30px;
  line-height: 1.25;
  letter-spacing: 0;
}

h3 {
  margin: 30px 0 10px;
  font-size: 21px;
}

section[id] {
  scroll-margin-top: 88px;
}

p {
  margin: 0 0 14px;
}

.lead {
  max-width: 720px;
  color: #475467;
  font-size: 19px;
  line-height: 1.7;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 28px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 16px;
  border: 1px solid var(--primary);
  border-radius: 8px;
  background: var(--primary);
  color: #ffffff;
  font-weight: 800;
}

.button.secondary {
  background: #ffffff;
  color: var(--primary-dark);
}

.button:hover {
  color: #ffffff;
  text-decoration: none;
  background: var(--primary-dark);
}

.button.secondary:hover {
  color: var(--primary-dark);
  background: var(--surface-soft);
}

.hero-panel,
.card,
.doc-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.hero-panel {
  padding: 24px;
}

.flow-list {
  display: grid;
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.flow-list li {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  padding: 12px;
  border: 1px solid #e5eaf3;
  border-radius: 8px;
  background: #fbfdff;
}

.num {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 8px;
  background: #e8f0ff;
  color: var(--primary-dark);
  font-weight: 900;
}

.grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin: 24px 0 8px;
}

.card {
  padding: 20px;
}

.card h3 {
  margin-top: 0;
}

.card p {
  color: var(--muted);
}

.doc-layout {
  display: grid;
  grid-template-columns: 285px minmax(660px, 1fr) minmax(320px, 26vw);
  gap: 0;
  align-items: start;
  padding: 0;
}

.toc {
  position: sticky;
  top: 65px;
  max-height: calc(100vh - 65px);
  overflow: auto;
  padding: 18px 16px 32px;
  background: #fafafa;
  border-right: 1px solid #e6e9ef;
}

.toc a {
  display: grid;
  gap: 2px;
  padding: 8px 10px;
  border-radius: 6px;
  color: #4b5565;
  font-size: 14px;
  font-weight: 700;
}

.toc a.active,
.toc a:hover {
  background: #edf3ff;
  color: var(--primary-dark);
  text-decoration: none;
}

.toc-search {
  position: sticky;
  top: -20px;
  z-index: 2;
  margin: -18px -16px 16px;
  padding: 16px;
  border-bottom: 1px solid #e6e9ef;
  background: #fafafa;
}

.toc-search input {
  width: 100%;
  height: 38px;
  padding: 0 12px;
  border: 1px solid #d6deea;
  border-radius: 8px;
  background: #ffffff;
  color: var(--text);
  font: inherit;
  font-size: 14px;
}

.toc-search input:focus {
  outline: 2px solid #bfdbfe;
  border-color: var(--primary);
}

.toc-group {
  margin: 0 0 18px;
}

.toc-group-title {
  margin: 16px 0 7px;
  padding: 0 10px;
  color: #8a94a6;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.endpoint-link small {
  overflow: hidden;
  color: #8a94a6;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 11px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.endpoint-link .method {
  margin-bottom: 2px;
}

.link-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
  margin: 18px 0 22px;
  padding: 16px;
  border: 1px solid #bfdbfe;
  border-radius: 8px;
  background: #eff6ff;
}

.link-card p {
  margin: 4px 0 0;
}

.doc-card {
  min-width: 0;
  padding: 52px 52px 72px;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.doc-card h1 {
  font-size: clamp(34px, 3.6vw, 48px);
}

.doc-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}

.doc-meta span {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 10px;
  border: 1px solid #bfdbfe;
  border-radius: 999px;
  background: #eff6ff;
  color: var(--primary-dark);
  font-size: 13px;
  font-weight: 800;
}

.step-list {
  display: grid;
  gap: 10px;
  margin: 16px 0 24px;
  padding-left: 22px;
}

.step-list li {
  padding-left: 4px;
}

.endpoint-card {
  margin-top: 56px;
  padding-top: 34px;
  border-top: 1px solid var(--line);
}

.endpoint-head {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-bottom: 10px;
}

.endpoint-head code {
  padding: 5px 8px;
  background: #f8fafc;
  color: #101828;
  font-size: 14px;
  word-break: break-all;
}

.method {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 58px;
  min-height: 28px;
  padding: 0 9px;
  border-radius: 6px;
  color: #ffffff;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 13px;
  font-weight: 900;
}

.method.mini {
  min-width: 42px;
  min-height: 20px;
  width: max-content;
  padding: 0 6px;
  border-radius: 4px;
  font-size: 10px;
  line-height: 20px;
}

.method.get {
  background: #138a55;
}

.method.post {
  background: #1457d9;
}

.endpoint-card h2 {
  margin-top: 0;
}

.sample-panel {
  position: sticky;
  top: 65px;
  min-width: 0;
  height: calc(100vh - 65px);
  overflow: auto;
  background: #1f2933;
  border-left: 1px solid #111827;
  color: #e5e7eb;
}

.sample-inner {
  padding: 30px 22px 38px;
}

.sample-kicker {
  margin-bottom: 10px;
  color: #8fb8ff;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.sample-panel h2 {
  margin: 0 0 10px;
  color: #ffffff;
  font-size: 22px;
  line-height: 1.3;
}

.sample-panel p {
  color: #cbd5e1;
  font-size: 14px;
  line-height: 1.65;
}

.sample-tabs {
  display: flex;
  gap: 6px;
  margin: 22px 0 12px;
  padding: 4px;
  border: 1px solid rgba(148, 163, 184, 0.28);
  border-radius: 8px;
  background: rgba(15, 23, 42, 0.54);
}

.sample-tabs button,
.copy-sample {
  min-height: 32px;
  border: 0;
  border-radius: 6px;
  font: inherit;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
}

.sample-tabs button {
  flex: 1;
  background: transparent;
  color: #cbd5e1;
}

.sample-tabs button.active {
  background: #ffffff;
  color: #172033;
}

.copy-sample {
  width: 100%;
  margin: 0 0 12px;
  background: #2f80ed;
  color: #ffffff;
}

.copy-sample:disabled {
  cursor: not-allowed;
  opacity: 0.48;
}

.sample-code {
  min-height: 360px;
  max-height: calc(100vh - 320px);
  margin: 0;
  border: 1px solid rgba(148, 163, 184, 0.2);
  background: #111827;
  font-size: 12px;
}

.sample-empty {
  margin: 14px 0 0;
  padding: 12px;
  border: 1px solid rgba(148, 163, 184, 0.28);
  border-radius: 8px;
  background: rgba(15, 23, 42, 0.54);
}

.notice {
  margin: 18px 0;
  padding: 14px 16px;
  border: 1px solid #fed7aa;
  border-radius: 8px;
  background: #fff7ed;
  color: #7c2d12;
}

.ok {
  border-color: #bbf7d0;
  background: #f0fdf4;
  color: #14532d;
}

table {
  width: 100%;
  margin: 16px 0 24px;
  border-collapse: collapse;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

th,
td {
  padding: 12px 14px;
  border-bottom: 1px solid #e5eaf3;
  text-align: left;
  vertical-align: top;
}

th {
  background: #f0f5ff;
  color: #344054;
  font-size: 15px;
}

tbody th {
  width: 190px;
  background: #f8fafc;
}

tr:last-child td {
  border-bottom: 0;
}

code {
  padding: 2px 5px;
  border-radius: 5px;
  background: #eef2f7;
  color: #0f3f9c;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 0.92em;
}

pre {
  overflow: auto;
  margin: 16px 0 24px;
  padding: 18px;
  border-radius: 8px;
  background: var(--code-bg);
  color: #e4e7ec;
  font-size: 14px;
  line-height: 1.68;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06);
}

pre code {
  padding: 0;
  background: transparent;
  color: inherit;
}

.screens {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
  margin: 20px 0 28px;
}

.screen {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.screen img {
  display: block;
  width: 100%;
  max-height: 520px;
  height: auto;
  padding: 14px;
  object-fit: contain;
  background: #fbfdff;
}

.screen figcaption {
  padding: 12px 14px;
  color: #475467;
  font-size: 15px;
  font-weight: 700;
}

.example-callout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
  margin: 22px 0;
  padding: 18px;
  border: 1px solid #bfdbfe;
  border-radius: 8px;
  background: #eff6ff;
}

.example-callout p {
  margin: 0;
  color: #1e40af;
  font-weight: 700;
}

.badge-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 12px 0 22px;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 10px;
  border: 1px solid #cbd5e1;
  border-radius: 999px;
  background: #ffffff;
  color: #344054;
  font-size: 14px;
  font-weight: 800;
}

.redoc-page {
  background: #ffffff;
}

.redoc-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 56px;
  padding: 0 20px;
  border-bottom: 1px solid var(--line);
  background: #ffffff;
}

.redoc-header a {
  font-weight: 800;
}

.redoc-full {
  min-height: calc(100vh - 56px);
  background: #ffffff;
}

.redoc-full redoc {
  display: block;
  min-height: calc(100vh - 56px);
}

footer {
  margin-top: 48px;
  padding: 26px 0;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 14px;
}

@media (max-width: 900px) {
  .topbar {
    align-items: flex-start;
    flex-direction: column;
    padding: 14px 20px;
  }

  .nav {
    flex-wrap: wrap;
  }

  .hero,
  .doc-layout {
    grid-template-columns: 1fr;
  }

  .toc {
    position: static;
    max-height: none;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .toc-search {
    position: static;
  }

  .grid,
  .screens {
    grid-template-columns: 1fr;
  }

  .doc-card {
    padding: 22px;
  }

  .sample-panel {
    position: static;
    height: auto;
  }

  .example-callout {
    grid-template-columns: 1fr;
  }

  .link-card {
    grid-template-columns: 1fr;
  }

  .screen img {
    max-height: 420px;
    padding: 10px;
  }

}
