/* BatechiX — Astro Docs style (11_astro), independent visual identity
 * Brand: #7C3AED deep violet, secondary accent #FF8A3D warm orange.
 * Surface in dark mode: deep cosmic purple-ink #0F0A1E with violet/orange hero gradient.
 * Surface in light mode: paper white with subtle lavender wash.
 * Visual signatures (independent from babianpeak / babianvox / babianx):
 *   - Header: thin dark cosmic bar with mono "BATECHIX DOCS" wordmark, version-less, centered
 *     pill search with "/" hotkey badge on the right.
 *   - Hero: large bold serifish H1 + violet→orange gradient blob backdrop with three orbiting
 *     planet/star glyphs; centered hero search; chip row of top categories.
 *   - Section cards: rounded 14px, soft lavender→peach gradient corner glow on hover, hairline
 *     border, large icon top-left, posts list inside, "进入 →" CTA at bottom-right.
 *   - Sidebar: 264px slate panel with chevron group toggles + count chip + filter input on top.
 *   - Article: kicker label above H1 in tracked uppercase orange, large H1, lede in muted ink,
 *     three-column body with 220px right TOC, sticky.
 *   - Code block: deep purple-ink panel with violet language tab strip and copy-button affordance.
 *   - Callout: violet/peach/teal accent stripes on left edge, soft tinted background.
 *   - Footer: dark bar with brand block + 4 columns + risk strip at the bottom.
 *   - Stardust layer: 6 absolute-positioned tiny stars in viewport background.
 */

:root {
  --bx-violet: #7C3AED;
  --bx-violet-2: #6D28D9;
  --bx-violet-3: #5B21B6;
  --bx-violet-4: #4C1D95;
  --bx-violet-5: #2E1065;
  --bx-violet-tint: rgba(124, 58, 237, 0.10);
  --bx-violet-line: rgba(124, 58, 237, 0.32);
  --bx-violet-glow: rgba(124, 58, 237, 0.22);

  --bx-lavender-1: #F5F0FF;
  --bx-lavender-2: #EBE0FF;
  --bx-lavender-3: #DDC9FF;
  --bx-lavender-4: #C9A9FF;

  --bx-orange: #FF8A3D;
  --bx-orange-2: #F97316;
  --bx-orange-3: #EA580C;
  --bx-orange-tint: rgba(255, 138, 61, 0.12);
  --bx-orange-line: rgba(255, 138, 61, 0.28);

  --bx-peach-1: #FFF1E5;
  --bx-peach-2: #FFE0CC;
  --bx-peach-3: #FFCBA8;

  --bx-teal: #14B8A6;
  --bx-teal-line: rgba(20, 184, 166, 0.32);

  --bx-bg: #0F0A1E;
  --bx-bg-2: #150E26;
  --bx-bg-3: #1B1230;
  --bx-bg-card: #19112A;
  --bx-bg-card-2: #1F1736;
  --bx-bg-elev: #20183A;
  --bx-bg-code: #0A0613;
  --bx-bg-code-tab: #14092A;
  --bx-bg-sidebar: #120B22;
  --bx-bg-sidebar-hover: #1B1230;
  --bx-bg-callout-info: #14122A;
  --bx-bg-callout-warn: #2A1B14;
  --bx-bg-callout-tip: #102220;
  --bx-bg-callout-danger: #2A111A;

  --bx-text: #ECE6FA;
  --bx-text-2: #C7BEDD;
  --bx-text-mut: #9E94B8;
  --bx-text-soft: #6F6890;

  --bx-line: #2A1F44;
  --bx-line-2: #221A3A;
  --bx-line-soft: #1A1330;
  --bx-line-strong: #3A2A5C;

  --bx-link: #C9A9FF;
  --bx-link-hover: #E2CCFF;
  --bx-link-visited: #B58BFF;

  --bx-callout-info-line: #7C3AED;
  --bx-callout-warn-line: #FF8A3D;
  --bx-callout-tip-line: #14B8A6;
  --bx-callout-danger-line: #DC2939;

  --bx-radius-xs: 4px;
  --bx-radius-sm: 6px;
  --bx-radius: 8px;
  --bx-radius-md: 10px;
  --bx-radius-lg: 14px;
  --bx-radius-xl: 18px;
  --bx-radius-pill: 999px;

  --bx-shadow-sm: 0 1px 2px rgba(7, 4, 17, 0.55);
  --bx-shadow: 0 6px 22px rgba(7, 4, 17, 0.50);
  --bx-shadow-lg: 0 18px 40px rgba(7, 4, 17, 0.55);
  --bx-shadow-glow: 0 0 0 1px var(--bx-violet-line), 0 0 22px var(--bx-violet-glow);

  --bx-grad-hero: radial-gradient(ellipse 70% 70% at 20% 20%, rgba(124, 58, 237, 0.45), transparent 60%),
                  radial-gradient(ellipse 60% 60% at 90% 30%, rgba(255, 138, 61, 0.30), transparent 65%),
                  radial-gradient(ellipse 50% 50% at 60% 100%, rgba(168, 85, 247, 0.25), transparent 70%);
  --bx-grad-card-hover: linear-gradient(135deg, rgba(124, 58, 237, 0.10) 0%, rgba(255, 138, 61, 0.06) 100%);
  --bx-grad-stripe: linear-gradient(90deg, #7C3AED 0%, #A855F7 50%, #FF8A3D 100%);

  --bx-font: -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", "Noto Sans CJK SC", "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
  --bx-mono: "JetBrains Mono", "SF Mono", ui-monospace, "Menlo", "Cascadia Mono", "Source Code Pro", "Roboto Mono", Consolas, "DejaVu Sans Mono", monospace;

  --bx-header-h: 60px;
  --bx-sidebar-w: 264px;
  --bx-toc-w: 220px;
  --bx-content-max: 760px;
  --bx-shell-max: 1480px;
  --bx-page-pad: 24px;
}

[data-theme="light"] {
  --bx-bg: #FBF8FF;
  --bx-bg-2: #F5EFFF;
  --bx-bg-3: #EDE3FF;
  --bx-bg-card: #FFFFFF;
  --bx-bg-card-2: #FBF8FF;
  --bx-bg-elev: #FFFFFF;
  --bx-bg-code: #1A0F2E;
  --bx-bg-code-tab: #251544;
  --bx-bg-sidebar: #F7F2FF;
  --bx-bg-sidebar-hover: #EFE5FF;
  --bx-bg-callout-info: #F4EEFF;
  --bx-bg-callout-warn: #FFF1E5;
  --bx-bg-callout-tip: #E6FAF6;
  --bx-bg-callout-danger: #FFEBEE;

  --bx-text: #1A0F33;
  --bx-text-2: #3D2D5E;
  --bx-text-mut: #6B5C84;
  --bx-text-soft: #8E80A6;

  --bx-line: #E2D7F4;
  --bx-line-2: #ECE3FA;
  --bx-line-soft: #F3ECFC;
  --bx-line-strong: #D5C6EC;

  --bx-link: #6D28D9;
  --bx-link-hover: #4C1D95;
  --bx-link-visited: #7E3DD7;

  --bx-shadow-sm: 0 1px 2px rgba(60, 30, 110, 0.06);
  --bx-shadow: 0 4px 14px rgba(60, 30, 110, 0.08);
  --bx-shadow-lg: 0 18px 40px rgba(60, 30, 110, 0.12);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body.bx-body {
  font-family: var(--bx-font);
  font-size: 16px;
  line-height: 1.7;
  color: var(--bx-text);
  background: var(--bx-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  position: relative;
  overflow-x: hidden;
}

a { color: var(--bx-link); text-decoration: none; transition: color .15s ease; }
a:hover { color: var(--bx-link-hover); }

img, svg { max-width: 100%; vertical-align: middle; }
button { font-family: inherit; cursor: pointer; }

/* ===== Stardust background layer (Astro signature: cosmic dot scatter) ===== */
.bx-stardust {
  position: fixed; inset: 0;
  pointer-events: none; z-index: 0;
  overflow: hidden;
}
.bx-star {
  position: absolute;
  width: 3px; height: 3px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.65);
  box-shadow: 0 0 8px rgba(168, 85, 247, 0.5);
  opacity: 0.6;
}
.bx-star--1 { top: 12%; left: 8%;  width: 2px; height: 2px; }
.bx-star--2 { top: 22%; right: 14%; width: 4px; height: 4px; }
.bx-star--3 { top: 60%; left: 5%;  width: 2px; height: 2px; }
.bx-star--4 { top: 70%; right: 8%; width: 3px; height: 3px; }
.bx-star--5 { top: 38%; left: 50%; width: 2px; height: 2px; opacity: 0.4; }
.bx-star--6 { bottom: 15%; left: 30%; width: 3px; height: 3px; }
[data-theme="light"] .bx-star {
  background: rgba(124, 58, 237, 0.55);
  box-shadow: 0 0 6px rgba(124, 58, 237, 0.3);
}

/* ===== Header ===== */
.bx-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(15, 10, 30, 0.85);
  backdrop-filter: saturate(140%) blur(12px);
  -webkit-backdrop-filter: saturate(140%) blur(12px);
  border-bottom: 1px solid var(--bx-line);
}
[data-theme="light"] .bx-header {
  background: rgba(251, 248, 255, 0.85);
}
.bx-header__bar { width: 100%; }
.bx-header__inner {
  display: flex; align-items: center; gap: 14px;
  height: var(--bx-header-h);
  max-width: var(--bx-shell-max);
  margin: 0 auto;
  padding: 0 var(--bx-page-pad);
}

.bx-icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 34px; height: 34px;
  border: 1px solid transparent;
  background: transparent;
  border-radius: var(--bx-radius);
  color: var(--bx-text-2);
  transition: background .15s ease, color .15s ease, border-color .15s ease;
}
.bx-icon-btn:hover {
  background: var(--bx-bg-2);
  color: var(--bx-text);
  border-color: var(--bx-line);
}
.bx-mobile-only { display: none; }
.bx-desktop-only { display: inline-flex; }

