/* 從小心臟到大心臟｜版面樣式（白底藍色調） */

:root {
  --bg: #f6f9fe;
  --surface: #ffffff;
  --text: #1d2b4f;
  --muted: #5d6b88;
  --border: #dfe8f5;
  --border-hover: #c3d6f4;
  --accent: #2f6fd6;
  --accent-strong: #1f56b3;
  --accent-soft: #eaf2fe;
  --heart: #ef8a78;
  --highlight: #fddcd2;
  --footer-bg: #eaf1fb;
  --shadow: 0 1px 2px rgb(29 43 79 / 6%), 0 8px 24px rgb(47 111 214 / 8%);
  --shadow-hover: 0 4px 10px rgb(29 43 79 / 8%), 0 18px 40px rgb(47 111 214 / 16%);
  --radius: 16px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang TC", "Noto Sans TC", "Microsoft JhengHei", "Heiti TC", sans-serif;
  --font-serif: "Noto Serif TC", "Songti TC", "Source Han Serif TC", "PMingLiU", serif;
  color-scheme: light;
}

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.7;
  /* 很長的英文字或網址也會換行，不會把版面撐破 */
  overflow-wrap: anywhere;
}

/* 標題換行時平均分配，避免最後一行只剩一個字 */
h1,
h2,
h3,
blockquote {
  text-wrap: balance;
}

p,
li {
  text-wrap: pretty;
}

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

a {
  color: var(--accent);
  text-underline-offset: 0.18em;
}

a:hover {
  color: var(--accent-strong);
}

:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
}

[hidden] {
  display: none !important;
}

.wrap {
  width: min(100% - 2.5rem, 68rem);
  margin-inline: auto;
}

.wrap-narrow {
  /* 中文每行約 30～34 字最好讀 */
  width: min(100% - 2.5rem, 38rem);
  margin-inline: auto;
}

.icon {
  width: 1.25em;
  height: 1.25em;
  flex: none;
}

.icon-inline {
  width: 1.05em;
  height: 1.05em;
  vertical-align: -0.18em;
}

.post-meta time,
.post-meta .views,
.post-meta .author,
.card-meta time,
.card-meta .views {
  white-space: nowrap;
}

.dot {
  color: var(--muted);
  opacity: 0.6;
  margin-inline: 0.35rem;
}

.badge {
  display: inline-block;
  padding: 0.12rem 0.65rem;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-decoration: none;
}

a.badge:hover {
  background: var(--accent);
  color: #fff;
}

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

.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.site-header-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.25rem 0.75rem;
  padding-block: 0.8rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text);
  font-weight: 700;
  font-size: 1.1rem;
  text-decoration: none;
  letter-spacing: 0.03em;
}

.brand:hover {
  color: var(--accent-strong);
}

.brand-logo {
  width: 1.7rem;
  height: 1.7rem;
}

.brand-by {
  color: var(--muted);
  font-size: 0.9rem;
}

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

.hero {
  position: relative;
  display: flex;
  align-items: center;
  /* 比插畫原本的 3:1 高一點，插畫會放大並往右移，左邊留給標題 */
  min-height: clamp(22rem, 38vw, 44rem);
  overflow: hidden;
  background: #eef5fe;
}

.hero-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 25% 50%;
}

/* 左側加一層淡淡的白，讓標題在任何寬度都清楚 */
.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgb(246 249 254 / 88%) 0%, rgb(246 249 254 / 60%) 30%, rgb(246 249 254 / 0%) 52%);
  pointer-events: none;
}

.hero-text {
  position: relative;
  z-index: 1;
  /* 跟原本 banner 一樣，從畫面左側約 6% 的位置開始 */
  padding: 3rem max(1.25rem, 6vw) 4.5rem;
}

.hero-title {
  margin: 0;
  color: var(--text);
  font-family: var(--font-serif);
  font-size: clamp(2rem, 3.2vw, 3.6rem);
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: 0.06em;
}

.hero-title span {
  display: inline-block;
}

