:root {
  --charcoal: #39494c;
  --charcoal-deep: #26373a;
  --muted: #708083;
  --orange: #f69903;
  --orange-bright: #ff8040;
  --orange-soft: #fff1df;
  --lavender: #f5f5ff;
  --lavender-deep: #a6a6d2;
  --surface: #ffffff;
  --canvas: #f7f9fc;
  --line: #e4e9eb;
  --shadow: 0 18px 44px rgba(43, 67, 70, 0.1);
  --radius-lg: 24px;
  --radius-md: 16px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--canvas);
  color: var(--charcoal);
  font-family: "Noto Sans TC", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}

button,
input,
select {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  cursor: pointer;
}

a {
  color: inherit;
}

.skip-link {
  background: var(--surface);
  border-radius: 0 0 8px 8px;
  left: 16px;
  padding: 10px 16px;
  position: fixed;
  top: -60px;
  transition: top 0.2s;
  z-index: 100;
}

.skip-link:focus {
  top: 0;
}

.site-header {
  background: var(--charcoal-deep);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.header-inner,
.hero-inner,
.directory-inner,
.footer-inner {
  margin: 0 auto;
  max-width: 1180px;
  width: calc(100% - 48px);
}

.header-inner {
  align-items: center;
  display: flex;
  height: 76px;
  justify-content: space-between;
}

.brand {
  display: inline-flex;
}

.brand img {
  height: auto;
  max-width: 248px;
  width: 100%;
}

.header-label {
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 999px;
  color: rgba(255, 255, 255, 0.82);
  font-size: 0.82rem;
  letter-spacing: 0.08em;
  padding: 7px 13px;
}

.hero {
  background:
    linear-gradient(135deg, rgba(245, 245, 255, 0.96), rgba(255, 255, 255, 0.98) 56%, rgba(255, 241, 223, 0.9)),
    var(--surface);
  overflow: hidden;
  position: relative;
}

.hero::after {
  background-image: radial-gradient(rgba(166, 166, 210, 0.45) 1.5px, transparent 1.5px);
  background-size: 15px 15px;
  content: "";
  height: 105px;
  opacity: 0.65;
  position: absolute;
  right: 4%;
  top: 14%;
  width: 105px;
}

.hero-orb {
  border-radius: 50%;
  pointer-events: none;
  position: absolute;
}

.hero-orb-one {
  background: rgba(166, 166, 210, 0.14);
  height: 390px;
  left: -180px;
  top: -210px;
  width: 390px;
}

.hero-orb-two {
  background: rgba(255, 128, 64, 0.11);
  bottom: -180px;
  height: 350px;
  right: -130px;
  width: 350px;
}

.hero-inner {
  padding: 88px 0 68px;
  position: relative;
  text-align: center;
  z-index: 1;
}

.eyebrow,
.section-kicker {
  color: #79878a;
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  margin: 0 0 18px;
}

.eyebrow span {
  color: var(--orange);
  font-size: 0.6rem;
  margin-right: 7px;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  color: var(--charcoal-deep);
  font-size: clamp(2.25rem, 5vw, 4.25rem);
  letter-spacing: -0.04em;
  line-height: 1.18;
  margin-bottom: 18px;
}

h1 span {
  color: var(--orange-bright);
  display: inline-block;
}

.hero-copy {
  color: var(--muted);
  font-size: clamp(1rem, 2vw, 1.15rem);
  line-height: 1.8;
  margin: 0 auto 34px;
  max-width: 620px;
}

.search-panel {
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid rgba(255, 255, 255, 0.9);
  border-radius: var(--radius-lg);
  box-shadow: 0 24px 70px rgba(43, 67, 70, 0.14);
  margin: 0 auto;
  max-width: 800px;
  padding: 18px;
  text-align: left;
}

.search-panel > label {
  display: block;
  font-size: 0.88rem;
  font-weight: 700;
  margin: 0 0 9px 3px;
}

.search-field {
  align-items: center;
  display: flex;
  gap: 8px;
  position: relative;
}

.search-icon {
  border: 2px solid var(--muted);
  border-radius: 50%;
  height: 18px;
  left: 18px;
  pointer-events: none;
  position: absolute;
  width: 18px;
}

.search-icon::after {
  background: var(--muted);
  content: "";
  height: 2px;
  position: absolute;
  right: -6px;
  top: 13px;
  transform: rotate(45deg);
  width: 8px;
}

.search-field input {
  background: #f7f9fa;
  border: 1px solid #dfe6e8;
  border-radius: 14px;
  color: var(--charcoal-deep);
  flex: 1;
  font-size: 1rem;
  height: 58px;
  min-width: 0;
  outline: none;
  padding: 0 48px 0 52px;
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}

.search-field input:focus {
  background: var(--surface);
  border-color: rgba(246, 153, 3, 0.78);
  box-shadow: 0 0 0 4px rgba(246, 153, 3, 0.12);
}

.clear-search {
  background: transparent;
  border: 0;
  color: var(--muted);
  font-size: 1.55rem;
  height: 40px;
  line-height: 1;
  position: absolute;
  right: 126px;
  width: 40px;
}

.search-button,
.booking-link,
.empty-state button,
.error-state button {
  align-items: center;
  background: linear-gradient(135deg, #f6a314, #f28e00);
  border: 1px solid #eb9306;
  border-radius: 14px;
  box-shadow: 0 7px 18px rgba(242, 142, 0, 0.22);
  color: #fff;
  display: inline-flex;
  font-weight: 700;
  height: 58px;
  justify-content: center;
  padding: 0 27px;
  text-decoration: none;
  transition: transform 0.18s, box-shadow 0.18s, filter 0.18s;
}

.search-button:hover,
.booking-link:hover,
.empty-state button:hover,
.error-state button:hover {
  box-shadow: 0 10px 24px rgba(242, 142, 0, 0.28);
  filter: brightness(1.02);
  transform: translateY(-1px);
}

.search-meta {
  color: #829093;
  display: flex;
  font-size: 0.78rem;
  justify-content: space-between;
  padding: 12px 4px 0;
}

.search-meta p {
  margin-bottom: 0;
}

.source-note {
  align-items: center;
  display: flex;
  gap: 7px;
}

.live-dot {
  background: #58a785;
  border: 3px solid #dff2ea;
  border-radius: 50%;
  display: inline-block;
  height: 11px;
  width: 11px;
}

.quick-regions {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  justify-content: center;
  margin-top: 24px;
  min-height: 34px;
}

.quick-regions::before {
  color: #849194;
  content: "熱門地區";
  font-size: 0.82rem;
  margin-right: 3px;
}

.quick-region {
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid rgba(112, 128, 131, 0.22);
  border-radius: 999px;
  color: #5f6f72;
  font-size: 0.82rem;
  padding: 7px 13px;
  transition: background 0.18s, border-color 0.18s, color 0.18s;
}

.quick-region:hover,
.quick-region.is-active {
  background: var(--charcoal);
  border-color: var(--charcoal);
  color: #fff;
}

.directory {
  background: var(--canvas);
  min-height: 500px;
  padding: 64px 0 82px;
}

.directory-heading {
  align-items: flex-end;
  display: flex;
  justify-content: space-between;
  margin-bottom: 22px;
}

.section-kicker {
  color: var(--orange-bright);
  margin-bottom: 7px;
}

h2 {
  color: var(--charcoal-deep);
  font-size: clamp(1.65rem, 3vw, 2.25rem);
  margin-bottom: 0;
}

.directory-controls {
  align-items: center;
  display: flex;
  gap: 10px;
}

.directory-controls label {
  color: var(--muted);
  font-size: 0.88rem;
}

.directory-controls select {
  appearance: none;
  background:
    linear-gradient(45deg, transparent 50%, var(--charcoal) 50%) calc(100% - 16px) 50% / 5px 5px no-repeat,
    linear-gradient(135deg, var(--charcoal) 50%, transparent 50%) calc(100% - 11px) 50% / 5px 5px no-repeat,
    var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--charcoal);
  min-width: 150px;
  outline: none;
  padding: 10px 34px 10px 13px;
}

.directory-controls select:focus {
  border-color: var(--orange);
  box-shadow: 0 0 0 3px rgba(246, 153, 3, 0.12);
}

.result-bar {
  align-items: center;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  margin-bottom: 24px;
  min-height: 44px;
  padding-bottom: 14px;
}

.result-bar p {
  color: var(--muted);
  font-size: 0.9rem;
  margin-bottom: 0;
}

.result-bar strong {
  color: var(--charcoal-deep);
}

.reset-filters,
.load-more,
.copy-link {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--charcoal);
  font-weight: 600;
}

