/* ═══════════════════════════════════════════════
   承安小兒科・耳鼻喉科診所 — 基層診所模板(clinic)
   視覺方向:One Medical 式「親切但專業」
   —— 暖天藍 + 暖橘黃 + 米白,大圓角、無 serif、字級偏大。
   刻意不走 dental/ 的精品冷調:家長半夜抱著小孩看手機,
   要的是好讀好按,不是質感。
   ═══════════════════════════════════════════════ */

:root {
  --primary: #2a7fb0;           /* 暖天藍:醫療信任感但不冰冷 */
  --primary-dark: #1c5c83;
  --primary-light: #e8f2f8;
  --accent: #ef9d3c;            /* 暖橘黃:兒科親和,用在數字與重點 */
  --accent-soft: #fdf1e0;
  --ok: #2e9e6b;                /* 開診中 / 有 */
  --off: #c0553f;               /* 休診 / 無 */
  --ink: #2c3540;
  --ink-soft: #66737f;
  --bg: #fbfaf7;
  --bg-alt: #eef4f8;
  --line: #e3e7ea;
  --line-green: #06c755;
  --radius: 14px;               /* 圓角比其他模板大,親和 */
  --radius-sm: 8px;
  --shadow: 0 8px 26px rgba(44, 53, 64, .10);
  --shadow-sm: 0 2px 10px rgba(44, 53, 64, .06);
  --font-sans: "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", sans-serif;
  --font-serif: "Noto Serif TC", "PMingLiU", serif;   /* 標題專用,見下方 .u-serif */
  /* sticky 高度的單一事實來源。header + today-bar 疊起來會蓋住畫面頂端,
     手機上改版前疊到 195px(佔 812px 螢幕的 24%),捲到醫師團隊時
     整條狀態列的白字正好壓在醫師照片上,臉完全看不到。
     --header-h 給 today-bar 與手機選單對齊,--stack-h 由 js/main.js 量實際值覆寫。 */
  --header-h: 72px;
  --stack-h: 124px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--stack-h) + 12px); }  /* 實際高度由 main.js 量,錨點才不會停在 sticky 底下 */
body {
  font-family: var(--font-sans); color: var(--ink); background: var(--bg);
  line-height: 1.85; font-size: 16.5px;   /* 比其他模板大:家長單手滑手機 */
  -webkit-text-size-adjust: 100%;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--primary); text-decoration: none; }
table { border-collapse: collapse; }

.container { width: min(1180px, 92%); margin: 0 auto; }
.container-narrow { width: min(780px, 92%); }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ── 字體層級:標題襯線、內文黑體 ──
   跟 sites/shunyu-farm 同一套配對。襯線體只上標題層級,理由:
   ① 中文襯線在大字級撐得出「機構感」,診所需要的是這個,不是可愛;
   ② 但襯線在小字級、長段落的螢幕閱讀性明顯較差,所以內文、表格、清單、
      班表、按鈕一律維持黑體——班表和疫苗表是要「掃」的,不是要「品」的。
   要讓某個新標題也吃襯線,把它加進下面這串選擇器就好。 */
.logo,
.hero h1,
.section-title,
.dept h3,
.vac-card h3,
.equip h3,
.doctor-info h3,
.notice-box h3,
.note-card h3,
.rating-score,
.footer-brand {
  font-family: var(--font-serif);
}
/* logo 的英文副標、醫師卡的職稱標籤是輔助資訊,跟著內文走黑體才不會搶戲 */
.logo-sub,
.doctor-info h3 span { font-family: var(--font-sans); }

/* ── 線性圖示系統 ──
   刻意不用 emoji:醫療機構網站一排彩色 emoji 的閱讀語感是社群貼文,不是診所;
   而且同一個 emoji 在 Windows / Android / iOS 長得完全不一樣,品牌視覺控制不了。
   全部改成 <use href="#i-xxx"> 的 inline SVG,stroke 吃 currentColor,跟著品牌色走。
   新增圖示:在 index.html 頂端的 <svg class="icon-sprite"> 裡加一個 <symbol>。 */
