:root {
  --bg: #09090b;
  --surface: #111113;
  --surface-strong: #18181b;
  --border: #292d35;
  --border-soft: #20242b;
  --text: #f5f7fa;
  --text-secondary: #a1a1aa;
  --text-muted: #85858f;
  --blue: #3b82f6;
  --blue-soft: rgba(59, 130, 246, 0.12);
  --green: #22c55e;
  --green-soft: rgba(34, 197, 94, 0.12);
  --amber: #eab308;
  --amber-soft: rgba(234, 179, 8, 0.12);
  --red: #ef4444;
  --radius: 8px;
  --font: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  --mono: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.72;
  letter-spacing: 0;
}

a { color: inherit; text-decoration: none; }
button, select { font: inherit; letter-spacing: 0; }
button, a.button { min-height: 36px; }

.docs-topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  height: 62px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 0 28px;
  background: rgba(11, 12, 14, 0.94);
  border-bottom: 1px solid var(--border-soft);
  backdrop-filter: blur(14px);
}

.docs-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  font-size: 15px;
  font-weight: 650;
}

.docs-brand-mark {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 28px;
  border: 1px solid rgba(75, 141, 248, 0.45);
  border-radius: 5px;
  background: var(--blue-soft);
  color: #8ab7ff;
  font-family: var(--mono);
  font-size: 11px;
}

.docs-topbar-actions { display: flex; align-items: center; gap: 10px; }

.version-badge {
  color: var(--text-muted);
  font-family: var(--mono);
  font-size: 12px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 7px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 600;
}

