/* BabianPeak — MDN-style docs site
 * Brand color: #FF6B35 (peak orange)
 * Layout: Top header + left sidebar (doc tree) + main content + right TOC
 * MDN signature: clean white background, dense tree sidebar with no card chrome,
 *   blue links (#0066CC), monospace code blocks with light gray bg, breadcrumb above content.
 */

:root {
  --bp-orange: #FF6B35;
  --bp-orange-2: #E85A24;
  --bp-orange-3: #C84618;
  --bp-orange-tint: #FFF1EB;
  --bp-orange-line: #FFD4BF;

  --bp-bg: #FFFFFF;
  --bp-bg-alt: #F9F9FB;
  --bp-bg-code: #F2F2F2;
  --bp-bg-callout-info: #E8F2FB;
  --bp-bg-callout-warn: #FFF4E5;
  --bp-bg-callout-note: #F5F0FF;

  --bp-text: #1B1B1B;
  --bp-text-2: #4A4A4A;
  --bp-text-mut: #696969;
  --bp-text-soft: #858585;

  --bp-line: #E0E0E0;
  --bp-line-soft: #EDEDED;

  --bp-link: #0066CC;
  --bp-link-hover: #003E78;
  --bp-link-visited: #6B43A2;

  --bp-callout-info-line: #2E7DD7;
  --bp-callout-warn-line: #D97706;
  --bp-callout-note-line: #7C3AED;

  --bp-radius: 4px;
  --bp-radius-md: 6px;
  --bp-radius-lg: 8px;

  --bp-shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.04);
  --bp-shadow-md: 0 4px 12px rgba(0, 0, 0, 0.06);

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

  --bp-header-h: 56px;
  --bp-sidebar-w: 280px;
  --bp-toc-w: 220px;
  --bp-content-max: 800px;
}

