:root {
  --pacific-blue: #005bac;
  --pacific-dark: #073b67;
  --pacific-red: #e6002d;
  --sky: #eaf4fb;
  --line: #d8e3ec;
  --ink: #173b59;
  --muted: #60788c;
  --white: #fff;
  --green: #198754;
  --yellow: #bd7a00;
  --grey: #77838d;
}
* {
  box-sizing: border-box;
}
html,
body {
  height: 100%;
  margin: 0;
  font-family: "Noto Sans TC", system-ui, sans-serif;
  color: var(--ink);
}
button,
input {
  font: inherit;
}
.topbar {
  position: fixed;
  z-index: 1000;
  inset: 0 0 auto;
  height: 62px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 16px;
  color: #fff;
  background: linear-gradient(115deg, var(--pacific-dark), var(--pacific-blue));
  border-bottom: 4px solid var(--pacific-red);
  box-shadow: 0 3px 16px #002a4c35;
}
.brand-logo {
  height: 42px;
  min-width: 76px;
  padding: 4px 8px;
  display: grid;
  place-items: center;
  background: #fff;
  border-radius: 8px;
}
.brand-logo img {
  display: block;
  max-width: 104px;
  max-height: 34px;
}
.brand-copy h1 {
  font-size: 18px;
  line-height: 1.1;
  margin: 0;
  font-weight: 900;
  white-space: nowrap;
}
.brand-copy span {
  display: block;
  font-size: 12px;
  margin-top: 4px;
  color: #d8efff;
  letter-spacing: 0.08em;
}
.official-warning {
  font-size: 12px;
  color: #ffe3a8;
  font-weight: 700;
  margin-left: 10px;
}
.spacer {
  flex: 1;
}
.header-contact {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
}
.phone-button {
  padding: 7px 12px;
  border-radius: 7px;
  background: #fff;
  color: var(--pacific-blue);
  font-weight: 900;
  text-decoration: none;
}
.level-switch {
  display: flex;
  padding: 3px;
  background: #ffffff20;
  border-radius: 9px;
}
.level-switch button {
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: #dceefe;
  padding: 7px 14px;
  font-weight: 800;
  cursor: pointer;
}
.level-switch button.active {
  color: #fff;
  background: var(--pacific-red);
}
#map {
  position: absolute;
  inset: 0;
  background: #dce7ef;
}
.panel {
  position: fixed;
  z-index: 900;
  top: 74px;
  left: 12px;
  width: 292px;
  max-height: calc(100vh - 88px);
  overflow: auto;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 12px 30px #0a36562b;
}
.panel section {
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
}
.panel section:last-child {
  border: 0;
}
.panel h2 {
  font-size: 14px;
  margin: 0 0 8px;
  font-weight: 900;
  color: var(--pacific-dark);
}
.input-row {
  display: flex;
  gap: 6px;
}
.input-row input {
  min-width: 0;
  flex: 1;
  border: 1px solid #b9cbd8;
  border-radius: 8px;
  padding: 9px 10px;
  outline: none;
}
.input-row input:focus {
  border-color: var(--pacific-blue);
  box-shadow: 0 0 0 3px #005bac20;
}
.input-row button {
  border: 0;
  border-radius: 8px;
  background: var(--pacific-blue);
  color: #fff;
  padding: 0 13px;
  font-weight: 900;
  cursor: pointer;
}
.panel section:first-child .input-row button {
  background: var(--pacific-red);
}
.muted,
.source-copy {
  font-size: 11.5px;
  color: var(--muted);
  line-height: 1.6;
}
.message {
  min-height: 18px;
  margin-top: 5px;
  font-size: 12px;
  color: #a14318;
  font-weight: 700;
}
.toggles label {
  display: block;
  font-size: 13px;
  margin: 5px 0;
  cursor: pointer;
}
.notice {
  padding: 9px;
  border: 1px solid #bdd4e5;
  background: #f3f9fd;
  border-radius: 8px;
  font-size: 11.5px;
  line-height: 1.6;
}
.notice strong {
  color: var(--pacific-blue);
}
.official-button {
  display: block;
  text-align: center;
  text-decoration: none;
  background: var(--pacific-red);
  color: #fff;
  border-radius: 8px;
  padding: 9px;
  margin-top: 8px;
  font-size: 12.5px;
  font-weight: 900;
}
.contact-card {
  font-size: 12px;
  line-height: 1.7;
}
.contact-card strong {
  font-size: 14px;
  color: var(--pacific-blue);
}
.contact-card a {
  color: var(--pacific-blue);
  font-weight: 800;
}
.contact-card #contact-line {
  color: #07933d;
}
.result-card {
  border: 1px solid var(--line);
  border-radius: 9px;
  overflow: hidden;
  margin-top: 8px;
}
.result-title {
  padding: 7px 10px;
  background: var(--pacific-blue);
  color: #fff;
  font-size: 12.5px;
  font-weight: 900;
}
.result-foot {
  padding: 7px 10px;
  background: #f4f7f9;
  color: var(--muted);
  font-size: 10.5px;
}
.tier {
  display: flex;
  gap: 8px;
  padding: 8px 10px;
}
.tier + .tier {
  border-top: 1px dashed var(--line);
}
.tier-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  margin-top: 6px;
  flex: none;
}
.tier.green .tier-dot {
  background: var(--green);
}
.tier.yellow .tier-dot {
  background: #e0a021;
}
.tier.grey .tier-dot {
  background: #8b959d;
}
.tier small {
  display: block;
  color: var(--muted);
}
.tier strong {
  display: block;
  font-size: 14px;
}
.tier.yellow strong {
  color: #8a5a12;
}
.tier p {
  font-size: 10.5px;
  margin: 2px 0 0;
  color: var(--muted);
}
#panel-toggle {
  display: none;
  position: fixed;
  z-index: 1001;
  top: 69px;
  left: 8px;
  border: 0;
  border-radius: 9px;
  padding: 9px 12px;
  background: var(--pacific-blue);
  color: #fff;
  font-weight: 900;
}
.line-fab {
  position: fixed;
  z-index: 1100;
  right: 0;
  top: 52%;
  padding: 14px 9px;
  border-radius: 12px 0 0 12px;
  background: #06c755;
  color: #fff;
  text-decoration: none;
  font-size: 12px;
  font-weight: 900;
  writing-mode: vertical-rl;
  letter-spacing: 0.12em;
}
.loading {
  position: fixed;
  z-index: 1300;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  background: #f5f9fce8;
  color: var(--pacific-dark);
}
.loading[hidden] {
  display: none;
}
.loading span {
  width: 24px;
  height: 24px;
  border: 3px solid #b8d6ea;
  border-top-color: var(--pacific-red);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
.leaflet-tooltip.zone-label {
  border: 0;
  background: var(--pacific-blue);
  color: #fff;
  font-weight: 700;
  font-size: 11px;
}
.leaflet-tooltip.zone-label:before {
  display: none;
}
.popup-title {
  font-size: 16px;
  font-weight: 900;
  color: var(--pacific-blue);
}
.popup-meta {
  font-size: 11.5px;
  color: var(--muted);
  margin: 2px 0 8px;
}
.school-chip {
  display: inline-block;
  margin: 2px;
  padding: 2px 6px;
  border-radius: 5px;
  background: #eef5fa;
  border: 1px solid #cbdce8;
  font-size: 11.5px;
}
.shared-note {
  font-size: 11px;
  color: #985e00;
  margin-top: 5px;
}
.popup-cta {
  border-top: 1px solid var(--line);
  margin-top: 9px;
  padding-top: 9px;
  text-align: center;
}
.popup-cta strong {
  display: block;
  font-size: 12px;
  margin-bottom: 6px;
}
.popup-cta a {
  display: block;
  border-radius: 7px;
  padding: 7px;
  margin-top: 5px;
  text-decoration: none;
  color: #fff;
  font-weight: 800;
}
.popup-cta .line {
  background: #06c755;
}
.popup-cta .phone {
  background: var(--pacific-blue);
}
.school-marker {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  background: #fff;
  border: 3px solid var(--pacific-red);
  border-radius: 50% 50% 50% 8px;
  transform: rotate(-45deg);
  box-shadow: 0 2px 7px #173b5966;
}
.school-marker span {
  transform: rotate(45deg);
  font-size: 15px;
}
@media (max-width: 1080px) {
  .official-warning,
  .header-contact strong {
    display: none;
  }
}
@media (max-width: 760px) {
  .topbar {
    height: 58px;
    padding: 0 8px;
    gap: 8px;
  }
  .brand-logo {
    height: 35px;
    min-width: 58px;
    padding: 3px 6px;
  }
  .brand-logo img {
    max-width: 78px;
    max-height: 28px;
  }
  .brand-copy h1 {
    font-size: 14px;
  }
  .brand-copy span {
    font-size: 10px;
  }
  .phone-button {
    display: none;
  }
  .level-switch button {
    padding: 6px 10px;
    font-size: 13px;
  }
  .panel {
    top: 64px;
    left: 8px;
    right: 8px;
    width: auto;
    max-height: calc(100vh - 74px);
    transform: translateY(-10px);
    opacity: 0;
    pointer-events: none;
    transition: 0.18s;
  }
  .panel.open {
    transform: none;
    opacity: 1;
    pointer-events: auto;
  }
  #panel-toggle {
    display: block;
  }
  .line-fab {
    top: auto;
    bottom: 90px;
  }
  .loading b {
    font-size: 14px;
  }
}
