:root {
  --ink: #18312a;
  --text: #283732;
  --muted: #617069;
  --paper: #fffaf1;
  --card: #ffffff;
  --line: #dfe6df;
  --green: #174c3c;
  --green-deep: #10372c;
  --mint: #e3f1e9;
  --orange: #ed7a3b;
  --orange-soft: #fff0e5;
  --gold: #d7a33f;
  font-family: "Noto Sans TC", "PingFang TC", system-ui, sans-serif;
  color: var(--text);
  background: var(--paper);
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; line-height: 1.7; }
a { color: var(--green); text-underline-offset: .2em; }
a:focus-visible, button:focus-visible, input:focus-visible { outline: 3px solid var(--orange); outline-offset: 3px; }
header, footer, main { max-width: 1200px; margin: auto; padding-inline: 1.5rem; }
header { min-height: 76px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); }
header nav { display: flex; gap: 1.35rem; flex-wrap: wrap; }
header nav a { color: var(--text); font-weight: 700; text-decoration: none; }
.brand { color: var(--ink); font-size: 1.28rem; font-weight: 950; letter-spacing: -.04em; text-decoration: none; }
.brand small { color: var(--muted); font-size: .72rem; font-weight: 650; letter-spacing: .04em; }
main { min-height: 70vh; }
footer { display: flex; justify-content: space-between; gap: 2rem; border-top: 1px solid var(--line); color: var(--muted); font-size: .9rem; padding-block: 2.5rem; }
.footer-brand { display: inline-block; margin-bottom: .2rem; }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 1rem; top: 1rem; background: #fff; padding: .6rem 1rem; z-index: 9; }
h1, h2, h3 { color: var(--ink); line-height: 1.18; letter-spacing: -.035em; }
h2 { font-size: clamp(2rem, 4vw, 3.25rem); margin: .2em 0; }
.eyebrow { margin: 0 0 .6rem; color: var(--green); font-size: .78rem; font-weight: 900; letter-spacing: .15em; text-transform: uppercase; }
.home-hero { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(280px, .8fr); gap: clamp(2rem, 7vw, 6rem); align-items: center; padding: clamp(4rem, 8vw, 7rem) 0 5rem; }
.hero-copy h1, .village-hero h1 { margin: .12em 0 .3em; font-size: clamp(3rem, 7.5vw, 6.5rem); line-height: .98; }
.lead { max-width: 760px; color: #40534b; font-size: clamp(1.05rem, 2vw, 1.28rem); }
.searchbox { margin-top: 2rem; padding: 1rem; background: #fff; border: 1px solid var(--line); border-radius: 18px; box-shadow: 0 16px 45px #18302212; }
.searchbox label { display: block; margin-bottom: .45rem; color: var(--ink); font-weight: 850; }
.search-row { display: grid; grid-template-columns: 1fr auto; gap: .65rem; }
.searchbox input { width: 100%; min-height: 50px; padding: .8rem 1rem; border: 1px solid #aab7ac; border-radius: 12px; font: inherit; }
.privacy-note { margin: .5rem 0 0; color: var(--muted); font-size: .82rem; }
.search-result { display: block; padding: .7rem; border-top: 1px solid var(--line); text-decoration: none; }
.search-result small { display: block; color: var(--muted); }
.button, button.button { display: inline-flex; min-height: 48px; align-items: center; justify-content: center; padding: .7rem 1.2rem; border: 0; border-radius: 999px; color: #fff; background: var(--green); cursor: pointer; font-weight: 850; text-decoration: none; }
.button:hover { background: var(--green-deep); }
.secondary-button { background: var(--orange); }
.hero-actions { display: flex; gap: .8rem; align-items: center; flex-wrap: wrap; margin-top: 1rem; }
.text-button { min-height: 48px; display: inline-flex; align-items: center; padding: .65rem .9rem; color: var(--ink); font-weight: 800; text-decoration: none; }
.coverage-card { padding: 1.5rem; background: var(--green); border-radius: 24px; color: #fff; box-shadow: 0 24px 60px #174c3c28; }
.coverage-card > strong { display: block; margin-top: .8rem; font-size: clamp(3.2rem, 6vw, 5rem); line-height: 1; letter-spacing: -.07em; }
.coverage-card p { color: #e4f2eb; }
.coverage-card dl { margin: 1.4rem 0; border-top: 1px solid #ffffff2e; }
.coverage-card dl div { display: flex; justify-content: space-between; padding: .55rem 0; border-bottom: 1px solid #ffffff2e; }
.coverage-card dd { margin: 0; font-weight: 850; }
.coverage-card a { color: #fff; font-weight: 800; }
.status-pill { display: inline-block; padding: .25rem .65rem; border-radius: 999px; background: #ffffff1c; color: #fff; font-size: .78rem; font-weight: 800; }
.role-section, .task-section, .trust-section { padding: 5rem 0; border-top: 1px solid var(--line); }
.section-heading { max-width: 720px; margin-bottom: 2rem; }
.section-heading > p:last-child { color: var(--muted); font-size: 1.05rem; }
.section-heading.compact { margin-bottom: 1.5rem; }
.role-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }
.role-card { min-height: 470px; display: flex; flex-direction: column; padding: 1.5rem; border: 1px solid var(--line); border-radius: 20px; background: var(--card); }
.role-card.resident { border-top: 5px solid var(--orange); }
.role-card.chief { border-top: 5px solid var(--green); }
.role-card.candidate { border-top: 5px solid var(--gold); }
.role-number { align-self: flex-end; color: #9aaba3; font-size: .8rem; font-weight: 900; }
.role-label { margin: 1.5rem 0 .1rem; color: var(--green); font-size: .82rem; font-weight: 900; letter-spacing: .08em; }
.role-card h3 { margin: .2rem 0 .5rem; font-size: 1.65rem; }
.role-card ul { padding-left: 1.3rem; color: var(--muted); }
.card-action { margin-top: auto; padding-top: 1rem; border-top: 1px solid var(--line); font-weight: 900; text-decoration: none; }
.task-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: .8rem; }
.task-grid a { min-height: 150px; display: flex; flex-direction: column; justify-content: center; padding: 1.3rem; border: 1px solid var(--line); border-radius: 16px; background: #fff; color: var(--text); text-decoration: none; }
.task-grid a:hover { border-color: var(--green); transform: translateY(-2px); }
.task-grid span { color: var(--orange); font-size: .78rem; font-weight: 900; letter-spacing: .08em; }
.task-grid strong { color: var(--ink); font-size: 1.2rem; }
.task-grid small { color: var(--muted); }
.trust-section { display: grid; grid-template-columns: .9fr 1.1fr; gap: 3rem; }
.trust-points { display: grid; grid-template-columns: repeat(2, 1fr); gap: .8rem; }
.trust-points article { padding: 1.2rem; border-radius: 16px; background: var(--mint); }
.trust-points p { margin-bottom: 0; color: #4e6259; font-size: .9rem; }

/* Shared directory and village pages */
.hero { padding: 5rem 0 3rem; max-width: 800px; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1rem; }
.card { display: flex; flex-direction: column; padding: 1rem; border: 1px solid var(--line); border-radius: 14px; background: var(--card); color: var(--ink); text-decoration: none; }
.card span { color: var(--muted); }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: .75rem; margin: 1rem 0; }
.stats div { padding: 1rem; border-radius: 14px; background: var(--mint); }
.stats b, .stats span { display: block; }
.stats b { font-size: 1.55rem; }
.village-list { columns: 3; padding: 0; list-style: none; }
.village-list li { break-inside: avoid; display: flex; justify-content: space-between; gap: .5rem; padding: .45rem; border-bottom: 1px solid var(--line); }
.village-list span, .crumbs, .map figcaption, .source-note { color: var(--muted); }
.crumbs { margin: 1rem 0; }
.two-col { display: grid; grid-template-columns: minmax(0, 2fr) minmax(250px, 1fr); gap: 2rem; }
.two-col aside { align-self: start; padding: 1rem; border: 1px solid var(--line); border-radius: 16px; background: #fff; }
.map svg { width: 100%; max-height: 420px; border-radius: 18px; background: #eaf5ee; }
.map path { fill: #73b88e; stroke: var(--green); stroke-width: 2; }
.map figcaption, .source-note { font-size: .88rem; }
.chips { display: flex; gap: .5rem; flex-wrap: wrap; }
.chips a { padding: .3rem .55rem; border-radius: 999px; background: var(--mint); }
.notice, .result { margin: 1.2rem 0; padding: 1rem; border-left: 4px solid var(--gold); background: #fff6dc; }
.empty { color: var(--muted); font-style: italic; }
.sources li { margin: 1rem 0; }
code { padding: .15rem .35rem; border-radius: 4px; background: #eef1ed; }

@media (max-width: 820px) {
  header { align-items: flex-start; flex-direction: column; gap: .8rem; padding-block: 1rem; }
  header nav { gap: .8rem 1rem; }
  .home-hero, .trust-section { grid-template-columns: 1fr; }
  .home-hero { padding-block: 3.5rem; }
  .role-grid { grid-template-columns: 1fr; }
  .role-card { min-height: auto; }
  .two-col { grid-template-columns: 1fr; }
  .village-list { columns: 1; }
}
@media (max-width: 560px) {
  header, footer, main { padding-inline: 1rem; }
  header nav { font-size: .9rem; }
  .hero-copy h1 { font-size: clamp(2.8rem, 14vw, 4.3rem); }
  .search-row, .task-grid, .trust-points { grid-template-columns: 1fr; }
  .hero-actions { align-items: stretch; flex-direction: column; }
  .hero-actions > * { width: 100%; justify-content: center; }
  .secondary-button { border-radius: 12px; }
  footer { flex-direction: column; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .task-grid a { transition: none; }
}
