/* ==========================================================================
   徐海 Wiki · 全站样式
   风格参考 OI Wiki / VitePress：文档式布局、左侧目录、右侧页内目录
   ========================================================================== */

:root {
  --brand: #3451b2;
  --brand-2: #5b7cfa;
  --brand-soft: rgba(52, 81, 178, 0.08);
  --brand-border: rgba(52, 81, 178, 0.22);
  --bg: #ffffff;
  --bg-alt: #f6f7fb;
  --surface: #ffffff;
  --surface-2: #f4f5f8;
  --text: #2c2c32;
  --text-2: #3c3c43;
  --muted: #67676c;
  --muted-2: #8b8b92;
  --border: #e5e5e8;
  --border-strong: #d4d4d8;
  --header-bg: rgba(255, 255, 255, 0.84);
  --shadow-sm: 0 1px 2px rgba(20, 24, 40, 0.05);
  --shadow-md: 0 8px 24px rgba(20, 24, 40, 0.08);
  --shadow-lg: 0 18px 48px rgba(20, 24, 40, 0.12);
  --grid-line: rgba(52, 81, 178, 0.075);
  --warn: #b45309;
  --warn-bg: rgba(217, 119, 6, 0.08);
  --danger: #c02626;
  --danger-bg: rgba(220, 38, 38, 0.07);
  --note: #566577;
  --note-bg: rgba(86, 101, 119, 0.07);
  --radius: 12px;
  --header-h: 64px;
  --sidebar-w: 274px;
  --toc-w: 236px;
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas,
    "Liberation Mono", monospace;
  color-scheme: light;
}

[data-theme="dark"] {
  --brand: #a8b1ff;
  --brand-2: #8ea1ff;
  --brand-soft: rgba(168, 177, 255, 0.12);
  --brand-border: rgba(168, 177, 255, 0.28);
  --bg: #1b1b1f;
  --bg-alt: #161618;
  --surface: #202127;
  --surface-2: #25262c;
  --text: #e6e6e3;
  --text-2: #d4d4d0;
  --muted: #98989f;
  --muted-2: #7a7a82;
  --border: #2e2e33;
  --border-strong: #3a3a40;
  --header-bg: rgba(27, 27, 31, 0.84);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 18px 48px rgba(0, 0, 0, 0.45);
  --grid-line: rgba(255, 255, 255, 0.05);
  --warn: #fbbf24;
  --warn-bg: rgba(251, 191, 36, 0.1);
  --danger: #f87171;
  --danger-bg: rgba(248, 113, 113, 0.1);
  --note: #a7b4c6;
  --note-bg: rgba(167, 180, 198, 0.08);
  color-scheme: dark;
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 20px);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text-2);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

body.nav-open,
body.search-open {
  overflow: hidden;
}

::selection {
  background: rgba(52, 81, 178, 0.22);
}

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

a:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

button,
input {
  font-family: inherit;
}

button {
  cursor: pointer;
}

:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

img,
svg {
  max-width: 100%;
}

.icon {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  display: inline-block;
  vertical-align: -0.15em;
}

.skip-link {
  position: fixed;
  top: -60px;
  left: 16px;
  z-index: 999;
  padding: 10px 16px;
  border-radius: 8px;
  background: var(--brand);
  color: #fff;
  font-size: 13px;
  transition: top 0.2s ease;
}

.skip-link:focus {
  top: 12px;
}

/* --------------------------------------------------------------------------
   Header
   -------------------------------------------------------------------------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 60;
  height: var(--header-h);
  border-bottom: 1px solid var(--border);
  background: var(--header-bg);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  backdrop-filter: saturate(180%) blur(14px);
  transition: box-shadow 0.2s ease, border-color 0.2s ease;
}

.site-header.is-scrolled {
  box-shadow: var(--shadow-sm);
  border-bottom-color: var(--border-strong);
}

.header-inner {
  max-width: 1440px;
  height: 100%;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  gap: 26px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
  color: var(--text);
  text-decoration: none;
}

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

.brand-mark {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: linear-gradient(135deg, #2f4da8 0%, #5b7cfa 100%);
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 11.5px;
  font-weight: 800;
  letter-spacing: 0.6px;
  box-shadow: 0 4px 12px rgba(52, 81, 178, 0.28);
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}

.brand-text strong {
  font-size: 15.5px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--text);
}

.brand-text small {
  margin-top: 3px;
  font-size: 8.5px;
  font-weight: 600;
  letter-spacing: 1.7px;
  color: var(--muted-2);
}

.top-nav {
  display: flex;
  align-items: center;
  gap: 2px;
}

.top-nav a {
  padding: 7px 12px;
  border-radius: 8px;
  color: var(--muted);
  font-size: 13.5px;
  font-weight: 500;
  text-decoration: none;
  transition: color 0.15s ease, background 0.15s ease;
}

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

.top-nav a.active {
  color: var(--brand);
  background: var(--brand-soft);
  font-weight: 600;
}

.header-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
}

.search-trigger {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 36px;
  min-width: 192px;
  padding: 0 10px 0 11px;
  border: 1px solid var(--border-strong);
  border-radius: 9px;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 13px;
  transition: border-color 0.15s ease, color 0.15s ease, background 0.15s ease;
}

.search-trigger:hover {
  border-color: var(--brand-border);
  color: var(--text);
  background: var(--surface);
}

.search-trigger .icon {
  width: 15px;
  height: 15px;
  color: var(--muted);
}

.search-trigger kbd {
  margin-left: auto;
}

kbd {
  display: inline-block;
  padding: 1px 5px;
  border: 1px solid var(--border-strong);
  border-bottom-width: 2px;
  border-radius: 4px;
  background: var(--surface);
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 10.5px;
  line-height: 1.5;
  white-space: nowrap;
}

.icon-btn {
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--muted);
  display: inline-grid;
  place-items: center;
  transition: background 0.15s ease, color 0.15s ease;
}

.icon-btn:hover {
  background: var(--surface-2);
  color: var(--text);
}

.icon-btn .icon {
  width: 18px;
  height: 18px;
}

.theme-icon {
  display: none;
  place-items: center;
}

.theme-icon-moon {
  display: inline-grid;
}

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

[data-theme="dark"] .theme-icon-sun {
  display: inline-grid;
}

.menu-toggle {
  display: none;
}

/* --------------------------------------------------------------------------
   Layout & documents
   -------------------------------------------------------------------------- */

