/* ==========================================================================
   倾梦AI中转站 Docs — light product marketing + documentation
   ========================================================================== */

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --font: "Segoe UI", system-ui, -apple-system, "PingFang SC", "Microsoft YaHei",
    sans-serif;
  --font-mono: "Cascadia Code", "Fira Code", Consolas, "Courier New", monospace;

  --bg: #f5f7fb;
  --surface: #ffffff;
  --surface-2: #f8fafc;
  --surface-3: #fafbfe;
  --ink: #334155;
  --ink-soft: #64748b;
  --ink-faint: #94a3b8;
  --heading: #0f172a;
  --brand: #4f46e5;
  --brand-2: #2563eb;
  --brand-3: #0ea5e9;
  --brand-tint: #eef2ff;
  --brand-tint-2: #e0e7ff;
  --mint: #0d9488;
  --mint-tint: #ecfdf5;
  --amber: #d97706;
  --amber-tint: #fffbeb;
  --rose: #e11d48;
  --border: #e8ecf4;
  --border-soft: #eef2f8;
  --border-strong: #d5dce8;
  --code-bg: #f4f7fc;
  --code-ink: #1e293b;
  --code-inline: #5b21b6;
  --sidebar-bg: rgba(255, 255, 255, 0.9);
  --topbar-bg: rgba(255, 255, 255, 0.8);
  --overlay: rgba(15, 23, 42, 0.24);
  --hero-bg: linear-gradient(180deg, #ffffff 0%, #f8faff 100%);
  --list-bg: #fafbfe;
  --toast-bg: #0f172a;
  --toast-ink: #fff;
  --glow-1: rgba(99, 102, 241, 0.14);
  --glow-2: rgba(14, 165, 233, 0.11);
  --glow-3: rgba(45, 212, 191, 0.08);
  --sidebar-w: 260px;
  --radius: 18px;
  --radius-sm: 12px;
  --shadow-xs: 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow-sm: 0 6px 20px rgba(15, 23, 42, 0.05);
  --shadow-md: 0 16px 48px rgba(15, 23, 42, 0.07);
  --shadow-brand: 0 14px 36px rgba(79, 70, 229, 0.14);
  color-scheme: light;
}

html[data-theme="dark"] {
  --bg: #0b1220;
  --surface: #111827;
  --surface-2: #0f172a;
  --surface-3: #152033;
  --ink: #cbd5e1;
  --ink-soft: #94a3b8;
  --ink-faint: #64748b;
  --heading: #f1f5f9;
  --brand: #818cf8;
  --brand-2: #60a5fa;
  --brand-3: #38bdf8;
  --brand-tint: rgba(99, 102, 241, 0.16);
  --brand-tint-2: rgba(99, 102, 241, 0.28);
  --mint: #2dd4bf;
  --mint-tint: rgba(45, 212, 191, 0.12);
  --amber: #fbbf24;
  --amber-tint: rgba(251, 191, 36, 0.12);
  --rose: #fb7185;
  --border: #243044;
  --border-soft: #1e293b;
  --border-strong: #334155;
  --code-bg: #0c1424;
  --code-ink: #e2e8f0;
  --code-inline: #c4b5fd;
  --sidebar-bg: rgba(15, 23, 42, 0.92);
  --topbar-bg: rgba(11, 18, 32, 0.86);
  --overlay: rgba(2, 6, 23, 0.55);
  --hero-bg: linear-gradient(180deg, #111827 0%, #0f172a 100%);
  --list-bg: #152033;
  --toast-bg: #e2e8f0;
  --toast-ink: #0f172a;
  --glow-1: rgba(99, 102, 241, 0.18);
  --glow-2: rgba(14, 165, 233, 0.12);
  --glow-3: rgba(45, 212, 191, 0.08);
  --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.25);
  --shadow-sm: 0 8px 24px rgba(0, 0, 0, 0.28);
  --shadow-md: 0 18px 48px rgba(0, 0, 0, 0.35);
  --shadow-brand: 0 14px 36px rgba(99, 102, 241, 0.2);
  color-scheme: dark;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.75;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(1000px 480px at 12% -12%, var(--glow-1), transparent 58%),
    radial-gradient(800px 420px at 100% 0%, var(--glow-2), transparent 52%),
    radial-gradient(700px 380px at 80% 100%, var(--glow-3), transparent 55%),
    var(--bg);
}

