:root {
  --sidebar-w: 17rem;
  --map-ink: #17201d;
  --map-paper: #f4ead3;
  --map-paper-deep: #dbc79d;
  --map-red: #a63d2f;
  --map-green: #58725f;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background:
    radial-gradient(circle at 78% 7%, rgba(166, 61, 47, .045), transparent 24rem),
    linear-gradient(180deg, #fbfaf6 0%, #fff 28rem);
}

.article-nav {
  max-width: 84rem;
}

/* 独立书籍布局：不继承其他书籍中多版本叠加的历史规则。 */
.book-layout,
.book-layout.book-layout-index {
  display: grid;
  grid-template-columns: var(--sidebar-w) minmax(0, 1fr);
  gap: 2.5rem;
  width: 100%;
  max-width: 84rem;
  margin: 0 auto;
  padding: 5rem 1.25rem 4rem;
  align-items: start;
}

.book-main {
  min-width: 0;
}

.book-article {
  width: 100%;
  max-width: 54rem;
}

.book-sidebar {
  position: sticky;
  top: 5rem;
  max-height: calc(100vh - 6rem);
  overflow-y: auto;
  padding: .25rem .5rem 1rem 0;
  scrollbar-width: thin;
  scrollbar-color: #cfc4ad transparent;
}

.book-sidebar-title {
  display: block;
  margin-bottom: .85rem;
  padding: .15rem 0 .7rem;
  border-bottom: 1px solid #ded7c9;
  color: #17201d;
  font-size: .98rem;
  font-weight: 850;
  line-height: 1.45;
}

.book-toc {
  font-size: .84rem;
}

.book-toc .toc-part {
  margin: 1rem 0 .28rem;
  color: #765a32;
  font-size: .68rem;
  font-weight: 900;
  letter-spacing: .055em;
}

.book-toc ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.book-toc li {
  margin: 0;
  padding: 0;
}

.book-toc li::before {
  content: none;
}

.book-toc a {
  position: relative;
  display: grid;
  grid-template-columns: 1.7rem minmax(0, 1fr);
  gap: .25rem;
  padding: .34rem .55rem;
  border-radius: .5rem;
  color: #53625a;
  font-weight: 560;
  line-height: 1.55;
}

.book-toc a:hover {
  background: #f3eee2;
  color: #293b32;
}

.book-toc a.is-current {
  background: #eee6d5;
  color: #293b32;
  font-weight: 780;
}

.book-toc a.is-current::before {
  content: "";
  position: absolute;
  inset: .42rem auto .42rem .08rem;
  width: 3px;
  border-radius: 999px;
  background: var(--map-red);
}

.book-toc .toc-num {
  margin: 0;
  color: #9d8f76;
  font-weight: 750;
  font-variant-numeric: tabular-nums;
}

.book-sidebar-toggle {
  display: none;
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  z-index: 60;
  padding: .62rem 1rem;
  border: 0;
  border-radius: 999px;
  background: #293b32;
  color: #fff;
  font: inherit;
  font-size: .88rem;
  font-weight: 800;
  box-shadow: 0 14px 32px -16px rgba(23, 32, 29, .8);
  cursor: pointer;
}

.book-chapter-hero {
  margin-bottom: 1.35rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid #e6e1d7;
}

.book-breadcrumb {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  margin-bottom: 1.25rem;
  color: #765a32;
  font-size: .8rem;
  font-weight: 800;
}

.book-breadcrumb .sep {
  color: #c9bfad;
}

.book-h1 {
  margin: 0 0 .65rem;
  color: #17201d;
  font-size: clamp(1.5rem, 2.2vw, 1.95rem);
  font-weight: 820;
  line-height: 1.32;
  letter-spacing: -.01em;
}

.book-byline-inline {
  margin: .2rem 0 0;
  color: #748078;
  font-size: .82rem;
  font-weight: 520;
  line-height: 1.55;
}

.book-body {
  max-width: none;
  color: #33423a;
  font-size: 1rem;
  line-height: 1.9;
}

.book-body p {
  margin: .78rem 0;
}

.book-body h2 {
  margin: 2rem 0 .72rem;
  padding: 0 0 0 .7rem;
  border-left: 3px solid var(--map-red);
  color: #1f2c26;
  font-size: clamp(1.08rem, 1.55vw, 1.28rem);
  font-weight: 780;
  line-height: 1.45;
}

.book-body h3 {
  margin: 1.35rem 0 .5rem;
  color: #3d5146;
  font-size: 1rem;
  font-weight: 760;
  line-height: 1.5;
}

.book-body ul,
.book-body ol {
  margin: .95rem 0;
}

.book-body ul {
  padding: 0;
  list-style: none;
}

.book-body ul > li {
  position: relative;
  margin: .4rem 0;
  padding-left: 1.25rem;
  color: #46584e;
  line-height: 1.8;
}

.book-body ul > li::before {
  content: "";
  position: absolute;
  top: .72em;
  left: .1rem;
  width: .4rem;
  height: .4rem;
  border-radius: 50%;
  background: var(--map-green);
}

.book-body ol {
  padding-left: 1.45rem;
}

.book-body ol > li {
  margin: .4rem 0;
  padding-left: .15rem;
  color: #46584e;
  line-height: 1.8;
}

.book-body ol > li::before {
  content: none;
}

.book-body blockquote {
  margin: 1.1rem 0;
  padding: .8rem 1rem;
  border: 1px solid #e7dfd0;
  border-left: 3px solid var(--map-green);
  border-radius: .6rem;
  background: #fbf8f1;
  color: #3f5147;
  font-family: ui-serif, "Songti SC", "Noto Serif SC", STSong, serif;
  font-size: .98rem;
  font-weight: 560;
  line-height: 1.78;
}

.book-body blockquote p {
  margin: .2rem 0;
}

.book-body strong {
  color: #1f2c26;
}

.book-body hr {
  margin: 2.5rem 0;
  border: 0;
  border-top: 1px solid #d8ceba;
}

.book-meta {
  margin: 1rem 0 1.35rem;
  padding: .9rem 1rem;
  border: 1px solid #e4ddce;
  border-radius: .7rem;
  background: #fffefa;
  font-size: .9rem;
}

.book-meta-row {
  display: flex;
  gap: .8rem;
  padding: .38rem 0;
  line-height: 1.65;
}

.book-meta-row + .book-meta-row {
  border-top: 1px solid #eee8dc;
}

.book-meta-key {
  flex: 0 0 4.2rem;
  color: #7d887f;
  font-weight: 760;
}

.book-meta-val {
  min-width: 0;
  color: #33423a;
}

.book-parts-grid {
  display: grid;
  gap: .8rem;
  margin: 1.15rem 0;
}

.book-part-card {
  padding: 1.05rem 1.15rem;
  border: 1px solid #e4ddce;
  border-radius: .75rem;
  background: #fffefa;
}

.book-part-card h3 {
  margin: 0 0 .4rem;
  color: #25372e;
  font-size: 1rem;
}

.book-part-card .part-theme {
  margin: 0 0 .75rem;
  color: #67746d;
  font-size: .88rem;
  line-height: 1.65;
}

.book-part-card .part-chapters {
  display: flex;
  flex-wrap: wrap;
  gap: .42rem;
}

.book-part-card .part-chapters a {
  padding: .27rem .62rem;
  border-radius: 999px;
  font-size: .8rem;
  font-weight: 720;
}

.book-pager {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 2.8rem;
  padding-top: 1.4rem;
  border-top: 1px solid #ded7c9;
}

.book-pager a {
  flex: 1;
  max-width: 48%;
  padding: .9rem 1rem;
  border: 1px solid #ded7c9;
  border-radius: .7rem;
  color: #33423a;
}

.book-pager a:hover {
  border-color: #b9a98b;
  background: #fffdf8;
}

.book-pager .pager-dir {
  color: #7b877f;
  font-size: .73rem;
  font-weight: 800;
}

.book-pager .pager-title {
  display: block;
  margin-top: .25rem;
  color: #25372e;
  font-weight: 800;
  line-height: 1.5;
}

.book-pager .pager-next {
  margin-left: auto;
  text-align: right;
}

.book-end {
  margin-top: 2.5rem;
  padding-top: 1.2rem;
  border-top: 1px dashed #d8ceba;
  color: #7d887f;
  font-size: .86rem;
  font-style: italic;
  text-align: center;
}

.map-cover {
  position: relative;
  min-height: 32rem;
  margin-bottom: 1.15rem;
  overflow: hidden;
  border: 1px solid #d2c4a5;
  border-radius: 1rem;
  background:
    linear-gradient(rgba(244, 234, 211, .94), rgba(235, 221, 190, .94)),
    #efe1c2;
  box-shadow: 0 30px 70px -45px rgba(39, 53, 47, .65);
  color: var(--map-ink);
}

.map-cover::before,
.map-cover::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  border: 1px solid rgba(60, 83, 70, .25);
}