[data-theme="dark"] {
  --bp-bg: #1B1B1B;
  --bp-bg-alt: #232323;
  --bp-bg-code: #2A2A2A;
  --bp-bg-callout-info: #1E2B3D;
  --bp-bg-callout-warn: #2D2317;
  --bp-bg-callout-note: #251E36;
  --bp-text: #E5E5E5;
  --bp-text-2: #C4C4C4;
  --bp-text-mut: #9F9F9F;
  --bp-text-soft: #7B7B7B;
  --bp-line: #343434;
  --bp-line-soft: #2A2A2A;
  --bp-link: #5BA8FF;
  --bp-link-hover: #8AC2FF;
  --bp-link-visited: #B89AE6;
  --bp-orange-tint: rgba(255, 107, 53, 0.12);
  --bp-orange-line: rgba(255, 107, 53, 0.32);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body.bp-body {
  font-family: var(--bp-font);
  font-size: 16px;
  line-height: 1.65;
  color: var(--bp-text);
  background: var(--bp-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a { color: var(--bp-link); text-decoration: none; }
a:hover { color: var(--bp-link-hover); text-decoration: underline; text-underline-offset: 2px; }

/* ===== Header (MDN minimal — single row, dense) ===== */
.bp-header {
  position: sticky; top: 0; z-index: 50;
  background: var(--bp-bg);
  border-bottom: 1px solid var(--bp-line);
}
.bp-header__bar { width: 100%; }
.bp-header__inner {
  display: flex; align-items: center; gap: 14px;
  height: var(--bp-header-h);
  max-width: 1600px;
  margin: 0 auto;
  padding: 0 20px;
}
.bp-brand {
  display: inline-flex; align-items: center; gap: 4px;
  color: var(--bp-text);
  font-weight: 600;
  text-decoration: none;
  flex-shrink: 0;
}
.bp-brand:hover { text-decoration: none; color: var(--bp-text); }
.bp-brand__icon { display: inline-flex; align-items: center; }
.bp-brand__name {
  font-size: 17px;
  letter-spacing: -0.01em;
  color: var(--bp-text);
  font-family: var(--bp-mono);
  font-weight: 700;
}
.bp-brand__sub {
  color: var(--bp-text-mut);
  font-family: var(--bp-mono);
  font-size: 17px;
  font-weight: 700;
  margin-left: 1px;
}

.bp-topnav {
  display: flex; align-items: center; gap: 0;
  margin-left: 8px;
}
.bp-topnav__item {
  display: inline-flex; align-items: center;
  height: var(--bp-header-h);
  padding: 0 12px;
  font-size: 14px;
  font-weight: 500;
  color: var(--bp-text);
  text-decoration: none;
  white-space: nowrap;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}
.bp-topnav__item:hover {
  color: var(--bp-orange);
  text-decoration: none;
  border-bottom-color: transparent;
}
.bp-topnav__item.is-active {
  color: var(--bp-orange);
  border-bottom-color: var(--bp-orange);
  font-weight: 600;
}

.bp-search {
  flex: 1;
  max-width: 360px;
  position: relative;
  margin-left: auto;
}
.bp-search__icon {
  position: absolute; left: 10px; top: 50%; transform: translateY(-50%);
  color: var(--bp-text-mut);
}
.bp-search__input {
  width: 100%; height: 32px;
  padding: 0 12px 0 32px;
  border: 1px solid var(--bp-line);
  border-radius: var(--bp-radius);
  background: var(--bp-bg);
  font-size: 13.5px; color: var(--bp-text);
  font-family: inherit;
  transition: border-color .15s, box-shadow .15s;
}
.bp-search__input::placeholder { color: var(--bp-text-mut); }
.bp-search__input:focus {
  outline: none;
  border-color: var(--bp-orange);
  box-shadow: 0 0 0 3px var(--bp-orange-tint);
}

.bp-header__right {
  display: flex; align-items: center; gap: 4px;
  flex-shrink: 0;
}

.bp-icon-btn {
  width: 32px; height: 32px;
  border: 1px solid transparent;
  border-radius: var(--bp-radius);
  background: transparent;
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--bp-text);
  cursor: pointer;
  text-decoration: none;
}
.bp-icon-btn:hover { background: var(--bp-bg-alt); color: var(--bp-orange); }

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

.bp-lang { position: relative; }
.bp-lang__btn {
  display: inline-flex; align-items: center; gap: 4px;
  height: 32px; padding: 0 8px;
  border: 1px solid transparent;
  border-radius: var(--bp-radius);
  background: transparent;
  color: var(--bp-text);
  font-family: inherit; font-size: 13px;
  cursor: pointer;
}
.bp-lang__btn:hover { background: var(--bp-bg-alt); color: var(--bp-orange); }
.bp-lang__cur { font-weight: 500; }
.bp-lang__menu {
  position: absolute; right: 0; top: calc(100% + 4px);
  list-style: none; margin: 0; padding: 6px;
  background: var(--bp-bg);
  border: 1px solid var(--bp-line);
  border-radius: var(--bp-radius-md);
  box-shadow: var(--bp-shadow-md);
  min-width: 160px;
  display: none;
  z-index: 60;
}
.bp-lang:hover .bp-lang__menu,
.bp-lang:focus-within .bp-lang__menu { display: block; }
.bp-lang__menu li { list-style: none; }
.bp-lang__menu a {
  display: block; padding: 6px 10px;
  color: var(--bp-text); font-size: 13px;
  border-radius: var(--bp-radius);
  text-decoration: none;
}
.bp-lang__menu a:hover { background: var(--bp-bg-alt); color: var(--bp-orange); }
.bp-lang__menu a.is-current { color: var(--bp-orange); font-weight: 600; background: var(--bp-orange-tint); }

.bp-mobile-only { display: none; }

/* ===== Shell (sidebar + main) ===== */
.bp-shell {
  display: flex;
  max-width: 1600px;
  margin: 0 auto;
  min-height: calc(100vh - var(--bp-header-h) - 200px);
}

/* ===== Sidebar (MDN-style: tree, dense, no cards) ===== */
.bp-sidebar {
  width: var(--bp-sidebar-w);
  flex-shrink: 0;
  border-right: 1px solid var(--bp-line);
  padding: 0;
  position: sticky;
  top: var(--bp-header-h);
  height: calc(100vh - var(--bp-header-h));
  overflow-y: auto;
  background: var(--bp-bg);
}
.bp-sidebar__filter {
  position: sticky; top: 0;
  background: var(--bp-bg);
  padding: 12px 16px;
  border-bottom: 1px solid var(--bp-line-soft);
  z-index: 1;
}
.bp-sidebar__filter-input {
  width: 100%; height: 32px;
  padding: 0 12px;
  border: 1px solid var(--bp-line);
  border-radius: var(--bp-radius);
  background: var(--bp-bg-alt);
  font-size: 13px; color: var(--bp-text);
  font-family: inherit;
}
.bp-sidebar__filter-input:focus {
  outline: none;
  border-color: var(--bp-orange);
  box-shadow: 0 0 0 3px var(--bp-orange-tint);
  background: var(--bp-bg);
}
.bp-sidebar__inner {
  padding: 12px 8px 60px 8px;
}
.bp-sidebar__group {
  margin-bottom: 4px;
}
.bp-sidebar__heading {
  font-size: 13px;
  font-weight: 700;
  color: var(--bp-text);
  padding: 6px 10px;
  letter-spacing: 0;
  text-transform: none;
}
.bp-sidebar__heading--clickable {
  cursor: pointer;
  display: flex; align-items: center;
  gap: 4px;
  user-select: none;
  border-radius: var(--bp-radius);
}
.bp-sidebar__heading--clickable:hover {
  background: var(--bp-bg-alt);
}
.bp-sidebar__chev {
  color: var(--bp-text-mut);
  display: inline-flex;
  transition: transform .15s;
}
.bp-sidebar__group.is-collapsed .bp-sidebar__chev {
  transform: rotate(-90deg);
}
.bp-sidebar__group.is-collapsed .bp-sidebar__list--inner {
  display: none;
}
.bp-sidebar__list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.bp-sidebar__list--inner {
  padding-left: 18px;
  margin-bottom: 6px;
}
.bp-sidebar__link {
  display: block;
  padding: 4px 10px;
  color: var(--bp-text-2);
  font-size: 13.5px;
  text-decoration: none;
  line-height: 1.45;
  border-radius: var(--bp-radius);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.bp-sidebar__link:hover {
  color: var(--bp-orange);
  text-decoration: none;
  background: var(--bp-bg-alt);
}
.bp-sidebar__link.is-active {
  color: #fff;
  font-weight: 500;
  background: var(--bp-orange);
  position: relative;
}
.bp-sidebar__link.is-active:hover {
  color: #fff;
  background: var(--bp-orange-2);
}
.bp-sidebar__link--cat {
  color: var(--bp-text);
  font-weight: 500;
}

/* ===== Main content area ===== */
.bp-main {
  flex: 1;
  min-width: 0;
  padding: 24px 40px 80px;
}
.bp-main--full {
  padding: 24px 40px 80px;
  max-width: 1100px;
  margin: 0 auto;
}

/* ===== Article (post / page / index) ===== */
.bp-article {
  max-width: 1080px;
}

.bp-crumb {
  font-size: 13px;
  color: var(--bp-text-mut);
  margin-bottom: 12px;
  display: flex; align-items: center; gap: 6px;
  flex-wrap: wrap;
}
.bp-crumb a {
  color: var(--bp-link);
  text-decoration: none;
}
.bp-crumb a:hover { text-decoration: underline; }
.bp-crumb__sep { color: var(--bp-text-mut); display: inline-flex; }
.bp-crumb__current { color: var(--bp-text-mut); }

.bp-article__head {
  border-bottom: 1px solid var(--bp-line);
  padding-bottom: 16px;
  margin-bottom: 20px;
}
.bp-article__h1 {
  font-size: 36px;
  line-height: 1.2;
  font-weight: 700;
  color: var(--bp-text);
  margin: 0 0 12px;
  letter-spacing: -0.012em;
}
.bp-article__lede {
  font-size: 17px;
  color: var(--bp-text-2);
  line-height: 1.55;
  margin: 0 0 12px;
}
.bp-article__meta {
  font-size: 13px;
  color: var(--bp-text-mut);
  display: flex; align-items: center; flex-wrap: wrap; gap: 6px;
}
.bp-article__meta-sep { color: var(--bp-text-soft); }
.bp-chip {
  display: inline-block;
  font-size: 12px;
  color: var(--bp-orange);
  background: var(--bp-orange-tint);
  border: 1px solid var(--bp-orange-line);
  padding: 1px 8px;
  border-radius: 999px;
  text-decoration: none;
}
.bp-chip:hover { color: var(--bp-orange-2); text-decoration: none; }

/* ===== Article body (3-col grid: content + TOC) ===== */
.bp-article__body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) var(--bp-toc-w);
  gap: 48px;
}

/* ===== Prose (main content typography) ===== */
.bp-prose {
  min-width: 0;
  font-size: 16px;
  line-height: 1.7;
  color: var(--bp-text);
  max-width: var(--bp-content-max);
}
.bp-prose h2 {
  font-size: 26px;
  line-height: 1.3;
  font-weight: 600;
  margin: 36px 0 14px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--bp-line);
  letter-spacing: -0.008em;
  scroll-margin-top: calc(var(--bp-header-h) + 16px);
}
.bp-prose h3 {
  font-size: 20px;
  line-height: 1.35;
  font-weight: 600;
  margin: 28px 0 10px;
  scroll-margin-top: calc(var(--bp-header-h) + 16px);
}
.bp-prose h4 {
  font-size: 17px;
  font-weight: 600;
  margin: 24px 0 8px;
}
.bp-prose p { margin: 0 0 16px; }
.bp-prose ul,
.bp-prose ol {
  margin: 0 0 16px;
  padding-left: 24px;
}
.bp-prose li { margin-bottom: 6px; }
.bp-prose li::marker { color: var(--bp-text-mut); }
.bp-prose a {
  color: var(--bp-link);
  text-decoration: underline;
  text-underline-offset: 2px;
  text-decoration-thickness: 1px;
}
.bp-prose a:hover {
  color: var(--bp-link-hover);
  text-decoration-thickness: 2px;
}
.bp-prose strong {
  color: var(--bp-text);
  font-weight: 600;
}