.layout {
  max-width: 1440px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: var(--sidebar-w) minmax(0, 1fr) var(--toc-w);
  align-items: start;
}

.main {
  min-width: 0;
  padding: 36px 48px 96px;
}

.main-inner {
  max-width: 780px;
  margin: 0 auto;
}

.site-sidebar {
  position: sticky;
  top: var(--header-h);
  height: calc(100vh - var(--header-h));
  padding: 20px 14px 64px;
  border-right: 1px solid var(--border);
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: var(--border-strong) transparent;
}

.site-sidebar::-webkit-scrollbar,
.site-toc::-webkit-scrollbar {
  width: 6px;
}

.site-sidebar::-webkit-scrollbar-thumb,
.site-toc::-webkit-scrollbar-thumb {
  background: var(--border-strong);
  border-radius: 3px;
}

.sidebar-top {
  padding: 0 4px 12px;
  border-bottom: 1px dashed var(--border);
  margin-bottom: 8px;
}

.sidebar-search {
  width: 100%;
  height: 36px;
  padding: 0 10px;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.sidebar-search:hover {
  border-color: var(--brand-border);
  background: var(--surface-2);
}

.sidebar-search .icon {
  width: 14px;
  height: 14px;
}

.sidebar-search kbd {
  margin-left: auto;
  font-size: 9.5px;
}

.sb-group {
  margin-top: 12px;
}

.sb-group-btn {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 8px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--text);
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.2px;
  text-align: left;
}

.sb-group-btn:hover {
  background: var(--surface-2);
}

.sb-group-icon {
  width: 16px;
  height: 16px;
  display: grid;
  place-items: center;
  color: var(--brand);
}

.sb-group-icon .icon {
  width: 15px;
  height: 15px;
}

.sb-group-title {
  flex: 1;
  min-width: 0;
}

.sb-group-count {
  font-size: 10.5px;
  font-weight: 500;
  color: var(--muted-2);
}

.sb-chevron {
  color: var(--muted-2);
  transition: transform 0.18s ease;
  display: grid;
  place-items: center;
}

.sb-chevron .icon {
  width: 13px;
  height: 13px;
}

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

.sb-list {
  margin: 2px 0 0;
  padding: 0 0 0 4px;
  list-style: none;
}

.sb-group.is-collapsed .sb-list {
  display: none;
}

.sb-list li {
  margin: 1px 0;
}

.sidebar-link {
  display: block;
  padding: 6px 10px 6px 30px;
  border-radius: 6px;
  color: var(--muted);
  font-size: 13px;
  text-decoration: none;
  position: relative;
  transition: color 0.15s ease, background 0.15s ease;
}

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

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

.sidebar-link.active::before {
  content: "";
  position: absolute;
  left: 14px;
  top: 11px;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--brand);
}

.site-toc {
  position: sticky;
  top: var(--header-h);
  max-height: calc(100vh - var(--header-h));
  overflow-y: auto;
  padding: 36px 22px 48px 12px;
  font-size: 12.5px;
  scrollbar-width: thin;
}

.toc-title {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0 0 10px;
  padding-left: 10px;
  color: var(--muted-2);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.2px;
  text-transform: uppercase;
}

.toc-title .icon {
  width: 13px;
  height: 13px;
}

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

.toc-item a {
  display: block;
  margin-left: -1px;
  padding: 5px 8px;
  border-left: 2px solid transparent;
  color: var(--muted);
  line-height: 1.55;
  text-decoration: none;
  transition: color 0.15s ease, border-color 0.15s ease;
}

.toc-item a:hover {
  color: var(--text);
  text-decoration: none;
}

.toc-item a.active {
  border-left-color: var(--brand);
  color: var(--brand);
  font-weight: 600;
}

.toc-item.depth-3 a {
  padding-left: 20px;
  font-size: 12px;
}

.breadcrumb {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
  margin-bottom: 18px;
  color: var(--muted-2);
  font-size: 12.5px;
}

.breadcrumb a {
  color: var(--muted);
}

.breadcrumb a:hover {
  color: var(--brand);
}

.breadcrumb .sep {
  color: var(--border-strong);
}

.breadcrumb .current {
  color: var(--text);
}

/* --------------------------------------------------------------------------
   Article
   -------------------------------------------------------------------------- */

.page-kicker {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--brand-soft);
  color: var(--brand);
  font-size: 12px;
  font-weight: 600;
}

.page-kicker .icon {
  width: 14px;
  height: 14px;
}

.page-head h1 {
  margin: 14px 0 10px;
  color: var(--text);
  font-size: 34px;
  line-height: 1.25;
  font-weight: 750;
  letter-spacing: -0.025em;
}

.page-lead {
  max-width: 700px;
  margin: 0;
  color: var(--muted);
  font-size: 16.5px;
  line-height: 1.75;
}

.page-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 16px;
  margin: 20px 0 30px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--border);
  color: var(--muted);
  font-size: 12.5px;
}

.meta-item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.meta-item .icon {
  width: 14px;
  height: 14px;
}

.meta-tags {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  margin-left: auto;
}

.tag {
  padding: 3px 9px;
  border: 1px solid var(--brand-border);
  border-radius: 999px;
  background: var(--brand-soft);
  color: var(--brand);
  font-size: 11.5px;
  line-height: 1.5;
  transition: background 0.15s ease, color 0.15s ease;
}

.tag:hover {
  background: var(--brand);
  color: var(--bg);
}

.article-body h2,
.article-body h3,
.article-body h4 {
  color: var(--text);
  scroll-margin-top: calc(var(--header-h) + 22px);
}

