/* ============================================================
   致力於止痛 — 診所網站樣式
   色票以 assets/design.css 為準（墨／紙／靛／朱紅四色）。本檔只留備援值。
   字體一律 Noto Sans TC 無襯線。
   閱讀對象包含老花眼長者，因此：基準字級放大、行高加大、
   對比拉高、小字最低不低於 16px、按鈕觸控範圍加大。
   ============================================================ */

:root {
  /* 這一層只是 design.css 未載入時的備援值，色票以 design.css 為準 */
  --navy: #003249;          /* = --indigo */
  --blue: #003249;          /* 連結與重點一律靛藍，不另開藍色 */
  --blue-deep: #00202f;
  --blue-wash: #e2ebef;

  --text: #16191c;          /* = --ink */
  --muted: #4a5158;         /* = --ink-70 */
  --bg: #f2efe8;            /* = --paper */
  --surface: #fffdf9;       /* = --sheet */
  --line: #d9d3c7;          /* = --hair */

  --max: 1140px;
  --gut: 1.5rem;
  --radius: 0px;          /* 印刷品沒有圓角 */
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Noto Sans TC", -apple-system, BlinkMacSystemFont, "Segoe UI",
    "PingFang TC", "Helvetica Neue", sans-serif;
  font-size: 1.15rem;      /* 約 18px，比一般網站大一級 */
  line-height: 2;
  -webkit-font-smoothing: antialiased;
  overflow-wrap: break-word;
}

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

a { color: inherit; text-decoration: none; }

.shell { max-width: var(--max); margin: 0 auto; padding: 0 var(--gut); }

/* ---------- 頁首 ---------- */

.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: saturate(180%) blur(10px);
  border-bottom: 1px solid var(--line);
}

.nav-in {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 var(--gut);
  min-height: 76px;
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.logo { display: flex; flex-direction: column; line-height: 1.3; }

.logo b { font-size: 1.25rem; font-weight: 700; color: var(--navy); }

.logo span {
  font-size: 0.85rem;
  letter-spacing: 0.16em;
  color: var(--blue);
  font-weight: 700;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  margin-left: auto;
  font-size: 1.05rem;
  font-weight: 500;
}

.nav-links a { padding: 0.5rem 0; border-bottom: 3px solid transparent; color: var(--navy); }

.nav-links a:hover { color: var(--blue); border-bottom-color: var(--blue); }

.nav-cta {
  background: var(--blue);
  color: #fff !important;
  padding: 0.85rem 1.5rem;
  border-radius: 0;
  font-weight: 700;
  border-bottom: 0 !important;
  min-height: 52px;
  display: inline-flex;
  align-items: center;
}

.nav-cta:hover { background: var(--blue-deep); }

.nav-toggle {
  display: none;
  margin-left: auto;
  background: none;
  border: 0;
  font: inherit;
  font-size: 1.8rem;
  line-height: 1;
  padding: 0.5rem;
  cursor: pointer;
  color: var(--navy);
}

/* ---------- Hero ---------- */

.hero-full {
  position: relative;
  min-height: 72vh;
  display: flex;
  align-items: flex-end;
  background: var(--navy);
  overflow: hidden;
}

.hero-full img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.45;
}

.hero-copy {
  position: relative;
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 var(--gut) 4rem;
  width: 100%;
  color: #fff;
}

.hero-copy h1 {
  font-size: clamp(2.1rem, 6vw, 3.3rem);
  line-height: 1.45;
  margin: 0 0 1.2rem;
  font-weight: 700;
}

.hero-copy p {
  margin: 0 0 2rem;
  font-size: clamp(1.1rem, 2.2vw, 1.3rem);
  max-width: 30rem;
  color: rgba(255, 255, 255, 0.95);
  line-height: 1.9;
}

.hero-kicker {
  display: inline-block;
  font-size: 1rem;
  letter-spacing: 0.2em;
  font-weight: 700;
  color: var(--sheet, #fffdf9);
  margin-bottom: 1rem;
}

/* ---------- 區塊通用 ---------- */

.sec { padding: 4.5rem 0; }

.sec-alt { background: var(--surface); }

.sec-head { margin-bottom: 2.4rem; }

.sec-head .en {
  display: block;
  font-size: 0.95rem;
  letter-spacing: 0.2em;
  font-weight: 700;
  color: var(--blue);
  margin-bottom: 0.4rem;
}

.sec-head h2 {
  font-size: clamp(1.6rem, 4vw, 2.2rem);
  line-height: 1.6;
  margin: 0;
  font-weight: 700;
  color: var(--navy);
}

.lede { color: var(--muted); max-width: 40rem; margin: 0 0 2rem; }

/* ---------- 卡片格線 ---------- */

.grid { display: grid; gap: 1.2rem; }

.grid-3 { grid-template-columns: repeat(3, 1fr); }

.grid-2 { grid-template-columns: repeat(2, 1fr); }

.tile {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.8rem 1.7rem;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.sec-alt .tile { background: var(--bg); }

.tile:hover { border-color: var(--blue); box-shadow: 0 4px 18px rgba(0, 50, 73, 0.08); }

.tile h3 {
  margin: 0 0 0.4rem;
  font-size: 1.3rem;
  font-weight: 700;
  line-height: 1.6;
  color: var(--navy);
}

.tile .hook {
  color: var(--blue);
  font-size: 1.05rem;
  font-weight: 700;
  margin: 0 0 0.6rem;
  line-height: 1.7;
}

.tile p { margin: 0; color: var(--muted); font-size: 1.05rem; line-height: 1.9; }

.tile .more {
  display: inline-block;
  margin-top: 1rem;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--blue);
}

/* ---------- 編號段落 ---------- */

.numbered { border-top: 2px solid var(--line); }

.num-item {
  display: grid;
  grid-template-columns: 5rem 1fr;
  gap: 1.5rem;
  padding: 2.2rem 0;
  border-bottom: 1px solid var(--line);
}

.num-item .n {
  font-size: 2rem;
  font-weight: 700;
  color: var(--blue);
  line-height: 1.2;
}

.num-item h3 { margin: 0 0 0.3rem; font-size: 1.35rem; font-weight: 700; color: var(--navy); }

.num-item .cap { color: var(--blue); font-size: 1.05rem; margin: 0 0 0.8rem; font-weight: 500; }

.num-item p { margin: 0 0 0.7rem; color: var(--muted); }

/* ---------- 條列清單（資歷用） ---------- */

.facts { list-style: none; margin: 0; padding: 0; }

.facts li {
  position: relative;
  padding: 0.55rem 0 0.55rem 1.6rem;
  border-bottom: 1px solid var(--line);
  font-size: 1.1rem;
  line-height: 1.85;
}

.facts li:last-child { border-bottom: 0; }

.facts li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 1.05rem;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--blue);
}

