:root {
  color-scheme: light dark;
  --bg: #fbfaf7;
  --fg: #26241f;
  --muted: #6f6a60;
  --line: #e4e0d6;
  --link: #2f6b5a;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #171613;
    --fg: #e8e4da;
    --muted: #a09a8d;
    --line: #34312a;
    --link: #8cc7b3;
  }
}

* {
  box-sizing: border-box;
}

body {
  max-width: 40rem;
  margin: 0 auto;
  padding: 2rem 1.25rem 4rem;
  background: var(--bg);
  color: var(--fg);
  font-family: system-ui, -apple-system, "PingFang TC", "Noto Sans TC", "Microsoft JhengHei", sans-serif;
  font-size: 1.0625rem;
  line-height: 1.9;
}

a {
  color: var(--link);
}

.site-header {
  margin-bottom: 2.5rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--line);
}

.site-header a {
  color: var(--muted);
  text-decoration: none;
}

h1 {
  font-size: 1.6rem;
  line-height: 1.4;
}

h2 {
  margin-top: 2.5rem;
  font-size: 1.2rem;
}

blockquote {
  margin: 1.5rem 0;
  padding: 0 0 0 1rem;
  border-left: 3px solid var(--line);
}

.intro,
.eyebrow {
  color: var(--muted);
}

.eyebrow {
  margin-bottom: 0;
  font-size: 0.9rem;
}

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

.shelf {
  padding: 0;
  list-style: none;
}

.shelf li {
  padding: 1rem 0;
  border-bottom: 1px solid var(--line);
}

.shelf a {
  font-size: 1.1rem;
  font-weight: 600;
  text-decoration: none;
}

.shelf p {
  margin: 0.25rem 0 0;
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.7;
}

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

/* 章次欄寬容得下三位數（480 章那種書） */
.toc li {
  display: grid;
  grid-template-columns: 2.75rem 1fr;
  padding: 0.9rem 0;
  border-bottom: 1px solid var(--line);
}

/* 編號用講記的章次，不用清單順序，所以中間缺章時號碼也不會錯 */
.toc li::before {
  content: attr(data-n);
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.toc a {
  font-weight: 600;
  text-decoration: none;
}

.toc p {
  grid-column: 2;
  margin: 0.15rem 0 0;
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.7;
}

.source {
  margin-top: 3rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.9rem;
}

.pager {
  display: flex;
  margin-top: 2rem;
}

.pager a {
  padding: 0.75rem 0;
  text-decoration: none;
}

.pager a:hover {
  text-decoration: underline;
}

.pager .prev {
  color: var(--muted);
}

.pager .next {
  margin-left: auto;
  color: var(--link);
  font-weight: 600;
}

.back {
  margin: 0;
  text-align: center;
}

.back a {
  display: inline-block;
  padding: 0.5rem 1rem;
  color: var(--muted);
  font-size: 0.95rem;
  text-decoration: none;
}

.back a:hover {
  text-decoration: underline;
}

.site-footer {
  margin-top: 4rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.85rem;
  line-height: 1.7;
}
