:root {
  --bg: #f3eee4;
  --surface: #faf6ee;
  --surface-2: #e8e0d2;
  --text: #2b241f;
  --text-muted: #5e554b;
  --accent: #7a3224;
  --accent-ink: #fff6ec;
  --border: #d3c6b3;
  --ring: #5f6d45;
  --cta: #6e2c20;
  --cta-wash: rgba(95, 109, 69, 0.28);
  --cta-line: rgba(232, 214, 176, 0.35);
  --fs-h1: 34px;
  --fs-h2: 24px;
  --fs-h3: 18px;
  --fs-body: 16px;
  --fs-small: 13px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
  --space-7: 48px;
  --space-8: 64px;
  --radius-sm: 2px;
  --radius-md: 4px;
  --container: 720px;
  --container-wide: 1180px;
  --ease: cubic-bezier(.2, .7, .3, 1);
  --dur: 160ms;
  --cta-loop: 2.7s;
  --rail: 200px;
  --cta-space: 96px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: "FangSong", "STFangsong", "Songti SC", "SimSun", serif;
  font-size: 16px;
  font-size: var(--fs-body);
  line-height: 1.7;
  color: var(--text);
  background: var(--bg);
  overflow-wrap: anywhere;
  padding-bottom: var(--cta-space);
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: #5c2419; }
a:focus-visible, button:focus-visible, summary:focus-visible {
  outline: 2px solid var(--ring);
  outline-offset: 2px;
}
h1, h2, .brand-mark {
  font-family: "KaiTi", "STKaiti", "Kaiti SC", "FangSong", serif;
  font-weight: 400;
  line-height: 1.25;
  margin: 0 0 var(--space-4);
}
h1 { font-size: 34px; font-size: var(--fs-h1); }
h2 { font-size: 24px; font-size: var(--fs-h2); margin-top: var(--space-7); }
h3 { font-size: 18px; font-size: var(--fs-h3); font-weight: 600; margin: var(--space-5) 0 var(--space-3); }
p { margin: 0 0 var(--space-4); }
ul, ol { margin: 0 0 var(--space-4); padding-left: 1.25em; }
li { margin-bottom: var(--space-2); }
.skip {
  position: absolute; left: -999px; top: 0;
  background: var(--accent); color: var(--accent-ink); padding: 8px 12px; z-index: 100;
}
.skip:focus { left: 8px; }

.shell {
  display: grid;
  grid-template-columns: var(--rail) minmax(0, 1fr);
  min-height: 100vh;
}
.rail {
  position: sticky;
  top: 0;
  align-self: start;
  height: 100vh;
  padding: var(--space-5) var(--space-4);
  border-right: 1px solid var(--border);
  background: var(--surface);
  overflow-y: auto;
}
.rail-brand {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: var(--space-5);
  color: inherit;
  text-decoration: none;
}
.rail-brand img { width: 44px; height: 44px; border-radius: var(--radius-sm); }
.brand-mark {
  font-size: 22px;
  color: var(--accent);
}
.rail-note {
  font-size: var(--fs-small);
  color: var(--text-muted);
  margin-bottom: var(--space-5);
  line-height: 1.5;
}
.rail nav { display: flex; flex-direction: column; gap: 2px; }
.rail nav a {
  display: block;
  padding: 10px 12px;
  color: var(--text);
  text-decoration: none;
  border-radius: var(--radius-sm);
  min-height: 44px;
}
.rail nav a:hover { background: var(--surface-2); }
.rail nav a[aria-current="page"] {
  background: var(--accent);
  color: var(--accent-ink);
}
.rail-foot {
  margin-top: var(--space-6);
  padding-top: var(--space-4);
  border-top: 1px solid var(--border);
  font-size: var(--fs-small);
  color: var(--text-muted);
}
.rail-foot a { color: var(--text-muted); }

.topbar {
  display: none;
  position: sticky;
  top: 0;
  z-index: 40;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 10px 14px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.menu-btn {
  appearance: none;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  min-height: 44px;
  min-width: 44px;
  padding: 0 12px;
  border-radius: var(--radius-sm);
  font: inherit;
  cursor: pointer;
}
.backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(43, 36, 31, 0.35);
  z-index: 45;
}
.backdrop.open { display: block; }

.main { min-width: 0; }
.page {
  width: min(100%, var(--container-wide));
  margin: 0 auto;
  padding: var(--space-6) var(--space-5) var(--space-8);
}
.narrow { max-width: var(--container); }

.hero {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: var(--space-6);
  align-items: end;
  padding-bottom: var(--space-6);
  border-bottom: 1px solid var(--border);
  margin-bottom: var(--space-6);
}
.hero-kicker {
  font-size: var(--fs-small);
  color: var(--ring);
  margin-bottom: var(--space-3);
}
.hero-lead { font-size: 17px; max-width: 38em; }
.hero-fig {
  margin: 0;
  border: 1px solid var(--border);
  background: var(--surface);
  padding: var(--space-2);
}
.hero-fig img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.hero-fig figcaption {
  font-size: var(--fs-small);
  color: var(--text-muted);
  padding: var(--space-2) var(--space-2) 0;
}

.lanes {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-3);
  margin: var(--space-5) 0;
}
.lane-btn {
  appearance: none;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  text-align: left;
  padding: 14px 14px 16px;
  border-radius: var(--radius-sm);
  font: inherit;
  cursor: pointer;
  min-height: 44px;
}
.lane-btn strong { display: block; font-family: "KaiTi", "STKaiti", serif; font-size: 20px; margin-bottom: 6px; }
.lane-btn span { color: var(--text-muted); font-size: 14px; line-height: 1.5; }
.lane-btn[aria-selected="true"] {
  background: var(--accent);
  color: var(--accent-ink);
  border-color: var(--accent);
}
.lane-btn[aria-selected="true"] span { color: rgba(255, 246, 236, 0.85); }
.lane-panels { margin-bottom: var(--space-6); }
.lane-panel {
  display: none;
  background: var(--surface);
  border: 1px solid var(--border);
  padding: var(--space-5);
}
.lane-panel.active { display: block; }
.lane-panel h3 { margin-top: 0; }