.facts .year {
  display: inline-block;
  min-width: 3.6rem;
  font-weight: 700;
  color: var(--blue);
}

/* ---------- 流程 ---------- */

.steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.2rem; }

.step {
  background: var(--surface);
  border-top: 4px solid var(--blue);
  padding: 1.6rem 1.4rem;
}

.sec-alt .step { background: var(--bg); }

.step .n { font-size: 1rem; font-weight: 700; color: var(--blue); letter-spacing: 0.1em; }

.step h3 { margin: 0.3rem 0 0.5rem; font-size: 1.2rem; font-weight: 700; color: var(--navy); }

.step p { margin: 0; font-size: 1.05rem; color: var(--muted); line-height: 1.85; }

/* ---------- 跑馬燈標語 ---------- */

.marquee {
  background: var(--navy);
  color: #fff;
  overflow: hidden;
  padding: 1.2rem 0;
  white-space: nowrap;
}

.marquee span {
  display: inline-block;
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: 0.22em;
  padding-right: 3rem;
  animation: slide 26s linear infinite;
}

@keyframes slide {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

@media (prefers-reduced-motion: reduce) {
  .marquee span { animation: none; }
}

/* ---------- 門診 / 據點 ---------- */

.clinic {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.9rem;
}

.sec-alt .clinic { background: var(--bg); }

.clinic h3 { margin: 0 0 0.3rem; font-size: 1.35rem; font-weight: 700; color: var(--navy); }

.clinic .tag {
  display: inline-block;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--blue);
  background: var(--blue-wash);
  padding: 0.25rem 0.8rem;
  border-radius: 0;
  margin-bottom: 0.9rem;
}

.clinic dl { margin: 1rem 0 0; font-size: 1.05rem; }

.clinic dl div { display: flex; gap: 1rem; padding: 0.45rem 0; }

.clinic dt { flex: 0 0 5.5rem; color: var(--navy); font-weight: 700; }

.clinic dd { margin: 0; color: var(--muted); }

/* ---------- 醫師卡 ---------- */

.doc-hero {
  display: grid;
  grid-template-columns: 1fr 1.6fr;
  gap: 2.5rem;
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 2.2rem;
}

.doc-hero .name { font-size: 2rem; font-weight: 700; color: var(--navy); margin: 0 0 0.3rem; }

.doc-hero .en-name { font-size: 1.05rem; color: var(--blue); font-weight: 700; margin: 0 0 1.2rem; }

.doc-photo {
  background: var(--blue-wash);
  border-radius: var(--radius);
  aspect-ratio: 3 / 4;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--blue);
  font-weight: 700;
  text-align: center;
  padding: 1rem;
}

/* ---------- 待填標記 ---------- */

