:root {
  --brand-50: #eff6ff;
  --brand-100: #dbeafe;
  --brand-200: #bfdbfe;
  --brand-500: #3b82f6;
  --brand-600: #2563eb;
  --brand-700: #1d4ed8;
  --brand-900: #1e3a8a;

  --accent-violet: #8b5cf6;
  --accent-rose: #f43f5e;

  --bg: #ffffff;
  --bg-soft: #f8fafc;
  --bg-elevated: #ffffff;
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #64748b;
  --border: #e2e8f0;
  --shadow-sm: 0 1px 2px 0 rgb(15 23 42 / 0.04);
  --shadow: 0 4px 6px -1px rgb(15 23 42 / 0.06), 0 2px 4px -2px rgb(15 23 42 / 0.04);
  --shadow-lg: 0 10px 15px -3px rgb(15 23 42 / 0.08), 0 4px 6px -4px rgb(15 23 42 / 0.04);
  --shadow-xl: 0 20px 25px -5px rgb(15 23 42 / 0.1), 0 8px 10px -6px rgb(15 23 42 / 0.04);

  --radius-sm: 0.5rem;
  --radius: 0.75rem;
  --radius-lg: 1rem;
  --radius-xl: 1.5rem;
  --radius-full: 9999px;

  --container: 1200px;
  --nav-height: 72px;
  --sidebar-width: 280px;
  --toc-width: 240px;

  --transition-fast: 150ms ease;
  --transition: 250ms ease;
}

[data-theme="dark"] {
  --bg: #0b1120;
  --bg-soft: #0f172a;
  --bg-elevated: #1e293b;
  --text-primary: #f1f5f9;
  --text-secondary: #cbd5e1;
  --text-muted: #94a3b8;
  --border: #334155;
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.25);
  --shadow: 0 4px 6px -1px rgb(0 0 0 / 0.3), 0 2px 4px -2px rgb(0 0 0 / 0.2);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.35), 0 4px 6px -4px rgb(0 0 0 / 0.25);
  --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.4), 0 8px 10px -6px rgb(0 0 0 / 0.25);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text-primary);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; }
ul, ol { margin: 0; padding: 0; list-style: none; }
h1, h2, h3, h4, h5, h6, p { margin: 0; }
img, svg { display: block; max-width: 100%; }
:focus-visible { outline: 2px solid var(--brand-600); outline-offset: 2px; }

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0);
  white-space: nowrap; border: 0;
}

.container {
  width: min(100% - 2rem, var(--container));
  margin-inline: auto;
}

/* Header */
.header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 100;
  height: var(--nav-height);
  background: rgba(255,255,255,0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
[data-theme="dark"] .header { background: rgba(11,17,32,0.85); }
.header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
}
.logo {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 800;
  font-size: 1.25rem;
  color: var(--text-primary);
}
.logo svg { width: 32px; height: 32px; color: var(--brand-600); }

.header-actions { display: flex; align-items: center; gap: 0.5rem; }
.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem; height: 2.5rem;
  border-radius: var(--radius-full);
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text-secondary);
  transition: var(--transition-fast);
}
.icon-btn:hover { color: var(--brand-600); border-color: var(--brand-200); }
.icon-btn svg { width: 1.25rem; height: 1.25rem; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius-full);
  font-weight: 600;
  border: 1.5px solid transparent;
  transition: var(--transition-fast);
}
.btn-primary {
  background: linear-gradient(135deg, var(--brand-600), var(--brand-700));
  color: #fff;
}
.btn-primary:hover { background: linear-gradient(135deg, var(--brand-700), var(--brand-900)); }
.btn-secondary {
  background: var(--bg-elevated);
  color: var(--text-primary);
  border-color: var(--border);
}
.btn-secondary:hover { background: var(--bg-soft); border-color: var(--brand-200); }

.nav ul { display: flex; align-items: center; gap: 0.25rem; list-style: none; }
.nav a {
  display: inline-flex;
  padding: 0.5rem 0.875rem;
  border-radius: var(--radius-full);
  color: var(--text-secondary);
  font-size: 0.9375rem;
  font-weight: 500;
  transition: var(--transition-fast);
}
.nav a:hover, .nav a.active { color: var(--brand-600); background: var(--brand-50); }
[data-theme="dark"] .nav a:hover, [data-theme="dark"] .nav a.active { background: rgba(59,130,246,0.12); }