.hero-title::after {
  content: "";
  display: block;
  width: min(100%, 11em);
  height: 2px;
  margin-top: 0.35em;
  background: linear-gradient(90deg, #b9d0f3, rgb(185 208 243 / 0%));
}

.hero-tagline {
  margin: 0.5em 0 0;
  color: var(--text);
  font-family: var(--font-serif);
  font-size: clamp(1.3rem, 2.1vw, 2.2rem);
  font-weight: 700;
  line-height: 1.4;
  letter-spacing: 0.05em;
}

.hero-heart {
  display: inline-block;
  width: 0.95em;
  height: 0.95em;
  margin-left: 0.2em;
  vertical-align: -0.12em;
  fill: none;
  stroke: var(--heart);
  stroke-width: 2.6;
  stroke-linejoin: round;
}

/* ---------- 分類按鈕與搜尋 ---------- */

.explore {
  position: relative;
  z-index: 2;
  margin-top: -3rem;
  padding: 1.25rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 22px;
  box-shadow: var(--shadow);
}

.cat-nav {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 6.4rem), 1fr));
  gap: 0.75rem;
}

.cat-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.15rem;
  padding: 1rem 0.5rem 0.85rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  text-align: center;
  text-decoration: none;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease, background-color 0.18s ease;
}

.cat-btn:hover {
  color: var(--text);
  transform: translateY(-4px);
  border-color: var(--border-hover);
  box-shadow: var(--shadow-hover);
}

.cat-icon {
  display: grid;
  place-items: center;
  width: 3rem;
  height: 3rem;
  margin-bottom: 0.35rem;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
  transition: background-color 0.18s ease, color 0.18s ease;
}

.cat-icon .icon {
  width: 1.55rem;
  height: 1.55rem;
}

.cat-name {
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: 0.04em;
}

.cat-count {
  color: var(--muted);
  font-size: 0.78rem;
}

.cat-btn.is-active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.cat-btn.is-active .cat-icon {
  background: rgb(255 255 255 / 20%);
  color: #fff;
}

.cat-btn.is-active .cat-count {
  color: rgb(255 255 255 / 85%);
}

.search {
  position: relative;
  margin-top: 1rem;
}

.search-icon {
  position: absolute;
  top: 50%;
  left: 1.15rem;
  transform: translateY(-50%);
  color: var(--muted);
  pointer-events: none;
}

.search input {
  width: 100%;
  height: 3.25rem;
  padding: 0 1.25rem 0 3.1rem;
  background: #f8fbff;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text);
  font: inherit;
  font-size: 1rem;
  transition: box-shadow 0.18s ease, border-color 0.18s ease, background-color 0.18s ease;
}

.search input::placeholder {
  color: #8a97b2;
}

.search input:hover {
  border-color: var(--border-hover);
  box-shadow: var(--shadow);
}

.search input:focus {
  outline: none;
  background: var(--surface);
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgb(47 111 214 / 15%), var(--shadow-hover);
}

/* ---------- 文章卡片 ---------- */

.posts {
  padding-block: 2.5rem 3.5rem;
}

.posts-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.25rem 1rem;
  margin-bottom: 1.25rem;
}

.section-title {
  margin: 0;
  font-size: 1.4rem;
  letter-spacing: 0.04em;
}

.results {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.clear-filter {
  margin-left: 0.6rem;
  padding: 0;
  background: none;
  border: 0;
  color: var(--accent);
  font: inherit;
  text-decoration: underline;
  text-underline-offset: 0.18em;
  cursor: pointer;
}

.cards {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 19rem), 1fr));
  gap: 1.5rem;
}

.card {
  min-width: 0;
}