.bx-brand {
  display: inline-flex; align-items: center; gap: 9px;
  text-decoration: none;
  color: var(--bx-text);
  flex-shrink: 0;
  padding: 4px 0;
}
.bx-brand:hover { color: var(--bx-text); }
.bx-brand__icon {
  width: 28px; height: 28px;
  display: inline-flex; align-items: center; justify-content: center;
  filter: drop-shadow(0 0 6px rgba(124, 58, 237, 0.3));
}
.bx-brand__wm {
  display: inline-flex; align-items: baseline; gap: 5px;
  letter-spacing: -0.4px;
}
.bx-brand__name {
  font-weight: 800;
  font-size: 18px;
  background: var(--bx-grad-stripe);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.bx-brand__sub {
  font-family: var(--bx-mono);
  font-weight: 700;
  font-size: 11px;
  letter-spacing: 1.2px;
  color: var(--bx-violet);
  padding: 2px 6px;
  border: 1px solid var(--bx-violet-line);
  border-radius: var(--bx-radius-xs);
  background: var(--bx-violet-tint);
  text-transform: uppercase;
}

.bx-topnav {
  display: inline-flex; gap: 4px;
  align-items: center;
  margin-left: 8px;
  flex-shrink: 0;
}
.bx-topnav__item {
  display: inline-flex; align-items: center;
  font-size: 14px;
  color: var(--bx-text-2);
  padding: 7px 12px;
  border-radius: var(--bx-radius);
  transition: background .15s ease, color .15s ease;
  white-space: nowrap;
}
.bx-topnav__item:hover {
  background: var(--bx-bg-2);
  color: var(--bx-text);
}
.bx-topnav__item.is-active {
  color: var(--bx-violet);
  background: var(--bx-violet-tint);
}
[data-theme="light"] .bx-topnav__item.is-active {
  color: var(--bx-violet-2);
  background: var(--bx-violet-tint);
}

.bx-search {
  flex: 1;
  max-width: 380px;
  margin: 0 auto;
  position: relative;
  display: flex; align-items: center;
  height: 36px;
  padding: 0 12px 0 32px;
  background: var(--bx-bg-2);
  border: 1px solid var(--bx-line);
  border-radius: var(--bx-radius-pill);
  transition: border-color .15s ease, background .15s ease;
}
.bx-search:focus-within {
  border-color: var(--bx-violet-line);
  background: var(--bx-bg-3);
  box-shadow: 0 0 0 3px var(--bx-violet-tint);
}
.bx-search__icon {
  position: absolute; left: 11px;
  display: inline-flex; align-items: center;
  color: var(--bx-text-mut);
}
.bx-search__input {
  flex: 1;
  background: transparent;
  border: 0; outline: 0;
  color: var(--bx-text);
  font-size: 13.5px;
  font-family: inherit;
}
.bx-search__input::placeholder { color: var(--bx-text-mut); }
.bx-search__kbd {
  font-family: var(--bx-mono);
  font-size: 11px;
  color: var(--bx-text-soft);
  padding: 2px 7px;
  border: 1px solid var(--bx-line);
  border-radius: var(--bx-radius-xs);
  background: var(--bx-bg);
}

.bx-header__right {
  display: inline-flex; align-items: center; gap: 6px;
  margin-left: auto;
  flex-shrink: 0;
}
.bx-header__icon-link {
  display: inline-flex; align-items: center; justify-content: center;
  width: 34px; height: 34px;
  color: var(--bx-text-mut);
  border-radius: var(--bx-radius);
  transition: color .15s ease, background .15s ease;
}
.bx-header__icon-link:hover {
  color: var(--bx-text);
  background: var(--bx-bg-2);
}

.bx-lang { position: relative; }
.bx-lang__btn {
  display: inline-flex; align-items: center; gap: 5px;
  height: 34px;
  padding: 0 10px;
  background: transparent;
  border: 1px solid var(--bx-line);
  border-radius: var(--bx-radius);
  color: var(--bx-text-2);
  font-size: 13px;
  transition: border-color .15s ease, background .15s ease;
}
.bx-lang__btn:hover {
  border-color: var(--bx-violet-line);
  background: var(--bx-bg-2);
}
.bx-lang__cur { font-weight: 600; }
.bx-lang__menu {
  position: absolute; top: calc(100% + 6px); right: 0;
  min-width: 160px;
  background: var(--bx-bg-card);
  border: 1px solid var(--bx-line);
  border-radius: var(--bx-radius-md);
  box-shadow: var(--bx-shadow-lg);
  list-style: none; padding: 6px; margin: 0;
  display: none;
  z-index: 100;
}
.bx-lang:hover .bx-lang__menu,
.bx-lang:focus-within .bx-lang__menu { display: block; }
.bx-lang__menu li { margin: 0; }
.bx-lang__menu a {
  display: block;
  padding: 7px 10px;
  font-size: 13.5px;
  color: var(--bx-text-2);
  border-radius: var(--bx-radius-sm);
}
.bx-lang__menu a:hover { background: var(--bx-bg-2); color: var(--bx-text); }
.bx-lang__menu a.is-current {
  color: var(--bx-violet);
  font-weight: 600;
  background: var(--bx-violet-tint);
}

.bx-theme-toggle .bx-theme-light { display: none; }
.bx-theme-toggle .bx-theme-dark { display: inline-flex; }
[data-theme="dark"] .bx-theme-toggle .bx-theme-light { display: inline-flex; }
[data-theme="dark"] .bx-theme-toggle .bx-theme-dark { display: none; }

/* ===== Shell layout ===== */
.bx-shell {
  display: flex;
  max-width: var(--bx-shell-max);
  margin: 0 auto;
  padding: 0 var(--bx-page-pad);
  position: relative; z-index: 1;
}
.bx-shell--has-sidebar { gap: 32px; }

.bx-sidebar {
  width: var(--bx-sidebar-w);
  flex-shrink: 0;
  position: sticky;
  top: var(--bx-header-h);
  height: calc(100vh - var(--bx-header-h));
  overflow-y: auto;
  padding: 22px 4px 36px 0;
  border-right: 1px solid var(--bx-line);
  scrollbar-width: thin;
  scrollbar-color: var(--bx-line) transparent;
}
.bx-sidebar::-webkit-scrollbar { width: 6px; }
.bx-sidebar::-webkit-scrollbar-track { background: transparent; }
.bx-sidebar::-webkit-scrollbar-thumb { background: var(--bx-line); border-radius: 4px; }

.bx-sidebar__filter {
  position: relative;
  display: flex; align-items: center;
  margin-bottom: 18px;
  margin-right: 8px;
  height: 32px;
  padding: 0 10px 0 28px;
  background: var(--bx-bg-2);
  border: 1px solid var(--bx-line);
  border-radius: var(--bx-radius);
}
.bx-sidebar__filter:focus-within {
  border-color: var(--bx-violet-line);
  background: var(--bx-bg-3);
}
.bx-sidebar__filter-icon {
  position: absolute; left: 9px;
  display: inline-flex; align-items: center;
  color: var(--bx-text-mut);
}
.bx-sidebar__filter-input {
  flex: 1;
  background: transparent;
  border: 0; outline: 0;
  font-size: 13px;
  color: var(--bx-text);
  font-family: inherit;
}
.bx-sidebar__filter-input::placeholder { color: var(--bx-text-mut); }

.bx-sidebar__inner {
  display: flex; flex-direction: column; gap: 4px;
}

.bx-sidebar__group { padding: 4px 0; }
.bx-sidebar__group--root { margin-bottom: 6px; }
.bx-sidebar__heading {
  display: flex; align-items: center; gap: 6px;
  padding: 8px 10px;
  font-size: 13px;
  font-weight: 700;
  color: var(--bx-text);
  letter-spacing: 0.1px;
  user-select: none;
}
.bx-sidebar__heading--plain {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--bx-text-mut);
  text-transform: uppercase;
  letter-spacing: 1.2px;
  padding: 6px 10px 8px;
}
.bx-sidebar__heading--clickable {
  cursor: pointer;
  border-radius: var(--bx-radius);
  transition: background .12s ease;
}
.bx-sidebar__heading--clickable:hover {
  background: var(--bx-bg-sidebar-hover);
}
.bx-sidebar__chev {
  display: inline-flex; align-items: center;
  color: var(--bx-text-mut);
  transition: transform .15s ease;
}
.bx-sidebar__group.is-collapsed .bx-sidebar__chev { transform: rotate(-90deg); }
.bx-sidebar__count {
  margin-left: auto;
  font-family: var(--bx-mono);
  font-size: 10.5px;
  font-weight: 700;
  color: var(--bx-violet);
  padding: 1px 6px;
  background: var(--bx-violet-tint);
  border-radius: var(--bx-radius-pill);
}
.bx-sidebar__list {
  list-style: none; margin: 0; padding: 0;
  display: flex; flex-direction: column; gap: 1px;
}
.bx-sidebar__list--inner {
  margin-left: 14px;
  padding-left: 8px;
  border-left: 1px solid var(--bx-line);
}
.bx-sidebar__group.is-collapsed .bx-sidebar__list--inner { display: none; }
.bx-sidebar__link {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 10px;
  font-size: 13.5px;
  color: var(--bx-text-2);
  border-radius: var(--bx-radius-sm);
  line-height: 1.45;
  transition: background .12s ease, color .12s ease;
}
.bx-sidebar__link:hover {
  background: var(--bx-bg-sidebar-hover);
  color: var(--bx-text);
}
.bx-sidebar__link.is-active {
  background: var(--bx-violet-tint);
  color: var(--bx-violet);
  font-weight: 600;
  box-shadow: inset 2px 0 0 var(--bx-violet);
}
[data-theme="light"] .bx-sidebar__link.is-active {
  color: var(--bx-violet-2);
}
.bx-sidebar__ico {
  display: inline-flex; align-items: center;
  color: var(--bx-text-mut);
  flex-shrink: 0;
}
.bx-sidebar__link.is-active .bx-sidebar__ico { color: var(--bx-violet); }
.bx-sidebar__link--cat {
  font-style: italic;
  font-size: 12.5px;
  color: var(--bx-text-mut);
}