/* Global text watermark — over content, non-interactive */
.gx-watermark {
  position: fixed;
  inset: -25%;
  /* Above page chrome, below float contact (50) / toast (70) */
  z-index: 45;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-content: center;
  justify-items: center;
  gap: 180px 100px;
  padding: 64px 32px;
  pointer-events: none;
  user-select: none;
  overflow: hidden;
  transform: rotate(-20deg);
  opacity: 0.12;
}

html[data-theme="dark"] .gx-watermark {
  opacity: 0.14;
}

.gx-watermark span {
  color: var(--heading);
  font-size: clamp(11px, 1.1vw, 14px);
  font-weight: 600;
  letter-spacing: 0.1em;
  white-space: nowrap;
  line-height: 1;
}

@media (max-width: 860px) {
  .gx-watermark {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 160px 80px;
    opacity: 0.08;
  }
  
  html[data-theme="dark"] .gx-watermark {
    opacity: 0.1;
  }
  
  .gx-watermark span {
    font-size: clamp(10px, 2vw, 12px);
    letter-spacing: 0.08em;
  }
}

a {
  color: var(--brand);
  text-decoration: none;
  transition: color 0.15s ease;
}

a:hover {
  color: var(--brand-2);
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ===================== LAYOUT ===================== */
.layout {
  display: flex;
  min-height: 100vh;
}

/* ===================== SIDEBAR ===================== */
.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 40;
  width: var(--sidebar-w);
  height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--sidebar-bg);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-right: 1px solid var(--border);
  color: var(--ink-soft);
  overflow: hidden;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 22px 18px 18px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.sidebar-brand .logo {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  color: #fff;
  font-weight: 800;
  font-size: 14px;
  letter-spacing: -0.03em;
  flex-shrink: 0;
  background: linear-gradient(145deg, #6366f1, #4f46e5 50%, #0ea5e9);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.35) inset,
    0 10px 22px rgba(79, 70, 229, 0.28);
}

.sidebar-brand .brand-title {
  color: var(--heading);
  font-size: 15px;
  font-weight: 780;
  letter-spacing: -0.02em;
  line-height: 1.25;
}

.sidebar-brand .brand-sub {
  font-size: 12px;
  color: var(--ink-faint);
  margin-top: 2px;
}

.sidebar-search {
  padding: 14px 14px 8px;
  flex-shrink: 0;
}

.sidebar-search input {
  width: 100%;
  padding: 10px 12px 10px 38px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' fill='none' stroke='%2394a3b8' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='6' cy='6' r='4.5'/%3E%3Cpath d='M10 10l2.5 2.5'/%3E%3C/svg%3E")
      12px center / 14px no-repeat,
    var(--surface-2);
  color: var(--heading);
  font-size: 13px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}

.sidebar-search input::placeholder {
  color: var(--ink-faint);
}

.sidebar-search input:focus {
  border-color: #a5b4fc;
  background-color: var(--surface);
  box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.12);
}

.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 10px 12px 20px;
  scrollbar-width: thin;
  scrollbar-color: #cbd5e1 transparent;
}

.nav-group {
  margin-bottom: 18px;
}

.nav-group-title {
  font-size: 11px;
  font-weight: 750;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-faint);
  padding: 8px 12px;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  color: var(--ink-soft);
  font-size: 13.5px;
  font-weight: 550;
  text-decoration: none;
  border: none;
  background: transparent;
  width: 100%;
  text-align: left;
  cursor: pointer;
  font-family: inherit;
  margin-bottom: 3px;
  transition: background 0.15s, color 0.15s;
}

.nav-link:hover {
  background: var(--surface-2);
  color: var(--heading);
  text-decoration: none;
}

.nav-link.active {
  background: linear-gradient(90deg, var(--brand-tint), var(--surface-2));
  color: var(--brand);
  font-weight: 720;
  box-shadow: inset 3px 0 0 var(--brand);
}

.nav-link .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.28;
  flex-shrink: 0;
}

.nav-link.active .dot {
  opacity: 1;
  background: var(--brand);
  box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.14);
}