/* MDN-style inline code: light gray background, no border */
.bp-prose code {
  font-family: var(--bp-mono);
  font-size: 0.875em;
  padding: 2px 5px;
  background: var(--bp-bg-code);
  border-radius: var(--bp-radius);
  color: var(--bp-text);
  font-weight: 400;
}
.bp-prose pre {
  font-family: var(--bp-mono);
  font-size: 13.5px;
  line-height: 1.55;
  background: var(--bp-bg-code);
  border: 1px solid var(--bp-line);
  border-radius: var(--bp-radius-md);
  padding: 14px 16px;
  overflow-x: auto;
  margin: 16px 0 20px;
  color: var(--bp-text);
}
.bp-prose pre code {
  padding: 0;
  background: transparent;
  font-size: inherit;
  border-radius: 0;
}

/* MDN-style callout/admonition: blockquote with left bar */
.bp-prose blockquote {
  margin: 18px 0;
  padding: 14px 18px;
  border-left: 4px solid var(--bp-callout-info-line);
  background: var(--bp-bg-callout-info);
  color: var(--bp-text);
  border-radius: 0 var(--bp-radius-md) var(--bp-radius-md) 0;
}
.bp-prose blockquote p:last-child { margin-bottom: 0; }
.bp-prose blockquote p:first-child::before { content: ""; }