/* ===== Main content area ===== */
.bx-main {
  flex: 1;
  min-width: 0;
  padding: 32px 0 80px;
}
.bx-main--full {
  max-width: var(--bx-shell-max);
  margin: 0 auto;
  padding: 0 var(--bx-page-pad) 80px;
  position: relative; z-index: 1;
}

.bx-article {
  max-width: 100%;
}
.bx-article__head { margin-bottom: 32px; }
.bx-article__kicker {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--bx-mono);
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--bx-orange);
  margin-bottom: 10px;
}
.bx-article__h1 {
  font-size: 42px;
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.8px;
  margin: 0 0 14px;
  color: var(--bx-text);
}
.bx-article__lede {
  font-size: 17px;
  line-height: 1.65;
  color: var(--bx-text-2);
  margin: 0 0 18px;
  max-width: 760px;
}
.bx-article__meta {
  display: flex; align-items: center; flex-wrap: wrap; gap: 8px;
  font-size: 13px;
  color: var(--bx-text-mut);
}
.bx-article__meta-item { display: inline-flex; align-items: center; }
.bx-article__meta-sep { color: var(--bx-text-soft); }
.bx-chip {
  display: inline-flex; align-items: center;
  padding: 2px 9px;
  font-size: 12px;
  background: var(--bx-violet-tint);
  color: var(--bx-violet);
  border-radius: var(--bx-radius-pill);
}
[data-theme="light"] .bx-chip { color: var(--bx-violet-2); }

