/* ==========================================================================
   葉鈺雯 個人品牌網站 — 樣式表
   設計原則：手機優先、任何元素都不破框、內容欄寬固定可讀
   ========================================================================== */

/* --- 品牌色票 -----------------------------------------------------------
   規則：整站只用三組顏色，不再新增第四個色相。
     1. 綠（主色）— 同一色系的深淺階，從 --brand-dk 到 --bg
     2. 金（點綴）— --accent，只用於強調，不當底色大面積使用
     3. 中性（文字與線）— --ink / --ink-soft / --ink-mute / --line

   需要區分不同項目時，用「同色系的深淺」或形狀（框線樣式、粗細），
   不要再引入新色相。原標準色中的藍 #739CB7、棕 #927C6A 已停用。
   ------------------------------------------------------------------------ */
:root {
  /* 1. 綠 — 主色，由深到淺 */
  --brand-dk:    #004C3E;   /* 最深 — 頁尾、Hero 底色 */
  --brand:       #006652;   /* 深綠 — 文字連結、按鈕 */
  --brand-soft:  #6AB98B;   /* 淺綠 — 標準色綠，線條與標示 */

  /* 2. 金 — 點綴 */
  --accent:      #D9AF54;   /* 標準色 金黃 — 標題點綴 */

  /* 3. 中性 — 帶一點綠味的灰，讓中性色也屬於同一家族 */
  --bg:        #F7FAF7;
  --bg-soft:   #EAF2EC;
  --card:      #FFFFFF;
  --ink:       #26332E;
  --ink-soft:  #4E5C56;
  --ink-mute:  #656E7A;   /* 標準色 灰 */
  --line:      #D8E6DC;

  --wrap:      1080px;   /* 版面最大寬 */
  --measure:   720px;    /* 內容文字區寬度（文章圖片不得超過此寬） */
  --radius:    14px;
  --shadow:    0 1px 2px rgba(0,72,58,.06), 0 8px 24px rgba(0,72,58,.07);

  --font: "PingFang TC", "Noto Sans TC", "Microsoft JhengHei",
          -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
          "Helvetica Neue", sans-serif;
}

/* --- 基礎重置：所有元素都不會撐破容器 --- */
*, *::before, *::after { box-sizing: border-box; }

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

body {
  margin: 0;
  /* 關鍵：避免任何子元素造成整頁橫向捲動 */
  overflow-x: hidden;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.85;
  letter-spacing: .01em;
  -webkit-font-smoothing: antialiased;
}

img, svg, video, canvas { max-width: 100%; height: auto; display: block; }

/* 中文長字串／英文網址都強制在框內換行 */
p, li, h1, h2, h3, h4, dd, dt, td, th, figcaption, blockquote, a {
  overflow-wrap: anywhere;
  word-break: break-word;
}

a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }

h1, h2, h3, h4 {
  line-height: 1.4;
  letter-spacing: .015em;
  margin: 0 0 .6em;
  font-weight: 700;
}

/* 字級一律用 clamp()，手機不會擠爆、桌機也不會過大 */
h1 { font-size: clamp(1.65rem, 5.2vw, 2.6rem); }
h2 { font-size: clamp(1.3rem,  3.6vw, 1.75rem); }
h3 { font-size: clamp(1.08rem, 2.8vw, 1.28rem); }

/* --- 版面容器 --- */
.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: 20px;
}
.measure { max-width: var(--measure); margin-inline: auto; }

section {
  padding-block: clamp(40px, 7vw, 72px);
  /* 錨點跳轉時不被固定導覽蓋住（手機版頁首較高，所以留多一點） */
  scroll-margin-top: 104px;
}
@media (min-width: 700px) { section { scroll-margin-top: 84px; } }
section.hero { padding-block: 0; }

.section-title {
  display: flex;
  align-items: baseline;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 1.4em;
}
.section-title .en {
  font-size: .74rem;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 600;
}

/* ==========================================================================
   頁首導覽
   ========================================================================== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(247,250,247,.90);
  backdrop-filter: saturate(150%) blur(10px);
  border-bottom: 1px solid var(--line);
}
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 60px;
  padding-block: 8px;
  flex-wrap: wrap;
}
.brand {
  display: flex;
  align-items: center;
  gap: 9px;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: .06em;
  flex-shrink: 0;
}
.brand .dot {
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--accent);
  flex-shrink: 0;
}
.nav-links {
  display: flex;
  gap: 6px clamp(10px, 3vw, 26px);
  flex-wrap: wrap;
  min-width: 0;              /* 允許收縮，否則連結會被切掉 */
  font-size: .93rem;
}
/* 窄螢幕：連結自己占滿一整行再換行，不跟品牌名擠同一列 */
@media (max-width: 860px) {
  .nav-links { flex: 1 0 100%; }
}
.nav-links a { color: var(--ink-soft); }
.nav-links a:hover { color: var(--brand); }

