:root {
  color-scheme: light;
  font-family: "Instrument Sans", "PingFang TC", "Noto Sans TC", "Microsoft JhengHei", sans-serif;
  color: #332738;
  background: #faf2ed;
  --ink: #332738;
  --muted: #645368;
  --purple: #754880;
  --accent: #fff0eb;
  --line: #e0cfe3;
  --paper: #fffcfa;
}
* { box-sizing: border-box; }
body { margin: 0; }
a { color: inherit; }
button, input, select { font: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid #804b91; outline-offset: 3px; }
.shell { width: min(100% - 32px, 1160px); margin-inline: auto; }
.topbar { border-bottom: 1px solid var(--line); }
.top-inner, .section-head, .dialog-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.top-inner { min-height: 65px; }
.brand { display: inline-flex; gap: 9px; align-items: center; font-weight: 750; font-size: .92rem; text-decoration: none; }
.brand-icon { display: grid; place-items: center; background: var(--purple); color: var(--accent); width: 31px; height: 31px; border-radius: 9px; }
.quiet, .primary {
  border: 1px solid var(--line); border-radius: 8px; background: var(--paper); color: var(--ink);
  min-height: 44px; padding: 8px 12px; font-weight: 680; white-space: nowrap;
}
.quiet:hover { background: #f4e4f2; }
.hero {
  isolation: isolate; position: relative; overflow: hidden;
  display: grid; gap: 24px; margin: 20px 0 28px; padding: clamp(23px, 5vw, 54px);
  border-radius: 19px; background: linear-gradient(112deg, #ddc2ea, #efd1e7 67%, #f6d5cb); color: #3b2843;
}
.eyebrow { color: #6f3855; font-size: .83rem; letter-spacing: .10em; margin: 0 0 13px; font-weight: 700; }
h1 { font-size: clamp(2rem, 6.5vw, 4.05rem); margin: 0; line-height: 1.18; letter-spacing: .015em; }
.hero-desc { margin: 15px 0 0; font-size: .95rem; line-height: 1.6; color: #553958; }
.figures { display: flex; align-self: end; gap: 12px; margin: 0; }
.figures div { display: flex; align-items: baseline; gap: 7px; padding: 8px 10px; border: 1px solid #c7a0cb; border-radius: 8px; background: #fff0eb; }
.figures dt { font-size: .74rem; }
.figures dd { font-size: 1.5rem; font-weight: 750; color: var(--purple); margin: 0; }
.explorer { display: grid; gap: 30px; }
.section-head { min-height: 48px; margin-bottom: 10px; }
h2 { font-size: 1.24rem; margin: 0; }
.all-link { display: inline-flex; align-items: center; min-height: 44px; color: var(--purple); font-weight: 700; font-size: .88rem; text-underline-offset: 4px; }
.area-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 7px; }
.area-tile {
  display: flex; flex-direction: column; justify-content: center; gap: 4px;
  min-height: 56px; border: 1px solid var(--line); border-radius: 9px;
  background: var(--paper); padding: 7px 8px; text-decoration: none;
}
.area-tile span { color: var(--muted); font-size: .71rem; }
.area-tile:hover { border-color: #a676ae; background: #f9e1e6; }
.area-tile.active { background: var(--purple); border-color: var(--purple); color: white; }
.area-tile.active span { color: var(--accent); }
.results { min-width: 0; }
.filters { display: grid; grid-template-columns: minmax(0, 1fr) minmax(105px, 34%); gap: 9px; }
.filters label, .field-label { display: grid; gap: 5px; font-size: .82rem; font-weight: 700; }
input, select { min-width: 0; width: 100%; min-height: 46px; padding: 8px 9px; border: 1px solid #b59ab7; border-radius: 8px; color: var(--ink); background: white; }
input::placeholder { color: var(--muted); }
.result-count, .hint { color: var(--muted); font-size: .86rem; line-height: 1.6; }
.cards { display: grid; gap: 10px; }
.card, .empty { background: var(--paper); border: 1px solid var(--line); border-radius: 11px; padding: 14px 16px; }
.card-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 9px; font-size: .76rem; font-weight: 700; }
.card-meta a { display: inline-flex; align-items: center; min-height: 24px; text-underline-offset: 3px; }
.card-meta span { border-radius: 4px; padding: 4px 7px; background: #f5d9e2; color: #6f3855; }
.card p { margin: 9px 0 0; line-height: 1.75; white-space: pre-wrap; overflow-wrap: anywhere; }
.empty h3 { margin: 0 0 9px; }
.empty p { margin: 0; color: var(--muted); }
.footer { margin-top: 35px; border-top: 1px solid var(--line); padding-block: 21px; color: var(--muted); font-size: .8rem; }
dialog { width: min(100% - 24px, 460px); padding: 0; border: 0; border-radius: 15px; background: var(--paper); color: var(--ink); }
dialog::backdrop { background: #38213ec0; }
.dialog-body { padding: 20px; }
.services { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin: 15px 0; }
.services a { display: grid; place-items: center; min-height: 45px; border: 1px solid var(--line); border-radius: 8px; font-weight: 700; text-decoration: none; }
.services a:hover { background: #f4e4f2; }
.copy-row { display: flex; gap: 7px; margin-top: 5px; }
.primary { background: var(--purple); color: white; }
.copy-status { min-height: 1.2em; color: var(--purple); font-size: .82rem; margin-bottom: 0; }
@media (min-width: 720px) {
  .shell { width: min(100% - 72px, 1160px); }
  .hero { grid-template-columns: 1fr auto; margin-block: 32px; }
  .figures div { min-width: 97px; flex-direction: column; gap: 0; padding: 13px; }
  .figures dd { font-size: 2rem; }
  .explorer { grid-template-columns: minmax(245px, 31%) minmax(0, 1fr); gap: clamp(23px, 4vw, 48px); }
  .area-grid { grid-template-columns: repeat(2, 1fr); }
  .area-tile { padding-inline: 13px; }
  .card { padding: 17px 20px; }
}

.page-nav {
  display: flex;
  gap: 8px;
  margin-top: 16px;
}
.page-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 8px 15px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  font-weight: 700;
  text-decoration: none;
}
.page-nav a[aria-current="page"] {
  background: var(--purple);
  border-color: var(--purple);
  color: white;
}
button.area-tile { align-items: flex-start; color: inherit; text-align: left; }
button.area-tile.active { color: white; }
.sector-group + .sector-group { margin-top: 26px; }
.sector-group h3 { margin: 0 0 10px; }
.sector-group h4 { margin: 0; font-size: 1rem; }

.regional-explorer {
  --map-accent: #754880;
  --map-muted: #ecd8ed;
}
.map-navigation {
  align-self: start;
  min-width: 0;
}
.map-navigation, .regional-explorer > .results {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 15px;
  padding: clamp(12px, 2vw, 22px);
}
.map-panel { margin-bottom: 12px; }
.map-controls { display: inline-flex; }
.map-controls button {
  min-height: 44px;
  background: white;
  border: 1px solid var(--line);
  padding: 6px 12px;
  color: var(--ink);
  font-weight: 700;
}
.map-controls button:first-child { border-radius: 8px 0 0 8px; }
.map-controls button:last-child { border-radius: 0 8px 8px 0; }
.map-controls button[aria-pressed="true"], .map-shortcuts .active {
  background: var(--map-accent);
  border-color: var(--map-accent);
  color: white;
}
.map-shortcuts .active span { color: #fff0f6; }
.region-map { display: block; width: 100%; margin-block: 10px; }
.region-map.zoom { max-height: 510px; }
.map-region path {
  fill: var(--map-muted);
  stroke: var(--paper);
  stroke-width: 1px;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
}
.map-region:hover path, .map-region:focus-visible path { fill: #e7a9bd; }
.map-region[aria-current="page"] path { fill: var(--map-accent); }
.map-label {
  cursor: pointer;
  font-weight: 800;
  fill: #4c3354;
  stroke: var(--paper);
  stroke-width: 2.5px;
  stroke-linejoin: round;
  paint-order: stroke;
}
.map-label.active { fill: white; stroke: var(--map-accent); }
.map-legend, .district-list { color: var(--muted); font-size: .83rem; }
.map-legend { display: flex; align-items: center; gap: 6px; }
.map-legend span { width: 12px; height: 12px; background: var(--map-accent); border-radius: 3px; }
.district-list { margin: -3px 0 15px; }
@media (min-width: 720px) {
  .regional-explorer { grid-template-columns: 1fr; }
  .map-shortcuts { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (min-width: 840px) {
  .regional-explorer { grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 18px; }
}

/* Keep the map and the reading pane close to the page heading. */
.hero {
  margin-block: 12px 18px;
  padding: clamp(17px, 2.6vw, 32px);
  gap: 14px;
  border: 1px solid #dfc7e4;
  background: linear-gradient(104deg, #f4e3f6 4%, #f9e9ee 60%, #fae4d8);
}
.hero::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 0 0 0 34%;
  background: linear-gradient(90deg, #f4e3f6, #f4e3f655 54%, #f6d5cb22),
    url("caowu-square.jpg") center 52% / cover no-repeat;
}
@media (max-width: 719px) {
  .hero::before {
    inset-inline-start: 24%;
    background-image: linear-gradient(90deg, #f4e3f6, #f4e3f6dd 60%, #f4e3f68c),
      url("caowu-square.jpg");
  }
}
.hero h1 {
  font-family: "Noto Serif TC", "Songti TC", "PMingLiU", serif;
  font-size: clamp(2rem, 4.8vw, 3.4rem);
  letter-spacing: .04em;
}
.hero .eyebrow { margin-bottom: 6px; }
.hero-desc { margin-top: 7px; }
.figures div {
  border: 0;
  border-inline-start: 2px solid #aa6d9b;
  border-radius: 0;
  background: #fff5f2db;
}
.map-navigation {
  background: #f2e5f3;
  border-color: #dcc5df;
}
.map-panel {
  padding: 10px;
  border: 1px solid #e7d3df;
  border-radius: 11px;
  background: #fffbf8;
}
.regional-explorer { --map-muted: #f1d9c9; }
.map-shortcuts { gap: 5px; }
.map-shortcuts .area-tile { min-height: 48px; }
.regional-explorer > .results { background: #fffdfb; }
.regional-explorer .cards { gap: 0; }
.policy-entry {
  border: 0;
  border-top: 1px solid var(--line);
  border-radius: 0;
  padding: 14px 0 14px 2.6rem;
  background: transparent;
  position: relative;
}
.policy-entry p { margin: 0 0 7px; }
.policy-number {
  position: absolute;
  left: 0;
  top: 14px;
  color: #94456b;
  font-family: Georgia, serif;
  font-size: 1.2rem;
  font-variant-numeric: lining-nums tabular-nums;
}
.policy-entry .card-meta span { border-radius: 99px; }
@media (min-width: 840px) {
  .map-navigation { position: sticky; top: 12px; }
}

.category-notice {
  max-width: 43em;
  margin: 10px 0 0;
  padding: 8px 11px;
  border-inline-start: 3px solid var(--purple);
  border-radius: 0 6px 6px 0;
  background: #fff7fa;
  color: var(--ink);
  font-size: .86rem;
  line-height: 1.55;
}
