:root {
  --paper: #fffefb;
  --canvas: #f7f7f2;
  --ink: #26352f;
  --muted: #7b837c;
  --accent: #2c5549;
  --line: #e4e7dd;
  --body-size: 17px;
  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:
    -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei",
    sans-serif;
}
a {
  color: var(--accent);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}
button,
input {
  font: inherit;
}
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:
    27px Georgia,
    serif;
}
.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:
    15px Georgia,
    serif;
  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 {
  font:
    12px/1.7 Georgia,
    serif;
  color: #99a094;
}
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: "Songti SC", "STSong", serif;
  font-size: 48px;
  font-weight: 600;
  letter-spacing: 3px;
  margin: 17px 0 8px;
}
.chapter-subtitle {
  font:
    italic 23px Georgia,
    serif;
  color: #8a9587;
  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-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 {
  font:
    22px Georgia,
    serif;
  color: #92a18b;
  margin-right: 14px;
}
h3 {
  font-size: 19px;
  font-weight: 600;
  margin: 32px 0 15px;
}
h4 {
  font-size: 17px;
  margin-top: 30px;
}
strong {
  font-weight: 620;
  color: #254c3f;
}
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: 24px 0;
  padding: 7px 2px;
  font-size: 1.02em;
}
.math.display mjx-container {
  min-width: fit-content;
}
.math.display mjx-container[jax="CHTML"][display="true"] {
  margin: 0 !important;
}
mjx-container {
  outline: none;
}
mjx-assistive-mml {
  max-width: 100%;
}
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: 12px;
  color: #7a8578;
  line-height: 1.75;
  margin: 18px auto 0;
  text-align: left;
  max-width: 600px;
}
.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.8;
}
td,
th {
  padding: 13px 14px;
  text-align: left;
  border-bottom: 1px solid var(--line);
  min-width: 65px;
}
tr:first-child {
  background: #f2f4ed;
}
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;
}
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;
}
.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-note {
  font-size: 11px;
  color: #939b8e;
  line-height: 2;
  margin: 24px 0;
  border-top: 1px solid var(--line);
  padding-top: 20px;
}
.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;
}
.csl-entry {
  margin: 15px 0;
  overflow-wrap: anywhere;
}
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;
  }
  figcaption {
    font-size: 11px;
  }
  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;
  }
}
.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 {
  font:
    12px/1.65 Georgia,
    serif;
  color: #9aa391;
}
.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;
}
