:root {
  --bg: #f2f7fb;
  --bg-accent: #e8f7fb;
  --surface: #ffffff;
  --surface-strong: #f7fbfe;
  --text: #102033;
  --muted: #4d6277;
  --border: #d7e4f0;
  --primary: #00b7d9;
  --primary-strong: #007e99;
  --code-bg: #071922;
  --code-text: #d8f2ff;
  --danger: #d25757;
  --warning: #efb64a;
  --success: #0f9f7f;
  --shadow: 0 18px 45px rgba(13, 40, 65, 0.12);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--text);
  background:
    radial-gradient(1200px 420px at 90% -60px, rgba(0, 183, 217, 0.22), transparent 65%),
    radial-gradient(900px 460px at -10% 30%, rgba(0, 138, 188, 0.16), transparent 62%),
    var(--bg);
  font-family: "Space Grotesk", system-ui, -apple-system, Segoe UI, sans-serif;
  min-height: 100vh;
}

a {
  color: inherit;
}

.docs-shell {
  width: min(1400px, 96vw);
  margin: 0 auto;
  padding: 20px 0 60px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  border: 1px solid rgba(215, 228, 240, 0.8);
  background: rgba(255, 255, 255, 0.86);
  backdrop-filter: blur(14px);
  border-radius: 18px;
  padding: 12px 16px;
  box-shadow: 0 10px 30px rgba(11, 44, 70, 0.08);
  position: sticky;
  top: 12px;
  z-index: 100;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text);
  font-weight: 700;
  letter-spacing: 0.01em;
}

.brand-mark {
  width: 30px;
  height: 30px;
  border-radius: 10px;
  border: 1px solid #b9cedf;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #f9fdff, #e8f7ff);
}

.brand-mark svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: #062939;
}

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

.btn {
  border-radius: 999px;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  font-weight: 600;
  padding: 9px 14px;
  font-size: 0.9rem;
}

.btn.primary {
  color: #fff;
  background: linear-gradient(135deg, #00b7d9, #0085a2);
  box-shadow: 0 10px 24px rgba(0, 144, 181, 0.34);
}

.btn.ghost {
  color: var(--text);
  border-color: var(--border);
  background: #fff;
}

.layout {
  margin-top: 18px;
  display: grid;
  gap: 20px;
  grid-template-columns: 280px minmax(0, 1fr);
  align-items: start;
}

.sidebar {
  position: sticky;
  top: 92px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(8px);
  border-radius: 18px;
  padding: 14px;
  box-shadow: var(--shadow);
}

.sidebar h2 {
  margin: 2px 0 10px;
  font-size: 0.96rem;
}

.toc {
  max-height: calc(100vh - 230px);
  overflow: auto;
  padding-right: 6px;
}

.toc a {
  display: block;
  text-decoration: none;
  color: #375068;
  font-size: 0.88rem;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid transparent;
}

.toc a:hover,
.toc a.active {
  background: #edfaff;
  border-color: #c7edf7;
  color: #114869;
}

.toc .nested {
  padding-left: 10px;
}

.sidebar-meta {
  margin-top: 12px;
  border-top: 1px dashed #c9dce9;
  padding-top: 12px;
  font-size: 0.82rem;
  color: #5f7489;
  display: grid;
  gap: 8px;
}

.content {
  display: grid;
  gap: 16px;
}

.hero {
  background: linear-gradient(150deg, rgba(255, 255, 255, 0.96), rgba(230, 248, 255, 0.92));
  border: 1px solid var(--border);
  border-radius: 24px;
  box-shadow: var(--shadow);
  padding: clamp(20px, 3vw, 34px);
  position: relative;
  overflow: hidden;
}

.hero::after {
  content: "";
  position: absolute;
  right: -48px;
  top: -48px;
  width: 220px;
  height: 220px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(0, 183, 217, 0.24), transparent 64%);
}

.badges {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.badge {
  display: inline-flex;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.78rem;
  border: 1px solid #c4e7f2;
  color: #0f5670;
  background: #f0fbff;
}

.hero h1 {
  margin: 0;
  font-size: clamp(1.75rem, 3vw, 2.5rem);
  line-height: 1.12;
}

.hero p {
  margin: 10px 0 0;
  color: #3d556c;
  max-width: 76ch;
}

.search-wrap {
  margin-top: 16px;
  display: grid;
  gap: 8px;
}

.search {
  width: 100%;
  border: 1px solid #c8ddee;
  border-radius: 12px;
  padding: 12px 14px;
  font-size: 0.95rem;
  background: rgba(255, 255, 255, 0.96);
  color: #082136;
}

.search:focus {
  border-color: #7fd4e9;
  outline: none;
  box-shadow: 0 0 0 3px rgba(0, 183, 217, 0.16);
}

.search-meta {
  font-size: 0.82rem;
  color: #547089;
}

.section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  box-shadow: var(--shadow);
  padding: clamp(18px, 2.2vw, 30px);
  animation: section-enter 420ms ease both;
}

