:root {
  --bg: #f4f1ea;
  --ink: #101828;
  --ink-soft: #3f4b5f;
  --muted: #6f7787;
  --glass: rgba(255, 255, 255, 0.55);
  --glass-soft: rgba(255, 255, 255, 0.36);
  --glass-deep: rgba(255, 255, 255, 0.24);
  --line: rgba(255, 255, 255, 0.72);
  --line-soft: rgba(255, 255, 255, 0.42);
  --accent: #1f74ff;
  --accent-2: #00a6a6;
  --accent-3: #ff7a45;
  --accent-4: #c69214;
  --accent-5: #6f5cff;
  --accent-soft: rgba(31, 116, 255, 0.14);
  --teal-soft: rgba(0, 166, 166, 0.16);
  --coral-soft: rgba(255, 122, 69, 0.16);
  --gold-soft: rgba(198, 146, 20, 0.16);
  --violet-soft: rgba(111, 92, 255, 0.16);
  --code-bg: #111827;
  --code-ink: #edf3ff;
  --shadow: 0 24px 70px rgba(24, 29, 43, 0.16);
  --shadow-soft: 0 12px 32px rgba(24, 29, 43, 0.1);
  --radius-sm: 8px;
  --radius-md: 8px;
  --radius-lg: 8px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  min-height: 100vh;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  color: var(--ink);
  line-height: 1.6;
  background:
    radial-gradient(980px 560px at 7% -10%, rgba(0, 166, 166, 0.22), transparent 58%),
    radial-gradient(860px 520px at 98% 2%, rgba(255, 122, 69, 0.2), transparent 56%),
    radial-gradient(920px 520px at 52% 108%, rgba(111, 92, 255, 0.16), transparent 58%),
    linear-gradient(180deg, #fbfaf6 0%, #f2f4f0 44%, #eceff4 100%);
  background-attachment: fixed;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    linear-gradient(115deg, transparent 0 21%, rgba(255, 255, 255, 0.52) 21.5%, transparent 23% 100%),
    linear-gradient(145deg, transparent 0 61%, rgba(255, 122, 69, 0.1) 61.5%, transparent 63% 100%),
    linear-gradient(25deg, transparent 0 74%, rgba(0, 166, 166, 0.1) 74.5%, transparent 76% 100%);
  opacity: 0.78;
}

.container {
  width: min(1240px, calc(100% - 40px));
  margin: 0 auto;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 90;
  border-bottom: 1px solid var(--line-soft);
  background: rgba(246, 249, 255, 0.66);
  backdrop-filter: blur(28px) saturate(180%);
}

.topbar-inner {
  min-height: 70px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.brand {
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.brand strong {
  font-size: 22px;
  letter-spacing: 0;
  color: #111827;
}

.brand span {
  font-size: 13px;
  color: var(--muted);
}

.actions,
.hero-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.btn {
  min-height: 36px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.54);
  color: var(--ink);
  border-radius: var(--radius-sm);
  padding: 8px 13px;
  font-size: 13px;
  line-height: 1.2;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(18px) saturate(180%);
  transition: transform 0.18s ease, background 0.18s ease, box-shadow 0.18s ease;
}

.btn:hover {
  background: rgba(255, 255, 255, 0.78);
  transform: translateY(-1px);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8), 0 10px 24px rgba(18, 35, 64, 0.1);
}

.btn-primary {
  background: linear-gradient(135deg, #1f74ff 0%, #00a6a6 100%);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.46);
  box-shadow: 0 12px 28px rgba(0, 166, 166, 0.26), inset 0 1px 0 rgba(255, 255, 255, 0.32);
}

.btn-primary:hover {
  background: linear-gradient(135deg, #2884ff 0%, #13b8aa 100%);
}

.btn-sm {
  min-height: 30px;
  padding: 6px 10px;
  font-size: 12px;
}

.hero-band {
  position: relative;
  overflow: hidden;
  border-bottom: 1px solid var(--line-soft);
}

.hero-band::before {
  content: "";
  position: absolute;
  inset: 18px max(20px, calc((100vw - 1240px) / 2)) 18px;
  z-index: -1;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.74), rgba(255, 255, 255, 0.24)),
    linear-gradient(105deg, rgba(31, 116, 255, 0.14), rgba(0, 166, 166, 0.1) 48%, rgba(255, 122, 69, 0.12));
  box-shadow: var(--shadow);
  backdrop-filter: blur(30px) saturate(180%);
}

.hero-inner {
  min-height: 280px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(340px, 430px);
  gap: 28px;
  align-items: center;
  padding: 38px 28px;
}

.hero-copy {
  min-width: 0;
}

.hero-kicker {
  width: fit-content;
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.42);
  padding: 5px 10px;
  color: #4e668b;
  font-size: 12px;
  backdrop-filter: blur(16px);
}