/* 手機版：導覽項目多，改成單行可橫向滑動，避免頁首折成三行吃掉半個螢幕 */
@media (max-width: 699px) {
  .nav-links {
    flex-wrap: nowrap;
    width: 100%;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding-bottom: 2px;
    font-size: .89rem;
  }
  .nav-links::-webkit-scrollbar { display: none; }
  .nav-links a { white-space: nowrap; }
}

/* ==========================================================================
   HERO 區
   ========================================================================== */
/* 版面策略：圖片鋪滿背景（絕對定位），文字走正常流排版。
   如此文字有多高、HERO 就有多高，任何螢幕寬度都不會被裁掉。 */
.hero {
  position: relative;
  overflow: hidden;                 /* 圖片絕不溢出 */
  background: var(--brand-dk);
  display: flex;
  align-items: flex-end;
  min-height: min(68vh, 520px);
}
.hero-media { position: absolute; inset: 0; z-index: 0; }
.hero-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  /* 採訪場景照：重心稍微偏上，讓品牌旗幟與人物都留在畫面裡 */
  object-position: center 33%;
}
.hero-media::after {                /* 讓文字在照片上仍可閱讀 */
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(180deg,
    rgba(0,45,36,.20) 0%, rgba(0,45,36,.50) 48%, rgba(0,45,36,.86) 100%);
}
.hero-copy {
  position: relative;
  z-index: 2;
  width: 100%;
  /* 上方留白避開授權標示 */
  padding-block: clamp(58px, 9vh, 120px) clamp(26px, 4vw, 52px);
  color: #fff;
}
/* 桌機把 HERO 拉高：cover 之下高度越高，照片被裁掉的部分越少，場景才看得完整 */
@media (min-width: 860px) { .hero { min-height: min(84vh, 780px); } }

/* 手機：照片完整呈現、完全不裁切，文字改排在圖片下方的深綠區塊。
   窄螢幕若沿用滿版裁切，人像會被放大到接近特寫——這裡改成「拉遠」的排法。 */
@media (max-width: 699px) {
  .hero { display: block; min-height: 0; }
  .hero-media { position: relative; inset: auto; }
  .hero-media img { height: auto; object-fit: contain; }
  .hero-media::after { display: none; }   /* 文字不疊在圖上，不需壓暗 */
  .hero-copy {
    padding-block: 26px 32px;
    background: var(--brand-dk);
  }
  .hero-copy h1 { text-shadow: none; }
}
.hero-copy .eyebrow {
  font-size: clamp(.68rem, 2.6vw, .78rem);
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 .5em;
  font-weight: 600;
}
.hero-copy h1 { color: #fff; margin-bottom: .35em; text-shadow: 0 2px 20px rgba(0,0,0,.25); }
.hero-copy p {
  margin: 0;
  max-width: 46ch;
  color: #E6F0E9;
  font-size: clamp(.95rem, 2.4vw, 1.08rem);
}
.hero-tags {
  display: flex; flex-wrap: wrap; gap: 8px;
  margin-top: 18px; padding: 0; list-style: none;
}
.hero-tags li {
  font-size: .8rem;
  padding: 5px 12px;
  border-radius: 999px;
  background: rgba(255,255,255,.16);
  border: 1px solid rgba(255,255,255,.28);
  color: #fff;
  backdrop-filter: blur(4px);
}
/* 圖片授權浮水印（footer 另有完整標示） */
.hero-credit {
  position: absolute;
  right: 10px; top: 10px;
  z-index: 3;
  margin: 0;
  font-size: .6rem;
  line-height: 1.5;
  color: rgba(255,255,255,.72);
  background: rgba(0,0,0,.26);
  padding: 2px 8px;
  border-radius: 999px;
  max-width: calc(100% - 20px);
}
.hero-credit a { color: rgba(255,255,255,.92); text-decoration: underline; }

/* ==========================================================================
   個人簡介 / 專長 / 經歷
   ========================================================================== */
.intro-grid {
  display: grid;
  gap: clamp(24px, 4vw, 44px);
  grid-template-columns: 1fr;
  align-items: start;
}
@media (min-width: 860px) {
  .intro-grid { grid-template-columns: 1.35fr .95fr; }
}
.lede { font-size: clamp(1.02rem, 2.5vw, 1.14rem); color: var(--ink-soft); }
.lede strong { color: var(--ink); font-weight: 700; }

/* ==========================================================================
   VITAL 五大健康支持方案
   五張並列的卡片，字母徽章用同色系深淺區分，不引入新色相
   ========================================================================== */
.vital-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: 1fr;
}
@media (min-width: 620px)  { .vital-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1000px) { .vital-grid { grid-template-columns: repeat(5, 1fr); } }