.sidebar-footer {
  padding: 14px 18px;
  border-top: 1px solid var(--border);
  font-size: 12px;
  color: var(--ink-faint);
  flex-shrink: 0;
}

/* ===================== MAIN ===================== */
.main {
  margin-left: var(--sidebar-w);
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  min-height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 28px;
  background: var(--topbar-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
}

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--ink-faint);
  min-width: 0;
}

.breadcrumb .sep {
  opacity: 0.5;
}

.breadcrumb .current {
  color: var(--brand);
  font-weight: 720;
  padding: 4px 12px;
  border-radius: 999px;
  background: var(--brand-tint);
  border: 1px solid var(--brand-tint-2);
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

/* Language switcher */
.lang-switch {
  display: inline-flex;
  align-items: center;
  padding: 3px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  box-shadow: var(--shadow-xs);
  gap: 2px;
}

.lang-btn {
  appearance: none;
  border: none;
  background: transparent;
  color: var(--ink-soft);
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 720;
  line-height: 1;
  padding: 8px 12px;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, box-shadow 0.15s;
}

.lang-btn:hover {
  color: var(--heading);
  background: var(--surface);
}

.lang-btn.is-active {
  color: #fff;
  background: linear-gradient(135deg, #6366f1, #4f46e5 55%, #2563eb);
  box-shadow: 0 6px 14px rgba(79, 70, 229, 0.24);
}

.lang-btn:focus-visible {
  outline: 2px solid #a5b4fc;
  outline-offset: 2px;
}

/* Theme toggle */
.theme-toggle {
  appearance: none;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 36px;
  padding: 0 12px 0 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--ink-soft);
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 720;
  cursor: pointer;
  box-shadow: var(--shadow-xs);
  transition: background 0.15s, color 0.15s, border-color 0.15s, box-shadow 0.15s,
    transform 0.15s;
}

.theme-toggle:hover {
  color: var(--heading);
  border-color: var(--border-strong);
  box-shadow: var(--shadow-sm);
  transform: translateY(-1px);
}

.theme-toggle:focus-visible {
  outline: 2px solid #a5b4fc;
  outline-offset: 2px;
}

.theme-toggle .theme-icon {
  display: none;
  width: 16px;
  height: 16px;
  color: var(--brand);
}

.theme-toggle .theme-icon-moon {
  display: grid;
  place-items: center;
}

.theme-toggle.is-dark .theme-icon-moon {
  display: none;
}

.theme-toggle.is-dark .theme-icon-sun {
  display: grid;
  place-items: center;
}

.theme-toggle-label {
  line-height: 1;
}

.menu-btn {
  display: none;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  cursor: pointer;
  color: var(--heading);
  box-shadow: var(--shadow-xs);
}

.content-wrap {
  display: flex;
  gap: 28px;
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  padding: 28px 32px 96px;
}

.content-wrap.is-landing {
  max-width: 1180px;
  display: block;
  padding-top: 20px;
}

.gx-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  width: 0;
  z-index: 80;
  background: linear-gradient(90deg, #6366f1, #2563eb, #0ea5e9);
  pointer-events: none;
}

/* ===================== LANDING (product homepage) ===================== */
.hero {
  position: relative;
  border-radius: 28px;
  padding: 48px 44px 42px;
  background:
    radial-gradient(700px 280px at 90% 10%, var(--glow-2), transparent 55%),
    radial-gradient(600px 260px at 10% 0%, var(--glow-1), transparent 55%),
    var(--hero-bg);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-md);
  overflow: hidden;
  margin-bottom: 28px;
}

.hero::after {
  content: "";
  position: absolute;
  right: -40px;
  top: -40px;
  width: 260px;
  height: 260px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(99, 102, 241, 0.16), transparent 70%);
  pointer-events: none;
}

.hero-kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--brand-tint);
  border: 1px solid var(--brand-tint-2);
  color: var(--brand);
  font-size: 12px;
  font-weight: 750;
  letter-spacing: 0.04em;
  margin-bottom: 18px;
}

.hero-kicker::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.16);
}

.hero h1 {
  font-size: clamp(2rem, 4vw, 2.85rem);
  line-height: 1.12;
  letter-spacing: -0.04em;
  color: var(--heading);
  font-weight: 850;
  max-width: 14em;
  margin-bottom: 14px;
}