/* Three column body — center prose + right TOC */
.bx-article__body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) var(--bx-toc-w);
  gap: 40px;
  align-items: start;
}
.bx-prose {
  max-width: var(--bx-content-max);
  font-size: 16px;
  line-height: 1.75;
  color: var(--bx-text);
  width: 100%;
}

/* ===== Breadcrumb ===== */
.bx-crumb {
  display: flex; align-items: center; flex-wrap: wrap; gap: 6px;
  font-size: 13px;
  color: var(--bx-text-mut);
  margin: 18px 0 22px;
}
.bx-crumb a {
  color: var(--bx-text-mut);
  text-decoration: none;
  border-bottom: 1px dashed transparent;
}
.bx-crumb a:hover {
  color: var(--bx-violet);
  border-color: var(--bx-violet-line);
}
.bx-crumb__sep { color: var(--bx-text-soft); }
.bx-crumb__current {
  color: var(--bx-text);
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 60%;
}
.bx-crumb--home { margin-top: 4px; }

/* ===== Hero (home page) ===== */
.bx-hero {
  position: relative;
  padding: 56px 28px 64px;
  margin: 18px 0 40px;
  border-radius: var(--bx-radius-xl);
  background: var(--bx-grad-hero), var(--bx-bg-2);
  border: 1px solid var(--bx-line);
  overflow: hidden;
  text-align: center;
}
.bx-hero__inner {
  position: relative; z-index: 2;
  max-width: 720px;
  margin: 0 auto;
}
.bx-hero__orbit {
  position: absolute; inset: 0;
  pointer-events: none;
  z-index: 1;
}
.bx-hero__planet {
  position: absolute;
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--bx-violet);
  opacity: 0.55;
  filter: drop-shadow(0 0 12px rgba(124, 58, 237, 0.5));
}
.bx-hero__planet--lg {
  top: 8%; right: 8%;
  width: 64px; height: 64px;
  color: var(--bx-orange);
  opacity: 0.65;
  filter: drop-shadow(0 0 16px rgba(255, 138, 61, 0.45));
}
.bx-hero__planet--md {
  bottom: 18%; left: 10%;
  width: 18px; height: 18px;
  color: var(--bx-lavender-4);
  opacity: 0.7;
}
.bx-hero__planet--sm {
  top: 20%; left: 22%;
  width: 28px; height: 28px;
  color: var(--bx-violet);
  opacity: 0.5;
}
.bx-hero__kicker {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--bx-mono);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 1.6px;
  text-transform: uppercase;
  color: var(--bx-orange);
  padding: 5px 12px;
  background: var(--bx-orange-tint);
  border: 1px solid var(--bx-orange-line);
  border-radius: var(--bx-radius-pill);
  margin-bottom: 18px;
}
.bx-hero__h1 {
  font-size: 52px;
  font-weight: 900;
  line-height: 1.10;
  letter-spacing: -1.4px;
  margin: 0 0 16px;
  color: var(--bx-text);
  background: var(--bx-grad-stripe);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
[data-theme="light"] .bx-hero__h1 {
  background: linear-gradient(90deg, #4C1D95 0%, #7C3AED 50%, #EA580C 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
.bx-hero__sub {
  font-size: 17px;
  line-height: 1.65;
  color: var(--bx-text-2);
  margin: 0 0 28px;
  max-width: 560px;
  margin-left: auto;
  margin-right: auto;
}

.bx-hero__search {
  position: relative;
  display: flex; align-items: center;
  height: 50px;
  max-width: 540px;
  margin: 0 auto 22px;
  padding: 0 14px 0 44px;
  background: var(--bx-bg-card);
  border: 1px solid var(--bx-line-strong);
  border-radius: var(--bx-radius-pill);
  box-shadow: var(--bx-shadow-lg);
}
.bx-hero__search:focus-within {
  border-color: var(--bx-violet);
  box-shadow: 0 0 0 4px var(--bx-violet-tint), var(--bx-shadow-lg);
}
.bx-hero__search-icon {
  position: absolute; left: 16px;
  display: inline-flex; align-items: center;
  color: var(--bx-text-mut);
}
.bx-hero__search-input {
  flex: 1;
  background: transparent;
  border: 0; outline: 0;
  color: var(--bx-text);
  font-size: 15px;
  font-family: inherit;
}
.bx-hero__search-input::placeholder { color: var(--bx-text-mut); }
.bx-hero__search-kbd {
  font-family: var(--bx-mono);
  font-size: 11px;
  color: var(--bx-text-mut);
  padding: 3px 8px;
  background: var(--bx-bg-2);
  border: 1px solid var(--bx-line);
  border-radius: var(--bx-radius-xs);
  letter-spacing: 0.5px;
}

.bx-hero__chips {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 8px;
  margin-top: 8px;
}
.bx-hero__chip {
  display: inline-flex; align-items: center;
  padding: 6px 14px;
  font-size: 13px;
  color: var(--bx-text-2);
  background: var(--bx-bg-card);
  border: 1px solid var(--bx-line);
  border-radius: var(--bx-radius-pill);
  transition: all .15s ease;
}
.bx-hero__chip:hover {
  color: var(--bx-violet);
  border-color: var(--bx-violet-line);
  background: var(--bx-violet-tint);
  transform: translateY(-1px);
}

/* ===== Card grid (Astro section cards) ===== */
.bx-cardgrid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 18px;
  margin: 28px 0 32px;
}
.bx-card {
  position: relative;
  display: flex; flex-direction: column;
  padding: 22px 22px 26px;
  background: var(--bx-bg-card);
  border: 1px solid var(--bx-line);
  border-radius: var(--bx-radius-lg);
  text-decoration: none;
  color: var(--bx-text);
  transition: border-color .2s ease, transform .2s ease, box-shadow .2s ease;
  overflow: hidden;
}
.bx-card::before {
  content: "";
  position: absolute; inset: 0;
  background: var(--bx-grad-card-hover);
  opacity: 0;
  transition: opacity .2s ease;
  pointer-events: none;
  border-radius: inherit;
}
.bx-card:hover {
  border-color: var(--bx-violet-line);
  transform: translateY(-3px);
  box-shadow: var(--bx-shadow);
  color: var(--bx-text);
}
.bx-card:hover::before { opacity: 1; }
.bx-card__top {
  display: flex; align-items: center; gap: 12px;
  margin-bottom: 10px;
  position: relative; z-index: 2;
}
.bx-card__icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 38px; height: 38px;
  border-radius: var(--bx-radius-md);
  background: linear-gradient(135deg, var(--bx-violet-tint) 0%, var(--bx-orange-tint) 100%);
  color: var(--bx-violet);
  flex-shrink: 0;
}
.bx-card__title {
  font-size: 17px;
  font-weight: 700;
  color: var(--bx-text);
  letter-spacing: -0.2px;
}
.bx-card__desc {
  font-size: 14px;
  color: var(--bx-text-2);
  line-height: 1.6;
  margin: 0 0 14px;
  position: relative; z-index: 2;
}
.bx-card__list {
  list-style: none; margin: 0 0 14px; padding: 0;
  display: flex; flex-direction: column; gap: 6px;
  position: relative; z-index: 2;
}
.bx-card__list li {
  font-size: 13px;
  color: var(--bx-text-mut);
  display: flex; align-items: baseline; gap: 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.bx-card__bullet {
  color: var(--bx-violet);
  font-weight: 700;
  flex-shrink: 0;
}
.bx-card__count {
  font-family: var(--bx-mono);
  font-size: 12px;
  color: var(--bx-violet);
  font-weight: 600;
  margin-top: auto;
  position: relative; z-index: 2;
}
.bx-card__cta {
  display: inline-flex; align-items: center; gap: 4px;
  margin-top: auto;
  font-size: 13px;
  font-weight: 600;
  color: var(--bx-violet);
  align-self: flex-end;
  position: relative; z-index: 2;
}
[data-theme="light"] .bx-card__cta { color: var(--bx-violet-2); }
.bx-card__arrow {
  display: inline-block;
  transition: transform .2s ease;
}
.bx-card:hover .bx-card__arrow { transform: translateX(3px); }

/* Reflist for "more categories" */
.bx-reflist {
  list-style: none; margin: 18px 0 28px; padding: 18px 22px;
  background: var(--bx-bg-2);
  border: 1px solid var(--bx-line);
  border-radius: var(--bx-radius-lg);
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px 22px;
}
.bx-reflist li {
  font-size: 14px;
  line-height: 1.55;
}
.bx-reflist li a {
  color: var(--bx-violet);
  font-weight: 600;
}
[data-theme="light"] .bx-reflist li a { color: var(--bx-violet-2); }
.bx-reflist__desc {
  font-size: 12.5px;
  color: var(--bx-text-mut);
}

/* ===== Post list (latest / category list) ===== */
.bx-postlist {
  list-style: none; margin: 18px 0 24px; padding: 0;
  display: flex; flex-direction: column;
  border: 1px solid var(--bx-line);
  border-radius: var(--bx-radius-lg);
  overflow: hidden;
  background: var(--bx-bg-card);
}
.bx-postlist__item {
  padding: 16px 20px;
  border-bottom: 1px solid var(--bx-line-soft);
  transition: background .12s ease;
}
.bx-postlist__item:last-child { border-bottom: 0; }
.bx-postlist__item:hover { background: var(--bx-bg-card-2); }
.bx-postlist__title {
  display: block;
  font-size: 16px;
  font-weight: 600;
  color: var(--bx-text);
  margin-bottom: 6px;
  line-height: 1.45;
}
.bx-postlist__title:hover { color: var(--bx-violet); }
.bx-postlist__meta {
  display: flex; align-items: center; flex-wrap: wrap; gap: 8px;
  font-size: 12.5px;
  color: var(--bx-text-mut);
  margin-bottom: 4px;
}
.bx-postlist__date { font-family: var(--bx-mono); }
.bx-postlist__chip {
  padding: 1px 7px;
  background: var(--bx-violet-tint);
  color: var(--bx-violet);
  border-radius: var(--bx-radius-pill);
  font-size: 11.5px;
}
[data-theme="light"] .bx-postlist__chip { color: var(--bx-violet-2); }
.bx-postlist__desc {
  font-size: 13.5px;
  color: var(--bx-text-2);
  margin: 4px 0 0;
  line-height: 1.55;
}
.bx-viewall {
  margin: 14px 0 0;
  text-align: right;
}
.bx-viewall a {
  font-size: 14px;
  font-weight: 600;
  color: var(--bx-violet);
}

/* ===== FAQ ===== */
.bx-faq {
  margin: 18px 0 40px;
  display: flex; flex-direction: column; gap: 10px;
}
.bx-faq__item {
  background: var(--bx-bg-card);
  border: 1px solid var(--bx-line);
  border-radius: var(--bx-radius-md);
  padding: 0;
  overflow: hidden;
  transition: border-color .15s ease;
}
.bx-faq__item[open] {
  border-color: var(--bx-violet-line);
  box-shadow: 0 0 0 3px var(--bx-violet-tint);
}
.bx-faq__q {
  cursor: pointer;
  list-style: none;
  padding: 14px 18px;
  font-size: 15px;
  font-weight: 600;
  color: var(--bx-text);
  display: flex; align-items: center; justify-content: space-between;
  position: relative;
}
.bx-faq__q::-webkit-details-marker { display: none; }
.bx-faq__q::after {
  content: "+";
  font-family: var(--bx-mono);
  font-size: 18px;
  color: var(--bx-violet);
  margin-left: 12px;
  transition: transform .2s ease;
}
.bx-faq__item[open] .bx-faq__q::after { content: "−"; }
.bx-faq__a {
  padding: 0 18px 16px;
  font-size: 14.5px;
  color: var(--bx-text-2);
  line-height: 1.7;
}
.bx-faq__a p { margin: 0 0 8px; }
.bx-faq__a p:last-child { margin: 0; }

/* ===== TOC ===== */
.bx-toc {
  position: sticky;
  top: calc(var(--bx-header-h) + 24px);
  align-self: start;
  max-height: calc(100vh - var(--bx-header-h) - 40px);
  overflow-y: auto;
  padding-right: 4px;
  scrollbar-width: thin;
  scrollbar-color: var(--bx-line) transparent;
}
.bx-toc::-webkit-scrollbar { width: 5px; }
.bx-toc::-webkit-scrollbar-track { background: transparent; }
.bx-toc::-webkit-scrollbar-thumb { background: var(--bx-line); border-radius: 3px; }
.bx-toc__inner { padding-left: 0; }
.bx-toc__head {
  font-family: var(--bx-mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.4px;
  color: var(--bx-text-mut);
  text-transform: uppercase;
  padding: 4px 0 12px;
  border-bottom: 1px solid var(--bx-line);
  margin-bottom: 10px;
}
.bx-toc__head--small { padding-top: 18px; }
.bx-toc__list {
  list-style: none; margin: 0; padding: 0;
  display: flex; flex-direction: column; gap: 1px;
}
.bx-toc__list--plain { gap: 4px; }
.bx-toc__item a {
  display: block;
  padding: 5px 10px 5px 0;
  font-size: 13px;
  color: var(--bx-text-mut);
  border-left: 2px solid transparent;
  padding-left: 10px;
  line-height: 1.45;
  transition: color .12s ease, border-color .12s ease;
}
.bx-toc__item a:hover {
  color: var(--bx-text-2);
}
.bx-toc__item a.is-active {
  color: var(--bx-violet);
  border-left-color: var(--bx-violet);
  font-weight: 600;
}
.bx-toc__item--lv3 a { padding-left: 22px; font-size: 12.5px; }
.bx-toc__more { margin-top: 14px; }

/* ===== Prose (article body markdown content) ===== */
.bx-prose h2,
.bx-prose h3,
.bx-prose h4 {
  color: var(--bx-text);
  font-weight: 700;
  letter-spacing: -0.4px;
  scroll-margin-top: calc(var(--bx-header-h) + 16px);
}
.bx-prose h2 {
  font-size: 26px;
  margin: 42px 0 14px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--bx-line);
  position: relative;
}
.bx-prose h2::before {
  content: "";
  position: absolute;
  left: -14px;
  top: 12px;
  width: 6px;
  height: 18px;
  background: var(--bx-grad-stripe);
  border-radius: 2px;
}
.bx-prose h3 {
  font-size: 19px;
  margin: 30px 0 10px;
}
.bx-prose h4 {
  font-size: 16px;
  margin: 22px 0 8px;
}
.bx-prose p {
  margin: 0 0 14px;
}
.bx-prose ul,
.bx-prose ol {
  margin: 0 0 14px;
  padding-left: 26px;
}
.bx-prose ul li,
.bx-prose ol li {
  margin: 6px 0;
  line-height: 1.7;
}
.bx-prose ul li::marker { color: var(--bx-violet); }
.bx-prose ol li::marker { color: var(--bx-violet); font-weight: 700; }
.bx-prose a {
  color: var(--bx-link);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: var(--bx-violet-line);
  transition: color .12s ease, text-decoration-color .12s ease;
}
.bx-prose a:hover {
  color: var(--bx-link-hover);
  text-decoration-color: var(--bx-violet);
}
.bx-prose strong { color: var(--bx-text); font-weight: 700; }
.bx-prose em { color: var(--bx-text-2); }
.bx-prose blockquote {
  margin: 18px 0;
  padding: 14px 18px;
  border-left: 3px solid var(--bx-violet);
  background: var(--bx-bg-callout-info);
  border-radius: 0 var(--bx-radius-md) var(--bx-radius-md) 0;
  color: var(--bx-text-2);
  font-size: 14.5px;
}
.bx-prose blockquote p:last-child { margin-bottom: 0; }
.bx-prose hr {
  border: 0;
  border-top: 1px solid var(--bx-line);
  margin: 28px 0;
}
.bx-prose code {
  font-family: var(--bx-mono);
  font-size: 0.88em;
  padding: 2px 6px;
  background: var(--bx-bg-2);
  border: 1px solid var(--bx-line-soft);
  border-radius: var(--bx-radius-xs);
  color: var(--bx-orange);
}
[data-theme="light"] .bx-prose code { color: var(--bx-violet-2); }
.bx-prose pre {
  position: relative;
  margin: 18px 0;
  padding: 16px 18px;
  background: var(--bx-bg-code);
  color: #E0DAF5;
  border-radius: var(--bx-radius-md);
  border: 1px solid var(--bx-violet-line);
  overflow-x: auto;
  font-size: 13.5px;
  line-height: 1.65;
}
.bx-prose pre::before {
  content: "BatechiX";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 26px;
  padding: 5px 14px;
  font-family: var(--bx-mono);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 1.4px;
  text-transform: uppercase;
  color: var(--bx-orange);
  background: var(--bx-bg-code-tab);
  border-bottom: 1px solid var(--bx-violet-line);
  border-radius: var(--bx-radius-md) var(--bx-radius-md) 0 0;
}
.bx-prose pre {
  padding-top: 38px;
}
.bx-prose pre code {
  background: transparent;
  border: 0;
  padding: 0;
  color: inherit;
  font-size: inherit;
}
.bx-prose img {
  display: block;
  margin: 18px auto;
  max-width: 100%;
  border-radius: var(--bx-radius-md);
}
.bx-prose table {
  width: 100%;
  margin: 18px 0;
  border-collapse: collapse;
  font-size: 14px;
  background: var(--bx-bg-card);
  border: 1px solid var(--bx-line);
  border-radius: var(--bx-radius-md);
  overflow: hidden;
}
.bx-prose table th,
.bx-prose table td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--bx-line-soft);
  text-align: left;
  vertical-align: top;
}
.bx-prose table th {
  background: var(--bx-bg-2);
  color: var(--bx-text);
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.2px;
  border-bottom: 1px solid var(--bx-line);
}
.bx-prose table tr:last-child td { border-bottom: 0; }
.bx-prose table tr:hover td { background: var(--bx-bg-2); }