.vital {
  min-width: 0;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 20px 18px;
}
.vital__letter {
  display: grid;
  place-items: center;
  width: 34px; height: 34px;
  border-radius: 50%;
  margin-bottom: 12px;
  background: var(--brand);
  color: #fff;
  font-size: 1rem;
  font-weight: 700;
  line-height: 1;
}
/* 同一綠色系的深淺 + 金色點綴，不新增色相 */
.vital:nth-child(2) .vital__letter { background: var(--brand-dk); }
.vital:nth-child(3) .vital__letter { background: var(--accent); color: #4A3A0E; }
.vital:nth-child(4) .vital__letter { background: var(--brand-soft); color: #10382A; }
.vital:nth-child(5) .vital__letter { background: var(--ink-mute); }

.vital h4 { margin: 0 0 .2em; font-size: 1rem; line-height: 1.45; }
.vital__en {
  margin: 0 0 .9em;
  font-size: .74rem;
  line-height: 1.5;
  color: var(--ink-mute);
  letter-spacing: .01em;
}
.vital ul {
  margin: 0;
  padding-left: 1.1em;
  font-size: .85rem;
  line-height: 1.7;
  color: var(--ink-soft);
}
.vital li { margin-bottom: .35em; }
.vital li:last-child { margin-bottom: 0; }

/* ==========================================================================
   採訪與媒體報導清單
   ========================================================================== */
.press-list { margin: 0; padding: 0; list-style: none; }
.press-list > li {
  padding: 20px 0;
  border-top: 1px solid var(--line);
}
.press-list > li:first-child { border-top: 0; padding-top: 0; }
.press__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 12px;
  margin: 0 0 .4em;
  font-size: .78rem;
  color: var(--ink-mute);
}
.press__outlet {
  font-weight: 700;
  color: var(--brand);
  letter-spacing: .04em;
}
.press-list h3 {
  margin: 0 0 .4em;
  font-size: clamp(1rem, 2.4vw, 1.1rem);
  line-height: 1.55;
}
.press-list h3 a { color: var(--ink); }
.press-list h3 a:hover { color: var(--brand); }
.press-list > li > p:last-child {
  margin: 0;
  max-width: var(--measure);
  font-size: .9rem;
  line-height: 1.75;
  color: var(--ink-soft);
}

/* 側欄人像：等比例縮放，不裁切 */
.portrait {
  margin: 0 0 18px;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  background: var(--bg-soft);
}
.portrait img { width: 100%; height: auto; display: block; }

.fact-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: clamp(20px, 3.5vw, 28px);
  box-shadow: var(--shadow);
}
.fact-card h3 { margin-bottom: .8em; font-size: 1.02rem; }
.fact-list { margin: 0; padding: 0; list-style: none; font-size: .93rem; }
.fact-list li {
  display: grid;
  grid-template-columns: 4.6em 1fr;
  gap: 10px;
  padding: 9px 0;
  border-top: 1px dashed var(--line);
  line-height: 1.65;
}
.fact-list li:first-child { border-top: 0; padding-top: 0; }
.fact-list .k { color: var(--ink-mute); font-size: .84rem; }

.skill-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: 1fr;
}
@media (min-width: 620px) { .skill-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 980px) { .skill-grid { grid-template-columns: repeat(3, 1fr); } }
.skill {
  background: var(--card);
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  border-radius: 10px;
  padding: 18px 20px;
}
/* 用品牌標準色輪流做左側色條 */
.skill:nth-child(3n+2) { border-left-color: var(--brand-soft); }
.skill:nth-child(3n+3) { border-left-color: var(--brand); }
.skill h3 { font-size: 1rem; margin-bottom: .35em; }
/* 卡片裡先一段說明、再接標籤列時的間距 */
.skill p + .tag-cloud { margin-top: 14px; }
/* 想特別凸顯的卡片 */
.skill--feature { border-left-width: 4px; border-left-color: var(--accent); background: var(--bg-soft); }
.skill p { margin: 0; font-size: .9rem; color: var(--ink-soft); line-height: 1.7; }

