:root {
  --blue: #0759ad;
  --deep: #06458e;
  --ink: #12354b;
  --muted: #405e73;
  --yellow: #ffe500;
  --ice: #eaf7fb;
  --soft: #f0f5fa;
  --paper: #fff;
  --entry: #f7fafd;
  --gutter: clamp(20px, 4.5vw, 72px);
  --font: "PingFang TC", "Noto Sans TC", "Microsoft JhengHei", sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 94px; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 16px/1.65 var(--font); }
h1, h2, h3, h4, p, figure { margin: 0; }
a { color: inherit; text-decoration: none; }
button, input { font: inherit; }
button { border: 0; color: inherit; cursor: pointer; }
a, button, input { touch-action: manipulation; }
a:focus-visible, button:focus-visible, input:focus-visible {
  outline: 3px solid var(--blue);
  outline-offset: 4px;
}
[hidden] { display: none !important; }
::selection { background: var(--yellow); color: var(--deep); }
.frame { width: calc(100% - 2 * var(--gutter)); max-width: 1320px; margin-inline: auto; }
.sr-only, .skip-link:not(:focus) { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.skip-link:focus { position: fixed; z-index: 10; top: 10px; left: 12px; background: var(--yellow); padding: 10px 16px; }
.button {
  display: inline-flex;
  min-height: 46px;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
  padding: 10px 18px;
  border-radius: 999px;
  font-weight: 700;
  transition: background .18s, color .18s;
}
.button-blue { background: var(--blue); color: var(--paper); }
.button-blue:hover { background: var(--deep); }
.button-yellow { background: var(--yellow); color: var(--deep); }
.button-yellow:hover { background: #fff261; }

.site-header { position: sticky; top: 0; z-index: 5; background: var(--paper); }
.header-inner { min-height: 83px; display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.brand { display: block; flex: none; }
.brand img { display: block; width: 124px; height: auto; }
.header-inner nav { display: flex; gap: clamp(18px, 3vw, 42px); align-items: center; font-size: 16px; font-weight: 700; }
.header-inner nav a { padding-block: 12px; }
.header-inner nav a:hover, .nav-current { color: var(--blue); }
.nav-current { text-decoration: underline; text-decoration-color: var(--yellow); text-decoration-thickness: 2px; text-underline-offset: 12px; }
.header-action { font-size: 14px; }

.hero { background: var(--ice); }
.hero-layout { display: grid; grid-template-columns: minmax(270px, 31%) minmax(0, 1fr); align-items: center; min-height: 595px; }
.hero-copy { position: relative; z-index: 1; padding-block: 46px 65px; }
.date { margin-top: 13px; color: var(--muted); font-size: 14px; }
.hero h1 {
  margin-block: 0 23px;
  color: var(--blue);
  font-size: clamp(49px, 5.8vw, 84px);
  line-height: 1.13;
  font-weight: 900;
  letter-spacing: -.065em;
  white-space: nowrap;
}
.intro { max-width: 20em; font-size: 18px; line-height: 1.8; text-wrap: pretty; }
.hero-copy .button { margin-top: 28px; padding-inline: 22px; }

.map-figure { width: 100%; min-width: 0; padding-block: 24px 16px; }
.city-map { position: relative; aspect-ratio: 900 / 595; isolation: isolate; }
.city-art, .district-boundaries { position: absolute; inset: 0; display: block; width: 100%; height: 100%; }
.city-art { pointer-events: none; }
.district-boundaries { overflow: visible; pointer-events: none; }
.district-boundaries path {
  fill: transparent;
  stroke: #4f8190;
  stroke-width: .9;
  stroke-opacity: .65;
  vector-effect: non-scaling-stroke;
  stroke-linejoin: round;
  pointer-events: visiblePainted;
  cursor: pointer;
  transition: fill .18s, stroke .18s;
}
.district-boundaries path:hover { fill: #fff52b44; stroke: var(--blue); }
.district-boundaries path.is-active { fill: #ffe50049; stroke: #486d34; stroke-width: 1.4; stroke-opacity: 1; }
.district-pin {
  position: absolute;
  z-index: 1;
  transform: translate(-50%, -50%);
  min-width: 48px;
  min-height: 34px;
  padding: 3px 10px;
  outline: 1px solid #b0cbd7;
  border-radius: 999px;
  background: var(--paper);
  color: var(--deep);
  font-size: 16px;
  line-height: 1;
  font-weight: 800;
  white-space: nowrap;
}
.district-pin:hover, .district-pin:focus-visible, .district-pin.is-active {
  z-index: 2;
  outline-color: var(--blue);
  background: var(--yellow);
}
.north {
  position: absolute;
  top: 7%;
  right: 4%;
  color: var(--blue);
  text-align: center;
  font-size: 14px;
  font-weight: 750;
  pointer-events: none;
}
.north svg { display: block; width: 24px; height: 26px; margin-bottom: 1px; }
.map-figure figcaption {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 4px 16px;
  margin-inline: 5%;
  padding-top: 10px;
  color: var(--muted);
  font-size: 13px;
}
.map-figure figcaption span:first-child { font-weight: 750; color: var(--deep); }

.district-dock { background: var(--blue); color: var(--paper); }
.dock-inner {
  min-height: 108px;
  padding-block: 17px;
  display: grid;
  grid-template-columns: minmax(172px, 23%) minmax(0, 1fr);
  align-items: center;
  gap: 12px 24px;
}
.dock-title span { display: block; font-size: 14px; color: #d6efff; }
.dock-title strong { display: block; margin-top: 2px; font-size: 18px; }
.district-buttons { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 5px 12px; }
.district-choice { min-height: 40px; padding: 5px 10px; background: transparent; border-radius: 999px; font-weight: 650; font-size: 16px; }
.district-choice:hover { background: #fff2; }
.district-choice.is-active { background: var(--yellow); color: var(--deep); }
.district-choice:focus-visible, .site-footer .button:focus-visible { outline-color: var(--paper); }

.progress-section { padding-block: 60px 90px; }
.progress-heading { display: flex; justify-content: space-between; gap: 10px 28px; align-items: end; margin-bottom: 25px; }
.progress-heading h2 { color: var(--blue); font-size: clamp(42px, 5vw, 68px); line-height: 1.18; letter-spacing: -.055em; }
.progress-heading h2:focus { outline: none; }
.progress-links { display: flex; flex-wrap: wrap; gap: 4px 24px; color: var(--deep); font-size: 14px; font-weight: 700; }
.progress-links a { display: inline-flex; min-height: 44px; align-items: center; gap: 7px; }
.progress-links a:hover, .site-footer p a:hover { text-decoration: underline; text-underline-offset: 3px; }

.progress-controls { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; }
.filters { display: flex; gap: 7px; flex-wrap: wrap; }
.filter { min-height: 44px; padding: 6px 15px; border-radius: 999px; background: var(--soft); color: var(--deep); font-size: 14px; font-weight: 750; }
.filter:hover { background: #ddecf9; }
.filter[aria-pressed="true"] { background: var(--blue); color: var(--paper); }
.search { display: flex; align-items: center; gap: 10px; max-width: 100%; width: 265px; padding-inline: 14px; background: var(--soft); border-radius: 999px; }
.search:focus-within { outline: 2px solid var(--blue); outline-offset: 2px; }
.search svg { width: 20px; flex: none; stroke: var(--blue); stroke-width: 1.8; fill: none; }
.search input { width: 100%; min-height: 44px; padding: 5px 0; border: 0; background: transparent; color: var(--ink); }
.search input:focus { outline: none; }
.search input::placeholder { color: var(--muted); }
.result-summary { margin-block: 21px 10px; font-size: 14px; color: var(--muted); }
.results { columns: 2; column-gap: 16px; }
.category { break-inside: avoid; margin-bottom: 16px; overflow: hidden; background: var(--entry); border-radius: 16px; }
.category-title { padding: 12px 18px; background: var(--ice); color: var(--deep); font-size: 20px; line-height: 1.4; }
.entry:nth-child(even) { background: #eef6fb; }
.entry { display: grid; grid-template-columns: 8.5em minmax(0, 1fr); gap: 9px 12px; padding: 15px 17px; }
.stage { width: fit-content; height: fit-content; padding: 2px 8px; border-radius: 6px; font-size: 13px; font-weight: 750; white-space: nowrap; }
.stage-done { color: #235e45; background: #e2f4e8; }
.stage-active { color: #704600; background: #fff1b8; }
.stage-planned { color: var(--deep); background: #e2effd; }
.stage-mixed { color: #374d60; background: #edf2f6; }
.entry-type { font-size: 14px; color: var(--deep); margin-bottom: 3px; }
.entry ul { padding: 0; margin: 0; list-style: none; overflow-wrap: anywhere; }
.entry li + li { margin-top: 3px; }
.entry .source-bullet { padding-left: 12px; }
.empty { column-span: all; padding: 30px 20px; border-radius: 16px; background: var(--soft); }
.empty .button { margin-top: 14px; }

.site-footer { background: var(--blue); color: var(--paper); }
.footer-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px 30px; padding-block: 28px; }
.footer-title { font-weight: 800; font-size: 20px; margin-bottom: 4px; }
.site-footer p:not(.footer-title) { font-size: 14px; color: #e6f6ff; }
.site-footer p a { text-decoration: underline; text-underline-offset: 3px; }
.footer-inner .button { flex: none; }

@media (max-width: 1020px) {
  .hero-layout { min-height: 510px; }
  .dock-inner { grid-template-columns: 160px minmax(0, 1fr); }
  .entry { grid-template-columns: 1fr; }
}

@media (max-width: 820px) {
  html { scroll-padding-top: 75px; }
  .header-inner { min-height: 66px; }
  .brand img { width: 96px; }
  .header-inner nav { display: none; }
  .hero-layout { grid-template-columns: 1fr; min-height: 0; }
  .hero-copy { padding-block: 28px 10px; }
  .hero h1 { font-size: clamp(45px, 10vw, 66px); margin-block: 0 11px; }
  .hero-copy .button { margin-top: 16px; }
  .map-figure { padding-block: 7px 15px; }
  .map-figure figcaption { margin-inline: 0; }
  .north { top: 6%; }
  .north svg { width: 19px; height: 20px; }
  .district-pin { min-width: 42px; min-height: 30px; padding-inline: 6px; font-size: 13px; }
  .district-pin::after { content: ""; position: absolute; inset: -5px -1px; border-radius: inherit; }
  .dock-inner { grid-template-columns: 1fr; padding-block: 15px; }
  .dock-title { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 10px; }
  .dock-title strong { font-size: 18px; }
  .district-buttons { gap: 4px; }
  .district-choice { min-height: 44px; padding-inline: 4px; font-size: 14px; }
  .progress-section { padding-block: 37px 58px; }
  .progress-heading { margin-bottom: 16px; }
  .progress-links { gap: 4px 12px; }
  .results { columns: 1; }
  .entry { grid-template-columns: 7.5em minmax(0, 1fr); }
}

@media (max-width: 470px) {
  .city-map { margin-inline: -8px; }
  .district-pin { min-width: 34px; min-height: 22px; padding: 2px 4px; }
  .district-pin::after { inset: -2px 0; }
  .district-buttons { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .progress-heading { align-items: start; flex-direction: column; }
  .search { width: 100%; }
  .entry { grid-template-columns: 1fr; }
  .footer-inner { align-items: flex-start; flex-direction: column; }
}

@media (prefers-reduced-motion: no-preference) {
  .district-pin { animation: pin-arrival .32s ease-out backwards; animation-delay: var(--arrival); }
  @keyframes pin-arrival {
    from { opacity: 0; transform: translate(-50%, -35%); }
    to { opacity: 1; transform: translate(-50%, -50%); }
  }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; }
}