/* ===== Prev/Next ===== */
.bx-prevnext {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin: 48px 0 0;
  padding-top: 28px;
  border-top: 1px solid var(--bx-line);
}
.bx-prevnext__item {
  display: flex; flex-direction: column; gap: 4px;
  padding: 14px 18px;
  background: var(--bx-bg-card);
  border: 1px solid var(--bx-line);
  border-radius: var(--bx-radius-md);
  text-decoration: none;
  transition: border-color .15s ease, transform .15s ease;
  min-height: 64px;
}
.bx-prevnext__item:hover {
  border-color: var(--bx-violet-line);
  transform: translateY(-2px);
}
.bx-prevnext__next { text-align: right; align-items: flex-end; }
.bx-prevnext__lab {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px;
  color: var(--bx-text-mut);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  font-family: var(--bx-mono);
}
.bx-prevnext__t {
  font-size: 14.5px;
  font-weight: 600;
  color: var(--bx-text);
  line-height: 1.4;
}

/* ===== Pager ===== */
.bx-pager {
  display: flex; align-items: center; justify-content: center;
  flex-wrap: wrap; gap: 6px;
  margin: 28px 0 0;
}
.bx-pager__btn,
.bx-pager__num {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 36px;
  height: 36px;
  padding: 0 12px;
  font-size: 13.5px;
  border: 1px solid var(--bx-line);
  background: var(--bx-bg-card);
  color: var(--bx-text-2);
  border-radius: var(--bx-radius);
  text-decoration: none;
  transition: border-color .15s ease, color .15s ease, background .15s ease;
}
.bx-pager__btn:hover,
.bx-pager__num:hover {
  border-color: var(--bx-violet-line);
  color: var(--bx-violet);
  background: var(--bx-violet-tint);
}
.bx-pager__num.is-current {
  background: var(--bx-violet);
  color: #fff;
  border-color: var(--bx-violet);
}
.bx-pager__btn.is-disabled,
.bx-pager__num.is-disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

