:root {
  --ink: #2a2433;
  --muted: #6d6578;
  --paper: #f3f1f6;
  --line: #e4deee;
  --purple: #832a7c;
  --purple-deep: #993366;
  --pink: #ffccff;
  --lilac: #8d56d8;
  --lilac-card: #dacfff;
  --teal: #009290;
  --mint: #ccffff;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
html:has(.topbar) { scroll-padding-top: 90px; }
body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: "Noto Sans TC", "Microsoft JhengHei", "PingFang TC", sans-serif;
}
a { color: inherit; text-decoration: none; }
.skip { position: absolute; left: 12px; top: -40px; }
.skip:focus { top: 8px; }

.topbar, .detail-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 16px;
  padding: 22px 7vw 18px;
  background: #fff;
}
.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  align-items: center;
  height: 77px;
  padding: 0 15px 0 10px;
  background: #fff;
  box-shadow: 0 1px 0 #e7e1ef;
}
.brand {
  display: flex;
  align-items: center;
  flex: 0 0 auto;
  height: 77px;
  min-width: 0;
}
.brand-emblem {
  display: block;
  flex: 0 0 auto;
  object-fit: contain;
}
.brand-emblem.national { width: 56px; height: 56px; margin-right: 7px; }
.brand-emblem.regional { width: 48px; height: 48px; margin-right: 7px; }
.brand-wordmark {
  display: block;
  width: 208px;
  height: 69px;
  min-width: 208px;
  max-width: 208px;
  margin: 7px 0 0 7px;
  object-fit: fill;
}
.topbar p, .detail-kicker { margin: 0 0 4px; color: var(--purple); font-size: 13px; }
.detail-top .detail-kicker { margin-bottom: 8px; font-size: 18px; line-height: 1.6; overflow-wrap: anywhere; }
.topbar h1 { margin-left: auto; white-space: nowrap; font-size: 21px; }
@media (min-width: 1281px) {
  .topbar { padding-left: calc(2.5vw + 10px); padding-right: max(15px, 2.5vw); }
}
@media (min-width: 1440px) {
  .topbar, .brand { height: 83px; }
  .brand-emblem.national { width: 61px; height: 61px; }
  .brand-emblem.regional { width: 52px; height: 52px; }
  .brand-wordmark { width: 226px; height: 76px; min-width: 226px; max-width: 226px; }
}
@media (min-width: 1600px) {
  .topbar, .brand { height: 90px; }
  .brand-emblem.national { width: 66px; height: 66px; }
  .brand-emblem.regional { width: 57px; height: 57px; }
  .brand-wordmark { width: 246px; height: 83px; min-width: 246px; max-width: 246px; }
  html:has(.topbar) { scroll-padding-top: 102px; }
}
.legco-mark {
  display: block;
  flex: 0 0 auto;
  width: 41px;
  min-width: 41px;
  max-width: 41px;
  height: 42px;
}
h1 { margin: 0; font-size: 30px; letter-spacing: 0.12em; }
.detail-top h1 { letter-spacing: 0; font-size: 26px; }

.shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 150px;
  gap: 22px;
  width: min(1120px, calc(100% - 40px));
  margin: 28px auto 40px;
  align-items: start;
}
.data-range { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 12px; margin: 0 0 16px; color: var(--muted); font-size: 14px; }
.data-range strong { color: var(--ink); font-weight: 600; white-space: nowrap; }
.rail { display: flex; flex-direction: column; gap: 10px; margin-top: 8px; }
.rail a {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 46px;
  padding: 8px 12px;
  border-radius: 999px;
  background: #fff;
  color: var(--purple-deep);
  font-size: 13px;
  font-weight: 700;
}
.rail a span {
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--pink);
  font-size: 11px;
}
.rail a.active { background: var(--purple); color: #fff; }
.rail a.active span { background: rgba(255, 255, 255, 0.22); }

.board {
  margin-bottom: 84px;
  padding: 24px;
  border-radius: 28px;
  color: #fff;
  scroll-margin-top: 18px;
}
.board:last-child { margin-bottom: 0; }
.board h2 { margin: 0 0 18px; font-size: 30px; font-weight: 700; }
.purple { background: var(--purple); }
.teal { background: var(--teal); }
.violet { background: var(--lilac); }

.feature {
  padding: 34px 32px 32px;
}
.feature h2 { margin-bottom: 22px; font-size: 44px; letter-spacing: 0.04em; }
.feature .tile { min-height: 250px; padding: 30px 28px 26px; grid-template-columns: 120px minmax(0, 1fr); }
.feature .tile h3 { font-size: 24px; }
.feature .mark { width: 108px; height: 108px; }
.feature .tile p { margin-top: 22px; }
.feature .tile strong { font-size: 92px; }
.feature .tile span, .feature .tile small { font-size: 16px; }
.tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.lead {
  display: grid;
  grid-template-columns: minmax(148px, 1fr) minmax(0, 2fr);
  gap: 12px;
  align-items: center;
  margin-bottom: 12px;
}
.lead h2 { margin: 0; }
.lead .tile { column-gap: 24px; }
.tiles.rows { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.tiles.rows > :nth-child(-n+3) { grid-column: span 2; }
.tiles.rows > :nth-child(n+4) { grid-column: span 3; }
.tiles.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.tiles.four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.tile, .chart-tile {
  display: block;
  min-height: 176px;
  padding: 20px 18px 18px;
  border-radius: 22px;
  background: var(--pink);
  color: var(--purple-deep);
  overflow: hidden;
}
.tile { display: grid; grid-template-columns: 104px minmax(0, 1fr); column-gap: 8px; align-items: center; }
.tile h3 { grid-column: 2; }
.tile p, .tile small { grid-column: 2; }
.tiles.rows .tile { grid-template-rows: 1fr auto 1fr; padding-block: 18px; }
.tiles.rows .tile h3 { grid-row: 1; align-self: end; margin-bottom: 10px; }
.tiles.rows .tile p { grid-row: 2; margin: 0; }
.tiles.rows .tile .mark { grid-row: 1 / span 3; }
.mark {
  grid-row: 1 / span 3;
  grid-column: 1;
  width: 72px;
  height: 72px;
  object-fit: contain;
  object-position: center;
  justify-self: center;
  transform: scale(1.72);
  transform-origin: center;
  filter:
    brightness(0) invert(1)
    drop-shadow(1px 0 0 var(--purple-deep))
    drop-shadow(-1px 0 0 var(--purple-deep))
    drop-shadow(0 1px 0 var(--purple-deep))
    drop-shadow(0 -1px 0 var(--purple-deep));
}
.mark.count {
  width: 104px;
  height: 88px;
  transform: none;
  filter: none;
}
.teal .tile { background: var(--mint); color: #007a78; }
.teal .mark {
  filter:
    brightness(0) invert(1)
    drop-shadow(1px 0 0 #007a78)
    drop-shadow(-1px 0 0 #007a78)
    drop-shadow(0 1px 0 #007a78)
    drop-shadow(0 -1px 0 #007a78);
}
.violet .chart-tile { background: var(--lilac-card); color: #6841b8; }
.tile h3, .chart-tile h3 { margin: 0; font-size: 18px; font-weight: 700; }
.tile p { display: flex; align-items: baseline; flex-wrap: wrap; gap: 6px; margin: 14px 0 0; }
.tile strong { font-size: 56px; line-height: 1; letter-spacing: 0; white-space: nowrap; }
.tile span, .tile small, .crumb { font-size: 14px; font-weight: 700; }
.tile small { display: block; margin-top: 8px; }
a.tile:hover, a.chart-tile:hover { filter: brightness(1.03); outline: 3px solid #fff; outline-offset: -6px; }

.feature .participation-summary {
  grid-template-columns: 104px minmax(0, 1fr);
  align-content: center;
  gap: 14px 8px;
  padding: 20px 18px 18px;
}
.feature .participation-summary .mark {
  display: block;
  grid-row: 1 / span 2;
  width: 72px;
  height: 72px;
}
.participation-metric { grid-column: 2; min-width: 0; }
.feature .participation-metric h3 { font-size: 18px; }
.feature .participation-metric p { margin: 8px 0 0; gap: 6px; }
.feature .participation-summary .participation-metric strong { font-size: 56px; }
.feature .participation-metric span { font-size: 14px; }
.feature .participation-metric .year-change {
  margin-left: 4px;
  font-size: 13px;
  white-space: nowrap;
}
.tiles.four .tile {
  min-height: 168px;
  padding: 16px 10px;
  grid-template-columns: 58px minmax(0, 1fr);
  column-gap: 4px;
}
.tiles.four .mark { width: 48px; height: 48px; transform: scale(1.42); }
.tiles.four .tile h3 { font-size: 15px; }
.tiles.four .tile strong { font-size: 56px; }
.tiles.four .tile span { font-size: 14px; }

.inset { margin-top: 14px; padding: 14px; border-radius: 22px; background: rgba(255, 255, 255, 0.14); }
.inset > h3 { margin: 2px 4px 12px; font-size: 18px; }
.inset .lead > h3 { margin: 2px 4px 12px; font-size: 18px; }
.finance-inset .tile { grid-template-rows: 44px minmax(62px, auto); align-items: start; }
.finance-inset .tile h3 { align-self: center; }
.finance-inset .tile p { grid-column: 1 / -1; grid-row: 2; justify-content: center; margin-top: 14px; }
.finance-inset .mark { grid-row: 1; align-self: center; }
.inset .mark.committee-count { object-view-box: inset(0 24%); filter: none; }

.chart-tile { min-height: 0; }
.crumb { margin: 0 0 6px; }
.chart-scroll { overflow-x: auto; margin-top: 8px; }
svg { display: block; width: 100%; min-width: 620px; height: auto; }
.grid { stroke: rgba(104, 65, 184, 0.25); }
.axis { fill: #6841b8; font-size: 11px; font-weight: 700; }
.axis.month { text-anchor: middle; }
.line { fill: none; stroke: #6841b8; stroke-width: 3; }
.point { fill: var(--lilac); stroke: #fff; stroke-width: 2; }
.value { fill: #4d2f92; font-size: 11px; font-weight: 700; text-anchor: middle; }

.back {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  padding: 8px 16px;
  border-radius: 999px;
  background: var(--purple);
  color: #fff;
  font-weight: 700;
  white-space: nowrap;
}
.detail { width: min(1080px, calc(100% - 32px)); margin: 24px auto 56px; }
.panel { margin-bottom: 18px; padding-top: 8px; border-radius: 24px; background: #fff; }
.panel h2 { margin: 0; padding: 16px 18px 0; font-size: 20px; color: var(--purple); }
.placeholder { margin: 8px 18px 0; color: var(--muted); font-size: 13px; }
.table-scroll { overflow-x: auto; padding: 12px; }
table { width: 100%; min-width: 640px; border-collapse: collapse; }
th, td { padding: 11px 12px; border-bottom: 1px solid var(--line); text-align: left; font-size: 14px; white-space: nowrap; }
th { color: var(--purple-deep); background: #faf7fc; }
.empty { color: #9a90a8; }

@media (min-width: 861px) {
  .rail {
    position: fixed;
    top: 50%;
    right: max(16px, calc((100% - 1120px) / 2));
    transform: translateY(-50%);
    width: 132px;
    margin: 0;
  }
  .shell { grid-template-columns: minmax(0, 1fr); padding-right: 156px; }
}
@media (min-width: 861px) and (max-width: 1180px) {
  .shell { padding-right: 0; gap: 18px; }
  .shell > .rail {
    position: static;
    grid-row: 1;
    flex-direction: row;
    justify-content: flex-end;
    width: auto;
    transform: none;
  }
  .shell > .rail a { min-height: 40px; }
}
@media (min-width: 861px) and (max-width: 1000px) {
  .tiles.rows .tile { grid-template-columns: 64px minmax(0, 1fr); }
  .tiles.rows .mark { width: 48px; height: 48px; transform: scale(1.42); }
}
@media (max-width: 860px) {
  .topbar, .detail-top { align-items: flex-start; flex-direction: column; padding: 16px; }
  .topbar {
    position: sticky;
    top: 0;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    height: auto;
    min-height: 72px;
    padding: 8px 10px;
    column-gap: 8px;
  }
  .brand { height: auto; }
  .topbar h1 { grid-column: 1 / -1; margin: 8px 0 0; }
  .legco-mark { width: 29px; min-width: 29px; max-width: 29px; height: 31px; justify-self: end; }
  .brand-emblem.national { width: 29px; height: 29px; margin-right: 4px; }
  .brand-emblem.regional { width: 25px; height: 25px; margin-right: 4px; }
  .brand-wordmark { width: 120px; height: 40px; min-width: 0; max-width: 120px; margin-top: 3px; }
  h1, .detail-top h1 { font-size: 24px; letter-spacing: 0.06em; }
  .shell { display: block; width: min(100% - 24px, 1120px); margin-bottom: 92px; }
  .board { margin-bottom: 54px; padding: 18px; border-radius: 22px; }
  .board h2 { margin-bottom: 16px; font-size: 24px; }
  .lead { grid-template-columns: 1fr; margin-bottom: 12px; }
  .tiles, .tiles.two, .tiles.four, .tiles.rows { grid-template-columns: 1fr 1fr; }
  .tiles.rows > :nth-child(n) { grid-column: auto; }
  .tile strong { font-size: 44px; }
  #efficiency .tiles:not(.four) .tile { grid-template-columns: 64px minmax(0, 1fr); }
  #efficiency .tiles:not(.four) .mark { width: 48px; height: 48px; transform: scale(1.42); }
  .feature { padding: 24px 20px; }
  .feature h2 { font-size: 30px; }
  .feature .tile { min-height: 220px; padding: 24px 20px; grid-template-columns: 100px minmax(0, 1fr); }
  .feature .tile h3 { font-size: 21px; }
  .feature .mark { width: 92px; height: 92px; }
  .feature .tile strong { font-size: 60px; }
  .rail {
    position: fixed;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 5;
    margin: 0;
    flex-direction: row;
    background: #fff;
    box-shadow: 0 -6px 18px rgba(42, 36, 51, 0.08);
  }
  .rail a { flex: 1; justify-content: center; border-radius: 0; font-size: 12px; }
}
@media (max-width: 600px) {
  .tiles, .tiles.two, .tiles.four, .tiles.rows { grid-template-columns: minmax(0, 1fr); }
  .lead { grid-template-columns: minmax(0, 1fr); }
  .lead .tile { grid-template-columns: 64px minmax(0, 1fr); column-gap: 8px; padding: 18px 12px; }
  .lead .mark.count { width: 64px; height: 64px; }
  .tiles.rows > :nth-child(n) { grid-column: auto; }
}
@media (max-width: 860px) {
  #participation .tiles.two { grid-template-columns: 1fr; }
  .feature .participation-summary { grid-template-columns: 104px minmax(0, 1fr); }
  .feature .participation-summary .participation-metric strong { font-size: 44px; }
}
@media (max-width: 360px) {
  #efficiency .tiles.rows .tile { grid-template-columns: 72px minmax(0, 1fr); padding-inline: 12px; }
  #efficiency .tiles.rows .mark { width: 48px; height: 48px; }
  .feature .participation-summary {
    grid-template-columns: 42px minmax(0, 1fr);
    padding-right: 14px;
    padding-left: 14px;
  }
  .feature .participation-summary .mark { width: 38px; height: 38px; }
}
.topbar.compact-topbar {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 12px;
  height: 56px;
  min-height: 56px;
  padding: 8px max(15px, 2.5vw);
}
.compact-topbar h1 { margin: 0 0 0 auto; font-size: 21px; letter-spacing: 0; }
.compact-topbar .legco-mark { width: 32px; min-width: 32px; max-width: 32px; height: 34px; }
html:has(.compact-topbar) { scroll-padding-top: 68px; }
