:root {
  color-scheme: light;
  --bg: #f5f7fb;
  --panel: #ffffff;
  --panel-soft: #f8fafc;
  --text: #111827;
  --muted: #64748b;
  --line: #dbe3ee;
  --accent: #0f766e;
  --accent-soft: #dff7f3;
  --accent-strong: #115e59;
  --code-bg: #0f172a;
  --shadow: 0 18px 45px rgba(15, 23, 42, 0.08);
}

* {
  box-sizing: border-box;
}

html {
  scroll-padding-top: 84px;
}

body {
  margin: 0;
  min-width: 320px;
  padding-top: 64px;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
  letter-spacing: 0;
}

a {
  color: var(--accent-strong);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.app-shell {
  min-height: 100vh;
}

.topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
  padding: 0 28px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(14px);
}

.brand {
  display: inline-flex;
  align-items: center;
  min-width: 0;
  color: var(--text);
  text-decoration: none;
}

.brand:hover {
  text-decoration: none;
}

.brand-logo {
  width: 34px;
  height: 34px;
  margin-right: 10px;
  border-radius: 7px;
  object-fit: cover;
  background: var(--panel-soft);
}

.brand strong,
.brand small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.brand strong {
  font-size: 16px;
  line-height: 20px;
}

.brand small {
  color: var(--muted);
  font-size: 12px;
  line-height: 16px;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.ghost-link,
.icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--panel);
  color: var(--text);
  font-size: 14px;
  cursor: pointer;
}

.ghost-link {
  padding: 0 14px;
}

.icon-button {
  width: 40px;
  gap: 4px;
  flex-direction: column;
}

.icon-button span {
  width: 18px;
  height: 2px;
  background: var(--text);
}

.mobile-only {
  display: none;
}

.layout {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  min-height: calc(100vh - 64px);
}

.sidebar {
  position: sticky;
  top: 64px;
  align-self: start;
  height: calc(100vh - 64px);
  overflow: auto;
  border-right: 1px solid var(--line);
  background: var(--panel);
}

.sidebar-head {
  padding: 22px 22px 10px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.menu {
  padding: 0 12px 24px;
}

.menu-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.menu-list .menu-list {
  margin-left: 12px;
  padding-left: 10px;
  border-left: 1px solid var(--line);
}

.menu-link {
  display: flex;
  align-items: center;
  width: 100%;
  min-height: 38px;
  margin: 2px 0;
  padding: 8px 10px;
  border-radius: 7px;
  color: #334155;
  font-size: 14px;
  line-height: 20px;
  text-decoration: none;
}

.menu-link:hover {
  background: var(--panel-soft);
  text-decoration: none;
}

.menu-link.active {
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-weight: 700;
}

.menu-group {
  min-height: 34px;
  color: #0f172a;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0;
  cursor: default;
}

.menu-group:hover {
  background: transparent;
}

.content-wrap {
  min-width: 0;
  padding: 34px 32px 56px;
}

.doc-content {
  width: min(100%, 980px);
  min-height: calc(100vh - 154px);
  margin: 0 auto;
  padding: 42px 52px 56px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
  scroll-margin-top: 84px;
}

.doc-content h1,
.doc-content h2,
.doc-content h3,
.doc-content h4 {
  margin: 32px 0 14px;
  line-height: 1.25;
}

.doc-content h1:first-child,
.doc-content h2:first-child,
.doc-content h3:first-child {
  margin-top: 0;
}

.doc-content h1 {
  font-size: 30px;
}

.doc-content h2 {
  font-size: 24px;
}

.doc-content h3 {
  font-size: 20px;
}

.doc-content p,
.doc-content li,
.doc-content td,
.doc-content th {
  font-size: 16px;
  line-height: 1.75;
}

.doc-content p {
  margin: 12px 0;
}

.doc-content blockquote {
  margin: 18px 0;
  padding: 12px 16px;
  border-left: 4px solid var(--accent);
  background: var(--accent-soft);
  color: #164e63;
}

.table-scroll {
  width: 100%;
  margin: 18px 0 26px;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.doc-content table {
  width: 100%;
  min-width: 720px;
  border-collapse: separate;
  border-spacing: 0;
}

.doc-content .table-scroll th,
.doc-content .table-scroll td {
  padding: 11px 12px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
  font-size: 14px;
  line-height: 1.55;
}

.doc-content .table-scroll th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #eef8f6;
  color: #0f3f3a;
  font-weight: 700;
  white-space: nowrap;
}

.doc-content .table-scroll th:first-child,
.doc-content .table-scroll td:first-child {
  position: sticky;
  left: 0;
  z-index: 1;
  background: #ffffff;
  font-weight: 700;
  white-space: nowrap;
}

.doc-content .table-scroll th:first-child {
  z-index: 3;
  background: #e4f4f1;
}

.doc-content .table-scroll tr:last-child td {
  border-bottom: 0;
}

.doc-content .table-scroll th:last-child,
.doc-content .table-scroll td:last-child {
  border-right: 0;
}

.doc-content .table-scroll td:nth-child(n + 2):nth-child(-n + 6) {
  white-space: nowrap;
}

.doc-content .table-scroll td strong {
  color: #0f766e;
}

.doc-content .table-scroll del {
  color: #94a3b8;
}

.doc-content code {
  padding: 2px 6px;
  border-radius: 5px;
  background: #eef2f7;
  color: #0f172a;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 0.9em;
}

.doc-content pre {
  position: relative;
  overflow: auto;
  padding: 16px;
  border-radius: 8px;
  background: var(--code-bg);
  color: #e2e8f0;
}

.doc-content pre code {
  padding: 0;
  background: transparent;
  color: inherit;
}

.copy-code-button {
  position: absolute;
  top: 10px;
  right: 10px;
  min-width: 56px;
  height: 30px;
  border: 1px solid #dbe3ee;
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.94);
  color: #334155;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

.command-step {
  margin: 18px 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: #ffffff;
}

.command-step pre {
  margin: 0;
  border-radius: 0;
}

.command-head {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 58px;
  padding: 0 18px;
  background: #f8fafc;
}

.step-badge.small {
  width: 30px;
  height: 30px;
  border-radius: 999px;
  background: #ffffff;
  color: #475569;
  font-size: 13px;
}

.doc-content img {
  max-width: 100%;
  height: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.doc-content figure {
  margin: 18px 0 28px;
}

.doc-content figcaption {
  margin-top: 8px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
  text-align: center;
}

.doc-callout {
  margin: 18px 0 24px;
  padding: 14px 16px;
  border: 1px solid #cdece8;
  border-radius: 8px;
  background: #f0fbf9;
}

.doc-callout p {
  margin-bottom: 0;
}

.action-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 20px 0 28px;
}

.doc-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0 16px;
  border: 1px solid #0f766e;
  border-radius: 7px;
  background: #0f766e;
  color: #ffffff;
  font-size: 14px;
  font-weight: 800;
  text-decoration: none;
}