/* ===== Footer ===== */
.bx-footer {
  position: relative; z-index: 1;
  margin-top: 80px;
  background: linear-gradient(180deg, var(--bx-bg) 0%, var(--bx-bg-2) 100%);
  border-top: 1px solid var(--bx-line);
}
.bx-footer__inner {
  max-width: var(--bx-shell-max);
  margin: 0 auto;
  padding: 48px var(--bx-page-pad) 32px;
  display: grid;
  grid-template-columns: minmax(260px, 320px) 1fr;
  gap: 48px;
}
.bx-footer__brand { }
.bx-footer__logo {
  display: inline-flex; align-items: center; gap: 10px;
  margin-bottom: 12px;
}
.bx-footer__logo-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 32px; height: 32px;
  filter: drop-shadow(0 0 6px rgba(124, 58, 237, 0.3));
}
.bx-footer__logo-text {
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.4px;
  background: var(--bx-grad-stripe);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.bx-footer__tag {
  font-size: 13.5px;
  color: var(--bx-text-mut);
  line-height: 1.7;
  margin: 0 0 14px;
  max-width: 320px;
}
.bx-footer__badges {
  display: flex; flex-wrap: wrap; gap: 6px;
}
.bx-footer__badge {
  font-family: var(--bx-mono);
  font-size: 11px;
  font-weight: 700;
  color: var(--bx-violet);
  background: var(--bx-violet-tint);
  border: 1px solid var(--bx-violet-line);
  padding: 3px 10px;
  border-radius: var(--bx-radius-pill);
  letter-spacing: 0.4px;
}
.bx-footer__cols {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
}
.bx-footer__col ul {
  list-style: none; margin: 0; padding: 0;
  display: flex; flex-direction: column; gap: 6px;
}
.bx-footer__col li a {
  font-size: 13px;
  color: var(--bx-text-mut);
}
.bx-footer__col li a:hover {
  color: var(--bx-violet);
}
.bx-footer__h {
  font-family: var(--bx-mono);
  font-size: 11px;
  font-weight: 700;
  color: var(--bx-text);
  letter-spacing: 1.4px;
  text-transform: uppercase;
  margin-bottom: 12px;
}
.bx-footer__lang {
  display: grid !important;
  grid-template-columns: repeat(2, 1fr);
  gap: 4px 12px !important;
}
.bx-footer__lang a.is-current {
  color: var(--bx-violet);
  font-weight: 600;
}
.bx-footer__bottom {
  max-width: var(--bx-shell-max);
  margin: 0 auto;
  padding: 18px var(--bx-page-pad) 28px;
  border-top: 1px solid var(--bx-line);
  display: flex; flex-direction: column; gap: 8px;
}
.bx-footer__rights {
  font-family: var(--bx-mono);
  font-size: 12px;
  color: var(--bx-text-mut);
}
.bx-footer__risk {
  font-size: 12px;
  color: var(--bx-text-soft);
  line-height: 1.65;
}

/* ===== Buttons ===== */
.bx-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 10px 18px;
  font-size: 14px;
  font-weight: 600;
  border-radius: var(--bx-radius-pill);
  text-decoration: none;
  transition: all .15s ease;
  border: 1px solid transparent;
  cursor: pointer;
  font-family: inherit;
}
.bx-btn--primary {
  background: var(--bx-grad-stripe);
  color: #fff;
  box-shadow: var(--bx-shadow);
}
.bx-btn--primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 24px rgba(124, 58, 237, 0.4);
  color: #fff;
}
.bx-btn--ghost {
  background: transparent;
  color: var(--bx-text-2);
  border-color: var(--bx-line);
}
.bx-btn--ghost:hover {
  background: var(--bx-bg-2);
  color: var(--bx-violet);
  border-color: var(--bx-violet-line);
}