.hero-lead {
  font-size: 1.08rem;
  color: var(--ink-soft);
  max-width: 40em;
  line-height: 1.75;
  margin-bottom: 26px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 28px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 18px;
  border-radius: 14px;
  font-size: 14px;
  font-weight: 720;
  font-family: inherit;
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s, background 0.15s, border-color 0.15s;
}

.btn:hover {
  text-decoration: none;
  transform: translateY(-1px);
}

.btn-primary {
  color: #fff;
  background: linear-gradient(135deg, #6366f1, #4f46e5 55%, #2563eb);
  box-shadow: 0 10px 24px rgba(79, 70, 229, 0.28);
}

.btn-primary:hover {
  color: #fff;
  box-shadow: 0 14px 30px rgba(79, 70, 229, 0.34);
}

.btn-secondary {
  color: var(--heading);
  background: var(--surface);
  border-color: var(--border-strong);
  box-shadow: var(--shadow-xs);
}

.btn-secondary:hover {
  color: var(--heading);
  border-color: #c7d2fe;
  box-shadow: var(--shadow-brand);
}

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 18px;
  color: var(--ink-soft);
  font-size: 13px;
}

.hero-meta span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.hero-meta span::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: linear-gradient(135deg, #6366f1, #0ea5e9);
}

.section-block {
  margin-bottom: 28px;
}

.section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.section-head h2 {
  font-size: 1.35rem;
  color: var(--heading);
  letter-spacing: -0.02em;
  font-weight: 800;
  margin: 0;
  border: none;
  padding: 0;
  display: block;
}

.section-head h2::before {
  display: none;
}

.section-head p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 14px;
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.product-card {
  display: flex;
  flex-direction: column;
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 22px;
  padding: 24px 22px 20px;
  text-decoration: none;
  color: inherit;
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: transform 0.18s, box-shadow 0.18s, border-color 0.18s;
  min-height: 240px;
}

.product-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, #6366f1, #0ea5e9);
  opacity: 0.85;
}

.product-card.tone-claude::before {
  background: linear-gradient(90deg, #f59e0b, #f97316);
}

.product-card.tone-grok::before {
  background: linear-gradient(90deg, #0ea5e9, #14b8a6);
}

.product-card:hover {
  transform: translateY(-4px);
  border-color: #c7d2fe;
  box-shadow: var(--shadow-brand);
  text-decoration: none;
  color: inherit;
}

.product-icon {
  width: 48px;
  height: 48px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  font-weight: 850;
  font-size: 14px;
  color: #fff;
  margin-bottom: 16px;
  background: linear-gradient(145deg, #6366f1, #2563eb);
  box-shadow: 0 10px 22px rgba(79, 70, 229, 0.22);
}

.product-card.tone-claude .product-icon {
  background: linear-gradient(145deg, #f59e0b, #ea580c);
  box-shadow: 0 10px 22px rgba(234, 88, 12, 0.2);
}

.product-card.tone-grok .product-icon {
  background: linear-gradient(145deg, #0ea5e9, #0d9488);
  box-shadow: 0 10px 22px rgba(14, 165, 233, 0.22);
}

.product-card .badge {
  margin-bottom: 10px;
}

.product-card h3 {
  margin: 0 0 8px;
  font-size: 1.2rem;
  color: var(--heading);
  font-weight: 800;
  letter-spacing: -0.02em;
}

.product-card p {
  margin: 0 0 18px;
  color: var(--ink-soft);
  font-size: 14px;
  line-height: 1.65;
  flex: 1;
}

.product-cta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13.5px;
  font-weight: 750;
  color: var(--brand);
}

.product-card.tone-claude .product-cta {
  color: #c2410c;
}

.product-card.tone-grok .product-cta {
  color: #0f766e;
}

.product-cta::after {
  content: "→";
  transition: transform 0.15s;
}

.product-card:hover .product-cta::after {
  transform: translateX(3px);
}

.flow-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-bottom: 28px;
}

.flow-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 18px 18px 16px;
  box-shadow: var(--shadow-xs);
}

.flow-num {
  width: 28px;
  height: 28px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 850;
  color: #fff;
  background: linear-gradient(145deg, #6366f1, #2563eb);
  margin-bottom: 12px;
  box-shadow: 0 6px 14px rgba(79, 70, 229, 0.2);
}

.flow-item h3 {
  margin: 0 0 6px;
  font-size: 15px;
  color: var(--heading);
  font-weight: 760;
}

.flow-item p {
  margin: 0;
  font-size: 13.5px;
  color: var(--ink-soft);
  line-height: 1.6;
}

.trust-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  padding: 16px 18px;
  border-radius: 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-xs);
  margin-bottom: 8px;
}

.trust-bar strong {
  color: var(--heading);
  font-size: 13.5px;
  margin-right: 4px;
}

.trust-chip {
  display: inline-flex;
  align-items: center;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--ink-soft);
  font-size: 12.5px;
  font-weight: 650;
}