.card-link {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  color: inherit;
  text-decoration: none;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.card-link:hover {
  color: inherit;
  transform: translateY(-4px);
  border-color: var(--border-hover);
  box-shadow: var(--shadow-hover);
}

.card-img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.card-link:hover .card-img {
  transform: scale(1.03);
}

.card-body {
  display: flex;
  flex-direction: column;
  flex: 1;
  padding: 1rem 1.2rem 1.15rem;
}

.card-cat {
  margin: 0 0 0.45rem;
}

.card-title {
  margin: 0 0 0.4rem;
  font-size: 1.18rem;
  line-height: 1.45;
}

.card-link:hover .card-title {
  color: var(--accent-strong);
}

.card-desc {
  margin: 0 0 0.9rem;
  color: var(--muted);
  font-size: 0.95rem;
}

.card-meta {
  margin: auto 0 0;
  color: var(--muted);
  font-size: 0.82rem;
}

.empty {
  margin: 0;
  padding: 2.5rem 1rem;
  background: var(--surface);
  border: 1px dashed var(--border-hover);
  border-radius: var(--radius);
  color: var(--muted);
  text-align: center;
}

/* ---------- 手機版 HERO：文字在上、插畫在下 ---------- */

@media (max-width: 47.99rem) {
  .hero {
    flex-direction: column;
    align-items: stretch;
    min-height: 0;
    background: var(--bg);
  }

  .hero::after {
    display: none;
  }

  .hero-text {
    order: -1;
    padding: 1.75rem 1.25rem 1.25rem;
  }

  .hero-img {
    position: static;
    height: auto;
    aspect-ratio: 16 / 10;
    object-position: 70% 50%;
  }

  .explore {
    margin-top: 1.25rem;
    padding: 0.85rem;
  }

  .cat-nav {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.5rem;
  }

  .cat-btn {
    padding: 0.7rem 0.25rem 0.6rem;
    border-radius: 14px;
  }

  .cat-icon {
    width: 2.4rem;
    height: 2.4rem;
    margin-bottom: 0.2rem;
  }

  .cat-icon .icon {
    width: 1.3rem;
    height: 1.3rem;
  }

  .cat-name {
    font-size: 0.92rem;
    letter-spacing: 0;
  }

  .search {
    margin-top: 0.75rem;
  }
}

/* ---------- 文章頁 ---------- */

.post {
  padding-block: 1.75rem 3rem;
}

.post-hero {
  margin: 0 0 1.5rem;
}

.post-hero img {
  /* 等比例縮放，最寬就是文字區的寬度 */
  width: 100%;
  max-width: 100%;
  height: auto;
  border-radius: var(--radius);
}

.post-cat {
  margin: 0 0 0.6rem;
}

.post-title {
  margin: 0 0 0.75rem;
  font-size: clamp(1.75rem, 6vw, 2.4rem);
  line-height: 1.3;
  letter-spacing: 0.02em;
}

.post-meta {
  margin: 0 0 2.25rem;
  padding-bottom: 1.1rem;
  border-bottom: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.8;
}

.author {
  color: var(--text);
  font-weight: 600;
}

.author a {
  color: inherit;
  text-decoration-color: var(--border-hover);
  text-underline-offset: 0.2em;
}

.author a:hover {
  color: var(--accent-strong);
}

/* ---------- 文章內文排版 ---------- */

.prose {
  font-size: clamp(1.0625rem, 1rem + 0.35vw, 1.125rem);
  line-height: 1.95;
  letter-spacing: 0.02em;
}

.prose > :first-child {
  margin-top: 0;
}

/* 第一段當作導言，字大一點 */
.prose > p:first-child {
  font-size: 1.2em;
  font-weight: 600;
  line-height: 1.7;
}

.prose p,
.prose ul,
.prose ol {
  margin: 0 0 1.4em;
}

/* 段落小標題：左側藍色線條 */
.prose h2 {
  margin: 2.8em 0 1em;
  padding-left: 0.75rem;
  border-left: 4px solid var(--accent);
  font-size: 1.3em;
  line-height: 1.45;
  letter-spacing: 0.03em;
}

.prose h3 {
  margin: 2.2em 0 0.8em;
  font-size: 1.12em;
  line-height: 1.5;
}

.prose ul,
.prose ol {
  padding-left: 1.3em;
}

.prose li {
  padding-left: 0.2em;
}

.prose li + li {
  margin-top: 0.6em;
}

.prose li::marker {
  color: var(--accent);
}

/* 重點：螢光筆畫線效果 */
.prose strong {
  font-weight: 700;
  background: linear-gradient(transparent 58%, var(--highlight) 58%);
  padding: 0 0.1em;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}

/* 清單開頭的粗體（像「醫師可能覺得：」）改用藍字，不畫線 */
.prose li > strong:first-child {
  background: none;
  padding: 0;
  color: var(--accent-strong);
}

.prose img {
  margin: 1.5rem auto;
  border-radius: 10px;
}

/* 引言：用來凸顯一句關鍵的話 */
.prose blockquote {
  margin: 2em 0;
  padding: 1em 1.2em;
  background: var(--accent-soft);
  border-left: 4px solid var(--accent);
  border-radius: 0 12px 12px 0;
  font-size: 1.15em;
  font-weight: 700;
  line-height: 1.7;
}

.prose blockquote p:last-child,
.prose blockquote ul:last-child {
  margin-bottom: 0;
}

.prose blockquote strong {
  background: none;
  padding: 0;
}

/* 含清單的引言區塊 = 重點整理框 */
.prose blockquote:has(ul) {
  padding: 1.1em 1.3em 1.2em;
  background: var(--surface);
  border: 1px solid var(--border);
  border-top: 4px solid var(--accent);
  border-radius: 12px;
  box-shadow: var(--shadow);
  font-size: 0.95em;
  font-weight: 400;
  line-height: 1.8;
}

.prose blockquote:has(ul) > p:first-child {
  margin-bottom: 0.5em;
  color: var(--accent-strong);
  font-weight: 700;
  letter-spacing: 0.08em;
}

.prose blockquote:has(ul) li + li {
  margin-top: 0.35em;
}

/* 分隔線之後的文字 = 文末署名 */
.prose hr ~ p {
  color: var(--muted);
  font-size: 0.95em;
  text-align: right;
}

.prose code {
  font-size: 0.9em;
  padding: 0.1em 0.35em;
  background: var(--accent-soft);
  border-radius: 5px;
}

.prose pre {
  overflow-x: auto;
  padding: 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow-wrap: normal;
}

.prose pre code {
  padding: 0;
  background: none;
}

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

.prose table {
  border-collapse: collapse;
  min-width: 100%;
  font-size: 0.95rem;
  overflow-wrap: normal;
}

.prose th,
.prose td {
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--border);
  text-align: left;
}