/* 經歷時間軸 */
.timeline { list-style: none; margin: 0; padding: 0 0 0 22px; position: relative; }
.timeline::before {
  content: "";
  position: absolute; left: 4px; top: 6px; bottom: 6px;
  width: 2px; background: var(--line);
}
.timeline li { position: relative; padding: 0 0 26px 4px; }
.timeline li::before {
  content: "";
  position: absolute; left: -22px; top: 9px;
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--bg); border: 2px solid var(--brand);
}
.timeline .yr {
  display: inline-block;
  font-size: .78rem; letter-spacing: .08em;
  color: var(--accent); font-weight: 700;
  margin-bottom: 2px;
}
.timeline .role { font-weight: 700; }
.timeline .org { color: var(--ink-soft); }
.timeline .desc { margin: 4px 0 0; font-size: .9rem; color: var(--ink-soft); }

.tag-cloud { display: flex; flex-wrap: wrap; gap: 8px; padding: 0; margin: 0; list-style: none; }
.tag-cloud li {
  font-size: .84rem;
  padding: 6px 13px;
  border-radius: 999px;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  color: var(--ink-soft);
}

.band { background: var(--bg-soft); }

/* ==========================================================================
   主張式段落（我看見的問題／立場說明）
   ========================================================================== */
.statement { max-width: var(--measure); }
.statement p {
  font-size: clamp(1.02rem, 2.6vw, 1.16rem);
  color: var(--ink-soft);
  margin: 0 0 1.15em;
}
.statement p:last-child { margin-bottom: 0; }
.statement strong { color: var(--ink); font-weight: 700; }
.statement .pull {
  font-size: clamp(1.18rem, 3.4vw, 1.55rem);
  font-weight: 700;
  line-height: 1.6;
  color: var(--brand-dk);
  border-left: 3px solid var(--accent);
  padding-left: 18px;
  margin: 0 0 1.15em;
}

/* 小節內的次級標題 */
.sub-head {
  margin: 2.6em 0 1em;
  padding-top: .9em;
  border-top: 1px solid var(--line);
  font-size: 1.05rem;
}

/* 註記（專利狀態說明等） */
.note {
  max-width: var(--measure);
  margin: 16px 0 0;
  font-size: .82rem;
  line-height: 1.7;
  color: var(--ink-mute);
}

/* ==========================================================================
   三個系統：判讀 → 行動 → 累積
   ========================================================================== */
.system-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: 1fr;
}
@media (min-width: 900px) { .system-grid { grid-template-columns: repeat(3, 1fr); } }

.system {
  display: flex;
  flex-direction: column;
  min-width: 0;
  background: var(--card);
  border: 1px solid var(--line);
  border-top: 3px solid var(--brand-soft);
  border-radius: var(--radius);
  padding: 22px 22px 20px;
  box-shadow: var(--shadow);
}
.system:nth-child(2) { border-top-color: var(--accent); }
.system:nth-child(3) { border-top-color: var(--brand); }

.system .step {
  margin: 0 0 .7em;
  font-size: .72rem;
  letter-spacing: .2em;
  font-weight: 700;
  color: var(--ink-mute);
}
.system h3 { margin-bottom: .15em; font-size: 1.14rem; }
.system .sub {
  margin: 0 0 1em;
  font-size: .82rem;
  color: var(--ink-mute);
  letter-spacing: .02em;
}
.system .ask {
  margin: 0 0 .7em;
  font-size: .95rem;
  font-weight: 600;
  color: var(--brand-dk);
}
.system .body {
  margin: 0 0 20px;
  font-size: .91rem;
  line-height: 1.75;
  color: var(--ink-soft);
}