.menu-toggle { display: none; }

/* Home hero */
.docs-hero {
  position: relative;
  padding-top: calc(var(--nav-height) + 5rem);
  padding-bottom: 5rem;
  text-align: center;
  background:
    radial-gradient(circle at 20% 30%, rgba(59,130,246,0.12) 0%, transparent 45%),
    radial-gradient(circle at 80% 20%, rgba(139,92,246,0.10) 0%, transparent 40%),
    radial-gradient(circle at 50% 90%, rgba(59,130,246,0.08) 0%, transparent 45%),
    var(--bg);
  border-bottom: 1px solid var(--border);
  overflow: hidden;
}
.hero-glow {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 50% 50%, rgba(37,99,235,0.06) 0%, transparent 60%);
}
.hero-inner {
  position: relative;
  z-index: 1;
  max-width: 760px;
  margin-inline: auto;
}
.docs-hero .badge { margin-bottom: 1.25rem; }
.badge-large {
  padding: 0.5rem 1rem;
  font-size: 1rem;
  background: linear-gradient(135deg, var(--brand-50), rgba(139,92,246,0.12));
  border: 1px solid rgba(37,99,235,0.15);
}
.docs-hero h1 {
  font-size: clamp(2.5rem, 6vw, 4rem);
  font-weight: 900;
  letter-spacing: -0.03em;
  line-height: 1.1;
}
.docs-hero .lead {
  margin-top: 1.25rem;
  font-size: 1.1875rem;
  color: var(--text-secondary);
}
.hero-search {
  position: relative;
  max-width: 680px;
  margin: 2rem auto 0;
}
.hero-search input {
  width: 100%;
  padding: 1.25rem 3rem 1.25rem 3.25rem;
  border-radius: var(--radius-full);
  border: 2px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text-primary);
  font-size: 1.0625rem;
  box-shadow: var(--shadow), 0 8px 24px rgba(37,99,235,0.06);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}
.hero-search input:focus {
  border-color: var(--brand-500);
  box-shadow: 0 0 0 5px rgba(37,99,235,0.12), 0 12px 32px rgba(37,99,235,0.1);
  outline: none;
}
.hero-search svg {
  position: absolute;
  left: 1.25rem;
  top: 50%;
  transform: translateY(-50%);
  width: 22px; height: 22px;
  color: var(--text-muted);
  pointer-events: none;
}
.search-clear {
  position: absolute;
  right: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  width: 2rem; height: 2rem;
  border-radius: 50%;
  border: 0;
  background: transparent;
  color: var(--text-muted);
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
  display: none;
}
.search-clear:hover { background: var(--bg-soft); color: var(--text-primary); }
.hero-search.has-value .search-clear { display: inline-flex; align-items: center; justify-content: center; }
.hero-search .search-results {
  position: absolute;
  top: calc(100% + 0.625rem);
  left: 0; right: 0;
  margin: 0;
  padding: 0.625rem;
  border-radius: var(--radius-lg);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-xl);
  max-height: 380px;
  overflow-y: auto;
  z-index: 20;
  text-align: left;
}
.hero-search .search-results li { margin-bottom: 0.25rem; }
.hero-search .search-results a {
  display: block;
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
  color: var(--text-secondary);
  transition: var(--transition-fast);
}
.hero-search .search-results a:hover, .hero-search .search-results a:focus {
  background: var(--brand-50);
  color: var(--brand-700);
  outline: none;
}
.hero-search .search-results a small { display: block; color: var(--text-muted); font-size: 0.75rem; margin-bottom: 0.125rem; }
.hero-search .search-results mark {
  background: rgba(251,191,36,0.35);
  color: inherit;
  border-radius: 2px;
  padding: 0 1px;
}
.hero-search .search-empty {
  padding: 1.5rem 1rem;
  text-align: center;
  color: var(--text-muted);
}
.hero-search .search-empty strong { display: block; color: var(--text-primary); margin-bottom: 0.25rem; }

