
:root {
  --bg: #f7f2ea;
  --ink: #2a1018;
  --muted: #6d4a54;
  --accent: #7a1535;
  --edge: #e4d0d6;
  --top: #7a1535;
  --gold: #e0b04a;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Georgia", "Times New Roman", serif;
  line-height: 1.7;
}
.top {
  display: flex; gap: 18px; align-items: baseline; flex-wrap: wrap;
  background: var(--top); color: #f0ebe6;
  padding: 14px 22px; font-family: "Segoe UI", system-ui, sans-serif;
}
.top a { color: var(--gold); text-decoration: none; }
.top a:hover { text-decoration: underline; }
.top .book { color: #f0ebe6; font-weight: 600; }
.layout { display: grid; grid-template-columns: 280px 1fr; max-width: 1240px; margin: 0 auto; }
.toc {
  padding: 28px 18px 60px 22px;
  border-right: 1px solid var(--edge);
  font-family: "Segoe UI", system-ui, sans-serif;
  font-size: 13.5px; line-height: 1.45;
  position: sticky; top: 0; align-self: start; max-height: 100vh; overflow: auto;
}
.toc a { display: block; color: var(--muted); text-decoration: none; padding: 5px 8px; border-radius: 6px; }
.toc a:hover, .toc a.current { background: #f3e4e8; color: var(--accent); }
.chapter { max-width: 46rem; padding: 36px 28px 80px; }
.hub { margin: 0 auto; }
.kicker { letter-spacing: .14em; text-transform: uppercase; font-size: 12px; color: var(--accent);
  font-family: "Segoe UI", system-ui, sans-serif; }
h1 { font-size: 2rem; line-height: 1.25; margin: .2em 0 .3em; font-weight: 600; }
h2 { font-size: 1.28rem; margin: 2em 0 .6em; color: var(--accent); font-weight: 600; }
h3 { font-size: 1.08rem; margin: 1.5em 0 .4em; }
h4 { font-size: 1rem; margin: 1.3em 0 .35em; font-weight: 600; }
.subtitle { font-size: 1.08rem; color: var(--muted); margin: 0 0 .3em; }
.byline { font-style: italic; color: var(--muted); margin-bottom: 2em; }
p { margin: 0 0 1em; }
p.caption { font-size: .92em; color: var(--muted); font-style: italic; margin: .2em 0 1.2em; }
p.dedication { text-align: center; font-style: italic; margin: 2em 0 .4em; color: var(--accent); }
p.ref {
  font-size: .92em; margin: 0 0 .7em; padding-left: 1.6em; text-indent: -1.6em;
  font-family: "Georgia", serif;
}
.gallery { display: flex; flex-wrap: wrap; gap: 10px; margin: 1em 0 .3em; }
.gallery img, figure img {
  max-width: 100%; height: auto; border-radius: 4px;
  box-shadow: 0 1px 4px rgba(42,16,24,.12);
}
.gallery img { flex: 1 1 260px; max-height: 520px; object-fit: contain; background: #f3e4e8; }
.table-wrap { overflow-x: auto; margin: 1.2em 0; }
table { border-collapse: collapse; font-size: .85rem; font-family: "Segoe UI", system-ui, sans-serif; width: 100%; }
th, td { border: 1px solid var(--edge); padding: 6px 8px; text-align: left; vertical-align: top; }
th { background: #f3e4e8; }
ul { margin: 0 0 1em; padding-left: 1.2em; }
.contents { padding-left: 1.2em; }
.contents a { color: var(--accent); }
.pager {
  display: flex; justify-content: space-between; gap: 12px; margin-top: 3em;
  padding-top: 1.2em; border-top: 1px solid var(--edge);
  font-family: "Segoe UI", system-ui, sans-serif; font-size: 14px;
}
.pager a { color: var(--accent); text-decoration: none; }
.pager a:hover { text-decoration: underline; }
sub, sup { font-size: .75em; }
@media (max-width: 860px) {
  .layout { grid-template-columns: 1fr; }
  .toc { position: static; max-height: none; border-right: 0; border-bottom: 1px solid var(--edge);
    display: flex; flex-wrap: wrap; gap: 4px 8px; padding: 12px 16px; }
  .toc a { display: inline-block; }
}
