:root {
  --paper: #fffefb;
  --canvas: #f7f7f2;
  --ink: #26352f;
  --muted: #7b837c;
  --accent: #2c5549;
  --line: #e4e7dd;
  --body-size: 17px;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Microsoft YaHei", sans-serif;
  --mono: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  color-scheme: light;
}
* {
  box-sizing: border-box;
}
html {
  scroll-behavior: smooth;
  scroll-padding-top: 100px;
}
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
}
a {
  color: var(--accent);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}
button,
input {
  font: inherit;
}
code,
pre,
kbd,
samp {
  font-family: var(--mono);
}
button {
  cursor: pointer;
  color: inherit;
}
button:focus-visible,
a:focus-visible,
input:focus-visible,
summary:focus-visible {
  outline: 3px solid #b1c9b6;
  outline-offset: 4px;
}
.topbar {
  height: 82px;
  padding: 0 44px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  background: var(--paper);
  position: sticky;
  top: 0;
  z-index: 20;
}
.brand {
  display: flex;
  align-items: center;
  gap: 13px;
  font-size: 17px;
  font-weight: 650;
  letter-spacing: 0.5px;
}
.brand:hover {
  text-decoration: none;
}
.monogram {
  display: grid;
  place-items: center;
  width: 36px;
  height: 40px;
  border-radius: 4px;
  background: var(--accent);
  color: #fff;
  font-family: var(--sans);
  font-size: 27px;
}
.brand-sub {
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 2px;
  margin-top: 4px;
  display: block;
  color: var(--muted);
}
.top-actions {
  display: flex;
  gap: 26px;
  align-items: center;
  font-size: 13px;
}
.top-actions button {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: transparent;
  padding: 8px 12px;
  color: #667168;
}
.top-actions kbd {
  font-size: 11px;
  color: #959d94;
  margin-left: 28px;
}
.progress {
  height: 2px;
  background: var(--line);
  position: sticky;
  top: 82px;
  z-index: 21;
}
#progress-fill {
  height: 100%;
  background: var(--accent);
  width: 0;
}
.layout {
  display: grid;
  grid-template-columns: 250px minmax(0, 780px) 160px;
  gap: 58px;
  max-width: 1460px;
  padding: 0 44px;
  margin: auto;
}
#sidebar {
  height: calc(100vh - 112px);
  position: sticky;
  top: 108px;
  overflow: auto;
  padding-right: 13px;
  scrollbar-width: thin;
}
.sidebar-intro {
  padding: 24px 0 22px;
}
.eyebrow {
  font-size: 10px;
  letter-spacing: 1.8px;
  font-weight: 650;
  color: var(--muted);
}
.sidebar-intro p {
  font-size: 13px;
  margin: 12px 0 0;
  color: #667168;
}
.chapter-current {
  display: flex;
  gap: 12px;
  background: #ecf0e8;
  padding: 13px 12px;
  margin: 0 0 15px;
  border-radius: 5px;
  font-size: 14px;
  color: var(--accent);
}
.chapter-current > span {
  font-family: var(--sans);
  font-size: 15px;
  opacity: 0.6;
}
nav ol {
  padding: 0;
  list-style: none;
  margin: 0;
}
nav a {
  display: flex;
  gap: 10px;
  font-size: 12px;
  line-height: 1.7;
  padding: 10px 9px;
  color: #758076;
  border-left: 2px solid transparent;
}
nav a.active {
  color: var(--accent);
  border-left-color: var(--accent);
  font-weight: 650;
  background: #f5f6f0;
}
nav a span {
  color: #99a094;
  font-family: var(--sans);
  font-size: 12px;
  line-height: 1.7;
}
nav a:hover {
  background: #f1f3ec;
  text-decoration: none;
}
.sidebar-bottom {
  border-top: 1px solid var(--line);
  padding-top: 16px;
  margin-top: 20px;
}
.sidebar-bottom a {
  display: flex;
  justify-content: space-between;
  padding: 9px;
  font-size: 12px;
}
.sidebar-bottom small {
  display: block;
  font-size: 10px;
  color: #9ba298;
  margin: 24px 9px;
}
main {
  min-width: 0;
  padding: 40px 0 0;
}
.breadcrumb {
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 0.3px;
}
.breadcrumb span {
  margin: 0 12px;
  color: #c1c7bd;
}
.chapter-heading {
  padding: 47px 0 30px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 32px;
}
.chapter-heading .eyebrow {
  color: var(--accent);
  font-size: 11px;
}
h1 {
  font-family: var(--sans);
  font-size: 48px;
  font-weight: 600;
  letter-spacing: 3px;
  margin: 17px 0 8px;
}
.chapter-subtitle {
  color: #8a9587;
  font-family: var(--sans);
  font-size: 23px;
  font-style: italic;
  margin: 0 0 26px;
}
.chapter-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  color: var(--muted);
  font-size: 11px;
}
.chapter-meta span + span::before {
  content: "·";
  margin-right: 18px;
  color: #abb3a6;
}

