:root {
  color-scheme: dark;
  --bg: #060912;
  --surface: #0c1222;
  --surface-soft: #10182b;
  --text: #eef3ff;
  --muted: #97a3bb;
  --line: rgba(255, 255, 255, 0.12);
  --line-strong: rgba(255, 255, 255, 0.18);
  --hot: #ff6a61;
  --orange: #ff9a62;
  --code: #161f34;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--text);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    "PingFang SC", "Microsoft YaHei", sans-serif;
  background:
    radial-gradient(circle at 30% 0%, rgba(255, 106, 97, 0.12), transparent 28rem),
    var(--bg);
  -webkit-font-smoothing: antialiased;
}

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

.docs-topbar {
  position: sticky;
  z-index: 30;
  top: 0;
  display: flex;
  min-height: 64px;
  gap: 18px;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  border-bottom: 1px solid var(--line);
  background: rgba(6, 9, 18, 0.78);
  backdrop-filter: blur(22px) saturate(140%);
}

.brand,
.top-links {
  display: flex;
  align-items: center;
}

.brand {
  gap: 10px;
  min-width: 190px;
  font-weight: 900;
}

.brand img {
  width: 34px;
  height: 34px;
  filter: drop-shadow(0 0 16px rgba(255, 106, 97, 0.36));
}

.top-links {
  display: grid;
  grid-template-columns: repeat(8, 58px) 88px;
  gap: 8px;
  justify-content: flex-end;
}

.top-links a {
  display: inline-flex;
  min-height: 36px;
  align-items: center;
  justify-content: center;
  padding: 0;
  border-radius: 999px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 850;
  line-height: 1;
  text-align: center;
  white-space: nowrap;
  transition:
    color 160ms ease,
    background 160ms ease,
    opacity 160ms ease,
    transform 160ms ease,
    box-shadow 160ms ease;
}

.top-links a:hover,
.top-links a.active {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  opacity: 1;
}

.top-links a:hover {
  transform: translateY(-1px);
}

.top-links .top-cta {
  background: linear-gradient(135deg, var(--hot), var(--orange));
  color: white;
  box-shadow: 0 12px 26px rgba(255, 106, 97, 0.18);
}

.top-links .top-cta:hover,
.top-links .top-cta.active {
  background: linear-gradient(135deg, var(--hot), var(--orange));
  color: white;
  box-shadow: 0 16px 34px rgba(255, 106, 97, 0.24);
}

.docs-layout {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr) 230px;
  gap: 36px;
  width: min(1440px, 100%);
  margin: 0 auto;
  padding: 28px 34px 80px;
}

.docs-sidebar,
.page-toc {
  position: sticky;
  top: 88px;
  height: calc(100vh - 112px);
  overflow: auto;
}

.search-box {
  display: flex;
  min-height: 44px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 22px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted);
  font-size: 14px;
}

kbd {
  min-width: 34px;
  padding: 4px 7px;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  background: var(--code);
  color: #cbd5e8;
  font-family: inherit;
  font-size: 12px;
  text-align: center;
}

.docs-sidebar nav,
.page-toc {
  display: grid;
  align-content: start;
}

.docs-sidebar p,
.page-toc p {
  margin: 22px 0 8px;
  color: #dce4f7;
  font-size: 13px;
  font-weight: 900;
}

.docs-sidebar p:first-child,
.page-toc p:first-child {
  margin-top: 0;
}

.docs-sidebar a,
.page-toc a {
  border-radius: 10px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
  transition:
    color 160ms ease,
    background 160ms ease,
    border-color 160ms ease,
    transform 160ms ease;
}

.docs-sidebar a {
  padding: 9px 12px;
}

.page-toc a {
  padding: 7px 0 7px 12px;
  border-left: 1px solid var(--line);
  border-radius: 0 10px 10px 0;
}

.docs-sidebar a:hover,
.docs-sidebar a.active,
.page-toc a:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.045);
}

.docs-sidebar a.active {
  background: rgba(255, 106, 97, 0.12);
}

.docs-sidebar a:hover {
  transform: translateX(2px);
}

.page-toc a:hover {
  border-left-color: rgba(255, 106, 97, 0.6);
}

.docs-main {
  min-width: 0;
}

.doc-article {
  max-width: 920px;
  margin: 0 auto;
}

.breadcrumb {
  margin-bottom: 20px;
  color: var(--muted);
  font-size: 14px;
}