.prose hr {
  margin: 3em 0 1.5em;
  border: 0;
  border-top: 1px solid var(--border);
}

.related {
  margin-top: 3rem;
}

.related h2 {
  margin: 0 0 0.9rem;
  font-size: 1.15rem;
}

.related ul {
  display: grid;
  gap: 0.6rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.related a {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.7rem;
  padding: 0.85rem 1.1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow);
  color: var(--text);
  font-weight: 600;
  line-height: 1.5;
  text-decoration: none;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.related a:hover {
  transform: translateY(-2px);
  border-color: var(--border-hover);
  box-shadow: var(--shadow-hover);
}

.post-nav {
  margin-top: 2.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border);
}

.not-found {
  padding-block: 4rem;
}

/* ---------- 共用：按鈕、晶片、螢幕閱讀器文字 ---------- */

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.7rem 1.25rem;
  border: 1px solid transparent;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.98rem;
  line-height: 1.3;
  text-decoration: none;
  transition: transform 0.18s ease, box-shadow 0.18s ease, background-color 0.18s ease;
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-hover);
}

.btn-primary {
  background: var(--accent);
  color: #fff;
}

.btn-primary:hover {
  background: var(--accent-strong);
  color: #fff;
}

.btn-secondary {
  background: var(--surface);
  border-color: var(--border-hover);
  color: var(--accent-strong);
}

.btn-secondary:hover {
  color: var(--accent-strong);
  border-color: var(--accent);
}

.btn-sm {
  padding: 0.45rem 0.95rem;
  font-size: 0.88rem;
}

.chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.chip-list li {
  padding: 0.3rem 0.85rem;
  background: var(--accent-soft);
  border-radius: 999px;
  color: var(--accent-strong);
  font-size: 0.9rem;
  font-weight: 600;
}

/* 頁首右側連結 */
.site-nav {
  margin-left: auto;
}

@media (max-width: 30rem) {
  .brand-by {
    display: none;
  }

  .site-nav a {
    padding-inline: 0.7rem;
  }
}

.site-nav a {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.4rem 0.9rem;
  border-radius: 999px;
  color: var(--accent-strong);
  font-weight: 700;
  font-size: 0.92rem;
  text-decoration: none;
  transition: background-color 0.18s ease;
}

.site-nav a:hover,
.site-nav a[aria-current="page"] {
  background: var(--accent-soft);
}

/* ---------- 診療服務頁 ---------- */

