/* 配色邏輯：取自診所門診表的深青綠與水藍。
   淡青白底 + 深青綠標題與頁尾 + 青綠主要按鈕，水藍只做點綴 */
:root {
  --bg: #f5f9f9;          /* 頁面底色：淡青白 */
  --surface: #ffffff;
  --band: #e9f3f4;        /* 淡青區塊 */
  --line: #d5e5e7;
  --ink: #2b3d43;         /* 內文 */
  --muted: #56696f;
  --deep: #1d4f5e;        /* 標題、頁尾：深青綠（門診表表頭色） */
  --primary: #1f7a8c;     /* 主要按鈕 */
  --primary-dark: #17616f;
  --link: #176a7b;        /* 文字連結（白底對比足夠） */
  --accent: #4aaec6;      /* 水藍點綴（門診表時段欄色） */
  --leaf: #9fdccf;
  --warm: #b85c1e;        /* 「本週」標記 */
  --radius: 14px;
  --gutter: clamp(16px, 5vw, 32px);
  --content: 720px;
  --wide: 1120px;
  --font: "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", "Heiti TC", system-ui, -apple-system, "Segoe UI", sans-serif;
}

[hidden] { display: none !important; }

.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;
}

*,
*::before,
*::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 16px; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.8;
  overflow-wrap: anywhere;
}

img { display: block; max-width: 100%; height: auto; }
svg { flex: none; }

a { color: var(--link); text-underline-offset: 3px; }
a:hover { color: var(--deep); }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

h1, h2, h3 { color: var(--deep); }

.skip-link {
  position: absolute; left: -9999px; top: 8px;
  background: var(--deep); color: #fff; padding: 8px 14px; border-radius: 8px; z-index: 30;
}
.skip-link:focus { left: 8px; }

.container {
  width: 100%;
  max-width: calc(var(--content) + var(--gutter) * 2);
  margin-inline: auto;
  padding-inline: var(--gutter);
}
.container--wide { max-width: calc(var(--wide) + var(--gutter) * 2); }
.nowrap { white-space: nowrap; }

/* ── 按鈕 ───────────────────────────── */
.button {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  background: var(--primary); color: #fff;
  border: 1.5px solid var(--primary);
  font-weight: 700; text-decoration: none; white-space: nowrap;
  padding: 10px 24px; border-radius: 999px;
  box-shadow: 0 6px 16px rgba(31, 122, 140, .22);
}
.button:hover { background: var(--primary-dark); border-color: var(--primary-dark); color: #fff; }
.button.button--outline { background: var(--surface); color: var(--deep); border-color: var(--deep); box-shadow: none; }
.button.button--outline:hover { background: var(--band); color: var(--deep); }

.chip {
  display: inline-block; padding: 1px 12px; border-radius: 999px;
  background: var(--band); border: 1px solid var(--line);
  color: var(--deep); font-size: .82rem; font-weight: 700; line-height: 1.9; white-space: nowrap;
}

/* ── 頁首 ───────────────────────────── */
.site-header { position: relative; z-index: 20; background: var(--surface); border-bottom: 1px solid var(--line); }
.header-inner { display: flex; align-items: center; gap: 16px; min-height: 78px; }
.brand { display: flex; align-items: center; gap: 12px; min-width: 0; margin-right: auto; text-decoration: none; }
.brand-mark { flex: none; width: 48px; height: 48px; }
.brand-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.3; }
.brand-name { font-weight: 900; font-size: 1.28rem; letter-spacing: .06em; color: var(--deep); white-space: nowrap; }
.brand-sub { font-size: .8rem; font-weight: 700; color: var(--link); letter-spacing: .08em; white-space: nowrap; }
.brand-en { margin-left: 8px; padding-left: 8px; border-left: 1px solid var(--line); color: var(--muted); font-weight: 600; letter-spacing: .04em; }

.site-menu { display: flex; align-items: center; gap: 6px; }
.site-nav { display: flex; gap: 2px; }
.site-nav a {
  color: var(--deep); text-decoration: none; font-size: .95rem; font-weight: 700;
  padding: 8px 12px; border-radius: 8px; white-space: nowrap;
}
.site-nav a:hover { background: var(--band); }
.site-nav a[aria-current="page"] { background: var(--band); box-shadow: inset 0 -3px 0 var(--accent); }
.header-search { display: inline-flex; align-items: center; gap: 8px; padding: 8px; border-radius: 8px; color: var(--deep); text-decoration: none; }
.header-search:hover { background: var(--band); }
.header-search-label { display: none; font-weight: 700; font-size: .95rem; }