.map-cover::before {
  width: 32rem;
  height: 32rem;
  right: -10rem;
  top: -12rem;
}

.map-cover::after {
  width: 18rem;
  height: 18rem;
  right: -4rem;
  bottom: -9rem;
}

.map-grid {
  position: absolute;
  inset: 0;
  opacity: .22;
  background-image:
    linear-gradient(rgba(74, 92, 80, .3) 1px, transparent 1px),
    linear-gradient(90deg, rgba(74, 92, 80, .3) 1px, transparent 1px);
  background-size: 3rem 3rem;
  mask-image: linear-gradient(115deg, transparent 2%, #000 34%, #000 100%);
}

.map-route {
  position: absolute;
  width: 24rem;
  height: 8rem;
  border-top: 3px solid rgba(166, 61, 47, .7);
  border-radius: 50%;
  transform: rotate(-13deg);
}

.route-one {
  right: -1rem;
  top: 12rem;
}

.route-two {
  right: 4rem;
  top: 19rem;
  width: 17rem;
  height: 6rem;
  border-color: rgba(88, 114, 95, .68);
  transform: rotate(18deg);
}

.map-point {
  position: absolute;
  z-index: 2;
  width: .7rem;
  height: .7rem;
  border: 3px solid var(--map-paper);
  border-radius: 50%;
  background: var(--map-red);
  box-shadow: 0 0 0 1px rgba(89, 44, 35, .35);
}

.point-one { right: 17.5rem; top: 11rem; }
.point-two { right: 8rem; top: 15.4rem; background: var(--map-green); }
.point-three { right: 3.2rem; top: 22.8rem; }

.map-cover-content {
  position: relative;
  z-index: 4;
  display: flex;
  min-height: 32rem;
  padding: 3rem;
  flex-direction: column;
  align-items: flex-start;
}

.map-series {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: space-between;
  color: #52645a;
  font-size: .75rem;
  font-weight: 800;
  letter-spacing: .16em;
}

.map-series b {
  display: inline-flex;
  width: 3rem;
  height: 3rem;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(166, 61, 47, .55);
  color: var(--map-red);
  font-family: ui-serif, Georgia, serif;
  font-size: .78rem;
  letter-spacing: .04em;
  transform: rotate(2deg);
}

.map-kicker {
  margin: 5.4rem 0 .8rem;
  color: var(--map-red);
  font-size: .84rem;
  font-weight: 800;
  letter-spacing: .12em;
}

.map-cover h1 {
  margin: 0;
  color: var(--map-ink);
  font-family: ui-serif, "Songti SC", "Noto Serif SC", STSong, serif;
  font-size: clamp(4rem, 9vw, 6.6rem);
  font-weight: 800;
  line-height: .98;
  letter-spacing: .05em;
}

.map-cover h1 span {
  color: var(--map-red);
}

.map-subtitle {
  margin: 1rem 0 0;
  color: #4c5e54;
  font-family: ui-serif, "Songti SC", serif;
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: .24em;
}

.map-legend {
  display: flex;
  margin-top: auto;
  gap: 1.1rem;
  color: #53625a;
  font-size: .78rem;
  font-weight: 700;
}

.map-legend span {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
}

.map-legend i {
  width: .45rem;
  height: .45rem;
  border-radius: 50%;
  background: var(--map-green);
}

.map-legend span:nth-child(2) i { background: var(--map-red); }
.map-legend span:nth-child(3) i { background: #8f744c; }

.map-author {
  margin-top: 1rem;
  color: #293b32;
  font-family: ui-serif, "Songti SC", serif;
  font-size: .95rem;
  font-weight: 800;
  letter-spacing: .18em;
}

.book-index-intro {
  margin: 1.5rem 0;
}

.book-index-intro h2,
.book-section-heading {
  margin: 1.75rem 0 .7rem;
  color: #26372f;
  font-size: 1.16rem;
}

.book-part-card {
  position: relative;
  overflow: hidden;
  border-color: #e4ddce;
  background: #fffefa;
}

.book-part-card::after {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  width: 5rem;
  height: .22rem;
  background: var(--map-green);
}

.book-part-card.part-practice::after { background: var(--map-red); }
.book-part-card.part-realm::after { background: #9b7a45; }

.part-index {
  position: absolute;
  right: 1rem;
  top: .8rem;
  color: #d9d1c1;
  font-family: ui-serif, Georgia, serif;
  font-size: 2rem;
  font-weight: 800;
}

.book-part-card h3,
.book-part-card .part-theme {
  padding-right: 3rem;
}

.book-part-card .part-chapters a {
  background: #f3eee2;
  color: #4d6256;
}

.book-part-card .part-chapters a:hover {
  background: #ebe0c8;
  color: #293b32;
}

.book-index-actions {
  display: flex;
  justify-content: flex-end;
  gap: .7rem;
  margin: 1.4rem 0 0;
}

.book-index-action {
  display: inline-flex;
  min-height: 2.65rem;
  padding: 0 1rem;
  align-items: center;
  justify-content: center;
  border: 1px solid #d8ceba;
  border-radius: 999px;
  color: #43564c;
  font-size: .86rem;
  font-weight: 800;
}

.book-index-action.primary {
  border-color: var(--map-red);
  background: var(--map-red);
  color: #fff;
}

.book-index-action:hover {
  border-color: var(--map-green);
  color: #263b30;
}

.book-index-action.primary:hover {
  border-color: #8e3025;
  background: #8e3025;
  color: #fff;
}

.book-table-wrap {
  max-width: 100%;
  margin: 1rem 0;
  overflow-x: auto;
  border: 1px solid #e4ddce;
  border-radius: .65rem;
  background: #fffefa;
}

.book-table-wrap table {
  width: 100%;
  min-width: 36rem;
  border-collapse: collapse;
  font-size: .88rem;
  line-height: 1.6;
}

.book-table-wrap th,
.book-table-wrap td {
  padding: .68rem .75rem;
  border-right: 1px solid #eee7d9;
  border-bottom: 1px solid #eee7d9;
  text-align: left;
  vertical-align: top;
}

.book-table-wrap th:last-child,
.book-table-wrap td:last-child { border-right: 0; }
.book-table-wrap tbody tr:last-child td { border-bottom: 0; }

.book-table-wrap th {
  background: #f3eee2;
  color: #293b32;
  font-weight: 800;
}

.book-callout.compare {
  margin: 1.2rem 0;
  padding: .9rem;
  border: 1px solid #e0d5bd;
  border-left: 3px solid #a66a32;
  border-radius: .65rem;
  background: #fffbf2;
  color: #4d4030;
}

.compare-title {
  margin: 0 .15rem .7rem;
  color: #785228;
  font-size: .88rem;
  font-weight: 800;
}

.book-callout.compare .book-table-wrap {
  margin: 0;
}

.book-body hr {
  border-top-color: #d8ceba;
}

@media (max-width: 640px) {
  .map-cover,
  .map-cover-content {
    min-height: 27rem;
  }

  .map-cover-content {
    padding: 1.5rem;
  }

  .map-kicker {
    max-width: 13rem;
    margin-top: 4.2rem;
    line-height: 1.7;
  }

  .map-cover h1 {
    font-size: clamp(3.25rem, 18vw, 4.65rem);
  }

  .map-subtitle {
    font-size: .88rem;
    letter-spacing: .14em;
  }

  .map-legend {
    flex-wrap: wrap;
    gap: .6rem .9rem;
  }

  .route-one { right: -10rem; }
  .route-two { right: -6rem; }
  .point-one { right: 8rem; }
  .point-two { right: 2.5rem; }
  .point-three { right: 1rem; }

  .book-index-actions {
    flex-direction: column;
  }

  .book-index-action {
    width: 100%;
    box-sizing: border-box;
  }
}

@media (max-width: 960px) {
  .book-layout,
  .book-layout.book-layout-index {
    grid-template-columns: 1fr;
    gap: 0;
    padding-top: 4.5rem;
  }

  .book-sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 55;
    width: min(18rem, 86vw);
    max-height: 100vh;
    padding: 5rem 1rem 2rem;
    border-right: 1px solid #ded7c9;
    background: #fffefa;
    box-shadow: 0 0 60px -20px rgba(15, 23, 42, .35);
    transform: translateX(-105%);
    transition: transform .25s ease;
  }

  .book-sidebar.is-open {
    transform: translateX(0);
  }

  .book-sidebar-toggle {
    display: block;
  }

  body.book-sidebar-open::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: 54;
    background: rgba(15, 23, 42, .34);
    backdrop-filter: blur(2px);
  }
}

@media (max-width: 640px) {
  .book-layout,
  .book-layout.book-layout-index {
    padding-right: 1rem;
    padding-bottom: 3rem;
    padding-left: 1rem;
  }

  .book-body {
    font-size: .98rem;
    line-height: 1.84;
  }

  .book-meta-row {
    display: grid;
    grid-template-columns: 3.6rem minmax(0, 1fr);
    gap: .55rem;
  }

  .book-pager {
    flex-direction: column;
  }

  .book-pager a {
    width: 100%;
    max-width: none;
  }
}
