@import url('https://fonts.googleapis.com/css2?family=Zen+Maru+Gothic:wght@500;700;900&family=Noto+Sans+TC:wght@400;500;600;700&display=swap');

:root {
  --bg: #fafaf7;
  --ink: #16232e;
  --text-2: #5b6672;
  --primary: #0d7377;
  --primary-dark: #095457;
  --primary-tint: #d9efee;
  --accent: #ff6f59;
  --tertiary: #0d7377;
  --line: #e5e2da;
  --card-bg: #ffffff;
  --danger: #b3453f;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; overflow-x: hidden; }
body {
  margin: 0;
  font-family: 'Noto Sans TC', sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.7;
  overflow-x: hidden;
  width: 100%;
}
h1, h2, h3, h4 { font-family: 'Zen Maru Gothic', sans-serif; }
a { color: inherit; }
img { max-width: 100%; }

/* ---------- 頁首 ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(250, 250, 247, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.site-header-inner {
  max-width: 1120px;
  margin: 0 auto;
  padding: 18px 28px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}
.brand-mark {
  font-family: 'Zen Maru Gothic', sans-serif;
  font-weight: 700;
  font-size: 19px;
  color: var(--primary-dark);
}
.site-nav { display: flex; gap: 26px; flex-wrap: wrap; }
.site-nav a {
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  color: var(--ink);
  transition: color 0.15s ease;
}
.site-nav a:hover { color: var(--primary); }

/* ---------- 診所分頁籤 ---------- */
.clinic-tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.clinic-tab {
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-2);
  padding: 8px 18px;
  border-radius: 20px;
  transition: background 0.15s ease, color 0.15s ease;
}
.clinic-tab:hover { background: var(--primary-tint); color: var(--primary-dark); }
.clinic-tab.active { background: var(--primary); color: #fff; }

/* ---------- 最新消息獨立頁面 ---------- */
.news-tabs {
  display: flex; gap: 6px; flex-wrap: wrap;
  margin: 24px 0 28px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 12px;
}
.news-tab-btn {
  padding: 8px 16px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: #fff;
  font-size: 13.5px;
  cursor: pointer;
  color: var(--text-2);
}
.news-tab-btn:hover { border-color: var(--primary); color: var(--primary-dark); }
.news-tab-btn.active { background: var(--primary); border-color: var(--primary); color: #fff; }
.news-tab-btn.news-tab-closure.active { background: var(--danger); border-color: var(--danger); }

.news-full-list { display: flex; flex-direction: column; gap: 16px; padding-bottom: 60px; }
.news-full-item {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 20px 22px;
  background: #fff;
}
.news-closure-item { border-color: var(--danger); background: #fbeceb; }
.news-full-image { width: 100%; max-height: 260px; object-fit: cover; border-radius: 8px; margin-bottom: 14px; display: block; }
.news-full-meta { display: flex; gap: 10px; align-items: center; margin-bottom: 8px; flex-wrap: wrap; }
.news-full-badge {
  font-size: 11.5px; font-weight: 600; padding: 3px 10px; border-radius: 12px;
  background: var(--primary-tint); color: var(--primary-dark);
}
.news-badge-closure { background: var(--danger); color: #fff; }
.news-full-date { font-size: 12px; color: var(--text-2); }
.news-full-item h3 { font-size: 16px; margin: 0 0 8px; }
.news-full-item p { font-size: 14px; color: var(--text-2); margin: 0; }

/* ---------- 緊急停診公告橫幅 ---------- */
.closure-banner {
  background: var(--danger);
  color: #fff;
  padding: 14px 28px;
  width: 100%;
}
.closure-banner p { margin: 4px 0; font-size: 14px; }
.closure-banner strong { font-weight: 700; }
.closure-banner-item { margin-bottom: 8px; }
.closure-banner-item:last-child { margin-bottom: 0; }
.closure-banner-image { max-width: 240px; max-height: 120px; border-radius: 6px; margin-top: 6px; display: block; }

/* ---------- Hero ---------- */
.hero { padding: 0 0 48px; width: 100%; overflow: hidden; }

.hero-banner-image-wrap {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 28px;
}
.hero-banner-image {
  display: block;
  width: 100%;
  height: 420px;
  object-fit: contain;
  background: var(--primary-tint);
  border-radius: 16px;
}
.hero-inner {
  max-width: 1120px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 40px;
  align-items: center;
  padding: 72px 28px 0;
  width: 100%;
}
.hero-inner-stacked {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 40px 28px 0;
  text-align: center;
}
.hero-inner-stacked .hero-text {
  margin: 0 auto;
  width: 100%;
}
.hero-inner-stacked .hero-cta { justify-content: center; }

.hero-eyebrow {
  display: inline-block;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--primary);
  background: var(--primary-tint);
  padding: 6px 14px;
  border-radius: 20px;
  margin-bottom: 22px;
}
.hero-title {
  font-size: 38px;
  font-weight: 900;
  line-height: 1.4;
  margin: 0 0 22px;
  color: var(--ink);
}
.hero-desc {
  font-size: 16px;
  color: var(--text-2);
  max-width: 100%;
  margin: 0 auto 32px;
}
.hero-inner:not(.hero-inner-stacked) .hero-desc { margin: 0 0 32px; }

.hero-cta { display: flex; gap: 14px; flex-wrap: wrap; }
.btn-primary, .btn-outline {
  display: inline-block;
  padding: 13px 26px;
  border-radius: 8px;
  font-size: 14.5px;
  font-weight: 600;
  text-decoration: none;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.btn-primary {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 6px 18px rgba(13, 115, 119, 0.25);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 10px 24px rgba(13, 115, 119, 0.32); }
.btn-outline {
  background: #fff;
  color: var(--primary-dark);
  border: 1.5px solid var(--primary);
}
.btn-outline:hover { transform: translateY(-2px); }

.hero-art { position: relative; height: 320px; width: 100%; }
.hero-blob { position: absolute; inset: 0; width: 100%; height: 100%; }
.hero-icon-cross {
  position: absolute;
  top: 46%; left: 50%;
  transform: translate(-50%, -50%);
  width: 64px; height: 64px;
}

/* ---------- 共用區塊標題 ---------- */
.section-inner { max-width: 1120px; margin: 0 auto; padding: 0 28px; width: 100%; }
.section-eyebrow {
  display: block;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.14em;
  color: var(--accent);
  margin-bottom: 8px;
}
.section-title {
  font-size: 26px;
  font-weight: 700;
  margin: 0 0 16px;
  color: var(--ink);
}
.section-desc { color: var(--text-2); max-width: 560px; margin: 0 0 32px; }

/* ---------- 診療項目 ---------- */
.services-section { padding: 64px 0; background: #fff; width: 100%; }
.services-checklist {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px 16px;
  margin-top: 28px;
  width: 100%;
}
.service-tag {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 13px;
  background: #fff;
  min-width: 0;
}
.service-tag span:last-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.service-tag-icon {
  width: 16px;
  height: 16px;
  min-width: 16px;
  max-width: 16px;
  min-height: 16px;
  max-height: 16px;
  flex: 0 0 16px;
  display: block;
}

/* ---------- 醫療團隊 ---------- */
.doctors-section { padding: 64px 0; width: 100%; }
.team-clinic-label {
  font-size: 16px;
  color: var(--ink);
  margin: 32px 0 16px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--primary-tint);
}
.team-clinic-label:first-of-type { margin-top: 8px; }
.doctors-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  width: 100%;
}
.doctor-card {
  background: var(--card-bg);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 24px 22px;
  min-width: 0;
}
.doctor-photo {
  width: 88px;
  height: 88px;
  min-width: 88px;
  max-width: 88px;
  min-height: 88px;
  max-height: 88px;
  border-radius: 50%;
  object-fit: cover;
  margin-bottom: 14px;
  border: 3px solid var(--primary-tint);
  display: block;
}
.doctor-avatar {
  width: 48px; height: 48px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Zen Maru Gothic', sans-serif;
  font-weight: 700;
  font-size: 18px;
  margin-bottom: 14px;
}
.doctor-card h4 { font-size: 16px; margin: 0 0 2px; }
.doctor-title { display: block; font-size: 12.5px; color: var(--accent); font-weight: 600; margin-bottom: 10px; }
.doctor-card p { font-size: 13.5px; color: var(--text-2); margin: 0; }
.doctor-social-links { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.doctor-social-links a {
  text-decoration: none;
  display: inline-flex;
  transition: transform 0.15s ease;
}
.doctor-social-links a:hover { transform: translateY(-2px); }
.clinic-social-links { display: flex; gap: 8px; flex-wrap: wrap; }
.clinic-social-links a { display: inline-flex; text-decoration: none; transition: transform 0.15s ease; }
.clinic-social-links a:hover { transform: translateY(-2px); }

/* ---------- 社群圖示(三種風格) ---------- */
.social-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  vertical-align: middle;
}
.social-icon-filled { }
.social-icon-outline { border: 1.5px solid; background: transparent; }
.social-icon-mono { width: auto; height: auto; }
.contact-fb-link .social-icon { margin-right: 6px; }
.contact-fb-link { display: inline-flex; align-items: center; }

/* ---------- 可點擊卡片(醫師/診療項目) ---------- */
.service-tag-clickable { cursor: pointer; transition: border-color 0.15s ease, transform 0.15s ease; }
.service-tag-clickable:hover { border-color: var(--primary); transform: translateY(-2px); }
.doctor-card-clickable { cursor: pointer; transition: border-color 0.15s ease, transform 0.15s ease; }
.doctor-card-clickable:hover { border-color: var(--primary); transform: translateY(-3px); }
.doctor-view-more { display: block; font-size: 12px; color: var(--primary); font-weight: 600; margin-top: 8px; }

/* ---------- 詳細說明彈出視窗 ---------- */
.detail-modal-overlay {
  position: fixed; inset: 0;
  background: rgba(22,35,46,0.55);
  display: none;
  align-items: center; justify-content: center;
  z-index: 1000;
  padding: 20px;
}
.detail-modal-overlay.active { display: flex; }
.detail-modal {
  background: #fff;
  border-radius: 14px;
  padding: 32px;
  max-width: 480px;
  width: 100%;
  max-height: 82vh;
  overflow-y: auto;
  position: relative;
}
.detail-modal-close {
  position: absolute; top: 14px; right: 16px;
  background: none; border: none;
  font-size: 18px; cursor: pointer;
  color: var(--text-2);
  width: 32px; height: 32px;
}
.detail-modal-title { font-size: 19px; margin: 0 0 6px; padding-right: 30px; }
.detail-modal-photo {
  width: 100%;
  max-width: 220px;
  height: 220px;
  object-fit: cover;
  border-radius: 12px;
  display: block;
  margin: 0 auto 18px;
  border: 3px solid var(--primary-tint);
}
.detail-modal-subtitle { font-size: 13px; color: var(--accent); font-weight: 600; margin: 0 0 16px; }
.detail-modal-section { font-size: 13.5px; color: var(--primary-dark); margin: 18px 0 6px; }
.detail-modal-section:first-of-type { margin-top: 4px; }
.detail-modal-text { font-size: 14px; color: var(--text-2); line-height: 1.7; margin: 0; }

/* ---------- 門診班表 ---------- */
.schedule-section { padding: 64px 0; background: #fff; width: 100%; }
.clinic-schedule-card {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 28px;
  margin-bottom: 24px;
  scroll-margin-top: 80px;
  width: 100%;
}
.clinic-schedule-header {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 22px;
}
.clinic-schedule-header h3 { font-size: 21px; margin: 0; }
.status-badge { font-size: 12.5px; font-weight: 600; padding: 5px 14px; border-radius: 20px; }
.status-open { background: #e3f6e9; color: #1f8a4c; }
.status-closed { background: #f1ede4; color: var(--text-2); }
.status-emergency { background: var(--danger); color: #fff; font-weight: 700; }

.clinic-schedule-grid {
  display: grid;
  grid-template-columns: 0.9fr 1.4fr;
  gap: 32px;
  align-items: start;
  width: 100%;
}
.clinic-schedule-info p { color: var(--text-2); margin: 0 0 16px; }
.queue-mini-widget { margin-bottom: 16px; }
.mini-queue-grid { display: flex; flex-direction: column; gap: 10px; }
.mini-queue-item {
  background: var(--primary-tint);
  border-radius: 8px;
  padding: 10px 14px;
}
.mini-queue-label { display: block; font-size: 13px; font-weight: 700; color: var(--primary-dark); margin-bottom: 6px; }
.mini-queue-group { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 3px; }
.mini-queue-group:last-child { margin-bottom: 0; }
.mini-queue-group-title { font-size: 10.5px; font-weight: 700; color: #fff; background: var(--primary); padding: 1px 7px; border-radius: 8px; min-width: 30px; text-align: center; }
.mini-queue-stat { font-size: 11.5px; color: var(--text-2); }
.mini-queue-stat strong { color: var(--ink); font-size: 13px; }
.mini-queue-updated { font-size: 10.5px; color: #a49d8a; margin: 8px 0 0; text-align: right; }
.info-list { display: flex; flex-direction: column; gap: 10px; }
.info-item { display: flex; gap: 10px; font-size: 14.5px; }
.info-label { flex-shrink: 0; width: 44px; color: var(--primary-dark); font-weight: 600; }
.info-value a { color: var(--primary-dark); text-decoration: underline; }
.clinic-map-embed { margin-top: 16px; }
.clinic-map-embed iframe { display: block; }

.hours-table { width: 100%; border-collapse: collapse; font-size: 14px; background: var(--bg); border-radius: 10px; overflow: hidden; }
.hours-table td { padding: 9px 16px; border-bottom: 1px solid var(--line); }
.hours-table tr:last-child td { border-bottom: none; }
.hours-table tr.today-row td { font-weight: 700; color: var(--primary-dark); }
.hours-segments { display: flex; flex-wrap: wrap; gap: 14px; }
.hours-segment-item { display: inline-flex; align-items: baseline; gap: 6px; white-space: nowrap; }
.hours-segment-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--primary-dark);
  background: var(--primary-tint);
  padding: 2px 8px;
  border-radius: 10px;
}
.today-tag {
  display: inline-block;
  margin-left: 8px;
  font-size: 10.5px;
  background: var(--accent);
  color: #fff;
  padding: 2px 8px;
  border-radius: 10px;
  font-weight: 600;
}
.closed-text { color: #b7b0a0; }

/* ---------- 最新消息(嵌入預覽) ---------- */
.news-section { padding: 64px 0; background: #fff; width: 100%; }
.news-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.news-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  background: var(--bg);
  min-width: 0;
}
.news-image { width: 100%; height: 160px; object-fit: cover; display: block; }
.news-body { padding: 18px 20px; }
.news-date { font-size: 12px; color: var(--accent); font-weight: 600; }
.news-body h3 { font-size: 16px; margin: 6px 0 8px; }
.news-body p { font-size: 13.5px; color: var(--text-2); margin: 0; }

/* ---------- FAQ ---------- */
.faq-section { padding: 64px 0; width: 100%; }
.faq-list { display: flex; flex-direction: column; gap: 10px; }
.faq-item {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 16px 20px;
}
.faq-item summary {
  cursor: pointer;
  font-weight: 600;
  font-size: 15px;
  list-style: none;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::before {
  content: '+';
  display: inline-block;
  width: 20px;
  color: var(--accent);
  font-weight: 700;
}
.faq-item[open] summary::before { content: '−'; }
.faq-item p { margin: 12px 0 0 20px; color: var(--text-2); font-size: 14px; }

/* ---------- 聯絡區塊 ---------- */
.contact-section { padding: 60px 28px; background: var(--primary-dark); color: #fff; text-align: center; width: 100%; }
.contact-inner { max-width: 640px; margin: 0 auto; width: 100%; }
.contact-section h2 { font-size: 24px; margin: 0 0 12px; }
.contact-section p { color: rgba(255,255,255,0.8); margin: 0 0 28px; }
.contact-cards { display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; }
.contact-card {
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 10px;
  padding: 18px 26px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 220px;
  flex: 1 1 220px;
  max-width: 320px;
  text-align: left;
}
.contact-card strong { font-size: 15px; }
.contact-card span { font-size: 13.5px; color: rgba(255,255,255,0.85); }
.contact-fb-link { color: #fff; text-decoration: underline; font-size: 13px; margin-top: 4px; }
.line-booking-btn {
  display: inline-flex; align-items: center; gap: 8px;
  background: #06C755; color: #fff; text-decoration: none;
  padding: 12px 24px; border-radius: 24px; font-size: 14.5px; font-weight: 700;
  margin: 8px 0 28px;
}
.line-booking-btn:hover { opacity: 0.9; }

.site-footer { text-align: center; padding: 24px; font-size: 12.5px; color: var(--text-2); width: 100%; }

/* ============================================================
   RWD
   ============================================================ */
@media (max-width: 900px) {
  .doctors-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .news-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 860px) {
  .hero-inner { grid-template-columns: 1fr; padding: 40px 20px 0; }
  .hero-inner-stacked { padding: 32px 20px 0; }
  .hero-art { height: 200px; order: -1; }
  .hero-title { font-size: 28px; }
  .clinic-schedule-grid { grid-template-columns: 1fr; }
  .hero-banner-image-wrap, .hero-banner-image { height: 220px; }
  .section-inner { padding: 0 20px; }
  .services-section, .doctors-section, .schedule-section, .faq-section, .news-section { padding: 48px 0; }
}

@media (max-width: 640px) {
  .services-checklist { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
  .service-tag { padding: 8px 6px; font-size: 11px; flex-direction: column; text-align: center; gap: 4px; }
  .service-tag span:last-child { white-space: normal; line-height: 1.3; }

  .doctors-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .doctor-card { padding: 16px 12px; text-align: center; }
  .doctor-photo, .doctor-avatar { margin-left: auto; margin-right: auto; }
  .doctor-photo { width: 64px; height: 64px; min-width: 64px; max-width: 64px; min-height: 64px; max-height: 64px; }
  .doctor-avatar { width: 48px; height: 48px; }
  .doctor-card h4 { font-size: 13.5px; }
  .doctor-title { font-size: 11px; }
  .doctor-view-more { font-size: 11px; }
  .doctor-social-links { justify-content: center; }

  .news-grid { grid-template-columns: 1fr; }
  .contact-card { min-width: 0; width: 100%; max-width: none; }
  .hero-title { font-size: 24px; }
  .clinic-schedule-card { padding: 20px; }
  .hours-segments { flex-direction: column; gap: 4px; }
  .hours-table td { padding: 8px 10px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .btn-primary:hover, .btn-outline:hover { transform: none; }
}
