:root {
  color-scheme: dark;
  --bg: #08111f;
  --bg-soft: #0d1829;
  --panel: rgba(17, 29, 48, 0.86);
  --panel-solid: #101b2e;
  --panel-raised: #152238;
  --text: #edf5ff;
  --muted: #91a1b6;
  --faint: #5d6f87;
  --border: rgba(145, 161, 182, 0.18);
  --border-strong: rgba(93, 184, 255, 0.35);
  --green: #65e4a3;
  --blue: #5bb8ff;
  --amber: #ffd166;
  --red: #ff7c8a;
  --shadow: 0 22px 80px rgba(0, 0, 0, 0.36);
  --radius-xl: 30px;
  --radius-lg: 22px;
  --radius-md: 16px;
  --mono: "JetBrains Mono", "SFMono-Regular", "Cascadia Code", Consolas, monospace;
  --sans: "Avenir Next", "PingFang SC", "Noto Sans SC", "Source Han Sans SC", sans-serif;
}

html[data-theme="light"] {
  color-scheme: light;
  --bg: #eef5fb;
  --bg-soft: #f8fbff;
  --panel: rgba(255, 255, 255, 0.9);
  --panel-solid: #ffffff;
  --panel-raised: #f7fbff;
  --text: #0d1d33;
  --muted: #5b6a80;
  --faint: #7e8da0;
  --border: rgba(16, 39, 66, 0.12);
  --border-strong: rgba(0, 113, 188, 0.28);
  --shadow: 0 24px 80px rgba(48, 79, 114, 0.14);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--sans);
  color: var(--text);
  background:
    radial-gradient(circle at 16% 8%, rgba(91, 184, 255, 0.2), transparent 28rem),
    radial-gradient(circle at 86% 16%, rgba(101, 228, 163, 0.12), transparent 30rem),
    linear-gradient(140deg, var(--bg), var(--bg-soft));
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -1;
  content: "";
  opacity: 0.4;
  background-image:
    linear-gradient(rgba(145, 161, 182, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(145, 161, 182, 0.05) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: linear-gradient(to bottom, black, transparent 78%);
}

a {
  color: inherit;
  text-decoration: none;
}

code,
pre {
  font-family: var(--mono);
}

code {
  padding: 0.12rem 0.36rem;
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  background: rgba(91, 184, 255, 0.08);
  color: var(--blue);
  font-size: 0.92em;
}

pre code {
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: inherit;
  font-size: 0.88rem;
}

.shell {
  display: grid;
  grid-template-columns: 292px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  display: flex;
  height: 100vh;
  flex-direction: column;
  gap: 1.4rem;
  padding: 1.4rem;
  border-right: 1px solid var(--border);
  background: rgba(5, 11, 21, 0.58);
  backdrop-filter: blur(22px);
}

html[data-theme="light"] .sidebar {
  background: rgba(248, 251, 255, 0.74);
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.brand-mark {
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  padding: 3px;
  border-radius: 14px;
  overflow: hidden;
  background: radial-gradient(circle at 50% 15%, rgba(91, 184, 255, 0.16), rgba(255, 255, 255, 0.04) 62%);
  box-shadow: 0 12px 38px rgba(91, 184, 255, 0.18);
}

.brand-mark img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.brand strong {
  display: block;
  font-size: 1.06rem;
}

.brand small {
  color: var(--muted);
  font-size: 0.78rem;
}

.search-box {
  display: grid;
  gap: 0.5rem;
  color: var(--muted);
  font-size: 0.76rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.search-box input {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 14px;
  outline: 0;
  padding: 0.82rem 0.9rem;
  background: var(--panel);
  color: var(--text);
  font: inherit;
}

.search-box input:focus {
  border-color: var(--border-strong);
  box-shadow: 0 0 0 4px rgba(91, 184, 255, 0.12);
}

.nav {
  display: grid;
  gap: 0.28rem;
}

.nav a {
  padding: 0.72rem 0.85rem;
  border-radius: 12px;
  color: var(--muted);
  font-size: 0.95rem;
  transition: 180ms ease;
}

.nav a:hover,
.nav a.active {
  background: rgba(91, 184, 255, 0.12);
  color: var(--text);
}

.sidebar-card {
  margin-top: auto;
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--panel);
}

.sidebar-card p {
  margin: 0.75rem 0 0;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.65;
}

.content {
  width: min(1120px, calc(100vw - 292px));
  margin: 0 auto;
  padding: 1.25rem 2.25rem 4rem;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 0;
  background: linear-gradient(to bottom, var(--bg), rgba(8, 17, 31, 0));
  backdrop-filter: blur(10px);
}

html[data-theme="light"] .topbar {
  background: linear-gradient(to bottom, var(--bg), rgba(238, 245, 251, 0));
}

.status-pill,
.theme-toggle,
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--panel);
  color: var(--text);
  font: inherit;
}