.section.is-hidden {
  display: none;
}

.section h2 {
  margin: 0 0 12px;
  font-size: clamp(1.2rem, 1.8vw, 1.55rem);
}

.section h3 {
  margin: 22px 0 10px;
  font-size: 1.05rem;
}

.section h4 {
  margin: 18px 0 10px;
  font-size: 0.95rem;
}

.section p,
.section li {
  color: #334f66;
  line-height: 1.65;
}

.section ul,
.section ol {
  margin: 6px 0 0;
  padding-left: 20px;
}

.note,
.warning,
.tip {
  border-radius: 12px;
  padding: 12px 14px;
  margin: 12px 0;
  border: 1px solid;
}

.note {
  background: #f4fbff;
  border-color: #cdeaf6;
}

.warning {
  background: #fff9ef;
  border-color: #f4deb3;
}

.tip {
  background: #eefcf7;
  border-color: #bee9d9;
}

.table-wrap {
  width: 100%;
  overflow: auto;
  border: 1px solid #d8e8f2;
  border-radius: 12px;
  margin: 10px 0;
  background: #fbfeff;
}

.table-wrap table {
  width: 100%;
  border-collapse: collapse;
  min-width: 640px;
}

.table-wrap th,
.table-wrap td {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid #e1edf5;
  vertical-align: top;
  font-size: 0.9rem;
}

.table-wrap th {
  background: #eef8fd;
  color: #193f59;
  font-weight: 700;
}

.table-wrap tbody tr:hover {
  background: #f7fcff;
}

.code-block {
  margin: 12px 0;
  border: 1px solid #11344a;
  background: linear-gradient(180deg, #0b2331, #071a27);
  border-radius: 14px;
  overflow: hidden;
}

.code-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-bottom: 1px solid rgba(120, 200, 230, 0.25);
  background: rgba(255, 255, 255, 0.03);
}

.code-lang {
  font-family: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  color: #9ed9f3;
  font-size: 0.78rem;
}

.copy-btn {
  border: 1px solid #4e819b;
  background: #0d3347;
  color: #d6f2ff;
  border-radius: 9px;
  padding: 4px 9px;
  font-size: 0.76rem;
  cursor: pointer;
}

.copy-btn:hover {
  background: #10455f;
}

.code-block pre {
  margin: 0;
  padding: 14px;
  overflow: auto;
}

.code-block code {
  font-family: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  color: var(--code-text);
  font-size: 0.86rem;
  line-height: 1.55;
}

.inline-code {
  font-family: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  background: #eff6fb;
  color: #0f3f59;
  padding: 2px 6px;
  border-radius: 6px;
  font-size: 0.86em;
}

.faq details {
  border: 1px solid #d6e6f3;
  border-radius: 12px;
  margin-bottom: 10px;
  background: #fcfeff;
  padding: 8px 12px;
}

.faq summary {
  cursor: pointer;
  font-weight: 600;
  color: #1a4863;
}

.faq p {
  margin-top: 8px;
}

.footer-note {
  text-align: center;
  color: #61788e;
  font-size: 0.84rem;
  margin-top: 6px;
}

.mobile-toc-toggle {
  display: none;
}

@keyframes section-enter {
  from {
    transform: translateY(12px);
    opacity: 0;
  }

  to {
    transform: translateY(0);
    opacity: 1;
  }
}

@media (max-width: 1080px) {
  .layout {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: fixed;
    left: 12px;
    right: 12px;
    top: 78px;
    transform: translateY(-14px) scale(0.98);
    opacity: 0;
    pointer-events: none;
    max-height: calc(100vh - 100px);
    overflow: auto;
    z-index: 120;
  }

  .sidebar.open {
    transform: translateY(0) scale(1);
    opacity: 1;
    pointer-events: auto;
  }

  .mobile-toc-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .toc {
    max-height: unset;
  }
}

@media (max-width: 680px) {
  .docs-shell {
    width: min(100vw - 16px, 680px);
    padding-top: 12px;
  }

  .topbar {
    border-radius: 14px;
    padding: 10px;
  }

  .brand {
    font-size: 0.9rem;
  }

  .btn {
    font-size: 0.82rem;
    padding: 8px 11px;
  }

  .hero {
    border-radius: 16px;
  }

  .section {
    border-radius: 14px;
    padding: 16px;
  }

  .table-wrap th,
  .table-wrap td {
    font-size: 0.84rem;
  }
}
