:root {
  --ink: #141625;
  --ink2: #3d4359;
  --muted: #6b7288;
  --purple: #644ce0;
  --purple-d: #4f38c4;
  --purple-l: #f1eeff;
  --purple-xl: #f8f6ff;
  --obsidian: #141524;
  --line: #e6e8f0;
  --line-strong: #d4d8e6;
  --bg: #ffffff;
  --surface: #f7f8fc;
  --green: #14865c;
  --mono: "SF Mono", ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  --sans: "SF Pro Display", Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 88px;
}

body {
  margin: 0;
  color: var(--ink);
  font: 15.5px/1.7 var(--sans);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

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

a:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

code {
  font-family: var(--mono);
  font-size: 0.88em;
  background: var(--purple-xl);
  color: var(--purple-d);
  padding: 2px 6px;
  border-radius: 5px;
  border: 1px solid #e6e0fb;
}

pre {
  margin: 16px 0;
  padding: 16px 18px;
  background: var(--obsidian);
  color: #ebedfa;
  border-radius: 12px;
  overflow-x: auto;
  line-height: 1.65;
}

pre code {
  background: none;
  color: inherit;
  border: 0;
  padding: 0;
  font-size: 13px;
}

:focus-visible {
  outline: 2px solid var(--purple);
  outline-offset: 3px;
  border-radius: 6px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

.skip {
  position: absolute;
  left: -9999px;
}

.skip:focus {
  left: 12px;
  top: 12px;
  background: #fff;
  color: var(--ink);
  padding: 8px 14px;
  z-index: 60;
  border-radius: 8px;
  box-shadow: 0 4px 14px rgba(20, 22, 37, 0.14);
}

.wrap {
  width: min(1220px, calc(100% - 48px));
  margin: 0 auto;
}

/* Header */
.header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: saturate(1.4) blur(14px);
  -webkit-backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid var(--line);
}

.header-inner {
  height: 68px;
  display: flex;
  align-items: center;
  gap: 24px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-weight: 800;
  font-size: 19px;
  letter-spacing: -0.04em;
  color: var(--ink);
  text-decoration: none !important;
  flex: none;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: linear-gradient(145deg, #7a62f0, #553cc9);
  color: #fff;
  font-size: 17px;
  line-height: 1;
}

.brand-name b {
  color: var(--purple);
  font-weight: 800;
}

.brand-pill {
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  background: var(--purple-l);
  color: var(--purple-d);
  padding: 3px 7px;
  border-radius: 6px;
}

.doc-search-wrap {
  flex: 1;
  max-width: 420px;
  position: relative;
  display: flex;
  align-items: center;
}

#doc-search {
  width: 100%;
  height: 38px;
  padding: 0 74px 0 14px;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  background: var(--surface);
  color: var(--ink);
  font: 13.5px/1 var(--sans);
  transition: border-color 0.15s ease, background 0.15s ease;
}

#doc-search:focus {
  background: #fff;
  border-color: var(--purple);
  outline: none;
  box-shadow: 0 0 0 3px rgba(100, 76, 224, 0.14);
}

.search-count {
  position: absolute;
  right: 11px;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted);
  pointer-events: none;
}

.header-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 18px;
  font-size: 14px;
  font-weight: 600;
  flex: none;
}

.nav-link,
.signin {
  color: var(--ink2);
  text-decoration: none !important;
}

.nav-link:hover,
.signin:hover {
  color: var(--purple);
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--purple);
  color: #fff !important;
  border-radius: 9px;
  padding: 8px 15px;
  font-size: 13.5px;
  font-weight: 650;
  text-decoration: none !important;
  transition: background 0.16s ease;
}

.button:hover {
  background: var(--purple-d);
}

/* Docs Layout */
.docs-layout {
  display: grid;
  grid-template-columns: 256px minmax(0, 1fr);
  gap: 52px;
  padding-top: 36px;
  padding-bottom: 84px;
  align-items: start;
}

.sidebar {
  position: sticky;
  top: 96px;
  max-height: calc(100vh - 116px);
  overflow-y: auto;
  padding-right: 12px;
}