/* ===================== DOC ARTICLE ===================== */
.article {
  flex: 1;
  min-width: 0;
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 36px 40px 48px;
  box-shadow: var(--shadow-md);
  overflow: hidden;
}

.article::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, #6366f1, #2563eb, #0ea5e9);
}

.page-hero {
  margin-bottom: 22px;
  padding-bottom: 8px;
}

.page-kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 750;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--brand);
  background: var(--brand-tint);
  border: 1px solid var(--brand-tint-2);
  border-radius: 999px;
  padding: 5px 12px;
  margin-bottom: 14px;
}

.article h1 {
  font-size: clamp(1.85rem, 3vw, 2.4rem);
  line-height: 1.15;
  color: var(--heading);
  letter-spacing: -0.035em;
  font-weight: 850;
  margin-bottom: 12px;
}

.article .lead {
  font-size: 1.05rem;
  color: var(--ink-soft);
  margin-bottom: 18px;
  max-width: 48em;
  line-height: 1.8;
}

.flow-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 8px;
}

.flow-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 12px;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--ink-soft);
  font-size: 12.5px;
  font-weight: 650;
}

.flow-pill b {
  width: 18px;
  height: 18px;
  border-radius: 6px;
  display: grid;
  place-items: center;
  font-size: 11px;
  color: #fff;
  background: linear-gradient(145deg, #6366f1, #2563eb);
}

.article h2 {
  font-size: 1.28rem;
  color: var(--heading);
  margin: 40px 0 14px;
  padding-top: 22px;
  border-top: 1px solid var(--border);
  scroll-margin-top: 88px;
  font-weight: 800;
  letter-spacing: -0.02em;
  display: flex;
  align-items: center;
  gap: 12px;
}

.article h2::before {
  content: "";
  width: 10px;
  height: 10px;
  border-radius: 4px;
  background: linear-gradient(135deg, #6366f1, #0ea5e9);
  box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.12);
  flex-shrink: 0;
}

.article h2:first-of-type {
  border-top: none;
  margin-top: 18px;
  padding-top: 0;
}

.article h3 {
  font-size: 1.05rem;
  color: var(--heading);
  margin: 26px 0 10px;
  scroll-margin-top: 88px;
  font-weight: 740;
}

.article p {
  margin-bottom: 14px;
}

.article ul,
.article ol {
  margin: 0 0 18px;
  padding-left: 0;
  list-style: none;
  counter-reset: step;
}

/* Continue numbering after an inserted tip between ordered steps */
.article ol.continue-from-10 {
  counter-reset: step 10;
}

/*
  有序步骤：编号与首行文字垂直对齐。
  --step 写在 li 上，1em 取正文 15px，避免 ::before 的 12px 把高度算矮。
*/
.article ol > li {
  --lh: 1.75;
  --step: calc(1em * var(--lh)); /* ≈ 26.25px，与首行行高一致 */
  position: relative;
  margin-bottom: 8px;
  padding: 12px 14px 12px calc(12px + var(--step) + 10px);
  border-radius: 14px;
  background: var(--list-bg);
  border: 1px solid var(--border-soft);
  font-size: 15px;
  line-height: var(--lh);
  counter-increment: step;
}

.article ol > li::before {
  content: counter(step);
  position: absolute;
  left: 12px;
  top: 12px;
  width: var(--step);
  height: var(--step);
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
  color: #fff;
  background: linear-gradient(145deg, #6366f1, #4f46e5);
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.22);
  box-sizing: border-box;
}

.article ol > li > ul,
.article ol > li > ol {
  margin: 8px 0 0;
  padding-left: 0;
  line-height: 1.7;
}

/* 无序列表（顶层） */
.article ul > li {
  position: relative;
  margin-bottom: 8px;
  padding: 12px 14px 12px 40px;
  border-radius: 14px;
  background: var(--list-bg);
  border: 1px solid var(--border-soft);
  font-size: 15px;
  line-height: 1.7;
}

.article ul > li::before {
  content: "";
  position: absolute;
  left: 18px;
  top: calc(12px + 0.85em);
  width: 7px;
  height: 7px;
  margin-top: -3.5px;
  border-radius: 50%;
  background: linear-gradient(135deg, #6366f1, #0ea5e9);
}

.article li ul,
.article li ol {
  margin: 8px 0 0;
  line-height: 1.7;
}

/* 嵌套列表：圆点与该行文字垂直居中 */
.article li li {
  background: transparent;
  border: none;
  padding: 4px 0 4px 18px;
  margin-bottom: 2px;
  position: relative;
  line-height: 1.7;
  font-size: 14.5px;
  counter-increment: none;
}

.article li li::before {
  content: "" !important;
  position: absolute !important;
  left: 0 !important;
  top: 50% !important;
  transform: translateY(-50%) !important;
  width: 6px !important;
  height: 6px !important;
  margin: 0 !important;
  border-radius: 50% !important;
  background: #cbd5e1 !important;
  box-shadow: none !important;
  font-size: 0 !important;
  display: block !important;
  line-height: 0 !important;
}

.article code {
  font-family: var(--font-mono);
  font-size: 0.88em;
  background: var(--brand-tint);
  color: var(--code-inline);
  padding: 0.14em 0.42em;
  border-radius: 6px;
  border: 1px solid var(--brand-tint-2);
}

.article pre {
  position: relative;
  background: var(--code-bg);
  color: var(--code-ink);
  border-radius: 16px;
  padding: 40px 18px 16px;
  overflow-x: auto;
  margin: 0 0 18px;
  font-size: 13.3px;
  line-height: 1.65;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-xs);
}

.article pre::before {
  content: "";
  position: absolute;
  top: 14px;
  left: 16px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #ff5f57;
  box-shadow: 16px 0 0 #febc2e, 32px 0 0 #28c840;
}

.article pre code {
  background: transparent;
  color: inherit;
  padding: 0;
  border: none;
  font-size: inherit;
}

.article table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  margin: 0 0 18px;
  font-size: 14px;
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  background: var(--surface);
  box-shadow: var(--shadow-xs);
}

