:root {
  color-scheme: light;
  --bg: #f7f6f1;
  --panel: #ffffff;
  --ink: #202124;
  --muted: #66706a;
  --line: #d9d6cc;
  --accent: #1f6f61;
  --accent-2: #9b3d2f;
  --soft: #e9f2ef;
  --shadow: 0 10px 28px rgba(35, 38, 35, .08);
}
html[data-theme="dark"] {
  color-scheme: dark;
  --bg: #171a18;
  --panel: #222723;
  --ink: #f0eee6;
  --muted: #aeb8b0;
  --line: #3a423d;
  --accent: #77c7b4;
  --accent-2: #e18b7e;
  --soft: #23362f;
  --shadow: 0 14px 32px rgba(0, 0, 0, .24);
}
* { box-sizing: border-box; }
body { margin: 0; font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif; background: var(--bg); color: var(--ink); line-height: 1.72; }
a { color: inherit; }
.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 18px; padding: 12px 24px; border-bottom: 1px solid var(--line); background: color-mix(in srgb, var(--bg) 90%, transparent); backdrop-filter: blur(14px); }
.brand { font-weight: 800; text-decoration: none; white-space: nowrap; }
nav { display: flex; gap: 8px; margin-left: auto; }
nav a, .tag, .button { text-decoration: none; border: 1px solid var(--line); border-radius: 8px; padding: 6px 10px; background: var(--panel); }
nav a.active, .tag:hover, .button:hover { border-color: var(--accent); color: var(--accent); }
.icon-button { width: 34px; height: 34px; border-radius: 8px; border: 1px solid var(--line); background: var(--panel); color: var(--ink); cursor: pointer; }
main { max-width: 1180px; margin: 0 auto; padding: 28px 22px 64px; }
.hero { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(280px, .8fr); gap: 24px; align-items: end; padding: 36px 0 26px; border-bottom: 1px solid var(--line); }
.hero h1 { font-size: clamp(32px, 5vw, 58px); line-height: 1.08; margin: 0 0 16px; letter-spacing: 0; }
.hero p { color: var(--muted); font-size: 18px; max-width: 760px; }
.metric-grid, .grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; }
.metric { border-left: 4px solid var(--accent); padding: 16px; background: var(--panel); box-shadow: var(--shadow); border-radius: 8px; }
.metric strong { display: block; font-size: 28px; }
.hero-visual { display: grid; grid-template-columns: 1.2fr .8fr; gap: 10px; align-items: stretch; }
.hero-visual a { min-height: 140px; }
.hero-visual a:first-child { grid-row: span 2; }
.visual-strip { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 10px; margin-top: 14px; }
.visual-strip .plate-thumb { min-height: 96px; }
.chapter-card-figure { display: block; margin: -20px -20px 14px; border-bottom: 1px solid var(--line); background: #fff; max-height: 180px; overflow: hidden; }
.chapter-card-figure img { width: 100%; height: 180px; object-fit: contain; display: block; }
.card { margin: 18px 0; padding: 20px; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; box-shadow: var(--shadow); }
.card h2, .card h3 { margin-top: 0; line-height: 1.25; }
.chapter-layout { display: grid; grid-template-columns: minmax(0, 1fr) 310px; gap: 18px; align-items: start; }
.side { position: sticky; top: 76px; }
.tag-row { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0; }
.route { display: flex; flex-wrap: wrap; gap: 8px; }
.route a { flex: 1 1 160px; min-height: 44px; }
.deep-card { border-top: 1px solid var(--line); padding: 14px 0; }
.deep-card h3 { margin: 0 0 6px; font-size: 18px; }
details { border: 1px solid var(--line); border-radius: 8px; padding: 14px 16px; background: var(--soft); }
summary { cursor: pointer; font-weight: 700; }
.plate-thumb { display: block; background: var(--bg); border: 1px solid var(--line); border-radius: 8px; overflow: hidden; min-height: 120px; text-decoration: none; }
.plate-thumb img, .plate-full img { width: 100%; display: block; object-fit: contain; background: #fff; }
.plate-thumb span { display: block; padding: 8px 10px; font-size: 13px; color: var(--muted); }
.plate-full { background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 8px; }
.small { color: var(--muted); font-size: 14px; }
.searchbar { width: 100%; padding: 12px 14px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); color: var(--ink); font-size: 16px; margin: 10px 0 18px; }
.pathbar { display: flex; justify-content: space-between; gap: 10px; margin-top: 18px; }
.pathbar a { flex: 1; }
@media (max-width: 860px) {
  .hero, .chapter-layout { grid-template-columns: 1fr; }
  .hero-visual { grid-template-columns: 1fr 1fr; }
  .side { position: static; }
  .topbar { padding: 10px 12px; gap: 8px; }
  nav a { padding: 5px 8px; }
  .brand { max-width: 48vw; overflow: hidden; text-overflow: ellipsis; }
}