.svc-hero {
  padding-block: 2.5rem;
  background: linear-gradient(180deg, #eaf2fe 0%, var(--bg) 100%);
}

.svc-hero-inner {
  display: flex;
  align-items: center;
  gap: 2.5rem;
}

.svc-photo {
  width: 16rem;
  flex: none;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  border: 6px solid var(--surface);
  border-radius: 24px;
  box-shadow: var(--shadow-hover);
}

.svc-eyebrow {
  margin: 0 0 0.3rem;
  color: var(--accent);
  font-weight: 700;
  letter-spacing: 0.12em;
}

.svc-name {
  margin: 0 0 0.75rem;
  font-family: var(--font-serif);
  font-size: clamp(2rem, 4vw, 2.8rem);
  line-height: 1.25;
  letter-spacing: 0.05em;
}

.svc-name-en {
  display: block;
  margin-top: 0.2rem;
  color: var(--muted);
  font-family: var(--font);
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.svc-positions {
  margin: 0 0 1rem;
  padding: 0;
  list-style: none;
  font-weight: 600;
}

.svc-positions li::before {
  content: "";
  display: inline-block;
  width: 0.45rem;
  height: 0.45rem;
  margin-right: 0.55rem;
  border-radius: 50%;
  background: var(--heart);
  vertical-align: 0.15em;
}

.svc-intro {
  max-width: 34rem;
  margin: 0 0 1.4rem;
  color: var(--muted);
}

.svc-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.svc-toc {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-block: 0.5rem 0.5rem;
}

.svc-toc a {
  padding: 0.4rem 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text);
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.svc-toc a:hover {
  transform: translateY(-2px);
  border-color: var(--border-hover);
  box-shadow: var(--shadow);
}

.svc-section {
  padding-block: 2rem 0.5rem;
  scroll-margin-top: 1rem;
}

.svc-section > h2 {
  margin: 0 0 1.1rem;
  padding-left: 0.75rem;
  border-left: 4px solid var(--accent);
  font-size: 1.45rem;
  letter-spacing: 0.04em;
}

.svc-section h3 {
  margin: 0 0 0.6rem;
  font-size: 1.08rem;
}

.schedule-card,
.research-card,
.cred-card,
.loc-card,
.spec-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.schedule-card {
  padding: 1.25rem;
}

.schedule {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  overflow-wrap: normal;
}

.schedule th,
.schedule td {
  padding: 0.8rem 0.9rem;
  border-bottom: 1px solid var(--border);
  text-align: center;
}

.schedule thead th {
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-size: 0.95rem;
}

.schedule thead th:first-child {
  border-radius: 10px 0 0 0;
}

.schedule thead th:last-child {
  border-radius: 0 10px 0 0;
}

.schedule tbody th {
  width: 5rem;
  font-weight: 700;
}

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

.slot {
  display: inline-block;
  padding: 0.35rem 0.8rem;
  border: 1px solid;
  border-radius: 10px;
  font-size: 0.92rem;
  font-weight: 700;
  white-space: nowrap;
}

.slot-linkou {
  background: #eaf2fe;
  border-color: #c3d6f4;
  color: #1f56b3;
}

.slot-taipei {
  background: #e6f6f1;
  border-color: #bfe6d8;
  color: #0f6e56;
}

.slot-echo {
  background: #fdeeea;
  border-color: #f6cfc4;
  color: #a8432f;
}

.slot-empty {
  color: #b5c1d6;
}

.schedule-notes {
  margin: 1rem 0 0.5rem;
  padding-left: 1.2rem;
  color: var(--muted);
  font-size: 0.9rem;
}

.schedule-updated {
  margin: 0;
  color: var(--muted);
  font-size: 0.85rem;
}

.loc-grid,
.cred-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 20rem), 1fr));
  gap: 1rem;
}

.loc-card {
  display: flex;
  gap: 1rem;
  padding: 1.25rem;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.loc-card:hover,
.spec-card:hover {
  transform: translateY(-4px);
  border-color: var(--border-hover);
  box-shadow: var(--shadow-hover);
}

.loc-icon,
.spec-icon {
  display: grid;
  place-items: center;
  flex: none;
  width: 2.8rem;
  height: 2.8rem;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
}

.loc-icon .icon,
.spec-icon .icon {
  width: 1.45rem;
  height: 1.45rem;
}

.loc-body h3 {
  margin: 0.2rem 0 0.1rem;
  font-size: 1.15rem;
}

.loc-detail,
.loc-address,
.loc-sessions {
  margin: 0 0 0.2rem;
  color: var(--muted);
  font-size: 0.95rem;
}

.loc-sessions strong {
  color: var(--text);
}

.loc-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0.8rem 0 0;
}

.spec-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 17rem), 1fr));
  gap: 1rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.spec-card {
  padding: 1.2rem 1.25rem;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.spec-card h3 {
  margin: 0.8rem 0 0.35rem;
}

.spec-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.94rem;
}