.article th,
.article td {
  border-bottom: 1px solid var(--border);
  border-right: 1px solid var(--border-soft);
  padding: 12px 14px;
  text-align: left;
}

.article th:last-child,
.article td:last-child {
  border-right: none;
}

.article tr:last-child td {
  border-bottom: none;
}

.article th {
  background: linear-gradient(180deg, var(--surface-3), var(--code-bg));
  color: var(--heading);
  font-weight: 740;
  font-size: 12.5px;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.article tr:hover td {
  background: var(--list-bg);
}

.article img {
  max-width: 100%;
  border-radius: 12px;
}

.article hr {
  border: none;
  height: 1px;
  margin: 28px 0;
  background: var(--border);
}

/* Callouts */
.callout {
  border-radius: 16px;
  padding: 16px 18px;
  margin: 0 0 18px;
  border: 1px solid transparent;
  border-left: 4px solid;
  font-size: 14px;
  line-height: 1.75;
  box-shadow: var(--shadow-xs);
}

.callout-title {
  display: block;
  font-weight: 780;
  margin-bottom: 5px;
}

.callout.tip {
  background: linear-gradient(135deg, rgba(14, 165, 233, 0.1), rgba(59, 130, 246, 0.08));
  border-color: rgba(56, 189, 248, 0.35);
  border-left-color: #0ea5e9;
}

.callout.tip .callout-title {
  color: var(--brand-3);
}

.callout.warn {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.12), rgba(249, 115, 22, 0.08));
  border-color: rgba(251, 191, 36, 0.35);
  border-left-color: #f59e0b;
}