.search-quick {
  margin-top: 1.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.625rem;
  flex-wrap: wrap;
  color: var(--text-muted);
  font-size: 0.9375rem;
}
.quick-tags {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.quick-tags button {
  padding: 0.375rem 0.875rem;
  border-radius: var(--radius-full);
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text-secondary);
  font-size: 0.875rem;
  transition: var(--transition-fast);
}
.quick-tags button:hover {
  border-color: var(--brand-200);
  background: var(--brand-50);
  color: var(--brand-700);
}

.hero-stats {
  margin-top: 2.5rem;
  display: inline-flex;
  align-items: center;
  gap: 2rem;
  padding: 0.875rem 1.75rem;
  border-radius: var(--radius-full);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}
.hero-stats .stat {
  display: flex;
  align-items: baseline;
  gap: 0.375rem;
  color: var(--text-secondary);
  font-size: 0.9375rem;
}
.hero-stats .stat strong {
  color: var(--brand-600);
  font-size: 1.25rem;
  font-weight: 800;
}

/* Section headers */
.section-header {
  text-align: center;
  margin-bottom: 2.5rem;
}
.section-header h2 {
  font-size: clamp(1.625rem, 4vw, 2rem);
  font-weight: 800;
  letter-spacing: -0.02em;
}
.section-header p {
  margin-top: 0.5rem;
  color: var(--text-muted);
  font-size: 1.0625rem;
}

/* Category section */
.docs-categories { padding: 5rem 0 2.5rem; }
.docs-popular { padding: 2.5rem 0 5rem; }
.docs-popular .section-title { text-align: center; font-size: 1.75rem; margin-bottom: 1.5rem; }

/* Docs layout */
.docs-layout {
  display: grid;
  grid-template-columns: var(--sidebar-width) 1fr;
  gap: 3rem;
  padding-top: calc(var(--nav-height) + 3rem);
  padding-bottom: 5rem;
}
@media (max-width: 1023px) {
  .docs-layout { grid-template-columns: 1fr; gap: 1.5rem; padding-top: calc(var(--nav-height) + 1.5rem); }
}

/* Sidebar */
.sidebar {
  position: sticky;
  top: calc(var(--nav-height) + 1.5rem);
  align-self: start;
  max-height: calc(100vh - var(--nav-height) - 3rem);
  overflow-y: auto;
  padding-right: 0.5rem;
}
@media (max-width: 1023px) {
  .sidebar { position: relative; top: auto; max-height: none; }
}

.search-box {
  position: relative;
  margin-bottom: 1.5rem;
}
.search-box input {
  width: 100%;
  padding: 0.625rem 1rem 0.625rem 2.5rem;
  border-radius: var(--radius-full);
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text-primary);
  font-size: 0.9375rem;
}
.search-box input:focus { border-color: var(--brand-500); box-shadow: 0 0 0 3px rgba(37,99,235,0.12); }
.search-box svg {
  position: absolute;
  left: 0.875rem;
  top: 50%;
  transform: translateY(-50%);
  width: 18px; height: 18px;
  color: var(--text-muted);
}
.search-results {
  margin-top: 0.75rem;
  display: none;
}
.search-results.visible { display: block; }
.search-results li { margin-bottom: 0.5rem; }
.search-results a {
  display: block;
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius);
  color: var(--text-secondary);
  font-size: 0.9375rem;
  transition: var(--transition-fast);
}
.search-results a:hover { background: var(--brand-50); color: var(--brand-700); }
.search-results a small { display: block; color: var(--text-muted); font-size: 0.8125rem; }

.sidebar-section { margin-bottom: 1.75rem; }
.sidebar-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8125rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
}
.sidebar-title svg { width: 16px; height: 16px; }
.sidebar-list { display: grid; gap: 0.25rem; }
.sidebar-list a {
  display: block;
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius);
  color: var(--text-secondary);
  font-size: 0.9375rem;
  transition: var(--transition-fast);
}
.sidebar-list a:hover { background: var(--bg-soft); color: var(--brand-600); }
.sidebar-list a.active { background: var(--brand-50); color: var(--brand-700); font-weight: 600; }
[data-theme="dark"] .sidebar-list a.active { background: rgba(59,130,246,0.12); }

