
:root {
  color-scheme: light;
  --bg: #f6efe3;
  --panel: #fffaf1;
  --panel-2: #fffdf8;
  --ink: #2b241c;
  --muted: #7b6d5d;
  --accent: #8a5628;
  --accent-2: #b7793d;
  --line: #eadcc7;
  --shadow: rgba(64, 44, 18, 0.08);
  --reader-font-size: 20px;
  --reader-line-height: 2.05;
}
body.dark {
  color-scheme: dark;
  --bg: #14100c;
  --panel: #211a14;
  --panel-2: #1b1510;
  --ink: #eadfce;
  --muted: #ad9b84;
  --accent: #e0ad73;
  --accent-2: #f1c892;
  --line: #3b2e22;
  --shadow: rgba(0, 0, 0, 0.28);
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: "Noto Serif SC", "LXGW WenKai", "Source Han Serif SC", "PingFang SC", "Microsoft YaHei", serif;
  background: radial-gradient(circle at top left, rgba(183,121,61,.16), transparent 32rem), var(--bg);
  color: var(--ink);
}
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-2); text-decoration: underline; }
.container { max-width: 1180px; margin: 0 auto; padding: 30px 18px 76px; }
.reader-container { max-width: 900px; }
.header { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; margin-bottom: 24px; }
.title { font-size: clamp(30px, 5vw, 48px); margin: 0 0 8px; letter-spacing: .04em; }
.subtitle { color: var(--muted); margin: 0; line-height: 1.7; }
.toolbar { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; }
button, .btn {
  border: 1px solid var(--line); background: var(--panel); color: var(--ink);
  border-radius: 999px; padding: 8px 13px; cursor: pointer; font: inherit; font-size: 14px;
  box-shadow: 0 4px 16px var(--shadow);
}
button:hover, .btn:hover { border-color: var(--accent); text-decoration: none; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 18px; }
.card { background: linear-gradient(180deg, var(--panel) 0%, var(--panel-2) 100%); border: 1px solid var(--line); border-radius: 20px; padding: 20px; box-shadow: 0 12px 34px var(--shadow); }
.book-title { font-size: 24px; margin: 0 0 12px; line-height: 1.35; }
.meta { color: var(--muted); font-size: 14px; margin: 7px 0; line-height: 1.5; }
.badges { display: flex; gap: 8px; flex-wrap: wrap; margin: 12px 0; }
.badge { display: inline-flex; border: 1px solid var(--line); border-radius: 999px; padding: 3px 9px; color: var(--muted); font-size: 12px; }
.chapter-list { list-style: none; padding: 0; margin: 20px 0 0; display: grid; gap: 10px; }
.chapter-list li { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 6px 18px var(--shadow); overflow: hidden; }
.chapter-list a { display: grid; grid-template-columns: 1fr auto; gap: 14px; padding: 13px 15px; align-items: center; }
.chapter-list .status { color: var(--muted); font-size: 13px; }
.breadcrumb { margin-bottom: 18px; color: var(--muted); font-size: 14px; line-height: 1.7; }
.chapter { background: var(--panel); border: 1px solid var(--line); border-radius: 22px; padding: clamp(22px, 4vw, 44px); box-shadow: 0 12px 34px var(--shadow); }
.chapter h1 { margin: 0 0 12px; font-size: clamp(28px, 5vw, 42px); line-height: 1.25; }
.chapter .chapter-meta { color: var(--muted); margin-bottom: 24px; }
.content { font-size: var(--reader-font-size); line-height: var(--reader-line-height); white-space: pre-wrap; letter-spacing: .02em; }
.content h1:first-child { display: none; }
.footer { margin-top: 32px; color: var(--muted); font-size: 13px; }
.nav-links { display: flex; justify-content: space-between; gap: 16px; margin-top: 30px; }
.nav-links a, .nav-links span { min-width: 7em; }
.nav-links a { background: rgba(183, 121, 61, .13); border: 1px solid var(--line); border-radius: 14px; padding: 11px 15px; }
.floating { position: fixed; right: 18px; bottom: 18px; display: flex; flex-direction: column; gap: 8px; z-index: 10; }
.progress { position: fixed; left: 0; top: 0; height: 3px; width: 0; background: var(--accent-2); z-index: 20; }
@media (max-width: 720px) {
  .header { display: block; }
  .toolbar { justify-content: flex-start; margin-top: 14px; }
  .container { padding-inline: 14px; }
  .chapter { border-radius: 16px; padding: 20px 16px; }
  .content { font-size: var(--reader-font-size); line-height: 1.95; }
  .chapter-list a { grid-template-columns: 1fr; }
}