.callout.warn .callout-title {
  color: var(--amber);
}

.callout.success {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.12), rgba(34, 197, 94, 0.08));
  border-color: rgba(52, 211, 153, 0.35);
  border-left-color: #10b981;
}

.callout.success .callout-title {
  color: #34d399;
}

html:not([data-theme="dark"]) .callout.tip .callout-title {
  color: #0369a1;
}

html:not([data-theme="dark"]) .callout.warn .callout-title {
  color: #b45309;
}

html:not([data-theme="dark"]) .callout.success .callout-title {
  color: #047857;
}

/* Expandable tip body (e.g. no-jump fallback) */
.doc-details {
  margin: 0;
}

.doc-details > summary {
  cursor: pointer;
  list-style: none;
  color: var(--brand-3);
  font-weight: 650;
  text-decoration: underline;
  text-underline-offset: 3px;
  user-select: none;
}

.doc-details > summary::-webkit-details-marker {
  display: none;
}

.doc-details > summary:hover {
  opacity: 0.88;
}

.doc-details > summary:focus-visible {
  outline: 2px solid rgba(14, 165, 233, 0.45);
  outline-offset: 2px;
  border-radius: 4px;
}

.doc-details-body {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid rgba(56, 189, 248, 0.25);
}

.doc-details-body > ol {
  margin-bottom: 0;
}

.doc-details-body pre {
  margin: 10px 0 0;
}

html:not([data-theme="dark"]) .doc-details > summary {
  color: #0369a1;
}

/* Legacy card-grid still works */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 16px;
  margin: 22px 0 8px;
}

.card {
  display: block;
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 22px 20px 20px;
  background: linear-gradient(180deg, var(--surface), var(--surface-3));
  color: inherit;
  text-decoration: none;
  box-shadow: var(--shadow-xs);
  transition: transform 0.18s, border-color 0.18s, box-shadow 0.18s;
}

.card:hover {
  transform: translateY(-3px);
  border-color: #c7d2fe;
  box-shadow: var(--shadow-brand);
  text-decoration: none;
}

.card h3 {
  margin: 0 0 8px;
  font-size: 1.08rem;
  color: var(--heading);
}

.card p {
  margin: 0;
  font-size: 13.5px;
  color: var(--ink-soft);
  line-height: 1.6;
}

.badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 750;
  letter-spacing: 0.04em;
  padding: 3px 10px;
  border-radius: 999px;
  margin-bottom: 12px;
  color: var(--brand);
  background: var(--brand-tint);
  border: 1px solid var(--brand-tint-2);
}

.page-nav {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 44px;
  padding-top: 22px;
  border-top: 1px solid var(--border);
}

.page-nav a {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 14px 16px;
  min-width: 150px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--list-bg);
  color: inherit;
  text-decoration: none;
  transition: all 0.15s ease;
  box-shadow: var(--shadow-xs);
}

.page-nav a:hover {
  border-color: var(--brand-tint-2);
  background: var(--surface);
  box-shadow: var(--shadow-brand);
  transform: translateY(-1px);
  text-decoration: none;
}

.page-nav .label {
  font-size: 12px;
  color: var(--ink-faint);
  font-weight: 650;
}

.page-nav .title {
  font-size: 14px;
  font-weight: 760;
  color: var(--heading);
}

.page-nav .next {
  margin-left: auto;
  text-align: right;
}

.toc {
  width: 172px;
  flex-shrink: 0;
  position: sticky;
  top: 88px;
  align-self: flex-start;
  max-height: calc(100vh - 120px);
  overflow-y: auto;
  padding: 14px 8px;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: var(--topbar-bg);
  backdrop-filter: blur(10px);
  box-shadow: var(--shadow-xs);
}

.toc-title {
  font-size: 11px;
  font-weight: 750;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin-bottom: 10px;
  padding-left: 10px;
}

.toc a {
  display: block;
  font-size: 12.5px;
  color: var(--ink-soft);
  padding: 5px 8px 5px 10px;
  border-left: 2px solid var(--border);
  text-decoration: none;
  line-height: 1.4;
  transition: all 0.15s;
}