.doc-button:hover {
  background: #115e59;
  color: #ffffff;
  text-decoration: none;
}

.doc-button.secondary {
  background: #ffffff;
  color: #0f766e;
}

.doc-button.secondary:hover {
  background: #f0fbf9;
  color: #115e59;
}

.overview-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 260px;
  gap: 24px;
  align-items: end;
  margin: -10px 0 30px;
  padding: 28px;
  border: 1px solid #cdece8;
  border-radius: 8px;
  background: linear-gradient(135deg, #f0fbf9 0%, #ffffff 62%);
  animation: docFadeUp 520ms ease both;
}

.overview-hero h1 {
  margin: 4px 0 12px;
}

.eyebrow {
  margin: 0;
  color: #0f766e;
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.hero-status {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.hero-status span,
.hero-status strong {
  display: block;
}

.hero-status span {
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 6px;
}

.hero-status strong {
  color: #0f766e;
  font-size: 15px;
  line-height: 1.5;
}

.flow-steps {
  position: relative;
  display: grid;
  gap: 14px;
  margin: 24px 0 34px;
}

.flow-step {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr);
  gap: 16px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  animation: docFadeUp 520ms ease both;
}

.flow-step:nth-child(2) {
  animation-delay: 80ms;
}

.flow-step:nth-child(3) {
  animation-delay: 160ms;
}

.flow-step:nth-child(4) {
  animation-delay: 240ms;
}

.flow-step:nth-child(5) {
  animation-delay: 320ms;
}

.step-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 8px;
  background: #0f766e;
  color: #ffffff;
  font-size: 14px;
  font-weight: 900;
}

.flow-step h2 {
  margin: 0 0 6px;
  font-size: 18px;
}

.flow-step p {
  margin: 0;
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin: 18px 0 30px;
}

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

.feature-card {
  display: block;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--text);
  text-decoration: none;
  transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.feature-card:hover {
  transform: translateY(-2px);
  border-color: #9bd8d0;
  box-shadow: 0 14px 30px rgba(15, 23, 42, 0.08);
  text-decoration: none;
}

.feature-card h3 {
  margin: 10px 0 8px;
  font-size: 17px;
}

.feature-card p {
  margin: 0;
  color: #475569;
  font-size: 14px;
}

.feature-index {
  display: inline-flex;
  color: #0f766e;
  font-size: 12px;
  font-weight: 900;
}

.animated-callout {
  animation: docPulse 2.6s ease-in-out infinite;
}

@keyframes docFadeUp {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes docPulse {
  0%,
  100% {
    box-shadow: 0 0 0 rgba(15, 118, 110, 0);
  }
  50% {
    box-shadow: 0 0 0 5px rgba(15, 118, 110, 0.08);
  }
}

.doc-tabs {
  margin: 20px 0;
}

.doc-tab-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
}

.doc-tab {
  min-height: 36px;
  padding: 0 16px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #475569;
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}

.doc-tab.active {
  background: #ffffff;
  color: #0f766e;
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.08);
}

.doc-tab-panel {
  display: none;
  padding-top: 22px;
}

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

.nested-tabs {
  margin-top: 14px;
}

.empty-doc {
  padding: 26px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
  color: var(--muted);
}

@media (max-width: 860px) {
  .topbar {
    padding: 0 14px;
  }

  .mobile-only {
    display: inline-flex;
  }

  .layout {
    display: block;
  }

  .sidebar {
    position: fixed;
    inset: 64px auto 0 0;
    z-index: 20;
    width: min(84vw, 320px);
    transform: translateX(-100%);
    transition: transform 180ms ease;
    box-shadow: var(--shadow);
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .content-wrap {
    padding: 18px 12px 32px;
  }

  .doc-content {
    min-height: calc(100vh - 114px);
    padding: 26px 18px 36px;
  }

  .doc-content h1 {
    font-size: 25px;
  }

  .doc-content h2 {
    font-size: 21px;
  }

  .overview-hero,
  .feature-grid,
  .feature-grid.compact {
    grid-template-columns: 1fr;
  }

  .flow-step {
    grid-template-columns: 1fr;
  }
}