.hero-title {
  margin: 14px 0 0;
  max-width: 680px;
  font-size: 42px;
  line-height: 1.14;
  letter-spacing: 0;
  color: #0f172a;
}

.hero-desc {
  max-width: 660px;
  margin: 12px 0 0;
  color: var(--ink-soft);
  font-size: 16px;
}

.hero-actions {
  margin-top: 18px;
}

.hero-visual {
  position: relative;
  min-height: 220px;
}

.hero-visual::before,
.hero-visual::after {
  content: "";
  position: absolute;
  border-radius: 999px;
  filter: blur(10px);
  opacity: 0.95;
}

.hero-visual::before {
  width: 120px;
  height: 120px;
  right: 24px;
  top: 0;
  background: rgba(0, 166, 166, 0.3);
}

.hero-visual::after {
  width: 150px;
  height: 150px;
  left: 8px;
  bottom: 0;
  background: rgba(255, 122, 69, 0.2);
}

.glass-console {
  position: relative;
  z-index: 1;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.38);
  box-shadow: var(--shadow);
  overflow: hidden;
  backdrop-filter: blur(24px) saturate(180%);
}

.glass-console::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(120deg, rgba(255, 255, 255, 0.72), transparent 28% 100%);
}

.glass-console::after {
  content: "";
  position: absolute;
  top: -40%;
  bottom: -40%;
  left: -70%;
  width: 42%;
  pointer-events: none;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.42), transparent);
  transform: rotate(14deg);
  animation: glassSweep 6s ease-in-out infinite;
}

.console-top {
  position: relative;
  z-index: 1;
  display: flex;
  gap: 7px;
  padding: 12px;
  border-bottom: 1px solid var(--line-soft);
}

.console-top span {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(15, 24, 48, 0.18);
}

.endpoint-line {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 14px 0;
}

.endpoint-line span {
  border-radius: 8px;
  background: var(--teal-soft);
  color: #007a7a;
  padding: 4px 7px;
  font-size: 12px;
  font-weight: 700;
}

.endpoint-line strong {
  font-size: 14px;
}

.glass-console pre {
  position: relative;
  z-index: 1;
  margin: 12px;
  border-radius: 8px;
  background: rgba(11, 21, 40, 0.9);
}

.model-stack {
  position: relative;
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0 12px 14px;
}

.model-stack span {
  border: 1px solid var(--line-soft);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.46);
  padding: 5px 9px;
  color: var(--ink-soft);
  font-size: 12px;
}

.model-stack span:nth-child(2) {
  background: var(--coral-soft);
}

.model-stack span:nth-child(3) {
  background: var(--violet-soft);
}

.docs-layout {
  display: grid;
  grid-template-columns: 270px minmax(0, 1fr);
  gap: 20px;
  padding: 22px 0 38px;
}

.toc {
  position: sticky;
  top: 92px;
  align-self: start;
}

.toc nav,
.section,
.api-item,
.tool-item,
.error-grid article,
.meta-item,
.poster-grid figure {
  border: 1px solid var(--line);
  background: var(--glass);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(24px) saturate(180%);
}

.toc nav {
  border-radius: var(--radius-lg);
  padding: 12px;
}

.toc h2 {
  margin: 0 0 8px;
  padding: 2px 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}

.toc a {
  display: block;
  text-decoration: none;
  color: var(--ink);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  font-size: 14px;
  transition: background 0.16s ease, color 0.16s ease;
}

.toc a:hover {
  background: rgba(255, 255, 255, 0.48);
}

