:root {
  --bg-app: #f6f5f1;
  --bg-paper: #ffffff;
  --bg-elevated: #faf9f6;
  --bg-muted: #eeece5;
  --bg-hover: #e8e5dc;

  --text-primary: #23221e;
  --text-secondary: #5c594f;
  --text-muted: #8a867b;

  --accent: #2f5e4e;
  --accent-hover: #244a3d;
  --accent-soft: rgba(47, 94, 78, 0.11);
  --accent-text: #ffffff;
  --accent-ring: rgba(47, 94, 78, 0.28);

  --border-subtle: rgba(35, 34, 30, 0.09);
  --border-strong: rgba(35, 34, 30, 0.18);

  --shadow-paper: 0 2px 18px rgba(35, 34, 30, 0.04), 0 1px 3px rgba(35, 34, 30, 0.05);
  --shadow-float: 0 14px 36px rgba(24, 23, 20, 0.14), 0 2px 10px rgba(24, 23, 20, 0.08);

  --callout-note-bg: rgba(86, 152, 224, 0.09);
  --callout-note-border: #357fd6;
  --callout-tip-bg: rgba(74, 163, 126, 0.1);
  --callout-tip-border: #2e8f68;
  --callout-warn-bg: rgba(232, 140, 74, 0.11);
  --callout-warn-border: #d97128;
  --callout-important-bg: rgba(155, 123, 216, 0.1);
  --callout-important-border: #845ec9;

  --code-bg: #f3f1ea;
  --topbar-bg: rgba(246, 245, 241, 0.88);
  --topbar-height: 62px;

  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei UI", "PingFang SC", "Ubuntu", "Noto Sans CJK SC", "WenQuanYi Micro Hei", sans-serif;
  --font-serif: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei UI", "PingFang SC", "Ubuntu", "Noto Sans CJK SC", "WenQuanYi Micro Hei", sans-serif;
  --font-mono: "JetBrains Mono", "Cascadia Code", Consolas, "Ubuntu Mono", "DejaVu Sans Mono", monospace;
}

[data-theme='dark'] {
  --bg-app: #141413;
  --bg-paper: #1b1b19;
  --bg-elevated: #222220;
  --bg-muted: #282825;
  --bg-hover: #30302c;

  --text-primary: #e6e3da;
  --text-secondary: #b1ada2;
  --text-muted: #7c7970;

  --accent: #6ab097;
  --accent-hover: #7ec2aa;
  --accent-soft: rgba(106, 176, 151, 0.14);
  --accent-text: #111614;
  --accent-ring: rgba(106, 176, 151, 0.30);

  --border-subtle: rgba(230, 227, 218, 0.09);
  --border-strong: rgba(230, 227, 218, 0.18);

  --shadow-paper: 0 4px 24px rgba(0, 0, 0, 0.35), 0 1px 3px rgba(0, 0, 0, 0.25);
  --shadow-float: 0 16px 40px rgba(0, 0, 0, 0.55), 0 2px 10px rgba(0, 0, 0, 0.35);

  --callout-note-bg: rgba(100, 165, 232, 0.12);
  --callout-note-border: #64a5e8;
  --callout-tip-bg: rgba(106, 176, 151, 0.13);
  --callout-tip-border: #6ab097;
  --callout-warn-bg: rgba(232, 140, 74, 0.13);
  --callout-warn-border: #e88c4a;
  --callout-important-bg: rgba(155, 123, 216, 0.13);
  --callout-important-border: #9b7bd8;

  --code-bg: #232320;
  --topbar-bg: rgba(20, 20, 19, 0.86);
}

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

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
}

body {
  margin: 0;
  background: var(--bg-app);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 15.5px;
  line-height: 1.72;
}

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

a:hover {
  text-decoration: underline;
}

img {
  max-width: 100%;
  height: auto;
}

button {
  font-family: inherit;
  cursor: pointer;
}

