:root {
  --paper: #f5f2ea;
  --paper-deep: #ebe6da;
  --ink: #27332f;
  --muted: #87918a;
  --line: #d9ddd6;
  --sage: #dbe7dc;
  --sage-dark: #597765;
  --terracotta: #bc6f55;
  --terracotta-soft: #f3ded5;
  --white: #fffefa;
  --shadow: 0 18px 45px rgba(48, 61, 53, .08);
  font-family: "Avenir Next", "Noto Sans TC", "PingFang TC", system-ui, sans-serif;
  color: var(--ink);
  background: var(--paper);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-width: 320px;
  background:
    radial-gradient(circle at 10% 10%, rgba(188, 111, 85, .08), transparent 27rem),
    linear-gradient(135deg, rgba(255,255,255,.35), transparent 45%),
    var(--paper);
}

button, input { font: inherit; }
button { cursor: pointer; }

.site-shell { min-height: 100vh; }

.topbar {
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
  min-height: 88px;
  display: flex;
  align-items: center;
  gap: 30px;
  border-bottom: 1px solid var(--line);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  text-decoration: none;
  margin-right: auto;
}

.brand-mark {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border: 1px solid #d7b3a7;
  border-radius: 50%;
  color: var(--terracotta);
  background: var(--terracotta-soft);
}

.brand strong, .brand small { display: block; }
.brand strong { letter-spacing: -.03em; font-size: 16px; }
.brand small { color: var(--muted); font-size: 10px; margin-top: 2px; }

.nav-links { display: flex; gap: 26px; }
.nav-links button {
  border: 0;
  background: transparent;
  color: var(--muted);
  padding: 10px 0;
  font-size: 12px;
}
.nav-links button:hover, .nav-links button.active { color: var(--terracotta); }

.guest-pill {
  border: 1px solid #ccd9cd;
  border-radius: 999px;
  color: var(--sage-dark);
  background: rgba(219, 231, 220, .58);
  padding: 7px 11px;
  font-size: 10px;
  white-space: nowrap;
}

.main-content {
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
  padding: 58px 0 80px;
}

.eyebrow {
  color: var(--terracotta);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .15em;
  text-transform: uppercase;
}