.toc a.active {
  background: var(--accent-soft);
  color: #1558d0;
  font-weight: 700;
}

.doc-main {
  min-width: 0;
  max-width: 940px;
}

.section {
  position: relative;
  margin-top: 16px;
  border-radius: var(--radius-lg);
  padding: 24px;
  overflow: hidden;
}

.section::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(120deg, rgba(255, 255, 255, 0.62), transparent 24% 100%);
  opacity: 0.8;
}

.section::after {
  content: "";
  position: absolute;
  top: 0;
  left: 16px;
  right: 16px;
  height: 1px;
  background: rgba(255, 255, 255, 0.9);
  pointer-events: none;
}

.section:nth-of-type(3n + 1) {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.62), rgba(0, 166, 166, 0.1));
}

.section:nth-of-type(3n + 2) {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.62), rgba(255, 122, 69, 0.1));
}

.section:nth-of-type(3n) {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.62), rgba(111, 92, 255, 0.1));
}

.section > * {
  position: relative;
  z-index: 1;
}

.section:first-child {
  margin-top: 0;
}

.section h1 {
  margin: 0;
  font-size: 33px;
  line-height: 1.22;
}

.section h2 {
  margin: 0 0 12px;
  font-size: 24px;
  line-height: 1.28;
}

.section h3 {
  margin: 0 0 8px;
  font-size: 18px;
}

.section p {
  margin: 8px 0 0;
  color: var(--ink-soft);
}

.meta-grid,
.api-grid,
.tool-grid,
.error-grid,
.poster-grid {
  display: grid;
  gap: 10px;
}

.meta-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 14px;
}

.api-grid,
.tool-grid,
.error-grid,
.poster-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.meta-item,
.api-item,
.tool-item,
.error-grid article,
.poster-grid figure {
  border-radius: var(--radius-md);
  padding: 12px;
}

.api-item,
.tool-item,
.error-grid article {
  position: relative;
  overflow: hidden;
}

.api-item::before,
.tool-item::before,
.error-grid article::before {
  content: "";
  position: absolute;
  top: 10px;
  bottom: 10px;
  left: 0;
  width: 3px;
  border-radius: 999px;
  background: var(--accent);
}

.api-item:nth-child(2)::before,
.tool-item:nth-child(2)::before,
.error-grid article:nth-child(2)::before {
  background: var(--accent-2);
}

.api-item:nth-child(3)::before,
.tool-item:nth-child(3)::before,
.error-grid article:nth-child(3)::before {
  background: var(--accent-3);
}

.api-item:nth-child(4)::before,
.tool-item:nth-child(4)::before,
.error-grid article:nth-child(4)::before {
  background: var(--accent-5);
}

.meta-label {
  display: block;
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 12px;
}

.steps {
  margin: 0;
  padding-left: 22px;
}

.steps li {
  margin: 5px 0;
}

.note {
  margin: 0 0 10px;
  color: var(--muted);
}

.code-card {
  margin-top: 12px;
  border: 1px solid rgba(255, 255, 255, 0.36);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-soft);
}

.code-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(13, 30, 58, 0.9);
  color: #dce9ff;
  padding: 8px 10px;
}

pre {
  margin: 0;
  overflow: auto;
  background: var(--code-bg);
  color: var(--code-ink);
  padding: 14px;
  font-size: 13px;
  line-height: 1.5;
}

code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono",
    "Courier New", monospace;
}

.api-item pre {
  margin-top: 8px;
  border-radius: var(--radius-sm);
}

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

.models-grid code {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.42);
  padding: 8px;
  word-break: break-word;
  font-size: 12px;
}

.models-grid code:nth-child(4n + 1) {
  background: var(--teal-soft);
}

.models-grid code:nth-child(4n + 2) {
  background: var(--gold-soft);
}

.models-grid code:nth-child(4n + 3) {
  background: var(--violet-soft);
}

.models-grid code:nth-child(4n) {
  background: var(--coral-soft);
}

.purchase-section {
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.68), rgba(0, 166, 166, 0.12)),
    linear-gradient(45deg, rgba(31, 116, 255, 0.08), rgba(255, 122, 69, 0.08));
}