.toc a:hover,
.toc a.active {
  color: var(--brand);
  border-left-color: var(--brand);
  background: var(--brand-tint);
  text-decoration: none;
  border-radius: 0 8px 8px 0;
}

.toc a.level-3 {
  padding-left: 18px;
  font-size: 12px;
}

.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: var(--overlay);
  backdrop-filter: blur(2px);
  z-index: 35;
}

/* Float contact */
.float-contact {
  position: fixed;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 50;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: min(210px, calc(100vw - 28px));
}

.float-contact-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 12px;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: var(--topbar-bg);
  backdrop-filter: blur(12px);
  color: var(--ink);
  font-size: 13px;
  line-height: 1.35;
  cursor: pointer;
  user-select: none;
  font-family: inherit;
  text-align: left;
  width: 100%;
  box-shadow: var(--shadow-sm);
  transition: transform 0.15s, border-color 0.15s, box-shadow 0.15s;
}

.float-contact-item:hover {
  transform: translateY(-2px);
  border-color: #c7d2fe;
  box-shadow: var(--shadow-brand);
  text-decoration: none;
}

.float-contact-icon {
  width: 34px;
  height: 34px;
  border-radius: 11px;
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  flex-shrink: 0;
  background: linear-gradient(145deg, #38bdf8, #6366f1);
  box-shadow: 0 6px 14px rgba(56, 189, 248, 0.28);
}

.float-contact-label {
  display: block;
  font-size: 11px;
  color: var(--ink-faint);
  font-weight: 650;
}

.float-contact-value {
  display: block;
  font-weight: 760;
  color: var(--heading);
  font-variant-numeric: tabular-nums;
}

.float-contact-hint {
  display: block;
  font-size: 10px;
  color: var(--ink-faint);
  margin-top: 2px;
}

.float-toast {
  position: fixed;
  left: 50%;
  bottom: 36px;
  transform: translateX(-50%) translateY(12px);
  z-index: 70;
  padding: 12px 18px;
  border-radius: 999px;
  background: var(--toast-bg);
  color: var(--toast-ink);
  font-size: 13.5px;
  font-weight: 650;
  box-shadow: var(--shadow-md);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s, transform 0.2s;
  max-width: min(90vw, 380px);
  text-align: center;
}

.float-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* Responsive */
@media (max-width: 1100px) {
  .toc {
    display: none;
  }

  .product-grid,
  .flow-strip {
    grid-template-columns: 1fr;
  }

  .content-wrap {
    padding: 22px 16px 72px;
  }

  .article {
    padding: 28px 20px 36px;
  }

  .hero {
    padding: 32px 24px 28px;
  }
  
  .trust-bar {
    gap: 8px;
  }
  
  .trust-chip {
    font-size: 12px;
  }
}

@media (max-width: 860px) {
  .sidebar {
    transform: translateX(-100%);
    transition: transform 0.22s ease;
  }

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

  .sidebar-overlay.open {
    display: block;
  }

  .main {
    margin-left: 0;
  }

  .menu-btn {
    display: inline-flex;
  }

  .topbar {
    padding: 0 12px;
  }

  .content-wrap {
    padding: 14px 10px 56px;
  }

  .article {
    border-radius: 18px;
    padding: 22px 16px 30px;
  }

  .hero {
    border-radius: 20px;
    padding: 26px 18px 22px;
  }

  .hero h1 {
    max-width: none;
    font-size: clamp(1.75rem, 6vw, 2.2rem);
  }
  
  .hero-lead {
    font-size: 1rem;
    line-height: 1.6;
  }
  
  .hero-actions {
    width: 100%;
  }
  
  .hero-actions .btn {
    flex: 1;
    min-width: 140px;
    padding: 12px 18px;
    font-size: 14px;
  }
  
  .trust-bar {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 16px;
  }
  
  .trust-bar strong {
    width: 100%;
    margin-bottom: 2px;
  }
  
  .trust-chip {
    font-size: 12px;
    padding: 5px 10px;
  }

  .float-contact {
    right: 10px;
    gap: 8px;
  }

  .section-head {
    flex-direction: column;
    align-items: start;
  }
  
  .sidebar-brand .brand-title {
    font-size: 14px;
  }
  
  .sidebar-brand .logo {
    width: 38px;
    height: 38px;
    font-size: 13px;
  }
}