section {
  scroll-margin-top: 84px;
  padding: 22px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

section:first-of-type {
  padding-top: 0;
}

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

h1 {
  max-width: 100%;
  margin-bottom: 18px;
  color: #f6f8ff;
  font-size: clamp(28px, 3.2vw, 42px);
  line-height: 1.12;
  letter-spacing: 0;
  white-space: normal;
}

h2 {
  margin-bottom: 14px;
  padding-top: 8px;
  color: #f3f6ff;
  font-size: clamp(26px, 3vw, 34px);
  line-height: 1.18;
  letter-spacing: 0;
}

h3 {
  margin: 24px 0 10px;
  color: #edf2ff;
  font-size: 20px;
  line-height: 1.3;
}

p,
li {
  color: #b9c3d8;
  font-size: 16px;
  line-height: 1.9;
}

.lead {
  color: #c7d0e3;
  font-size: 18px;
}

ul,
ol {
  margin: 10px 0 0;
  padding-left: 22px;
}

li + li {
  margin-top: 6px;
}

.callout,
.note,
.warning {
  margin: 18px 0;
  border: 1px solid rgba(255, 106, 97, 0.28);
  border-radius: 14px;
  background: rgba(255, 106, 97, 0.08);
  color: #dce4f7;
}

.callout,
.warning {
  padding: 16px 18px;
  line-height: 1.8;
}

.note {
  padding: 14px 16px;
}

.warning {
  border-color: rgba(255, 177, 102, 0.34);
  background: rgba(255, 154, 98, 0.09);
}

.hero-doc {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 0.82fr);
  gap: 28px;
  align-items: center;
  padding-top: 0;
}

.eyebrow {
  margin-bottom: 12px;
  color: var(--hot);
  font-size: 14px;
  font-weight: 900;
}

.feature-list,
.term-grid,
.license-cards {
  display: grid;
  gap: 12px;
}

.feature-list {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

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

.feature-list article,
.term-grid article,
.license-cards article,
.screenshot,
.accordion-grid details,
.log-shot {
  border: 1px solid var(--line);
  border-radius: 16px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.045), rgba(255, 255, 255, 0.018)),
    rgba(12, 18, 34, 0.78);
  box-shadow: 0 18px 52px rgba(0, 0, 0, 0.24);
}

.feature-list article,
.term-grid article,
.license-cards article {
  padding: 18px;
}

.feature-list b,
.term-grid b {
  display: block;
  margin-bottom: 8px;
  color: #f2f6ff;
  font-size: 17px;
}

.feature-list span,
.term-grid span {
  color: var(--muted);
  line-height: 1.7;
}

.screenshot {
  margin: 0;
  overflow: hidden;
}

.help-shot {
  display: block;
  width: 100%;
  height: auto;
  background: #070b15;
}

.screenshot figcaption {
  padding: 12px 16px 15px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
}

.mock-window {
  margin: 16px;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  background: #070b15;
}

.mock-bar {
  display: flex;
  min-height: 38px;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  border-bottom: 1px solid var(--line);
  color: #dfe6f8;
  font-size: 13px;
}

.mock-bar span {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.22);
}

.mock-bar b {
  margin-left: 6px;
}

.mock-body {
  padding: 18px;
}

.mock-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
}

.mock-brand img {
  width: 42px;
  height: 42px;
}

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

mark {
  display: inline-flex;
  min-height: 36px;
  align-items: center;
  justify-content: center;
  padding: 0 10px;
  border-radius: 10px;
  background: rgba(255, 106, 97, 0.16);
  color: #ffd8d3;
  font-weight: 850;
}

.mock-grid mark:last-child {
  grid-column: 1 / -1;
}

.flow {
  display: flex;
  gap: 8px;
  align-items: center;
  margin: 18px 0;
  overflow-x: auto;
  padding-bottom: 3px;
}

.flow span {
  flex: 0 0 auto;
  min-height: 40px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.045);
  color: #e7edfb;
  display: inline-flex;
  align-items: center;
  font-weight: 850;
}

.flow i {
  flex: 0 0 28px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--hot), transparent);
}

.tutorial-row {
  display: grid;
  grid-template-columns: minmax(280px, 0.9fr) minmax(0, 1fr);
  gap: 20px;
  align-items: start;
  margin: 16px 0 22px;
}

.mock-form {
  display: grid;
  gap: 12px;
  padding: 18px;
}

.mock-form b {
  font-size: 18px;
}