/* Main content */
.docs-main {
  min-width: 0;
}
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-bottom: 1.25rem;
}
.breadcrumb a:hover { color: var(--brand-600); }
.breadcrumb svg { width: 14px; height: 14px; }

.docs-article {
  padding: 2rem;
  border-radius: var(--radius-xl);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}
@media (max-width: 639px) { .docs-article { padding: 1.25rem; } }

.docs-article h1 {
  font-size: clamp(1.875rem, 4vw, 2.5rem);
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -0.02em;
  margin-bottom: 1rem;
}
.docs-article h2 {
  font-size: 1.5rem;
  font-weight: 700;
  margin-top: 2.5rem;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
}
.docs-article h3 {
  font-size: 1.25rem;
  font-weight: 700;
  margin-top: 2rem;
  margin-bottom: 0.75rem;
}
.docs-article h4 {
  font-size: 1.0625rem;
  font-weight: 700;
  margin-top: 1.5rem;
  margin-bottom: 0.5rem;
}
.docs-article p {
  margin-bottom: 1rem;
  color: var(--text-secondary);
}
.docs-article a { color: var(--brand-600); text-decoration: underline; }
.docs-article a:hover { color: var(--brand-700); }
.docs-article ul, .docs-article ol {
  margin-bottom: 1.25rem;
  padding-left: 1.5rem;
  color: var(--text-secondary);
}
.docs-article ul { list-style: disc; }
.docs-article ol { list-style: decimal; }
.docs-article li { margin-bottom: 0.375rem; }
.docs-article li > ul, .docs-article li > ol { margin-top: 0.375rem; margin-bottom: 0.375rem; }

.docs-article blockquote {
  margin: 1.5rem 0;
  padding: 1rem 1.25rem;
  border-left: 4px solid var(--brand-500);
  border-radius: 0 var(--radius) var(--radius) 0;
  background: var(--bg-soft);
  color: var(--text-secondary);
}
.docs-article blockquote p:last-child { margin-bottom: 0; }

.docs-article img {
  border-radius: var(--radius);
  border: 1px solid var(--border);
  margin: 1.5rem 0;
}

.docs-article hr {
  border: 0;
  border-top: 1px solid var(--border);
  margin: 2rem 0;
}

.docs-article table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
  font-size: 0.9375rem;
}
.docs-article th, .docs-article td {
  padding: 0.75rem 1rem;
  border: 1px solid var(--border);
  text-align: left;
}
.docs-article th { background: var(--bg-soft); font-weight: 700; color: var(--text-primary); }
.docs-article tr:nth-child(even) td { background: rgba(248,250,252,0.5); }
[data-theme="dark"] .docs-article tr:nth-child(even) td { background: rgba(30,41,59,0.5); }