.reset-filters {
  font-size: 0.82rem;
  padding: 7px 11px;
}

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

.clinic-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  box-shadow: 0 7px 24px rgba(43, 67, 70, 0.045);
  display: flex;
  flex-direction: column;
  min-height: 260px;
  padding: 21px;
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s;
}

.clinic-card:hover {
  border-color: rgba(246, 153, 3, 0.42);
  box-shadow: var(--shadow);
  transform: translateY(-3px);
}

.clinic-card-top {
  align-items: flex-start;
  display: flex;
  justify-content: space-between;
  margin-bottom: 18px;
}

.clinic-mark {
  align-items: center;
  background: linear-gradient(145deg, var(--lavender), var(--orange-soft));
  border: 1px solid rgba(166, 166, 210, 0.24);
  border-radius: 13px;
  display: flex;
  height: 50px;
  justify-content: center;
  overflow: hidden;
  width: 50px;
}

.clinic-initial {
  color: var(--charcoal);
  font-size: 1.2rem;
  font-weight: 700;
}

.clinic-logo {
  height: 100%;
  object-fit: cover;
  width: 100%;
}

.booking-badge {
  align-items: center;
  background: #f0faf6;
  border-radius: 999px;
  color: #43856a;
  display: inline-flex;
  font-size: 0.72rem;
  gap: 6px;
  padding: 6px 9px;
}