.purchase-flow {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-top: 16px;
}

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

.purchase-step {
  min-height: 190px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.66), rgba(255, 255, 255, 0.24)),
    linear-gradient(135deg, rgba(31, 116, 255, 0.08), rgba(0, 166, 166, 0.08));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.76), 0 14px 34px rgba(20, 32, 52, 0.08);
  padding: 14px;
  backdrop-filter: blur(20px) saturate(180%);
}

.purchase-step:nth-child(2) {
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.66), rgba(255, 255, 255, 0.24)),
    linear-gradient(135deg, var(--gold-soft), rgba(255, 122, 69, 0.08));
}

.purchase-step:nth-child(3) {
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.66), rgba(255, 255, 255, 0.24)),
    linear-gradient(135deg, var(--teal-soft), rgba(111, 92, 255, 0.08));
}

.purchase-step:nth-child(4) {
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.66), rgba(255, 255, 255, 0.24)),
    linear-gradient(135deg, var(--violet-soft), rgba(31, 116, 255, 0.08));
}

.purchase-step h3 {
  margin-bottom: 0;
}

.purchase-step p {
  margin-top: 0;
  font-size: 14px;
}

.purchase-step .btn {
  margin-top: auto;
  width: 100%;
}

.step-badge {
  width: 38px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(31, 116, 255, 0.26);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.58);
  color: #1558d0;
  font-weight: 800;
  font-size: 12px;
}

.redeem-note {
  margin-top: 12px;
  border: 1px solid rgba(0, 166, 166, 0.34);
  border-radius: var(--radius-md);
  background: rgba(237, 255, 252, 0.52);
  padding: 14px;
}

.redeem-note strong {
  display: block;
  margin-bottom: 6px;
}

.redeem-note ul {
  margin: 0;
  padding-left: 18px;
}

.redeem-note li {
  margin: 4px 0;
}

.tool-item ul {
  margin: 0;
  padding-left: 18px;
}

.tool-item li {
  margin: 4px 0;
}

.poster-grid figure {
  margin: 0;
  overflow: hidden;
  padding: 0;
}

.poster-grid img {
  display: block;
  width: 100%;
}

.poster-grid figcaption {
  border-top: 1px solid var(--line-soft);
  padding: 8px 10px;
  color: var(--muted);
  font-size: 13px;
}

.footer {
  color: var(--muted);
  padding: 10px 0 24px;
}

.toast {
  position: fixed;
  right: 14px;
  bottom: 14px;
  z-index: 120;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-sm);
  background: rgba(11, 24, 48, 0.88);
  color: #fff;
  box-shadow: var(--shadow);
  padding: 10px 12px;
  font-size: 13px;
  opacity: 0;
  transform: translateY(10px);
  transition: 0.2s ease;
  pointer-events: none;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

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

@keyframes glassSweep {
  0%,
  62% {
    transform: translateX(0) rotate(14deg);
    opacity: 0;
  }

  72% {
    opacity: 0.8;
  }

  100% {
    transform: translateX(430%) rotate(14deg);
    opacity: 0;
  }
}

@media (max-width: 1100px) {
  .docs-layout {
    grid-template-columns: 228px minmax(0, 1fr);
  }

  .hero-inner {
    grid-template-columns: minmax(0, 1fr) minmax(320px, 380px);
  }
}

@media (max-width: 920px) {
  .hero-band::before {
    inset: 12px 20px;
  }

  .hero-inner {
    grid-template-columns: 1fr;
    min-height: unset;
    padding: 28px 20px;
  }

  .hero-title {
    font-size: 32px;
  }

  .hero-visual {
    min-height: auto;
  }

  .docs-layout {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .toc {
    position: static;
  }

  .toc nav {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
  }

  .toc h2 {
    grid-column: 1 / -1;
  }

  .meta-grid,
  .api-grid,
  .purchase-flow,
  .purchase-flow.compact,
  .models-grid,
  .tool-grid,
  .error-grid,
  .poster-grid {
    grid-template-columns: 1fr;
  }

  .section h1 {
    font-size: 28px;
  }

  .section h2 {
    font-size: 22px;
  }
}