.icon-sprite { display: none; }
.ico {
  width: 1em; height: 1em; flex-shrink: 0;
  fill: none; stroke: currentColor; stroke-width: 1.7;
  stroke-linecap: round; stroke-linejoin: round;
}

/* ── 按鈕 ── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 11px 22px; border-radius: 999px;
  font-weight: 700; font-size: 15px; white-space: nowrap; cursor: pointer;
  border: 0; font-family: inherit;
  transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
}
.btn:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-accent { background: var(--accent); color: #4a2e0c; }
.btn-ghost { border: 1.5px solid var(--primary); color: var(--primary); background: transparent; }
.btn-line { background: var(--line-green); color: #fff; }
.btn-lg { padding: 15px 32px; font-size: 17px; }
.btn-block { width: 100%; }

/* ── Header ── */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(251, 250, 247, .97); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.header-inner { display: flex; align-items: center; gap: 18px; height: var(--header-h); }
/* white-space:nowrap 不可拿掉:本模板 nav 有 7 項,header 很擠,
   沒有這行的話診所名在 1100–1280 之間會被擠成兩行。 */
.logo { font-size: 22px; font-weight: 900; color: var(--primary); display: flex; align-items: baseline; gap: 8px; line-height: 1.2; white-space: nowrap; flex-shrink: 0; }
.logo-sub { font-size: 11px; letter-spacing: .18em; color: var(--accent); font-weight: 700; }
.main-nav { display: flex; gap: 2px; margin-left: auto; }
.main-nav a { color: var(--ink); font-weight: 500; padding: 8px 10px; border-radius: var(--radius-sm); font-size: 15px; white-space: nowrap; }
.main-nav a:hover { background: var(--primary-light); color: var(--primary); }
.header-cta { display: flex; gap: 8px; }
.nav-toggle { display: none; }

/* ── 看診狀態條:本模板的核心差異化 ──
   sticky 在 header 下方,任何捲動位置都看得到「現在有沒有開」。
   狀態由 js/main.js 依 CLINIC_HOURS 即時計算;JS 沒跑到就退回 HTML 裡的靜態文字。 */