/* Tables: clean borders */
.bp-prose table {
  width: 100%;
  border-collapse: collapse;
  margin: 16px 0 20px;
  font-size: 14.5px;
  border: 1px solid var(--bp-line);
}
.bp-prose table th,
.bp-prose table td {
  padding: 8px 12px;
  border: 1px solid var(--bp-line-soft);
  text-align: left;
  vertical-align: top;
}
.bp-prose table th {
  background: var(--bp-bg-alt);
  font-weight: 600;
  font-size: 13.5px;
  color: var(--bp-text);
}
.bp-prose table tr:nth-child(even) td { background: var(--bp-bg-alt); }

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

/* ===== Hero search (index page) ===== */
.bp-hero-search {
  position: relative;
  margin: 8px 0 28px;
  max-width: 640px;
}
.bp-hero-search__icon {
  position: absolute; left: 14px; top: 50%; transform: translateY(-50%);
  color: var(--bp-text-mut);
}
.bp-hero-search__input {
  width: 100%; height: 48px;
  padding: 0 16px 0 42px;
  border: 1px solid var(--bp-line);
  border-radius: var(--bp-radius-md);
  background: var(--bp-bg);
  font-size: 15px; color: var(--bp-text);
  font-family: inherit;
  transition: border-color .15s, box-shadow .15s;
}
.bp-hero-search__input::placeholder { color: var(--bp-text-mut); }
.bp-hero-search__input:focus {
  outline: none;
  border-color: var(--bp-orange);
  box-shadow: 0 0 0 3px var(--bp-orange-tint);
}