.button.header-call { padding: 9px 18px; font-variant-numeric: tabular-nums; }

.nav-toggle {
  display: none; align-items: center; justify-content: center;
  width: 44px; height: 44px; padding: 0;
  background: none; border: 1px solid var(--line); border-radius: 10px;
  color: var(--deep); cursor: pointer;
}

/* 選單放不下時改成漢堡選單 */
@media (max-width: 1079px) {
  .nav-toggle { display: inline-flex; }
  .site-menu {
    display: none;
    position: absolute; top: 100%; left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 0;
    padding: 4px var(--gutter) 16px;
    background: var(--surface); border-bottom: 1px solid var(--line);
    box-shadow: 0 16px 24px rgba(29, 79, 94, .08);
  }
  .site-menu.is-open { display: flex; }
  .site-nav { flex-direction: column; }
  .site-nav a { padding: 12px 4px; border-bottom: 1px solid #edf3f4; border-radius: 0; }
  .site-nav a[aria-current="page"] { background: none; box-shadow: inset 3px 0 0 var(--accent); padding-left: 12px; }
  .header-search { padding: 12px 4px; }
  .header-search-label { display: inline; }
}
@media (max-width: 600px) {
  .header-inner { min-height: 66px; gap: 10px; }
  .brand { gap: 10px; }
  .brand-mark { width: 40px; height: 40px; }
  .brand-name { font-size: 1.08rem; }
  .brand-en { display: none; }
  .button.header-call { width: 44px; height: 44px; padding: 0; }
  .header-call-label { display: none; }
}

/* ── 首頁 HERO：左文字、右門診資訊卡 ───────── */
.hero {
  background:
    radial-gradient(ellipse at 8% 10%, rgba(255, 255, 255, .95) 0%, rgba(255, 255, 255, 0) 45%),
    radial-gradient(ellipse at 95% 90%, rgba(159, 220, 207, .35) 0%, rgba(159, 220, 207, 0) 50%),
    linear-gradient(110deg, #f1f8f8 0%, #e3f1f3 100%);
  border-bottom: 1px solid var(--line);
}
.hero-inner {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(300px, 380px);
  align-items: center; gap: 48px; padding-block: 64px;
}
.hero-kicker { margin: 0 0 10px; color: var(--link); font-weight: 700; letter-spacing: .16em; font-size: .92rem; }
.hero-title { margin: 0; font-weight: 900; font-size: clamp(1.9rem, 4.4vw, 2.9rem); line-height: 1.4; letter-spacing: .03em; }
.hero-desc { margin: 18px 0 28px; max-width: 34em; font-size: 1.02rem; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px 16px; }
.hero-actions .button { padding: 12px 28px; font-size: 1.02rem; }

.info-card {
  background: var(--surface); border: 1px solid var(--line); border-top: 5px solid var(--primary);
  border-radius: var(--radius); padding: 22px 24px 20px;
  box-shadow: 0 16px 36px rgba(29, 79, 94, .10);
}
.info-card--flat { box-shadow: none; }
.info-card-title { display: flex; align-items: center; gap: 8px; margin: 0 0 10px; font-size: 1.15rem; }
.info-card-title svg { color: var(--primary); }
.hours-table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.hours-table th, .hours-table td { padding: 9px 4px; border-bottom: 1px solid var(--line); text-align: left; }
.hours-table th { width: 4.5em; color: var(--deep); font-weight: 700; }
.hours-table td { font-size: 1.12rem; font-weight: 700; color: var(--ink); letter-spacing: .02em; }
.hours-note { margin: 8px 0 0; font-size: .85rem; color: var(--muted); }
.info-card-list { margin: 14px 0 0; padding: 14px 0 0; list-style: none; border-top: 1px dashed var(--line); }
.info-card-list li { display: flex; align-items: center; gap: 8px; margin: 4px 0; }
.info-card-list svg { color: var(--primary); }
.info-card-list a { font-weight: 700; font-size: 1.1rem; font-variant-numeric: tabular-nums; }
.info-card-more { margin: 10px 0 0; }

@media (max-width: 859px) {
  .hero-inner { grid-template-columns: 1fr; gap: 28px; padding-block: 40px 44px; }
  .hero-title br { display: none; }
}

/* ── 區塊 ───────────────────────────── */
.section { padding-block: 64px 0; }
main > .section:last-child { padding-bottom: 72px; }
.section h2,
.band h2 { margin: 0 0 20px; font-weight: 900; font-size: clamp(1.45rem, 4.4vw, 1.9rem); line-height: 1.45; letter-spacing: .04em; }
.section-kicker { margin: 0 0 4px; color: var(--link); font-weight: 700; letter-spacing: .16em; font-size: .9rem; }
.page-title { margin: 0 0 12px; font-weight: 900; font-size: clamp(1.7rem, 6vw, 2.4rem); letter-spacing: .04em; }
.page-lead { margin: 0 0 28px; max-width: 42em; }
.section-more { margin: 20px 0 0; }
.text-link { font-weight: 700; text-decoration: none; color: var(--link); }
.text-link:hover { text-decoration: underline; color: var(--deep); }
.empty { color: var(--muted); }

/* 服務項目：桌機四欄、平板兩欄、手機單欄 */
.services { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); gap: 20px; }
.service {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 22px 22px 18px;
}
.service-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 48px; height: 48px; border-radius: 12px; background: var(--band); color: var(--primary);
}
.service-title { margin: 12px 0 6px; font-size: 1.18rem; }
.service ul { margin: 0; padding-left: 1.2em; color: var(--ink); font-size: .96rem; }
.service li { margin: .2em 0; }
.service li::marker { color: var(--accent); }