/* ===== Callouts (markdown-rendered blockquote-like) ===== */
.bx-callout {
  margin: 18px 0;
  padding: 14px 18px;
  border-radius: var(--bx-radius-md);
  border-left: 3px solid var(--bx-callout-info-line);
  background: var(--bx-bg-callout-info);
  font-size: 14.5px;
}
.bx-callout--warn {
  border-left-color: var(--bx-callout-warn-line);
  background: var(--bx-bg-callout-warn);
}
.bx-callout--tip {
  border-left-color: var(--bx-callout-tip-line);
  background: var(--bx-bg-callout-tip);
}
.bx-callout--danger {
  border-left-color: var(--bx-callout-danger-line);
  background: var(--bx-bg-callout-danger);
}

/* ===== 404 ===== */
.bx-404 {
  max-width: 540px;
  margin: 80px auto;
  padding: 0 var(--bx-page-pad);
  text-align: center;
  position: relative; z-index: 1;
}
.bx-404__planet {
  display: inline-flex; align-items: center; justify-content: center;
  width: 96px; height: 96px;
  margin: 0 auto 16px;
  color: var(--bx-violet);
  filter: drop-shadow(0 0 22px rgba(124, 58, 237, 0.5));
  opacity: 0.85;
}
.bx-404__code {
  font-family: var(--bx-mono);
  font-size: 96px;
  font-weight: 900;
  line-height: 1;
  letter-spacing: -2px;
  background: var(--bx-grad-stripe);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 8px;
}
.bx-404__title {
  font-size: 22px;
  font-weight: 700;
  margin: 0 0 8px;
  color: var(--bx-text);
}
.bx-404__body {
  color: var(--bx-text-2);
  margin: 0 0 22px;
  font-size: 14.5px;
}

