:root {
  color-scheme: light;
  --bg: #f9fafb;
  --text: #111827;
  --muted: #64748b;
  --line: #e5e7eb;
  --line-soft: #f3f4f6;
  --surface: rgba(255, 255, 255, 0.78);
  --surface-strong: #ffffff;
  --surface-muted: #f9fafb;
  --header-bg: rgba(255, 255, 255, 0.8);
  --header-border: rgba(255, 255, 255, 0.2);
  --hover-bg: #f3f4f6;
  --secondary-text: #374151;
  --title-from: #111827;
  --inner-surface: #ffffff;
  --accent-ring: #99f6e4;
  --soft: #f0fdfa;
  --accent: #14b8a6;
  --accent-hover: #0d9488;
  --accent-strong: #0f766e;
  --shadow: 0 8px 32px rgba(0, 0, 0, 0.08);
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.04), 0 1px 2px rgba(0, 0, 0, 0.06);
  --shadow-hover: 0 10px 40px rgba(0, 0, 0, 0.08);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #020617;
  --text: #f8fafc;
  --muted: #94a3b8;
  --line: #334155;
  --line-soft: rgba(51, 65, 85, 0.58);
  --surface: rgba(15, 23, 42, 0.78);
  --surface-strong: #0f172a;
  --surface-muted: #111827;
  --header-bg: rgba(15, 23, 42, 0.82);
  --header-border: rgba(51, 65, 85, 0.62);
  --hover-bg: rgba(30, 41, 59, 0.84);
  --secondary-text: #e2e8f0;
  --title-from: #f8fafc;
  --inner-surface: rgba(15, 23, 42, 0.72);
  --accent-ring: rgba(45, 212, 191, 0.32);
  --soft: rgba(20, 184, 166, 0.16);
  --accent: #2dd4bf;
  --accent-hover: #14b8a6;
  --accent-strong: #5eead4;
  --shadow: 0 8px 32px rgba(0, 0, 0, 0.32);
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.28), 0 1px 2px rgba(0, 0, 0, 0.22);
  --shadow-hover: 0 10px 40px rgba(0, 0, 0, 0.36);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  background:
    radial-gradient(at 40% 20%, rgba(20, 184, 166, 0.12) 0, transparent 50%),
    radial-gradient(at 80% 0%, rgba(6, 182, 212, 0.08) 0, transparent 50%),
    radial-gradient(at 0% 50%, rgba(20, 184, 166, 0.08) 0, transparent 50%),
    var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

code {
  border: 1px solid var(--accent-ring);
  border-radius: 8px;
  background: var(--soft);
  color: var(--accent-strong);
  padding: 0.08rem 0.32rem;
}

.topbar {
  position: sticky;
  top: 14px;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  width: min(1120px, calc(100% - 32px));
  margin: 14px auto 0;
  border: 1px solid var(--header-border);
  border-radius: 24px;
  background: var(--header-bg);
  box-shadow: var(--shadow);
  padding: 10px 12px;
  backdrop-filter: blur(18px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
}

.brand img {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  object-fit: cover;
  box-shadow: 0 0 20px rgba(20, 184, 166, 0.25);
}

.brand span {
  display: grid;
  gap: 2px;
}

.brand strong {
  font-size: 1rem;
}

.brand small,
.lead,
.steps p,
.safe-list span,
details p {
  color: var(--muted);
}

nav {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 600;
}

nav a:not(.console),
.toc a {
  border-radius: 12px;
  transition: background-color 0.2s ease, color 0.2s ease;
}

nav a:hover,
.toc a:hover {
  color: var(--text);
}

nav a:not(.console):hover,
.toc a:hover {
  background: var(--hover-bg);
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface-strong);
  color: var(--secondary-text);
  padding: 0 12px;
  font: inherit;
  font-size: 0.9rem;
  font-weight: 650;
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.theme-toggle:hover {
  border-color: var(--accent-ring);
  background: var(--hover-bg);
  color: var(--text);
}

.theme-toggle-dot {
  width: 18px;
  height: 18px;
  border-radius: 999px;
  background: linear-gradient(135deg, #facc15 0 50%, var(--accent) 50% 100%);
  box-shadow: 0 0 18px rgba(20, 184, 166, 0.35);
}

:root[data-theme="dark"] .theme-toggle-dot {
  background: linear-gradient(135deg, #0f172a 0 50%, var(--accent) 50% 100%);
}

.console,
.primary,
.secondary,
.snippet-head button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  border-radius: 14px;
  font-size: 0.92rem;
  font-weight: 650;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}

.console,
.primary {
  background: linear-gradient(90deg, var(--accent), var(--accent-hover));
  color: #ffffff;
  padding: 0 16px;
  box-shadow: 0 8px 20px rgba(20, 184, 166, 0.25);
}

.console:hover,
.primary:hover {
  background: linear-gradient(90deg, var(--accent-hover), var(--accent-strong));
  box-shadow: 0 12px 26px rgba(20, 184, 166, 0.3);
  transform: translateY(-1px);
}

.secondary {
  border: 1px solid var(--line);
  background: var(--surface-strong);
  color: var(--secondary-text);
  padding: 0 16px;
  box-shadow: var(--shadow-sm);
}

.secondary:hover {
  border-color: var(--line);
  background: var(--surface-muted);
}

main {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
}

.hero {
  display: grid;
  justify-items: center;
  padding: 94px 0 34px;
  text-align: center;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 14px;
  color: var(--accent-strong);
  font-size: 0.78rem;
  font-weight: 950;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.eyebrow::before {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--accent);
  box-shadow: 0 0 18px rgba(20, 184, 166, 0.7);
  content: "";
}

h1,
h2,
h3 {
  margin: 0;
  letter-spacing: -0.045em;
}

h1 {
  max-width: 880px;
  background: linear-gradient(135deg, var(--title-from), var(--accent-strong) 62%, var(--accent));
  background-clip: text;
  color: transparent;
  font-size: clamp(2.55rem, 6vw, 5rem);
  line-height: 0.98;
}

h2 {
  font-size: clamp(1.5rem, 3vw, 2.35rem);
}

.hero p:not(.eyebrow) {
  max-width: 780px;
  margin: 22px 0 0;
  color: var(--muted);
  font-size: 1.08rem;
  line-height: 1.85;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-top: 30px;
}

.quick-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  overflow: hidden;
  border: 1px solid var(--line-soft);
  border-radius: 24px;
  background: var(--line-soft);
  box-shadow: var(--shadow-sm);
}

.quick-cards article {
  display: grid;
  gap: 8px;
  min-width: 0;
  background: var(--surface-strong);
  padding: 20px;
}

.quick-cards span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 950;
  text-transform: uppercase;
}