.docs-article code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.875em;
  padding: 0.125rem 0.375rem;
  border-radius: var(--radius-sm);
  background: var(--bg-soft);
  color: var(--accent-rose);
  border: 1px solid var(--border);
}
.docs-article pre {
  background: #0f172a;
  color: #e2e8f0;
  padding: 1.25rem;
  border-radius: var(--radius);
  overflow-x: auto;
  margin: 1.25rem 0;
}
.docs-article pre code {
  background: transparent;
  color: inherit;
  border: 0;
  padding: 0;
  font-size: 0.875rem;
  line-height: 1.7;
}
.docs-article pre .token-keyword { color: #c084fc; }
.docs-article pre .token-string { color: #86efac; }
.docs-article pre .token-number { color: #fdba74; }
.docs-article pre .token-comment { color: #94a3b8; }
.docs-article pre .token-function { color: #93c5fd; }

/* Callout boxes */
.callout {
  display: flex;
  gap: 0.75rem;
  padding: 1rem 1.25rem;
  border-radius: var(--radius);
  margin: 1.25rem 0;
  border: 1px solid var(--border);
}
.callout svg { flex-shrink: 0; width: 20px; height: 20px; margin-top: 2px; }
.callout.info { background: var(--brand-50); border-color: var(--brand-200); color: var(--brand-900); }
.callout.info svg { color: var(--brand-600); }
.callout.warning { background: #fffbeb; border-color: #fde68a; color: #92400e; }
.callout.warning svg { color: #f59e0b; }
.callout.tip { background: #f0fdf4; border-color: #bbf7d0; color: #166534; }
.callout.tip svg { color: #22c55e; }
[data-theme="dark"] .callout.info { background: rgba(59,130,246,0.12); border-color: rgba(59,130,246,0.25); }
[data-theme="dark"] .callout.warning { background: rgba(245,158,11,0.12); border-color: rgba(245,158,11,0.25); }
[data-theme="dark"] .callout.tip { background: rgba(34,197,94,0.12); border-color: rgba(34,197,94,0.25); }

/* Step cards */
.steps { counter-reset: step; display: grid; gap: 1rem; margin: 1.5rem 0; }
.step {
  display: flex;
  gap: 1rem;
  padding: 1.25rem;
  border-radius: var(--radius);
  background: var(--bg-soft);
  border: 1px solid var(--border);
}
.step::before {
  counter-increment: step;
  content: counter(step);
  width: 32px; height: 32px;
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  background: var(--brand-600);
  color: #fff;
  font-weight: 700;
  font-size: 0.875rem;
}
.step h4 { margin-top: 0; }
.step p { margin-bottom: 0; }

/* Category cards on home */
.category-grid {
  display: grid;
  gap: 1.5rem;
}
@media (min-width: 640px) { .category-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { .category-grid { grid-template-columns: repeat(3, 1fr); } }
.category-card {
  position: relative;
  padding: 1.75rem;
  border-radius: var(--radius-xl);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
  overflow: hidden;
}
.category-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, var(--card-tint, rgba(59,130,246,0.04)), transparent 55%);
  opacity: 0;
  transition: opacity var(--transition);
  pointer-events: none;
}
.category-card:hover { transform: translateY(-5px); box-shadow: var(--shadow-lg); border-color: var(--card-color, var(--brand-200)); }
.category-card:hover::before { opacity: 1; }
.category-card .card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 1rem;
}
.category-card h3 {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 1.125rem;
  font-weight: 700;
}
.category-card .icon-wrap {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px; height: 44px;
  border-radius: var(--radius);
  background: var(--card-bg, var(--brand-50));
  color: var(--card-color, var(--brand-600));
  transition: transform var(--transition);
}
.category-card:hover .icon-wrap { transform: scale(1.08); }
.category-card .icon-wrap svg { width: 24px; height: 24px; }
.category-card .card-desc {
  font-size: 0.9375rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
  line-height: 1.55;
}
.category-card ul { display: grid; gap: 0.5rem; }
.category-card li { display: flex; align-items: center; gap: 0.5rem; }
.category-card li::before {
  content: '';
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--text-muted);
  flex-shrink: 0;
}
.category-card a {
  color: var(--text-secondary);
  font-size: 0.9375rem;
  transition: var(--transition-fast);
}
.category-card a:hover { color: var(--brand-600); }
.category-card .card-arrow {
  position: absolute;
  right: 1.25rem;
  top: 1.75rem;
  width: 24px; height: 24px;
  color: var(--text-muted);
  opacity: 0;
  transform: translateX(-4px);
  transition: opacity var(--transition), transform var(--transition);
}
.category-card:hover .card-arrow { opacity: 1; transform: translateX(0); }
.category-card[data-cat="getting-started"] { --card-bg: #eff6ff; --card-color: #2563eb; --card-tint: rgba(37,99,235,0.06); }
.category-card[data-cat="account"] { --card-bg: #f0fdf4; --card-color: #16a34a; --card-tint: rgba(22,163,74,0.06); }
.category-card[data-cat="automation"] { --card-bg: #faf5ff; --card-color: #9333ea; --card-tint: rgba(147,51,234,0.06); }
.category-card[data-cat="faq"] { --card-bg: #fff7ed; --card-color: #ea580c; --card-tint: rgba(234,88,12,0.06); }
.category-card[data-cat="troubleshooting"] { --card-bg: #fef2f2; --card-color: #dc2626; --card-tint: rgba(220,38,38,0.06); }

/* All articles */
.docs-all { padding: 2.5rem 0 5rem; background: var(--bg-soft); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.all-articles {
  display: grid;
  gap: 1.5rem;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}
.all-articles .cat-block {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
}
.all-articles .cat-block h3 {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border);
}
.all-articles .cat-block h3 svg { width: 18px; height: 18px; color: var(--brand-600); }
.all-articles .cat-block ul { display: grid; gap: 0.375rem; }
.all-articles .cat-block a {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.625rem;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 0.9375rem;
  transition: var(--transition-fast);
}
.all-articles .cat-block a::before {
  content: '';
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--brand-200);
  flex-shrink: 0;
}
.all-articles .cat-block a:hover { background: var(--brand-50); color: var(--brand-700); }

/* Popular articles */
.popular-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 0.875rem;
  max-width: 880px;
  margin-inline: auto;
}
.popular-list li { list-style: none; }
.popular-list a {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.875rem 1rem;
  border-radius: var(--radius);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  font-size: 0.9375rem;
  transition: var(--transition-fast);
}
.popular-list a::before {
  content: '→';
  color: var(--brand-600);
  font-weight: 700;
}
.popular-list a:hover { border-color: var(--brand-200); color: var(--brand-700); background: var(--brand-50); }

/* TOC */
.toc {
  position: sticky;
  top: calc(var(--nav-height) + 1.5rem);
  align-self: start;
  padding-left: 1.25rem;
  border-left: 1px solid var(--border);
}
.toc-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 0.875rem;
}
.toc-title::before {
  content: '';
  width: 4px; height: 16px;
  border-radius: 2px;
  background: var(--brand-600);
}
.toc ul { display: grid; gap: 0.25rem; }
.toc li { position: relative; }
.toc li.active::before {
  content: '';
  position: absolute;
  left: calc(-1.25rem - 1px);
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--brand-600);
  border-radius: 0 2px 2px 0;
}
.toc a {
  display: block;
  padding: 0.375rem 0.625rem;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  color: var(--text-secondary);
  transition: var(--transition-fast);
}
.toc a:hover { background: var(--brand-50); color: var(--brand-700); }
.toc li.active > a { color: var(--brand-700); font-weight: 600; background: var(--brand-50); }
.toc a.h3 { padding-left: 1rem; }

.toc-empty {
  font-size: 0.875rem;
  color: var(--text-muted);
  padding: 0.5rem 0;
}

/* Footer */
.docs-footer {
  margin-top: 4rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.875rem;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 1rem;
}
.docs-footer a { color: var(--brand-600); }

/* Mobile sidebar toggle */
.sidebar-toggle {
  display: none;
  width: 100%;
  padding: 0.75rem 1rem;
  margin-bottom: 1rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text-primary);
  font-weight: 600;
  align-items: center;
  justify-content: space-between;
}
.sidebar-toggle svg { width: 18px; height: 18px; transition: transform var(--transition); }
.sidebar-toggle.open svg { transform: rotate(180deg); }
@media (max-width: 1023px) {
  .sidebar-toggle { display: flex; }
  .sidebar-content { display: none; }
  .sidebar-content.open { display: block; }
}

/* Utilities */
.text-center { text-align: center; }
.lead { font-size: 1.125rem; color: var(--text-secondary); max-width: 640px; margin-inline: auto; }
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.375rem 0.875rem;
  border-radius: var(--radius-full);
  background: var(--brand-50);
  color: var(--brand-700);
  font-size: 0.875rem;
  font-weight: 600;
}
[data-theme="dark"] .badge { background: rgba(59,130,246,0.15); }

@media (max-width: 1023px) {
  .nav { display: none; }
  .menu-toggle { display: inline-flex; }
}

.mobile-menu {
  position: fixed;
  inset: var(--nav-height) 0 0 0;
  z-index: 99;
  background: var(--bg);
  padding: 1.5rem;
  transform: translateX(100%);
  transition: transform var(--transition);
  overflow-y: auto;
  border-top: 1px solid var(--border);
}
.mobile-menu.open { transform: translateX(0); }
.mobile-menu a {
  display: block;
  padding: 0.875rem 0;
  font-size: 1.0625rem;
  font-weight: 500;
  color: var(--text-primary);
  border-bottom: 1px solid var(--border);
}