/* ---------- Top Navigation ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  height: var(--topbar-height);
  background: var(--topbar-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-subtle);
}

.topbar-inner {
  width: 100%;
  max-width: 1280px;
  height: 100%;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

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

.segmented-control {
  display: inline-flex;
  padding: 2px;
  border-radius: 9px;
  background: var(--bg-muted);
  border: 1px solid var(--border-subtle);
  gap: 2px;
}

.segmented-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 28px;
  padding: 0 11px;
  border-radius: 7px;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text-secondary);
  background: none;
  border: none;
  cursor: pointer;
  white-space: nowrap;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.segmented-btn:hover {
  color: var(--text-primary);
}

.segmented-btn.active {
  background: var(--bg-paper);
  color: var(--accent);
  font-weight: 600;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.theme-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-paper);
  color: var(--text-secondary);
  cursor: pointer;
  transition: border-color 0.15s ease, color 0.15s ease, background-color 0.15s ease;
}

.theme-icon-btn:hover {
  background: var(--bg-hover);
  border-color: var(--border-strong);
  color: var(--text-primary);
}

.theme-icon-btn .icon-sun {
  display: none;
}

[data-theme='dark'] .theme-icon-btn .icon-moon {
  display: none;
}

[data-theme='dark'] .theme-icon-btn .icon-sun {
  display: block;
}

.search-trigger {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  height: 34px;
  min-width: 190px;
  padding: 0 11px;
  border-radius: 8px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-elevated);
  color: var(--text-muted);
  font-size: 13px;
  cursor: pointer;
  transition: border-color 0.15s ease, color 0.15s ease, background-color 0.15s ease;
}

.search-trigger:hover {
  border-color: var(--accent);
  color: var(--text-primary);
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

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

.brand-link:hover {
  text-decoration: none;
  color: var(--accent);
}

.brand-link img {
  width: 28px;
  height: 28px;
  border-radius: 7px;
}

.brand-badge {
  font-size: 11.5px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
}

.topbar-nav {
  display: flex;
  align-items: center;
  gap: 4px;
}

.topbar-nav a {
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  white-space: nowrap;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.topbar-nav a:hover {
  background: var(--bg-muted);
  color: var(--text-primary);
  text-decoration: none;
}

.topbar-nav a.active {
  color: var(--accent);
  background: var(--accent-soft);
  font-weight: 600;
  text-decoration: none;
}

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

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 34px;
  padding: 0 11px;
  border-radius: 8px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-paper);
  color: var(--text-secondary);
  font-size: 13px;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.icon-btn:hover {
  background: var(--bg-hover);
  border-color: var(--border-strong);
  color: var(--text-primary);
  text-decoration: none;
}

.search-trigger-key {
  font-family: var(--font-mono);
  font-size: 11px;
  padding: 1px 5px;
  border-radius: 4px;
  background: var(--bg-muted);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
}

.mobile-menu-btn {
  display: none;
  padding: 0 9px;
}

/* ---------- Landing Page ---------- */
.container {
  max-width: 1160px;
  margin: 0 auto;
  padding: 0 24px;
}

.hero {
  padding: 64px 0 44px;
  text-align: center;
}

.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 12px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 18px;
}

.hero-title {
  margin: 0 auto 14px;
  max-width: 780px;
  font-family: var(--font-serif);
  font-size: clamp(32px, 5vw, 48px);
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.hero-subtitle {
  margin: 0 auto 28px;
  max-width: 680px;
  font-size: 17px;
  color: var(--text-secondary);
  line-height: 1.75;
}

.hero-cta {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin-bottom: 36px;
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 22px;
  border-radius: 10px;
  background: var(--accent);
  color: var(--accent-text);
  font-weight: 600;
  font-size: 15px;
  border: 1px solid transparent;
  transition: background-color 0.15s ease, transform 0.12s ease;
}

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

.btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 20px;
  border-radius: 10px;
  background: var(--bg-paper);
  color: var(--text-primary);
  border: 1px solid var(--border-strong);
  font-weight: 600;
  font-size: 15px;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}

