:root {
  --ink: #1f2f2d;
  --muted: #66736e;
  --paper: #f7fbf6;
  --surface: #ffffff;
  --wash: #edf4ef;
  --line: #d8e2dc;
  --teal: #0f7c74;
  --teal-deep: #154c64;
  --leaf: #4f8f55;
  --coral: #e76855;
  --coral-soft: #fee8df;
  --yellow: #f5c95f;
  --violet: #6b6a9f;
  --shadow: 0 16px 42px rgba(25, 45, 42, 0.12);
  --max: 1180px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: -apple-system, BlinkMacSystemFont, "Noto Sans TC", "PingFang TC", "Microsoft JhengHei",
    sans-serif;
  line-height: 1.6;
}

img {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select {
  font: inherit;
}

button,
select,
input {
  border-radius: 8px;
}

button {
  cursor: pointer;
}

:focus-visible {
  outline: 3px solid rgba(15, 124, 116, 0.26);
  outline-offset: 2px;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 68px;
  padding: 10px clamp(16px, 4vw, 42px);
  border-bottom: 1px solid rgba(216, 226, 220, 0.9);
  background: rgba(247, 251, 246, 0.94);
  backdrop-filter: blur(14px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: max-content;
  color: var(--teal-deep);
  font-size: 1.16rem;
  font-weight: 900;
}

.brand img {
  width: 42px;
  height: 42px;
}

.main-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 22px;
  color: var(--muted);
  font-size: 0.96rem;
  font-weight: 700;
}

.main-nav a:hover,
.main-nav a:focus-visible {
  color: var(--teal);
}

.header-action,
.primary-button,
.report-form button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 16px;
  border: 0;
  background: var(--teal-deep);
  color: #fff;
  font-weight: 850;
  white-space: nowrap;
}

.header-action:hover,
.primary-button:hover,
.report-form button:hover {
  background: #0d3f54;
}

.map-app {
  display: grid;
  grid-template-columns: minmax(240px, 292px) minmax(0, 1fr) minmax(270px, 350px);
  gap: 16px;
  max-width: 1440px;
  margin: 0 auto;
  padding: 18px clamp(14px, 3vw, 32px) 44px;
}

.filter-panel,
.map-panel,
.detail-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 10px 28px rgba(31, 47, 45, 0.08);
}

.filter-panel,
.detail-panel {
  position: sticky;
  top: 86px;
  align-self: start;
  padding: 18px;
}

.map-panel {
  min-width: 0;
  padding: 18px;
}

.panel-heading h1,
.map-toolbar h2,
.section-heading h2,
.report-copy h2,
.seo-page h1 {
  margin: 0;
  font-size: 1.78rem;
  line-height: 1.18;
  letter-spacing: 0;
}

.panel-heading p:not(.eyebrow),
.section-heading p:not(.eyebrow),
.report-copy p,
.seo-page p {
  margin: 8px 0 0;
  color: var(--muted);
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--coral);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.quick-intents {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 16px;
}

.quick-intents button,
.toggle-grid button,
.secondary-button,
.chip,
.toilet-card button,
.toilet-actions a,
.detail-actions a,
.article-link,
.link-grid a {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font-weight: 800;
}

.quick-intents button {
  padding: 8px 10px;
  color: var(--teal-deep);
  text-align: left;
}

.field,
.report-form label {
  display: grid;
  gap: 7px;
  margin-top: 15px;
}

.field span,
.report-form label span {
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 800;
}

.field input,
.field select,
.toolbar-controls select,
.report-form input,
.report-form select {
  width: 100%;
  min-height: 44px;
  padding: 9px 11px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
}

.toggle-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.toggle-grid button {
  padding: 8px 9px;
  text-align: left;
}

.toggle-grid button.active,
.chip.active {
  border-color: var(--teal);
  background: #e1f2ef;
  color: var(--teal-deep);
}

.switch-row {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 42px;
  margin-top: 16px;
  color: var(--ink);
  font-weight: 800;
}

.switch-row input {
  width: 18px;
  height: 18px;
  accent-color: var(--teal);
}

.secondary-button {
  width: 100%;
  margin-top: 10px;
  background: var(--wash);
}

#nearMeButton {
  width: 100%;
  margin-top: 16px;
}

.status-line {
  min-height: 22px;
  margin: 10px 0 0;
  color: var(--teal-deep);
  font-size: 0.9rem;
  font-weight: 750;
}

.map-toolbar {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: start;
}

.toolbar-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 230px;
}