.booking-badge span {
  background: #58a785;
  border-radius: 50%;
  height: 6px;
  width: 6px;
}

.clinic-name {
  color: var(--charcoal-deep);
  font-size: 1.13rem;
  line-height: 1.5;
  margin-bottom: 8px;
}

.clinic-address {
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.65;
  margin-bottom: 20px;
  min-height: 2.8em;
}

.clinic-address::before {
  color: var(--orange-bright);
  content: "●";
  font-size: 0.55rem;
  margin-right: 7px;
  vertical-align: 2px;
}

.clinic-actions {
  display: grid;
  gap: 8px;
  grid-template-columns: minmax(0, 1fr) auto;
  margin-top: auto;
}

.booking-link {
  border-radius: 10px;
  height: 44px;
  padding: 0 17px;
}

.booking-link span {
  margin-left: 6px;
}

.copy-link {
  min-width: 86px;
  padding: 0 12px;
}

.copy-link:hover,
.reset-filters:hover,
.load-more:hover {
  background: var(--lavender);
  border-color: var(--lavender-deep);
}

.copy-link.is-copied {
  background: #f0faf6;
  border-color: #82bba4;
  color: #36765c;
}

.skeleton-card {
  animation: pulse 1.4s ease-in-out infinite;
  background:
    linear-gradient(#e7ebed 0 0) 20px 20px / 50px 50px no-repeat,
    linear-gradient(#e7ebed 0 0) 20px 92px / 62% 18px no-repeat,
    linear-gradient(#edf0f1 0 0) 20px 124px / 82% 13px no-repeat,
    linear-gradient(#edf0f1 0 0) 20px 150px / 68% 13px no-repeat,
    linear-gradient(#e7ebed 0 0) 20px 202px / calc(100% - 40px) 42px no-repeat,
    #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  height: 266px;
}

@keyframes pulse {
  0%,
  100% {
    opacity: 0.55;
  }
  50% {
    opacity: 1;
  }
}

.empty-state,
.error-state {
  background: var(--surface);
  border: 1px dashed #ccd5d7;
  border-radius: var(--radius-md);
  padding: 56px 24px;
  text-align: center;
}

.empty-icon {
  align-items: center;
  background: var(--lavender);
  border-radius: 50%;
  color: var(--lavender-deep);
  display: flex;
  font-size: 2rem;
  height: 62px;
  justify-content: center;
  margin: 0 auto 16px;
  width: 62px;
}

.empty-state h3,
.error-state h3 {
  color: var(--charcoal-deep);
  margin-bottom: 8px;
}

.empty-state p,
.error-state p {
  color: var(--muted);
  margin-bottom: 20px;
}

.empty-state button,
.error-state button {
  border-radius: 10px;
  height: 44px;
}

.load-more-wrap {
  text-align: center;
}

.load-more {
  margin-top: 30px;
  padding: 11px 28px;
}

.site-footer {
  background: var(--charcoal-deep);
  color: rgba(255, 255, 255, 0.67);
}

.footer-inner {
  align-items: center;
  display: flex;
  font-size: 0.82rem;
  justify-content: space-between;
  min-height: 84px;
}

.footer-inner p {
  margin-bottom: 0;
}

.footer-inner a {
  text-underline-offset: 4px;
}

.noscript-note {
  background: #fff4df;
  bottom: 0;
  left: 0;
  margin: 0;
  padding: 12px;
  position: fixed;
  text-align: center;
  width: 100%;
  z-index: 20;
}

[hidden] {
  display: none !important;
}

@media (max-width: 900px) {
  .clinic-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .header-inner,
  .hero-inner,
  .directory-inner,
  .footer-inner {
    width: calc(100% - 32px);
  }

  .header-inner {
    height: 66px;
  }

  .brand img {
    max-width: 205px;
  }

  .header-label {
    display: none;
  }

  .hero-inner {
    padding: 64px 0 48px;
  }

  .hero::after {
    display: none;
  }

  h1 {
    font-size: 2.35rem;
  }

  h1 span {
    display: block;
  }

  .hero-copy {
    font-size: 0.95rem;
  }

  .search-panel {
    border-radius: 18px;
    padding: 13px;
  }

  .search-field {
    align-items: stretch;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .search-field input {
    font-size: 16px;
    padding-left: 47px;
    padding-right: 40px;
  }

  .clear-search {
    right: 91px;
  }

  .search-button {
    padding: 0 18px;
  }

  .search-meta {
    display: block;
    line-height: 1.7;
  }

  .search-meta > p:first-child {
    display: none;
  }

  .quick-regions::before {
    flex-basis: 100%;
  }

  .directory {
    padding: 48px 0 64px;
  }

  .directory-heading {
    align-items: stretch;
    display: block;
  }

  .directory-controls {
    margin-top: 18px;
  }

  .directory-controls select {
    flex: 1;
  }

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

  .clinic-card {
    min-height: 244px;
  }

  .footer-inner {
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
    justify-content: center;
    line-height: 1.65;
    padding: 20px 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }

  .skeleton-card {
    animation: none;
  }
}