.button-secondary { background: var(--surface); color: var(--text-secondary); }
.button-secondary:hover { border-color: #3c424d; color: var(--text); background: var(--surface-strong); }

.docs-shell {
  display: grid;
  grid-template-columns: 250px minmax(0, 900px);
  gap: 54px;
  max-width: 1260px;
  margin: 0 auto;
  padding: 36px 28px 80px;
}

.docs-sidebar {
  position: sticky;
  top: 98px;
  align-self: start;
  max-height: calc(100vh - 118px);
  overflow-y: auto;
  padding-right: 12px;
}

.base-url-block {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 6px 8px;
  padding: 0 0 18px;
  border-bottom: 1px solid var(--border-soft);
}

.base-url-label {
  grid-column: 1 / -1;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}

.base-url-block code {
  min-width: 0;
  overflow: hidden;
  color: #88c6a6;
  font-family: var(--mono);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.copy-base {
  min-height: auto;
  padding: 0;
  border: 0;
  background: none;
  color: var(--blue);
  cursor: pointer;
  font-size: 12px;
}

.docs-nav { display: grid; gap: 2px; margin-top: 16px; }
.docs-nav a {
  padding: 7px 10px;
  border-left: 2px solid transparent;
  color: var(--text-muted);
  font-size: 13px;
}
.docs-nav a:hover { color: var(--text-secondary); background: rgba(255,255,255,0.025); }
.docs-nav a.active { border-left-color: var(--blue); color: #8ab7ff; background: var(--blue-soft); }

.docs-content { min-width: 0; }
.mobile-toc { display: none; }

.docs-section {
  scroll-margin-top: 84px;
  padding: 50px 0;
  border-top: 1px solid var(--border-soft);
}

.docs-section:first-of-type { border-top: 0; }
.docs-intro { padding-top: 12px; }

.section-kicker {
  margin-bottom: 9px;
  color: var(--green);
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

h1, h2, h3 { margin: 0; letter-spacing: 0; line-height: 1.3; }
h1 { max-width: 760px; font-size: 36px; font-weight: 720; }
h2 { margin-bottom: 18px; font-size: 25px; font-weight: 700; }
h3 { margin: 30px 0 12px; font-size: 17px; font-weight: 650; }
p { margin: 0 0 17px; color: var(--text-secondary); }
.lead { max-width: 780px; margin-top: 16px; font-size: 17px; line-height: 1.75; }

code {
  font-family: var(--mono);
  font-size: 0.9em;
}

p code, li code, td code {
  padding: 2px 5px;
  border: 1px solid var(--border-soft);
  border-radius: 4px;
  background: var(--surface);
  color: #d6deeb;
  overflow-wrap: anywhere;
}

.notice {
  display: grid;
  gap: 5px;
  margin: 24px 0;
  padding: 15px 17px;
  border-left: 3px solid;
  border-radius: 0 var(--radius) var(--radius) 0;
}
.notice strong { font-size: 14px; }
.notice span { color: var(--text-secondary); font-size: 14px; }
.notice-warning { border-color: var(--amber); background: var(--amber-soft); }
.notice-warning strong { color: #efc675; }
.notice-info { border-color: var(--blue); background: var(--blue-soft); }
.notice-info strong { color: #8ab7ff; }

.workflow {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0;
  margin: 32px 0 0;
  padding: 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  list-style: none;
}
.workflow li { display: flex; gap: 11px; min-width: 0; padding: 18px 14px; border-left: 1px solid var(--border); }
.workflow li:first-child { border-left: 0; }
.workflow li > span {
  display: grid;
  place-items: center;
  flex: 0 0 24px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--green-soft);
  color: #70d0a1;
  font-family: var(--mono);
  font-size: 11px;
}
.workflow strong { display: block; font-size: 13px; }
.workflow small { display: block; margin-top: 4px; color: var(--text-muted); font-size: 12px; line-height: 1.55; }

.plain-list { margin: 0; padding-left: 20px; color: var(--text-secondary); }
.plain-list li { margin: 7px 0; padding-left: 3px; }
.plain-list li::marker { color: var(--text-muted); }

.two-column, .security-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 36px; }

.table-wrap { width: 100%; overflow-x: auto; margin: 17px 0 24px; border-top: 1px solid var(--border); }
table { width: 100%; min-width: 620px; border-collapse: collapse; text-align: left; }
th, td { padding: 12px 13px; border-bottom: 1px solid var(--border-soft); vertical-align: top; }
th { color: var(--text-muted); font-size: 11px; font-weight: 700; text-transform: uppercase; }
td { color: var(--text-secondary); font-size: 14px; }
td:first-child { color: var(--text); }

.method {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 46px;
  padding: 2px 6px;
  border: 1px solid;
  border-radius: 4px;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 700;
}
.method.get { border-color: rgba(56,178,122,0.35); background: var(--green-soft); color: #70d0a1; }
.method.post { border-color: rgba(75,141,248,0.4); background: var(--blue-soft); color: #8ab7ff; }

.code-block { margin: 17px 0 24px; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; background: #090a0c; }
.code-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 38px;
  padding: 0 12px;
  border-bottom: 1px solid var(--border-soft);
  background: var(--surface);
  color: var(--text-muted);
  font-size: 12px;
}
.code-header button {
  min-height: 28px;
  padding: 3px 8px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 12px;
}
.code-header button:hover { border-color: #414753; color: var(--text); }
pre { margin: 0; padding: 16px; overflow-x: auto; color: #d6deeb; font-family: var(--mono); font-size: 13px; line-height: 1.65; tab-size: 2; }
pre code { font-size: inherit; white-space: pre; }

.status-flow {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 9px;
  margin: 21px 0;
  color: var(--text-muted);
}
.status-flow span { padding: 4px 9px; border: 1px solid var(--border); border-radius: 4px; background: var(--surface); color: var(--text-secondary); font-family: var(--mono); font-size: 12px; }
.status-flow .status-success { border-color: rgba(56,178,122,0.35); color: #70d0a1; }
.status-flow .status-failed { border-color: rgba(224,108,117,0.35); color: #ef9299; }
.status-flow b, .status-flow em { font-size: 12px; font-style: normal; font-weight: 400; }

.security-column { padding-top: 14px; border-top: 2px solid; }
.security-column.allowed { border-color: var(--green); }
.security-column.blocked { border-color: var(--red); }
.security-column h3 { margin-top: 0; }

.checklist { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 11px 30px; margin: 0; padding: 0; list-style: none; }
.checklist li { position: relative; padding-left: 27px; color: var(--text-secondary); }
.checklist li::before {
  content: "✓";
  position: absolute;
  left: 0;
  top: 2px;
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  border: 1px solid rgba(56,178,122,0.4);
  border-radius: 4px;
  background: var(--green-soft);
  color: #70d0a1;
  font-size: 11px;
}

.docs-footer { display: flex; justify-content: space-between; gap: 20px; padding-top: 26px; border-top: 1px solid var(--border); color: var(--text-muted); font-size: 12px; }
.docs-footer a { color: var(--blue); }

.copy-status {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 100;
  min-width: 120px;
  padding: 9px 13px;
  border: 1px solid rgba(56,178,122,0.35);
  border-radius: var(--radius);
  background: #13231b;
  color: #8edbb4;
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
  transition: opacity 0.18s ease, transform 0.18s ease;
  font-size: 13px;
}
.copy-status.visible { opacity: 1; transform: translateY(0); }

@media (max-width: 900px) {
  .docs-shell { grid-template-columns: 1fr; gap: 0; padding-top: 22px; }
  .docs-sidebar { display: none; }
  .mobile-toc { display: grid; gap: 6px; margin-bottom: 24px; }
  .mobile-toc label { color: var(--text-muted); font-size: 12px; }
  .mobile-toc select {
    width: 100%;
    height: 42px;
    padding: 0 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    color: var(--text);
  }
  .workflow { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .workflow li:nth-child(3) { border-left: 0; border-top: 1px solid var(--border); }
  .workflow li:nth-child(4) { border-top: 1px solid var(--border); }
}

@media (max-width: 620px) {
  .docs-topbar { height: auto; min-height: 62px; padding: 10px 16px; }
  .docs-brand > span:last-child { display: none; }
  .version-badge { display: none; }
  .button { padding: 7px 9px; font-size: 12px; }
  .docs-shell { padding: 18px 18px 60px; }
  .docs-section { padding: 38px 0; scroll-margin-top: 74px; }
  .docs-intro { padding-top: 8px; }
  h1 { font-size: 29px; }
  h2 { font-size: 22px; }
  .lead { font-size: 16px; }
  .workflow, .two-column, .security-grid, .checklist { grid-template-columns: 1fr; }
  .workflow li { border-left: 0; border-top: 1px solid var(--border); }
  .workflow li:first-child { border-top: 0; }
  .table-wrap { margin-left: 0; margin-right: 0; }
  pre { padding: 14px; font-size: 12px; }
  .copy-status { right: 16px; bottom: 16px; left: 16px; text-align: center; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