.article-body h2 {
  margin: 44px 0 14px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
  font-size: 23px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.article-body h3 {
  margin: 30px 0 10px;
  font-size: 17.5px;
  font-weight: 650;
}

.article-body h4 {
  margin: 24px 0 8px;
  font-size: 15.5px;
  font-weight: 650;
}

.article-body p {
  margin: 14px 0;
  color: var(--text-2);
  line-height: 1.85;
}

.article-body ul,
.article-body ol {
  margin: 14px 0;
  padding-left: 1.4em;
  line-height: 1.9;
}

.article-body li {
  margin: 5px 0;
}

.article-body ul li::marker {
  color: var(--brand);
}

.article-body ol li::marker {
  color: var(--brand);
  font-weight: 600;
}

.article-body strong {
  color: var(--text);
  font-weight: 650;
}

.article-body a {
  color: var(--brand);
  font-weight: 500;
}

.article-body a:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.header-anchor {
  margin-left: 6px;
  color: var(--muted-2) !important;
  font-size: 0.8em;
  font-weight: 400;
  opacity: 0;
  text-decoration: none !important;
  transition: opacity 0.15s ease;
}

.article-body h2:hover .header-anchor,
.article-body h3:hover .header-anchor,
.article-body h4:hover .header-anchor {
  opacity: 0.6;
}

.pending {
  padding: 18px;
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius);
  color: var(--muted);
}

/* Table */

.table-wrap {
  margin: 18px 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  overflow: auto;
  -webkit-overflow-scrolling: touch;
}

.table-wrap table {
  width: 100%;
  min-width: 480px;
  border-collapse: collapse;
  font-size: 13.5px;
  line-height: 1.65;
}

.table-wrap th {
  padding: 10px 13px;
  border-bottom: 1px solid var(--border-strong);
  background: var(--surface-2);
  color: var(--text);
  font-weight: 600;
  text-align: left;
  white-space: nowrap;
}

.table-wrap td {
  padding: 10px 13px;
  border-bottom: 1px solid var(--border);
  color: var(--text-2);
  vertical-align: top;
}

.table-wrap tbody tr:last-child td {
  border-bottom: 0;
}

.table-wrap tbody tr:hover td {
  background: color-mix(in srgb, var(--brand-soft) 55%, transparent);
}

.table-wrap td a {
  color: var(--brand);
}

/* Callouts */

.callout {
  margin: 20px 0;
  padding: 13px 16px 13px 17px;
  border-left: 3px solid var(--brand);
  border-radius: 0 10px 10px 0;
  background: var(--brand-soft);
}

.callout-title {
  margin-bottom: 5px;
  color: var(--brand);
  font-size: 13.5px;
  font-weight: 700;
}

.callout p {
  margin: 0;
  font-size: 13.8px;
  line-height: 1.8;
}

.callout p + p {
  margin-top: 6px;
}

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

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

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

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

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

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

/* Fact grid */

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

.fact {
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface-2);
}

.fact-label {
  display: block;
  margin-bottom: 3px;
  color: var(--muted);
  font-size: 11.5px;
}

.fact strong {
  display: block;
  color: var(--text);
  font-size: 14.5px;
  font-weight: 650;
  line-height: 1.45;
}

/* Info cards */

.info-cards {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 18px 0;
}

.info-card {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: inherit;
  text-decoration: none;
  transition: border-color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}

.info-card:hover {
  border-color: var(--brand-border);
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
  text-decoration: none;
}

.info-card.static {
  cursor: default;
}

.info-card.static:hover {
  transform: none;
  box-shadow: none;
  border-color: var(--border);
}

.info-card-title {
  color: var(--text);
  font-size: 14.5px;
  font-weight: 650;
}

.info-card-desc {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.7;
}

/* Steps */

.step-list {
  margin: 16px 0;
  padding: 0;
  list-style: none;
  counter-reset: step;
}

.step-list li {
  counter-increment: step;
  position: relative;
  margin: 14px 0;
  padding-left: 38px;
}

.step-list li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: 1px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--brand-soft);
  color: var(--brand);
  display: grid;
  place-items: center;
  font-size: 11.5px;
  font-weight: 700;
}

.step-list li strong {
  display: block;
  margin-bottom: 2px;
  color: var(--text);
  font-size: 14px;
}

.step-list li p {
  margin: 0;
  color: var(--muted);
  font-size: 13.8px;
  line-height: 1.75;
}

/* Pills & kbd */

.pill-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 14px 0;
}

.pill {
  display: inline-flex;
  align-items: center;
  padding: 5px 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
  font-size: 12.5px;
  text-decoration: none;
  transition: border-color 0.15s ease, color 0.15s ease;
}

.pill:hover {
  border-color: var(--brand-border);
  color: var(--brand);
  text-decoration: none;
}

pre {
  margin: 18px 0;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-2);
  overflow: auto;
  font-size: 12.5px;
  line-height: 1.7;
}

code {
  font-family: var(--font-mono);
}

p code,
li code {
  padding: 1px 5px;
  border-radius: 4px;
  background: var(--surface-2);
  color: var(--brand);
  font-size: 0.9em;
}

/* Map */

.map-shell {
  margin: 22px 0;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--bg-alt);
  overflow: hidden;
  padding: 12px 12px 0;
}

.map-image {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 12px;
}

.map-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 260px;
  padding: 24px;
  border: 1.5px dashed var(--border-strong);
  border-radius: 12px;
  text-align: center;
}

.map-empty .icon {
  width: 34px;
  height: 34px;
  color: var(--muted-2);
}

.map-empty strong {
  color: var(--text-2);
  font-size: 14.5px;
}

.map-empty span {
  color: var(--muted);
  font-size: 12px;
}

.map-caption {
  margin: 0;
  padding: 8px 6px 13px;
  color: var(--muted);
  font-size: 11.5px;
  text-align: center;
}

/* Page nav & doc footer */

.page-nav {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 48px;
}

.page-nav-card {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  text-decoration: none;
  transition: border-color 0.15s ease, transform 0.15s ease;
}

.page-nav-card:hover {
  border-color: var(--brand-border);
  transform: translateY(-1px);
  text-decoration: none;
}

.page-nav-card.next {
  align-items: flex-end;
  text-align: right;
}

.page-nav-card.is-empty {
  visibility: hidden;
}