#resultCount {
  min-width: 58px;
  color: var(--teal-deep);
  font-weight: 900;
  text-align: right;
}

.city-strip {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 14px 0;
}

.chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: max-content;
  padding: 0 12px;
}

.map-canvas {
  position: relative;
  min-height: 365px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(90deg, rgba(21, 76, 100, 0.08) 1px, transparent 1px),
    linear-gradient(0deg, rgba(21, 76, 100, 0.08) 1px, transparent 1px),
    #ecf7f4;
  background-size: 38px 38px;
}

.map-shape {
  position: absolute;
  inset: 30px 16% 30px 22%;
  border: 2px solid rgba(15, 124, 116, 0.55);
  border-radius: 58% 42% 52% 48% / 38% 45% 55% 62%;
  background: rgba(255, 255, 255, 0.62);
  transform: rotate(-10deg);
}

.map-shape::before {
  content: "";
  position: absolute;
  right: 8%;
  bottom: 12%;
  width: 18%;
  height: 25%;
  border: 2px solid rgba(15, 124, 116, 0.38);
  border-radius: 50%;
  background: rgba(245, 201, 95, 0.16);
}

.map-label {
  position: absolute;
  display: inline-flex;
  min-height: 28px;
  padding: 2px 8px;
  border: 1px solid rgba(21, 76, 100, 0.12);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.8);
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 850;
  transform: rotate(10deg);
}

.map-label.north {
  top: 12%;
  right: 22%;
}

.map-label.center {
  top: 46%;
  left: 36%;
}

.map-label.south {
  bottom: 12%;
  left: 30%;
}

.map-points {
  position: absolute;
  inset: 0;
}

.map-point {
  position: absolute;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 3px solid #fff;
  border-radius: 999px;
  background: var(--teal);
  color: #fff;
  box-shadow: 0 8px 18px rgba(21, 76, 100, 0.22);
  transform: translate(-50%, -50%);
  transition: transform 140ms ease, opacity 140ms ease, background 140ms ease;
}

.map-point span {
  font-size: 0.78rem;
  font-weight: 900;
}

.map-point.active {
  z-index: 4;
  background: var(--coral);
  transform: translate(-50%, -50%) scale(1.18);
}

.map-point.muted {
  opacity: 0.24;
}

.map-point:hover {
  transform: translate(-50%, -50%) scale(1.12);
}

.toilet-list {
  display: grid;
  gap: 12px;
  margin-top: 14px;
}

.toilet-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 66px;
  gap: 14px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.toilet-card.is-active {
  border-color: var(--teal);
  box-shadow: inset 4px 0 0 var(--teal);
}

.toilet-card h3 {
  margin: 0;
  font-size: 1.12rem;
  line-height: 1.32;
  letter-spacing: 0;
}

.toilet-card h3 a {
  color: var(--teal-deep);
}

.toilet-meta,
.toilet-tags,
.toilet-actions,
.detail-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  align-items: center;
}

.toilet-meta {
  margin-top: 7px;
  color: var(--muted);
  font-size: 0.92rem;
}

.toilet-card p {
  margin: 10px 0 0;
  color: var(--muted);
}

.toilet-quick-facts {
  display: grid;
  gap: 6px;
  margin: 12px 0 0;
}

.toilet-quick-facts div {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr);
  gap: 8px;
  padding: 4px 0;
  border-bottom: 1px solid #edf2ef;
}

.toilet-quick-facts dt {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 850;
}

.toilet-quick-facts dd {
  min-width: 0;
  margin: 0;
  color: var(--ink);
  font-size: 0.9rem;
  font-weight: 750;
}

.toilet-tags,
.detail-tags {
  margin-top: 12px;
}

.tag {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--wash);
  color: #47524e;
  font-size: 0.84rem;
  font-weight: 800;
}

.tag.important {
  background: var(--coral-soft);
  color: #943728;
}

.toilet-actions {
  margin-top: 14px;
}

.toilet-card button,
.toilet-actions a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 12px;
}

.grade-badge {
  display: grid;
  place-items: center;
  align-content: center;
  width: 66px;
  height: 66px;
  border-radius: 8px;
  background: #eef7f4;
  color: var(--teal-deep);
  font-size: 0.95rem;
  font-weight: 900;
  text-align: center;
}

.grade-badge span {
  display: block;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
}

.detail-empty {
  color: var(--muted);
}

.detail-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}

.detail-brand img {
  width: 50px;
  height: 50px;
}

.detail-panel h2 {
  margin: 0;
  font-size: 1.26rem;
  line-height: 1.26;
  letter-spacing: 0;
}