.btn-secondary:hover {
  background: var(--bg-hover);
  text-decoration: none;
}

.hero-shot {
  background: var(--bg-paper);
  border: 1px solid var(--border-subtle);
  border-radius: 16px;
  padding: 12px;
  box-shadow: var(--shadow-float);
}

.hero-shot img {
  display: block;
  width: 100%;
  border-radius: 10px;
  cursor: zoom-in;
}

.hero-caption {
  margin-top: 10px;
  font-size: 13.5px;
  color: var(--text-muted);
}

.section {
  padding: 44px 0;
}

.section-header {
  text-align: center;
  max-width: 660px;
  margin: 0 auto 30px;
}

.section-header h2 {
  margin: 0 0 8px;
  font-family: var(--font-serif);
  font-size: 28px;
  line-height: 1.3;
}

.section-header p {
  margin: 0;
  color: var(--text-secondary);
  font-size: 15.5px;
}

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

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

.card {
  background: var(--bg-paper);
  border: 1px solid var(--border-subtle);
  border-radius: 14px;
  padding: 22px;
  box-shadow: var(--shadow-paper);
}

.card-tag {
  display: inline-block;
  font-size: 12px;
  font-weight: 600;
  color: var(--accent);
  background: var(--accent-soft);
  padding: 2px 9px;
  border-radius: 999px;
  margin-bottom: 10px;
}

.card h3 {
  margin: 0 0 8px;
  font-size: 18px;
  line-height: 1.35;
}

.card p {
  margin: 0;
  color: var(--text-secondary);
  font-size: 14.5px;
}

.card-link {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 12px;
  color: inherit;
  transition: border-color 0.15s ease, transform 0.14s ease, box-shadow 0.15s ease;
}

.card-link:hover {
  text-decoration: none;
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: var(--shadow-float);
}

.card-more {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--accent);
}

.shot-card {
  padding: 12px;
}

.shot-card img {
  display: block;
  width: 100%;
  border-radius: 8px;
  border: 1px solid var(--border-subtle);
  cursor: zoom-in;
}

.shot-card figcaption {
  padding: 10px 6px 4px;
  font-size: 13.5px;
  color: var(--text-secondary);
}

.shot-card strong {
  color: var(--text-primary);
}

.site-footer {
  border-top: 1px solid var(--border-subtle);
  padding: 22px 24px;
  margin-top: 0;
  color: var(--text-muted);
  font-size: 13px;
}

.site-footer-inner {
  max-width: 1280px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
}

/* ---------- VitePress / AstrBot 3-Column Documentation Layout ---------- */
.docs-shell {
  max-width: 1280px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr) 216px;
  gap: 0 28px;
  align-items: start;
}

.docs-sidebar {
  position: sticky;
  top: var(--topbar-height);
  max-height: calc(100vh - var(--topbar-height));
  overflow-y: auto;
  padding: 20px 16px 32px 24px;
  background: var(--bg-elevated);
  border-right: 1px solid var(--border-subtle);
}

.sidebar-group {
  padding-bottom: 12px;
  margin-bottom: 12px;
  border-bottom: 1px solid var(--border-subtle);
}

.sidebar-group:last-child {
  border-bottom: none;
}

.sidebar-group-static {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
  padding: 6px 0;
}

.sidebar-group-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 0;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
  background: none;
  border: none;
  cursor: pointer;
  text-align: left;
}

.sidebar-group-btn:hover {
  color: var(--accent);
}

.sidebar-chevron {
  font-size: 12px;
  color: var(--text-muted);
  transition: transform 0.16s ease;
}

.sidebar-group.is-collapsed .sidebar-chevron {
  transform: rotate(-90deg);
}

.sidebar-group.is-collapsed .sidebar-group-items {
  display: none;
}