.mock-form label {
  display: flex;
  min-height: 48px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: #dce4f7;
  background: rgba(5, 8, 16, 0.62);
}

.mock-form button,
.gateway-state button,
.log-shot button {
  min-height: 40px;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--hot), var(--orange));
  color: white;
  font-weight: 900;
}

.accordion-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.accordion-grid details,
#faq details {
  padding: 16px 18px;
}

.accordion-grid summary,
#faq summary {
  cursor: pointer;
  color: #f3f6ff;
  font-weight: 900;
}

.accordion-grid p {
  margin: 10px 0 0;
  font-size: 15px;
  line-height: 1.75;
}

.channel-tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  padding: 18px;
}

.gateway-state {
  display: grid;
  gap: 12px;
  padding: 18px;
}

.gateway-state strong {
  display: inline-flex;
  width: max-content;
  min-height: 36px;
  align-items: center;
  padding: 0 12px;
  border-radius: 999px;
  background: rgba(41, 210, 132, 0.14);
  color: #8ff0ba;
}

.log-shot {
  display: grid;
  gap: 8px;
  margin: 16px 0;
  padding: 16px;
}

.log-shot code {
  display: block;
  padding: 10px 12px;
  border-radius: 10px;
  background: #050812;
  color: #bfe5cf;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 14px;
}

.log-shot div {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 6px;
}

.license-cards h3 {
  margin-top: 0;
}

#faq details {
  margin-bottom: 10px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.035);
}

#faq p {
  margin: 12px 0 0;
}

.steps {
  display: grid;
  gap: 10px;
  padding: 0;
  list-style: none;
}

.steps li {
  display: grid;
  grid-template-columns: 34px 1fr;
  gap: 12px;
  align-items: start;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.035);
}

.steps span {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--hot), var(--orange));
  color: white;
  font-weight: 900;
}

.steps p {
  margin: 0;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin: 14px 0 20px;
}

.chips span {
  display: inline-flex;
  min-height: 34px;
  align-items: center;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  color: #d9e1f2;
  font-size: 14px;
  font-weight: 760;
}

.doc-button {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  padding: 0 18px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--hot), var(--orange));
  color: white;
  font-weight: 900;
}

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

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

  .page-toc {
    display: none;
  }

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

@media (max-width: 860px) {
  .docs-topbar {
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
    padding: 12px 14px;
  }

  .brand {
    min-width: 0;
  }

  .top-links {
    display: flex;
    width: 100%;
    gap: 8px;
    justify-content: flex-start;
    overflow-x: auto;
    padding-bottom: 2px;
    -webkit-overflow-scrolling: touch;
  }

  .top-links::-webkit-scrollbar {
    display: none;
  }

  .top-links a {
    flex: 0 0 58px;
    min-height: 36px;
  }

  .top-links .top-cta {
    flex-basis: 82px;
  }

  .docs-layout {
    display: block;
    padding: 18px 18px 64px;
  }

  .docs-sidebar {
    position: static;
    height: auto;
    margin-bottom: 22px;
    overflow: visible;
  }

  .docs-sidebar nav {
    display: flex;
    gap: 8px;
    margin: 0 -18px;
    padding: 0 18px 4px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .docs-sidebar nav::-webkit-scrollbar {
    display: none;
  }

  .docs-sidebar p {
    display: none;
  }

  .docs-sidebar a {
    flex: 0 0 auto;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.04);
  }

  .search-box {
    margin-bottom: 12px;
  }

  .feature-list,
  .term-grid,
  .license-cards,
  .accordion-grid {
    grid-template-columns: 1fr;
  }

  .hero-doc {
    gap: 18px;
  }

  h1 {
    font-size: clamp(20px, 6.2vw, 30px);
  }

  .brand span {
    max-width: 150px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
}

@media (max-width: 540px) {
  .docs-layout {
    padding-inline: 14px;
  }

  .docs-sidebar nav {
    margin: 0 -14px;
    padding: 0 14px 4px;
  }

  p,
  li {
    font-size: 15px;
  }

  .steps li {
    grid-template-columns: 30px 1fr;
    padding: 12px;
  }

  .steps span {
    width: 30px;
    height: 30px;
  }

  .mock-grid,
  .channel-tabs {
    grid-template-columns: 1fr;
  }

  .mock-grid mark:last-child {
    grid-column: auto;
  }

  .mock-form label {
    align-items: flex-start;
    flex-direction: column;
    justify-content: center;
    padding: 10px 12px;
  }
}