/* ===== Card grid (home + tags pages) ===== */
.bp-cardgrid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin: 16px 0 28px;
}
.bp-card {
  display: block;
  border: 1px solid var(--bp-line);
  border-radius: var(--bp-radius-md);
  padding: 18px 20px;
  text-decoration: none;
  color: var(--bp-text);
  background: var(--bp-bg);
  transition: border-color .15s, box-shadow .15s, transform .15s;
}
.bp-card:hover {
  border-color: var(--bp-orange);
  box-shadow: var(--bp-shadow-md);
  text-decoration: none;
  transform: translateY(-1px);
}
.bp-card__title {
  font-size: 16px;
  font-weight: 700;
  color: var(--bp-text);
  margin-bottom: 6px;
}
.bp-card:hover .bp-card__title { color: var(--bp-orange); }
.bp-card__desc {
  font-size: 14px;
  color: var(--bp-text-2);
  line-height: 1.55;
  margin: 0 0 10px;
}
.bp-card__list {
  list-style: none;
  margin: 8px 0 0;
  padding: 0;
  font-size: 13px;
  color: var(--bp-text-2);
}
.bp-card__list li {
  padding: 2px 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.bp-card__bullet {
  color: var(--bp-orange);
  margin-right: 4px;
  font-weight: 600;
}
.bp-card__count {
  font-size: 12.5px;
  color: var(--bp-text-mut);
  margin-top: 8px;
}

/* MDN-style ref list */
.bp-reflist {
  list-style: none;
  margin: 12px 0 24px;
  padding: 0;
}
.bp-reflist li {
  padding: 8px 0;
  border-bottom: 1px solid var(--bp-line-soft);
}
.bp-reflist li a { font-size: 15px; }
.bp-reflist__desc {
  display: inline-block;
  margin-top: 2px;
  font-size: 13.5px;
  color: var(--bp-text-2);
}

/* ===== Post list (latest, posts.njk, tag-page.njk) ===== */
.bp-postlist {
  list-style: none;
  margin: 0 0 28px;
  padding: 0;
}
.bp-postlist__item {
  padding: 14px 0;
  border-bottom: 1px solid var(--bp-line-soft);
}
.bp-postlist__title {
  display: block;
  font-size: 16.5px;
  font-weight: 600;
  color: var(--bp-link);
  margin-bottom: 4px;
  text-decoration: none;
}
.bp-postlist__title:hover { color: var(--bp-link-hover); text-decoration: underline; }
.bp-postlist__meta {
  display: flex; align-items: center;
  gap: 8px;
  margin: 0 0 4px;
  font-size: 12.5px;
  color: var(--bp-text-mut);
}
.bp-postlist__chip {
  font-size: 11.5px;
  color: var(--bp-orange);
  background: var(--bp-orange-tint);
  border: 1px solid var(--bp-orange-line);
  padding: 1px 7px;
  border-radius: 999px;
}
.bp-postlist__desc {
  font-size: 14px;
  color: var(--bp-text-2);
  margin: 4px 0 0;
  line-height: 1.55;
}
.bp-viewall {
  margin-top: 8px;
  font-size: 14.5px;
}
.bp-viewall a { font-weight: 500; }

/* ===== FAQ ===== */
.bp-faq {
  margin: 12px 0 36px;
}
.bp-faq__item {
  border: 1px solid var(--bp-line);
  border-radius: var(--bp-radius-md);
  margin-bottom: 8px;
  background: var(--bp-bg);
}
.bp-faq__item[open] { border-color: var(--bp-orange-line); }
.bp-faq__q {
  padding: 12px 16px;
  font-weight: 600;
  font-size: 15px;
  cursor: pointer;
  list-style: none;
  position: relative;
  padding-right: 38px;
  color: var(--bp-text);
}
.bp-faq__q::after {
  content: "+";
  position: absolute; right: 16px; top: 50%; transform: translateY(-50%);
  color: var(--bp-text-mut);
  font-size: 20px; line-height: 1;
  font-weight: 400;
  transition: color .15s;
}
.bp-faq__item[open] .bp-faq__q::after { content: "−"; color: var(--bp-orange); }
.bp-faq__q::-webkit-details-marker { display: none; }
.bp-faq__a {
  padding: 12px 16px 14px;
  color: var(--bp-text-2);
  font-size: 14.5px;
  line-height: 1.65;
  border-top: 1px solid var(--bp-line-soft);
}
.bp-faq__a p { margin: 0 0 8px; }
.bp-faq__a p:last-child { margin-bottom: 0; }

/* ===== TOC (right sidebar on article pages) ===== */
.bp-toc {
  position: relative;
}
.bp-toc__inner {
  position: sticky;
  top: calc(var(--bp-header-h) + 20px);
  font-size: 13px;
  border-left: 1px solid var(--bp-line);
  padding-left: 20px;
}
.bp-toc__head {
  font-size: 13px;
  font-weight: 700;
  color: var(--bp-text);
  margin-bottom: 10px;
  text-transform: none;
}
.bp-toc__list {
  list-style: none;
  margin: 0 0 18px;
  padding: 0;
}
.bp-toc__list--plain li { padding: 3px 0; }
.bp-toc__item a {
  display: block;
  padding: 4px 0 4px 8px;
  color: var(--bp-text-2);
  text-decoration: none;
  font-size: 13px;
  line-height: 1.5;
  border-left: 2px solid transparent;
  margin-left: -22px;
  padding-left: 24px;
}
.bp-toc__item--lv3 a {
  padding-left: 36px;
  font-size: 12.5px;
  color: var(--bp-text-mut);
}
.bp-toc__item a:hover {
  color: var(--bp-orange);
  text-decoration: none;
  border-left-color: var(--bp-orange-line);
}
.bp-toc__item a.is-active {
  color: var(--bp-orange);
  border-left-color: var(--bp-orange);
  font-weight: 600;
}
.bp-toc__more { margin-top: 18px; }

/* ===== Buttons ===== */
.bp-btn {
  display: inline-flex; align-items: center; gap: 6px;
  height: 36px; padding: 0 14px;
  border: 1px solid var(--bp-line);
  border-radius: var(--bp-radius-md);
  background: var(--bp-bg);
  color: var(--bp-text);
  font-size: 14px;
  font-family: inherit;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
}
.bp-btn:hover {
  border-color: var(--bp-orange);
  color: var(--bp-orange);
  text-decoration: none;
}
.bp-btn--primary {
  background: var(--bp-orange);
  color: #fff;
  border-color: var(--bp-orange);
}
.bp-btn--primary:hover {
  background: var(--bp-orange-2);
  border-color: var(--bp-orange-2);
  color: #fff;
}

/* ===== Prev/Next navigation ===== */
.bp-prevnext {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 40px;
  padding-top: 20px;
  border-top: 1px solid var(--bp-line);
}
.bp-prevnext__item {
  display: flex; flex-direction: column;
  gap: 4px;
  padding: 12px 16px;
  border: 1px solid var(--bp-line);
  border-radius: var(--bp-radius-md);
  text-decoration: none;
  color: var(--bp-text);
  background: var(--bp-bg);
}
.bp-prevnext__item:hover {
  border-color: var(--bp-orange);
  text-decoration: none;
}
.bp-prevnext__lab {
  font-size: 12.5px;
  color: var(--bp-text-mut);
  display: inline-flex; align-items: center; gap: 4px;
}
.bp-prevnext__t {
  font-size: 14.5px;
  font-weight: 600;
  color: var(--bp-link);
  line-height: 1.4;
}
.bp-prevnext__item:hover .bp-prevnext__t { color: var(--bp-orange); }
.bp-prevnext__next {
  text-align: right;
}
.bp-prevnext__next .bp-prevnext__lab {
  justify-content: flex-end;
}

/* ===== Pager ===== */
.bp-pager {
  display: flex; align-items: center; justify-content: center;
  gap: 4px;
  margin: 36px 0 8px;
  flex-wrap: wrap;
}
.bp-pager__btn,
.bp-pager__num {
  display: inline-flex; align-items: center; justify-content: center;
  height: 34px; min-width: 34px;
  padding: 0 11px;
  border: 1px solid var(--bp-line);
  border-radius: var(--bp-radius);
  font-size: 13.5px;
  color: var(--bp-text);
  background: var(--bp-bg);
  text-decoration: none;
}
.bp-pager__btn:hover,
.bp-pager__num:hover {
  border-color: var(--bp-orange);
  color: var(--bp-orange);
  text-decoration: none;
}
.bp-pager__num.is-current {
  background: var(--bp-orange);
  color: #fff;
  border-color: var(--bp-orange);
}
.bp-pager__btn.is-disabled,
.bp-pager__num.is-disabled {
  opacity: 0.4;
  cursor: not-allowed;
  pointer-events: none;
}

/* ===== 404 ===== */
.bp-404 {
  max-width: 480px;
  margin: 80px auto;
  text-align: center;
  padding: 0 22px;
}
.bp-404__code {
  font-size: 96px;
  font-weight: 800;
  color: var(--bp-orange);
  margin-bottom: 12px;
  letter-spacing: -0.04em;
  font-family: var(--bp-mono);
  line-height: 1;
}
.bp-404__title {
  font-size: 24px;
  margin: 0 0 12px;
}
.bp-404__body {
  color: var(--bp-text-2);
  margin: 0 0 24px;
}

/* ===== Footer ===== */
.bp-footer {
  border-top: 1px solid var(--bp-line);
  background: var(--bp-bg-alt);
  margin-top: 60px;
}
.bp-footer__inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 36px 22px 24px;
  display: grid;
  grid-template-columns: 1.4fr 3fr;
  gap: 36px;
}
.bp-footer__brand { }
.bp-footer__logo {
  font-size: 18px; font-weight: 700;
  color: var(--bp-text);
  margin-bottom: 8px;
  font-family: var(--bp-mono);
}
.bp-footer__tag {
  font-size: 13.5px;
  color: var(--bp-text-2);
  margin: 0;
  line-height: 1.55;
}
.bp-footer__cols {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
}
.bp-footer__h {
  font-size: 13px;
  font-weight: 700;
  color: var(--bp-text);
  margin-bottom: 10px;
}
.bp-footer__col ul {
  list-style: none; margin: 0; padding: 0;
}
.bp-footer__col li { margin-bottom: 6px; }
.bp-footer__col a {
  font-size: 13px;
  color: var(--bp-text-2);
  text-decoration: none;
}
.bp-footer__col a:hover { color: var(--bp-orange); text-decoration: underline; }
.bp-footer__lang {
  display: flex; flex-wrap: wrap; gap: 4px 8px;
}
.bp-footer__lang a {
  display: inline-block;
  padding: 1px 4px;
}
.bp-footer__lang a.is-current { color: var(--bp-orange); font-weight: 600; }
.bp-footer__bottom {
  border-top: 1px solid var(--bp-line);
  padding: 16px 22px;
  max-width: 1280px;
  margin: 0 auto;
  display: flex; justify-content: space-between; align-items: flex-start;
  gap: 20px;
  font-size: 12.5px;
  color: var(--bp-text-mut);
  flex-wrap: wrap;
}
.bp-footer__rights { white-space: nowrap; }
.bp-footer__risk { flex: 1; line-height: 1.55; max-width: 760px; }

