:root {
  --ink: #17231f;
  --muted: #5c6964;
  --line: #d5dfda;
  --soft: #f3f7f5;
  --white: #ffffff;
  --green: #1f6c55;
  --green-dark: #174f41;
  --green-pale: #e5f1ec;
  --red: #b8483f;
  --red-pale: #f9ebe8;
  --gold: #a97805;
  --gold-pale: #fff4d7;
  --shadow: 0 8px 24px rgba(23, 35, 31, 0.08);
  color-scheme: light;
  font-family: Inter, "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", Arial, sans-serif;
}

* { box-sizing: border-box; }
html { background: var(--soft); color: var(--ink); scroll-behavior: smooth; }
body { margin: 0; min-width: 320px; background: var(--soft); line-height: 1.6; }
a { color: var(--green-dark); text-underline-offset: 3px; }
a:hover { color: var(--red); }
img { display: block; max-width: 100%; }
button, input, select { font: inherit; letter-spacing: 0; }
button, .button { min-height: 42px; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(12px);
}
.site-header-inner {
  width: min(1240px, calc(100% - 32px));
  min-height: 68px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 24px;
}
.brand {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  font-weight: 800;
  text-decoration: none;
}
.brand img { width: 34px; height: 34px; }
.brand span { line-height: 1.08; }
.brand small { display: block; margin-top: 3px; color: var(--muted); font-size: 11px; font-weight: 650; }
.site-nav {
  min-width: 0;
  flex: 1;
  display: flex;
  align-items: center;
  gap: 2px;
  overflow-x: auto;
  scrollbar-width: thin;
}
.site-nav a {
  flex: 0 0 auto;
  padding: 10px 9px;
  color: var(--ink);
  font-size: 14px;
  font-weight: 650;
  text-decoration: none;
}
.site-nav a[aria-current="page"] { color: var(--green); text-decoration: underline; }
.language-link {
  flex: 0 0 auto;
  border-left: 1px solid var(--line);
  padding: 7px 0 7px 14px;
  font-size: 14px;
  font-weight: 750;
  text-decoration: none;
}

main { min-height: 70vh; }
.page-shell { width: min(1160px, calc(100% - 32px)); margin: 0 auto; padding: 34px 0 64px; }
.narrow-shell { width: min(860px, calc(100% - 32px)); }
.breadcrumb { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 22px; color: var(--muted); font-size: 14px; }
.breadcrumb a { color: var(--muted); }
.eyebrow { margin: 0 0 8px; color: var(--green); font-size: 13px; font-weight: 800; text-transform: uppercase; }
h1, h2, h3 { margin-top: 0; line-height: 1.22; letter-spacing: 0; }
h1 { max-width: 900px; margin-bottom: 14px; font-size: 38px; }
h2 { margin-bottom: 12px; font-size: 25px; }
h3 { margin-bottom: 8px; font-size: 18px; }
p { margin: 0 0 16px; }
.lede { max-width: 820px; color: var(--muted); font-size: 18px; }
.secondary-name { margin: -6px 0 20px; color: var(--muted); font-size: 17px; font-weight: 650; }
.updated-line { margin: 16px 0 0; color: var(--muted); font-size: 13px; }

.status-band {
  margin: 26px 0 34px;
  border-top: 4px solid var(--green);
  border-bottom: 1px solid var(--line);
  background: var(--white);
  box-shadow: var(--shadow);
}
.status-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.status-item { min-width: 0; padding: 20px; border-right: 1px solid var(--line); }
.status-item:last-child { border-right: 0; }
.status-item span { display: block; margin-bottom: 5px; color: var(--muted); font-size: 13px; }
.status-item strong { display: block; font-size: 20px; overflow-wrap: anywhere; }
.status-item.is-pending strong { color: var(--red); }

.notice {
  margin: 20px 0 28px;
  padding: 16px 18px;
  border-left: 4px solid var(--gold);
  background: var(--gold-pale);
}
.notice strong { display: block; margin-bottom: 4px; }
.notice.is-critical { border-color: var(--red); background: var(--red-pale); }
.notice.is-source { border-color: var(--green); background: var(--green-pale); }

.section { margin-top: 46px; }
.section-head { display: flex; align-items: end; justify-content: space-between; gap: 18px; margin-bottom: 18px; }
.section-head p { max-width: 650px; margin: 0; color: var(--muted); }
.action-row { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 20px; }
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 9px 14px;
  border: 1px solid var(--green);
  border-radius: 5px;
  background: var(--green);
  color: var(--white);
  font-weight: 750;
  text-decoration: none;
}
.button:hover { border-color: var(--red); background: var(--red); color: var(--white); }
.button.secondary { background: var(--white); color: var(--green-dark); }
.button.secondary:hover { color: var(--red); }

.search-bar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  max-width: 760px;
  margin: 22px 0 0;
}
input, select {
  width: 100%;
  min-width: 0;
  min-height: 44px;
  border: 1px solid #aebdb6;
  border-radius: 4px;
  background: var(--white);
  color: var(--ink);
  padding: 9px 11px;
}
input:focus, select:focus, button:focus-visible, a:focus-visible { outline: 3px solid rgba(31, 108, 85, 0.24); outline-offset: 2px; }

.feature-grid, .source-grid, .fact-grid, .district-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}
.feature-card, .source-card, .fact-card, .school-card {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--white);
}
.feature-card, .source-card { padding: 20px; }
.feature-card p, .source-card p { color: var(--muted); }
.feature-card a, .source-card a { font-weight: 750; }
.fact-card { padding: 16px; }
.fact-card span { display: block; margin-bottom: 4px; color: var(--muted); font-size: 13px; }
.fact-card strong { display: block; overflow-wrap: anywhere; }