.career-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 19rem), 1fr));
  gap: 1rem 2rem;
  margin-bottom: 1rem;
}

.timeline {
  margin: 0;
  padding: 0 0 0 1.1rem;
  border-left: 2px solid var(--border-hover);
  list-style: none;
}

.timeline li {
  position: relative;
  padding: 0 0 1rem 0.4rem;
}

.timeline li::before {
  content: "";
  position: absolute;
  top: 0.5rem;
  left: -1.55rem;
  width: 0.75rem;
  height: 0.75rem;
  border: 2px solid var(--accent);
  border-radius: 50%;
  background: var(--surface);
}

.tl-period {
  display: block;
  color: var(--accent);
  font-size: 0.85rem;
  font-weight: 700;
}

.tl-body {
  display: block;
}

.cred-card,
.research-card {
  padding: 1.2rem 1.25rem;
}

.cred-card h3 {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.research-card h3:not(:first-child) {
  margin-top: 1.4rem;
}

.pub-list {
  margin: 0;
  padding-left: 1.3rem;
  font-size: 0.95rem;
}

.pub-list li + li {
  margin-top: 0.6rem;
}

.pub-list a {
  white-space: nowrap;
}

.svc-cta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  padding-block: 2.5rem 3.5rem;
}

.svc-cta p {
  margin: 0 0.5rem 0 0;
  font-weight: 700;
}

@media (max-width: 47.99rem) {
  .svc-hero {
    padding-block: 1.75rem;
  }

  .svc-hero-inner {
    flex-direction: column;
    align-items: flex-start;
    gap: 1.25rem;
  }

  .svc-photo {
    width: 9.5rem;
    border-width: 4px;
    border-radius: 18px;
  }

  .svc-actions .btn {
    flex: 1 1 100%;
    justify-content: center;
  }

  .schedule-card {
    padding: 0.85rem;
  }

  .schedule th,
  .schedule td {
    padding: 0.65rem 0.4rem;
  }

  .schedule tbody th {
    width: 3.5rem;
  }

  .slot {
    padding: 0.3rem 0.5rem;
    font-size: 0.85rem;
    white-space: normal;
  }
}

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

.site-footer {
  padding-block: 2.25rem 2.5rem;
  background: var(--footer-bg);
  border-top: 1px solid var(--border);
  color: var(--text);
  font-size: 0.88rem;
}

.footer-title {
  margin: 0 0 0.4rem;
  font-weight: 700;
  font-size: 1rem;
}

.footer-title a {
  color: var(--text);
  text-decoration: none;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 1.1rem;
  margin: 0 0 0.9rem;
}

.footer-links a {
  color: var(--accent-strong);
}

.disclaimer,
.copyright {
  margin: 0 0 1rem;
  color: var(--muted);
}

.credits h2 {
  margin: 1.25rem 0 0.35rem;
  font-size: 0.88rem;
}

.credits ul {
  margin: 0 0 1.25rem;
  padding-left: 1.2rem;
  color: var(--muted);
}

.copyright {
  margin-bottom: 0;
}

@media (prefers-reduced-motion: reduce) {
  .card-link,
  .card-img,
  .cat-btn,
  .btn,
  .loc-card,
  .spec-card,
  .svc-toc a,
  .related a {
    transition: none;
  }

  .card-link:hover,
  .cat-btn:hover,
  .btn:hover,
  .loc-card:hover,
  .spec-card:hover,
  .svc-toc a:hover,
  .related a:hover {
    transform: none;
  }

  .card-link:hover .card-img {
    transform: none;
  }
}

/* ---------- 動態細節：換頁淡入淡出、捲到才出現的圖表、跑動數字、回到頂部 ---------- */

/* 換頁：支援的瀏覽器用原生頁面轉場（整頁交叉淡化） */
@media (prefers-reduced-motion: no-preference) {
  @view-transition {
    navigation: auto;
  }

  html {
    scroll-behavior: smooth;
  }

  /* 不支援原生轉場的瀏覽器：載入時淡入，點連結時淡出（motion.js） */
  .no-vt body {
    animation: page-in 0.35s ease backwards;
  }

  .no-vt.page-leaving body {
    opacity: 0;
    transition: opacity 0.18s ease;
  }
}