article,
.exercise-section {
  font-family: var(--sans);
  font-size: var(--body-size);
  line-height: 1.95;
  overflow-wrap: break-word;
}
article p {
  margin: 18px 0;
}
article > p:first-child {
  color: #58655a;
}
h2 {
  font-size: 26px;
  font-weight: 600;
  line-height: 1.5;
  letter-spacing: 0.3px;
  margin: 54px 0 22px;
  padding-top: 14px;
}
h2 .section-number,
h3 .section-number {
  color: #92a18b;
  font-family: var(--sans);
  font-size: 22px;
  margin-right: 14px;
}
h3 .section-number {
  font-size: 0.9em;
}
.newtheorem {
  margin: 28px 0;
  padding: 16px 20px;
  border-left: 3px solid #547b6c;
  background: #f7f8f3;
}
.newtheorem .head {
  color: #254c3f;
  font-weight: 700;
}
.newtheorem > p:first-child {
  margin-top: 0;
}
.newtheorem > :last-child {
  margin-bottom: 0;
}
h3 {
  font-size: 19px;
  font-weight: 600;
  margin: 32px 0 15px;
}
h4 {
  font-size: 17px;
  margin-top: 30px;
}
strong {
  font-weight: 620;
  color: #254c3f;
}
.term-en {
  margin-inline: 0.2em;
}
.optional-marker {
  display: inline-flex;
  align-items: center;
  gap: 0.35em;
  margin: 4px 0 14px;
  padding: 3px 9px;
  border: 1px solid #bdcbb9;
  border-radius: 999px;
  background: #eef3e9;
  color: #486653;
  font-size: 0.72em;
  font-style: normal;
  font-weight: 650;
  line-height: 1.45;
  vertical-align: middle;
}
.optional-marker > [aria-hidden="true"] {
  font-size: 0.9em;
}
h2 > .optional-marker,
h3 > .optional-marker,
h4 > .optional-marker {
  margin: 0 0 0 0.75em;
  font-size: 12px;
  white-space: nowrap;
}
article a:not(.footnote-ref) {
  border-bottom: 1px solid #bdcdb9;
}
article a:hover {
  text-decoration: none;
  border-color: var(--accent);
}
article .math.display {
  display: block;
  overflow-x: auto;
  overflow-y: hidden;
  margin: 18px 0;
  padding: 4px 2px;
  font-size: 1.02em;
}
.math.display mjx-container {
  min-width: fit-content;
}
.math.display mjx-container[jax="CHTML"][display="true"],
.equation-block mjx-container[jax="CHTML"][display="true"] {
  margin: 0 !important;
}
mjx-container {
  outline: none;
}
mjx-assistive-mml {
  max-width: 100%;
}
.equation-block {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  margin: 18px 0;
  overflow-x: auto;
  overflow-y: hidden;
}
.equation-block .mathjax-equation {
  min-width: 0;
}
.equation-block > a[id] {
  display: none;
}
.equation-number {
  color: #657168;
  font-family: var(--sans);
  font-size: 0.88em;
  white-space: nowrap;
}
figure {
  margin: 34px 0;
  padding: 26px 22px;
  background: #f7f8f3;
  border: 1px solid var(--line);
  border-radius: 7px;
  text-align: center;
}
figure img {
  max-width: 100%;
  height: auto;
  cursor: zoom-in;
  max-height: 350px;
}
figcaption {
  font-size: var(--body-size);
  color: #5f6c63;
  line-height: 1.75;
  margin: 18px auto 0;
  text-align: left;
  max-width: 600px;
}
figcaption .id {
  color: var(--ink);
  font-weight: 650;
}
.table-scroll {
  overflow: auto;
  margin: 28px 0;
  border-top: 1px solid #bac8b6;
  border-bottom: 1px solid #bac8b6;
}
table {
  border-collapse: collapse;
  width: 100%;
  font-size: 14px;
  line-height: 1.6;
}
td,
th {
  padding: 9px 12px;
  text-align: left;
  border-bottom: 1px solid var(--line);
  min-width: 65px;
}
td > p,
th > p {
  margin: 0;
}
table > thead > tr,
table:not(:has(> thead)) > tbody > tr:first-child {
  background: #f2f4ed;
}
thead th {
  font-weight: 650;
}
table > tbody > tr:last-child td {
  border-bottom: 0;
}
blockquote {
  margin: 30px 0;
  padding: 19px 24px;
  border-left: 3px solid #7e9f81;
  background: #f1f4ed;
  font-size: 0.94em;
  border-radius: 0 6px 6px 0;
}
blockquote p {
  margin: 8px 0;
}
blockquote p:first-child strong {
  display: block;
  font-size: 14px;
  margin-bottom: 10px;
}
blockquote.admonition,
.tcolorbox.admonition {
  padding: 13px 18px;
  border-radius: 0;
  border-left-width: 4px;
  background: #f6f8fa;
}
.tcolorbox.admonition .tcolorbox-title {
  display: flex;
  align-items: center;
  gap: 0.5em;
  margin-bottom: 7px;
}
.tcolorbox.admonition .tcolorbox-title strong {
  display: flex;
  align-items: center;
  gap: 0.5em;
  font-size: 14px;
}
.tcolorbox.admonition .tcolorbox-title strong::before {
  width: 1.15em;
  text-align: center;
  font-size: 0.95em;
}
.tcolorbox.admonition .tcolorbox-content > p:first-child {
  margin-top: 0;
}
.tcolorbox.admonition .tcolorbox-content > p:last-child {
  margin-bottom: 0;
}
blockquote.admonition > p:first-child {
  margin-top: 0;
}
blockquote.admonition > p:last-child {
  margin-bottom: 0;
}
blockquote.admonition > p:first-child strong {
  display: flex;
  align-items: center;
  gap: 0.5em;
  margin-bottom: 7px;
}
blockquote.admonition > p:first-child strong::before {
  width: 1.15em;
  text-align: center;
  font-size: 0.95em;
}
blockquote.admonition.note {
  border-left-color: #0969da;
  background: #eff6ff;
}
blockquote.admonition.note > p:first-child strong {
  color: #0969da;
}
blockquote.admonition.note > p:first-child strong::before {
  content: "ⓘ";
}
blockquote.admonition.tip {
  border-left-color: #1a7f37;
  background: #f0fff4;
}
blockquote.admonition.tip > p:first-child strong {
  color: #1a7f37;
}
blockquote.admonition.tip > p:first-child strong::before {
  content: "✦";
}
blockquote.admonition.important {
  border-left-color: #8250df;
  background: #f6f0ff;
}
blockquote.admonition.important > p:first-child strong {
  color: #8250df;
}
blockquote.admonition.important > p:first-child strong::before {
  content: "◆";
}
blockquote.admonition.warning {
  border-left-color: #9a6700;
  background: #fff8c5;
}
blockquote.admonition.warning > p:first-child strong {
  color: #9a6700;
}
blockquote.admonition.warning > p:first-child strong::before {
  content: "⚠";
}
blockquote.admonition.caution {
  border-left-color: #cf222e;
  background: #fff1f0;
}
blockquote.admonition.caution > p:first-child strong {
  color: #cf222e;
}
blockquote.admonition.caution > p:first-child strong::before {
  content: "⛔";
}
.tcolorbox.admonition.note {
  border-left-color: #0969da;
  background: #eff6ff;
}
.tcolorbox.admonition.note .tcolorbox-title strong { color: #0969da; }
.tcolorbox.admonition.note .tcolorbox-title strong::before { content: "ⓘ"; }
.tcolorbox.admonition.tip {
  border-left-color: #1a7f37;
  background: #f0fff4;
}
.tcolorbox.admonition.tip .tcolorbox-title strong { color: #1a7f37; }
.tcolorbox.admonition.tip .tcolorbox-title strong::before { content: "✦"; }
.tcolorbox.admonition.important {
  border-left-color: #8250df;
  background: #f6f0ff;
}
.tcolorbox.admonition.important .tcolorbox-title strong { color: #8250df; }
.tcolorbox.admonition.important .tcolorbox-title strong::before { content: "◆"; }
.tcolorbox.admonition.warning {
  border-left-color: #9a6700;
  background: #fff8c5;
}
.tcolorbox.admonition.warning .tcolorbox-title strong { color: #9a6700; }
.tcolorbox.admonition.warning .tcolorbox-title strong::before { content: "⚠"; }
.tcolorbox.admonition.caution {
  border-left-color: #cf222e;
  background: #fff1f0;
}
.tcolorbox.admonition.caution .tcolorbox-title strong { color: #cf222e; }
.tcolorbox.admonition.caution .tcolorbox-title strong::before { content: "⛔"; }
section.algorithm {
  margin: 30px 0;
  padding: 0 18px 15px;
  overflow: hidden;
  border: 1px solid #c9d5c6;
  border-left: 3px solid #547b6c;
  background: #f8faf6;
  font-size: 0.9em;
}
section.algorithm .algorithm-title {
  margin: 0 -18px 12px;
  padding: 11px 18px;
  color: #244e42;
  background: #e8eee8;
  border-bottom: 1px solid #c9d5c6;
  font-weight: 700;
  font-size: 0.95em;
}
section.algorithm .algorithm-contract {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  gap: 0 0.35em;
  margin: 4px 0;
}
section.algorithm .algorithm-contract-label {
  font-weight: 700;
}
section.algorithm .algorithm-steps {
  margin: 12px 0;
}
section.algorithm dl.enumerate-enumitem {
  display: grid;
  grid-template-columns: 2em minmax(0, 1fr);
  gap: 6px 4px;
  margin: 0;
  padding: 0;
}
section.algorithm dt.enumerate-enumitem {
  grid-column: 1;
  margin: 0;
  color: #617068;
  text-align: right;
}
section.algorithm dd.enumerate-enumitem {
  grid-column: 2;
  min-width: 0;
  margin: 0;
}
section.algorithm dl dl.enumerate-enumitem {
  margin: 6px 0 0 1.1em;
  padding-left: 12px;
  border-left: 1px solid #ccd7ce;
}
article li {
  padding-left: 5px;
  margin: 10px 0;
}
code {
  font-size: 0.85em;
  padding: 2px 5px;
  border-radius: 3px;
  background: #edf1e8;
}
pre {
  overflow: auto;
  background: #f1f3ec;
  padding: 18px;
  border-radius: 5px;
}
.footnotes {
  border-top: 1px solid var(--line);
  margin-top: 50px;
  font-size: 13px;
  color: #727c70;
}
.footnotes .footnote-mark {
  margin-right: 0.45em;
}

.reading-tools {
  position: sticky;
  top: 145px;
  align-self: start;
  padding-top: 8px;
}
.size-controls {
  display: flex;
  gap: 8px;
  margin: 16px 0 24px;
}
.size-controls button {
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 4px;
  width: 38px;
  height: 34px;
  font-size: 13px;
}
.reading-tools #reading-status {
  font-size: 11px;
  color: #768170;
}
.reading-tools > a {
  font-size: 11px;
}
.exercise-section,
.references-section {
  border-top: 1px solid var(--line);
  margin-top: 65px;
  padding-top: 35px;
}
.exercise-section h2,
.references-section h2 {
  margin-top: 6px;
}
.section-note {
  font-size: 13px;
  color: var(--muted);
}
.exercise {
  border: 1px solid var(--line);
  padding: 22px 25px;
  margin: 20px 0;
  border-radius: 7px;
}
.exercise-heading {
  font-size: 11px;
  color: var(--accent);
  font-weight: 650;
  letter-spacing: 1px;
}
.optional {
  font-size: 10px;
  margin-left: 12px;
  padding: 3px 7px;
  background: #f0ecd9;
  color: #8b783b;
  border-radius: 3px;
}
.exercise p {
  margin: 12px 0;
  font-size: 0.94em;
}
.exercise details {
  border-top: 1px solid var(--line);
  margin-top: 18px;
  padding-top: 14px;
}
.exercise summary {
  font-size: 12px;
  color: var(--accent);
  cursor: pointer;
}
.answer {
  color: #52604f;
}
.references-section {
  font-size: 13px;
  line-height: 1.9;
}
#references dl.thebibliography,
#refs dl.thebibliography {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  gap: 15px 12px;
  margin: 15px 0;
  align-items: baseline;
}
#references dt.thebibliography,
#references dd.thebibliography,
#refs dt.thebibliography,
#refs dd.thebibliography {
  margin: 0;
  min-width: 0;
}
#references dd.thebibliography,
#refs dd.thebibliography {
  overflow-wrap: anywhere;
}
#references dd.thebibliography p,
#refs dd.thebibliography p {
  margin: 0;
}
footer {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: #959d91;
  border-top: 1px solid var(--line);
  margin-top: 65px;
  padding: 30px 0 45px;
}
dialog {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 25px;
  background: var(--paper);
  color: var(--ink);
  max-height: 80vh;
  max-width: calc(100vw - 28px);
  width: 620px;
  box-shadow: 0 25px 100px #102b2333;
}
dialog::backdrop {
  background: #15282066;
  backdrop-filter: blur(3px);
}
.dialog-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.dialog-top h2 {
  margin: 0 0 15px;
  padding: 0;
  font-size: 19px;
}
.dialog-top button,
#figure-close {
  border: 0;
  background: transparent;
  padding: 8px;
  font-size: 20px;
}
#search-input {
  width: 100%;
  padding: 13px 15px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  font-size: 14px;
}
#search-count {
  font-size: 12px;
  color: var(--muted);
}
#search-results {
  max-height: 50vh;
  overflow: auto;
}
#search-results a {
  display: block;
  padding: 14px 8px;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
  line-height: 1.8;
}
#search-results a:hover {
  background: #f2f4ed;
  text-decoration: none;
}
#figure-dialog {
  width: 1050px;
  text-align: center;
}
#figure-large {
  display: block;
  width: 100%;
  max-height: 65vh;
  object-fit: contain;
}
#figure-close {
  display: block;
  margin-left: auto;
  font-size: 13px;
}
#figure-caption {
  font-size: 13px;
  line-height: 1.8;
  color: var(--muted);
}
#menu-toggle {
  display: none;
}
.skip {
  position: absolute;
  top: -100px;
  left: 20px;
  z-index: 40;
  padding: 12px;
  background: #fff;
}
.skip:focus {
  top: 10px;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}