.page-nav-label {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--muted);
  font-size: 11.5px;
}

.page-nav-label .icon {
  width: 13px;
  height: 13px;
}

.page-nav-card.prev .page-nav-label .icon {
  transform: rotate(180deg);
}

.page-nav-title {
  color: var(--text);
  font-size: 14.5px;
  font-weight: 600;
}

.page-nav-card:hover .page-nav-title {
  color: var(--brand);
}

.page-nav-cat {
  color: var(--muted-2);
  font-size: 11.5px;
}

.doc-footer {
  margin-top: 32px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 12px;
  line-height: 1.75;
}

.doc-footer p {
  margin: 5px 0;
}

.doc-footer a {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--brand);
}

.doc-footer .icon {
  width: 13px;
  height: 13px;
}

.mobile-toc {
  display: none;
  margin: 18px 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-2);
  overflow: hidden;
}

.mobile-toc summary {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 11px 14px;
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  list-style: none;
}

.mobile-toc summary::-webkit-details-marker {
  display: none;
}

.mobile-toc summary span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.mobile-toc summary small {
  margin-left: auto;
  color: var(--muted);
  font-size: 11px;
  font-weight: 500;
}

.mobile-toc summary > .icon {
  color: var(--muted);
  transition: transform 0.18s ease;
}

.mobile-toc[open] summary > .icon {
  transform: rotate(180deg);
}

.mobile-toc .toc-list {
  padding: 6px 12px 12px;
  border-left: 0;
}

.mobile-toc .toc-item a {
  padding: 5px 8px;
}

/* Reading progress & back top */

.reading-progress {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 80;
  height: 2px;
  pointer-events: none;
}

.reading-progress span {
  display: block;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, var(--brand), var(--brand-2));
  transform: scaleX(0);
  transform-origin: 0 50%;
  transition: transform 0.1s linear;
}

.back-top {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 70;
  width: 40px;
  height: 40px;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: var(--surface);
  color: var(--muted);
  box-shadow: var(--shadow-md);
  display: grid;
  place-items: center;
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
  transition: opacity 0.2s ease, transform 0.2s ease, color 0.2s ease;
}

.back-top.is-visible {
  opacity: 1;
  pointer-events: auto;
  transform: none;
}

.back-top:hover {
  color: var(--brand);
}

/* --------------------------------------------------------------------------
   Search modal
   -------------------------------------------------------------------------- */

.search-modal {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: none;
}

.search-modal.is-open {
  display: block;
}

.search-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 18, 28, 0.48);
  -webkit-backdrop-filter: blur(3px);
  backdrop-filter: blur(3px);
}

.search-dialog {
  position: relative;
  max-width: 640px;
  margin: 11vh auto 0;
  border: 1px solid var(--border-strong);
  border-radius: 16px;
  background: var(--surface);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  animation: search-in 0.16s ease-out;
}

@keyframes search-in {
  from { opacity: 0; transform: translateY(-8px) scale(0.99); }
  to { opacity: 1; transform: none; }
}

.search-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 58px;
  padding: 0 14px 0 16px;
  border-bottom: 1px solid var(--border);
}

.search-bar-icon {
  color: var(--muted);
  display: grid;
  place-items: center;
}

.search-bar input {
  flex: 1;
  min-width: 0;
  height: 100%;
  border: 0;
  background: transparent;
  color: var(--text);
  font-size: 15px;
  outline: none;
}

.search-bar input::placeholder {
  color: var(--muted-2);
}

.search-close {
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  display: grid;
  place-items: center;
}

.search-close:hover {
  background: var(--surface-2);
  color: var(--text);
}

.search-close .icon {
  width: 16px;
  height: 16px;
}

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

.search-result {
  display: block;
  padding: 11px 13px;
  border-radius: 9px;
  color: inherit;
  text-decoration: none;
}

.search-result:hover,
.search-result.is-active {
  background: var(--brand-soft);
  text-decoration: none;
}

.sr-top {
  display: flex;
  align-items: center;
  gap: 8px;
}

.sr-cat {
  padding: 1px 7px;
  border-radius: 999px;
  background: var(--brand-soft);
  color: var(--brand);
  font-size: 10.5px;
  line-height: 1.6;
  white-space: nowrap;
}

.sr-title {
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
}

.sr-desc {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-top: 3px;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.65;
}

mark {
  padding: 0 1px;
  border-radius: 2px;
  background: rgba(255, 200, 0, 0.35);
  color: inherit;
}

[data-theme="dark"] mark {
  background: rgba(255, 200, 0, 0.28);
}

.search-footer {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 9px 16px;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 11.5px;
}

.search-footer span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.search-empty {
  padding: 14px;
}

.search-empty-title {
  margin: 6px 0 8px;
  color: var(--muted-2);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.1px;
}

.search-suggestions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  margin-bottom: 16px;
}

.search-suggestion {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 11px;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-size: 13px;
  text-decoration: none;
}

.search-suggestion:hover {
  border-color: var(--brand-border);
  background: var(--brand-soft);
  text-decoration: none;
}

.search-suggestion .icon {
  width: 15px;
  height: 15px;
  color: var(--brand);
}

.search-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.search-tag {
  padding: 5px 11px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
}

.search-tag:hover {
  border-color: var(--brand-border);
  color: var(--brand);
  background: var(--brand-soft);
}

.search-no-result {
  padding: 30px 20px;
  text-align: center;
}

.search-no-result strong {
  display: block;
  margin-bottom: 6px;
  color: var(--text);
  font-size: 14px;
}

.search-no-result p {
  margin: 0;
  color: var(--muted);
  font-size: 12.5px;
}

/* --------------------------------------------------------------------------
   Mobile navigation
   -------------------------------------------------------------------------- */

.mobile-nav {
  position: fixed;
  inset: 0;
  z-index: 200;
  visibility: hidden;
  pointer-events: none;
}

.mobile-nav.is-open {
  visibility: visible;
  pointer-events: auto;
}

.mobile-nav-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 18, 28, 0.45);
  opacity: 0;
  transition: opacity 0.2s ease;
}