.quick-cards strong {
  overflow-wrap: anywhere;
  font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
}

.layout {
  display: grid;
  grid-template-columns: 230px minmax(0, 1fr);
  gap: 28px;
  align-items: start;
  padding: 48px 0 72px;
}

.toc,
.doc-card {
  border: 1px solid var(--line-soft);
  border-radius: 24px;
  background: var(--surface-strong);
  box-shadow: var(--shadow-sm);
  backdrop-filter: blur(18px);
}

.toc {
  position: sticky;
  top: 92px;
  display: grid;
  gap: 4px;
  padding: 16px;
}

.toc strong {
  margin-bottom: 8px;
}

.toc a {
  color: var(--muted);
  padding: 10px 12px;
  font-size: 0.92rem;
  font-weight: 600;
}

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

.doc-card {
  display: grid;
  gap: 18px;
  padding: clamp(20px, 3vw, 30px);
  scroll-margin-top: 100px;
  transition: box-shadow 0.2s ease, border-color 0.2s ease;
}

.doc-card:hover {
  border-color: var(--line);
  box-shadow: var(--shadow-hover);
}

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

.steps li,
.safe-list article,
details {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--inner-surface);
  padding: 16px;
}

.steps p,
details p {
  margin: 8px 0 0;
  line-height: 1.7;
}

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

.snippet {
  overflow: hidden;
  border-radius: 18px;
  background: #101827;
  color: #e5e7eb;
}

.snippet-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: #182235;
  padding: 10px 14px;
}

.snippet-head span {
  color: #9ca3af;
  font-size: 0.76rem;
  font-weight: 950;
  text-transform: uppercase;
}

.snippet-head button {
  min-height: 28px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.08);
  color: #d1d5db;
  padding: 0 10px;
  cursor: pointer;
}

.snippet pre {
  margin: 0;
  overflow-x: auto;
  padding: 18px;
}

.snippet code {
  border: 0;
  background: transparent;
  color: #e5e7eb;
  padding: 0;
  font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
  font-size: 0.88rem;
  line-height: 1.7;
  white-space: pre;
}

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

.safe-list article {
  display: grid;
  gap: 6px;
}

details summary {
  cursor: pointer;
  font-weight: 900;
}

footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 16px;
  border-top: 1px solid var(--line);
  padding: 26px 16px 34px;
  color: var(--muted);
  font-size: 0.92rem;
}

footer a:hover {
  color: var(--accent-strong);
}

.toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 30;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-strong);
  box-shadow: var(--shadow);
  padding: 12px 14px;
}

@media (max-width: 900px) {
  .layout,
  .quick-cards,
  .snippet-grid,
  .safe-list {
    grid-template-columns: 1fr;
  }

  .toc {
    position: static;
  }
}

@media (max-width: 680px) {
  .topbar {
    align-items: flex-start;
    border-radius: 20px;
    flex-direction: column;
  }

  nav {
    flex-wrap: wrap;
  }

  h1 {
    font-size: clamp(2.4rem, 14vw, 4rem);
  }
}