/* 專利狀態標籤 */
.status {
  margin-top: auto;
  align-self: flex-start;
  max-width: 100%;
  padding: 6px 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--bg-soft);
  color: var(--ink-soft);
  font-size: .76rem;
  font-weight: 600;
  line-height: 1.5;
}
/* 三種狀態改用「同色系深淺 + 框線樣式」區分，不引入第四個色相 */
.status--granted { background: #E4F1E9; border-color: var(--brand-soft); color: var(--brand); }
.status--pending { background: #FAF2E0; border-color: var(--accent);     color: #7E5F12; }
.status--dev     { background: var(--bg-soft); border-style: dashed;
                   border-color: var(--brand-soft); color: var(--ink-soft); }

/* ==========================================================================
   合作立場（編號清單）
   ========================================================================== */
.stance {
  max-width: var(--measure);
  margin: 0 0 30px;
  padding: 0;
  list-style: none;
  counter-reset: stance;
}
.stance li {
  counter-increment: stance;
  position: relative;
  padding: 0 0 18px 52px;
  font-size: clamp(1rem, 2.5vw, 1.1rem);
  color: var(--ink);
  line-height: 1.8;
}
.stance li:last-child { padding-bottom: 0; }
.stance li::before {
  content: counter(stance, decimal-leading-zero);
  position: absolute;
  left: 0; top: .3em;
  padding: 2px 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--card);
  color: var(--accent);
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .06em;
  line-height: 1.5;
}
.stance strong { color: var(--brand-dk); }

/* ==========================================================================
   誠臻健康入口卡
   ========================================================================== */
.org-card {
  display: grid;
  gap: 22px;
  grid-template-columns: 1fr;
  background: var(--card);
  border: 1px solid var(--line);
  border-left: 3px solid var(--brand);
  border-radius: var(--radius);
  padding: clamp(22px, 4vw, 34px);
  box-shadow: var(--shadow);
}
@media (min-width: 820px) {
  .org-card { grid-template-columns: 1.35fr .8fr; align-items: center; }
}
.org-card h3 { margin-bottom: .45em; }
.org-card p {
  margin: 0 0 1em;
  font-size: .96rem;
  color: var(--ink-soft);
}
.org-card p:last-child { margin-bottom: 0; }
.org-actions { display: flex; flex-wrap: wrap; gap: 10px; }

/* ==========================================================================
   證照橫條（比 tag-cloud 更低調的並列呈現）
   ========================================================================== */
.cred-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  margin: 0; padding: 0;
  list-style: none;
  font-size: .89rem;
  color: var(--ink-soft);
}
.cred-strip li { display: flex; align-items: center; gap: 8px; }
.cred-strip li::before {
  content: "";
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--accent);
  flex-shrink: 0;
}

/* ==========================================================================
   文章卡片索引
   ========================================================================== */
.post-grid {
  display: grid;
  gap: 18px;
  grid-template-columns: 1fr;
  padding: 0; margin: 0; list-style: none;
}
@media (min-width: 700px)  { .post-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1000px) { .post-grid { grid-template-columns: repeat(3, 1fr); } }

.post-card {
  display: flex;
  flex-direction: column;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform .28s cubic-bezier(.22,1,.36,1),
              box-shadow .28s ease,
              border-color .28s ease;
  min-width: 0;                     /* grid 子項不被內容撐開 */
}
/* 滑鼠移入：輕微上浮 + 陰影加深 + 邊框轉品牌綠。
   :focus-within 讓鍵盤 Tab 到卡片內連結時也有同樣回饋 */