.mobile-nav.is-open .mobile-nav-backdrop {
  opacity: 1;
}

.mobile-nav-panel {
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  width: min(340px, 88vw);
  padding: 16px 18px 40px;
  background: var(--surface);
  border-right: 1px solid var(--border);
  overflow-y: auto;
  transform: translateX(-102%);
  transition: transform 0.24s cubic-bezier(0.4, 0, 0.2, 1);
}

.mobile-nav.is-open .mobile-nav-panel {
  transform: none;
}

.mobile-nav-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
}

.mobile-nav-quick {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
}

.mobile-nav-body {
  padding-top: 4px;
}

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

.nav-group-title {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.6px;
}

.nav-group-title .icon {
  width: 14px;
  height: 14px;
  color: var(--brand);
}

.nav-group ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.nav-link {
  display: block;
  padding: 7px 10px;
  border-radius: 7px;
  color: var(--muted);
  font-size: 13.5px;
  text-decoration: none;
}

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

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

/* --------------------------------------------------------------------------
   Footer
   -------------------------------------------------------------------------- */

.site-footer {
  border-top: 1px solid var(--border);
  background: var(--bg-alt);
}

.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 48px 24px 34px;
  display: grid;
  grid-template-columns: 1.6fr 1fr 1fr 1fr;
  gap: 32px;
}

.footer-brand p {
  max-width: 340px;
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.8;
}

.footer-brand .footer-updated {
  margin-top: 8px;
  color: var(--muted-2);
  font-size: 11.5px;
}

.footer-col h3 {
  margin: 0 0 12px;
  color: var(--text);
  font-size: 12.5px;
  font-weight: 700;
}

.footer-col ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.footer-col li {
  margin: 7px 0;
}

.footer-col a {
  color: var(--muted);
  font-size: 13px;
  text-decoration: none;
}

.footer-col a:hover {
  color: var(--brand);
  text-decoration: none;
}

.footer-bottom {
  max-width: 1200px;
  margin: 0 auto;
  padding: 16px 24px 22px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 20px;
  color: var(--muted-2);
  font-size: 11.5px;
}

/* --------------------------------------------------------------------------
   Home
   -------------------------------------------------------------------------- */

.hero {
  position: relative;
  overflow: hidden;
  padding: 96px 24px 88px;
  border-bottom: 1px solid var(--border);
  background:
    radial-gradient(620px 320px at 18% 8%, rgba(52, 81, 178, 0.14), transparent 62%),
    radial-gradient(700px 380px at 82% 0%, rgba(91, 124, 250, 0.13), transparent 64%),
    linear-gradient(180deg, var(--bg) 0%, var(--bg-alt) 100%);
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(to right, var(--grid-line) 1px, transparent 1px),
    linear-gradient(to bottom, var(--grid-line) 1px, transparent 1px);
  background-size: 56px 56px;
  -webkit-mask-image: radial-gradient(ellipse 72% 62% at 50% 30%, #000 20%, transparent 76%);
  mask-image: radial-gradient(ellipse 72% 62% at 50% 30%, #000 20%, transparent 76%);
  pointer-events: none;
}

.hero::after {
  content: "";
  position: absolute;
  left: 50%;
  top: -160px;
  width: 760px;
  height: 420px;
  transform: translateX(-50%);
  border-radius: 50%;
  background: radial-gradient(closest-side, rgba(91, 124, 250, 0.16), transparent);
  filter: blur(20px);
  pointer-events: none;
}

.hero-inner {
  position: relative;
  z-index: 1;
  max-width: 900px;
  margin: 0 auto;
  text-align: center;
}

.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: color-mix(in srgb, var(--surface) 72%, transparent);
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.2px;
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}

.hero-eyebrow::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-soft);
}

.hero-title {
  margin: 22px 0 0;
  color: var(--text);
  font-size: clamp(50px, 8.4vw, 88px);
  line-height: 1.03;
  font-weight: 800;
  letter-spacing: -0.045em;
}

