/*首頁、子頁都載入)*/

/* ── 科別一行(第 1 項;第 2 條解法):電腦版在頁首 logo 下面(每一頁都有),平板、手機在首屏最上面 ── */
html body .hero .hero-dept { margin: 0 0 var(--s-5); font-size: 16px; line-height: 1.5; letter-spacing: .08em; color: #fff; text-shadow: 0 1px 12px rgba(31, 42, 37, .3); }
@media (min-width: 1200px) { html body .hero .hero-dept { margin: -48px 0 var(--s-5); } }   /*往上拉一格(字高 24+間距 24),大標位置跟之前完全一樣*/
@media (max-width: 767px) { html body .hero .hero-dept { margin-bottom: var(--s-4); font-size: var(--t-en-m); letter-spacing: .02em !important; } }   /* 全站段落字距是 .05em,這行要蓋過 */
html body .hero .hero-dept span { letter-spacing: inherit !important; }   /* 全站 span 一律 .05em(opt2.css),這行跟著自己的字距 */
@media (max-width: 389px) { html body .hero .hero-dept { letter-spacing: 0 !important; } }   /* 375 寬剛好 22 字一行 */
@media (max-width: 374px) { html body .hero .hero-dept .dp-s { display: none; } html body .hero .hero-dept .dp-b { display: block; } }
/* 引言(第 2 項):電腦、平板兩行,第二行「用剛剛好的方法。」單獨一行、字重略加;手機三行、每行八字 */
html body .hero .hero-sub .hs-b { display: block; font-weight: 500; }
@media (max-width: 767px) { html body .hero .hero-sub .hs-a { display: block; } }

/* 首屏進場縮短:延遲從 0.5–1.35 秒縮到 0.05–0.25 秒,動作照舊;本機量:大標 0.4 秒、按鈕約 0.9 秒出現*/
html.mo .hero .hero-dept { animation: rise .7s cubic-bezier(.2, .7, .2, 1) .05s both; }
html.mo .hero .hero-h1 .ln:nth-child(1) .in { animation-delay: .1s; animation-duration: .9s; }
html.mo .hero .hero-h1 .ln:nth-child(2) .in { animation-delay: .18s; animation-duration: .9s; }
html.mo .hero .hero-en { animation-delay: .15s; animation-duration: .6s; }
html.mo .hero .hero-sub { animation-delay: .2s; animation-duration: .6s; }
html.mo .hero .door { animation-delay: .25s; animation-duration: .6s; }
@media (prefers-reduced-motion: reduce) { html .hero .hero-dept { animation: none !important; } }

/* ── 首屏「立即預約」+ 選單──*/
html body .hero .doors { position: relative; }
html body .hero button.door { font: inherit; color: #fff; cursor: pointer; }
html body .bk-pop { position: absolute; left: 0; top: calc(100% + var(--s-3)); z-index: 60; width: min(380px, calc(100vw - 40px)); padding: var(--s-5); border-radius: var(--r-card);
  background: #fff; box-shadow: 0 12px 40px rgba(31, 42, 37, .24); color: var(--c-ink); text-shadow: none; text-align: left; }
html body .bk-pop[hidden] { display: none; }
html body .bk-h { margin: 0 0 var(--s-4); padding-right: var(--s-7); font-size: var(--t-body); line-height: 1.5; font-weight: 500; color: var(--c-green-dk); }
html body .bk-o { position: relative; display: grid; gap: var(--s-1); padding: var(--s-4) var(--s-8) var(--s-4) var(--s-5); border: 1px solid var(--ln); border-radius: var(--r-card); text-decoration: none; color: var(--c-ink); }
html body .bk-o + .bk-o { margin-top: var(--s-2); }
html body .bk-o b { font-size: var(--t-body); line-height: 1.5; font-weight: 500; color: var(--c-green-dk); }
html body .bk-o span { font-size: 16px; line-height: 1.5; }
html body .bk-o::after { content: "→"; position: absolute; right: var(--s-5); top: 50%; transform: translateY(-50%); color: var(--c-green); }
html body .bk-o:is(:hover, :focus-visible) { border-color: var(--ln-act); background: #F3F6F4; }
html body .bk-o:first-of-type { border-color: var(--ln-act); }
html body .bk-f { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 var(--s-2); margin: var(--s-4) 0 0; font-size: 16px; line-height: 1.75; }
html body .bk-f + .bk-f { margin-top: var(--s-1); }
html body .bk-f a { color: var(--c-green-dk); font-weight: 500; text-underline-offset: 3px; }
html body .bk-x { position: absolute; top: var(--s-2); right: var(--s-2); display: grid; place-items: center; width: 44px; height: 44px; padding: 0; border: 0; border-radius: var(--r-pill); background: none; color: var(--c-ink); cursor: pointer; }
html body .bk-x svg { width: 20px; height: 20px; }
html body .bk-x:is(:hover, :focus-visible) { background: var(--c-bone); }
@media (min-width: 1024px) { html body .bk-pop { top: auto; bottom: calc(100% + var(--s-3)); } }   /* 大螢幕按鈕靠近首屏底部 → 往上開,不會超出畫面 */
@media (max-width: 767px) {   /* 手機:從畫面底部升起的一張卡 */
  html body .bk-pop { position: fixed; left: var(--s-3); right: var(--s-3); top: auto; bottom: var(--s-3); z-index: 130; width: auto; }
}

/* ── 疼痛問題 ── */
/* 從生活找的小目標(第 28 項):跟依部位找同一種樣子 */
html body #find .lf-i dl .fw-ck { grid-column: 1 / -1; padding: var(--s-5); border: 0; border-radius: var(--r-card); background: #E8EEEA; }
@media (max-width: 767px) { html body #find .lf-i dl .fw-ck { padding: var(--s-4); } }
/* 依療程找點開後的第一行(第 33–41 項;第 6 條解法) */
html body #find .tf-how { margin: var(--s-3) 0 0; font-size: var(--t-body); line-height: 1.75; color: #505150; }
html body #find .tf-how b { font-weight: 500; color: var(--c-green-dk); }

/* ── 醫療團隊:三位醫師「掛誰」清單(第 53、54 項;第 4 條解法)── */
html body .tm-docs { margin: var(--s-5) 0 var(--s-7); }
html body .tm-dl { margin: 0; padding: 0; list-style: none; border-top: 1px solid var(--ln); }
html body .tm-dl > li { border-bottom: 1px solid var(--ln); }
html body .tm-dl a { display: grid; gap: var(--s-1); padding: var(--s-4) 0; text-decoration: none; color: inherit; }
html body .tm-dn { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 var(--s-3); margin: 0; }
html body .tm-dn b { font-size: var(--t-lead); line-height: 1.4; font-weight: 500; color: var(--c-green-dk); }
html body .tm-dn span { font-size: var(--t-body); line-height: 1.5; color: var(--c-green); }
html body .tm-dc { margin: 0; font-size: var(--t-body); line-height: 1.75; color: var(--c-ink); }
html body .tm-dc .tm-i { white-space: nowrap; }
html body .tm-dl a:is(:hover, :focus-visible) .tm-dn b { text-decoration: underline; text-underline-offset: 4px; text-decoration-thickness: 1px; }
html body .tm-hint { margin: var(--s-5) 0 0; font-size: var(--t-body); line-height: 1.75; color: var(--c-green-dk); }
/*清單接在照片下面;照片到清單留 40(跟原本清單到照片一樣)*/
@media (max-width: 1023.98px) { html body .o-center #team > .wrap > .tm-docs { margin-top: var(--s-7); } }
/* 電腦、橫拿平板:團體照下面一排三欄(左欄放清單會比照片高一大截),四張團隊卡往下一列;三欄的名字、說明各自對齊 */
@media (min-width: 1024px) {
  html body .o-center #team > .wrap > .tm-docs { grid-column: 1 / -1; grid-row: 6; margin: var(--s-7) 0 0; }
  html body .o-center #team > .wrap > .tm-tcs { grid-row: 7; }
  html body .tm-dl { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); grid-template-rows: auto auto; column-gap: var(--s-7); border-top: 0; }
  /*現在感覺有點擠」→ 每位醫師下面也加一條,跟上面那條同長;線到內容上下都是 24*/
  html body .tm-dl > li { display: grid; grid-row: span 2; grid-template-rows: subgrid; border-top: 1px solid var(--ln); border-bottom: 1px solid var(--ln); }
  html body .tm-dl a { grid-row: span 2; grid-template-rows: subgrid; row-gap: var(--s-1); padding: var(--s-5) 0; }
}


html body .faq-i > :is(p, table) + :is(p, table) { margin-top: var(--s-2); }
html body .faq-tb { border-collapse: collapse; font-size: var(--t-body); line-height: 1.75; }
html body .faq-tb th { padding: 0 var(--s-4) 0 0; font-weight: 500; text-align: left; vertical-align: top; white-space: nowrap; color: var(--c-green-dk); }
html body .faq-tb td { padding: 0 var(--s-4) 0 0; vertical-align: top; }
html body .faq-tb .tr { white-space: nowrap; }   /* 時間不拆開;太窄只在「、」後面換行 */

/* ── 預約與交通:健保在前、自費細框(第 97 項)── */
html body .paths .btn-line { background: transparent; border: 1px solid rgba(255, 255, 255, .7); color: #fff; }
html body .paths .btn-line:is(:hover, :focus-visible) { background: rgba(255, 255, 255, .12); }

/* ── 手機頁首換短版標誌:直式 Just Joy Clinic,高 44 ──*/
@media (max-width: 767px) { html body .hd .hd-logo img { width: auto; height: 44px; } }

/* ── 子頁:治療頁每種療程的兩行說明(第 33–41 項;首頁圖卡只放第一行)── */
html body.sp .sp-list .sp-how { margin: var(--s-2) 0 0; font-size: var(--t-body); line-height: 1.85; color: var(--c-ink); }
html body.sp .sp-list .sp-how b { font-weight: 500; color: var(--c-green-dk); }

/* ── 空間區:連到就醫指南那 9 句說明的入口(第 5 條解法)── */
html body .s3g-more { display: inline-flex; align-items: center; min-height: 44px; margin-top: var(--s-2); }

/*自動播放與暫停鈕保留 ──
 ※ 設計系統照片圓角是 12,記在設計系統.md 第 29 節)*/
html body .o-center #space .s3g img { border-radius: 40px; }
@media (max-width: 767px) { html body .o-center #space .s3g img { border-radius: 24px; } }
@media (hover: hover) and (min-width: 768px) { html body .o-center #space .s3g figcaption { border-radius: 40px; } }   /* 滑過出現的黑底說明跟照片同一個圓角 */
html body .o-center #space .s3g-w { position: relative; }
html body .o-center #space .s3g-w.s3g-ov .s3g-ctl { position: static; }   /* 箭頭要以整個輪播區定位,不是以下面那排按鈕 */
html body .o-center #space .s3g-w.s3g-ov :is(.s3g-prev, .s3g-next) { position: absolute; z-index: 3; top: var(--arw-y, 50%); transform: translateY(-50%);
  background: rgba(255, 255, 255, .92); color: var(--c-green-dk); box-shadow: 0 4px 16px rgba(31, 42, 37, .18); }
html body .o-center #space .s3g-w.s3g-ov :is(.s3g-prev, .s3g-next):hover { background: var(--c-green); color: #fff; }
html body .o-center #space .s3g-w.s3g-ov .s3g-prev { left: var(--s-5); }
html body .o-center #space .s3g-w.s3g-ov .s3g-next { right: var(--s-5); }

/* ── 首頁 3 個小問題──*/
html body .o-center #faq .h2 .nw { display: inline-block; white-space: nowrap; }   /* 手機大標不再只剩「事。」一行 */
html body .o-center #kids .sl-cta .kd-faq { display: inline-flex; align-items: center; min-height: 44px; }   /* 手機點按範圍 33 → 44 */
html body #find .pw-card .pw-say { font-size: var(--t-body) !important; }   /* 中文最小 18(設計系統第 1 節) */
html body #find .pw-card .pw-n { font-size: var(--t-body) !important; }
html body .o-center .td-i .td-doc small, html body .o-center .td-i .td-nx { font-size: var(--t-body); }
html body #find .pw-tip { font-size: var(--t-body); }   /* 部位小標籤 16 → 18 */


/* 16 全站文字連結:底線連到箭頭(原本文字和箭頭之間隔 6px,底線斷成兩段) */
html body .tlink, html body .o-center .tlink { gap: 0; }   /*被 system.css 的 .o-center 規則(gap 8px)蓋掉,首頁和子頁內文區都沒生效*/
html body .tlink > span[aria-hidden="true"]::before { content: "\a0"; }   /* 箭頭前的空白改成不會被吃掉的空白,底線畫得過去;文字到箭頭還是約 8px */
/* 12 常見問題:問題和答案之間的分隔線拿掉,改用段距分層;時段表跟答案文字同一條左緣 */
html body details.faq-i[open] > p { background: none !important; padding-top: 0 !important; }
html body .faq-i > :is(p, table, .faq-tb):not(:last-child) { padding-bottom: var(--s-2) !important; }
html body .faq-i > :is(p, table) + :is(p, table) { margin-top: 0; }
html body .faq-i > .faq-tb { margin: 0 var(--s-5) 0 64px; }
html body .faq-i > .faq-tb:last-child { margin-bottom: var(--s-5); }
@media (max-width: 767px) { html body .faq-i > .faq-tb { margin-left: 60px; } }
/* 04 三位醫師:名字前小圓形大頭貼;「主治」那行從大頭貼底下開始(整寬) */
html body .tm-dl a { grid-template-columns: 56px minmax(0, 1fr); column-gap: var(--s-4); align-items: center; }
html body .tm-dl .tm-av { grid-column: 1; grid-row: 1; width: 56px; height: 56px; border-radius: 50%; object-fit: cover; object-position: 50% 18%; background: var(--c-bone); }
html body .tm-dl .tm-dn { grid-column: 2; grid-row: 1; }
html body .tm-dl .tm-dc { grid-column: 1 / -1; grid-row: 2; }
/* 08 療程說明的小標(當天怎麼進行:、注射之後:…)改品牌橘紅 */
html body :is(#find .tf-how, .sp .sp-how) b { color: var(--c-warm); }

html body.sp #space .s3g figcaption span { display: block; font-size: var(--t-body); font-weight: 400; line-height: 1.6; }
/* 10 門診時間頁:11 月整月門診表(4 週,醫師用首頁同色圓章) */
html body.sp .mo-wk + .mo-wk { margin-top: var(--s-7); }
html body.sp .mo-h { margin: 0 0 var(--s-3); font-size: var(--t-body); font-weight: 500; color: var(--c-green-dk); }
html body.sp .mo-tb { width: 100%; table-layout: fixed; border-collapse: separate; border-spacing: 0; background: #fff; border-radius: var(--r-card); overflow: hidden; }
html body.sp .mo-tb :is(th, td) { padding: var(--s-3) var(--s-1); border-bottom: 1px solid var(--ln); text-align: center; vertical-align: middle; font-size: var(--t-body); line-height: 1.4; color: var(--c-ink); }
html body.sp .mo-tb tbody tr:last-child :is(th, td) { border-bottom: 0; }
html body.sp .mo-tb thead th { font-weight: 500; color: var(--c-green-dk); background: #E8EEEA; }
html body.sp .mo-tb :is(.mo-dt, .mo-wd) { display: block; }
html body.sp .mo-tb :is(thead th:first-child, tbody th) { width: 18%; padding-left: var(--s-4); text-align: left; font-weight: 500; color: var(--c-green-dk); }
html body.sp .mo-tb .d { width: 36px; height: 36px; font-size: 16px; }
html body.sp .mo-tb .mo-off { color: #8B8C8A; }
html body.sp .mo-mk { margin-left: 2px; font-size: var(--t-body); color: var(--c-warm); }
html body.sp .mo-note { margin: var(--s-4) 0 0; font-size: var(--t-body); color: var(--c-ink); }
@media (max-width: 767px) {
  html body.sp .mo-tb :is(th, td) { padding: var(--s-2) 2px; }
  html body.sp .mo-tb :is(thead th:first-child, tbody th) { width: 17%; padding-left: var(--s-2); }
  html body.sp .mo-tb .mo-dt { font-size: 15px; }   /* 日期數字 15(中文最小 18 只管中文);星期一個字維持 18、拿掉括號 */
  html body.sp .mo-tb .mo-p { display: none; }
  html body.sp .mo-tb .d { width: 30px; height: 30px; font-size: 15px; }
}
/* 01 寬螢幕(21:9、21:10)首屏:螢幕寬但瀏覽器可用高度矮(1920×810 的螢幕約只剩 680)→ 大字、間距、小綠人跟著高度縮
大標不碰到 logo 下面的科別*/
@media (min-width: 1200px) and (max-height: 880px) and (min-aspect-ratio: 11/5) {   /* 只管超寬(寬高比 2.2 以上);一般筆電 1440×790、1536×740 維持原本調好的樣子 */
  html body .hd .hd-in { padding-top: clamp(28px, 6vh, 56px); }
  html body .hero .hero-in { padding-top: calc(clamp(28px, 6vh, 56px) + 64px + 24px + 24px); padding-bottom: calc(88px + clamp(16px, 2.4vh, 32px) + 24px); }
  html body .hero .hero-h1 { font-size: clamp(48px, 7.6vh, 72px) !important; }
  html body .hero .hero-en { font-size: clamp(22px, 3.4vh, 32px) !important; margin-bottom: clamp(16px, 3vh, 40px); }
  html body .hero .hero-sub { line-height: 1.6; }
  html body .hero .gm-greet { --gm-s: .28px; }
  html body .hero .hero-nav { bottom: clamp(16px, 2.4vh, 32px); }
}
/* 一般筆電(寬高比 2.2 以下,首屏比一屏高 4–36px、1536 的大標碰到科別 → 保守收
 大標在 790 高時維持 72,只收引言行距、英文標語下的空、小綠人;更矮才讓大字跟著縮*/
@media (min-width: 1200px) and (max-height: 880px) and (max-aspect-ratio: 11/5) {
  html body .hd .hd-in { padding-top: clamp(28px, 7vh, 56px); }
  html body .hero .hero-in { padding-top: calc(clamp(28px, 7vh, 56px) + 64px + 48px); padding-bottom: calc(88px + clamp(16px, 2.4vh, 32px) + 24px); }
  html body .hero .hero-h1 { font-size: clamp(56px, 9.2vh, 72px) !important; }
  html body .hero .hero-en { font-size: clamp(24px, 4vh, 32px) !important; margin-bottom: clamp(16px, 2.6vh, 40px); }
  html body .hero .hero-sub { line-height: 1.6; }
  html body .hero .gm-greet { --gm-s: .3px; }
  html body .hero .hero-nav { bottom: clamp(16px, 2.4vh, 32px); }
}

/* 14 空間輪播:箭頭疊在照片上 → 下面那排(暫停鍵)拿掉*/
html body .o-center #space .s3g-w.s3g-ov .s3g-ctl { display: none; }
/* 18 就醫指南「來之前，先看一眼環境」的左右拖曳 bar:灰色系統捲軸 → 品牌綠細圓條 */
html body.sp .sp-strip { scrollbar-width: thin; scrollbar-color: var(--c-green) #E1DBCF; padding-bottom: var(--s-4); }
html body.sp .sp-strip::-webkit-scrollbar { height: 6px; }
html body.sp .sp-strip::-webkit-scrollbar-track { background: #E1DBCF; border-radius: 999px; }
html body.sp .sp-strip::-webkit-scrollbar-thumb { background: var(--c-green); border-radius: 999px; }

/*
 最長的「護理與行政團隊 →」約 9 個字寬 → 字級 = 卡片文字區寬 ÷ 9,最大 20(電腦維持原本 20);四張卡同寬,所以字級一致*/
html body .o-center #team .tm-tcs > .sl-tc > .sl-tc-b { container-type: inline-size; }
html body .o-center #team .tm-tcs .sl-tc-b h3 { font-size: clamp(13px, calc(100cqi / 8), 20px) !important; white-space: nowrap; }   /* 11-09「護理與行政團隊」改「護理行政團隊」,最長變約 8 字寬 → ÷ 8 */

/*
 卡片照衛教文章的樣子;子頁的卡片樣式綁在 body.sp,首頁這裡照 sub.css 的數值另寫一份*/
html body .o-center #media .sp-arts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s-5); margin: 0; padding: 0; list-style: none; }
html body .o-center #media .sp-arts > li { display: grid; grid-row: span 5; grid-template-rows: subgrid; row-gap: 0; }
html body .o-center #media .sp-art { display: grid; grid-row: 1 / -1; grid-template-rows: subgrid; row-gap: 0; border-radius: var(--r-card); background: #fff; overflow: hidden; color: inherit; text-decoration: none; transition: background-color .2s; }
html body .o-center #media .sp-art:is(:hover, :focus-visible) { background: #E8EEEA; }
html body .o-center #media .sp-art figure { margin: 0; }
html body .o-center #media .sp-art figure img { display: block; width: 100%; aspect-ratio: 3 / 2; object-fit: cover; }
html body .o-center #media .sp-art-b { display: contents; }
html body .o-center #media .sp-art-b > * { margin: 0; padding-left: var(--s-5); padding-right: var(--s-5); }
html body .o-center #media .sp-art .tx-k { padding-top: var(--s-5); margin-bottom: var(--s-2); font: 500 var(--t-body)/1.5 "Noto Sans TC", sans-serif; letter-spacing: .05em !important; text-transform: none; color: var(--c-warm); }
html body .o-center #media .sp-art h3 { font-size: var(--t-lead); font-weight: 500; line-height: 1.5; color: var(--c-green-dk); }
html body .o-center #media .sp-art h3 + p { padding-top: var(--s-4); font-size: var(--t-body); line-height: 1.75; color: var(--c-ink); }
html body .o-center #media .sp-art-m { align-self: end; padding-top: var(--s-4); padding-bottom: var(--s-5); font-size: var(--t-body); line-height: 1.5; color: var(--c-ink); opacity: .72; }
html body .o-center #media .sl-cta { margin-top: var(--s-7); }
/* 平板、手機:三欄太窄(820 寬每張 220,標題折 5 行)→ 改橫滑一排,樣子跟就醫指南的環境照橫滑列一樣*/
@media (max-width: 1023.98px) {
  html body .o-center #media .sp-arts { grid-template-columns: none; grid-template-rows: repeat(5, auto); grid-auto-flow: column; grid-auto-columns: 46%; gap: 0 var(--s-5); overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: var(--s-4); scrollbar-width: thin; scrollbar-color: var(--c-green) #E1DBCF; }
  html body .o-center #media .sp-arts > li { scroll-snap-align: start; }
  html body .o-center #media .sp-arts::-webkit-scrollbar { height: 6px; }
  html body .o-center #media .sp-arts::-webkit-scrollbar-track { background: #E1DBCF; border-radius: 999px; }
  html body .o-center #media .sp-arts::-webkit-scrollbar-thumb { background: var(--c-green); border-radius: 999px; }
}
@media (max-width: 767px) { html body .o-center #media .sp-arts { grid-auto-columns: 78%; gap: 0 var(--s-4); } }
/* 短片:封面正中間一顆播放鍵(首頁、衛教文章頁共用) */
html body .sp-art figure { position: relative; }
html body .md-play { position: absolute; left: 50%; top: 50%; width: 56px; height: 56px; margin: -28px 0 0 -28px; border-radius: 50%; background: rgba(255, 255, 255, .9); display: grid; place-items: center; color: var(--c-green-dk); pointer-events: none; }
html body .md-play svg { width: 24px; height: 24px; margin-left: 2px; fill: currentColor; }
