/*
Theme Name: Ruianc 2026
Theme URI: https://ruianc.com
Author: 台中瑞安診所
Description: 台中瑞安診所 2026 自製主題。深紫 × 灰紫低亮度配色，設計稿見 ruianc-group repo docs/ruianc-redesign-plan.md 階段 2。
Version: 0.47.0
Requires PHP: 8.0
License: proprietary
Text Domain: ruianc-2026
*/

:root {
	--c-primary: #3f2d63;
	--c-primary-dark: #2e2049;
	--c-primary-light: #55407c;
	--c-accent: #766399;
	--c-accent-soft: #f1eef6;
	--c-ivory: #f7f5fa;
	--c-footer: #251d3a;
	--c-text: #1e293b;
	--c-text-light: #64748b;
	--c-border: #e5e0ee;
	--c-line-green: #089950;
	--font-serif: "Noto Serif TC", "Songti TC", "PMingLiU", serif;
	--font-sans: "PingFang TC", "Microsoft JhengHei", system-ui, -apple-system, "Segoe UI", sans-serif;
}

/* ---------- Base ---------- */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; font-family: var(--font-sans); color: var(--c-text); background: #fff; font-size: 16px; line-height: 1.75; -webkit-font-smoothing: antialiased; overflow-x: clip; }
img { max-width: 100%; height: auto; }
a { color: var(--c-accent); text-decoration: none; }
a:hover { color: var(--c-primary); }
h1, h2, h3, h4 { font-family: var(--font-serif); color: var(--c-primary); line-height: 1.35; }
.wrap { max-width: 1200px; margin: 0 auto; padding: 0 24px; }
.screen-reader-text { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; height: 52px; padding: 0 30px; border-radius: 999px; font-size: 16px; font-weight: 700; letter-spacing: .05em; border: 0; cursor: pointer; }
.btn-line { background: var(--c-line-green); color: #fff; }
.btn-line:hover { background: #077e43; color: #fff; }
.btn-primary { background: var(--c-primary); color: #fff; }
.btn-primary:hover { background: var(--c-primary-dark); color: #fff; }
.btn-ghost-light { border: 1.5px solid rgba(255,255,255,.75); color: #fff; background: transparent; }
.btn-ghost-light:hover { background: rgba(255,255,255,.12); color: #fff; }
.btn-outline { border: 1.5px solid var(--c-primary); color: var(--c-primary); background: transparent; }
.btn-outline:hover { background: var(--c-accent-soft); }

.tag { display: inline-flex; align-items: center; height: 26px; padding: 0 12px; border-radius: 6px; background: var(--c-accent-soft); color: var(--c-primary); font-size: 12.5px; font-weight: 600; }

/* ---------- 跑馬燈公告帶 ---------- */
.marquee { background: var(--c-primary-dark); color: #d6cfe6; font-size: 14px; letter-spacing: .04em; padding: 9px 16px; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------- Header ---------- */
.site-header { background: #fff; border-bottom: 1px solid var(--c-border); position: sticky; top: 0; z-index: 60; }
.site-header .bar { display: flex; align-items: center; gap: 32px; height: 80px; }
.brand { display: flex; align-items: center; gap: 12px; flex: none; }
.brand-mark { height: 44px; width: auto; display: block; }
.brand-text { display: flex; flex-direction: column; line-height: 1.25; }
.brand-name { font-family: var(--font-serif); font-size: 21px; font-weight: 700; letter-spacing: .1em; margin-right: -.1em; color: var(--c-primary); }
.brand-sub { font-size: 10px; letter-spacing: .24em; margin-right: -.24em; color: var(--c-accent); font-weight: 600; }
.header-nhi { display: flex; align-items: center; flex: none; padding-left: 20px; border-left: 1px solid var(--c-border); }
.header-nhi img { height: 38px; width: auto; display: block; }
.main-nav { margin-left: auto; }
.nav-list { list-style: none; display: flex; gap: 26px; margin: 0; padding: 0; font-size: 15.5px; font-weight: 600; }
/* 導覽項不隨 flex 收縮，標籤也不折行——原本 Hair Loss 會被拆成兩行 */
.nav-list > li { flex: none; }
.nav-list a { color: var(--c-text); white-space: nowrap; }
.nav-list a:hover { color: var(--c-primary); }
.nav-list li { position: relative; }
.nav-list .sub-menu { display: none; position: absolute; top: 100%; left: -14px; background: #fff; border: 1px solid var(--c-border); border-radius: 12px; box-shadow: 0 14px 34px rgba(63,45,99,.12); list-style: none; margin: 0; padding: 10px 0; min-width: 190px; z-index: 70; }
.nav-list li:hover > .sub-menu,
.nav-list li:focus-within > .sub-menu { display: block; }
/* 按鈕與選單間沒有間距，但父項底部到選單頂端仍需可 hover，故補一條透明橋接 */
.nav-list .has-sub { padding-bottom: 4px; margin-bottom: -4px; }
.nav-list .has-sub > a::after { content: ""; display: inline-block; width: 0; height: 0; margin-left: 6px; vertical-align: 2px; border: 4px solid transparent; border-top-color: currentColor; }
.nav-list .sub-menu a { display: block; padding: 8px 18px; font-weight: 500; }
.menu-toggle { display: none; background: none; border: 0; color: var(--c-primary); padding: 8px; cursor: pointer; }

/* 語言切換下拉 */
.lang-switch { position: relative; flex: none; }
.lang-toggle { display: inline-flex; align-items: center; gap: 8px; height: 42px; padding: 0 16px; border-radius: 999px; border: 1.5px solid var(--c-border); background: #fff; color: var(--c-text); font-size: 14.5px; font-weight: 600; cursor: pointer; font-family: inherit; }
.lang-toggle:hover { border-color: var(--c-accent); color: var(--c-primary); }
.lang-menu { display: none; position: absolute; right: 0; top: calc(100% + 8px); background: #fff; border: 1px solid var(--c-border); border-radius: 12px; box-shadow: 0 14px 34px rgba(63,45,99,.14); list-style: none; margin: 0; padding: 8px 0; min-width: 176px; z-index: 80; }
/* 按鈕與選單之間留了 8px 視覺間距，滑鼠移過去會離開 hover 區而關閉選單。
   用一條同寬的透明橋接把間距補回 hover 範圍內（屬於選單自身，故 hover 不中斷）。 */
.lang-menu::before { content: ""; position: absolute; left: 0; right: 0; top: -10px; height: 10px; }
.lang-switch:hover .lang-menu,
.lang-switch:focus-within .lang-menu,
.lang-switch.open .lang-menu { display: block; }
.lang-menu a { display: block; padding: 9px 18px; font-size: 14px; color: var(--c-text); }
.lang-menu a:hover { background: var(--c-accent-soft); color: var(--c-primary); }
.lang-menu li.current a { color: var(--c-accent); font-weight: 700; }

/* ---------- Hero ---------- */
.hero {
	background:
		linear-gradient(rgba(46,32,73,.8), rgba(46,32,73,.8)),
		var(--c-primary-dark) url('assets/img/hero-bg.jpg?v=4') center / cover no-repeat;
	color: #fff;
}
/* 這個元素同時是 .wrap。只設上下內距，左右交給 .wrap——
   用 padding 簡寫會把 .wrap 的左右 24px 一起蓋掉，
   桌機看不太出來（視窗通常比 1200 寬），手機就變成文字貼著螢幕邊緣。 */
.hero-inner { display: flex; gap: 56px; align-items: center; padding-top: 72px; padding-bottom: 64px; }
.hero-text h1, .hero-text p, .hero-sub, .hero-kicker { text-shadow: 0 2px 14px rgba(20,10,40,.45); }
.hero-text { flex: 1.05; }
.hero-kicker { font-size: 14.5px; letter-spacing: .28em; color: #c3b8dc; font-weight: 700; margin-bottom: 14px; }
.hero h1 { color: #fff; font-size: 50px; font-weight: 900; letter-spacing: .04em; margin: 0; text-wrap: balance; }
.hero-sub, .hero-kicker { text-wrap: balance; }
.hero-sub { font-family: var(--font-serif); font-size: 21px; color: #d6cfe6; margin: 14px 0 20px; letter-spacing: .06em; }
.hero-text p { font-size: 16px; line-height: 1.9; color: rgba(255,255,255,.86); margin: 0 0 30px; max-width: 560px; }
.hero-ctas { display: flex; gap: 16px; flex-wrap: wrap; }
.hero-visual { flex: .95; }
.hero-visual .ph, .hero-visual img { width: 100%; height: 400px; object-fit: cover; border-radius: 20px; box-shadow: 0 24px 60px rgba(0,0,0,.35); }

.trust-band { border-top: 1px solid rgba(255,255,255,.14); }
.trust-band .wrap { display: flex; flex-wrap: wrap; padding: 18px 24px; gap: 12px 28px; align-items: center; justify-content: space-between; font-size: 14.5px; color: rgba(255,255,255,.82); }
/* 外語版只有一句，置中比左右分散好看 */
.trust-band--single .wrap { justify-content: center; }

/* ---------- 精簡頁首（門診時間表這類不需要 hero 的頁） ---------- */
.page-head { background: var(--c-primary-dark); color: #fff; padding: 44px 0 40px; }
.page-head h1 { color: #fff; font-size: 38px; margin: 0; letter-spacing: .04em; text-wrap: balance; }
.page-head p { margin: 14px 0 0; max-width: 720px; font-size: 16px; line-height: 1.9; color: rgba(255,255,255,.86); }

/* ---------- 衛教文版型 ---------- */
.wrap-narrow { max-width: 880px; }
.article-body h2 { font-size: 27px; margin: 0 0 18px; }
.article-body p { font-size: 16.5px; line-height: 2; margin: 0 0 16px; }
.article-body p:last-child { margin-bottom: 0; }
.art-list { margin: 4px 0 18px; padding-left: 22px; font-size: 16px; line-height: 2; color: var(--c-text); }
.art-list li { margin-bottom: 4px; }
.art-figure { margin: 22px 0 0; }
.art-figure img { width: 100%; height: auto; border-radius: 16px; display: block; }
.art-disclaimer { margin: 36px 0 0; padding: 16px 20px; border-left: 3px solid var(--c-border); font-size: 13.5px; line-height: 1.8; color: var(--c-text-light); }

/* ---------- 頁內導覽 ---------- */
.anchornav { background: #fff; border-bottom: 1px solid var(--c-border); box-shadow: 0 6px 18px rgba(63,45,99,.05); position: sticky; top: 80px; z-index: 50; }
/* 單行水平捲動（比照 mle.com.tw）：項目多的時候不換行，改成左右滑動。
   `safe center` 讓項目少時仍然置中、多到溢出時自動靠左——
   單純用 `center` 的話溢出內容會往兩側跑，開頭那幾項永遠滑不到。
   捲軸藏起來（mle 也是），視覺上乾淨；捲動仍然可用。 */
.anchornav ul { list-style: none; display: flex; justify-content: center; justify-content: safe center; flex-wrap: nowrap; overflow-x: auto; gap: 28px; margin: 0; padding: 15px 16px; counter-reset: anchornav; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.anchornav ul::-webkit-scrollbar { display: none; }
.anchornav li { flex: none; }
.anchornav a { font-size: 15px; font-weight: 600; color: var(--c-text); padding-bottom: 4px; border-bottom: 2.5px solid transparent; white-space: nowrap; }
.anchornav a::before { counter-increment: anchornav; content: counter(anchornav) "."; font-family: var(--font-serif); font-weight: 700; color: var(--c-accent); margin-right: 5px; }
.anchornav a:hover, .anchornav li.active a { color: var(--c-primary); border-bottom-color: var(--c-accent); }

/* ---------- answer-ready 摘要 ---------- */
.summary-box { border-left: 4px solid var(--c-accent); background: var(--c-accent-soft); border-radius: 0 12px 12px 0; padding: 20px 28px; font-size: 15.5px; line-height: 1.9; color: var(--c-primary); margin: 40px 0 0; }

/* ---------- Sections ---------- */
.section { padding: 84px 0; }
.section-ivory { background: var(--c-ivory); }
.section-navy { background: var(--c-primary); }
.section-head { text-align: center; margin-bottom: 46px; }
.section-head .kicker { font-size: 14px; letter-spacing: .3em; color: var(--c-accent); font-weight: 700; margin-bottom: 10px; }
.section-head h2 { font-size: 34px; font-weight: 700; margin: 0; }
.section-head .lede { font-size: 16px; color: var(--c-text-light); max-width: 760px; margin: 16px auto 0; }

.card { background: #fff; border: 1px solid var(--c-border); border-radius: 16px; }
.ph { background: linear-gradient(135deg, #ece8f4 0%, #d9d3e6 100%); display: flex; align-items: center; justify-content: center; color: #8b7fa5; font-size: 13.5px; letter-spacing: .1em; }

/* ---------- 服務六卡 ---------- */
.svc-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; }
.svc-card { padding: 30px 28px; display: block; color: inherit; transition: box-shadow .2s ease, transform .2s ease; }
.svc-card:hover { box-shadow: 0 14px 34px rgba(63,45,99,.1); transform: translateY(-2px); color: inherit; }
.svc-card svg { margin-bottom: 16px; }
.svc-card h3 { font-size: 20px; margin: 0 0 10px; }
.svc-card p { font-size: 14.5px; color: var(--c-text-light); margin: 0 0 14px; }
.svc-card .more { font-size: 14px; font-weight: 700; color: var(--c-accent); }

/* ---------- 醫師 / 班表（外掛輸出容器） ---------- */
.doctor-note { text-align: center; font-size: 13.5px; color: var(--c-text-light); margin-top: 22px; }
.plugin-embed { margin-top: 8px; }

/* ---------- 三大門診帶 ---------- */
.dept-rows { display: flex; flex-direction: column; gap: 72px; }
.dept-row { display: flex; gap: 56px; align-items: center; }
.dept-row.reverse { flex-direction: row-reverse; }
.dept-media { width: 46%; flex: none; }
.dept-media .ph, .dept-media img { width: 100%; height: 340px; object-fit: cover; border-radius: 18px; }
.dept-body .kicker { font-size: 13.5px; letter-spacing: .3em; color: var(--c-accent); font-weight: 700; margin-bottom: 8px; }
.dept-body h2 { font-size: 30px; margin: 0 0 16px; }
.dept-body > p { font-size: 15.5px; color: var(--c-text-light); margin: 0 0 20px; }
.dept-note { background: #fff; border: 1px solid var(--c-border); border-radius: 10px; padding: 12px 16px; font-size: 13.5px; color: var(--c-text-light); margin-bottom: 18px; }
.dept-links { display: flex; flex-direction: column; gap: 10px; font-size: 14.5px; font-weight: 600; }
.dept-links a::before { content: "→ "; }

/* ---------- 體檢 ---------- */
.physical-cols { display: flex; gap: 32px; align-items: flex-start; }
.physical-cols > * { min-width: 0; max-width: 100%; }
.physical-table { flex: 1.4; width: 100%; overflow-x: auto; }
.physical-side { flex: 1; display: flex; flex-direction: column; gap: 16px; }
.physical-side .card { padding: 22px 24px; }
.physical-side h3 { font-size: 17px; margin: 0 0 8px; }
.physical-side p { font-size: 14px; color: var(--c-text-light); margin: 0; line-height: 1.85; }
.physical-side .card.highlight { background: var(--c-accent-soft); border-color: transparent; }
.physical-side .card.highlight p { color: var(--c-primary); }

/* ---------- 班表元件（樣式已內建於 ruianc-doctor ≥1.5.0，此處僅留版面情境調整） ---------- */
.plugin-embed .car-check-heading { display: none; } /* 首頁 section-head 已有標題，不重複 */
#clinicSched .cs-caption { font-family: var(--font-serif); } /* 標題用主題 serif（外掛不假設字體已載入） */

/* ---------- 評價 ---------- */
.reviews-embed { min-height: 120px; }
.reviews-placeholder { border: 1.5px dashed var(--c-border); border-radius: 16px; padding: 40px; text-align: center; color: var(--c-text-light); font-size: 14.5px; }

/* ---------- FAQ ---------- */
.faq-wrap { max-width: 980px; margin: 0 auto; display: flex; flex-direction: column; gap: 16px; }
.faq-card { padding: 24px 28px; }
.faq-card h3 { font-size: 17.5px; margin: 0 0 8px; display: flex; gap: 12px; }
.faq-card h3 .q { color: var(--c-accent); font-family: var(--font-serif); }
.faq-card p { font-size: 14.5px; color: var(--c-text-light); margin: 0; padding-left: 28px; }

/* ---------- 位置 ---------- */
.location-inner { display: flex; gap: 56px; align-items: stretch; }
.location-info { flex: 1; color: #fff; }
.location-info .kicker { font-size: 13.5px; letter-spacing: .3em; color: #c3b8dc; font-weight: 700; margin-bottom: 10px; }
.location-info h2 { color: #fff; font-size: 32px; margin: 0 0 24px; }
.location-rows { display: flex; flex-direction: column; gap: 18px; font-size: 15.5px; line-height: 1.8; }
.location-rows .row { display: flex; gap: 14px; }
.location-rows svg { flex: none; margin-top: 4px; }
.location-rows .dim { color: rgba(255,255,255,.62); font-size: 14px; }
.location-partners { border-top: 1px solid rgba(255,255,255,.16); margin-top: 26px; padding-top: 22px; font-size: 13.5px; color: rgba(255,255,255,.62); line-height: 1.9; }
.location-map { width: 46%; flex: none; display: flex; }
.location-map a { display: block; width: 100%; }
.location-map img { width: 100%; height: auto; border-radius: 20px; display: block; background: #fff; }
.location-map .ph { width: 100%; height: auto; min-height: 400px; border: 0; border-radius: 20px; display: block; }
.location-info a { color: #fff; }

/* ---------- CTA band ---------- */
.cta-band { background: var(--c-accent-soft); padding: 52px 0; }
.cta-band .wrap { display: flex; align-items: center; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
.cta-band h2 { font-size: 27px; margin: 0 0 8px; }
.cta-band p { font-size: 15px; color: var(--c-text-light); margin: 0; }
.cta-band .cta-nhi { display: flex; align-items: center; gap: 12px; margin-top: 16px; padding-top: 16px; border-top: 1px solid rgba(63,45,99,.12); font-size: 13.5px; line-height: 1.6; max-width: 640px; }
.cta-band .cta-nhi img { width: 48px; height: 48px; flex: none; display: block; }
.cta-actions { display: flex; gap: 16px; flex-wrap: wrap; }

/* ---------- Footer ---------- */
.site-footer { background: var(--c-footer); color: rgba(255,255,255,.75); padding: 56px 0 0; }
.foot-cols { display: flex; gap: 56px; padding-bottom: 40px; flex-wrap: wrap; }
.foot-brand-col { flex: 1.3; min-width: 260px; }
.foot-brand { display: flex; align-items: center; margin-bottom: 18px; }
.foot-brand-name { display: block; font-family: var(--font-serif); font-size: 20px; font-weight: 700; letter-spacing: .1em; color: #fff; line-height: 1.35; }
.foot-brand-sub { display: block; font-size: 10px; letter-spacing: .24em; color: #c3b8dc; font-weight: 600; }
.foot-brand-col p { font-size: 13.5px; line-height: 1.9; margin: 0; max-width: 380px; }
.foot-col { flex: 1; min-width: 150px; }
.foot-col h3 { color: #fff; font-family: var(--font-sans); font-size: 15px; margin: 0 0 14px; }
.foot-col ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 9px; font-size: 14px; }
.foot-col a { color: rgba(255,255,255,.75); }
.foot-col a:hover { color: #fff; }
/* 位置區的健保徽章：深底上需要白色底板才看得清楚 */

.foot-legal { border-top: 1px solid rgba(255,255,255,.12); padding: 20px 16px 28px; text-align: center; font-size: 12.5px; color: rgba(255,255,255,.45); line-height: 2; }

/* ---------- 內頁（文章 / 固定頁 / 列表） ---------- */
.content-area { padding: 48px 0 72px; }
.entry-narrow { max-width: 860px; margin: 0 auto; }
.entry-header h1 { font-size: 32px; margin: 0 0 14px; }
.entry-meta { font-size: 13.5px; color: var(--c-text-light); margin-bottom: 28px; }
.entry-content { font-size: 16px; line-height: 1.95; }
.entry-content h2 { font-size: 26px; margin: 44px 0 16px; }
.entry-content h3 { font-size: 20px; margin: 32px 0 12px; }
.entry-content img { border-radius: 14px; }
.entry-content table { border-collapse: collapse; width: 100%; }
.entry-content th { background: var(--c-primary); color: #fff; font-weight: 600; padding: 12px 10px; }
.entry-content td { border: 1px solid var(--c-border); padding: 12px 10px; }
.entry-content tr:nth-child(even) td { background: var(--c-ivory); }
.entry-content blockquote { border-left: 4px solid var(--c-accent); background: var(--c-accent-soft); border-radius: 0 12px 12px 0; margin: 24px 0; padding: 18px 24px; }

.archive-header { text-align: center; padding: 52px 0 8px; }
.archive-header h1 { font-size: 32px; margin: 0; }
.post-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; padding: 40px 0 24px; }
.post-card { overflow: hidden; display: flex; flex-direction: column; color: inherit; transition: box-shadow .2s ease; }
.post-card:hover { box-shadow: 0 14px 34px rgba(63,45,99,.1); color: inherit; }
.post-card .thumb { height: 190px; object-fit: cover; width: 100%; display: block; }
.post-card .thumb-ph { height: 190px; }
.post-card h3 { font-size: 17px; margin: 16px 18px 8px; line-height: 1.55; }
.post-card .excerpt { font-size: 13.5px; color: var(--c-text-light); margin: 0 18px 14px; }
.post-card .date { font-size: 12.5px; color: var(--c-text-light); margin: auto 18px 16px; }
.pagination { display: flex; justify-content: center; gap: 8px; padding: 12px 0 48px; }
.pagination .page-numbers { display: inline-flex; align-items: center; justify-content: center; min-width: 42px; height: 42px; border-radius: 999px; border: 1.5px solid var(--c-border); color: var(--c-text); font-size: 14.5px; padding: 0 8px; }
.pagination .page-numbers.current { background: var(--c-primary); border-color: var(--c-primary); color: #fff; }

.error404-box { text-align: center; padding: 100px 24px 120px; }
.error404-box .code { font-family: var(--font-serif); font-size: 84px; font-weight: 700; color: var(--c-accent); line-height: 1; }
.error404-box h1 { font-size: 26px; margin: 18px 0 10px; }
.error404-box p { color: var(--c-text-light); margin: 0 0 28px; }

/* ---------- 主項目頁 hero ----------
   字級、padding 一律沿用首頁 .hero（不再縮一級）。主題頁沒有 hero-sub，
   導言直接接在 H1 下方，故只補一個上緣間距。 */
.hero-inner--page .hero-text p { margin-top: 16px; }
.entry-builder { padding-top: 40px; }

/* ---------- 主題頁共用版型（template-parts/service-page.php） ---------- */
.cond-card { padding: 28px; display: block; color: inherit; transition: box-shadow .2s ease, transform .2s ease; }
a.cond-card:hover { box-shadow: 0 14px 34px rgba(63,45,99,.1); transform: translateY(-2px); color: inherit; }
.cond-card svg { margin-bottom: 14px; }
.cond-card h3 { font-size: 20px; margin: 0 0 8px; }
.cond-card p { font-size: 14.5px; color: var(--c-text-light); margin: 0 0 12px; }
.cond-tags { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.cond-card .more { font-size: 14px; font-weight: 700; color: var(--c-accent); }

.watch-cols { display: flex; gap: 24px; }
.watch-card { flex: 1; padding: 30px; }
.watch-card--alert { border-color: var(--c-accent); }
.watch-head { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.watch-head h3 { font-size: 19px; margin: 0; }
.watch-card ul { margin: 0; padding-left: 20px; font-size: 14.5px; color: var(--c-text-light); line-height: 2; }

.svc-table-wrap { overflow-x: auto; }
.svc-table { border-collapse: collapse; width: 100%; min-width: 720px; background: #fff; }
.svc-table th { background: var(--c-primary); color: #fff; font-weight: 600; font-size: 15px; padding: 13px 12px; text-align: left; }
.svc-table td { border: 1px solid var(--c-border); padding: 13px 12px; font-size: 14.5px; vertical-align: top; }
.svc-table td b { color: var(--c-primary); }
.svc-table tbody tr:nth-child(even) td { background: var(--c-ivory); }
.svc-note { font-size: 13.5px; color: var(--c-text-light); margin-top: 18px; }

.treat-card { overflow: hidden; }
.treat-card img { width: 100%; height: 170px; object-fit: cover; display: block; }
/* 無相符照片時的替代版面：與照片同高，格線才不會參差 */
.treat-plate { height: 170px; display: flex; align-items: center; justify-content: center; background: var(--c-accent-soft); border-bottom: 1px solid var(--c-border); }
.treat-plate svg { width: 46px; height: 46px; opacity: .9; }
.treat-body { padding: 22px; }
.treat-body h3 { font-size: 18px; margin: 0 0 8px; }
.treat-body p { font-size: 14px; color: var(--c-text-light); margin: 0; }

/* auto-fit：皮膚科 4 步、掉髮 5 步都能自動排滿，不會落單 */
.proc-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 24px; }
.proc-no { font-family: var(--font-serif); font-size: 32px; font-weight: 700; color: #c3b8dc; line-height: 1; }
.proc-step h3 { color: #fff; font-size: 18px; margin: 10px 0 8px; }
.proc-step p { color: rgba(255,255,255,.78); font-size: 14px; margin: 0; }

.section-navy .section-head h2 { color: #fff; }
.section-navy .section-head .kicker { color: #c3b8dc; }
.section-navy .section-head .lede { color: rgba(255,255,255,.78); }

@media (max-width: 1024px) {
	.watch-cols { flex-direction: column; }
	.proc-grid { gap: 28px; }
}
@media (max-width: 768px) {
	.cond-card { padding: 20px 18px; }
	.cond-card h3 { font-size: 17px; }
	.treat-card img, .treat-plate { height: 150px; }
}

/* ---------- 積木頁（主項目頁：全幅 Gutenberg 版型） ---------- */
.entry-builder { overflow-x: clip; }
.entry-builder .entry-content { font-size: 16px; line-height: 1.95; }
.entry-builder .entry-content > * { max-width: 860px; margin-left: auto; margin-right: auto; }
.entry-builder .entry-content > .alignwide { max-width: 1200px; }
.entry-builder .entry-content > .alignfull { max-width: none; }
.entry-builder .wp-block-cover__inner-container,
.entry-builder .alignfull > .wp-block-group__inner-container { max-width: 1200px; margin-left: auto; margin-right: auto; }
.entry-builder .wp-block-cover h1,
.entry-builder .wp-block-cover h2,
.entry-builder .wp-block-cover h3 { line-height: 1.4; }
.entry-builder > .entry-content > .alignfull:not(.wp-block-cover) { padding-left: 24px; padding-right: 24px; }
.entry-builder .wp-block-columns { gap: 28px; }
.entry-builder .wp-block-media-text { border-radius: 16px; overflow: hidden; }
.entry-builder .wp-block-media-text .wp-block-media-text__media img { border-radius: 0; }
.entry-builder figure img { border-radius: 14px; }
.entry-builder .wp-block-cover figure img,
.entry-builder .wp-block-cover__image-background { border-radius: 0; }
.entry-builder .wp-block-group.has-background { border-radius: 16px; padding: 28px; }
.entry-builder .alignfull.wp-block-group.has-background { border-radius: 0; }
.entry-builder .wp-block-table table { border-collapse: collapse; width: 100%; }
.entry-builder .wp-block-table th { background: var(--c-primary); color: #fff; font-weight: 600; padding: 12px 10px; }
.entry-builder .wp-block-table td { border: 1px solid var(--c-border); padding: 12px 10px; }
.entry-builder .wp-block-table tr:nth-child(even) td { background: var(--c-ivory); }

/* Gutenberg 按鈕統一膠囊樣式 */
.wp-block-button__link { border-radius: 999px !important; background-color: var(--c-primary); color: #fff; font-weight: 700; letter-spacing: .05em; padding: 13px 30px; font-size: 15.5px; }
.wp-block-button__link:hover { background-color: var(--c-primary-dark); color: #fff; }
.is-style-outline .wp-block-button__link,
.wp-block-button__link.has-background.has-ast-global-color-5-background-color { color: var(--c-primary); }
.is-style-outline .wp-block-button__link { background: transparent; border: 1.5px solid currentColor; }
.is-style-outline .wp-block-button__link.has-ast-global-color-8-color { color: var(--c-primary); }
.is-style-outline .wp-block-button__link:hover { background: var(--c-accent-soft); color: var(--c-primary); }

/* ez-toc 目錄改主題色系 */
div#ez-toc-container { background: var(--c-ivory); border: 1px solid var(--c-border); border-radius: 14px; padding: 20px 24px; }
div#ez-toc-container p.ez-toc-title { color: var(--c-primary); font-family: var(--font-serif); font-weight: 700; }
#ez-toc-container a, #ez-toc-container a:visited { color: var(--c-accent); }
#ez-toc-container a:hover { color: var(--c-primary); }

/* 頁內錨點目標：空元素，放在 h2 裡面（見 ruianc2026_anchor()）。
   捲過去時要讓開上方兩層 sticky：header 80px ＋ 頁內導覽 59px = 139px，
   再留一點呼吸空間，所以是 160px。少算就會看到標題被導覽壓住。
   用 display:block（不是 inline-block）是為了讓這個零高度元素的頂端
   對齊 h2 內容框的頂端；inline 的話會落在文字基線上，偏移量很難算準。 */
.anchor-target { display: block; height: 0; scroll-margin-top: 160px; }
/* 積木頁的 H2 是直接掛 id（ruianc2026_builder_page_data 產生），同樣要留空間 */
.entry-content h2[id] { scroll-margin-top: 160px; }

/* ---------- RWD ---------- */

/* 導覽列最寬只有 1200px（.wrap 的上限）。2026-08-26 加了衛教專區之後變成 6 項，
   中文／粵語／日文字窄還放得下，拉丁與泰文語系則在 1200px 以下無論怎麼縮都會溢出
   （英文差 130px、印尼文差 150px，硬縮字級只會變成看不清楚的小字）。
   所以這些語系的漢堡斷點提高到 1199px；1200px 以上用緊縮版並收起健保標章
   （標章在頁尾的預約區塊仍看得到）。 */
@media (min-width: 1200px) {
	html:not([lang^="zh"]):not([lang="ja"]) .site-header .bar { gap: 24px; }
	html:not([lang^="zh"]):not([lang="ja"]) .header-nhi { display: none; }
	html:not([lang^="zh"]):not([lang="ja"]) .nav-list { gap: 16px; font-size: 14.5px; }
}

@media (max-width: 1199.98px) and (min-width: 1025px) {
	html:not([lang^="zh"]):not([lang="ja"]) .menu-toggle { display: block; }
	html:not([lang^="zh"]):not([lang="ja"]) .main-nav { display: none; position: absolute; top: 100%; left: 0; right: 0; background: #fff; border-bottom: 1px solid var(--c-border); margin: 0; padding: 12px 20px 18px; box-shadow: 0 18px 30px rgba(63,45,99,.12); max-height: calc(100vh - 80px); max-height: calc(100dvh - 80px); overflow-y: auto; overscroll-behavior: contain; }
	html:not([lang^="zh"]):not([lang="ja"]) .main-nav.open { display: block; }
	html:not([lang^="zh"]):not([lang="ja"]) .nav-list { flex-direction: column; gap: 4px; font-size: 15.5px; }
	html:not([lang^="zh"]):not([lang="ja"]) .nav-list a { display: block; padding: 10px 4px; min-height: 44px; }
	html:not([lang^="zh"]):not([lang="ja"]) .nav-list .sub-menu { display: block; position: static; border: 0; box-shadow: none; padding: 0 0 0 18px; }
}

/* 平板到小筆電通用縮排（所有語言）：縮字級與間距，並收起 header 的健保徽章。 */
@media (max-width: 1199.98px) and (min-width: 1025px) {
	.site-header .bar { gap: 20px; }
	.header-nhi { display: none; }
	.nav-list { gap: 16px; font-size: 14px; }
	.brand-name { font-size: 19px; }
	.lang-toggle { height: 38px; padding: 0 12px; font-size: 13.5px; }
}

@media (max-width: 1024px) {
	.hero-inner { gap: 36px; }
	.hero h1 { font-size: 40px; }
	.svc-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.post-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.dept-row, .dept-row.reverse { flex-direction: column; }
	.dept-media { width: 100%; }
	.location-inner { flex-direction: column; }
	.location-map { width: 100%; }
	.location-map .ph { height: 340px; min-height: 0; }
	.physical-cols { flex-direction: column; }
}

/* ---------- 衛教專區 ---------- */
/* 頁首：左邊標題與說明，右邊搜尋（2026-08-26 客戶指定）。 */
.kg-head-inner { display: flex; align-items: flex-end; justify-content: space-between; gap: 32px; flex-wrap: wrap; }
.kg-head-text { flex: 1 1 420px; min-width: 0; }
.kg-head .kg-head-text h1, .kg-head .kg-head-text p { margin: 0; }
.kg-head .kg-head-text p { margin-top: 12px; }
.kg-head .kg-search { flex: 0 0 300px; margin-bottom: 4px; }
.kg-head .kg-search input { background: rgba(255,255,255,.96); border-color: transparent; }
.kg-head .kg-search input::placeholder { color: var(--c-accent); }

/* 頁籤不鎖在上方，跟著頁面捲走（2026-08-26 客戶指定）。 */
.kg-tools { background: #fff; border-bottom: 1px solid var(--c-border); }
.kg-tools-inner { display: flex; align-items: center; gap: 20px; padding-top: 16px; padding-bottom: 16px; flex-wrap: wrap; }
.kg-tabs { display: flex; flex-wrap: wrap; gap: 8px; flex: 1 1 auto; }
.kg-tab { display: inline-flex; align-items: center; gap: 7px; background: none; border: 1px solid var(--c-border); border-radius: 999px; padding: 8px 15px; font: inherit; font-size: 14.5px; color: var(--c-accent); cursor: pointer; transition: background .15s, color .15s, border-color .15s; }
.kg-tab:hover { border-color: var(--c-primary); color: var(--c-primary); }
.kg-tab.is-on { background: var(--c-primary); border-color: var(--c-primary); color: #fff; }
.kg-n { font-size: 12px; opacity: .7; }
.kg-search { position: relative; display: flex; align-items: center; flex: 0 0 232px; }
.kg-search svg { position: absolute; left: 12px; color: var(--c-accent); pointer-events: none; }
.kg-search input { width: 100%; border: 1px solid var(--c-border); border-radius: 999px; padding: 9px 14px 9px 36px; font: inherit; font-size: 14.5px; background: #fff; }
.kg-search input:focus { outline: 2px solid var(--c-primary); outline-offset: 1px; border-color: transparent; }

.kg-main { padding: 44px 0 64px; }
.kg-result { color: var(--c-accent); font-size: 14.5px; margin: 0 0 18px; }
.kg-empty { text-align: center; color: var(--c-accent); padding: 56px 0; margin: 0; }
.kg-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(272px, 1fr)); gap: 26px; }
/* display:grid／flex 會蓋掉瀏覽器預設的 [hidden] { display:none }，
   分頁與篩選靠 hidden 屬性運作，所以要明確寫回來。 */
.kg-grid[hidden], .kg-card[hidden] { display: none; }
.kg-card { display: flex; flex-direction: column; background: #fff; border: 1px solid var(--c-border); border-radius: 14px; overflow: hidden; transition: box-shadow .18s, transform .18s; }
.kg-card:hover { box-shadow: 0 16px 34px rgba(63,45,99,.12); transform: translateY(-2px); }
.kg-thumb { display: block; aspect-ratio: 16/10; overflow: hidden; background: var(--c-ivory); }
.kg-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.kg-thumb.is-ph { display: grid; place-items: center; background: linear-gradient(135deg, #f3effa, #e9e2f4); }
.kg-thumb.is-ph img { width: 52px; height: 52px; object-fit: contain; opacity: .5; }
.kg-body { padding: 15px 17px 18px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.kg-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.kg-cat { font-size: 12px; color: var(--c-accent); background: var(--c-ivory); border-radius: 5px; padding: 3px 8px; }
.kg-badge { font-size: 11.5px; font-weight: 500; letter-spacing: .04em; color: #fff; background: var(--c-accent); border-radius: 5px; padding: 3px 8px; }
.kg-card h3 { font-size: 16px; line-height: 1.5; margin: 0; font-weight: 600; }
.kg-card h3 a { color: var(--c-ink); }
.kg-card h3 a:hover { color: var(--c-primary); }
.kg-card p { font-size: 13.5px; line-height: 1.75; color: var(--c-accent); margin: 0; }

.kg-pager { display: flex; justify-content: center; flex-wrap: wrap; gap: 7px; padding: 40px 0 0; }
.kg-pager button { min-width: 40px; height: 40px; padding: 0 12px; border: 1px solid var(--c-border); border-radius: 9px; background: #fff; font: inherit; font-size: 14.5px; color: var(--c-accent); cursor: pointer; }
.kg-pager button:hover:not(:disabled) { border-color: var(--c-primary); color: var(--c-primary); }
.kg-pager button.is-on { background: var(--c-primary); border-color: var(--c-primary); color: #fff; }
.kg-pager button:disabled { opacity: .4; cursor: default; }
.kg-pager button.is-gap { border-color: transparent; background: none; }

/* 導覽收成漢堡的斷點由 768 提高到 1024：外語導覽單列需要約 1070px，
   769–1024 這一段無論怎麼縮都塞不下，硬撐只會折行。 */
@media (max-width: 1024px) {
	.menu-toggle { display: block; }
	/* 選單比視窗高時要能捲動：header 是 sticky，面板 absolute 定位在它底下，
	   沒有 max-height 就會被視窗底部切掉，下面的連結永遠點不到。
	   100dvh 讓行動瀏覽器的網址列收合時也算得準，100vh 是舊瀏覽器的回退。 */
	.main-nav { display: none; position: absolute; top: 100%; left: 0; right: 0; background: #fff; border-bottom: 1px solid var(--c-border); margin: 0; padding: 12px 20px 18px; box-shadow: 0 18px 30px rgba(63,45,99,.12); max-height: calc(100vh - 80px); max-height: calc(100dvh - 80px); overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
	.main-nav.open { display: block; }
	.nav-list { flex-direction: column; gap: 4px; }
	.nav-list a { display: block; padding: 10px 4px; min-height: 44px; }
	.nav-list .sub-menu { display: block; position: static; border: 0; box-shadow: none; padding: 0 0 0 18px; }
	.lang-switch { margin-left: auto; }
}

@media (max-width: 768px) {
	.site-header .bar { height: 64px; gap: 12px; }
	.kg-tools-inner { gap: 12px; padding-top: 12px; padding-bottom: 12px; }
	.kg-head-inner { align-items: stretch; gap: 20px; }
	.kg-head .kg-search { flex: 1 1 100%; margin-bottom: 0; }
	/* 手機版頁籤排三行會吃掉半個螢幕，改成單行橫向滑動（sticky 才不會太高）。 */
	.kg-tabs { gap: 6px; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
	.kg-tabs::-webkit-scrollbar { display: none; }
	.kg-tab { padding: 7px 12px; font-size: 13.5px; flex: 0 0 auto; }
	.kg-main { padding: 30px 0 48px; }
	.kg-grid { grid-template-columns: 1fr; gap: 18px; }
	.main-nav { max-height: calc(100vh - 64px); max-height: calc(100dvh - 64px); }
	.marquee { font-size: 12px; letter-spacing: .02em; padding: 8px 12px; }
	.brand-mark { height: 34px; }
	.brand-name { font-size: 16.5px; }
	.brand-sub { font-size: 8.5px; }
	.header-nhi { padding-left: 12px; }
	.header-nhi img { height: 30px; }
	.lang-toggle { height: 38px; padding: 0 12px; font-size: 13.5px; }
	.hero-inner { flex-direction: column; padding-top: 44px; padding-bottom: 40px; gap: 28px; }
	.hero h1 { font-size: 32px; }
	.page-head { padding: 30px 0 28px; }
	.page-head h1 { font-size: 26px; }
	.page-head p { font-size: 15px; }
	.article-body h2 { font-size: 21px; }
	.article-body p { font-size: 15.5px; line-height: 1.95; }
	.art-list { font-size: 15px; }
	.hero-sub { font-size: 16px; }
	.hero-kicker { font-size: 12.5px; letter-spacing: .18em; }
	.hero-text p { font-size: 14.5px; }
	.hero-visual { width: 100%; }
	.hero-visual .ph, .hero-visual img { height: 220px; }
	.trust-band .wrap { justify-content: flex-start; font-size: 13px; }
	.anchornav { top: 64px; }
	.anchor-target, .entry-content h2[id] { scroll-margin-top: 132px; }
	.anchornav ul { gap: 20px; padding: 13px 16px; }
	.section { padding: 52px 0; }
	.section-head h2 { font-size: 25px; }
	.svc-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
	/* 主題頁的問題卡與療程卡內容比首頁服務卡多（圖示＋描述＋標籤＋連結），
	   兩欄在 375px 會擠成六七行短句，改單欄。首頁服務卡維持兩欄不動。 */
	[data-sec="conditions"] .svc-grid, [data-sec="treatments"] .svc-grid { grid-template-columns: 1fr; gap: 16px; }
	.svc-card { padding: 18px 16px; }
	.post-grid { grid-template-columns: 1fr; }
	.dept-media .ph, .dept-media img { height: 200px; }
	.cta-band .wrap { flex-direction: column; align-items: flex-start; }
	.cta-band .cta-nhi { font-size: 13px; gap: 10px; }
	.cta-band .cta-nhi img { width: 40px; height: 40px; }
	.foot-cols { gap: 32px; }
	.hero-ctas .btn { width: 100%; }
	.hero-ctas { flex-direction: column; width: 100%; }
}

@media (max-width: 480px) {
	.site-header .bar { padding: 0 14px; gap: 10px; }
	/* 外語版的品牌名比中文長，手機 header 塞不下會把整頁撐出橫向捲軸
	   （實測 320px 時英文溢出 47px、菲律賓文 73px；360px 時泰／印尼／菲仍溢出 33px）。
	   收起健保標章——它在頁尾的預約區塊也有一份，不會漏掉。
	   中文與粵語字窄，放得下，維持顯示。 */
	html:not([lang^="zh"]) .header-nhi { display: none; }
	.brand { gap: 9px; }
	.brand-sub { font-size: 8px; letter-spacing: .1em; margin-right: -.1em; }
	.lang-toggle span { display: none; }
	.lang-toggle { padding: 0 11px; gap: 5px; }
	.header-nhi { padding-left: 10px; }
	.header-nhi img { height: 26px; }
}

/* 320–360px 的老機型：收起健保標章之後，泰文品牌名還是差 12px。
   只在這個寬度再縮一級字並收緊字距——375px 以上維持原本大小。 */
@media (max-width: 360px) {
	html:not([lang^="zh"]) .brand-name { font-size: 15px; letter-spacing: .06em; }
}