::view-transition-old(root),
::view-transition-new(root) {
  animation-duration: 0.3s;
  animation-timing-function: ease;
}

@keyframes page-in {
  from {
    opacity: 0;
  }
}

/* 捲到才出現（motion.js 只替還沒進入畫面的元素加上 .reveal） */
.reveal {
  transition: opacity 0.7s ease, transform 0.7s cubic-bezier(0.2, 0.7, 0.2, 1);
}

.reveal:not(.is-visible) {
  opacity: 0;
  transform: translateY(24px);
}

.table-wrap.reveal tr {
  transition: opacity 0.5s ease, transform 0.5s ease;
  transition-delay: calc(var(--i, 0) * 70ms + 150ms);
}

.table-wrap.reveal:not(.is-visible) tr {
  opacity: 0;
  transform: translateY(10px);
}

/* 長條圖：```chart 區塊 */
.prose .chart {
  margin: 2em 0;
  padding: 1.2rem 1.3rem 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: var(--shadow);
  font-size: 0.95rem;
  letter-spacing: 0;
}

.chart-title {
  margin: 0 0 1rem;
  font-weight: 700;
  font-size: 1rem;
  line-height: 1.5;
  text-wrap: balance;
}

.prose .chart-bars {
  display: grid;
  gap: 0.75rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.prose .chart-row {
  display: grid;
  grid-template-columns: 4.5em minmax(0, 1fr) 3.6em;
  align-items: center;
  gap: 0.75rem;
  margin: 0;
  padding: 0;
}

.chart-label {
  font-weight: 600;
  line-height: 1.4;
}

.chart-track {
  height: 0.95rem;
  overflow: hidden;
  background: #eef3fb;
  border-radius: 999px;
}

.chart-fill {
  display: block;
  width: var(--w);
  height: 100%;
  background: linear-gradient(90deg, #8db6f0, var(--accent));
  border-radius: inherit;
  transition: width 1.3s cubic-bezier(0.2, 0.7, 0.2, 1) 0.15s;
}

.chart.reveal:not(.is-visible) .chart-fill {
  width: 0;
}

.chart-value {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.chart-row.is-highlight .chart-fill {
  background: linear-gradient(90deg, #f6b3a5, #e0624c);
}

.chart-row.is-highlight .chart-label,
.chart-row.is-highlight .chart-value {
  color: #c2412d;
}

.prose .chart-source {
  margin: 0.9rem 0 0;
  color: var(--muted);
  font-size: 0.8rem;
}

/* 大數字：```stats 區塊 */
.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 11rem), 1fr));
  gap: 0.9rem;
  margin: 2em 0;
}

.stat {
  padding: 1.1rem 1.2rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-top: 4px solid var(--accent);
  border-radius: 14px;
  box-shadow: var(--shadow);
}

.prose .stat-num {
  margin: 0;
  color: var(--accent-strong);
  font-size: clamp(1.9rem, 5vw, 2.4rem);
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
  letter-spacing: 0;
}

.prose .stat-label {
  margin: 0.35rem 0 0;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.6;
}

[data-count] {
  font-variant-numeric: tabular-nums;
}

/* 回到頂部按鈕 */
.to-top {
  position: fixed;
  right: max(1rem, env(safe-area-inset-right));
  bottom: max(1.25rem, env(safe-area-inset-bottom));
  z-index: 50;
  display: grid;
  place-items: center;
  width: 3rem;
  height: 3rem;
  padding: 0;
  background: var(--accent);
  border: 0;
  border-radius: 50%;
  box-shadow: var(--shadow-hover);
  color: #fff;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transform: translateY(14px) scale(0.9);
  transition: opacity 0.25s ease, transform 0.25s ease, visibility 0s linear 0.25s, background-color 0.18s ease;
}

.to-top.is-shown {
  opacity: 1;
  visibility: visible;
  transform: none;
  transition: opacity 0.25s ease, transform 0.25s ease, visibility 0s, background-color 0.18s ease;
}

.to-top.is-shown:hover {
  background: var(--accent-strong);
  transform: translateY(-3px);
}

.to-top svg {
  width: 1.35rem;
  height: 1.35rem;
}

@media (prefers-reduced-motion: reduce) {
  .reveal,
  .table-wrap.reveal tr,
  .chart-fill,
  .to-top,
  .to-top.is-shown {
    transition: none;
  }
}