.today-bar {
  position: sticky; top: var(--header-h); z-index: 99;
  background: var(--primary-dark); color: #fff;
  border-bottom: 1px solid rgba(255, 255, 255, .12);
}
.today-inner {
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
  min-height: 52px; padding: 8px 0;
}
.today-status { display: flex; align-items: center; gap: 9px; font-weight: 700; font-size: 15.5px; }
.status-dot {
  width: 11px; height: 11px; border-radius: 50%; flex-shrink: 0;
  background: var(--ink-soft); box-shadow: 0 0 0 4px rgba(255, 255, 255, .12);
}
.today-bar.is-open .status-dot { background: #4ade80; animation: pulse-dot 2s ease-in-out infinite; }
.today-bar.is-closed .status-dot { background: #f0a58c; }
@keyframes pulse-dot {
  0%, 100% { box-shadow: 0 0 0 4px rgba(74, 222, 128, .28); }
  50% { box-shadow: 0 0 0 9px rgba(74, 222, 128, .06); }
}
.today-next { color: #bcd6e6; font-size: 14.5px; font-weight: 500; }
.today-links { display: flex; gap: 8px; margin-left: auto; }
.today-links .btn { padding: 8px 18px; font-size: 14px; }
.today-links .btn-ghost { border-color: rgba(255, 255, 255, .55); color: #fff; }
.today-links .btn-ghost:hover { background: rgba(255, 255, 255, .12); }

/* ── Hero ── */
.hero {
  background:
    linear-gradient(96deg, rgba(19, 51, 71, .80) 0%, rgba(19, 51, 71, .52) 52%, rgba(19, 51, 71, .18) 100%),
    url("../assets/hero.jpg") center / cover no-repeat;
  background-color: var(--primary-dark);
  min-height: clamp(460px, 62vh, 620px);
  display: flex; align-items: center; padding: 72px 0;
}
.hero-text { max-width: 680px; }
.hero-eyebrow { color: #ffd9a8; font-weight: 700; letter-spacing: .14em; font-size: 14px; margin-bottom: 12px; }
.hero h1 { font-size: clamp(30px, 4.6vw, 48px); font-weight: 900; line-height: 1.35; margin-bottom: 16px; color: #fff; letter-spacing: .01em; }
.hero h1 em { font-style: normal; color: #ffd9a8; }
.hero-sub { color: rgba(255, 255, 255, .88); font-size: 17px; margin-bottom: 22px; }
.hero-badges { display: flex; flex-wrap: wrap; gap: 9px; margin-bottom: 28px; }
.badge {
  background: rgba(255, 255, 255, .14); border: 1px solid rgba(255, 255, 255, .34);
  border-radius: 999px; padding: 6px 15px; font-size: 14px; font-weight: 500;
  color: #fff; backdrop-filter: blur(4px);
}
.hero-cta { display: flex; flex-wrap: wrap; gap: 12px; }
.hero .btn-primary { background: #fff; color: var(--primary-dark); }
.hero .btn-primary:hover { background: var(--primary-light); }

/* ── 就診資訊條:仿 cafe 空間資訊條,直接回答家長最常問的六件事 ── */
.facts { background: #fff; border-bottom: 1px solid var(--line); padding: 30px 0; }
.facts-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 14px; }
.fact {
  text-align: center; padding: 14px 8px; border-radius: var(--radius);
  background: var(--bg); border: 1px solid var(--line);
}
.fact-ico { font-size: 26px; line-height: 0; margin-bottom: 10px; color: var(--primary); }
.fact-label { font-size: 13.5px; color: var(--ink-soft); margin-bottom: 3px; }
.fact-val { font-size: 15px; font-weight: 700; color: var(--ok); }
.fact-val.is-no { color: var(--off); }
.fact-val.is-info { color: var(--primary); }

/* ── 區塊通用 ── */
.section { padding: 82px 0; }
.section-alt { background: var(--bg-alt); }
.section-title { font-size: clamp(25px, 3.1vw, 36px); font-weight: 900; text-align: center; margin-bottom: 12px; color: var(--primary-dark); letter-spacing: .01em; }
.section-sub { text-align: center; color: var(--ink-soft); margin-bottom: 48px; font-size: 16px; }
.section-sub strong { color: var(--primary); }

/* ── 科別與服務:以「你遇到的狀況」分欄,而非只列科別 ── */
.dept-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.dept {
  background: #fff; border-radius: var(--radius); padding: 30px 26px 26px;
  box-shadow: var(--shadow-sm); border-top: 4px solid var(--primary);
  transition: transform .2s ease, box-shadow .2s ease;
}
.dept:nth-child(2) { border-top-color: var(--accent); }
.dept:nth-child(3) { border-top-color: var(--ok); }
.dept:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.dept-icon { font-size: 34px; line-height: 0; margin-bottom: 14px; color: var(--primary); }
.dept:nth-child(2) .dept-icon { color: var(--accent); }
.dept:nth-child(3) .dept-icon { color: var(--ok); }
.dept h3 { font-size: 21px; font-weight: 900; color: var(--primary-dark); margin-bottom: 4px; }
.dept-for { font-size: 13.5px; color: var(--accent); font-weight: 700; margin-bottom: 14px; }
.dept-list { list-style: none; }
.dept-list li { position: relative; padding: 6px 0 6px 22px; font-size: 15px; border-bottom: 1px dashed var(--line); color: var(--ink-soft); }
.dept-list li:last-child { border-bottom: 0; }
.dept-list li::before { content: "▸"; position: absolute; left: 4px; color: var(--primary); font-weight: 700; }

/* ── 疫苗與健檢:SEO 主戰場,兩張表 ── */
.vac-layout { display: grid; grid-template-columns: 1fr 1fr; gap: 26px; align-items: start; }
.vac-card { background: #fff; border-radius: var(--radius); padding: 26px 24px 22px; box-shadow: var(--shadow-sm); }
.vac-card h3 { font-size: 19px; font-weight: 900; color: var(--primary-dark); margin-bottom: 4px; }
.vac-kicker { font-size: 13.5px; color: var(--ink-soft); margin-bottom: 16px; }
.vac-table { width: 100%; font-size: 14.5px; }
.vac-table th, .vac-table td { padding: 9px 8px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: top; }
.vac-table thead th { background: var(--primary-light); color: var(--primary-dark); font-weight: 700; font-size: 13.5px; white-space: nowrap; }
.vac-table tbody th { font-weight: 700; color: var(--ink); white-space: nowrap; }
.vac-table .price { color: var(--accent); font-weight: 700; white-space: nowrap; }
.vac-table .have { color: var(--ok); font-weight: 700; line-height: 0; }
.vac-table .have .ico { width: 17px; height: 17px; stroke-width: 2.2; vertical-align: middle; }
.vac-note {
  margin-top: 14px; font-size: 13.5px; color: var(--ink-soft);
  background: var(--accent-soft); border-radius: var(--radius-sm); padding: 12px 14px;
}

/* ── 檢查設備 ── */
.equip-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.equip {
  display: flex; gap: 14px; align-items: flex-start;
  background: #fff; border-radius: var(--radius); padding: 22px 20px; box-shadow: var(--shadow-sm);
}
.equip-ico {
  flex-shrink: 0; width: 46px; height: 46px; border-radius: 12px;
  background: var(--primary-light); color: var(--primary);
  display: flex; align-items: center; justify-content: center; font-size: 24px;
}
.equip h3 { font-size: 16.5px; font-weight: 700; color: var(--primary-dark); margin-bottom: 2px; }
.equip p { font-size: 14.5px; color: var(--ink-soft); line-height: 1.7; }

/* ── 醫師 ── */
.doctor-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 24px; max-width: 920px; margin: 0 auto; }
.doctor-card { background: #fff; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-sm); display: grid; grid-template-columns: 42% 1fr; }
.doctor-card img { width: 100%; height: 100%; aspect-ratio: 4/5; object-fit: cover; }
/* background + position 是保險:文字區永遠不透明、永遠在照片上層。
   照片若因為瀏覽器算錯高度而溢出自己的格線,文字也絕不會變成疊在人臉上。 */
.doctor-info { padding: 24px 22px; background: #fff; position: relative; z-index: 1; }
.doctor-info h3 { font-size: 20px; font-weight: 900; color: var(--primary-dark); }
.doctor-info h3 span { font-size: 13px; color: var(--accent); font-weight: 700; margin-left: 6px; }
.doctor-title { font-size: 13.5px; color: var(--ink-soft); margin: 4px 0 12px; }
.cert-badges { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.cert-badges span {
  background: var(--primary-light); color: var(--primary-dark);
  font-size: 12px; font-weight: 700; padding: 4px 10px; border-radius: 999px;
}
.doctor-info > p { font-size: 14.5px; color: var(--ink-soft); }
.doctor-shift { font-size: 13.5px; color: var(--primary); font-weight: 700; margin-top: 10px; }

/* ── 門診班表:三診次 × 七天 × 醫師名,今日欄高亮 ── */
.sched-wrap { max-width: 940px; margin: 0 auto; }
.sched-table { width: 100%; background: #fff; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); font-size: 14.5px; }
.sched-table th, .sched-table td { padding: 13px 6px; text-align: center; border-bottom: 1px solid var(--line); }
.sched-table thead th { background: var(--primary); color: #fff; font-weight: 700; font-size: 14px; }
.sched-table tbody th { background: var(--primary-light); color: var(--primary-dark); font-weight: 700; white-space: nowrap; text-align: left; padding-left: 16px; }
.sched-table td { color: var(--ink-soft); font-size: 13.5px; line-height: 1.6; }
.sched-table td.off { color: #b9c1c8; }
.sched-table .is-today { background: var(--accent-soft); color: var(--ink); font-weight: 700; }
.sched-table thead th.is-today { background: var(--accent); color: #4a2e0c; }
.sched-note { margin-top: 14px; font-size: 14px; color: var(--ink-soft); text-align: center; }

/* 休診公告:白跑一趟是基層診所最大的信任破口 */
.notice-box {
  max-width: 940px; margin: 26px auto 0;
  background: #fff; border-left: 5px solid var(--accent); border-radius: var(--radius);
  padding: 20px 24px; box-shadow: var(--shadow-sm);
}
.notice-box h3 { font-size: 17px; font-weight: 900; color: var(--primary-dark); margin-bottom: 10px; }
.notice-box ul { list-style: none; }
.notice-box li { padding: 7px 0; border-bottom: 1px dashed var(--line); font-size: 15px; }
.notice-box li:last-child { border-bottom: 0; }
.notice-box li strong { color: var(--off); margin-right: 8px; }

/* ── 就診須知 ── */
.notes-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
.note-card { background: #fff; border-radius: var(--radius); padding: 24px 24px 20px; box-shadow: var(--shadow-sm); }
.note-card h3 { font-size: 17.5px; font-weight: 900; color: var(--primary-dark); margin-bottom: 10px; }
.note-card p, .note-card li { font-size: 15px; color: var(--ink-soft); }
.note-card ul { list-style: none; margin-top: 6px; }
.note-card li { position: relative; padding-left: 20px; padding-top: 3px; }
.note-card li::before { content: "・"; position: absolute; left: 2px; color: var(--primary); }
.note-card .fee { color: var(--accent); font-weight: 700; }

/* ── Google 評分(法規保守版:只放星等與連結,不摘錄評論全文)── */
.rating-box {
  max-width: 620px; margin: 0 auto; text-align: center;
  background: #fff; border-radius: var(--radius); padding: 32px 28px; box-shadow: var(--shadow-sm);
}
.rating-score { font-size: 52px; font-weight: 900; color: var(--accent); line-height: 1.1; }
.rating-stars { color: #e5a53c; letter-spacing: 4px; font-size: 20px; margin: 4px 0 6px; }
.rating-count { color: var(--ink-soft); font-size: 15px; margin-bottom: 18px; }

/* ── FAQ ── */
.faq-item { background: #fff; border-radius: var(--radius); margin-bottom: 12px; overflow: hidden; box-shadow: var(--shadow-sm); }
.faq-item summary { cursor: pointer; list-style: none; padding: 18px 52px 18px 22px; font-weight: 700; font-size: 16.5px; position: relative; user-select: none; color: var(--primary-dark); }
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after { content: "+"; position: absolute; right: 22px; top: 50%; transform: translateY(-50%); color: var(--accent); font-size: 24px; transition: transform .2s ease; }
.faq-item[open] summary::after { transform: translateY(-50%) rotate(45deg); }
.faq-item p { padding: 0 22px 18px; color: var(--ink-soft); font-size: 15.5px; }

/* ── 聯絡 / 地圖 ── */
.contact-grid { display: grid; grid-template-columns: 1fr 1.1fr; gap: 44px; align-items: start; }
.contact-grid .section-title { text-align: left; }
.contact-list { list-style: none; margin: 20px 0 24px; }
.contact-list li { display: flex; gap: 14px; padding: 11px 0; border-bottom: 1px solid var(--line); font-size: 15.5px; }
.contact-list strong { color: var(--primary); flex-shrink: 0; min-width: 52px; }
.map-embed iframe { width: 100%; height: 400px; border: 0; border-radius: var(--radius); box-shadow: var(--shadow); }

/* ── Footer + 法定資訊揭露(醫療法要求,不可刪)── */
.site-footer { background: var(--primary-dark); color: #b9cfdd; padding: 40px 0 32px; text-align: center; }
.footer-brand { font-size: 21px; font-weight: 900; color: #fff; margin-bottom: 8px; }
.site-footer a { color: #ffd9a8; }
.disclosure {
  margin: 18px auto 0; max-width: 800px; padding-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, .16);
  font-size: 13px; line-height: 1.9; color: #9fb8c8;
}
.footer-copy { margin-top: 14px; font-size: 12.5px; opacity: .72; }

/* ── 浮動 CTA:雙鈕(撥號 + LINE)。
   急症家長最常直接打電話,所以撥號鈕排在 LINE 上面。 ── */
.float-cta { position: fixed; right: 16px; bottom: 16px; z-index: 200; display: flex; flex-direction: column; gap: 10px; }
.float-btn {
  display: flex; align-items: center; gap: 8px;
  padding: 12px 18px; border-radius: 999px; font-weight: 700; font-size: 15px; color: #fff;
  box-shadow: 0 8px 22px rgba(44, 53, 64, .28);
}
.float-btn.is-tel { background: var(--primary); }
.float-btn.is-line { background: var(--line-green); }
.float-btn svg { flex-shrink: 0; }

/* ── 捲動顯示動畫 ──
   內容預設「看得見」,只有 main.js 成功掛上 IntersectionObserver 才加 .js-reveal 藏起來等進場。
   JS 沒載到 / 被擋 / 出錯時整頁照樣讀得到,不會變空白頁。(farm / cafe 起的標準寫法) */
.js-reveal .reveal { opacity: 0; transform: translateY(22px); transition: opacity .6s ease, transform .6s ease; }
.js-reveal .reveal.is-visible { opacity: 1; transform: none; }
.js-reveal .dept-grid .reveal:nth-child(2), .js-reveal .equip-grid .reveal:nth-child(2),
.js-reveal .doctor-grid .reveal:nth-child(2), .js-reveal .notes-grid .reveal:nth-child(2),
.js-reveal .vac-layout .reveal:nth-child(2) { transition-delay: .08s; }
.js-reveal .dept-grid .reveal:nth-child(3), .js-reveal .equip-grid .reveal:nth-child(3),
.js-reveal .notes-grid .reveal:nth-child(3) { transition-delay: .16s; }
.js-reveal .equip-grid .reveal:nth-child(4), .js-reveal .notes-grid .reveal:nth-child(4) { transition-delay: .24s; }
.js-reveal .equip-grid .reveal:nth-child(5) { transition-delay: .32s; }
.js-reveal .equip-grid .reveal:nth-child(6) { transition-delay: .40s; }

/* ═══════ RWD:1160 / 768 / 640 ═══════
   斷點比其他模板早(1160 而非 1024):本模板 nav 有 7 項 + 3 顆 CTA,
   1160 以下橫排就會開始擠,提早收成漢堡選單比硬擠好看。 */
@media (max-width: 1160px) {
  .main-nav { display: none; }
  .header-cta .btn-ghost { display: none; }
  .facts-grid { grid-template-columns: repeat(3, 1fr); }
  .dept-grid { grid-template-columns: 1fr; }
  .equip-grid { grid-template-columns: repeat(2, 1fr); }
  .vac-layout { grid-template-columns: 1fr; }
  .doctor-grid { grid-template-columns: 1fr; }
  .contact-grid { grid-template-columns: 1fr; gap: 32px; }
  .nav-toggle {
    display: flex; flex-direction: column; gap: 5px; justify-content: center;
    width: 44px; height: 44px; padding: 10px; background: none; border: 0; cursor: pointer;
  }
  .nav-toggle span { display: block; height: 2.5px; background: var(--primary); border-radius: 2px; transition: transform .25s, opacity .25s; }
  .nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7.5px) rotate(45deg); }
  .nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
  .nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7.5px) rotate(-45deg); }
  .main-nav.is-open {
    display: flex; flex-direction: column; gap: 0;
    position: absolute; top: var(--header-h); left: 0; right: 0;
    background: var(--bg); border-bottom: 1px solid var(--line); box-shadow: var(--shadow);
    padding: 10px 4%;
  }
  .main-nav.is-open a { padding: 14px 12px; border-bottom: 1px solid var(--line); font-size: 16px; }
}

@media (max-width: 768px) {
  .today-links .btn-ghost { display: none; }   /* 手機狀態條只留主要掛號鈕 */
  .doctor-card { grid-template-columns: 34% 1fr; }
  .notes-grid { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  :root { --header-h: 64px; }
  body { font-size: 16px; }
  .header-inner { gap: 10px; }
  .header-cta { margin-left: auto; }
  .header-cta .btn-line { display: none; }     /* LINE 走浮動鈕,header 只留掛號 */
  .header-cta .btn-primary { padding: 9px 15px; font-size: 14px; }
  .logo { font-size: 17px; }
  .logo-sub { display: none; }
  /* 狀態條改成「狀態 + 掛號鈕同一列,下次看診縮到第二列」。
     原本三列各佔滿一行(status / next / 按鈕)高 130px,是照片被壓住的主因。 */
  .today-inner { gap: 2px 10px; padding: 8px 0; min-height: 0; }
  .today-status { font-size: 14.5px; flex: 1 1 auto; min-width: 0; }
  .today-next { font-size: 12.5px; line-height: 1.5; flex: 1 1 100%; order: 3; }
  .today-links { margin-left: auto; width: auto; flex-shrink: 0; }
  .today-links .btn { padding: 7px 15px; font-size: 13.5px; }
  .hero {
    padding: 40px 0; min-height: 54vh;
    background:
      linear-gradient(180deg, rgba(19, 51, 71, .76) 0%, rgba(19, 51, 71, .58) 100%),
      url("../assets/hero.jpg") center / cover no-repeat;
    background-color: var(--primary-dark);
  }
  .hero h1 { line-height: 1.45; }
  .hero-cta { width: 100%; }
  .hero-cta .btn { flex: 1; }
  .section { padding: 54px 0; }
  .section-sub { margin-bottom: 34px; }
  .facts { padding: 22px 0; }
  .facts-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .fact { padding: 12px 6px; }
  .equip-grid { grid-template-columns: 1fr; }
  /* ⚠️ 手機版不要用 grid。
     .doctor-card img 帶著 height:100%(桌機雙欄要靠它把照片撐滿卡片高度),
     但單欄 grid 的列高是 auto,百分比高度在 iOS Safari 會拿「整張卡片的高度」去算,
     照片因此撐滿整張卡片、蓋掉下面那一列,文字就整片疊在醫師照片上
     (2026-09-12 實機回報;Chrome 手機模擬量不出來,只有 WebKit 會)。
     改成 display:block + height:auto,照片與文字回到正常文件流,
     任何引擎都不可能重疊。 */
  .doctor-card { display: block; }
  /* 16/10 太扁:原圖是 4:5 直幅,置中裁切會把醫師的頭整個切掉(林醫師只剩白袍)。
     改 4/3 並把裁切重心往上推,臉固定留在框內。 */
  .doctor-card img { height: auto; aspect-ratio: 4/3; object-position: 50% 22%; }
  /* 班表在手機上橫向捲動,不硬塞成兩行 */
  .sched-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .sched-table { min-width: 620px; }
  .vac-card { padding: 20px 16px; }
  .vac-table { font-size: 13.5px; }
  .vac-table th, .vac-table td { padding: 8px 5px; }
  /* 疫苗名稱在 360px 以下不 nowrap,否則表格撐爆卡片,整頁會多出橫向捲動 */
  .vac-table tbody th { white-space: normal; }
  .map-embed iframe { height: 300px; }
  .float-btn span { display: none; }           /* 手機只留圖示,不擋畫面 */
  .float-btn { padding: 14px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js-reveal .reveal { opacity: 1; transform: none; transition: none; }
  .btn:hover, .dept:hover { transform: none; }
  .today-bar.is-open .status-dot { animation: none; }
}

@media print {
  .site-header, .today-bar, .float-cta, .map-embed, .nav-toggle { display: none; }
  .hero { background: none; color: var(--ink); min-height: auto; padding: 16px 0; }
  .hero h1, .hero-sub, .hero-eyebrow { color: var(--ink); }
  .hero h1 em { color: var(--ink); }
  .hero .badge { color: var(--ink); border-color: var(--line); background: none; }
  .site-footer { background: none; color: var(--ink); }
  .site-footer .footer-brand, .site-footer a, .disclosure { color: var(--ink); }
  .js-reveal .reveal { opacity: 1 !important; transform: none !important; }
}
