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

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

* {
  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;
}

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

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

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

.toc li {
  display: grid;
  grid-template-columns: 2.25rem 1fr;
  padding: 0.9rem 0;
  border-bottom: 1px solid var(--line);
  counter-increment: toc;
}

.toc li::before {
  content: counter(toc, decimal-leading-zero);
  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;
}