.hero-title .grad {
  background: linear-gradient(100deg, #2f4da8 0%, #5b7cfa 55%, #7ea0ff 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

[data-theme="dark"] .hero-title .grad {
  background: linear-gradient(100deg, #9aa8ff 0%, #c0c9ff 100%);
  -webkit-background-clip: text;
  background-clip: text;
}

.hero-lead {
  max-width: 640px;
  margin: 20px auto 0;
  color: var(--muted);
  font-size: 16.5px;
  line-height: 1.8;
}

.hero-search {
  width: 100%;
  max-width: 640px;
  height: 58px;
  margin: 34px auto 0;
  padding: 0 14px 0 18px;
  border: 1px solid var(--border-strong);
  border-radius: 14px;
  background: var(--surface);
  box-shadow: var(--shadow-md);
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--muted);
  font-size: 14.5px;
  text-align: left;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.hero-search:hover {
  border-color: var(--brand-border);
  box-shadow: var(--shadow-lg);
  transform: translateY(-1px);
}

.hero-search .icon {
  width: 19px;
  height: 19px;
  color: var(--brand);
}

.hero-search .hero-search-text {
  flex: 1;
  min-width: 0;
  color: var(--muted-2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.hero-search kbd {
  font-size: 10.5px;
}

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

.btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 11px 20px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}

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

.btn .icon {
  width: 16px;
  height: 16px;
}

.btn-primary {
  background: var(--brand);
  color: #fff;
  border: 1px solid var(--brand);
  box-shadow: 0 8px 20px rgba(52, 81, 178, 0.22);
}

[data-theme="dark"] .btn-primary {
  color: #12131a;
}

.btn-primary:hover {
  background: #2b46a3;
  border-color: #2b46a3;
  color: #fff;
}

[data-theme="dark"] .btn-primary:hover {
  background: #c0c9ff;
  border-color: #c0c9ff;
  color: #12131a;
}

.btn-ghost {
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--text);
}

.btn-ghost:hover {
  border-color: var(--brand-border);
  color: var(--brand);
}

.hero-stats {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px 28px;
  margin-top: 28px;
  color: var(--muted);
  font-size: 12.5px;
}

.hero-stats span {
  display: inline-flex;
  align-items: baseline;
  gap: 5px;
}

.hero-stats strong {
  color: var(--text);
  font-size: 16px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.hero-quick {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 16px;
}

.quick-chip {
  padding: 4px 11px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: color-mix(in srgb, var(--surface) 70%, transparent);
  color: var(--muted);
  font-size: 12px;
  text-decoration: none;
  transition: border-color 0.15s ease, color 0.15s ease;
}

.quick-chip:hover {
  border-color: var(--brand-border);
  color: var(--brand);
  text-decoration: none;
}

.section {
  padding: 72px 24px;
}

.section.section-alt {
  background: var(--bg-alt);
}

.section-inner {
  max-width: 1200px;
  margin: 0 auto;
}

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

.section-eyebrow {
  margin: 0 0 8px;
  color: var(--brand);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.6px;
  text-transform: uppercase;
}

.section-title {
  margin: 0;
  color: var(--text);
  font-size: 29px;
  font-weight: 750;
  letter-spacing: -0.02em;
  line-height: 1.25;
}

.section-desc {
  max-width: 620px;
  margin: 9px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.75;
}

.section-link {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding-bottom: 3px;
  color: var(--brand);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
}

.section-link:hover {
  text-decoration: none;
  gap: 9px;
}

.section-link .icon {
  width: 14px;
  height: 14px;
  transition: transform 0.15s ease;
}

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

.category-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 9px;
  min-height: 196px;
  padding: 22px 44px 20px 22px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
  color: inherit;
  text-decoration: none;
  overflow: hidden;
  transition: border-color 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
}

.category-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 3px;
  background: linear-gradient(90deg, var(--brand), var(--brand-2));
  opacity: 0;
  transition: opacity 0.18s ease;
}

.category-card:hover {
  border-color: var(--brand-border);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  text-decoration: none;
}

.category-card:hover::before {
  opacity: 1;
}

.category-icon {
  width: 42px;
  height: 42px;
  border-radius: 11px;
  background: var(--brand-soft);
  color: var(--brand);
  display: grid;
  place-items: center;
}

.category-icon .icon {
  width: 21px;
  height: 21px;
}

.category-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 2px;
}

.category-title {
  color: var(--text);
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.category-count {
  padding: 1px 7px;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 500;
}

.category-desc {
  color: var(--muted);
  font-size: 12.8px;
  line-height: 1.7;
}

.category-preview {
  margin-top: auto;
  padding-top: 11px;
  border-top: 1px dashed var(--border);
  color: var(--muted-2);
  font-size: 11.5px;
  line-height: 1.6;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.category-arrow {
  position: absolute;
  right: 18px;
  bottom: 18px;
  color: var(--muted-2);
  opacity: 0.35;
  transition: color 0.18s ease, opacity 0.18s ease, transform 0.18s ease;
}

.category-arrow .icon {
  width: 16px;
  height: 16px;
}

.category-card:hover .category-arrow {
  color: var(--brand);
  opacity: 1;
  transform: translateX(2px);
}

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

.featured-card {
  display: flex;
  flex-direction: column;
  gap: 7px;
  padding: 20px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
  color: inherit;
  text-decoration: none;
  transition: border-color 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
}

.featured-card:hover {
  border-color: var(--brand-border);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  text-decoration: none;
}

.featured-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--muted-2);
}

.featured-top .icon {
  width: 15px;
  height: 15px;
  opacity: 0.5;
  transition: transform 0.15s ease, opacity 0.15s ease;
}

.featured-card:hover .featured-top .icon {
  opacity: 1;
  transform: translateX(2px);
  color: var(--brand);
}

.featured-cat {
  color: var(--brand);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.6px;
}

.featured-card h3 {
  margin: 0;
  color: var(--text);
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.featured-card p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.7;
}

.featured-meta {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-top: auto;
  padding-top: 12px;
  color: var(--muted-2);
  font-size: 11.5px;
}

.featured-meta .icon {
  width: 13px;
  height: 13px;
}

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

.starter-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  color: inherit;
  text-decoration: none;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.starter-item:hover {
  border-color: var(--brand-border);
  background: var(--brand-soft);
  text-decoration: none;
}

.starter-icon {
  width: 36px;
  height: 36px;
  border-radius: 9px;
  background: var(--brand-soft);
  color: var(--brand);
  display: grid;
  place-items: center;
  flex: 0 0 auto;
}

.starter-icon .icon {
  width: 17px;
  height: 17px;
}

.starter-text {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}

.starter-text strong {
  color: var(--text);
  font-size: 13.5px;
  font-weight: 650;
}

.starter-text small {
  color: var(--muted);
  font-size: 11.5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.starter-item > .icon {
  width: 15px;
  height: 15px;
  margin-left: auto;
  color: var(--muted-2);
  opacity: 0.5;
}

.updates-layout {
  display: grid;
  grid-template-columns: 1.45fr 1fr;
  gap: 22px;
}

.updates-panel {
  padding: 22px 24px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--surface);
}

.updates-panel h3 {
  margin: 0 0 4px;
  color: var(--text);
  font-size: 17px;
  font-weight: 700;
}

.updates-panel > p {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 12.5px;
}

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

.updates-list li + li {
  border-top: 1px solid var(--border);
}

.updates-list a {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 11px 4px;
  color: inherit;
  text-decoration: none;
}

.updates-list a:hover {
  text-decoration: none;
}

.updates-list a:hover .update-body strong {
  color: var(--brand);
}

.update-date {
  flex: 0 0 auto;
  color: var(--muted-2);
  font-family: var(--font-mono);
  font-size: 11px;
}

.update-body {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.update-body strong {
  color: var(--text);
  font-size: 13.5px;
  font-weight: 600;
  transition: color 0.15s ease;
}

.update-cat {
  padding: 1px 6px;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 10px;
  white-space: nowrap;
}

.updates-list a > .icon {
  width: 14px;
  height: 14px;
  color: var(--muted-2);
  opacity: 0.5;
}

.updates-cta {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px dashed var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 12.5px;
  color: var(--muted);
}

.updates-cta a {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-weight: 600;
}

.updates-cta .icon {
  width: 13px;
  height: 13px;
}

.contribute-band {
  padding: 0 24px 80px;
}

.contribute-inner {
  position: relative;
  max-width: 1200px;
  margin: 0 auto;
  padding: 38px 40px;
  border-radius: 20px;
  background: linear-gradient(130deg, #243a8a 0%, #3451b2 52%, #4c6fe0 100%);
  color: #fff;
  overflow: hidden;
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 38px;
  align-items: center;
}

.contribute-inner::before {
  content: "";
  position: absolute;
  width: 420px;
  height: 420px;
  right: -80px;
  top: -190px;
  border-radius: 50%;
  background: radial-gradient(closest-side, rgba(255, 255, 255, 0.18), transparent);
}

.contribute-inner::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(to right, rgba(255, 255, 255, 0.06) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255, 255, 255, 0.06) 1px, transparent 1px);
  background-size: 42px 42px;
  -webkit-mask-image: radial-gradient(ellipse at 70% 20%, #000, transparent 72%);
  mask-image: radial-gradient(ellipse at 70% 20%, #000, transparent 72%);
  pointer-events: none;
}

.contribute-copy {
  position: relative;
  z-index: 1;
}

.contribute-copy h2 {
  margin: 0;
  color: #fff;
  font-size: 28px;
  font-weight: 750;
  letter-spacing: -0.02em;
}

.contribute-copy p {
  max-width: 520px;
  margin: 12px 0 0;
  color: rgba(255, 255, 255, 0.78);
  font-size: 14px;
  line-height: 1.8;
}

.contribute-cta {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-top: 20px;
  padding: 10px 18px;
  border-radius: 9px;
  background: #fff;
  color: #2b46a3;
  font-size: 13.5px;
  font-weight: 650;
  text-decoration: none;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.contribute-cta:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.18);
  text-decoration: none;
}

.contribute-cta .icon {
  width: 15px;
  height: 15px;
}

.contribute-ctas {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.contribute-cta-ghost {
  background: transparent;
  color: #fff;
  box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, 0.65);
}

.contribute-steps {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.contribute-step {
  display: flex;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.08);
}

.contribute-step span {
  flex: 0 0 auto;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.16);
  display: grid;
  place-items: center;
  font-size: 11px;
  font-weight: 700;
}

.contribute-step strong {
  display: block;
  font-size: 13px;
  font-weight: 650;
  margin-bottom: 1px;
}

.contribute-step p {
  margin: 0;
  color: rgba(255, 255, 255, 0.72);
  font-size: 11.5px;
  line-height: 1.6;
}

/* Reveal */

.js [data-reveal] {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.js [data-reveal].is-visible {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  .js [data-reveal] {
    opacity: 1;
    transform: none;
    transition: none;
  }
  .search-dialog {
    animation: none;
  }
  .mobile-nav-panel {
    transition: none;
  }
}

/* --------------------------------------------------------------------------
   All entries
   -------------------------------------------------------------------------- */

.all-hero {
  position: relative;
  overflow: hidden;
  padding: 64px 24px 38px;
  border-bottom: 1px solid var(--border);
  background:
    radial-gradient(520px 260px at 12% 0%, rgba(52, 81, 178, 0.1), transparent 65%),
    linear-gradient(180deg, var(--bg) 0%, var(--bg-alt) 100%);
}

.all-hero-inner {
  max-width: 1100px;
  margin: 0 auto;
}

.all-hero h1 {
  margin: 12px 0 8px;
  color: var(--text);
  font-size: 38px;
  font-weight: 750;
  letter-spacing: -0.03em;
  line-height: 1.2;
}

.all-hero p {
  max-width: 640px;
  margin: 0;
  color: var(--muted);
  font-size: 14.5px;
  line-height: 1.8;
}

.all-controls {
  max-width: 1100px;
  margin: 0 auto;
  padding: 24px 24px 0;
}

.filter-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-bottom: 16px;
}

.filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
  font-size: 12.5px;
  transition: border-color 0.15s ease, color 0.15s ease, background 0.15s ease;
}

