:root {
  --font-geist-sans: "Geist", "PingFang SC", "Microsoft YaHei", sans-serif;
  --font-geist-mono: "Geist Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  --ink: #172534;
  --muted: #627080;
  --line: #d9e0e7;
  --paper: #fffdf8;
  --paper-deep: #f3f0e8;
  --cyan: #0b91ab;
  --cyan-soft: #dff5ff;
  --amber: #e49b08;
  --amber-soft: #fff0cb;
  --red: #dc4139;
  --red-soft: #ffe8e4;
}

@font-face {
  font-family: "Geist";
  src: url("/fonts/geist-sans-variable.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Geist Mono";
  src: url("/fonts/geist-mono-variable.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background:
    linear-gradient(rgba(23, 37, 52, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(23, 37, 52, 0.025) 1px, transparent 1px),
    var(--paper);
  background-size: 32px 32px;
  color: var(--ink);
  font-family:
    var(--font-geist-sans), "PingFang SC", "Microsoft YaHei", sans-serif;
}

button,
input {
  font: inherit;
}

a {
  color: inherit;
  text-decoration: none;
}

.bm-page {
  --bm-ink: #172534;
  --bm-muted: #627080;
  --bm-line: #d9e0e7;
  --bm-paper: #fffdf8;
  --bm-paper-deep: #f3f0e8;
  --bm-cyan: #0b91ab;
  --bm-cyan-soft: #dff5ff;
  --bm-amber: #e49b08;
  --bm-amber-soft: #fff0cb;
  --bm-red: #dc4139;
  --bm-red-soft: #ffe8e4;
  min-height: 100vh;
  color: var(--bm-ink);
  font-family: var(--font-geist-sans), "PingFang SC", "Microsoft YaHei", sans-serif;
}

.bm-page *, .bm-page *::before, .bm-page *::after { box-sizing: border-box; }
.bm-page a { color: inherit; }
.bm-page code, .bm-page pre { font-family: var(--font-geist-mono), monospace; }

.bm-subhead {
  margin: 56px 0 16px;
  scroll-margin-top: 96px;
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: clamp(24px, 3vw, 32px);
  line-height: 1.15;
  letter-spacing: -0.02em;
  color: var(--bm-ink);
}

.bm-subhead::before {
  content: "";
  width: 12px;
  height: 12px;
  background: var(--bm-cyan);
  border-radius: 3px;
  flex: none;
}

.bm-layout {
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr);
  gap: 44px;
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 24px;
}

.bm-toc {
  position: sticky;
  top: 108px;
  align-self: start;
  display: flex;
  flex-direction: column;
  gap: 3px;
  max-height: calc(100vh - 130px);
  overflow: auto;
  padding: 18px 16px;
  border: 1px solid var(--bm-line);
  border-radius: 16px;
  background: rgba(255, 253, 248, 0.86);
  backdrop-filter: blur(8px);
  scrollbar-width: thin;
}

.bm-toc-kicker {
  margin: 0 0 10px;
  padding: 0 8px;
  color: var(--bm-muted);
  font: 850 10px var(--font-geist-mono), monospace;
  letter-spacing: 0.12em;
}

.bm-toc a {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 7px 8px;
  border-radius: 9px;
  color: var(--bm-muted);
  font-size: 13px;
  line-height: 1.4;
  text-decoration: none;
  transition: background-color 160ms ease, color 160ms ease;
}

.bm-toc a span {
  flex: none;
  color: var(--bm-cyan);
  font: 800 10px var(--font-geist-mono), monospace;
}

.bm-toc a.sub {
  padding-left: 26px;
  font-size: 12px;
}

.bm-toc a.sub::before {
  content: "—";
  flex: none;
  color: var(--bm-amber);
  font-size: 11px;
}

.bm-toc a:hover {
  background: var(--bm-cyan-soft);
  color: var(--bm-ink);
}

.bm-table-wrap {
  margin: 18px 0 28px;
  overflow-x: auto;
  border: 1px solid var(--bm-line);
  border-radius: 14px;
  background: #fff;
}

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

.bm-table th {
  padding: 12px 16px;
  text-align: left;
  background: var(--bm-cyan-soft);
  color: var(--bm-ink);
  font-size: 13px;
  white-space: nowrap;
}

.bm-table td {
  padding: 11px 16px;
  border-top: 1px solid var(--bm-line);
  vertical-align: top;
}

.bm-table td:first-child {
  font-weight: 800;
  white-space: nowrap;
}

.bm-topbar {
  position: sticky;
  z-index: 40;
  top: 0;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  height: 86px;
  padding: 0 max(20px, calc((100vw - 1120px) / 2));
  border-bottom: 1px solid rgba(23, 37, 52, .15);
  background: rgba(255, 253, 248, .9);
  backdrop-filter: blur(16px);
}
.bm-brand { font: 800 13px var(--font-geist-mono), monospace; letter-spacing: .16em; text-decoration: none; }
.bm-brand span { color: var(--bm-cyan); }
.bm-topbar nav { display: flex; gap: 27px; color: var(--bm-muted); font-size: 13px; }
.bm-topbar nav a, .bm-back { text-decoration: none; }
.bm-topbar nav a:hover, .bm-back:hover { color: var(--bm-cyan); }
.bm-back { justify-self: end; padding: 9px 13px; border: 1px solid #aeb7c1; border-radius: 8px; font-size: 12px; }

.bm-hero {
  min-height: 700px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 90px max(20px, calc((100vw - 1120px) / 2));
  border-bottom: 1px solid var(--bm-line);
  background:
    radial-gradient(circle at 83% 24%, rgba(12, 145, 171, .18), transparent 23%),
    linear-gradient(135deg, #fffdf8 0%, #f6f4ed 58%, #edf8f8 100%);
}
.bm-kicker, .bm-section-head > p {
  margin: 0 0 18px;
  color: var(--bm-cyan);
  font: 800 12px var(--font-geist-mono), monospace;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.bm-hero h1 { max-width: 920px; margin: 0; font-size: clamp(70px, 10vw, 132px); line-height: .88; letter-spacing: -.07em; }
.bm-lead { max-width: 750px; margin: 38px 0 0; color: #475565; font-size: clamp(18px, 2vw, 24px); line-height: 1.75; }
.bm-route { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 44px; }
.bm-route span, .bm-route strong { min-height: 42px; display: inline-flex; align-items: center; padding: 0 14px; border: 1px solid var(--bm-line); border-radius: 8px; background: rgba(255,255,255,.74); font-size: 12px; }
.bm-route strong { border-color: var(--bm-ink); background: var(--bm-ink); color: white; }
.bm-route i { color: var(--bm-cyan); font-style: normal; }

.bm-section {
  width: min(1120px, calc(100% - 40px));
  margin-inline: auto;
  padding: 92px 0;
  scroll-margin-top: 86px;
  border-bottom: 1px solid var(--bm-line);
}
.bm-section.bm-paper, .bm-section.bm-dark { background: transparent; color: var(--bm-ink); }
.bm-section-head { margin-bottom: 46px; }
.bm-section-head > p { display: inline-flex; align-items: center; min-height: 32px; padding: 0 12px; border: 1px solid #addde5; border-radius: 999px; background: var(--bm-cyan-soft); }
.bm-section-head h2 { margin: 0; font-size: clamp(42px, 6vw, 76px); line-height: 1; letter-spacing: -.045em; }
.bm-prose { max-width: 780px; color: #405061; font-size: 18px; line-height: 2; }
.bm-prose p { margin: 0 0 22px; }
.bm-prose strong { color: var(--bm-ink); }
.bm-prose code, .bm-details code { padding: .12em .38em; border-radius: 5px; background: var(--bm-cyan-soft); color: #08758a; font-size: .88em; }

.bm-chapter-plan {
  display: grid;
  grid-template-columns: minmax(280px, .9fr) minmax(0, 1.1fr);
  gap: 1px;
  max-width: 980px;
  margin: -18px 0 42px;
  overflow: hidden;
  border: 1px solid #cfd8dd;
  border-radius: 12px;
  background: #cfd8dd;
}
.bm-chapter-role, .bm-chapter-scope { background: #fff; }
.bm-chapter-role { padding: 24px 26px; border-left: 5px solid var(--bm-cyan); }
.bm-chapter-role span, .bm-chapter-scope span { color: #08758a; font: 850 10px var(--font-geist-mono), monospace; }
.bm-chapter-role strong { display: block; margin-top: 14px; font-size: 15px; line-height: 1.65; }
.bm-chapter-scope { display: grid; grid-template-columns: 1fr 1fr; }
.bm-chapter-scope > div { padding: 22px 24px; }
.bm-chapter-scope > div + div { border-left: 1px solid var(--bm-line); background: #f7f9fa; }
.bm-chapter-scope p { margin: 10px 0 0; color: #5f6e7a; font-size: 11px; line-height: 1.7; }

.relation-list { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin: 34px 0 42px; }
.relation-list > div, .enumeration-demo > div, .problem-grid article, .result-grid > div {
  border: 1px solid var(--bm-line);
  border-radius: 18px;
  background: rgba(255,255,255,.78);
  box-shadow: 0 18px 46px rgba(23,37,52,.055);
}
.relation-list > div { display: flex; align-items: center; gap: 8px; min-height: 90px; padding: 20px; }
.relation-list b { margin-right: auto; }
.relation-list span { padding: 6px 9px; border-radius: 5px; background: var(--bm-cyan-soft); color: #076a7e; font-size: 11px; }
.enumeration-demo { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin: 44px 0; }
.enumeration-demo > div { padding: 28px; }
.enumeration-demo span { color: #08758a; font: 850 10px var(--font-geist-mono), monospace; }
.enumeration-demo ol { margin: 24px 0; padding-left: 22px; color: var(--bm-muted); line-height: 2; }
.enumeration-demo strong { display: block; padding-top: 18px; border-top: 1px solid var(--bm-line); }
.enumeration-demo > div:last-child { border-color: #addde5; background: #f3fcff; }
.pain-card { display: grid; grid-template-columns: 250px 1fr; gap: 34px; align-items: center; margin-top: 42px; padding: 30px; border: 1px solid #efd494; border-radius: 18px; background: var(--bm-amber-soft); }
.pain-card span { color: #8a5c00; font: 850 10px var(--font-geist-mono), monospace; }
.pain-card b { display: block; margin-top: 10px; font-size: 34px; }
.pain-card p { margin: 0; color: #6f5b32; line-height: 1.8; }
.chapter-result { display: flex; gap: 18px; align-items: center; margin-top: 28px; padding: 18px 22px; border-radius: 9px; background: var(--bm-ink); color: white; }
.chapter-result span { flex: none; color: #7fd4e4; font: 850 10px var(--font-geist-mono), monospace; }
.chapter-result strong { font-size: 13px; line-height: 1.6; }

.relation-matrix { max-width: 780px; margin: 38px 0 44px; overflow: hidden; border: 1px solid var(--bm-line); border-radius: 14px; background: white; box-shadow: 0 18px 46px rgba(23,37,52,.05); }
.relation-matrix > div { display: grid; grid-template-columns: 1.3fr repeat(3, 1fr); min-height: 58px; border-bottom: 1px solid var(--bm-line); }
.relation-matrix > div:last-child { border-bottom: 0; }
.relation-matrix span, .relation-matrix b { display: grid; place-items: center; border-right: 1px solid var(--bm-line); }
.relation-matrix span:last-child { border-right: 0; }
.relation-matrix .head { background: var(--bm-paper-deep); color: var(--bm-muted); font: 800 11px var(--font-geist-mono), monospace; }
.relation-matrix .yes { background: var(--bm-cyan-soft); color: #08758a; font-weight: 900; }

.journey-figure, .bm-figure {
  margin: 54px 0 32px;
  overflow: hidden;
  border: 1px solid var(--bm-line);
  border-radius: 18px;
  background: rgba(255,255,255,.8);
  box-shadow: 0 18px 46px rgba(23,37,52,.055);
}
.journey-caption { display: grid; grid-template-columns: 170px 1fr; gap: 7px 24px; align-items: baseline; padding: 24px 28px; border-bottom: 1px solid var(--bm-line); }
.journey-caption span { grid-row: 1 / 3; color: var(--bm-cyan); font: 850 10px var(--font-geist-mono), monospace; letter-spacing: .1em; }
.journey-caption b { font-size: 17px; }
.journey-caption p { margin: 0; color: var(--bm-muted); font-size: 12px; }
.journey-canvas { width: 100%; height: 430px; background: #fbfaf5; }
.journey-canvas .react-flow__node { width: 160px; }
.journey-canvas .react-flow__edge-path {
  stroke-linecap: round;
  transition: stroke 180ms cubic-bezier(.22, 1, .36, 1), opacity 180ms cubic-bezier(.22, 1, .36, 1);
}
.journey-node {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 74px;
  padding: 13px 18px;
  border: 2px solid var(--bm-ink);
  border-radius: 14px;
  background: #fff;
  box-shadow: 5px 5px 0 rgba(23,37,52,.1);
  transition:
    transform 180ms cubic-bezier(.22, 1, .36, 1),
    background-color 180ms cubic-bezier(.22, 1, .36, 1),
    border-color 180ms cubic-bezier(.22, 1, .36, 1),
    box-shadow 180ms cubic-bezier(.22, 1, .36, 1);
}
.journey-node.right { border-color: var(--bm-cyan); }
.journey-node.free { border-color: var(--bm-red); background: var(--bm-red-soft); }
.journey-node.visited { box-shadow: 5px 5px 0 rgba(11,145,171,.18); }
.journey-node.active { transform: scale(1.025); box-shadow: 0 0 0 5px rgba(228,155,8,.18), 5px 5px 0 rgba(23,37,52,.1); }
.journey-node.fail { border-color: var(--bm-red); background: var(--bm-red-soft); box-shadow: 0 0 0 5px rgba(220,65,57,.16); }
.journey-node.back { border-color: var(--bm-amber); background: var(--bm-amber-soft); box-shadow: 0 0 0 5px rgba(228,155,8,.16); }
.journey-node span { font-size: 16px; font-weight: 800; }
.journey-node small { margin-top: 4px; color: var(--bm-muted); font-size: 10px; }
.journey-node .react-flow__handle { width: 11px; height: 11px; border: 2px solid white; background: var(--bm-ink); }
.journey-node.right .react-flow__handle { background: var(--bm-cyan); }
.journey-node.free .react-flow__handle { background: var(--bm-red); }
.journey-legend { display: flex; gap: 22px; flex-wrap: wrap; padding: 16px 28px; border-top: 1px solid var(--bm-line); color: var(--bm-muted); font-size: 12px; }
.journey-legend span { display: flex; align-items: center; gap: 8px; }
.journey-legend i { display: inline-block; width: 30px; border-top: 2px solid #9aabb3; }
.journey-legend i.matched { border-top: 4px solid var(--bm-cyan); }
.journey-legend i.augment { border-top: 4px dashed var(--bm-amber); }
.journey-legend i.fail { border-top: 4px dashed var(--bm-red); }
.path-controller {
  display: grid;
  grid-template-columns: 130px 1fr auto;
  gap: 24px;
  align-items: center;
  padding: 22px 28px;
  border-top: 1px solid var(--bm-line);
  background: #fff;
}
.path-progress { display: flex; gap: 7px; }
.path-progress i { width: 15px; height: 5px; border-radius: 999px; background: #d7dfe4; transition: background-color 180ms cubic-bezier(.22, 1, .36, 1), transform 180ms cubic-bezier(.22, 1, .36, 1); }
.path-progress i.done { transform: scaleY(1.4); background: var(--bm-cyan); }
.path-step-copy span { color: #08758a; font: 850 10px var(--font-geist-mono), monospace; }
.path-step-copy b { display: block; margin-top: 7px; font-size: 16px; }
.path-step-copy p { margin: 5px 0 0; color: var(--bm-muted); font-size: 12px; line-height: 1.6; }
.path-controller button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  min-width: 132px;
  min-height: 46px;
  padding: 0 17px;
  border: 0;
  border-radius: 9px;
  background: var(--bm-ink);
  color: white;
  cursor: pointer;
  font-weight: 760;
  transition: transform 140ms cubic-bezier(.22, 1, .36, 1), background-color 180ms ease;
}
.path-controller button:active { transform: scale(.97); }
.path-controller button:focus-visible { outline: 3px solid rgba(11,145,171,.35); outline-offset: 3px; }
.path-controller button span { color: #7fd4e4; }
.bm-figure-scroll { overflow-x: auto; background: var(--bm-paper); }
.bm-figure img { display: block; width: 100%; min-width: 720px; height: auto; }
.bm-figure figcaption { margin: 0; padding: 16px 22px; border-top: 1px solid var(--bm-line); color: var(--bm-muted); font-size: 12px; line-height: 1.7; }
.continuity-note { display: grid; grid-template-columns: 230px 1fr; gap: 24px; margin-top: 28px; padding: 22px 24px; border: 1px solid var(--bm-line); border-radius: 12px; background: #f7f9fa; }
.continuity-note b { color: #08758a; }
.continuity-note p { margin: 0; color: var(--bm-muted); line-height: 1.7; }

.definition-strip { display: grid; grid-template-columns: 1fr 220px 1fr; align-items: center; margin: 48px 0 28px; padding: 32px; border: 1px solid var(--bm-line); border-radius: 18px; background: white; box-shadow: 0 18px 46px rgba(23,37,52,.05); }
.definition-strip > div { display: grid; grid-template-columns: 50px 1fr; gap: 4px 14px; align-items: center; }
.definition-strip > div:last-child { text-align: right; }
.definition-strip span { grid-row: 1 / 3; display: grid; place-items: center; width: 46px; height: 46px; border-radius: 50%; background: var(--bm-ink); color: white; font: 800 16px var(--font-geist-mono), monospace; }
.definition-strip > div:last-child span { order: 2; background: var(--bm-cyan); }
.definition-strip p { margin: 0; color: var(--bm-muted); font-size: 12px; }
.definition-strip > i { color: var(--bm-cyan); font-style: normal; text-align: center; font-size: 12px; }
.concept-figure-grid { display: grid; grid-template-columns: 1fr; gap: 8px; }
.concept-figure-grid .bm-figure { margin-top: 26px; }
.structure-payoff { margin-top: 34px; padding: 30px; border-left: 5px solid var(--bm-cyan); border-radius: 0 12px 12px 0; background: var(--bm-cyan-soft); }
.structure-payoff span { color: #08758a; font: 850 10px var(--font-geist-mono), monospace; }
.structure-payoff strong { display: block; margin: 14px 0 10px; font-size: 19px; }
.structure-payoff p { margin: 0; color: #47606c; line-height: 1.8; }

.bm-details { margin-top: 22px; overflow: hidden; border: 1px solid var(--bm-line); border-radius: 12px; background: rgba(255,255,255,.75); }
.bm-details summary { cursor: pointer; padding: 20px 24px; font-weight: 760; }
.bm-details > p { margin: 0; padding: 0 24px 24px; color: var(--bm-muted); line-height: 1.8; }
.application-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; padding-top: 1px; background: var(--bm-line); }
.application-grid > div { min-height: 170px; padding: 23px; background: white; }
.application-grid b { color: #08758a; }
.application-grid p { margin: 12px 0 0; color: var(--bm-muted); font-size: 13px; line-height: 1.7; }

.bm-vocab, .bm-code-reading { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-top: 24px; }
.bm-vocab > div, .bm-code-reading > div { padding: 22px; border: 1px solid var(--bm-line); border-radius: 12px; background: rgba(255,255,255,.74); }
.bm-vocab > div { border-top: 4px solid var(--bm-cyan); }
.bm-vocab > div:nth-child(n+3) { border-top-color: var(--bm-amber); }
.bm-vocab p, .bm-code-reading p { margin: 10px 0 0; color: var(--bm-muted); font-size: 13px; line-height: 1.7; }
.question-block { margin-top: 46px; padding: 34px; border-left: 6px solid var(--bm-amber); border-radius: 0 18px 18px 0; background: var(--bm-amber-soft); }
.question-block span { color: #8a5c00; font: 850 10px var(--font-geist-mono), monospace; }
.question-block b { display: block; margin-top: 12px; font-size: clamp(24px, 4vw, 36px); }
.question-block p { margin: 14px 0 0; color: #6f5b32; line-height: 1.75; }

.reason-chain, .final-route { margin: 42px 0; overflow: hidden; border: 1px solid var(--bm-line); border-radius: 14px; background: white; }
.story-step { display: grid; grid-template-columns: 90px 1fr; gap: 20px; padding: 22px 26px; border-bottom: 1px solid var(--bm-line); }
.story-step:last-child { border-bottom: 0; }
.story-step > span { color: var(--bm-cyan); font: 850 11px var(--font-geist-mono), monospace; }
.story-step b { font-size: 15px; }
.story-step p { margin: 7px 0 0; color: var(--bm-muted); line-height: 1.65; }
.concept-pair, .result-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-top: 28px; }
.concept-pair > div { padding: 27px; border: 1px solid var(--bm-line); border-radius: 14px; background: white; }
.concept-pair span { color: #08758a; font-weight: 800; }
.concept-pair p { margin: 12px 0 0; color: var(--bm-muted); line-height: 1.75; }
.concept-checklist { margin: 18px 0 0; padding: 0; list-style: none; counter-reset: augment-rule; }
.concept-checklist li { counter-increment: augment-rule; display: grid; grid-template-columns: 28px 1fr; gap: 9px; align-items: start; padding: 10px 0; border-bottom: 1px solid var(--bm-line); color: #405061; line-height: 1.6; }
.concept-checklist li::before { content: counter(augment-rule); display: grid; place-items: center; width: 23px; height: 23px; border-radius: 50%; background: var(--bm-cyan-soft); color: #08758a; font: 850 10px var(--font-geist-mono), monospace; }
.concept-checklist li:last-child { border-bottom: 0; }
.concept-checklist b { font-size: 13px; }
.concept-pair .concept-caution { margin-top: 15px; padding: 12px 14px; border-radius: 8px; background: var(--bm-amber-soft); color: #6f5b32; font-size: 12px; }
.flip-count, .complexity-compare { display: grid; grid-template-columns: 1fr 200px 1fr; align-items: center; margin-top: 36px; padding: 28px; border: 1px solid var(--bm-line); border-radius: 18px; background: white; box-shadow: 0 18px 46px rgba(23,37,52,.05); }
.flip-count > div, .complexity-compare > div { display: grid; grid-template-columns: 1fr auto; gap: 7px 18px; }
.flip-count span, .complexity-compare span { color: var(--bm-cyan); font: 850 10px var(--font-geist-mono), monospace; }
.flip-count b { grid-row: 1 / 3; grid-column: 2; font-size: 52px; line-height: 1; }
.flip-count p, .complexity-compare p { margin: 0; color: var(--bm-muted); font-size: 12px; }
.flip-count > i, .complexity-compare > i { color: var(--bm-muted); font-style: normal; text-align: center; font-size: 11px; line-height: 1.7; }
.bm-theorem { display: grid; grid-template-columns: 130px 1fr; gap: 30px; margin-top: 44px; padding: 28px; border-radius: 14px; background: var(--bm-ink); color: white; }
.bm-theorem > span { color: #7fd4e4; font: 850 10px var(--font-geist-mono), monospace; }
.bm-theorem b { font-size: 19px; line-height: 1.6; }
.bm-theorem p { margin-bottom: 0; color: #b9c6ce; line-height: 1.75; }
.result-grid { margin-bottom: 38px; }
.result-grid > div { min-height: 220px; padding: 30px; border-top: 4px solid var(--bm-cyan); }
.result-grid > div:last-child { border-top-color: var(--bm-amber); }
.result-grid span { color: var(--bm-muted); font: 800 10px var(--font-geist-mono), monospace; }
.result-grid h3 { margin: 46px 0 12px; font-size: 27px; }
.result-grid p { color: var(--bm-muted); line-height: 1.7; }

.tree-levels { display: grid; grid-template-columns: 1fr 90px 1fr 90px 1fr; align-items: center; gap: 8px; margin: 46px 0 30px; }
.tree-levels > div { min-height: 190px; padding: 24px; border: 1px solid var(--bm-line); border-radius: 16px; background: white; box-shadow: 0 18px 46px rgba(23,37,52,.05); }
.tree-levels span { color: var(--bm-cyan); font: 850 10px var(--font-geist-mono), monospace; }
.tree-levels b { display: block; margin-top: 38px; font-size: 20px; }
.tree-levels p { color: var(--bm-muted); font-size: 13px; line-height: 1.65; }
.tree-levels > i { color: var(--bm-cyan); font-style: normal; text-align: center; font-size: 11px; }

.bm-code-card { overflow: hidden; margin-top: 44px; border: 1px solid #263c4d; border-radius: 18px; background: #101b25; box-shadow: 0 22px 60px rgba(23,37,52,.18); }
.bm-code-head { display: flex; align-items: center; gap: 18px; padding: 15px 20px; border-bottom: 1px solid #263c4d; color: #d6e3e7; }
.bm-code-head span { color: #57cfe1; font: 800 11px var(--font-geist-mono), monospace; }
.bm-code-head small { margin-left: auto; color: #849ba6; }
.bm-code-card pre { overflow-x: auto; margin: 0; padding: 26px; color: #dce9ed; font-size: 13px; line-height: 1.75; tab-size: 4; }
.bm-code-card pre code { display: block; background: transparent; padding: 0; color: inherit; font: inherit; }
.bm-code-reading > div { background: white; }
.name-warning { display: grid; grid-template-columns: 170px 1fr; gap: 28px; margin-top: 28px; padding: 26px; border: 1px solid #addde5; border-radius: 14px; background: var(--bm-cyan-soft); }
.name-warning b { color: #08758a; }
.name-warning p { margin: 0; color: #47606c; line-height: 1.75; }
.complexity-compare b { grid-column: 1 / 3; margin-top: 9px; font-size: 24px; }

.transfer-intro { display: grid; grid-template-columns: 170px 1fr; gap: 24px; padding: 26px; border-left: 5px solid var(--bm-cyan); border-radius: 0 12px 12px 0; background: var(--bm-cyan-soft); }
.transfer-intro p { margin: 0; color: #47606c; line-height: 1.7; }
.problem-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin: 40px 0 62px; }
.problem-grid article { min-height: 235px; padding: 28px; }
.problem-grid span { color: var(--bm-cyan); font: 850 10px var(--font-geist-mono), monospace; }
.problem-grid h3 { margin: 34px 0 13px; font-size: 23px; }
.problem-grid p { margin: 0; color: var(--bm-muted); line-height: 1.75; }
.bm-boundaries { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-top: 30px; }
.bm-boundaries p { margin: 0; padding: 21px; border: 1px solid var(--bm-line); border-radius: 12px; background: white; color: var(--bm-muted); font-size: 13px; line-height: 1.7; }
.bm-boundaries b { display: block; margin-bottom: 7px; color: var(--bm-ink); }

.bm-sources ul { margin: 0; padding: 0; list-style: none; border-top: 1px solid var(--bm-line); }
.bm-sources li { border-bottom: 1px solid var(--bm-line); }
.bm-sources li a { display: block; padding: 18px 0; color: var(--bm-muted); text-decoration: none; }
.bm-sources li a:hover { color: var(--bm-cyan); }
.bm-footer { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 20px; padding: 30px max(20px, calc((100vw - 1120px) / 2)); background: var(--bm-ink); color: white; }
.bm-footer span { font-weight: 850; letter-spacing: .12em; }
.bm-footer p { margin: 0; color: #9fb2bb; font-size: 13px; }
.bm-footer a { justify-self: end; color: #7fd4e4; text-decoration: none; font-size: 13px; }

@media (max-width: 920px) {
  .bm-topbar { grid-template-columns: 1fr auto; }
  .bm-topbar nav { display: none; }
  .bm-chapter-plan { grid-template-columns: 1fr; }
  .bm-chapter-scope > div + div { border-left: 0; border-top: 1px solid var(--bm-line); }
  .relation-list, .application-grid { grid-template-columns: 1fr; }
  .concept-figure-grid, .bm-vocab, .bm-code-reading { grid-template-columns: 1fr 1fr; }
  .definition-strip { grid-template-columns: 1fr; gap: 18px; }
  .definition-strip > i { padding: 10px; }
  .tree-levels { grid-template-columns: 1fr; }
  .tree-levels > i { padding: 7px; }
  .bm-layout { grid-template-columns: 1fr; gap: 0; padding: 0 16px; }
  .bm-toc { position: static; max-height: none; flex-direction: row; flex-wrap: wrap; gap: 4px; margin-bottom: 22px; }
  .bm-toc-kicker { width: 100%; }
  .bm-toc a { padding: 5px 9px; font-size: 12px; }
}

@media (max-width: 640px) {
  .bm-topbar { height: 72px; }
  .bm-back { padding: 8px 10px; }
  .bm-hero { min-height: 650px; padding-block: 80px; }
  .bm-hero h1 { font-size: 60px; }
  .bm-route i { display: none; }
  .bm-section { width: min(100% - 28px, 1120px); padding: 72px 0; scroll-margin-top: 72px; }
  .bm-section-head h2 { font-size: 42px; }
  .bm-chapter-scope, .enumeration-demo, .concept-figure-grid, .bm-vocab, .bm-code-reading, .concept-pair, .result-grid, .problem-grid, .bm-boundaries { grid-template-columns: 1fr; }
  .pain-card, .continuity-note, .transfer-intro, .name-warning { grid-template-columns: 1fr; gap: 12px; }
  .journey-figure, .bm-figure { overflow-x: auto; }
  .journey-caption { grid-template-columns: 1fr; min-width: 720px; }
  .journey-caption span { grid-row: auto; }
  .journey-canvas, .journey-legend { min-width: 720px; }
  .path-controller { min-width: 720px; grid-template-columns: 110px 1fr auto; }
  .flip-count, .complexity-compare { grid-template-columns: 1fr; gap: 24px; }
  .flip-count > i, .complexity-compare > i { text-align: left; }
  .bm-theorem { grid-template-columns: 1fr; gap: 12px; }
  .story-step { grid-template-columns: 54px 1fr; padding-inline: 18px; }
  .bm-footer { grid-template-columns: 1fr auto; }
  .bm-footer p { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .journey-canvas .react-flow__edge-path,
  .journey-node,
  .path-progress i,
  .path-controller button { transition: none; }
}

/* 独立知识页链接：明确可点击样式 */
.bm-page a.proof-link {
  color: var(--bm-cyan);
  text-decoration: underline;
  text-underline-offset: 3px;
  font-weight: 750;
  border-radius: 6px;
  transition: color 140ms ease, background-color 140ms ease;
}

.bm-page a.proof-link:hover {
  color: var(--bm-ink);
  background: var(--bm-cyan-soft);
}

/* highlight.js 与代码卡背景统一 */
.bm-code-card pre code.hljs {
  background: transparent;
  padding: 0;
}
