:root {
  --bg: #f7f5f0;
  --surface: #ffffff;
  --surface-2: #f0ede5;
  --text: #22252a;
  --muted: #5d6470;
  --line: #e2ddd2;
  --accent: #2f6b5a;
  --accent-soft: #e3efe9;
  --warn: #9a5b12;
  --warn-soft: #fbf0df;
  --danger: #a33a3a;
  --danger-soft: #f9e6e4;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(0, 0, 0, .04), 0 4px 16px rgba(0, 0, 0, .04);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #15171a;
    --surface: #1e2125;
    --surface-2: #262a2f;
    --text: #e8e6e1;
    --muted: #a3a9b2;
    --line: #33383e;
    --accent: #7cc3ad;
    --accent-soft: #1f3530;
    --warn: #e2b36f;
    --warn-soft: #3a2f1f;
    --danger: #e59a94;
    --danger-soft: #3b2322;
    --shadow: none;
  }
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: 72px; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.75;
}

a { color: var(--accent); }

/* ---------- top nav ---------- */
.topnav {
  position: sticky;
  top: 0;
  z-index: 10;
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.topnav ul {
  display: flex;
  gap: 4px;
  margin: 0 auto;
  padding: 10px 16px;
  max-width: 1040px;
  list-style: none;
  overflow-x: auto;
  white-space: nowrap;
  scrollbar-width: none;
}
.topnav ul::-webkit-scrollbar { display: none; }
.topnav a {
  display: block;
  padding: 6px 12px;
  border-radius: 999px;
  color: var(--muted);
  text-decoration: none;
  font-size: 14px;
}
.topnav a:hover { background: var(--surface-2); color: var(--text); }

/* ---------- layout ---------- */
main { max-width: 1040px; margin: 0 auto; padding: 0 16px 64px; }

.hero {
  padding: 48px 0 24px;
  display: grid;
  gap: 28px;
  align-items: center;
  grid-template-columns: 1.1fr 1fr;
}
.hero-art svg { width: 100%; height: auto; display: block; filter: drop-shadow(0 6px 18px rgba(47, 107, 90, .12)); }
@media (max-width: 720px) {
  .hero { grid-template-columns: 1fr; padding-top: 32px; }
  .hero-art { max-width: 420px; }
}
@media (prefers-color-scheme: dark) {
  .hero-art svg { filter: brightness(.88) saturate(.95); }
}

/* heading icon badges */
section > h2 { display: flex; align-items: center; gap: 12px; }
.icon {
  flex: none;
  width: 44px; height: 44px;
  border-radius: 14px;
  display: grid; place-items: center;
}
.icon svg {
  width: 24px; height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.icon.c1 { background: #fff1c9; color: #a86b00; }
.icon.c2 { background: #dcebff; color: #2f62b5; }
.icon.c3 { background: #d9f2e4; color: #2c7a55; }
.icon.c4 { background: #f1e3ff; color: #7a4bb0; }
.icon.c5 { background: #ffe1dc; color: #b44a3a; }
@media (prefers-color-scheme: dark) {
  .icon.c1 { background: #3b3220; color: #f2c96b; }
  .icon.c2 { background: #1f2d44; color: #8db6f5; }
  .icon.c3 { background: #1d3529; color: #7fd1a6; }
  .icon.c4 { background: #2f2540; color: #c4a2ef; }
  .icon.c5 { background: #3d2522; color: #f0a197; }
}

/* photo */
.photo { margin: 0 0 20px; }
.photo img {
  width: 100%;
  max-height: 420px;
  object-fit: cover;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  display: block;
}
.photo figcaption { margin-top: 8px; font-size: 13px; color: var(--muted); }

/* colorful cards */
.grid .card { border-top: 4px solid var(--accent); }
.grid .card:nth-child(4n+2) { border-top-color: #5b8def; }
.grid .card:nth-child(4n+3) { border-top-color: #f2a33a; }
.grid .card:nth-child(4n+4) { border-top-color: #e0766b; }
.kpi div { border-left: 4px solid var(--accent); }
.kpi div:nth-child(2) { border-left-color: #5b8def; }
.kpi div:nth-child(3) { border-left-color: #f2a33a; }
.hero .eyebrow {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 14px;
  font-weight: 600;
}
.hero h1 { margin: 16px 0 8px; font-size: clamp(28px, 5vw, 42px); line-height: 1.3; }
.hero p { margin: 0; color: var(--muted); max-width: 680px; }

section { margin-top: 56px; }
section > h2 {
  margin: 0 0 6px;
  font-size: clamp(22px, 3.4vw, 28px);
  line-height: 1.4;
}
section > .lead { margin: 0 0 20px; color: var(--muted); }
h3 { margin: 28px 0 10px; font-size: 19px; }

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px 22px;
  box-shadow: var(--shadow);
}
.card + .card { margin-top: 14px; }
.card h3:first-child { margin-top: 0; }

.grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.grid .card + .card { margin-top: 0; }

.callout {
  border-radius: var(--radius);
  padding: 16px 20px;
  margin: 16px 0;
  background: var(--accent-soft);
  border-left: 4px solid var(--accent);
}
.callout.warn { background: var(--warn-soft); border-left-color: var(--warn); }
.callout.danger { background: var(--danger-soft); border-left-color: var(--danger); }
.callout p { margin: 0; }
.callout p + p { margin-top: 8px; }

.kpi { display: flex; flex-wrap: wrap; gap: 14px; margin: 16px 0; }
.kpi div {
  flex: 1 1 160px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 18px;
}
.kpi strong { display: block; font-size: 26px; line-height: 1.3; }
.kpi span { color: var(--muted); font-size: 14px; }

ul.clean { margin: 0; padding-left: 1.2em; }
ul.clean li + li { margin-top: 4px; }

.tag {
  display: inline-block;
  padding: 0 8px;
  border-radius: 6px;
  font-size: 13px;
  background: var(--surface-2);
  color: var(--muted);
  vertical-align: 1px;
}

/* ---------- tables ---------- */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
table { width: 100%; border-collapse: collapse; min-width: 560px; }
th, td { padding: 11px 14px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); }
th { background: var(--surface-2); font-weight: 600; font-size: 15px; white-space: nowrap; }
tr:last-child td { border-bottom: 0; }
td strong { font-weight: 600; }

/* ---------- timeline ---------- */
.timeline { list-style: none; margin: 0; padding: 0; position: relative; }
.timeline::before {
  content: "";
  position: absolute;
  left: 11px; top: 8px; bottom: 8px;
  width: 2px;
  background: var(--line);
}
.timeline li { position: relative; padding: 0 0 20px 40px; }
.timeline li::before {
  content: "";
  position: absolute;
  left: 4px; top: 7px;
  width: 16px; height: 16px;
  border-radius: 50%;
  background: var(--surface);
  border: 3px solid var(--accent);
}
.timeline li.key::before { background: var(--accent); }
.timeline .when { font-weight: 700; }
.timeline .what { color: var(--text); }
.timeline .note { color: var(--muted); font-size: 14px; }

/* ---------- checklist ---------- */
.checklist { list-style: none; margin: 0; padding: 0; }
.checklist li + li { margin-top: 8px; }
.checklist label {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  cursor: pointer;
}
.checklist input { margin-top: 6px; width: 18px; height: 18px; accent-color: var(--accent); flex: none; }
.check-result { margin-top: 14px; font-weight: 600; }

.steps { counter-reset: step; list-style: none; margin: 0; padding: 0; }
.steps > li { counter-increment: step; position: relative; padding-left: 48px; }
.steps > li + li { margin-top: 18px; }
.steps > li::before {
  content: counter(step);
  position: absolute; left: 0; top: 0;
  width: 32px; height: 32px;
  border-radius: 50%;
  display: grid; place-items: center;
  background: var(--accent); color: var(--surface);
  font-weight: 700;
}
.steps h4 { margin: 2px 0 4px; font-size: 17px; }
.steps p { margin: 0; }

details.sources summary { cursor: pointer; font-weight: 600; }
details.sources ul { font-size: 14px; }
details.sources li { word-break: break-all; }

.counter {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 12px;
  padding: 6px 14px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--text);
  font-size: 15px;
}
.counter strong { color: var(--accent); font-size: 18px; font-variant-numeric: tabular-nums; }
.counter-emoji { font-size: 18px; }

footer {
  margin-top: 64px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 14px;
}