.filter-chip .icon {
  width: 14px;
  height: 14px;
}

.filter-chip:hover {
  border-color: var(--brand-border);
  color: var(--brand);
}

.filter-chip.active {
  border-color: var(--brand-border);
  background: var(--brand-soft);
  color: var(--brand);
  font-weight: 600;
}

.all-search {
  position: relative;
  max-width: 420px;
}

.all-search .icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  color: var(--muted);
  pointer-events: none;
}

.all-search input {
  width: 100%;
  height: 42px;
  padding: 0 12px 0 38px;
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text);
  font-size: 13.5px;
  outline: none;
  transition: border-color 0.15s ease;
}

.all-search input:focus {
  border-color: var(--brand);
}

.all-count {
  margin: 14px 0 0;
  color: var(--muted-2);
  font-size: 12px;
}

.all-list {
  max-width: 1100px;
  margin: 0 auto;
  padding: 22px 24px 84px;
  display: flex;
  flex-direction: column;
  gap: 30px;
}

.all-section-head {
  display: flex;
  align-items: flex-start;
  gap: 13px;
  margin-bottom: 12px;
}

.all-section-icon {
  flex: 0 0 auto;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: var(--brand-soft);
  color: var(--brand);
  display: grid;
  place-items: center;
  margin-top: 2px;
}

.all-section-icon .icon {
  width: 18px;
  height: 18px;
}

.all-section-head h2 {
  margin: 0;
  color: var(--text);
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.all-section-head p {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.65;
}

.all-section-count {
  margin-left: auto;
  padding: 2px 9px;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 11px;
  white-space: nowrap;
}

.entry-list {
  margin: 0;
  padding: 0;
  list-style: none;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
  overflow: hidden;
}

.entry-list li + li {
  border-top: 1px solid var(--border);
}

.entry-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 14px 18px;
  color: inherit;
  text-decoration: none;
  transition: background 0.15s ease;
}

.entry-row:hover {
  background: var(--surface-2);
  text-decoration: none;
}