h1, h2, h3, p { margin-top: 0; }
h1 { font-size: clamp(32px, 5vw, 58px); letter-spacing: -.055em; line-height: 1.05; margin-bottom: 18px; }
h2 { letter-spacing: -.04em; }
p { color: #68736b; line-height: 1.8; }

.hero {
  display: grid;
  grid-template-columns: 1.15fr .85fr;
  gap: 70px;
  align-items: center;
  min-height: 390px;
}

.hero-copy { max-width: 610px; }
.hero-copy p { max-width: 480px; font-size: 15px; }
.hero-title-dot { color: var(--terracotta); }
.hero-actions { display: flex; gap: 12px; margin-top: 30px; }

.primary-button, .quiet-button {
  border-radius: 5px;
  padding: 12px 17px;
  border: 1px solid transparent;
  font-size: 12px;
}
.primary-button { color: var(--white); background: var(--terracotta); }
.primary-button:hover { background: #a75d45; }
.quiet-button { color: var(--sage-dark); background: transparent; border-color: #cbd8cd; }
.quiet-button:hover { background: var(--sage); }

.map-card {
  min-height: 300px;
  position: relative;
  overflow: hidden;
  border: 1px solid #d2d9d0;
  border-radius: 6px;
  background:
    linear-gradient(28deg, transparent 47%, rgba(89,119,101,.15) 48%, transparent 49%),
    linear-gradient(112deg, transparent 54%, rgba(188,111,85,.12) 55%, transparent 56%),
    repeating-linear-gradient(0deg, transparent 0 39px, rgba(89,119,101,.11) 40px 41px),
    var(--sage);
  box-shadow: var(--shadow);
}
.map-card::before, .map-card::after {
  content: "";
  position: absolute;
  border: 1px solid rgba(89,119,101,.35);
  transform: rotate(-17deg);
}
.map-card::before { width: 230px; height: 130px; top: 52px; left: 55px; }
.map-card::after { width: 130px; height: 180px; right: 45px; bottom: 30px; transform: rotate(23deg); }
.map-label {
  position: absolute;
  left: 23px;
  bottom: 20px;
  color: var(--sage-dark);
  font-size: 10px;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin: 42px 0 74px;
}
.stat-card, .article-card, .reader-panel, .word-card {
  border: 1px solid var(--line);
  background: rgba(255,254,250,.8);
  border-radius: 6px;
}
.stat-card { padding: 20px; min-height: 125px; }
.stat-card.accent { background: var(--terracotta-soft); border-color: #edcfc4; }
.stat-label { color: var(--muted); font-size: 11px; }
.stat-number { font-size: 31px; letter-spacing: -.06em; margin-top: 18px; }
.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 18px;
}
.section-heading h2 { margin: 5px 0 0; font-size: 22px; }
.text-link {
  border: 0;
  color: var(--terracotta);
  background: transparent;
  font-size: 11px;
}

.article-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
.article-card {
  overflow: hidden;
  padding: 0;
  text-align: left;
  color: var(--ink);
  transition: transform .18s ease, box-shadow .18s ease;
}
.article-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.article-art {
  height: 104px;
  padding: 17px;
  display: flex;
  justify-content: space-between;
  align-items: start;
  color: rgba(39,51,47,.66);
  background: var(--sage);
}
.article-card:nth-child(2) .article-art { background: var(--terracotta-soft); }
.article-card:nth-child(3) .article-art { background: #e4e0d2; }
.article-art strong { font-size: 24px; font-weight: 400; }
.article-art span { font-size: 10px; }
.article-body { padding: 17px; }
.article-meta { color: var(--muted); font-size: 10px; display: flex; gap: 10px; }
.article-body h3 { font-size: 17px; margin: 13px 0 7px; }
.article-body p { margin-bottom: 0; font-size: 12px; line-height: 1.65; }

.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin: 34px 0 18px;
}
.search-box {
  width: min(340px, 100%);
  display: flex;
  align-items: center;
  gap: 8px;
  border-bottom: 1px solid var(--line);
  padding: 8px 0;
}
.search-box span { color: var(--terracotta); }
.search-box input { width: 100%; border: 0; outline: 0; background: transparent; font-size: 12px; }
.filter-list { display: flex; flex-wrap: wrap; gap: 7px; }
.filter-list button {
  color: var(--muted);
  border: 1px solid transparent;
  background: transparent;
  border-radius: 999px;
  padding: 7px 10px;
  font-size: 10px;
}
.filter-list button.active { color: var(--sage-dark); background: var(--sage); border-color: #cbd8cd; }

.reader-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 42px;
  align-items: start;
}
.back-link {
  border: 0;
  background: transparent;
  color: var(--terracotta);
  padding: 0;
  font-size: 11px;
  margin-bottom: 28px;
}
.reader-title { font-size: clamp(30px, 5vw, 52px); max-width: 760px; }
.reader-subtitle { color: var(--terracotta); font-size: 14px; }
.reader-toolbar { display: flex; align-items: center; gap: 14px; margin: 25px 0 35px; }
.speed-list { display: flex; align-items: center; gap: 4px; color: var(--muted); font-size: 10px; }
.speed-list button {
  border: 0; background: transparent; color: var(--muted); padding: 5px;
}
.speed-list button.active { color: var(--terracotta); font-weight: 700; }
.reading-copy { max-width: 720px; }
.reading-copy p { color: #3e4943; font-size: 17px; line-height: 2.05; }
.word-button {
  border: 0;
  color: inherit;
  background: transparent;
  padding: 0 1px;
  border-bottom: 1px dashed #bdc8be;
}
.word-button:hover, .word-button.selected { color: var(--terracotta); border-color: var(--terracotta); }

.reader-panel { padding: 18px; position: sticky; top: 20px; }
.reader-panel h3 { font-size: 13px; margin-bottom: 8px; }
.reader-panel p { font-size: 12px; margin-bottom: 16px; }
.status-actions { display: grid; gap: 7px; }
.status-actions button {
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--white);
  text-align: left;
  padding: 9px 10px;
  color: var(--ink);
  font-size: 11px;
}
.status-actions button:hover { border-color: var(--terracotta); color: var(--terracotta); }
.status-actions button.active { border-color: #b7cfbc; background: var(--sage); color: var(--sage-dark); }

.word-list { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 25px; }
.word-card { padding: 17px; }
.word-card strong { font-size: 17px; }
.word-card small { display: block; color: var(--terracotta); margin-top: 6px; }
.word-card p { font-size: 12px; margin: 11px 0 0; }
.empty-state { color: var(--muted); padding: 45px 0; }

.footer {
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
  border-top: 1px solid var(--line);
  padding: 18px 0 30px;
  display: flex;
  justify-content: space-between;
  gap: 20px;
  color: var(--muted);
  font-size: 10px;
}

@media (max-width: 780px) {
  .topbar { width: min(100% - 28px, 1180px); min-height: 72px; gap: 14px; }
  .nav-links { gap: 12px; }
  .guest-pill { display: none; }
  .main-content { width: min(100% - 28px, 1180px); padding-top: 35px; }
  .hero { grid-template-columns: 1fr; gap: 35px; }
  .map-card { min-height: 220px; }
  .stats-grid, .article-grid, .word-list { grid-template-columns: 1fr; }
  .toolbar, .section-heading, .footer { align-items: start; flex-direction: column; }
  .reader-layout { grid-template-columns: 1fr; gap: 25px; }
  .reader-panel { position: static; }
  .reading-copy p { font-size: 15px; }
}