.timeline-list { border-top: 1px solid var(--line); }
.timeline-row {
  display: grid;
  grid-template-columns: 190px minmax(0, 1fr) 150px;
  gap: 18px;
  padding: 18px 0;
  border-bottom: 1px solid var(--line);
}
.timeline-row strong { color: var(--green-dark); }
.timeline-row p { margin: 0; }
.pending-label { color: var(--red); font-weight: 800; }

.directory-section { padding: 26px 0; border-top: 1px solid var(--line); }
.directory-section h2 { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; }
.directory-section h2 span { color: var(--muted); font-size: 14px; font-weight: 600; }
.school-link-list { columns: 3; column-gap: 28px; margin: 0; padding: 0; list-style: none; }
.school-link-list li { break-inside: avoid; margin: 0 0 8px; }
.school-link-list a { font-weight: 650; }

.finder-form {
  display: grid;
  grid-template-columns: minmax(220px, 1.6fr) repeat(3, minmax(150px, 1fr)) auto;
  gap: 10px;
  align-items: end;
  margin: 24px 0 16px;
  padding: 18px;
  border-top: 4px solid var(--green);
  background: var(--white);
  box-shadow: var(--shadow);
}
.field label { display: block; margin-bottom: 5px; color: var(--muted); font-size: 13px; font-weight: 700; }
.reset-button {
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--white);
  color: var(--ink);
  padding: 8px 13px;
  cursor: pointer;
}
.result-count { margin: 0 0 16px; color: var(--muted); font-weight: 700; }
.school-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.school-card { display: flex; min-height: 260px; flex-direction: column; padding: 18px; }
.school-card[hidden] { display: none; }
.school-card h2 { margin-bottom: 5px; font-size: 19px; }
.school-card .other-name { min-height: 42px; margin: 0 0 12px; color: var(--muted); font-size: 13px; }
.tag-row { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.tag { padding: 3px 7px; border-radius: 3px; background: var(--green-pale); color: var(--green-dark); font-size: 12px; font-weight: 750; }
.tag.alt { background: var(--gold-pale); color: #795600; }
.card-facts { display: grid; gap: 7px; margin-bottom: 16px; color: var(--muted); font-size: 14px; }
.card-facts strong { color: var(--ink); }
.school-card .button { margin-top: auto; align-self: flex-start; }

.profile-header { padding-bottom: 8px; }
.profile-section { padding: 30px 0; border-top: 1px solid var(--line); }
.profile-section p:last-child { margin-bottom: 0; }
.prose { max-width: 850px; }
.prose ul, .prose ol { padding-left: 22px; }
.prose li { margin-bottom: 8px; }
.source-list { margin: 0; padding-left: 20px; }
.source-list li { margin-bottom: 10px; overflow-wrap: anywhere; }
.empty-state {
  padding: 32px;
  border: 1px dashed #9cafaa;
  background: var(--white);
  text-align: center;
}
.empty-state strong { display: block; margin-bottom: 8px; font-size: 22px; }

.site-footer { border-top: 1px solid var(--line); background: var(--white); }
.site-footer-inner {
  width: min(1160px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0;
  display: grid;
  grid-template-columns: 1fr 1.5fr;
  gap: 30px;
}
.site-footer p { max-width: 520px; margin: 7px 0 0; color: var(--muted); font-size: 14px; }
.site-footer nav { display: flex; flex-wrap: wrap; align-content: flex-start; justify-content: flex-end; gap: 8px 16px; }
.site-footer nav a { color: var(--muted); font-size: 14px; }
.site-footer-meta { border-top: 1px solid var(--line); padding: 12px 16px; color: var(--muted); font-size: 12px; text-align: center; }

@media (max-width: 980px) {
  .site-header-inner { align-items: flex-start; flex-wrap: wrap; gap: 6px 16px; padding: 10px 0; }
  .site-nav { order: 3; width: 100%; flex-basis: 100%; }
  .language-link { margin-left: auto; }
  .feature-grid, .source-grid, .fact-grid, .district-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .finder-form { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .school-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .school-link-list { columns: 2; }
}

@media (max-width: 680px) {
  .site-header-inner, .page-shell, .narrow-shell, .site-footer-inner { width: min(100% - 24px, 1160px); }
  .brand small { display: none; }
  .site-nav a { padding: 8px; font-size: 13px; }
  .language-link { padding-left: 10px; }
  .page-shell { padding-top: 24px; }
  h1 { font-size: 30px; overflow-wrap: anywhere; }
  h2 { font-size: 22px; }
  .lede { font-size: 16px; }
  .status-grid, .feature-grid, .source-grid, .fact-grid, .district-grid, .school-grid, .finder-form, .site-footer-inner { grid-template-columns: 1fr; }
  .status-item { border-right: 0; border-bottom: 1px solid var(--line); }
  .status-item:last-child { border-bottom: 0; }
  .search-bar { grid-template-columns: 1fr; }
  .section-head { align-items: flex-start; flex-direction: column; }
  .timeline-row { grid-template-columns: 1fr; gap: 5px; }
  .school-link-list { columns: 1; }
  .school-card { min-height: 0; }
  .school-card .other-name { min-height: 0; }
  .site-footer nav { justify-content: flex-start; }
  .empty-state { padding: 24px 16px; }
}
