:root {
  --bg: #f3efe5;
  --paper: #fbf8f1;
  --ink: #1d2a2d;
  --muted: #6b7674;
  --line: rgba(30, 46, 48, 0.12);
  --accent: #b25c2f;
  --accent-soft: #ead8c7;
  --accent-dark: #264b49;
  --shadow: 0 20px 60px rgba(33, 43, 45, 0.08);
  --radius: 24px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(178, 92, 47, 0.09), transparent 34%),
    radial-gradient(circle at top right, rgba(38, 75, 73, 0.10), transparent 28%),
    linear-gradient(180deg, #f7f2e8 0%, var(--bg) 46%, #efe7da 100%);
  font: 16px/1.65 "PingFang SC", "Hiragino Sans GB", "Helvetica Neue", sans-serif;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
p { margin: 0 0 1rem; }
h1, h2, h3, h4 {
  margin: 0 0 0.75rem;
  font-family: "Songti SC", "STSong", "Iowan Old Style", serif;
  line-height: 1.2;
  letter-spacing: 0.02em;
}

.page-shell {
  width: min(1180px, calc(100vw - 28px));
  margin: 0 auto;
  padding: 24px 0 60px;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 14px 18px;
  margin-bottom: 18px;
  background: rgba(251, 248, 241, 0.82);
  border: 1px solid var(--line);
  border-radius: 999px;
  backdrop-filter: blur(12px);
  position: sticky;
  top: 10px;
  z-index: 10;
}

.brand { display: grid; gap: 2px; }
.brand-kicker {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--muted);
}

.top-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  color: var(--muted);
}

.top-nav a:hover,
.text-link:hover,
.chapter-inline:hover { color: var(--accent); }

.hero {
  display: grid;
  grid-template-columns: 1.5fr 0.9fr;
  gap: 22px;
  padding: 34px;
  border-radius: calc(var(--radius) + 4px);
  background:
    linear-gradient(140deg, rgba(251, 248, 241, 0.94), rgba(234, 216, 199, 0.88));
  border: 1px solid rgba(178, 92, 47, 0.14);
  box-shadow: var(--shadow);
  overflow: hidden;
  position: relative;
}

.hero::after {
  content: "";
  position: absolute;
  inset: auto -10% -48% auto;
  width: 280px;
  height: 280px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(38, 75, 73, 0.16), transparent 70%);
}

.hero-copy { position: relative; z-index: 1; }
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  color: var(--accent-dark);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
}
.eyebrow::before {
  content: "";
  width: 40px;
  height: 1px;
  background: currentColor;
  opacity: 0.5;
}
.hero h1 { font-size: clamp(2rem, 4vw, 3.5rem); margin-bottom: 0.8rem; }
.hero-subtitle { font-size: 1.06rem; max-width: 50ch; color: #334443; }
.hero-meta {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 12px;
  align-content: start;
  position: relative;
  z-index: 1;
}
.hero-meta li {
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.58);
  border: 1px solid rgba(38, 75, 73, 0.12);
  border-radius: 16px;
}

.page-content { display: grid; gap: 18px; margin-top: 22px; }
.content-with-rail {
  grid-template-columns: minmax(0, 1.6fr) minmax(260px, 0.72fr);
  align-items: start;
}
.main-column { display: grid; gap: 18px; }
.sticky-rail { position: sticky; top: 92px; }

.panel {
  background: rgba(251, 248, 241, 0.9);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
}

.side-panel { padding: 20px; }
.muted { color: var(--muted); }
.thesis {
  font-size: 1.08rem;
  color: var(--accent-dark);
}

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

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 18px;
}

.filter-input {
  width: min(320px, 100%);
  border: 1px solid rgba(38, 75, 73, 0.18);
  border-radius: 999px;
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.78);
  color: var(--ink);
}

.chapter-grid,
.concept-grid,
.plate-grid,
.glossary-grid {
  display: grid;
  gap: 16px;
}

.chapter-grid { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.concept-grid { grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }
.plate-grid { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.glossary-grid { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }

.chapter-card,
.concept-card,
.plate-card,
.glossary-card {
  display: grid;
  gap: 14px;
  padding: 18px;
  border-radius: 22px;
  border: 1px solid rgba(38, 75, 73, 0.1);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.72), rgba(248, 243, 233, 0.94));
  transition: transform 180ms ease, border-color 180ms ease;
}

.chapter-card:hover,
.concept-card:hover,
.plate-card:hover {
  transform: translateY(-2px);
  border-color: rgba(178, 92, 47, 0.28);
}

.card-badge {
  display: inline-flex;
  width: fit-content;
  padding: 5px 10px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-dark);
  font-size: 12px;
  letter-spacing: 0.08em;
}

.card-copy p,
.chapter-card p,
.concept-card p,
.plate-card p,
.glossary-card p { color: var(--muted); }

.thumb-frame {
  aspect-ratio: 4 / 3;
  padding: 12px;
  border-radius: 18px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(240, 234, 222, 0.94));
  border: 1px solid rgba(38, 75, 73, 0.08);
  overflow: hidden;
}

.thumb-frame.small {
  width: 100%;
  aspect-ratio: 3 / 2;
  padding: 10px;
}

.thumb-frame img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.plate-strip,
.mini-plates {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 14px;
}

.plate-chip {
  display: grid;
  gap: 10px;
  padding: 12px;
  border-radius: 18px;
  border: 1px solid rgba(38, 75, 73, 0.08);
  background: rgba(255, 255, 255, 0.74);
}

.glossary-preview {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.glossary-pill {
  display: grid;
  gap: 4px;
  padding: 10px 12px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(38, 75, 73, 0.08);
}

.deep-read-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
}

.deep-card {
  padding: 18px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(38, 75, 73, 0.08);
}

.qa-box {
  padding: 16px 18px;
  border-radius: 18px;
  border: 1px solid rgba(178, 92, 47, 0.16);
  background: rgba(234, 216, 199, 0.36);
}

.qa-box summary {
  cursor: pointer;
  font-weight: 600;
}

.answer { padding-top: 12px; color: #324140; }

.route-list,
.action-list,
.bullet-list {
  margin: 0;
  padding-left: 1.2rem;
  display: grid;
  gap: 0.5rem;
}

.chapter-inline,
.concept-links,
.path-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.concept-links a,
.path-nav a,
.text-link {
  color: var(--accent-dark);
}

.plate-group + .plate-group { margin-top: 18px; }

.image-stage {
  padding: 16px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.76);
  border: 1px solid rgba(38, 75, 73, 0.08);
}

.image-stage img {
  width: 100%;
  height: auto;
  object-fit: contain;
}

.en-label {
  font-size: 13px;
  color: var(--accent-dark);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

[hidden] { display: none !important; }

@media (max-width: 980px) {
  .hero,
  .content-with-rail,
  .two-column {
    grid-template-columns: 1fr;
  }

  .sticky-rail {
    position: static;
  }
}

@media (max-width: 640px) {
  .page-shell {
    width: min(100vw - 16px, 1180px);
    padding-top: 14px;
  }

  .site-header {
    border-radius: 24px;
    padding: 16px;
    align-items: flex-start;
  }

  .hero,
  .panel {
    padding: 20px;
  }

  .section-head {
    flex-direction: column;
    align-items: flex-start;
  }

  .filter-input {
    width: 100%;
  }
}