.todo {
  display: inline-block;
  background: transparent;
  border: 1px dashed var(--hair-strong, #b9b2a3);
  color: var(--ink-50, #6f767d);
  font-size: 1rem;
  padding: 0.15rem 0.6rem;
  border-radius: 4px;
}

/* ---------- 按鈕 ---------- */

.btn {
  display: inline-block;
  background: var(--blue);
  color: #fff;
  font-weight: 700;
  font-size: 1.15rem;
  padding: 0.95rem 2rem;
  border-radius: 0;
  min-height: 52px;
}

.btn:hover { background: var(--blue-deep); }

.btn-ghost { background: transparent; color: var(--blue); border: 2px solid var(--blue); }

.btn-ghost:hover { background: var(--blue); color: #fff; }

/* ---------- 頁尾 ---------- */

.foot {
  background: var(--navy);
  color: rgba(255, 255, 255, 0.85);
  padding: 3.5rem 0 2.5rem;
  font-size: 1.05rem;
}

.foot a { color: rgba(255, 255, 255, 0.85); }

.foot a:hover { color: #fff; text-decoration: underline; }

.foot-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 2.2rem; }

.foot h4 { color: #fff; font-size: 1rem; letter-spacing: 0.16em; margin: 0 0 1rem; font-weight: 700; }

.foot ul { list-style: none; margin: 0; padding: 0; }

.foot li { margin-bottom: 0.7rem; }

.foot-bottom {
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.2);
  font-size: 1rem;
  color: rgba(255, 255, 255, 0.7);
  line-height: 1.9;
}

/* ---------- 響應式 ---------- */

@media (max-width: 980px) {
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .steps { grid-template-columns: repeat(2, 1fr); }
  .foot-grid { grid-template-columns: 1fr 1fr; }
  .doc-hero { grid-template-columns: 1fr; }
  .doc-photo { max-width: 15rem; aspect-ratio: 1; }
}

@media (max-width: 760px) {
  .nav-links { display: none; }
  .nav-links.open {
    display: flex;
    position: absolute;
    top: 76px;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    background: var(--surface);
    border-bottom: 1px solid var(--line);
    padding: 0.5rem 1.5rem 1.2rem;
  }
  .nav-links.open a { padding: 0.9rem 0; border-bottom: 1px solid var(--line); }
  .nav-links.open .nav-cta { text-align: center; margin-top: 0.8rem; }
  .nav-toggle { display: block; }
  .sec { padding: 3rem 0; }
  .grid-3, .grid-2, .steps { grid-template-columns: 1fr; }
  .num-item { grid-template-columns: 1fr; gap: 0.4rem; }
  .foot-grid { grid-template-columns: 1fr; }
  .hero-full { min-height: 60vh; }
  .clinic dl div { display: block; }
  .clinic dt { margin-bottom: 0.1rem; }
}

/* ============================================================
   下拉式導覽選單
   ============================================================ */

.nav-list {
  display: flex;
  align-items: center;
  gap: 0.2rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-item { position: relative; }

.nav-item > a,
.nav-top {
  display: block;
  font: inherit;
  font-size: 1.02rem;
  font-weight: 500;
  color: var(--navy);
  background: none;
  border: 0;
  padding: 1.6rem 0.75rem;
  cursor: pointer;
  white-space: nowrap;
  border-bottom: 3px solid transparent;
}

.nav-item > a:hover,
.nav-top:hover,
.nav-item.open .nav-top {
  color: var(--blue);
  border-bottom-color: var(--blue);
}

.caret { font-size: 0.8rem; margin-left: 0.25rem; }

.nav-item.has-menu > .nav-top-link { display: none; }

.dropdown {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 15rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 10px 30px rgba(0, 50, 73, 0.14);
  padding: 0.6rem 0;
  list-style: none;
  margin: 0;
  z-index: 60;
}

.nav-item.has-menu:hover > .dropdown,
.nav-item.open > .dropdown { display: block; }

.dropdown li { margin: 0; }

.dropdown a {
  display: block;
  padding: 0.7rem 1.3rem;
  font-size: 1.05rem;
  color: var(--navy);
  line-height: 1.6;
}

.dropdown a:hover { background: var(--blue-wash); color: var(--blue); }

.dropdown a.sub {
  padding-left: 2.6rem;
  font-size: 1rem;
  color: var(--muted);
  position: relative;
}

.dropdown a.sub::before {
  content: "–";
  position: absolute;
  left: 1.7rem;
  color: var(--blue);
}

/* 治療方式：兩欄大面板 */

.dropdown-wide { min-width: 34rem; right: 0; left: auto; padding: 1.2rem 0.8rem; }

.nav-item.has-menu:hover > .dropdown-wide,
.nav-item.open > .dropdown-wide { display: flex; gap: 1rem; }

.dd-col { flex: 1; min-width: 15rem; }

.dd-head {
  display: block;
  padding: 0.4rem 1rem 0.6rem;
  font-weight: 700;
  color: var(--blue);
  font-size: 1.05rem;
  border-bottom: 2px solid var(--line);
  margin-bottom: 0.4rem;
}

.dd-col ul { list-style: none; margin: 0; padding: 0; }

.dd-col a { padding: 0.55rem 1rem; font-size: 1rem; }

/* 內頁標題區 */

.page-head { padding: 3rem 0 0; }

.page-head h1 { font-size: clamp(1.9rem, 5vw, 2.6rem); color: var(--navy); margin: 0.3rem 0 0.4rem; }

.crumb { color: var(--blue); font-weight: 700; font-size: 1.05rem; }

.crumb-path { color: var(--muted); font-size: 1.05rem; margin: 0; }

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.8rem;
  margin-bottom: 1.2rem;
}

.panel h3 {
  margin: 0 0 1rem;
  font-size: 1.35rem;
  color: var(--navy);
  font-weight: 700;
  padding-bottom: 0.7rem;
  border-bottom: 3px solid var(--blue);
  display: inline-block;
}

/* 手機版：改為可展開的層級選單 */

@media (max-width: 980px) {
  .nav-item > a, .nav-top { padding: 1.6rem 0.5rem; font-size: 0.98rem; }
  .dropdown-wide { min-width: 30rem; }
}

@media (max-width: 1180px) {
  .nav-links { display: none; }

  .nav-links.open {
    display: block;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    max-height: calc(100vh - 76px);
    overflow-y: auto;
    background: var(--surface);
    border-bottom: 1px solid var(--line);
    box-shadow: 0 12px 24px rgba(0, 50, 73, 0.12);
    padding: 0.5rem 1.2rem 1.5rem;
  }

  .nav-list { flex-direction: column; align-items: stretch; gap: 0; }

  .nav-item { border-bottom: 1px solid var(--line); }

  .nav-item.has-menu { display: flex; flex-wrap: wrap; align-items: center; }

  .nav-item > a, .nav-top { padding: 1rem 0; border-bottom: 0; font-size: 1.15rem; }

  .nav-top { display: none; }

  .nav-item.has-menu > .nav-top-link { display: block; flex: 1; }

  .nav-item.has-menu .nav-top {
    display: block;
    flex: 0 0 3.5rem;
    text-align: center;
    font-size: 1.5rem;
    padding: 0.8rem 0;
  }

  .nav-item.has-menu .nav-top .caret { margin: 0; font-size: 1.1rem; }

  .dropdown, .dropdown-wide {
    position: static;
    width: 100%;
    flex-basis: 100%;
    box-shadow: none;
    border: 0;
    border-top: 1px solid var(--line);
    border-radius: 0;
    background: var(--bg);
    padding: 0.4rem 0;
    min-width: 0;
  }

  .nav-item.has-menu:hover > .dropdown { display: none; }

  .nav-item.open > .dropdown { display: block; }

  .nav-item.open > .dropdown-wide { display: block; }

  .dd-col { min-width: 0; margin-bottom: 0.8rem; }

  .nav-cta { display: block; text-align: center; margin-top: 1.2rem; }
}

/* ============================================================
   互動式人體疼痛部位圖
   ============================================================ */

.bodymap-wrap {
  display: grid;
  grid-template-columns: minmax(260px, 360px) 1fr;
  gap: 2.5rem;
  align-items: start;
}

.bodymap {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.5rem 1rem;
  position: sticky;
  top: 96px;
}

.sec-alt .bodymap { background: var(--bg); }

.bodymap svg { width: 100%; height: auto; display: block; }

.bodymap .hint {
  text-align: center;
  color: var(--muted);
  font-size: 1.05rem;
  margin: 0.8rem 0 0;
}

/* 被選中的部位卡片會亮起來 */

.pain-card { scroll-margin-top: 100px; }

.pain-card:target {
  border-color: var(--vermilion, #b8402b);
  outline: 2px solid var(--vermilion, #b8402b);
  outline-offset: -2px;
}

.pain-card:target h3::after {
  content: "　← 你選的部位";
  color: var(--vermilion, #b8402b);
  font-size: 1rem;
  font-weight: 500;
}

@media (max-width: 860px) {
  .bodymap-wrap { grid-template-columns: 1fr; gap: 1.5rem; }
  .bodymap { position: static; max-width: 22rem; margin: 0 auto; }
}

/* ---------- 內頁表格（老花眼友善：字大、列高、可橫向捲動） ---------- */

.table-wrap { overflow-x: auto; margin: 1.2rem 0; -webkit-overflow-scrolling: touch; }

.tbl {
  width: 100%;
  border-collapse: collapse;
  font-size: 1.05rem;
  min-width: 34rem;
}

.tbl th, .tbl td {
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--line);
  text-align: left;
  line-height: 1.7;
  vertical-align: top;
}

.tbl thead th {
  background: var(--blue-wash);
  color: var(--navy);
  font-weight: 700;
  border-bottom: 2px solid var(--blue);
  white-space: nowrap;
}

.tbl tbody th { font-weight: 700; color: var(--navy); white-space: nowrap; }

.tbl tr:last-child td, .tbl tr:last-child th { border-bottom: 0; }

.table-hint { font-size: 1rem; color: var(--muted); margin: 0.4rem 0 0; }

/* 重點提示框 */

.callout {
  border-left: 5px solid var(--blue);
  background: var(--blue-wash);
  padding: 1.2rem 1.4rem;
  border-radius: 0 var(--radius) var(--radius) 0;
  margin: 1.5rem 0;
}

.callout.warn { border-left-color: var(--ink); background: var(--paper-2, #e9e5db); }

.callout p:last-child { margin-bottom: 0; }

.callout .t { font-weight: 700; color: var(--navy); margin: 0 0 0.4rem; font-size: 1.1rem; }

/* 治療流程步驟（直式） */

.flow { list-style: none; margin: 1rem 0 0; padding: 0; counter-reset: flow; }

.flow li {
  position: relative;
  padding: 0 0 1.6rem 3.6rem;
  border-left: 2px solid var(--line);
  margin-left: 1.2rem;
}

.flow li:last-child { border-left-color: transparent; padding-bottom: 0; }

.flow li::before {
  counter-increment: flow;
  content: counter(flow);
  position: absolute;
  left: -1.25rem;
  top: -0.2rem;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  background: var(--blue);
  color: #fff;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

.flow h4 { margin: 0 0 0.3rem; font-size: 1.2rem; color: var(--navy); font-weight: 700; }

.flow .when { color: var(--blue); font-size: 1rem; font-weight: 700; margin: 0 0 0.3rem; }

.flow p { margin: 0; color: var(--muted); font-size: 1.05rem; }

/* 參考文獻 */

.reflist { font-size: 1rem; color: var(--muted); line-height: 1.8; padding-left: 1.4rem; }

.reflist li { margin-bottom: 0.5rem; }

/* 風險與副作用區塊（法遵必備，樣式同 .panel） */
.risk {
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 5px solid var(--ink);
  border-radius: var(--radius);
  padding: 1.8rem;
  margin-bottom: 1.2rem;
}
.risk h3 {
  margin: 0 0 1rem;
  font-size: 1.35rem;
  color: var(--navy);
  font-weight: 700;
  padding-bottom: 0.7rem;
  border-bottom: 3px solid var(--ink);
  display: inline-block;
}

/* 法規性質的補充說明：語氣要比正文弱，但不能弱到讓人略過。
   用在「這不是核准適應症」這類必須講、但不是主軸的澄清。 */
.risk .note,
.panel .note {
  margin: 0.8rem 0 0;
  padding: 0.85rem 1rem;
  border-left: 2px solid var(--line);
  background: rgba(0, 0, 0, 0.02);
  font-size: 1rem;
  line-height: 1.85;
  color: var(--muted);
}
@media (prefers-color-scheme: dark) {
  .risk .note,
  .panel .note { background: rgba(255, 255, 255, 0.04); }
}

/* 補充（法遵）：醫療法 §86-7 核釋第 6 目要求「完整揭示」風險，
   所以標題要一眼認得出來，而且不能只在療程頁生效。
   療程頁的區塊標題是 h3（沿用章節編號），文章模板是 h2 —— 兩種都要吃到。 */
.risk > :is(h2, h3):first-child::before {
  content: "⚠ ";
  opacity: 0.8;
}
.risk > h2:first-child {
  margin: 0 0 1rem;
  font-size: 1.35rem;
  color: var(--navy);
  font-weight: 700;
  padding-bottom: 0.7rem;
  border-bottom: 3px solid var(--ink);
  display: inline-block;
}

/* 模板用 h3 當「適應症／禁忌症／副作用」的子標題，
   不能吃到上面那個大標題樣式（會變成一堆底線大字）。 */
.risk h3:not(:first-child) {
  margin: 1.4rem 0 0.4rem;
  font-size: 1.08rem;
  font-weight: 700;
  color: var(--navy);
  padding-bottom: 0;
  border-bottom: 0;
  display: block;
}

.risk ul { margin: 0.3rem 0 0; }

/* ------------------------------------------------------------
   手機版邊界修正
   design.css 第 903 行為 .bodymap-wrap 設定了兩欄且無手機斷點，
   載入順序在後會蓋掉單欄設定，導致 375px 時內容寬度 448px 破框。
   這裡用雙類別選擇器提高權重修正，不改動 design.css。
   ------------------------------------------------------------ */

@media (max-width: 860px) {
  .bodymap-wrap.bodymap-wrap {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .bodymap-wrap.bodymap-wrap .bodymap {
    position: static;
    max-width: 22rem;
    margin-left: auto;
    margin-right: auto;
  }

  .bodymap-wrap.bodymap-wrap svg { max-width: 100%; }
}

/* 疼痛部位卡片格線（人體互動圖移除後的版面） */
.pain-grid { display: grid; gap: 1rem; }
.pain-grid > .grid { display: grid; gap: 1rem; }

@media (min-width: 760px) {
  .pain-grid > .grid { grid-template-columns: repeat(2, 1fr); }
}

/* ============================================================
   疼痛部位按鈕：人物素描圖當背景，整張卡片可點
   圖片：assets/figure-sketch.png（課本手繪風格人物）
   每張卡片用 background-position 放大到對應的身體部位
   ============================================================ */

.pain-grid > .grid { gap: 1px; background: var(--hair); }

.pain-btn {
  position: relative;
  display: block;
  background: var(--sheet);
  padding: 2rem 11rem 2rem 2rem;   /* 右側留給人物圖 */
  min-height: 13rem;
  text-decoration: none;
  color: inherit;
  overflow: hidden;
  transition: background 0.15s ease;
}

.pain-btn:hover { background: var(--paper); }

.pain-btn h3 {
  margin: 0 0 0.4rem;
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.5;
}

.pain-btn .hook {
  color: var(--indigo);
  font-size: 1.05rem;
  font-weight: 500;
  margin: 0 0 1.2rem;
  line-height: 1.7;
}

.pain-btn .go {
  font-size: 1rem;
  font-weight: 700;
  color: var(--indigo);
}

/* 人物素描圖：放在右側，依部位放大定位 */

.pain-btn .figure {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 10rem;
  background-image: url("/assets/figure-sketch.png");
  background-repeat: no-repeat;
  background-size: 190% auto;
  background-position: 50% var(--y, 50%);
  opacity: 0.75;
  pointer-events: none;
}

.pain-btn:hover .figure { opacity: 1; }

/* 紅點標記該部位 */

.pain-btn .figure::after {
  content: "";
  position: absolute;
  left: 50%;
  top: var(--y, 50%);
  width: 16px;
  height: 16px;
  margin: -8px 0 0 -8px;
  border-radius: 50%;
  background: var(--vermilion);
  box-shadow: 0 0 0 6px rgba(184, 64, 43, 0.22);
}

/* 各部位的位置：同一個 --y 同時驅動取景與紅點，兩者才會對齊 */
.pain-btn[data-part="myofascial"] { --y: 22%; }
.pain-btn[data-part="shoulder"]   { --y: 27%; }
.pain-btn[data-part="back"]       { --y: 44%; }
.pain-btn[data-part="hip"]        { --y: 53%; }
.pain-btn[data-part="knee"]       { --y: 80%; }
.pain-btn[data-part="foot"]       { --y: 96%; }

@media (max-width: 560px) {
  .pain-btn { padding: 1.6rem 7.5rem 1.6rem 1.4rem; min-height: 11rem; }
  .pain-btn .figure { width: 7rem; background-size: 210% auto; }
  .pain-btn h3 { font-size: 1.2rem; }
}

/* ============================================================
   留白與密度：加大區塊間距，內文收窄到易讀寬度
   ============================================================ */

.sec { padding: var(--s7, 6.5rem) 0; }

.panel { padding: var(--s4, 2rem) var(--s4, 2rem) calc(var(--s4, 2rem) + 0.5rem); margin-bottom: var(--s3, 1.5rem); }

.panel > p, .panel > ul, .risk > p, .risk > ul { max-width: 36em; }

.panel h3 { margin-bottom: var(--s3, 1.5rem); }

.lede { max-width: 32em; line-height: 2.05; }

.tile p, .step p { max-width: 34em; }

.facts li { padding-top: 0.7rem; padding-bottom: 0.7rem; }

.flow li { padding-bottom: var(--s4, 2rem); }

.sec-head { margin-bottom: var(--s5, 3rem); }

@media (max-width: 760px) {
  .sec { padding: var(--s6, 4.5rem) 0; }
}

/* ============================================================
   Hero：明亮的醫病互動插畫。
   圖本身是淺色調，因此改用「紙色漸層 + 墨色文字」，
   不壓深色遮罩，才不會把插畫的溫度吃掉。
   ============================================================ */

.hero-full {
  background: var(--paper, #f2efe8);
  min-height: 60vh;
}

.hero-full img.hero-warm {
  opacity: 1;
  filter: saturate(1.02) contrast(1.02);
  object-position: 72% 38%;
}

/* 文字側鋪紙色漸層，保留右側插畫 */
.hero-full::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(
    to right,
    rgba(242, 239, 232, 0.97) 0%,
    rgba(242, 239, 232, 0.86) 30%,
    rgba(242, 239, 232, 0.35) 55%,
    rgba(242, 239, 232, 0) 72%);
}

.hero-copy { position: relative; z-index: 2; }

.hero-copy h1 { color: var(--ink, #16191c); }

.hero-act .btn-light {
  background: transparent;
  color: var(--indigo, #003249) !important;
  border: 2px solid var(--indigo, #003249);
}

.hero-act .btn-light:hover { background: var(--indigo, #003249); color: #fff !important; }

@media (max-width: 760px) {
  .hero-full { min-height: 68vh; }
  .hero-full img.hero-warm { object-position: 68% 30%; }
  .hero-full::after {
    background: linear-gradient(
      to top,
      rgba(242, 239, 232, 0.97) 0%,
      rgba(242, 239, 232, 0.9) 42%,
      rgba(242, 239, 232, 0.3) 78%,
      rgba(242, 239, 232, 0) 100%);
  }
}

/* ============================================================
   頁眉：左側插圖頭像 ＋ 醫師姓名（不用英文）
   右側預約按鈕加大、與視窗邊緣保持距離
   ============================================================ */

.nav-in { gap: 1rem; padding-left: max(1.5rem, env(safe-area-inset-left)); padding-right: 1.5rem; }

.logo { flex-direction: row; align-items: center; gap: 0.75rem; }

.logo-mark {
  width: 34px;
  height: 34px;
  color: var(--indigo, #003249);
  flex: 0 0 auto;
  display: block;
}

.logo-text { display: flex; flex-direction: column; line-height: 1.3; }

.logo-text b { font-size: 1.2rem; font-weight: 700; color: var(--ink); letter-spacing: 0.02em; }

.logo-text i {
  font-style: normal;
  font-size: 0.95rem;
  color: var(--ink-50, #6f767d);
  font-weight: 500;
}

/* 預約按鈕：實墨底、方角、留白足夠，不貼邊 */

.nav-cta {
  background: var(--indigo, #003249) !important;
  color: #fff !important;
  padding: 0.9rem 1.8rem !important;
  margin-left: 0.75rem;
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  border: 0 !important;
  min-height: 52px;
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
}

.nav-cta:hover { background: var(--ink) !important; }

/* Hero：只有一句標語，字放大，留白拉開 */

.hero-copy h1 {
  font-size: clamp(2.6rem, 8vw, 4.6rem);
  line-height: 1.2;
  margin: 0 0 2.5rem;
  letter-spacing: 0.04em;
}

.hero-act { gap: 1rem; }

.hero-act .btn { font-size: 1.1rem; padding: 1.05rem 2.2rem; }

@media (max-width: 560px) {
  .logo-text b { font-size: 1.05rem; }
  .logo-text i { font-size: 0.85rem; }
  .logo-mark { width: 30px; height: 30px; }
  .nav-in { padding-right: 1rem; }
}

/* ============================================================
   1181–1460px：9 個主項目＋頭像標誌＋預約按鈕的臨界區間
   壓縮字級與內距，確保按鈕不會被推到邊界外
   ============================================================ */

@media (min-width: 1181px) and (max-width: 1460px) {
  .nav-item > a, .nav-top { padding: 1.5rem 0.42rem; font-size: 0.95rem; }
  .nav-list { gap: 0; }
  .nav-links { gap: 0.5rem; }
  .nav-cta { padding: 0.8rem 1.2rem !important; font-size: 0.98rem; margin-left: 0.4rem; }
  .logo-text b { font-size: 1.05rem; }
  .logo-text i { font-size: 0.85rem; }
  .logo-mark { width: 30px; height: 30px; }
  .caret { margin-left: 0.15rem; font-size: 0.7rem; }
}

/* 任何寬度都不讓導覽列溢出 */
.nav, .nav-in { max-width: 100%; }
.nav-links { min-width: 0; }

/* ============================================================
   門診頁：院所配色（福瑞＝靛藍／台大＝青）、當月日曆、據點卡
   顏色不單獨承載資訊，一律同時有文字標示（色盲友善）
   ============================================================ */

:root { --c-fulrei: #003249; --c-ntuh: #0f5a26; }   /* 深靛 vs 飽和深綠：白字對比 11.6:1 與 8.3:1 */

/* 色標 */
.legend { display: flex; flex-wrap: wrap; gap: 1.5rem; margin: 0 0 2rem; font-size: 1.05rem; }
.legend-item { display: inline-flex; align-items: center; gap: 0.5rem; font-weight: 500; }
.swatch { width: 18px; height: 18px; display: inline-block; }
.sw-f { background: var(--c-fulrei); }
.sw-n { background: var(--c-ntuh); }
.sw-off { background: transparent; border: 1px solid var(--hair-strong, #b9b2a3); }

/* 院所標籤 */
.pill {
  display: inline-block;
  padding: 0.3rem 0.7rem;
  font-size: 1.05rem;
  font-weight: 700;
  color: #fff;
  white-space: nowrap;
  letter-spacing: 0.04em;
}
.pill.c-f { background: var(--c-fulrei); }
.pill.c-n { background: var(--c-ntuh); }
.sched .wk { font-size: 0.95rem; color: var(--ink-50, #6f767d); margin-left: 0.3rem; }
.sched .off, .cal .c-off { color: var(--ink-30, #a7aeb4); }
.sched th .t-when { display: block; font-size: 0.95rem; color: var(--ink-50, #6f767d); font-weight: 400; }
.sched { table-layout: fixed; width: 100%; min-width: 44rem; }
.sched th, .sched td { text-align: center; vertical-align: top; padding: 1rem 0.35rem; }
.sched tbody tr { border-bottom: 2px solid var(--hair, #d9d3c7); }
.sched tbody tr:nth-child(even) td, .sched tbody tr:nth-child(even) th { background: rgba(0, 50, 73, 0.035); }
.sched tbody th { vertical-align: top; }
.sched td > .pill:first-child { margin-top: 0; }
.sched .row-label { display: block; font-size: 1.15rem; font-weight: 700; }
.sched thead th:first-child, .sched tbody th:first-child { width: 8.5rem; }
.sched thead th:not(:first-child) { width: calc((100% - 8.5rem) / 7); }
.sched tbody th { text-align: left; white-space: nowrap; }
.sched tbody th .t-when { white-space: nowrap; }

/* 當月日曆 */
.cal { margin: 1.5rem 0 0.5rem; }

.cal-head, .cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); }

.cal-head { gap: 1px; margin-bottom: 1px; }
.cal-head div {
  text-align: center;
  padding: 0.6rem 0;
  font-weight: 700;
  font-size: 1.05rem;
  background: var(--paper-2, #e9e5db);
  color: var(--ink);
}

.cal-grid { gap: 1px; background: var(--hair, #d9d3c7); }

.cal-cell {
  background: var(--sheet, #fff);
  min-height: 6.4rem;
  padding: 0.5rem 0.45rem;
}

.cal-out { background: var(--paper, #f2efe8); min-height: 6.4rem; }

.cal-d { font-size: 1.15rem; font-weight: 700; color: var(--ink); }

.cal-wk {
  float: right;
  font-size: 0.9rem;
  color: var(--ink-30, #a7aeb4);
}

.cal-chips { display: flex; flex-direction: column; gap: 3px; margin-top: 0.35rem; }

.cal-chips .chip {
  font-size: 0.85rem;
  font-weight: 700;
  padding: 0.1rem 0.3rem;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cal-chips .c-f { background: var(--c-fulrei); }
.cal-chips .c-n { background: var(--c-ntuh); }
.cal-chips .c-off {
  background: transparent;
  color: var(--ink-30, #a7aeb4);
  font-weight: 400;
  border: 1px dashed var(--hair, #d9d3c7);
}

/* 三個時段固定三列，早對早、午對午、晚對晚 */
.cal-chips { display: grid; grid-template-rows: repeat(3, 1.7rem); align-content: start; }
.cal-chips .chip { display: flex; align-items: center; justify-content: flex-start; line-height: 1; }

/* 據點卡 */
.sec-h2 { font-size: clamp(1.5rem, 3.6vw, 2rem); color: var(--ink); margin: 3rem 0 1.5rem; font-weight: 700; }

.loc {
  background: var(--sheet, #fff);
  border: 1px solid var(--hair, #d9d3c7);
  border-top: 5px solid var(--c-fulrei);
  padding: 1.9rem;
  display: flex;
  flex-direction: column;
}
.loc-n { border-top-color: var(--c-ntuh); }

.loc { padding: 0; overflow: hidden; }

.loc-top {
  position: relative;
  background-size: cover;
  background-position: center;
  padding: 2.6rem 1.9rem 1.8rem;
  min-height: 10.5rem;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  isolation: isolate;
}

.loc-top::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(to top, rgba(0, 50, 73, 0.92) 0%, rgba(0, 50, 73, 0.68) 60%, rgba(0, 50, 73, 0.45) 100%);
}

.loc-n .loc-top::before {
  background: linear-gradient(to top, rgba(15, 90, 38, 0.92) 0%, rgba(15, 90, 38, 0.68) 60%, rgba(15, 90, 38, 0.45) 100%);
}

.loc-body { padding: 1.8rem 1.9rem 1.9rem; display: flex; flex-direction: column; flex: 1 1 auto; }

.loc h3 { margin: 0; font-size: 1.55rem; font-weight: 700; color: #fff; letter-spacing: 0.02em; }
.loc-kind { margin: 0.35rem 0 0; font-size: 1.02rem; color: rgba(255, 255, 255, 0.88); letter-spacing: 0.1em; }

.loc dl { margin: 0 0 1.5rem; font-size: 1.05rem; flex: 1 1 auto; }
.loc dl div { display: flex; gap: 1rem; padding: 0.45rem 0; }
.loc dt { flex: 0 0 5.5rem; color: var(--ink); font-weight: 700; }
.loc dd { margin: 0; color: var(--ink-70, #4a5158); }

/* 三個按鈕水平對齊、等高 */
.loc-act { display: flex; flex-wrap: wrap; gap: 0.6rem; align-items: stretch; }
.loc-act .btn {
  flex: 1 1 auto;
  text-align: center;
  justify-content: center;
  font-size: 1.12rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  padding: 1rem 1.1rem;
  min-height: 58px;
  display: inline-flex;
  align-items: center;
}
.loc-f .loc-act .btn:not(.btn-ghost) { background: var(--c-fulrei); }
.loc-n .loc-act .btn:not(.btn-ghost) { background: var(--c-ntuh); }
.loc-n .loc-act .btn-ghost { color: var(--c-ntuh); border-color: var(--c-ntuh); }
.loc-n .loc-act .btn-ghost:hover { background: var(--c-ntuh); color: #fff; }

@media (max-width: 720px) {
  .cal-cell, .cal-out { min-height: 4.6rem; padding: 0.35rem 0.25rem; }
  .cal-d { font-size: 1rem; }
  .cal-wk { display: none; }
  .cal-chips .chip { font-size: 0.7rem; padding: 0.05rem 0.2rem; }
  .cal-head div { font-size: 0.95rem; padding: 0.45rem 0; }
  .loc-act .btn { flex: 1 1 100%; }
}

/* ------------------------------------------------------------
   班表格子：院所標籤置於固定欄位，單／雙標記靠右緣
   讓台大與福瑞的標籤上下對齊在同一條垂直線上
   ------------------------------------------------------------ */

.sched .slot {
  display: grid;
  grid-template-columns: 1fr 1.3rem;
  align-items: center;
  gap: 0.35rem;
}

.sched .slot + .slot { margin-top: 0.4rem; }

.sched .slot .pill,
.sched .slot .pill-off {
  justify-self: stretch;
  text-align: center;
}

.sched .pill-off {
  display: block;
  padding: 0.3rem 0.7rem;
  font-size: 1.05rem;
  color: var(--ink-30, #a7aeb4);
  border: 1px dashed var(--hair, #d9d3c7);
}

.sched .slot .wk {
  justify-self: end;
  margin: 0;
  font-size: 0.92rem;
  color: var(--ink-50, #6f767d);
}

/* Hero 副標：淺底用墨色，寬度控制在插畫左側的留白內 */
.hero-copy .hero-sub {
  color: var(--ink-70, #4a5158) !important;
  font-size: clamp(1.05rem, 2.1vw, 1.35rem);
  line-height: 1.85;
  max-width: 22em;
  margin: 0 0 2.2rem;
  letter-spacing: 0.02em;
}

@media (max-width: 560px) {
  .hero-copy .hero-sub br { display: none; }
  .hero-copy .hero-sub { font-size: 1.05rem; }
}

/* ------------------------------------------------------------
   手機版 Hero：取景往左移，讓醫師的臉落在畫面右側，
   標題不會壓在臉上
   ------------------------------------------------------------ */

@media (max-width: 760px) {
  .hero-full img.hero-warm { object-position: 54% 24%; }
}

/* ------------------------------------------------------------
   按鈕字級整體放大（長輩易讀、觸控目標更明確）
   ------------------------------------------------------------ */

.btn { font-size: 1.25rem; padding: 1.05rem 2.1rem; min-height: 58px; }

.hero-act .btn { font-size: 1.3rem; padding: 1.15rem 2.4rem; min-height: 64px; }

.nav-cta { font-size: 1.12rem !important; }

.loc-act .btn { font-size: 1.2rem; min-height: 62px; }

.tile .more, .pain-btn .go { font-size: 1.12rem; }

@media (max-width: 560px) {
  .btn { font-size: 1.15rem; padding: 0.95rem 1.6rem; }
  .hero-act .btn { font-size: 1.2rem; padding: 1.05rem 1.8rem; }
  .loc-act .btn { font-size: 1.12rem; }
}