.band {
  padding-block: var(--space-6);
  border-top: 1px solid var(--border);
}
.entry-list { list-style: none; padding: 0; margin: 0; }
.entry-list li {
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr);
  gap: var(--space-4);
  padding: var(--space-4) 0;
  border-bottom: 1px solid var(--border);
}
.entry-list .tag {
  font-size: var(--fs-small);
  color: var(--ring);
  padding-top: 4px;
}
.entry-list a { font-family: "KaiTi", "STKaiti", serif; font-size: 20px; text-decoration: none; color: var(--accent); }
.entry-list p { margin: 6px 0 0; color: var(--text-muted); }

.compare {
  width: 100%;
  border-collapse: collapse;
  font-size: 15px;
  background: var(--surface);
}
.compare th, .compare td {
  border: 1px solid var(--border);
  padding: 12px 14px;
  text-align: left;
  vertical-align: top;
}
.compare th { background: var(--surface-2); font-weight: 600; }
.table-wrap { overflow-x: auto; margin-bottom: var(--space-5); }

.fold {
  border: 1px solid var(--border);
  background: var(--surface);
  margin-bottom: var(--space-3);
}
.fold summary {
  cursor: pointer;
  list-style: none;
  padding: 14px 16px;
  min-height: 44px;
  font-family: "KaiTi", "STKaiti", serif;
  font-size: 18px;
}
.fold summary::-webkit-details-marker { display: none; }
.fold[open] summary { border-bottom: 1px solid var(--border); }
.fold .fold-body { padding: 14px 16px 16px; }