.post-card:hover,
.post-card:focus-within {
  transform: translateY(-6px);
  box-shadow: 0 2px 6px rgba(0,72,58,.08), 0 18px 40px rgba(0,72,58,.16);
  border-color: var(--brand-soft);
}
.post-card__thumb { aspect-ratio: 16 / 9; background: var(--bg-soft); overflow: hidden; }
.post-card__thumb img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform .45s cubic-bezier(.22,1,.36,1);
}
.post-card:hover .post-card__thumb img,
.post-card:focus-within .post-card__thumb img { transform: scale(1.045); }
.post-card:hover h3 a { color: var(--brand); }
.post-card h3 a { transition: color .2s ease; }
.post-card__body { padding: 18px 20px 20px; display: flex; flex-direction: column; flex: 1; }
.post-card__meta {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
  font-size: .76rem; color: var(--ink-mute); margin-bottom: 9px;
}
.post-card__meta .sep { color: var(--line); }
.post-card h3 { font-size: 1.06rem; margin-bottom: .45em; }
.post-card h3 a { color: var(--ink); }
.post-card p {
  margin: 0 0 16px;
  font-size: .9rem;
  color: var(--ink-soft);
  line-height: 1.75;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.post-card__foot {
  margin-top: auto;
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; flex-wrap: wrap;
  font-size: .78rem; color: var(--ink-mute);
  padding-top: 12px; border-top: 1px dashed var(--line);
}
.read-more { color: var(--brand); font-weight: 600; }

/* 瀏覽計數器 */
.views { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; }
.views svg { width: 14px; height: 14px; flex-shrink: 0; opacity: .7; }
.views[data-state="loading"] .views-num { opacity: .35; }

/* ==========================================================================
   文章內頁
   ========================================================================== */
.article { padding-block: clamp(28px, 5vw, 56px); }

.article-head { margin-bottom: 26px; }
.crumb { font-size: .82rem; color: var(--ink-mute); margin: 0 0 18px; }
.article-head h1 { margin-bottom: .5em; }

.byline {
  display: flex; align-items: center; flex-wrap: wrap;
  gap: 8px 14px;
  font-size: .85rem;
  color: var(--ink-soft);
  padding: 14px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.byline .author { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; color: var(--ink); }
.byline .avatar {
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--brand); color: #fff;
  display: grid; place-items: center;
  font-size: .8rem; font-weight: 700; flex-shrink: 0;
}
.byline .role { color: var(--ink-mute); font-weight: 400; }
.byline time { color: var(--ink-mute); }

/* 文章 HERO 圖：等比例縮放，寬度不超過內容文字區 */
.article-hero {
  margin: 26px auto 30px;
  max-width: var(--measure);
}
.article-hero img {
  width: 100%;
  height: auto;          /* 等比例，不裁切、不變形 */
  border-radius: var(--radius);
  border: 1px solid var(--line);
}
.article-hero figcaption {
  margin-top: 9px;
  font-size: .76rem;
  color: var(--ink-mute);
  line-height: 1.65;
}

/* 內文節奏：行距與段距都放寬，讓長文好讀。
   段距 1.9em 大於行距 2.05，段落之間才有明顯的呼吸空間 */
.prose { font-size: 1.03rem; line-height: 2.05; }
.prose h2 {
  margin-top: 2.6em;
  padding-top: .6em;
  border-top: 1px solid var(--line);
  line-height: 1.5;
}
.prose h3 { margin-top: 2.2em; line-height: 1.55; }
.prose h2 + p, .prose h3 + p { margin-top: .9em; }
.prose p  { margin: 0 0 1.9em; }
.prose ul, .prose ol { margin: 0 0 1.9em; padding-left: 1.35em; }
.prose li { margin-bottom: .75em; line-height: 1.95; }
.prose strong { color: var(--brand-dk); }
.prose blockquote {
  margin: 1.6em 0;
  padding: 4px 0 4px 20px;
  border-left: 3px solid var(--accent);
  color: var(--ink-soft);
  font-style: normal;
}
.prose hr { border: 0; border-top: 1px solid var(--line); margin: 2.4em 0; }
.prose code {
  background: var(--bg-soft);
  padding: 2px 6px; border-radius: 5px;
  font-size: .88em;
}
/* 寬內容自己橫向捲動，不讓整頁破框 */
.prose pre, .table-scroll {
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.prose pre { background: var(--bg-soft); padding: 14px 16px; border-radius: 10px; }
.prose table { border-collapse: collapse; width: 100%; font-size: .9rem; }
.prose th, .prose td { border: 1px solid var(--line); padding: 9px 12px; text-align: left; }
.prose th { background: var(--bg-soft); }

.callout {
  background: var(--card);
  border: 1px solid var(--line);
  border-left: 3px solid var(--brand);
  border-radius: 10px;
  padding: 18px 20px;
  margin: 1.8em 0;
}
.callout p:last-child { margin-bottom: 0; }
.callout .label {
  display: block;
  font-size: .76rem; letter-spacing: .14em; text-transform: uppercase;
  color: var(--accent); font-weight: 700; margin-bottom: .5em;
}

.article-foot {
  margin-top: 46px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
  display: flex; flex-wrap: wrap; gap: 14px;
  align-items: center; justify-content: space-between;
  font-size: .87rem;
}
.btn {
  display: inline-block;
  padding: 11px 22px;
  border-radius: 999px;
  background: var(--brand);
  color: #fff;
  font-size: .9rem; font-weight: 600;
  border: 1px solid var(--brand);
}
.btn:hover { background: var(--brand-dk); text-decoration: none; }
.btn--ghost { background: transparent; color: var(--brand); }
.btn--ghost:hover { background: var(--bg-soft); }

/* ==========================================================================
   頁尾
   ========================================================================== */
.site-footer {
  background: var(--brand-dk);
  color: #CFE0D6;
  padding-block: clamp(34px, 5vw, 52px);
  font-size: .87rem;
  line-height: 1.8;
}
.site-footer a { color: var(--accent); }
.footer-grid {
  display: grid;
  gap: 26px;
  grid-template-columns: 1fr;
}
@media (min-width: 760px) { .footer-grid { grid-template-columns: 1.1fr 1fr; } }
.site-footer h4 {
  color: #fff;
  font-size: .78rem; letter-spacing: .18em; text-transform: uppercase;
  margin: 0 0 .9em; font-weight: 600;
}
.site-footer p { margin: 0 0 .8em; }
.credit {
  font-size: .8rem;
  color: #A9C4B6;
  line-height: 1.75;
}
.footer-bottom {
  margin-top: 28px;
  padding-top: 18px;
  border-top: 1px solid rgba(255,255,255,.14);
  display: flex; flex-wrap: wrap; gap: 10px;
  justify-content: space-between;
  font-size: .78rem;
  color: #93B0A2;
}

/* ==========================================================================
   頁面切換：淡入淡出
   --------------------------------------------------------------------------
   支援 View Transitions 的瀏覽器（Chrome / Edge / Safari 18+）由瀏覽器
   直接接管跨頁轉場；不支援的瀏覽器走 @supports 的降級方案：
   載入時淡入，點站內連結時由 motion.js 加上 .is-leaving 淡出。
   ========================================================================== */
@view-transition { navigation: auto; }

::view-transition-old(root) { animation: page-fade-out .2s ease both; }
::view-transition-new(root) { animation: page-fade-in  .32s ease both; }

@keyframes page-fade-out { to   { opacity: 0; } }
@keyframes page-fade-in  { from { opacity: 0; transform: translateY(8px); } }

/* 降級方案：沒有 View Transitions 的瀏覽器 */
@supports not (view-transition-name: none) {
  body { animation: page-fade-in .32s ease both; }
  body.is-leaving { opacity: 0; transition: opacity .18s ease; }
}

/* ==========================================================================
   捲動進場與數據動畫
   --------------------------------------------------------------------------
   由 assets/motion.js 以 IntersectionObserver 加上 .is-in，捲到才播。
   用法：
     <div class="reveal">…</div>                          區塊淡入上浮
     <span data-countup="1500" data-suffix="+">0</span>    數字跑動
     長條圖見下方 .bar-chart 範例
   ========================================================================== */
.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity .7s ease, transform .7s cubic-bezier(.22,1,.36,1);
}
.reveal.is-in { opacity: 1; transform: none; }
/* 同一組內依序錯開，看起來像逐項出現 */
.reveal.is-in:nth-child(2) { transition-delay: .08s; }
.reveal.is-in:nth-child(3) { transition-delay: .16s; }
.reveal.is-in:nth-child(4) { transition-delay: .24s; }

/* --- 數字 --- */
.stat-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 16px;
  margin: 2em 0;
}
.stat {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px 22px;
  box-shadow: var(--shadow);
}
.stat__num {
  display: block;
  font-size: clamp(1.7rem, 5vw, 2.2rem);
  font-weight: 700;
  line-height: 1.15;
  color: var(--brand);
  font-variant-numeric: tabular-nums;   /* 跑動時寬度不會抖 */
}
.stat__num .unit { font-size: .5em; font-weight: 600; margin-left: 2px; }
.stat__label { display: block; margin-top: .5em; font-size: .85rem; color: var(--ink-mute); }