/* 榮譽肯定：淡青色帶 */
.band { margin-top: 64px; padding-block: 52px; background: var(--band); border-block: 1px solid var(--line); }
.awards { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); gap: 32px 48px; align-items: center; }
.awards-intro p { margin: .6em 0; }
.awards-intro h2 { margin-bottom: 8px; }
.award-list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin: 0; padding: 0; list-style: none; }
.award {
  display: flex; flex-direction: column; gap: 4px;
  padding: 20px 18px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: inset 0 4px 0 var(--accent);
}
.award-program { font-size: .85rem; color: var(--muted); line-height: 1.5; }
.award-name { font-weight: 900; font-size: 1.15rem; color: var(--deep); line-height: 1.5; }
.award-note { font-size: .88rem; font-weight: 700; color: var(--link); }
@media (max-width: 859px) {
  .awards { grid-template-columns: 1fr; }
}
@media (max-width: 599px) {
  .award-list { grid-template-columns: 1fr; }
}

/* 首頁醫師團隊：整張卡片可點，連到醫師頁的錨點 */
.doctor-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); gap: 16px; }
.doctor-tile {
  display: flex; flex-direction: column; align-items: flex-start; gap: 6px;
  padding: 20px 22px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  color: var(--ink); text-decoration: none;
  transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}
.doctor-tile:hover { color: var(--ink); border-color: var(--accent); transform: translateY(-2px); box-shadow: 0 10px 24px rgba(29, 79, 94, .08); }
.doctor-tile-name { font-weight: 900; font-size: 1.3rem; color: var(--deep); letter-spacing: .06em; line-height: 1.4; }
.doctor-tile-name span, .doctor-name span { font-size: .9rem; font-weight: 700; color: var(--muted); letter-spacing: .02em; }
.doctor-tile-summary { font-size: .93rem; color: var(--muted); line-height: 1.7; }