/* ===== Responsive ===== */
@media (max-width: 1280px) {
  :root {
    --bx-toc-w: 200px;
    --bx-content-max: 720px;
  }
}

@media (max-width: 1100px) {
  .bx-article__body {
    grid-template-columns: minmax(0, 1fr);
  }
  .bx-toc {
    display: none;
  }
  :root {
    --bx-content-max: 100%;
  }
}

@media (max-width: 960px) {
  :root {
    --bx-page-pad: 18px;
    --bx-sidebar-w: 240px;
  }
  .bx-topnav__item:nth-child(n+3) { display: none; }
  .bx-search { max-width: 240px; }
}

@media (max-width: 820px) {
  .bx-mobile-only { display: inline-flex; }
  .bx-desktop-only { display: none; }
  .bx-topnav { display: none; }
  .bx-shell--has-sidebar {
    display: block;
  }
  .bx-sidebar {
    position: fixed;
    top: var(--bx-header-h);
    left: 0;
    width: 86%; max-width: 320px;
    height: calc(100vh - var(--bx-header-h));
    background: var(--bx-bg);
    z-index: 40;
    border-right: 1px solid var(--bx-line);
    transform: translateX(-100%);
    transition: transform .25s ease;
    padding: 18px 12px 36px;
  }
  .bx-sidebar.is-open { transform: translateX(0); }
  body.bx-nav-open { overflow: hidden; }
  .bx-main { padding: 24px 0 60px; }
  .bx-cardgrid { grid-template-columns: 1fr; }
  .bx-reflist { grid-template-columns: 1fr; }
  .bx-footer__inner {
    grid-template-columns: 1fr;
    gap: 32px;
  }
  .bx-footer__cols { grid-template-columns: repeat(2, 1fr); }
  .bx-hero {
    padding: 40px 18px 44px;
    margin: 12px 0 28px;
  }
  .bx-hero__h1 { font-size: 36px; }
  .bx-hero__sub { font-size: 15px; }
  .bx-hero__planet--lg { width: 44px; height: 44px; }
  .bx-article__h1 { font-size: 30px; }
  .bx-prevnext { grid-template-columns: 1fr; }
  .bx-search__kbd { display: none; }
}

@media (max-width: 540px) {
  :root {
    --bx-page-pad: 14px;
  }
  .bx-brand__sub { display: none; }
  .bx-brand__name { font-size: 16px; }
  .bx-search { display: none; }
  .bx-hero { padding: 32px 14px 36px; border-radius: var(--bx-radius-lg); }
  .bx-hero__h1 { font-size: 30px; letter-spacing: -1px; }
  .bx-hero__kicker { font-size: 11px; padding: 4px 10px; }
  .bx-hero__search { height: 44px; padding: 0 12px 0 38px; }
  .bx-hero__search-icon { left: 13px; }
  .bx-card { padding: 18px; }
  .bx-card__title { font-size: 15.5px; }
  .bx-article__h1 { font-size: 26px; }
  .bx-prose h2 { font-size: 22px; }
  .bx-prose h3 { font-size: 17px; }
  .bx-footer__cols { grid-template-columns: 1fr; }
  .bx-404__code { font-size: 72px; }
}

/* ===== Print ===== */
@media print {
  .bx-header, .bx-sidebar, .bx-toc, .bx-footer, .bx-prevnext, .bx-pager,
  .bx-stardust, .bx-search, .bx-hero__orbit { display: none !important; }
  body.bx-body { background: #fff; color: #000; }
  .bx-prose { max-width: 100%; }
  .bx-shell { display: block; padding: 0; }
  .bx-main { padding: 0; }
  .bx-prose pre { background: #f5f5f5; color: #000; border: 1px solid #ccc; }
  .bx-prose pre::before { display: none; }
}

/* ===== Misc utilities ===== */
.bx-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;
}

/* Selection */
::selection {
  background: rgba(124, 58, 237, 0.35);
  color: #fff;
}
[data-theme="light"] ::selection {
  background: rgba(124, 58, 237, 0.25);
  color: var(--bx-text);
}

/* Focus ring for accessibility */
a:focus-visible,
button:focus-visible,
input:focus-visible,
.bx-card:focus-visible {
  outline: 2px solid var(--bx-violet);
  outline-offset: 2px;
}

/* Scrollbar global */
* {
  scrollbar-width: thin;
  scrollbar-color: var(--bx-line-strong) transparent;
}
*::-webkit-scrollbar { width: 8px; height: 8px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb { background: var(--bx-line-strong); border-radius: 4px; }
*::-webkit-scrollbar-thumb:hover { background: var(--bx-violet-line); }