.status-pill {
  padding: 0.56rem 0.9rem;
  color: var(--muted);
  font-size: 0.86rem;
}

.pulse {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 7px rgba(101, 228, 163, 0.12);
}

.theme-toggle,
.button {
  cursor: pointer;
  padding: 0.66rem 1rem;
}

.theme-toggle:hover,
.button:hover {
  border-color: var(--border-strong);
}

.button.primary {
  border-color: transparent;
  background: linear-gradient(135deg, #5bb8ff, #65e4a3);
  color: #06111f;
  font-weight: 800;
}

.button.ghost {
  color: var(--muted);
}

.doc-section {
  scroll-margin-top: 90px;
  margin: 1.4rem 0;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) 0.85fr;
  gap: 1.2rem;
  min-height: 460px;
  align-items: stretch;
}

.hero-copy,
.endpoint-card,
.metric-card,
.step-card,
.info-card,
.code-card,
.compact-grid article,
.faq details,
.admin-list,
.check-list,
.log-table,
.pricing-row {
  border: 1px solid var(--border);
  background: var(--panel);
  box-shadow: var(--shadow);
}

.hero-copy {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(1.6rem, 4vw, 3rem);
  border-radius: var(--radius-xl);
  background:
    linear-gradient(140deg, rgba(91, 184, 255, 0.16), transparent 42%),
    var(--panel);
}

.eyebrow {
  color: var(--blue);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  max-width: 820px;
  margin-bottom: 1rem;
  font-size: clamp(3rem, 7vw, 5.9rem);
  line-height: 0.92;
  letter-spacing: -0.08em;
}

h2 {
  margin-bottom: 0.65rem;
  font-size: clamp(2rem, 4vw, 3rem);
  letter-spacing: -0.06em;
}

h3 {
  margin-bottom: 0.55rem;
  font-size: 1.15rem;
}

p,
li {
  color: var(--muted);
  line-height: 1.85;
}

.hero-copy p {
  max-width: 680px;
  font-size: 1.08rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  margin-top: 1.4rem;
}

.endpoint-card {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 1.4rem;
  border-radius: var(--radius-xl);
  background:
    radial-gradient(circle at 80% 12%, rgba(101, 228, 163, 0.16), transparent 18rem),
    var(--panel);
}

.endpoint-card dl {
  display: grid;
  gap: 0.9rem;
  margin: 1.3rem 0 0;
}

.endpoint-card div {
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.03);
}

.endpoint-card dt {
  color: var(--muted);
  font-size: 0.85rem;
}

.endpoint-card dd {
  margin: 0.4rem 0 0;
}

.grid {
  display: grid;
  gap: 1rem;
}

.grid.three {
  grid-template-columns: repeat(3, 1fr);
}

.metric-card {
  position: relative;
  overflow: hidden;
  padding: 1.2rem;
  border-radius: var(--radius-lg);
}

.metric-card::after {
  position: absolute;
  inset: auto 1rem 1rem auto;
  width: 82px;
  height: 82px;
  border-radius: 50%;
  content: "";
  filter: blur(6px);
  opacity: 0.2;
}

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

.metric-card strong {
  display: block;
  margin: 0.7rem 0 0.4rem;
  font-size: 1.25rem;
}

.metric-card p {
  margin-bottom: 0;
}

.accent-green::after {
  background: var(--green);
}

.accent-blue::after {
  background: var(--blue);
}

.accent-amber::after {
  background: var(--amber);
}

.section-heading {
  margin: 4.2rem 0 1.2rem;
}

.section-heading p {
  max-width: 760px;
  margin-bottom: 0;
}

.steps,
.split,
.compact-grid,
.terminal-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}

.split {
  grid-template-columns: repeat(2, 1fr);
}

.terminal-grid {
  margin-bottom: 1.2rem;
}

.step-card,
.info-card,
.compact-grid article,
.docs-link-card {
  padding: 1.2rem;
  border-radius: var(--radius-lg);
}

.step-index {
  display: inline-flex;
  margin-bottom: 1.2rem;
  color: var(--amber);
  font-weight: 900;
}

.note {
  padding: 0.85rem 1rem;
  border: 1px solid rgba(91, 184, 255, 0.28);
  border-radius: var(--radius-md);
  background: rgba(91, 184, 255, 0.08);
  color: var(--muted);
  line-height: 1.75;
}