/* ===== Responsive ===== */
@media (max-width: 1180px) {
  .bp-article__body {
    grid-template-columns: 1fr;
  }
  .bp-toc {
    display: none;
  }
}
@media (max-width: 980px) {
  :root { --bp-sidebar-w: 240px; }
  .bp-cardgrid { grid-template-columns: 1fr; }
  .bp-topnav__item { padding: 0 8px; font-size: 13.5px; }
}
@media (max-width: 800px) {
  .bp-mobile-only { display: inline-flex; }
  .bp-search { display: none; }
  .bp-topnav { display: none; }
  .bp-shell { display: block; }
  .bp-sidebar {
    position: fixed;
    top: var(--bp-header-h);
    left: 0;
    width: 280px;
    height: calc(100vh - var(--bp-header-h));
    background: var(--bp-bg);
    z-index: 40;
    transform: translateX(-100%);
    transition: transform .2s;
    border-right: 1px solid var(--bp-line);
  }
  .bp-sidebar.is-open { transform: translateX(0); }
  .bp-main { padding: 20px 18px 60px; }
  .bp-main--full { padding: 20px 18px 60px; }
  .bp-article__h1 { font-size: 28px; }
  .bp-footer__inner { grid-template-columns: 1fr; }
  .bp-footer__cols { grid-template-columns: repeat(2, 1fr); }
  .bp-prevnext { grid-template-columns: 1fr; }
  .bp-lang__cur { display: none; }
}