@media (min-width: 1500px) {
  .layout {
    gap: 64px;
  }
}
@media (max-width: 1200px) {
  .layout {
    grid-template-columns: 225px minmax(0, 780px);
    gap: 38px;
    padding: 0 30px;
  }
  .reading-tools {
    display: none;
  }
  .topbar {
    padding: 0 30px;
  }
}
@media (max-width: 800px) {
  :root {
    --body-size: 16px;
  }
  .topbar {
    height: 70px;
    padding: 0 20px;
  }
  .progress {
    top: 70px;
  }
  .brand {
    font-size: 14px;
  }
  .monogram {
    width: 29px;
    height: 34px;
    font-size: 24px;
  }
  .brand-sub {
    font-size: 9px;
  }
  .top-actions {
    gap: 12px;
    font-size: 11px;
  }
  .top-actions kbd {
    display: none;
  }
  .top-actions button {
    padding: 7px;
    font-size: 11px;
  }
  .top-actions > a {
    display: none;
  }
  #menu-toggle {
    display: block;
  }
  .layout {
    display: block;
    padding: 0 23px;
  }
  #sidebar {
    display: none;
    position: fixed;
    left: 0;
    top: 72px;
    width: 290px;
    background: var(--paper);
    z-index: 19;
    height: calc(100dvh - 72px);
    padding: 0 22px 25px;
    box-shadow: 20px 0 60px #19332622;
  }
  #sidebar.open {
    display: block;
  }
  main {
    padding-top: 28px;
  }
  .breadcrumb {
    font-size: 10px;
  }
  .chapter-heading {
    padding-top: 35px;
    margin-bottom: 25px;
  }
  h1 {
    font-size: 38px;
    letter-spacing: 2px;
  }
  .chapter-subtitle {
    font-size: 21px;
  }
  .chapter-meta {
    gap: 10px;
    font-size: 10px;
  }
  .chapter-meta span + span::before {
    margin-right: 10px;
  }
  h2 {
    font-size: 23px;
    margin-top: 38px;
  }
  h3 {
    font-size: 18px;
  }
  figure {
    padding: 20px 12px;
  }
  blockquote {
    padding: 15px 17px;
  }
  table {
    font-size: 12px;
  }
  .exercise {
    padding: 17px;
  }
  .reading-tools {
    display: none;
  }
  footer {
    gap: 20px;
    font-size: 10px;
  }
  article .math.display {
    font-size: 0.95em;
  }
  html {
    scroll-padding-top: 88px;
  }
}
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