.note.warning {
  border-color: rgba(255, 209, 102, 0.35);
  background: rgba(255, 209, 102, 0.1);
}

.code-card {
  overflow: hidden;
  margin-top: 1rem;
  border-radius: var(--radius-lg);
}

.code-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.9rem 1rem;
  border-bottom: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.03);
  color: var(--muted);
  font-size: 0.9rem;
}

.code-title button {
  border: 1px solid var(--border);
  border-radius: 999px;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  padding: 0.38rem 0.72rem;
}

pre {
  overflow: auto;
  margin: 0;
  padding: 1.15rem;
  background: #07101d;
  color: #cde5ff;
  line-height: 1.7;
}

html[data-theme="light"] pre {
  background: #0c1524;
}

.model-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.model-grid span {
  padding: 0.75rem 0.9rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--panel);
  color: var(--text);
  font-family: var(--mono);
  font-size: 0.88rem;
}

.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.tab {
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--panel);
  color: var(--muted);
  cursor: pointer;
  font: inherit;
  padding: 0.68rem 1rem;
}

.tab.active {
  border-color: var(--border-strong);
  background: rgba(91, 184, 255, 0.14);
  color: var(--text);
}

.tab-panel {
  display: none;
}

.tab-panel.active {
  display: block;
}

.pricing-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  overflow: hidden;
  margin-top: 1rem;
  border-radius: var(--radius-lg);
}

.docs-link-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.2rem;
  border: 1px solid var(--border);
  background:
    radial-gradient(circle at 86% 10%, rgba(91, 184, 255, 0.18), transparent 18rem),
    var(--panel);
  box-shadow: var(--shadow);
}

.docs-link-card h3 {
  margin-top: 0.45rem;
  font-size: 1.45rem;
}

.docs-link-card p {
  margin-bottom: 0;
}

.pricing-row div {
  padding: 1.2rem;
  background: var(--panel-solid);
}

.pricing-row span {
  display: block;
  color: var(--muted);
}

.pricing-row strong {
  display: block;
  margin-top: 0.6rem;
  font-size: 1.1rem;
}

.log-table {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  overflow: hidden;
  border-radius: var(--radius-lg);
}

.log-table div {
  display: grid;
  gap: 0.38rem;
  padding: 1rem;
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.log-table strong {
  color: var(--text);
}

.log-table span {
  color: var(--muted);
}

.compact-grid {
  grid-template-columns: repeat(4, 1fr);
}

.compact-grid strong {
  display: block;
  margin-bottom: 0.5rem;
}

.compact-grid span {
  color: var(--muted);
  line-height: 1.7;
}

.check-list {
  display: grid;
  gap: 0.8rem;
  padding: 1.1rem;
  border-radius: var(--radius-lg);
}

.check-list div {
  display: flex;
  gap: 0.7rem;
  align-items: flex-start;
  color: var(--muted);
  line-height: 1.7;
}

.check-list span {
  color: var(--green);
  font-weight: 900;
}

.faq {
  display: grid;
  gap: 0.7rem;
}

.faq details {
  border-radius: var(--radius-md);
  padding: 1rem;
}

.faq summary {
  cursor: pointer;
  font-weight: 800;
}

.faq p {
  margin: 0.75rem 0 0;
}

.admin-list {
  padding: 1.2rem 1.2rem 1.2rem 2.7rem;
  border-radius: var(--radius-lg);
}

.admin-list li::marker {
  color: var(--blue);
  font-weight: 900;
}

.footer {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 4rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.9rem;
}

.is-hidden-by-search {
  display: none;
}

mark {
  border-radius: 0.28rem;
  background: rgba(255, 209, 102, 0.36);
  color: inherit;
}

@media (max-width: 980px) {
  .shell {
    display: block;
  }

  .sidebar {
    position: relative;
    height: auto;
    border-right: 0;
    border-bottom: 1px solid var(--border);
  }

  .nav {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .content {
    width: 100%;
    padding: 1rem;
  }

  .hero,
  .grid.three,
  .steps,
  .split,
  .terminal-grid,
  .compact-grid,
  .pricing-row,
  .log-table,
  .docs-link-card {
    grid-template-columns: 1fr;
  }

  .docs-link-card {
    display: grid;
    align-items: stretch;
  }
}

@media (max-width: 560px) {
  .topbar,
  .footer {
    align-items: stretch;
    flex-direction: column;
  }

  .hero-copy {
    padding: 1.35rem;
  }

  h1 {
    font-size: 3rem;
  }

  .nav {
    grid-template-columns: 1fr;
  }
}