/* 最新消息 ＋ 健康專欄：桌機左右兩欄 */
.split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 48px; }
@media (max-width: 859px) {
  .split { grid-template-columns: 1fr; gap: 56px; }
}
.news-list { margin: 0; padding: 0; list-style: none; border-top: 1px solid var(--line); }
.news-item { display: grid; grid-template-columns: 6.5em minmax(0, 1fr); gap: 12px; padding: 16px 0; border-bottom: 1px solid var(--line); }
.news-item time { color: var(--link); font-weight: 700; font-size: .92rem; font-variant-numeric: tabular-nums; padding-top: 1px; }
.news-title { margin: 0; font-weight: 700; color: var(--deep); line-height: 1.6; }
.news-title a { color: var(--deep); text-decoration: none; }
.news-title a:hover { color: var(--link); text-decoration: underline; }
.news-desc { margin: 4px 0 0; font-size: .92rem; color: var(--muted); }

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr));
  gap: 20px;
}
.cards--stack { grid-template-columns: 1fr; gap: 14px; }
.card {
  position: relative;
  display: flex; flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 4px solid var(--primary);
  border-radius: var(--radius);
  padding: 18px 22px 16px;
  transition: transform .15s ease, box-shadow .15s ease;
}
.card:hover { transform: translateY(-2px); box-shadow: 0 10px 24px rgba(29, 79, 94, .08); }
.card-title { margin: 0 0 6px; font-size: 1.15rem; line-height: 1.5; }
.card-title a { color: var(--deep); text-decoration: none; }
.card-title a::after { content: ""; position: absolute; inset: 0; border-radius: var(--radius); } /* 整張卡片都可點 */
.card:hover .card-title a { color: var(--link); }
.card-desc { margin: 0 0 12px; color: var(--muted); font-size: .94rem; flex: 1; }

.meta {
  display: flex; flex-wrap: wrap; gap: 2px 16px;
  margin: 0; padding: 0; list-style: none;
  color: var(--muted); font-size: .84rem; line-height: 1.6;
}
.meta-label { color: var(--link); font-weight: 700; margin-right: 2px; }
.meta time, .views { white-space: nowrap; font-variant-numeric: tabular-nums; }

/* 交通資訊 */
.location {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 24px 40px;
  padding: 28px 32px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
}
.location-list { display: grid; gap: 10px; margin: 0; }
.location-list > div { display: grid; grid-template-columns: 3.5em minmax(0, 1fr); gap: 12px; }
.location-list dt { color: var(--link); font-weight: 700; }
.location-list dd { margin: 0; font-weight: 700; color: var(--deep); font-variant-numeric: tabular-nums; }
.location-actions { display: flex; flex-wrap: wrap; gap: 12px; }
@media (max-width: 599px) {
  .location { padding: 22px 20px; }
  .location-actions, .location-actions .button { width: 100%; }
}

/* 搜尋 */
.search-form { margin: 0 0 24px; }
.search-input {
  width: 100%; max-width: 560px; padding: 12px 18px;
  font: inherit; color: var(--ink);
  background: var(--surface); border: 1.5px solid var(--line); border-radius: 999px;
}
.search-input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 4px rgba(31, 122, 140, .15); }

/* ── 門診表頁 ───────────────────────── */
.schedule-top { display: grid; grid-template-columns: minmax(280px, 360px) minmax(0, 1fr); gap: 24px 40px; align-items: start; margin-bottom: 36px; }
.schedule-month { margin: 0 0 8px; font-size: 1.35rem; }
.schedule-notes ul { margin: 0; padding-left: 1.2em; }
.schedule-notes li { margin: .3em 0; }
.schedule-notes li::marker { color: var(--accent); }
@media (max-width: 759px) {
  .schedule-top { grid-template-columns: 1fr; }
}
.weeks { display: grid; gap: 28px; }
.week { margin: 0; padding: 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.week.is-current { border-color: var(--warm); box-shadow: 0 0 0 2px var(--warm); }
.week figcaption { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; margin: 0 0 12px; font-weight: 700; color: var(--deep); font-variant-numeric: tabular-nums; }
.week-no { color: var(--link); }
.week-now { padding: 0 10px; border-radius: 999px; background: var(--warm); color: #fff; font-size: .82rem; line-height: 1.9; }
.week a { display: block; cursor: zoom-in; }
.week img { width: 100%; border-radius: 6px; }
.week { scroll-margin-top: 16px; }
.jump-now { margin: 16px 0 0; }
.schedule-archive { margin: 28px 0 0; }

/* ── 醫師團隊頁 ───────────────────────── */
.doctor-index { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 28px; }
.doctor-index a {
  padding: 4px 16px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface);
  color: var(--deep); font-weight: 700; text-decoration: none;
}
.doctor-index a:hover { border-color: var(--accent); background: var(--band); }
.doctor-list { display: grid; gap: 24px; }
.doctor {
  padding: 28px 32px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  scroll-margin-top: 16px;
}
.doctor:target { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent); }
.doctor-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; padding-bottom: 14px; margin-bottom: 18px; border-bottom: 1px solid var(--line); }
.doctor-name { margin: 0; font-weight: 900; font-size: 1.6rem; letter-spacing: .08em; line-height: 1.4; }
.doctor-sections { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 36px; margin: 0; }
.doctor-section dt { margin-bottom: 4px; color: var(--link); font-weight: 700; letter-spacing: .08em; }
.doctor-section dd { margin: 0; }
.doctor-section ul { margin: 0; padding-left: 1.1em; font-size: .96rem; line-height: 1.75; }
.doctor-section li::marker { color: var(--accent); }
/* 專長放在最後、橫跨整列，底色區隔 */
.doctor-section--focus { grid-column: 1 / -1; padding: 14px 18px; background: var(--band); border-radius: 10px; }
@media (max-width: 719px) {
  .doctor { padding: 22px 20px; }
  .doctor-sections { grid-template-columns: 1fr; }
}