.entry-main {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.entry-title {
  color: var(--text);
  font-size: 14.5px;
  font-weight: 650;
  transition: color 0.15s ease;
}

.entry-row:hover .entry-title {
  color: var(--brand);
}

.entry-desc {
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.6;
}

.entry-side {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
}

.entry-updated {
  color: var(--muted-2);
  font-family: var(--font-mono);
  font-size: 10.5px;
}

.entry-side .icon {
  width: 15px;
  height: 15px;
  color: var(--muted-2);
  opacity: 0.6;
  transition: color 0.15s ease, transform 0.15s ease, opacity 0.15s ease;
}

.entry-row:hover .entry-side .icon {
  color: var(--brand);
  opacity: 1;
  transform: translateX(2px);
}

.empty-state {
  padding: 60px 20px;
  border: 1px dashed var(--border-strong);
  border-radius: 14px;
  text-align: center;
}

.empty-state strong {
  display: block;
  color: var(--text);
  font-size: 15px;
}

.empty-state p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13px;
}

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */

@media (max-width: 1280px) {
  .layout {
    grid-template-columns: var(--sidebar-w) minmax(0, 1fr);
  }

  .site-toc {
    display: none;
  }

  .main {
    padding: 36px 52px 96px;
  }

  .main-inner {
    max-width: 820px;
  }
}

@media (max-width: 1024px) {
  .layout {
    display: block;
  }

  .site-sidebar {
    display: none;
  }

  .main {
    padding: 28px 24px 80px;
  }

  .main-inner {
    max-width: 760px;
  }

  .top-nav {
    display: none;
  }

  .menu-toggle {
    display: inline-grid;
  }

  .mobile-toc {
    display: block;
  }

  .hero {
    padding: 80px 24px 72px;
  }

  .hero-title {
    font-size: clamp(48px, 8.6vw, 72px);
  }

  .category-grid,
  .featured-grid,
  .starter-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .footer-inner {
    grid-template-columns: 1.5fr 1fr 1fr;
  }

  .footer-brand {
    grid-column: 1 / -1;
  }
}

@media (max-width: 860px) {
  .updates-layout {
    grid-template-columns: 1fr;
  }

  .contribute-inner {
    grid-template-columns: 1fr;
    gap: 26px;
    padding: 32px 28px;
  }

  .contribute-copy h2 {
    font-size: 25px;
  }

  .section {
    padding: 56px 24px;
  }

  .section-head {
    align-items: flex-start;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 24px;
  }

  .section-title {
    font-size: 25px;
  }

  .page-head h1 {
    font-size: 30px;
  }
}

@media (max-width: 720px) {
  .header-inner {
    gap: 14px;
    padding: 0 16px;
  }

  .search-trigger {
    min-width: 0;
    width: 36px;
    padding: 0;
    justify-content: center;
  }

  .search-trigger-label,
  .search-trigger kbd {
    display: none;
  }

  .search-trigger .icon {
    width: 17px;
    height: 17px;
  }

  .hero {
    padding: 64px 18px 60px;
  }

  .hero-lead {
    font-size: 15px;
  }

  .hero-search {
    height: 52px;
    margin-top: 28px;
    font-size: 13.5px;
  }

  .hero-search .hero-search-text {
    font-size: 13px;
  }

  .hero-search kbd {
    display: none;
  }

  .hero-stats {
    gap: 8px 18px;
    font-size: 12px;
  }

  .hero-stats strong {
    font-size: 14.5px;
  }

  .category-grid,
  .featured-grid,
  .starter-grid {
    grid-template-columns: 1fr;
  }

  .category-card {
    min-height: 0;
  }

  .section {
    padding: 48px 18px;
  }

  .section-title {
    font-size: 23px;
  }

  .footer-inner {
    grid-template-columns: 1fr 1fr;
    padding: 38px 18px 28px;
    gap: 26px;
  }

  .footer-brand {
    grid-column: 1 / -1;
  }

  .footer-bottom {
    padding: 14px 18px 20px;
    flex-direction: column;
    gap: 4px;
  }

  .contribute-band {
    padding: 0 18px 56px;
  }

  .contribute-inner {
    padding: 28px 22px;
    border-radius: 16px;
  }

  .main {
    padding: 22px 18px 64px;
  }

  .page-head h1 {
    font-size: 27px;
  }

  .page-lead {
    font-size: 15px;
  }

  .page-meta {
    margin-bottom: 22px;
  }

  .meta-tags {
    margin-left: 0;
    width: 100%;
  }

  .fact-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .info-cards {
    grid-template-columns: 1fr;
  }

  .article-body h2 {
    margin-top: 36px;
    font-size: 21px;
  }

  .page-nav {
    grid-template-columns: 1fr;
  }

  .page-nav-card.is-empty {
    display: none;
  }

  .page-nav-card.next {
    align-items: flex-start;
    text-align: left;
  }

  .search-dialog {
    margin: 8vh 12px 0;
  }

  .search-suggestions {
    grid-template-columns: 1fr;
  }

  .search-footer {
    display: none;
  }

  .all-hero {
    padding: 48px 18px 30px;
  }

  .all-hero h1 {
    font-size: 31px;
  }

  .all-controls {
    padding: 20px 18px 0;
  }

  .all-list {
    padding: 20px 18px 60px;
  }

  .entry-side .entry-updated {
    display: none;
  }

  .all-section-head p {
    display: none;
  }

  .back-top {
    right: 14px;
    bottom: 14px;
  }
}

@media (max-width: 480px) {
  .brand-text small {
    display: none;
  }

  .brand-text strong {
    font-size: 14.5px;
  }

  .brand-mark {
    width: 32px;
    height: 32px;
  }

  .hero-title {
    font-size: 44px;
  }

  .hero-eyebrow {
    font-size: 11px;
  }

  .hero-actions .btn {
    flex: 1;
    justify-content: center;
  }

  .fact-grid {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }

  .fact {
    padding: 10px 12px;
  }

  .fact strong {
    font-size: 13.5px;
  }

  .footer-inner {
    grid-template-columns: 1fr;
  }

  .update-body {
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
  }

  .update-date {
    display: none;
  }
}