/* --- 長條圖 --- */
.bar-chart { margin: 2em 0; display: grid; gap: 18px; }
.bar-chart__row { display: grid; gap: 7px; }
.bar-chart__head {
  display: flex; justify-content: space-between; align-items: baseline; gap: 12px;
  font-size: .88rem; color: var(--ink-soft);
}
.bar-chart__value { font-weight: 700; color: var(--brand); font-variant-numeric: tabular-nums; }
.bar-chart__track {
  height: 12px;
  background: var(--bg-soft);
  border-radius: 999px;
  overflow: hidden;
}
.bar-chart__fill {
  height: 100%;
  width: 0;                                    /* 進場前一律 0，捲到才長 */
  border-radius: 999px;
  background: var(--brand);
  transition: width 1.1s cubic-bezier(.22,1,.36,1);
}
/* 同色系深淺輪替，不引入新色相 */
.bar-chart__row:nth-child(3n+2) .bar-chart__fill { background: var(--brand-soft); }
.bar-chart__row:nth-child(3n+3) .bar-chart__fill { background: var(--brand-dk); }
/* 想強調某一條時加 .bar-chart__row--key，用金色。
   多包一層 .bar-chart 是為了贏過上面 :nth-child 的權重 */
.bar-chart .bar-chart__row--key .bar-chart__fill { background: var(--accent); }
.bar-chart.is-in .bar-chart__fill { width: var(--pct, 0%); }

/* 關於我側欄的人像照 */
.portrait {
  margin: 0 0 clamp(16px, 2.5vw, 22px);
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}
.portrait img {
  width: 100%;
  aspect-ratio: 3 / 2;
  object-fit: cover;
  /* 人物偏右，裁切時把重心往右移才不會切到臉 */
  object-position: 62% center;
}

/* ==========================================================================
   分頁籤：內容多的區塊改成點擊切換，不必一路往下捲
   --------------------------------------------------------------------------
   無障礙：tablist / tab / tabpanel 三種角色齊全，左右方向鍵可切換。
   沒有 JavaScript 時所有面板都會展開，內容不會消失（見最下方 .no-js 規則）。
   ========================================================================== */