.footnote-inline {
  display: inline;
  margin: 0 0.2em;
  color: var(--muted);
  font-size: 0.9em;
}
.footnote-inline > sup {
  margin-right: 0.25em;
  color: var(--accent);
  font-size: 0.75em;
  font-weight: 700;
}
.all-chapters-link {
  display: block;
  font-size: 12px;
  padding: 8px 9px 18px;
}
.chapter-nav-label {
  margin: 22px 9px 10px;
  font-size: 10px;
  letter-spacing: 1px;
  color: var(--muted);
}
.book-navigation {
  font-size: 12px;
}
.book-part {
  margin: 8px 0;
}
.book-part summary {
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  color: #53614f;
  padding: 10px 8px;
  line-height: 1.7;
}
.book-part ol {
  list-style: none;
  padding: 0;
  margin: 3px 0 14px;
}
.book-part a {
  display: flex;
  gap: 10px;
  padding: 8px 10px;
  font-size: 12px;
  line-height: 1.65;
  color: #71806c;
  border-radius: 4px;
}
.book-part a span {
  color: #9aa391;
  font-family: var(--sans);
  font-size: 12px;
  line-height: 1.65;
}
.book-part a.current {
  background: #eaf0e5;
  color: var(--accent);
  font-weight: 650;
}
.book-part a:hover {
  background: #f0f3e9;
  text-decoration: none;
}
main .book-navigation {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 22px 35px;
}
main .book-part {
  border-top: 1px solid var(--line);
  padding-top: 12px;
}
main .book-part summary {
  font-size: 17px;
  color: var(--ink);
}
main .book-part a {
  font-size: 14px;
  padding: 9px 8px;
}
main .book-part a span {
  font-size: 13px;
}
.home-links {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  font-size: 13px;
  margin: 30px 0 45px;
}
.home-links a:first-child {
  background: var(--accent);
  color: white;
  border: 0;
  padding: 9px 17px;
  border-radius: 5px;
}
.home-links a {
  align-self: center;
}
.chapter-pager {
  display: flex;
  justify-content: space-between;
  gap: 30px;
  margin-top: 60px;
  padding: 25px 0;
  border-top: 1px solid var(--line);
  font-size: 13px;
}
.search-result-title {
  display: block;
  color: var(--accent);
  font-weight: 600;
  margin-bottom: 4px;
}
.chapter-subtitle:empty {
  display: none;
}
@media (max-width: 800px) {
  main .book-navigation {
    display: block;
  }
  .chapter-pager {
    font-size: 12px;
  }
  .book-part summary {
    font-size: 12px;
  }
}
.book-extras {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px 8px;
  border-top: 1px solid var(--line);
  font-size: 12px;
  margin-top: 15px;
}
main .book-extras {
  flex-direction: row;
  flex-wrap: wrap;
  gap: 24px;
  padding: 20px 0;
}
.chapter-heading h1 {
  overflow-wrap: anywhere;
}
main h1 {
  line-height: 1.4;
}
@media (max-width: 800px) {
  main .chapter-heading h1 {
    font-size: 32px;
  }
}
#sidebar .chapter-toc {
  margin: 4px 0 12px 18px;
  border-left: 1px solid var(--line);
}
#sidebar .chapter-toc a {
  border-radius: 0;
  font-size: 11px;
  padding: 7px 9px;
}
#sidebar .chapter-toc a.active {
  color: var(--accent);
  border-left-color: var(--accent);
  background: #f5f6f0;
  font-weight: 650;
}