.faq details.fold h3 { margin: 0; font-size: 18px; font-weight: 400; }
.chip-row { display: flex; flex-wrap: wrap; gap: 8px; margin: var(--space-4) 0; }
.chip {
  display: inline-block;
  padding: 6px 10px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  font-size: 13px;
  border-radius: var(--radius-sm);
  text-decoration: none;
}
.chip:hover { border-color: var(--accent); color: var(--accent); }

.site-footer {
  border-top: 1px solid var(--border);
  padding: var(--space-6) var(--space-5) var(--space-7);
  background: var(--surface);
}
.site-footer .foot-inner {
  width: min(100%, var(--container-wide));
  margin: 0 auto;
  display: grid;
  gap: var(--space-4);
}
.site-footer nav { display: flex; flex-wrap: wrap; gap: 10px 18px; }
.site-footer .brand-link {
  font-family: "KaiTi", "STKaiti", serif;
  font-size: 20px;
  color: var(--accent);
  text-decoration: none;
}
.site-footer .tagline { color: var(--text-muted); font-size: var(--fs-small); margin: 0; }

.site-cta {
  position: fixed;
  left: 50%;
  bottom: calc(14px + env(safe-area-inset-bottom, 0px));
  transform: translateX(-50%);
  z-index: 60;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 56px;
  width: min(520px, 38vw);
  padding: 0 22px;
  background: var(--cta);
  color: var(--accent-ink);
  text-decoration: none;
  font-family: "KaiTi", "STKaiti", serif;
  font-size: 18px;
  border-radius: var(--radius-md);
  box-shadow: 0 8px 22px rgba(43, 36, 31, 0.18), inset 0 0 0 1px rgba(232, 214, 176, 0.18);
  overflow: hidden;
  isolation: isolate;
}
.site-cta:hover, .site-cta:focus-visible { color: var(--accent-ink); filter: brightness(1.05); }
.site-cta::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(120% 160% at 28% 55%, var(--cta-wash) 0%, transparent 70%);
  opacity: 0;
  z-index: -1;
  animation: wetbrick-seep var(--cta-loop) var(--ease) infinite;
}
.site-cta::after {
  content: "";
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: 9px;
  height: 2px;
  background: var(--cta-line);
  transform: scaleX(0);
  transform-origin: left;
  z-index: -1;
  animation: rim-press var(--cta-loop) var(--ease) infinite;
  box-shadow: 0 0 0 0 rgba(0, 0, 0, 0);
}
@keyframes wetbrick-seep {
  0%, 55% { opacity: 0; transform: scale(0.96); }
  68% { opacity: 0.3; transform: scale(1); }
  85%, 100% { opacity: 0; transform: scale(1); }
}
@keyframes rim-press {
  0%, 58% { transform: scaleX(0); opacity: 1; }
  72% { transform: scaleX(1); opacity: 1; }
  86%, 100% { transform: scaleX(1); opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .site-cta::before, .site-cta::after { animation: none; }
  .site-cta::before { opacity: 0.18; transform: none; }
  .site-cta::after { transform: scaleX(1); opacity: 0.45; }
}

@media (max-width: 900px) {
  .shell { display: block; }
  .rail {
    position: fixed;
    left: 0; top: 0; bottom: 0;
    width: min(280px, 86vw);
    height: 100%;
    z-index: 50;
    transform: translateX(-105%);
    transition: transform var(--dur) var(--ease);
  }
  .rail.open { transform: translateX(0); }
  .topbar { display: flex; }
  .hero { grid-template-columns: 1fr; }
  .lanes { grid-template-columns: 1fr; }
  .site-cta {
    width: calc(100% - 28px);
    font-size: 16px;
    min-height: 54px;
  }
  .entry-list li { grid-template-columns: 1fr; gap: 4px; }
}
@media (max-width: 640px) {
  h1 { font-size: 28px; }
  h2 { font-size: 22px; }
  .page { padding: var(--space-5) var(--space-4) var(--space-8); }
}