.detail-panel p {
  color: var(--muted);
}

.detail-list {
  display: grid;
  gap: 10px;
  margin: 18px 0;
  padding: 0;
  list-style: none;
}

.detail-list li {
  display: grid;
  gap: 2px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}

.detail-list span {
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 800;
}

.detail-list strong {
  font-size: 0.98rem;
  line-height: 1.45;
}

.call-checklist {
  margin: 18px 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #e5f3ed;
}

.call-checklist strong {
  display: block;
  color: var(--teal-deep);
}

.call-checklist ol {
  display: grid;
  gap: 6px;
  margin: 10px 0 0;
  padding-left: 20px;
}

.call-checklist li {
  color: var(--ink);
  font-size: 0.92rem;
}

.detail-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.detail-actions a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 8px;
}

.detail-actions a:first-child {
  border-color: var(--teal-deep);
  background: var(--teal-deep);
  color: #fff;
}

.content-band {
  padding: 58px clamp(18px, 4vw, 34px);
}

.place-band,
.source-band {
  background: #fff;
}

.feature-band {
  background: #f0f7f2;
}

.seo-band {
  background: #f8f2e7;
}

.report-band {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 430px);
  gap: 54px;
  align-items: start;
  max-width: var(--max);
  margin: 0 auto;
}

.section-heading {
  display: grid;
  gap: 8px;
  max-width: var(--max);
  margin: 0 auto 24px;
}

.section-heading h2,
.report-copy h2 {
  font-size: 2rem;
}

.section-heading p:not(.eyebrow) {
  max-width: 760px;
}

.intent-grid,
.feature-grid,
.matrix-grid,
.source-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  max-width: var(--max);
  margin: 0 auto;
}

.matrix-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.source-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.intent-grid article,
.feature-grid article,
.matrix-grid article,
.source-grid article {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.intent-grid strong,
.feature-grid strong,
.matrix-grid strong,
.source-grid strong {
  display: block;
  font-size: 1.08rem;
  line-height: 1.36;
}

.feature-grid span {
  display: inline-flex;
  min-height: 28px;
  margin-bottom: 12px;
  padding: 2px 8px;
  border-radius: 999px;
  background: #e0eff5;
  color: var(--teal-deep);
  font-size: 0.82rem;
  font-weight: 900;
}

.intent-grid p,
.feature-grid p,
.matrix-grid p,
.source-grid p {
  margin: 8px 0 0;
  color: var(--muted);
}

.intent-grid a,
.matrix-grid a {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  margin-top: 16px;
  color: var(--teal-deep);
  font-weight: 900;
}

.report-form {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 10px 28px rgba(31, 47, 45, 0.08);
}

.report-form button {
  width: 100%;
  margin-top: 18px;
}

#formMessage {
  min-height: 24px;
  margin: 12px 0 0;
  color: var(--teal-deep);
  font-weight: 800;
}

.empty-state {
  margin: 18px 0 0;
  padding: 16px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  background: #fff;
}

.mobile-action-bar {
  position: fixed;
  left: 10px;
  right: 10px;
  bottom: 10px;
  z-index: 35;
  display: none;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(247, 251, 246, 0.96);
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
}

.mobile-action-bar a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  border-radius: 8px;
  background: #fff;
  color: var(--teal-deep);
  font-size: 0.9rem;
  font-weight: 900;
}

.mobile-action-bar a:first-child {
  background: var(--teal-deep);
  color: #fff;
}

.site-footer {
  display: flex;
  justify-content: space-between;
  gap: 22px;
  padding: 28px clamp(18px, 4vw, 44px);
  border-top: 1px solid var(--line);
  background: var(--ink);
  color: #fff;
}

.site-footer p {
  max-width: 650px;
  margin: 6px 0 0;
  color: rgba(255, 255, 255, 0.72);
}

.domain-list {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  align-content: flex-start;
}

.domain-list span,
.domain-list a {
  padding: 4px 8px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 999px;
  color: rgba(255, 255, 255, 0.84);
  font-size: 0.86rem;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

.seo-page {
  max-width: var(--max);
  margin: 0 auto;
  padding: 26px clamp(18px, 4vw, 34px) 64px;
}

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 18px;
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 750;
}

.breadcrumb a {
  color: var(--teal-deep);
}

.seo-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(240px, 320px);
  gap: 22px;
  align-items: stretch;
  padding: 26px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.hero-facts {
  display: grid;
  gap: 10px;
}

.hero-facts div,
.provider-profile dl div,
.trust-grid article {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
}