/* Roles remain explicit in titles; colors only assist recognition. */
blockquote.warning { border-left-color: #b7791f; background: #fff7e8; }
blockquote.assumption { border-left-color: #0d9488; }
pre code { padding: 0; background: transparent; font-size: inherit; }
.sourceCode .kw, .sourceCode .cf { color: #005a9c; font-weight: 600; }
.sourceCode .st, .sourceCode .ch { color: #1b6b3a; }
.sourceCode .co { color: #52615a; }
.sourceCode .dv, .sourceCode .fl { color: #8b4513; }
.sourceCode .fu, .sourceCode .bu { color: #6c3483; }

/* Local Highlight.js tokens use the reader's existing code palette. */
.hljs-keyword, .hljs-selector-tag, .hljs-literal { color: #7c3aed; }
.hljs-string, .hljs-attr { color: #166534; }
.hljs-number, .hljs-built_in { color: #0369a1; }
.hljs-comment { color: #64748b; }
.hljs-title, .hljs-function { color: #9a3412; }

/* The landing page is a compact book front door, independent of chapter controls. */
.home-body {
  background:
    radial-gradient(circle at 82% 8%, #dfe9dc 0, transparent 24rem),
    linear-gradient(180deg, #fbfcf7 0, var(--paper) 40rem);
}
.home-body .progress,
.home-body #sidebar,
.home-body .reading-tools {
  display: none;
}
.home-body .layout {
  display: block;
  max-width: 1240px;
  padding: 0 48px;
}
.home-page {
  padding-top: 0;
}
.home-hero {
  min-height: 650px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 310px;
  align-items: center;
  gap: 96px;
  padding: 70px 34px 78px;
}
.home-copy {
  max-width: 690px;
}
.home-kicker {
  color: var(--accent);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 2.2px;
}
.home-page h1 {
  margin: 22px 0 24px;
  font-size: clamp(50px, 6.5vw, 82px);
  line-height: 1.08;
  letter-spacing: 5px;
}
.home-page h1 span {
  color: #718174;
  font-size: 0.55em;
  font-weight: 500;
  letter-spacing: 8px;
}
.home-lead {
  max-width: 650px;
  margin: 0;
  color: #536158;
  font-family: var(--sans);
  font-size: 19px;
  line-height: 1.95;
}
.home-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 25px;
  margin-top: 34px;
  font-size: 14px;
  font-weight: 650;
}
.home-actions a {
  white-space: nowrap;
  border: 0 !important;
}
.home-actions .home-primary {
  display: inline-flex;
  align-items: center;
  gap: 36px;
  min-width: 172px;
  padding: 14px 18px;
  border-radius: 6px;
  background: var(--accent);
  color: #fff;
  box-shadow: 0 10px 26px #1d493b22;
}
.home-actions a:hover,
.home-cover:hover {
  text-decoration: none;
  transform: translateY(-2px);
}
.home-learning {
  margin-top: 44px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
  color: #7a857d;
  font-size: 11px;
}
.home-materials {
  display: flex;
  flex-wrap: wrap;
  gap: 24px 36px;
}
.home-materials strong {
  display: block;
  margin-bottom: 3px;
  color: var(--ink);
  font-size: 21px;
  font-weight: 600;
}
.home-tracks {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px 16px;
  margin-top: 22px;
  font-size: 12px;
}
.home-tracks strong {
  color: var(--ink);
  font-size: 14px;
  font-weight: 600;
}
.home-cover {
  position: relative;
  isolation: isolate;
  display: flex;
  flex-direction: column;
  min-height: 450px;
  padding: 34px 31px;
  overflow: hidden;
  border-radius: 4px 14px 14px 4px;
  background: #214d41;
  color: #f7f1dd;
  box-shadow: -10px 16px 38px #17392f2b, inset 8px 0 #173e34;
  transition: transform 180ms ease, box-shadow 180ms ease;
}
.home-cover::before,
.home-cover::after {
  content: "";
  position: absolute;
  z-index: -1;
  border: 1px solid #9ab5a766;
  border-radius: 50%;
}
.home-cover::before {
  width: 310px;
  height: 310px;
  right: -165px;
  top: -95px;
  box-shadow: 0 0 0 38px #86aa9830, 0 0 0 76px #86aa9819;
}
.home-cover::after {
  width: 190px;
  height: 190px;
  left: -110px;
  bottom: -90px;
}
.home-cover-label {
  font-size: 12px;
  letter-spacing: 3px;
  opacity: 0.78;
}
.home-cover-title {
  margin-top: 78px;
  font-family: var(--sans);
  font-size: 37px;
  font-weight: 600;
  line-height: 1.35;
  letter-spacing: 5px;
}
.home-cover-rule {
  width: 52px;
  height: 2px;
  margin: 22px 0 16px;
  background: #cfbe82;
}
.home-cover-en {
  font: 9px/1.7 var(--sans);
  letter-spacing: 1.4px;
  opacity: 0.62;
}
.home-cover-mark {
  position: absolute;
  right: 25px;
  bottom: 22px;
  color: #f7f1dd17;
  font: 150px/0.7 var(--sans);
}
.home-cover-open {
  margin-top: auto;
  font-size: 11px;
  letter-spacing: 1px;
}
.home-section {
  margin: 0 34px;
  padding: 72px 0;
  border-top: 1px solid var(--line);
}
.home-section-heading {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: end;
  gap: 36px;
  margin-bottom: 34px;
}
.home-section-heading h2 {
  margin: 9px 0 0;
  padding: 0;
  font: 600 32px/1.4 var(--sans);
}
.home-section-heading > p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.8;
}
.home-contents .book-navigation {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}
.home-contents .book-part {
  margin: 0;
  padding: 17px 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffefa;
}
.home-contents .book-part summary {
  padding: 0 0 10px;
  font: 600 17px/1.6 var(--sans);
}
.home-contents .book-part a {
  padding: 7px 2px;
}
.home-contents .book-extras {
  grid-column: 1 / -1;
  justify-content: center;
  margin-top: 6px;
  padding: 22px;
  border: 0;
  border-radius: 8px;
  background: #eef2ea;
}
.home-page footer {
  margin: 30px 34px 0;
}
@media (max-width: 800px) {
  .home-body .layout {
    padding: 0 22px;
  }
  .home-hero {
    min-height: auto;
    grid-template-columns: 1fr;
    gap: 45px;
    padding: 55px 0 62px;
  }
  .home-page h1 {
    font-size: 48px;
    letter-spacing: 3px;
  }
  .home-page h1 span {
    letter-spacing: 5px;
  }
  .home-lead {
    font-size: 16px;
  }
  .home-materials {
    gap: 18px;
  }
  .home-cover {
    min-height: 390px;
    width: min(100%, 285px);
    margin: 0 auto;
  }
  .home-section {
    margin: 0;
    padding: 52px 0;
  }
  .home-section-heading,
  .home-contents .book-navigation {
    grid-template-columns: 1fr;
  }
  .home-section-heading {
    gap: 12px;
  }
  .home-contents .book-extras {
    grid-column: auto;
  }
  .home-page footer {
    margin: 20px 0 0;
  }
}
@media (prefers-reduced-motion: reduce) {
  .home-actions a,
  .home-cover {
    transition: none;
  }
}