/* ── 文章頁 ─────────────────────────── */
.post { padding-block: 28px 64px; }
.breadcrumb { font-size: .85rem; color: var(--muted); margin-bottom: 16px; }
.breadcrumb a { color: var(--muted); }
.post-header h1 { margin: 0 0 12px; font-weight: 900; font-size: clamp(1.6rem, 6vw, 2.3rem); line-height: 1.4; letter-spacing: .02em; }

.post-hero { margin: 24px 0 8px; }
.post-hero img { width: 100%; height: auto; border-radius: var(--radius); }
.post-hero figcaption, .prose figcaption { margin-top: 6px; font-size: .85rem; color: var(--muted); text-align: center; }

.prose { margin-top: 24px; }
.prose > :first-child { margin-top: 0; }
.prose h2 { margin: 2.2em 0 .6em; font-size: 1.4rem; line-height: 1.45; padding-left: 12px; border-left: 4px solid var(--primary); }
.prose h3 { margin: 1.8em 0 .5em; font-size: 1.15rem; }
.prose p { margin: 1em 0; }
.prose ul, .prose ol { padding-left: 1.4em; }
.prose li { margin: .35em 0; }
.prose li::marker { color: var(--primary); }
.prose strong { color: var(--deep); }
.prose figure { margin: 1.6em 0; }
.prose blockquote {
  margin: 1.4em 0; padding: 12px 18px;
  background: var(--band); border-left: 4px solid var(--accent); border-radius: 0 10px 10px 0;
  color: var(--deep);
}
.prose blockquote p { margin: .4em 0; }
.prose img { width: 100%; height: auto; border-radius: 10px; }
.prose table { display: block; overflow-x: auto; border-collapse: collapse; }
.prose th, .prose td { border: 1px solid var(--line); padding: 6px 10px; }
.prose hr { border: 0; border-top: 1px solid var(--line); margin: 2em 0; }

.back-link { margin-top: 40px; }
.not-found { text-align: center; padding-block: 80px; }

/* ── 頁尾 ───────────────────────────── */
.site-footer { margin-top: 0; background: var(--deep); color: #c9dde1; font-size: .88rem; line-height: 1.8; padding-block: 40px 32px; }
.site-footer a { color: #fff; }
.footer-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.6fr); gap: 16px 40px; }
.footer-name { margin: 0; color: #fff; font-weight: 900; font-size: 1.15rem; letter-spacing: .06em; }
.footer-sub { margin: 2px 0 0; color: var(--leaf); }
.footer-sub span { margin-left: 8px; color: #c9dde1; }
.footer-info { margin: 0; padding: 0; list-style: none; }
.footer-note, .copyright { grid-column: 1 / -1; margin: 0; }
.footer-note { padding-top: 16px; border-top: 1px solid rgba(255, 255, 255, .15); font-size: .82rem; }
.copyright { opacity: .75; font-size: .82rem; }
@media (max-width: 719px) {
  .footer-grid { grid-template-columns: 1fr; }
}

/* ── 手機 ───────────────────────────── */
@media (max-width: 600px) {
  body { font-size: 16px; }
  .section { padding-top: 48px; }
  .band { margin-top: 48px; padding-block: 40px; }
  .hero-actions .button { flex: 1 1 auto; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .card, .doctor-tile { transition: none; }
}