.hero-facts span,
.provider-profile dt,
.trust-grid span {
  display: block;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 850;
}

.hero-facts strong,
.provider-profile dd,
.trust-grid strong {
  display: block;
  margin: 4px 0 0;
  color: var(--ink);
  font-weight: 900;
}

.seo-section {
  margin-top: 26px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.seo-section .section-heading {
  margin-bottom: 18px;
}

.seo-card-grid,
.decision-grid,
.faq-list,
.link-grid,
.trust-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.seo-provider-card,
.decision-grid article,
.faq-list article {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
}

.seo-provider-card h3,
.decision-grid strong,
.faq-list h3 {
  margin: 0;
  color: var(--teal-deep);
  font-size: 1.04rem;
  line-height: 1.35;
}

.seo-provider-card span {
  display: inline-flex;
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 850;
}

.seo-provider-card p,
.decision-grid p,
.faq-list p {
  margin: 8px 0 0;
  color: var(--muted);
}

.seo-provider-card dl,
.provider-profile dl {
  display: grid;
  gap: 8px;
  margin: 12px 0 0;
}

.seo-provider-card dl div {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  gap: 8px;
}

.seo-provider-card dt,
.seo-provider-card dd {
  margin: 0;
  font-size: 0.9rem;
}

.seo-provider-card dt {
  color: var(--muted);
  font-weight: 850;
}

.card-link,
.empty-resource a,
.profile-actions a {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  margin-top: 14px;
  color: var(--teal-deep);
  font-weight: 900;
}

.link-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.link-grid a {
  display: inline-flex;
  align-items: center;
  padding: 0 12px;
}

.empty-resource,
.source-note {
  padding: 18px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: var(--paper);
}

.provider-profile dl {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.provider-profile dd {
  margin-left: 0;
}

.profile-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 14px;
}

.source-note {
  margin-top: 24px;
}

@media (max-width: 1160px) {
  .map-app {
    grid-template-columns: minmax(230px, 280px) minmax(0, 1fr);
  }

  .detail-panel {
    position: static;
    grid-column: 1 / -1;
  }

  .intent-grid,
  .feature-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .site-header {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .main-nav {
    order: 3;
    justify-content: flex-start;
    width: 100%;
    overflow-x: auto;
    padding-bottom: 2px;
  }

  .map-app,
  .report-band,
  .seo-hero {
    grid-template-columns: 1fr;
  }

  .filter-panel,
  .detail-panel {
    position: static;
  }

  .map-canvas {
    min-height: 320px;
  }

  .matrix-grid,
  .source-grid,
  .seo-card-grid,
  .decision-grid,
  .faq-list,
  .trust-grid,
  .provider-profile dl {
    grid-template-columns: 1fr;
  }

  .link-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  body {
    padding-bottom: 76px;
  }

  .site-header {
    min-height: auto;
  }

  .brand img {
    width: 38px;
    height: 38px;
  }

  .header-action {
    min-height: 38px;
    padding: 0 12px;
  }

  .map-app {
    padding: 12px 10px 30px;
  }

  .filter-panel,
  .map-panel,
  .detail-panel {
    padding: 14px;
  }

  .panel-heading h1,
  .map-toolbar h2,
  .section-heading h2,
  .report-copy h2,
  .seo-page h1 {
    font-size: 1.52rem;
  }

  .quick-intents,
  .toggle-grid,
  .intent-grid,
  .feature-grid {
    grid-template-columns: 1fr;
  }

  .map-toolbar,
  .toolbar-controls {
    display: grid;
    width: 100%;
  }

  #resultCount {
    text-align: left;
  }

  .map-canvas {
    min-height: 270px;
  }

  .toilet-card {
    grid-template-columns: 1fr;
  }

  .grade-badge {
    width: 100%;
    height: auto;
    min-height: 46px;
  }

  .toilet-quick-facts div {
    grid-template-columns: 1fr;
    gap: 2px;
  }

  .detail-actions {
    grid-template-columns: 1fr;
  }

  .content-band {
    padding: 42px 14px;
  }

  .report-band {
    gap: 20px;
  }

  .site-footer {
    display: grid;
    padding-bottom: 88px;
  }

  .domain-list {
    justify-content: flex-start;
  }

  .mobile-action-bar {
    display: grid;
  }

  .seo-page {
    padding: 18px 12px 58px;
  }

  .seo-hero,
  .seo-section {
    padding: 16px;
  }

  .link-grid {
    grid-template-columns: 1fr;
  }
}
