﻿:root {
  --bg: #f6f1e8;
  --panel: rgba(255,255,255,0.82);
  --panel-strong: #fffdf8;
  --ink: #1f2a25;
  --muted: #5d685f;
  --line: rgba(31,42,37,0.12);
  --accent: #234f3d;
  --accent-soft: #dfe8df;
  --accent-warm: #9e5f2d;
  --shadow: 0 18px 40px rgba(28, 32, 27, 0.08);
  --radius: 22px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(158,95,45,0.10), transparent 30%),
    radial-gradient(circle at bottom right, rgba(35,79,61,0.12), transparent 28%),
    linear-gradient(180deg, #f8f3eb 0%, var(--bg) 100%);
  font-family: "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}
a { color: inherit; text-decoration: none; }

.site-shell {
  display: grid;
  grid-template-columns: 290px minmax(0, 1fr) 260px;
  gap: 20px;
  min-height: 100vh;
  padding: 18px;
}

.sidebar, .toc-card, .overview-card, .chapter-card, .stat-card, .reading-page, .search-page-shell {
  backdrop-filter: blur(12px);
  background: var(--panel);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.sidebar {
  position: sticky;
  top: 18px;
  align-self: start;
  height: calc(100vh - 36px);
  border-radius: 28px;
  padding: 22px 18px;
  overflow: auto;
}

.brand {
  display: block;
  margin-bottom: 10px;
}

.brand-kicker, .eyebrow, .nav-caption, .toc-caption {
  display: inline-block;
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
}

.brand strong, .hero h1, .page-header h1, .chapter-card h3, .overview-card h2, .section-head h2, .section-title {
  font-family: Georgia, "Source Han Serif SC", "Noto Serif SC", "Songti SC", serif;
}

.brand strong {
  display: block;
  margin-top: 6px;
  font-size: 30px;
  line-height: 1.18;
}

.brand-copy {
  margin: 0 0 18px;
  color: var(--muted);
  line-height: 1.7;
  font-size: 14px;
}

.search-box, .search-stage {
  display: flex;
  gap: 8px;
}

.search-box {
  margin-bottom: 18px;
}

.search-box input, .search-stage input {
  width: 100%;
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.72);
  border-radius: 999px;
  padding: 12px 14px;
  color: var(--ink);
}

.search-box button, .search-stage button, .primary-btn, .secondary-btn {
  border: 0;
  cursor: pointer;
  border-radius: 999px;
  padding: 11px 16px;
  font-weight: 600;
}

.search-box button, .search-stage button, .primary-btn {
  background: var(--accent);
  color: white;
}

.secondary-btn {
  background: rgba(35,79,61,0.10);
  color: var(--accent);
}

.nav-stack {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.nav-link {
  display: block;
  padding: 10px 12px;
  border-radius: 14px;
  color: var(--muted);
  transition: 0.2s ease;
}

.nav-link:hover, .nav-link.is-active {
  background: rgba(35,79,61,0.10);
  color: var(--ink);
}

.main-panel {
  min-width: 0;
}

.hero, .overview-grid, .chapter-grid {
  margin-bottom: 22px;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(260px, 0.8fr);
  gap: 20px;
}

.hero-copy, .hero-stats, .overview-card, .reading-page, .search-page-shell {
  border-radius: 28px;
  padding: 28px;
}

.hero-text, .page-lead, .overview-card p, .chapter-card p, .prose p, .search-status {
  line-height: 1.86;
  color: var(--muted);
}

.hero h1 {
  font-size: clamp(34px, 5vw, 58px);
  margin: 10px 0 14px;
  line-height: 1.05;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 22px;
}

.hero-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.stat-card {
  border-radius: 22px;
  padding: 18px;
  background: rgba(255,253,248,0.86);
}

.stat-card span {
  display: block;
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 8px;
}

.stat-card strong {
  display: block;
  font-size: 22px;
  line-height: 1.35;
}

.overview-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.overview-card h2, .section-head h2, .page-header h1 {
  margin: 10px 0 12px;
}

.chapter-grid .section-head {
  margin-bottom: 16px;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.chapter-card {
  border-radius: 24px;
  padding: 22px;
  position: relative;
  overflow: hidden;
}

.chapter-card::after {
  content: "";
  position: absolute;
  inset: auto -20px -20px auto;
  width: 90px;
  height: 90px;
  border-radius: 50%;
  background: rgba(35,79,61,0.08);
}

.chapter-order {
  display: inline-flex;
  width: 44px;
  height: 44px;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(35,79,61,0.12);
  color: var(--accent);
  font-weight: 700;
}

.toc-panel {
  position: sticky;
  top: 18px;
  align-self: start;
}

.toc-card {
  border-radius: 24px;
  padding: 18px;
}

.toc-link {
  display: block;
  padding: 7px 0;
  color: var(--muted);
  line-height: 1.5;
}

.toc-link:hover {
  color: var(--ink);
}

.toc-level-3, .toc-level-4, .toc-level-5 {
  padding-left: 14px;
}

.reading-page .prose {
  margin-top: 22px;
}

.prose p {
  margin: 0 0 1.1em;
  font-size: 17px;
}

.section-title {
  margin: 2.2em 0 0.8em;
  line-height: 1.3;
}

.section-title.level-2 { font-size: 31px; }
.section-title.level-3 { font-size: 25px; }
.section-title.level-4, .section-title.level-5 { font-size: 20px; }

.table-wrap {
  overflow: auto;
  margin: 1.4em 0 2em;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: var(--panel-strong);
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 620px;
}

th, td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
  line-height: 1.65;
  text-align: left;
}

th {
  background: rgba(35,79,61,0.08);
}

.pager {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 34px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.pager-link {
  color: var(--accent);
  font-weight: 600;
}

.pager-link.is-muted, .muted {
  color: var(--muted);
}

.search-results {
  display: grid;
  gap: 14px;
  margin-top: 18px;
}

.search-result {
  border-radius: 18px;
  padding: 18px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.68);
}

.search-result h3 {
  margin: 0 0 8px;
  font-size: 18px;
}

.search-result p {
  margin: 0;
  line-height: 1.8;
  color: var(--muted);
}

@media (max-width: 1180px) {
  .site-shell {
    grid-template-columns: 1fr;
  }
  .sidebar, .toc-panel {
    position: static;
    height: auto;
  }
  .hero, .overview-grid, .card-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .site-shell {
    padding: 12px;
    gap: 12px;
  }
  .hero-copy, .hero-stats, .overview-card, .reading-page, .search-page-shell, .sidebar, .toc-card, .chapter-card {
    padding: 20px;
    border-radius: 22px;
  }
  .prose p {
    font-size: 16px;
  }
  .section-title.level-2 { font-size: 26px; }
}