.tabs__list {
  display: flex;
  gap: 4px;
  overflow-x: auto;
  scrollbar-width: none;
  border-bottom: 1px solid var(--line);
  margin-bottom: clamp(22px, 3vw, 32px);
}
.tabs__list::-webkit-scrollbar { display: none; }

.tabs__tab {
  flex: none;
  padding: 12px 18px 13px;
  border: 0;
  border-bottom: 3px solid transparent;
  background: none;
  cursor: pointer;
  white-space: nowrap;
  font-family: inherit;
  font-size: .95rem;
  font-weight: 600;
  color: var(--ink-mute);
  transition: color .2s ease, border-color .2s ease, background .2s ease;
}
.tabs__tab:hover { color: var(--brand); background: rgba(0,102,82,.05); }
.tabs__tab[aria-selected="true"] {
  color: var(--brand);
  border-bottom-color: var(--accent);
}
.tabs__tab:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: -3px;
  border-radius: 6px 6px 0 0;
}

.tabs__panel:focus-visible { outline: 3px solid var(--accent); outline-offset: 6px; border-radius: 6px; }
.tabs__panel[hidden] { display: none; }
/* 切換時淡入，避免內容硬跳出來 */
.tabs__panel:not([hidden]) { animation: tab-in .3s ease both; }
@keyframes tab-in { from { opacity: 0; transform: translateY(6px); } }

/* ==========================================================================
   現場紀錄：照片與影片
   --------------------------------------------------------------------------
   影片用「封面 + 播放鍵」的假面（facade）：點擊前完全不載入 YouTube，
   頁面不會變慢，也不會在使用者還沒按播放前就被第三方追蹤。
   ========================================================================== */
.media-grid {
  display: grid;
  gap: clamp(18px, 3vw, 28px);
  grid-template-columns: 1fr;
}
@media (min-width: 760px) { .media-grid { grid-template-columns: repeat(2, 1fr); } }

.media-card {
  margin: 0;
  min-width: 0;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}
.media-card > img,
.media-card .video-facade { display: block; width: 100%; }
.media-card > img { aspect-ratio: 3 / 2; object-fit: cover; }

.media-card figcaption {
  padding: 16px 20px 18px;
  font-size: .88rem;
  line-height: 1.75;
  color: var(--ink-soft);
}
.media-card figcaption strong {
  display: block;
  margin-bottom: .25em;
  color: var(--ink);
  font-size: .96rem;
}

/* --- 影片假面 --- */
.video-facade {
  position: relative;
  padding: 0;
  border: 0;
  background: var(--brand-dk);
  cursor: pointer;
  aspect-ratio: 16 / 9;
  overflow: hidden;
}
.video-facade img {
  width: 100%; height: 100%;
  object-fit: cover;
  /* YouTube 的 hqdefault 上下有黑邊，稍微放大裁掉 */
  transform: scale(1.34);
  transition: transform .45s cubic-bezier(.22,1,.36,1), opacity .3s ease;
}
.video-facade:hover img,
.video-facade:focus-visible img { transform: scale(1.4); opacity: .82; }

/* 自製的 5 秒循環封面：本來就是 16:9，不需要放大裁黑邊 */
.video-facade--clip video {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: opacity .3s ease;
}
.video-facade--clip:hover video,
.video-facade--clip:focus-visible video { opacity: .82; }

.video-facade__play {
  position: absolute;
  inset: 0;
  margin: auto;
  width: 62px; height: 62px;
  border-radius: 50%;
  background: rgba(0,76,62,.82);
  border: 2px solid rgba(255,255,255,.9);
  backdrop-filter: blur(2px);
  transition: transform .25s ease, background .25s ease;
}
/* 用 CSS 畫三角形播放鍵，不必額外載入圖示 */
.video-facade__play::after {
  content: "";
  position: absolute;
  top: 50%; left: 54%;
  transform: translate(-50%, -50%);
  border-style: solid;
  border-width: 11px 0 11px 18px;
  border-color: transparent transparent transparent #fff;
}
.video-facade:hover .video-facade__play,
.video-facade:focus-visible .video-facade__play {
  transform: scale(1.08);
  background: var(--accent);
}
.video-facade:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }

/* 點擊後換成真正的 iframe */
.media-card iframe {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  border: 0;
}

/* 減少動態偏好：關掉所有動畫，但要確保內容仍然看得到 */
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
  @view-transition { navigation: none; }
  .reveal { opacity: 1; transform: none; }
  .bar-chart__fill { width: var(--pct, 0%); }
  body.is-leaving { opacity: 1; }
}