.sidebar-group-items {
  padding-top: 2px;
}

.sidebar-link {
  display: block;
  padding: 6px 10px;
  margin: 1px 0;
  border-radius: 7px;
  font-size: 13.5px;
  color: var(--text-secondary);
  line-height: 1.45;
  transition: background-color 0.14s ease, color 0.14s ease;
}

.sidebar-link:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
  text-decoration: none;
}

.sidebar-link.active {
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 600;
}

.docs-main {
  min-width: 0;
  padding: 32px 24px 64px;
}

.paper-article {
  background: transparent;
  border: none;
  padding: 0;
  box-shadow: none;
  max-width: 780px;
  margin: 0 auto;
}

.article-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 10px;
}

.article-category {
  padding: 2px 9px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 600;
}

/* ---------- Prose Typography ---------- */
.prose h1 {
  margin: 0 0 18px;
  font-family: var(--font-serif);
  font-size: 31px;
  line-height: 1.28;
  letter-spacing: -0.015em;
}

.prose h2 {
  margin: 34px 0 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border-subtle);
  font-family: var(--font-serif);
  font-size: 22px;
  line-height: 1.35;
  scroll-margin-top: calc(var(--topbar-height) + 18px);
}

.prose h3 {
  margin: 24px 0 10px;
  font-size: 17.5px;
  line-height: 1.4;
  scroll-margin-top: calc(var(--topbar-height) + 18px);
}

.prose h4 {
  margin: 18px 0 8px;
  font-size: 15.5px;
  scroll-margin-top: calc(var(--topbar-height) + 18px);
}

.heading-anchor {
  margin-left: 8px;
  font-size: 0.85em;
  color: var(--text-muted);
  opacity: 0;
  transition: opacity 0.15s ease;
}

.prose h2:hover .heading-anchor,
.prose h3:hover .heading-anchor,
.prose h4:hover .heading-anchor {
  opacity: 1;
}

.prose p {
  margin: 0 0 14px;
}

.prose ul,
.prose ol {
  margin: 0 0 16px;
  padding-left: 24px;
}

.prose li {
  margin-bottom: 6px;
}

.prose li > ul,
.prose li > ol {
  margin-top: 6px;
  margin-bottom: 4px;
}

.prose hr {
  border: none;
  border-top: 1px solid var(--border-subtle);
  margin: 28px 0;
}

.prose code {
  font-family: var(--font-mono);
  font-size: 0.875em;
  background: var(--code-bg);
  padding: 2px 6px;
  border-radius: 5px;
  border: 1px solid var(--border-subtle);
}

.prose kbd {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.82em;
  line-height: 1.25;
  padding: 2px 7px;
  border-radius: 6px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-strong);
  box-shadow: inset 0 -1px 0 var(--border-subtle);
  color: var(--text-primary);
}

.code-block {
  position: relative;
  margin: 16px 0 20px;
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  background: var(--code-bg);
  overflow: hidden;
}

.code-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 12px;
  border-bottom: 1px solid var(--border-subtle);
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-muted);
  background: var(--bg-elevated);
}

.code-copy-btn {
  border: 1px solid var(--border-subtle);
  background: var(--bg-paper);
  color: var(--text-secondary);
  font-size: 11.5px;
  padding: 2px 9px;
  border-radius: 6px;
}

.code-copy-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.code-block pre {
  margin: 0;
  padding: 14px 16px;
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 13.5px;
  line-height: 1.55;
}

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

.prose blockquote {
  margin: 16px 0;
  padding: 10px 16px;
  border-left: 3.5px solid var(--accent);
  background: var(--bg-elevated);
  border-radius: 0 8px 8px 0;
  color: var(--text-secondary);
}

.prose blockquote p:last-child {
  margin-bottom: 0;
}

.callout {
  margin: 18px 0;
  padding: 13px 16px;
  border-radius: 10px;
  border-left: 4px solid var(--callout-note-border);
  background: var(--callout-note-bg);
}

