:root {
  --bg: #faf9f7;
  --text: #2c2c2c;
  --muted: #888;
  --border: #e5e2dd;
  --accent: #8b6f47;
  --font-size: 18px;
  --line-height: 1.9;
}

[data-theme="dark"] {
  --bg: #1a1a1a;
  --text: #c8c8c8;
  --muted: #777;
  --border: #333;
  --accent: #b89a6f;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: var(--font-size);
  line-height: var(--line-height);
  transition: background .2s, color .2s;
}

a { color: inherit; text-decoration: none; }

.container {
  max-width: 720px;
  margin: 0 auto;
  padding: 40px 20px 80px;
}

/* 首页 */
.site-title {
  font-size: 1.6em;
  font-weight: 600;
  margin-bottom: 8px;
}
.site-sub {
  color: var(--muted);
  font-size: .9em;
  margin-bottom: 48px;
}

.book-card {
  padding: 24px 0;
  border-bottom: 1px solid var(--border);
}
.book-card h2 {
  font-size: 1.2em;
  margin-bottom: 6px;
}
.book-card .author {
  color: var(--muted);
  font-size: .85em;
  margin-bottom: 12px;
}
.book-card .intro {
  font-size: .95em;
  color: var(--text);
  opacity: .85;
  margin-bottom: 16px;
}
.book-card .btn {
  display: inline-block;
  padding: 8px 18px;
  border: 1px solid var(--accent);
  color: var(--accent);
  border-radius: 4px;
  font-size: .9em;
  transition: all .2s;
}
.book-card .btn:hover {
  background: var(--accent);
  color: var(--bg);
}

/* 顶栏 */
.topbar {
  position: sticky;
  top: 0;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  z-index: 10;
}
.topbar-inner {
  max-width: 720px;
  margin: 0 auto;
  padding: 12px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: .9em;
}
.topbar a, .topbar button {
  background: none;
  border: none;
  color: var(--text);
  font-size: 1em;
  cursor: pointer;
  padding: 4px 8px;
  font-family: inherit;
}
.topbar button:hover, .topbar a:hover {
  color: var(--accent);
}
.tools { display: flex; gap: 8px; align-items: center; }

/* 目录页 */
.book-header {
  text-align: center;
  padding: 32px 0 40px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 32px;
}
.book-header h1 {
  font-size: 1.5em;
  margin-bottom: 10px;
}
.book-header .author {
  color: var(--muted);
  font-size: .9em;
  margin-bottom: 16px;
}
.book-header .intro {
  font-size: .95em;
  opacity: .8;
  max-width: 500px;
  margin: 0 auto;
}

.chapter-list { list-style: none; }
.chapter-list li {
  border-bottom: 1px solid var(--border);
}
.chapter-list a {
  display: block;
  padding: 14px 4px;
  font-size: .95em;
  transition: color .2s, padding-left .2s;
}
.chapter-list a:hover {
  color: var(--accent);
  padding-left: 12px;
}

/* 阅读页 */
.chapter-title {
  font-size: 1.3em;
  font-weight: 600;
  margin: 16px 0 36px;
  text-align: center;
}
.chapter-content p {
  text-indent: 2em;
  margin-bottom: 1em;
}

.chapter-nav {
  display: flex;
  justify-content: space-between;
  margin-top: 60px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
  font-size: .9em;
}
.chapter-nav a {
  color: var(--accent);
  padding: 8px 0;
}
.chapter-nav .disabled {
  color: var(--muted);
  opacity: .4;
  pointer-events: none;
}

.empty { color: var(--muted); text-align: center; padding: 40px 0; }