.toc {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.toc-group {
  font-family: var(--mono);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 18px 0 6px;
  padding-left: 12px;
}

.toc-group:first-child {
  margin-top: 0;
}

.toc a {
  display: block;
  padding: 7px 12px;
  border-radius: 8px;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--ink2);
  text-decoration: none;
  border-left: 2px solid transparent;
  transition: background 0.14s ease, color 0.14s ease;
}

.toc a:hover {
  background: var(--surface);
  color: var(--ink);
}

.toc a.is-active {
  background: var(--purple-xl);
  color: var(--purple-d);
  font-weight: 650;
  border-left-color: var(--purple);
}

/* Main Content */
.content {
  min-width: 0;
  max-width: 820px;
}

.doc-hero {
  padding-bottom: 32px;
  margin-bottom: 36px;
  border-bottom: 1px solid var(--line);
}

.eyebrow {
  font-family: var(--mono);
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.14em;
  color: var(--purple);
  margin: 0 0 10px;
}

.doc-hero h1 {
  font-size: clamp(32px, 3.6vw, 44px);
  letter-spacing: -0.04em;
  line-height: 1.08;
  margin: 0 0 14px;
}

.lead {
  font-size: 17px;
  color: var(--ink2);
  margin: 0 0 22px;
}

.quick-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.quick-links a {
  display: inline-flex;
  align-items: center;
  padding: 7px 13px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink2);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  transition: border-color 0.15s ease, color 0.15s ease, background 0.15s ease;
}

.quick-links a:hover {
  border-color: #cfc6f6;
  background: var(--purple-xl);
  color: var(--purple-d);
}

.empty-search {
  padding: 24px;
  border: 1px dashed var(--line-strong);
  border-radius: 12px;
  background: var(--surface);
  color: var(--muted);
}

.doc-section {
  padding: 8px 0 42px;
  margin-bottom: 32px;
  border-bottom: 1px solid var(--line);
}

.doc-section:last-of-type {
  border-bottom: 0;
  margin-bottom: 0;
}

.doc-section h2 {
  font-size: 26px;
  letter-spacing: -0.03em;
  margin: 0 0 14px;
}

.doc-section h3 {
  font-size: 17px;
  letter-spacing: -0.02em;
  margin: 24px 0 10px;
  color: var(--ink);
}

.doc-section p {
  margin: 0 0 14px;
  color: var(--ink2);
}

.doc-section ul,
.doc-steps {
  margin: 0 0 16px;
  padding-left: 20px;
  color: var(--ink2);
}

.doc-section li {
  margin-bottom: 8px;
}

.callout {
  margin: 20px 0 0;
  padding: 15px 18px;
  border-radius: 12px;
  border: 1px solid #dfd8fb;
  background: var(--purple-xl);
  color: var(--ink2);
  font-size: 14.5px;
}

.table-wrap {
  overflow-x: auto;
  margin: 16px 0 20px;
  border: 1px solid var(--line);
  border-radius: 12px;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  text-align: left;
}

th {
  background: var(--surface);
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 11px 14px;
  border-bottom: 1px solid var(--line);
}

td {
  padding: 11px 14px;
  border-bottom: 1px solid var(--line);
  color: var(--ink2);
  vertical-align: top;
}

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

/* Footer */
.footer {
  border-top: 1px solid var(--line);
  background: var(--surface);
}

.footer-inner {
  padding: 28px 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}

.footer-links {
  display: flex;
  gap: 22px;
  font-size: 14px;
  font-weight: 500;
}

.footer-links a {
  color: var(--ink2);
}

@media (max-width: 960px) {
  .docs-layout {
    grid-template-columns: 1fr;
    gap: 28px;
    padding-top: 24px;
  }

  .sidebar {
    position: static;
    max-height: none;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--surface);
  }
}

@media (max-width: 680px) {
  .wrap {
    width: calc(100% - 32px);
  }

  .header-inner {
    flex-wrap: wrap;
    height: auto;
    padding: 12px 0;
    gap: 12px;
  }

  .doc-search-wrap {
    order: 3;
    flex-basis: 100%;
    max-width: none;
  }

  .nav-link,
  .signin {
    display: none;
  }
}

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