.callout-tip {
  border-left-color: var(--callout-tip-border);
  background: var(--callout-tip-bg);
}

.callout-warning {
  border-left-color: var(--callout-warn-border);
  background: var(--callout-warn-bg);
}

.callout-important {
  border-left-color: var(--callout-important-border);
  background: var(--callout-important-bg);
}

.callout-title {
  font-weight: 700;
  font-size: 14px;
  margin-bottom: 6px;
  color: var(--text-primary);
}

.callout p:last-child,
.callout ul:last-child {
  margin-bottom: 0;
}

.table-wrap {
  margin: 16px 0 20px;
  overflow-x: auto;
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
}

.prose table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.prose th,
.prose td {
  padding: 10px 13px;
  text-align: left;
  border-bottom: 1px solid var(--border-subtle);
  vertical-align: top;
}

.prose th {
  background: var(--bg-elevated);
  font-weight: 650;
  color: var(--text-primary);
  white-space: nowrap;
}

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

.prose figure {
  margin: 18px 0 22px;
  padding: 10px;
  border-radius: 12px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-elevated);
  text-align: center;
}

.prose figure img {
  display: block;
  margin: 0 auto;
  border-radius: 8px;
  cursor: zoom-in;
}

.prose figcaption {
  margin-top: 8px;
  font-size: 13px;
  color: var(--text-muted);
}

.pager {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 32px;
  padding-top: 22px;
  border-top: 1px solid var(--border-subtle);
}

.pager-link {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 13px 16px;
  border-radius: 10px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-elevated);
  color: var(--text-primary);
}

.pager-link:hover {
  border-color: var(--accent);
  text-decoration: none;
}

.pager-next {
  text-align: right;
  grid-column: 2;
}

.pager-label {
  font-size: 12px;
  color: var(--text-muted);
}

.pager-title {
  font-size: 14.5px;
  font-weight: 600;
  color: var(--accent);
}

/* ---------- Right TOC ---------- */
.docs-toc {
  position: sticky;
  top: calc(var(--topbar-height) + 22px);
  max-height: calc(100vh - var(--topbar-height) - 44px);
  overflow-y: auto;
  font-size: 13px;
}

.toc-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 10px;
}

.toc-list {
  list-style: none;
  margin: 0;
  padding: 0;
  border-left: 1.5px solid var(--border-subtle);
}

.toc-item a {
  display: block;
  padding: 4px 0 4px 12px;
  margin-left: -1.5px;
  border-left: 2px solid transparent;
  color: var(--text-muted);
  line-height: 1.45;
}

.toc-item.toc-h3 a {
  padding-left: 24px;
  font-size: 12.5px;
}

.toc-item a:hover,
.toc-item a.active {
  color: var(--accent);
  border-left-color: var(--accent);
  text-decoration: none;
}

/* ---------- Search Modal & Lightbox ---------- */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 90;
  background: rgba(14, 14, 12, 0.52);
  display: none;
  align-items: flex-start;
  justify-content: center;
  padding: 10vh 16px 16px;
}

.modal-backdrop.open {
  display: flex;
}

.search-dialog {
  width: 100%;
  max-width: 620px;
  background: var(--bg-paper);
  border: 1px solid var(--border-strong);
  border-radius: 14px;
  box-shadow: var(--shadow-float);
  overflow: hidden;
}

.search-input-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-subtle);
}

.search-input {
  flex: 1;
  border: none;
  outline: none;
  background: transparent;
  color: var(--text-primary);
  font-size: 15.5px;
  font-family: inherit;
}

.search-results {
  max-height: 55vh;
  overflow-y: auto;
  padding: 8px;
}

.search-empty {
  padding: 24px 16px;
  text-align: center;
  color: var(--text-muted);
  font-size: 14px;
}

.search-hit {
  display: block;
  padding: 10px 12px;
  border-radius: 9px;
  color: var(--text-primary);
}

.search-hit:hover {
  background: var(--accent-soft);
  text-decoration: none;
}

.search-hit-title {
  font-weight: 600;
  font-size: 14.5px;
  color: var(--accent);
}

.search-hit-sub {
  font-size: 12.5px;
  color: var(--text-muted);
  margin-top: 2px;
}

.search-hit-snippet {
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 4px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(12, 12, 10, 0.84);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  cursor: zoom-out;
}

.lightbox.open {
  display: flex;
}

.lightbox img {
  max-width: 95vw;
  max-height: 92vh;
  border-radius: 10px;
  box-shadow: var(--shadow-float);
}

.sidebar-scrim {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 45;
  background: rgba(14, 14, 12, 0.45);
}

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

/* ---------- Responsive ---------- */
  .docs-toc {
    padding-right: 16px;
  }
@media (max-width: 1180px) {
  .docs-shell {
    grid-template-columns: 252px minmax(0, 1fr);
  }
  .docs-toc {
    display: none;
  }
}

@media (max-width: 900px) {
  .grid-3 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .search-trigger {
    min-width: auto;
  }
  .search-trigger-label {
    display: none;
  }
}

@media (max-width: 860px) {
  .mobile-menu-btn {
    display: inline-flex;
  }
  .topbar-nav {
    display: none;
  }
  .docs-shell {
    grid-template-columns: minmax(0, 1fr);
    padding: 0 14px;
  }
  .docs-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 50;
    width: 280px;
    max-height: none;
    background: var(--bg-paper);
    border-right: 1px solid var(--border-strong);
    padding: 18px 14px 28px;
    transform: translateX(-105%);
    transition: transform 0.2s ease;
  }
  .docs-sidebar.open {
    transform: translateX(0);
  }
  .paper-article {
    padding: 24px 20px 28px;
  }
  .pager {
    grid-template-columns: 1fr;
  }
  .pager-next {
    grid-column: 1;
    text-align: left;
  }
}

@media (max-width: 640px) {
  .grid-3,
  .grid-2 {
    grid-template-columns: 1fr;
  }
  .hero {
    padding: 40px 0 28px;
  }
}

@media print {
  .topbar,
  .docs-sidebar,
  .docs-toc,
  .pager,
  .code-copy-btn {
    display: none !important;
  }
  .docs-shell {
    display: block;
  }
  .paper-article {
    border: none;
    box-shadow: none;
    padding: 0;
  }
}

/* ---------- Visual containers ---------- */
.prose .feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 12px;
  margin: 6px 0 22px;
}
@media (min-width: 641px) {
  .prose .feature-grid:has(> .feature-card:nth-child(4):last-child) {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
.prose .feature-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 14px 16px;
  transition: border-color 0.15s ease;
}
.prose .feature-card:hover { border-color: var(--accent-ring); }
.prose .feature-card-title {
  font-weight: 600;
  font-size: 15px;
  color: var(--text-primary);
  margin-bottom: 4px;
}
.prose .feature-card p {
  margin: 0;
  font-size: 13.5px;
  line-height: 1.6;
  color: var(--text-secondary);
}
.prose ol.steps {
  list-style: none;
  padding-left: 0;
  margin: 6px 0 22px;
  counter-reset: step;
}
.prose ol.steps > li.step-item {
  position: relative;
  margin: 0;
  padding: 0 0 16px 44px;
  counter-increment: step;
}
.prose ol.steps > li.step-item::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: 0;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 700;
  font-size: 13.5px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.prose ol.steps > li.step-item:not(:last-child)::after {
  content: '';
  position: absolute;
  left: 13.5px;
  top: 32px;
  bottom: 4px;
  width: 1px;
  background: var(--border-strong);
}
.prose .step-title { font-weight: 600; line-height: 28px; }
.prose .step-item p { margin: 2px 0 0; font-size: 14.5px; color: var(--text-secondary); }
