/* 作品集網站 v2：個人風格（精密工業的版面＋製圖藍圖的配色） */
:root {
  --accent: #1F6FEB;
  --accent-dark: #0B2545;
  --accent-soft: #E6EEFB;
  --ink: #0B2545;
  --text: #334155;
  --muted: #475569;
  --line: #D5DEEA;
  --line-soft: #E2E8F0;
  --panel: #F3F6FA;
  --bg: #FFFFFF;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, "Noto Sans TC", system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.75;
  font-variant-numeric: tabular-nums;
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--accent); text-underline-offset: 3px; }
a:hover { color: var(--accent-dark); }
a:focus-visible, button:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 48px; }

/* 語言切換（中翻英之後再接功能） */
.lang-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-left: 4px;
  padding: 0;
  border: 1px solid var(--line-soft);
  background: #fff;
  cursor: pointer;
}
.lang-btn:hover { background: var(--panel); }
.lang-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* 頁首 */

.hero .wrap { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 56px; align-items: center; }
.hero img { width: 240px; height: 298px; object-fit: cover; border-radius: 16px; }
.hero h1 {
  margin: 0;
  font-family: "Noto Sans TC", sans-serif;
  font-weight: 900;
  font-size: 60px;
  line-height: 1.15;
  letter-spacing: 12px;
}

.hero .intro { margin: 0 0 28px; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; }
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  text-decoration: none;
  border: 1px solid var(--accent);
  transition: background-color 150ms ease-out, transform 100ms ease-out;
}
.btn svg { flex-shrink: 0; }
.btn:active { transform: translateY(1px); }
@media (prefers-reduced-motion: reduce) { .btn { transition: none; } .btn:active { transform: none; } }

.btn-primary:hover { color: #fff; }

/* 區塊 */
section.block { padding: 64px 0; }

.block-title {
  margin: 0 0 32px;
  padding-bottom: 10px;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 4px;
  color: var(--ink);
}

/* 作品：左欄類別＋右欄內容，跟履歷的工作經歷一樣 */
.work { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 48px; padding: 40px 0; border-bottom: 1px solid var(--line-soft); }
.work:first-of-type { padding-top: 0; }
.work:last-child { border-bottom: 0; padding-bottom: 0; }
.work-meta { display: flex; flex-direction: column; gap: 4px; font-size: 14px; color: var(--muted); }
.work-meta .kind { font-weight: 700; color: var(--accent); }

.work .lead { margin: 0 0 20px; max-width: 52em; }
.work ul { margin: 0 0 20px; padding-left: 20px; }
.work li + li { margin-top: 4px; }
.work h4 { margin: 28px 0 12px; font-size: 15px; color: var(--ink); }

.dotti-row { display: grid; grid-template-columns: 320px minmax(0, 1fr); gap: 40px; align-items: start; margin-bottom: 8px; }
.dotti-row img { border-radius: 12px; }
.dotti-row h4 { margin-top: 0; }

.work .stickers { padding: 0; margin: 0 0 20px; }
.stickers { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 8px; list-style: none; }
.stickers li { margin: 0; background: var(--panel); padding: 6px; }
.stickers li + li { margin-top: 0; }
.stickers img { width: 100%; aspect-ratio: 370 / 320; object-fit: contain; }

/* LINE 推播示意卡 */
.news-demo { max-width: 360px; border: 1px solid var(--line-soft); border-radius: 12px; overflow: hidden; font-size: 13px; line-height: 1.55; background: #fff; }
/* 實際訊息是 #F97316；白字對比不足 4.5:1，網頁上改用較深的橘 */
.news-demo .head { background: #C2410C; color: #fff; padding: 14px 16px; }
.news-demo .head b { display: block; font-size: 16px; }
.news-demo .head span { color: #FFEDD5; font-size: 12px; }
.news-demo .item { padding: 12px 16px; border-bottom: 1px solid var(--line-soft); }
.news-demo .cat { display: block; font-size: 11px; font-weight: 700; }
.news-demo .t { display: block; color: var(--ink); font-weight: 700; }
.news-demo .s { display: block; color: #4B5563; font-size: 12px; }
.news-demo .foot { padding: 10px 16px; color: #4B5563; font-size: 12px; }

/* 關於：三張圖卡＋icon */

.card-icon {
  display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0;
  width: 40px; height: 40px; border-radius: 10px; background: #fff; color: var(--accent);
  border: 1px solid var(--line-soft);
}

/* 頁首底色（方案 A） */

.hero img { box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06), 0 8px 24px rgba(15, 23, 42, 0.08); }

/* 作品區：封面圖卡格（方案 B），點進去看詳細頁 */

.cover-dotti { background: #F3F6FA; }
.cover-dotti img { height: 100%; width: auto; transition: transform 300ms ease-out; }

.cover-slides { gap: 16px; font-weight: 700; }

.mini-news { width: 220px; background: #fff; border: 1px solid var(--line-soft); border-radius: 10px; overflow: hidden; display: flex; flex-direction: column; font-size: 11px; font-style: normal; }
.mini-news b { color: #fff; padding: 8px 10px; font-size: 12px; }
.mini-news i { font-style: normal; font-weight: 700; padding: 6px 10px 2px; }
.mini-news span { height: 6px; margin: 0 10px 6px; background: var(--line-soft); border-radius: 3px; }
.cover-skills { flex-wrap: wrap; align-content: center; gap: 8px; padding: 24px; }

/* 詳細頁 */
.detail .back { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; text-decoration: none; }
.detail .work { padding-top: 0; border-bottom: 0; }

/* 關於：左短文＋右清單（方案 D） */

.about-text p { margin: 0 0 16px; font-size: 17px; line-height: 1.9; color: var(--text); }
.about-list { margin: 0; background: var(--panel); border: 1px solid var(--line-soft); border-radius: 14px; padding: 8px 24px; }
.about-list > div { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 16px; padding: 14px 0; }
.about-list > div + div { border-top: 1px solid var(--line-soft); }
.about-list dt { display: flex; align-items: center; gap: 8px; font-weight: 700; color: var(--ink); font-size: 15px; }
.about-list dt .card-icon { width: 30px; height: 30px; border-radius: 8px; }
.about-list dd { margin: 0; font-size: 15px; line-height: 1.7; }
.about-list b { color: var(--ink); }
.about-list .yr { white-space: nowrap; color: var(--muted); }
.about-list dd b + br + .yr { display: inline-block; margin-bottom: 4px; }
.about-list .skill-groups br + b { display: inline-block; margin-top: 8px; }

/* 作品條列 1：類別｜標題與說明｜縮圖，整列可點 */
.work-list { list-style: none; margin: 0; padding: 0; }
.work-list li + li { border-top: 1px solid var(--line-soft); }
.work-row {
  display: grid; grid-template-columns: 140px minmax(0, 1fr) 240px; gap: 32px; align-items: center;
  padding: 24px 16px; margin: 0 -16px; border-radius: 12px;
  color: var(--text); text-decoration: none; transition: background-color 150ms ease-out;
}
.work-row:hover { color: var(--text); }
.work-row:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.row-meta { display: flex; flex-direction: column; gap: 2px; font-size: 14px; color: var(--muted); }
.row-meta .kind { font-weight: 700; }

.row-main p { margin: 0 0 8px; max-width: 46em; }
.row-main .more { font-size: 14px; }
.row-thumb { height: 150px; border-radius: 10px; border: 1px solid var(--line-soft); background: var(--panel); display: flex; align-items: center; justify-content: center; overflow: hidden; }
.row-thumb.cover-dotti { background: #F3F6FA; }
.row-thumb.cover-dotti img { height: 100%; width: auto; transition: transform 300ms ease-out; }
.work-row:hover .cover-dotti img { transform: scale(1.03); }
.row-thumb.cover-slides { gap: 10px; font-weight: 700; }

.row-thumb .mini-news { width: 170px; }
.row-thumb.cover-skills { flex-wrap: wrap; align-content: center; gap: 6px; }

@media (prefers-reduced-motion: reduce) { .work-row { transition: none; } .work-row:hover .cover-dotti img { transform: none; } }

/* 讓「作品」標題底線和「關於」卡片裡的標題底線對齊（卡片上方 1px 框線＋24px 內距） */

@media (max-width: 1279px) {
  
  
  .work-row { grid-template-columns: 110px minmax(0, 1fr) 180px; gap: 20px; }
  .row-thumb { height: 120px; }
}
@media (max-width: 700px) {
  .work-row { grid-template-columns: 1fr; gap: 10px; }
  .row-meta { flex-direction: row; gap: 10px; }
  .row-thumb { order: -1; height: 160px; }
}

/* 頁尾 */
footer { padding: 32px 0 40px; font-size: 14px; }
/* 頁尾不受內容最寬 1320px 限制，左右貼齊視窗邊距 */
footer .wrap, .hero .wrap { max-width: none; }
footer .footer-row { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; }
footer .contact { display: flex; flex-wrap: wrap; gap: 8px 24px; }
footer .contact a, footer .contact span { display: inline-flex; align-items: center; gap: 6px; }

/* 灰線和文字都跟上面那一列一樣寬，行距收緊 */
footer .legal { margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--line); font-size: 13px; line-height: 1.6; }
footer .legal h2 { margin: 0 0 6px; font-size: 13px; font-weight: 700; letter-spacing: 2px; }
footer .legal p { margin: 0 0 2px; }

/* 平板 */
@media (max-width: 860px) {
  .work { grid-template-columns: 1fr; gap: 12px; }
  .work-meta { flex-direction: row; gap: 12px; flex-wrap: wrap; }
  
  
  
  
  
  .stickers { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
/* 手機 */
@media (max-width: 600px) {
  .wrap { padding: 0 16px; }
  .hero { padding: 40px 0; }
  .hero .wrap { grid-template-columns: 1fr; gap: 24px; }
  .hero img { width: 128px; height: 158px; }
  .hero h1 { font-size: 36px; letter-spacing: 6px; }
  .dotti-row { grid-template-columns: 1fr; gap: 16px; }
  .dotti-row img { max-width: 200px; }
  
  
  .about-list > div { grid-template-columns: 1fr; gap: 6px; }
  
  
}
.detail-title { margin: 0 0 8px; font-size: 32px; line-height: 1.3; color: var(--ink); }

/* 拿掉導覽列後：翻譯鈕放在頁首右上角；詳細頁放在「回到作品」同一列右側 */
.hero { position: relative; }

/* 作品縮圖：簡報時間對照卡、技能庫終端機卡 */
.row-thumb.cover-slides { background: linear-gradient(135deg, #EEF4FD 0%, #F4F7FB 100%); }
.time-card { width: 200px; background: #fff; border: 1px solid var(--line-soft); border-radius: 10px; padding: 12px 14px; box-shadow: 0 4px 12px rgba(15,23,42,.06); }
.tc-head { display: flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; color: var(--ink); margin-bottom: 10px; }
.tc-slide { width: 16px; height: 11px; border: 1.5px solid var(--accent); border-radius: 2px; position: relative; flex: none; }
.tc-slide::after { content: ""; position: absolute; left: 2px; right: 6px; top: 2px; height: 2px; background: var(--accent); }
.tc-row { display: grid; grid-template-columns: 26px 1fr 26px; align-items: center; gap: 6px; margin-top: 8px; font-size: 11px; color: var(--muted); }
.tc-track { height: 8px; background: var(--line-soft); border-radius: 4px; overflow: hidden; }
.tc-bar { display: block; height: 100%; border-radius: 4px; }
.tc-bar.old { width: 100%; }
.tc-bar.new { width: 12.5%; background: var(--accent); }
.tc-val { font-family: Inter, sans-serif; font-size: 13px; text-align: right; }
.tc-val.old { color: var(--muted); }
.tc-val.new { color: var(--accent); }
.row-thumb.cover-skills { padding: 0; background: linear-gradient(135deg, #E2E8F0 0%, #F4F7FB 100%); }
.term { width: 200px; border-radius: 10px; overflow: hidden; box-shadow: 0 6px 16px rgba(15,23,42,.18); font-family: Inter, monospace; }
.term-bar { display: flex; align-items: center; gap: 4px; padding: 6px 10px; }
.term-bar i { width: 7px; height: 7px; border-radius: 50%; background: #475569; }
.term-bar i:first-child { background: #F87171; } .term-bar i:nth-child(2) { background: #FBBF24; } .term-bar i:nth-child(3) { background: #34D399; }
.term-bar span { margin-left: 6px; font-size: 10px; color: #CBD5E1; }
.term ul { list-style: none; margin: 0; padding: 6px 10px 2px; }
.term li { font-size: 11px; line-height: 1.6; color: #E2E8F0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.term li .dir { color: #93C5FD; margin-right: 6px; font-family: "Noto Sans TC", sans-serif; }
.term-foot { padding: 2px 10px 7px; font-size: 10px; color: #94A3B8; font-family: "Noto Sans TC", sans-serif; }
@media (max-width: 1279px) { .time-card, .term { width: 164px; } .term li { font-size: 10px; } .term li .dir { display: none; } }
@media (max-width: 700px) { .term li .dir { display: inline; } }
@media (max-width: 700px) { .time-card, .term { width: 220px; } .term li { font-size: 11px; } }

/* 英文模式：英文名字不需要中文的大字距 */
html[lang="en"] .hero h1 { letter-spacing: 1px; }
html[lang="en"] footer .legal h2 { letter-spacing: 0.5px; }

html[lang="en"] .block-title { letter-spacing: 1px; }
html[lang="en"] .tc-row { grid-template-columns: 40px 1fr 26px; }

/* 下載履歷：中文版／英文版選單 */
.dl { position: relative; display: inline-flex; }
button.btn { font-family: inherit; line-height: inherit; cursor: pointer; }
.dl-btn svg { transition: transform 150ms ease-out; }
.dl-btn[aria-expanded="true"] svg { transform: rotate(180deg); }
.dl-menu { position: absolute; top: calc(100% + 6px); left: 0; min-width: 100%; z-index: 5; padding: 6px; background: #fff; border: 1px solid var(--line); box-shadow: 0 8px 24px rgba(15,23,42,.12); }
.dl-menu[hidden] { display: none; }
.dl-menu a { display: block; padding: 8px 12px; border-radius: 6px; color: var(--ink); text-decoration: none; font-size: 15px; white-space: nowrap; }
.dl-menu a:hover, .dl-menu a:focus-visible { background: var(--panel); color: var(--accent); outline: none; }
@media (prefers-reduced-motion: reduce) { .dl-btn svg { transition: none; } }

/* ===== v2 個人風格 =====
   版面：精密工業（齒輪 LOGO、膠囊按鈕、型錄式粗線與數字字體）
   配色：製圖藍圖（深藍 #0B2545、藍 #1F6FEB、淺藍灰 #F3F6FA） */
:root { --num: "Space Grotesk", Inter, "Noto Sans TC", sans-serif; }
.hero { background: var(--panel); border-bottom: 0; }
.hero h1 { color: var(--ink); }

.btn { border-radius: 999px; border-color: var(--ink); }
.btn-primary { background: var(--ink); color: #fff; }
.btn-primary:hover { background: var(--accent); border-color: var(--accent); }
.btn-ghost { background: #fff; color: var(--ink); }
.btn-ghost:hover { background: var(--accent-soft); color: var(--ink); }
.dl-menu { border-radius: 14px; }
.block-title { border-bottom: 2px solid var(--ink); }

.about-list .card-icon { color: var(--accent); }
.row-meta, .row-meta .kind, .about-list .yr, .work-meta { font-family: var(--num); }
.row-meta .kind { color: var(--accent); letter-spacing: 0.5px; }

.row-main .more { font-weight: 700; color: var(--ink); }
.work-row:hover { background: var(--panel); }
.work-row:hover .more { color: var(--accent); }
.lang-btn { border-radius: 999px; border-color: var(--line); color: var(--ink); }
.lang-btn[aria-pressed="true"] { background: var(--ink); color: #fff; border-color: var(--ink); }
.cover-slides .tc-val, .cover-slides .tc-lbl { font-family: var(--num); }
.tc-bar.old { background: #8A9BB4; }
.mini-news b { background: #C2410C; }
.term { background: var(--ink); }
.term-bar { background: #13335C; }
/* 頁尾：深藍底，像型錄封底 */
footer { background: var(--ink); color: #C9D6EA; border-top: 0; }
footer a { color: #fff; }
footer a:hover { color: #9CC2FF; }
footer .contact svg { color: #9CC2FF; }
footer .legal { border-top-color: #2A4A75; }
footer .legal h2 { color: #fff; }
.footer-logo { width: 32px; height: 32px; margin-right: 8px; }
footer .contact { align-items: center; }
.term ul li { border: 0; margin: 0; padding: 0; }

/* v2 作品詳細頁 */

.detail .back { color: var(--ink); font-weight: 700; }
.detail .back:hover { color: var(--accent); }
.detail-title { font-weight: 900; }
.work-meta .kind { letter-spacing: 0.5px; }

.work a[href$="dotti-3d.html"] {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 22px; margin-right: 10px;
  border: 1px solid var(--ink); border-radius: 999px; color: var(--ink); font-weight: 700; text-decoration: none;
}
.work a[href$="dotti-3d.html"]:hover { background: var(--accent-soft); }
.stickers li { border: 1px solid var(--line); border-radius: 10px; }

/* 作品頁：LOGO 自己一行，「回到主頁」在分隔線下方 */

.detail .back { margin-bottom: 20px; }

/* LOGO 與翻譯按鈕視覺大小一致：都是 40px，按鈕內圖示縮為 18px */
.lang-btn { width: 40px; height: 40px; }
.lang-btn svg { width: 18px; height: 18px; }

/* 頁首底邊：製圖尺刻度（小刻度每 12px、大刻度每 60px，從內容左緣 48px 起算） */
.hero::after {
  content: "";
  position: absolute;
  bottom: 0;
  pointer-events: none;
}
@media (max-width: 600px) {
  .hero::after {
    background:
      linear-gradient(#8A9BB4, #8A9BB4) left bottom / 100% 1px no-repeat,
      repeating-linear-gradient(to right, #8A9BB4 0 1px, transparent 1px 60px) 16px bottom / 100% 11px no-repeat,
      repeating-linear-gradient(to right, #8A9BB4 0 1px, transparent 1px 12px) 16px bottom / 100% 5px no-repeat;
  }
}
/* 頁首底邊：章節短線（方案 B）＝左端一段深藍粗線，對齊內容左緣（不加灰色細線） */

@media (max-width: 600px) {
  .hero::after {
    background:
      linear-gradient(var(--ink), var(--ink)) 16px bottom / 61px 4px no-repeat;
  }
}
/* 驗收修正（web-design-review v2）：職稱在淺藍底上的對比 ≥4.5；頁尾連結觸控高度加大 */

footer .contact a { min-height: 40px; }

/* 頁首背景：白色超大「丁」從右上角出血（和名片同一個構圖），放在最底層，不影響下載選單。
   寬螢幕拆成三塊：橫條固定在右上、鉤的位置跟著頁首下緣（下緣切在鉤底上方 3.6 個單位，照使用者指定）、直畫補在中間，所以頁首高度變了鉤還是剛好接到下方白色。
   --w 是整個字（34 個單位寬）的寬度，--r／--t 是右上角的出血量。 */
.hero-bg { position: absolute; inset: 0; overflow: hidden; pointer-events: none; z-index: 1; --w: 600px; --r: -110px; --t: -70px; }
.hero-bar, .hero-stem, .hero-hook, .hero-mark { position: absolute; }
.hero-bar { right: var(--r); top: var(--t); width: var(--w); height: auto; }
.hero-stem { right: calc(var(--r) + var(--w) * 14 / 34); width: calc(var(--w) * 6 / 34); top: calc(var(--t) + var(--w) * 8.5 / 34); bottom: calc(var(--w) * 11.4 / 34); background: #FFFFFF; }
.hero-hook { right: calc(var(--r) + var(--w) * 14 / 34); bottom: calc(var(--w) * -3.6 / 34); width: calc(var(--w) * 13 / 34); height: auto; }
.hero-mark { display: none; }
.hero .wrap { position: relative; z-index: 2; }

@media (max-width: 900px) {
  .hero-bar, .hero-stem, .hero-hook { display: none; }
  .hero-mark { display: block; right: -90px; top: -50px; width: 420px; height: auto; }
}
@media (max-width: 600px) { .hero-mark { right: -70px; top: -30px; width: 280px; } }
/* 白色「丁」蓋過頁首底部的細灰線，直接接到下方的白色區塊 */
.hero::after { z-index: 0; }

/* 手機版：翻譯按鈕改放在 Email 按鈕那一行的右端、垂直置中（同一個按鈕放兩份，i18n.js 會一起切換） */

@media (max-width: 600px) {
  
  .actions { align-items: center; }
  
}

/* ===== 作品案例頁（tech-news、slide-builder、claude-skills）=====
   結構：副標題 → 截圖框 → 01 背景 → 02 架構流程卡 → 03 技術棧卡 → 04 效益數據卡 → 上一個／下一個作品 */
.case .subtitle { margin: 0 0 28px; font-size: 18px; line-height: 1.7; color: var(--text); }
.case-sec { margin-top: 56px; }
.case-h { display: flex; align-items: baseline; gap: 12px; margin: 0 0 20px; padding-bottom: 10px; border-bottom: 2px solid var(--ink); font-size: 20px; font-weight: 900; line-height: 1.4; color: var(--ink); }
.case-h .no { font-family: var(--num); font-size: 15px; font-weight: 700; color: var(--accent); letter-spacing: 0.5px; }
.case-sec > p { margin: 0 0 12px; }

/* 截圖框：製圖方格底，之後換成實際截圖（img 會填滿框） */
.shot { margin: 0; }
.shot-frame {
  position: relative; display: flex; align-items: center; justify-content: center; overflow: hidden;
  aspect-ratio: 16 / 9; border: 1px solid var(--line); border-radius: 14px;
  background-color: var(--panel);
  background-image: linear-gradient(var(--line-soft) 1px, transparent 1px), linear-gradient(90deg, var(--line-soft) 1px, transparent 1px);
  background-size: 24px 24px; background-position: -1px -1px;
}
.shot-frame > img { width: 100%; height: 100%; object-fit: cover; }
.shot-frame.is-img { aspect-ratio: auto; }
.shot-frame.is-img > img { height: auto; }
.shot-frame.is-demo { aspect-ratio: auto; padding: 40px 16px; }
.shot-frame.is-demo .news-demo { width: 100%; box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08); }

/* 架構流程卡：寬螢幕橫排＋箭頭，窄螢幕直排＋向下箭頭 */
.pipe-wrap { padding: 20px; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; }
.case .pipeline { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 28px; counter-reset: step; }
.case .pipeline li { position: relative; margin: 0; padding: 16px; background: #fff; border: 1px solid var(--line); border-radius: 12px; font-size: 14px; line-height: 1.65; counter-increment: step; }
.case .pipeline li::before { content: counter(step, decimal-leading-zero); display: block; font-family: var(--num); font-size: 22px; font-weight: 700; line-height: 1.1; color: var(--accent); margin-bottom: 8px; }
.case .pipeline li + li::after {
  content: ""; position: absolute; left: -19px; top: 50%; width: 9px; height: 9px; margin-top: -5px;
  border-top: 2px solid var(--accent); border-right: 2px solid var(--accent); transform: rotate(45deg);
}
.case .pipeline li:last-child { border-color: var(--ink); box-shadow: inset 0 3px 0 var(--ink); }
.case .pipeline .layer { display: block; font-family: var(--num); font-size: 12px; font-weight: 700; letter-spacing: 0.5px; color: var(--muted); }
.case .pipeline strong { display: block; margin: 2px 0 6px; font-size: 15px; line-height: 1.4; color: var(--ink); }
.case .pipeline.is-vertical { grid-template-columns: 1fr; gap: 22px; }
.case .pipeline.is-vertical li + li::after { left: 50%; top: -16px; margin: 0 0 0 -5px; transform: rotate(135deg); }
@media (max-width: 1100px) {
  .case .pipeline { grid-template-columns: 1fr; gap: 22px; }
  .case .pipeline li + li::after { left: 50%; top: -16px; margin: 0 0 0 -5px; transform: rotate(135deg); }
}

/* 技術棧卡 */
.case .stack { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.case .stack li { margin: 0; padding: 18px 20px; background: #fff; border: 1px solid var(--line); border-radius: 12px; }
.case .stack .tag { display: inline-block; margin-bottom: 10px; padding: 2px 10px; border-radius: 999px; background: var(--accent-soft); color: #1F5BC4; font-family: var(--num); font-size: 12px; font-weight: 700; letter-spacing: 0.3px; }
.case .stack strong { display: block; margin-bottom: 4px; font-size: 16px; color: var(--ink); }
.case .stack p { margin: 0; font-size: 14px; line-height: 1.7; }

/* 效益數據卡 */
.stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.stat { padding: 20px 22px 22px; background: var(--panel); border-top: 4px solid var(--ink); border-radius: 0 0 12px 12px; }
.stat .num { display: block; font-family: var(--num); font-size: 36px; font-weight: 700; line-height: 1.15; color: var(--ink); white-space: nowrap; }
.stat .num em { font-style: normal; color: var(--accent); }
.stat .num small { font-size: 0.5em; font-weight: 500; color: var(--muted); }
.stat .num .arr { font-weight: 500; color: var(--muted); }
.stat .lbl { display: block; margin-top: 10px; font-size: 15px; font-weight: 700; color: var(--ink); }
.stat p { margin: 4px 0 0; font-size: 14px; line-height: 1.7; color: var(--muted); }
.stat.is-key { background: var(--ink); border-top-color: var(--accent); }
.stat.is-key .num, .stat.is-key .lbl { color: #fff; }
.stat.is-key .num em { color: #9CC2FF; }
.stat.is-key .num small, .stat.is-key .num .arr, .stat.is-key p { color: #C9D6EA; }

/* 技能庫：檔案總管樹狀卡＋部署流程 */
.tree-wrap { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 20px; align-items: stretch; }
.tree { display: flex; flex-direction: column; background: var(--ink); border-radius: 14px; overflow: hidden; color: #E2E8F0; }
.tree .term-bar { padding: 10px 14px; gap: 6px; }
.tree .term-bar i { width: 9px; height: 9px; }
.tree .term-bar span { font-family: var(--num); font-size: 13px; }
.case .tree-root, .case .tree-root ul { list-style: none; margin: 0; padding: 0; }
.case .tree-root { flex: 1; padding: 14px 18px 10px; }
.case .tree-root ul { margin: 2px 0 6px 7px; padding-left: 18px; border-left: 1px solid #2A4A75; }
.case .tree li { position: relative; margin: 0; font-size: 14px; line-height: 1.85; }
.case .tree-root ul > li::before { content: ""; position: absolute; left: -18px; top: 0.95em; width: 11px; border-top: 1px solid #2A4A75; }
.tree .dir { color: #9CC2FF; font-weight: 700; }
.tree .cnt { margin-left: 8px; padding: 0 7px; border-radius: 999px; background: #13335C; color: #C9D6EA; font-family: var(--num); font-size: 12px; }
.tree code { font-family: var(--num); font-size: 13.5px; color: #E2E8F0; overflow-wrap: anywhere; }
.tree .private { color: #A9BBD6; font-size: 13px; }
.tree-foot { padding: 10px 18px 14px; border-top: 1px solid #2A4A75; color: #A9BBD6; font-size: 13px; }
.tree-wrap .pipe-wrap { display: flex; }
.tree-wrap .pipeline { width: 100%; align-content: center; }

/* 上一個／下一個作品 */
.pager { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-top: 64px; padding-top: 24px; border-top: 2px solid var(--ink); }
.pager-link { display: flex; flex-direction: column; gap: 4px; min-height: 44px; padding: 16px 20px; border: 1px solid var(--line); border-radius: 12px; color: var(--ink); text-decoration: none; transition: background-color 150ms ease-out, border-color 150ms ease-out; }
.pager-link:hover { background: var(--panel); border-color: var(--ink); color: var(--ink); }
.pager-next { text-align: right; align-items: flex-end; }
.pager-dir { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 700; color: var(--muted); }
.pager-link:hover .pager-dir { color: var(--accent); }
.pager-title { font-size: 17px; font-weight: 900; line-height: 1.4; }
@media (prefers-reduced-motion: reduce) { .pager-link { transition: none; } }

@media (max-width: 860px) {
  .tree-wrap { grid-template-columns: 1fr; }
  .stats { grid-template-columns: 1fr; }
}
@media (max-width: 700px) {
  .case .stack { grid-template-columns: 1fr; }
  .case .subtitle { font-size: 16px; }
  .case-sec { margin-top: 44px; }
  .pager { grid-template-columns: 1fr; }
  .pager-empty { display: none; }
  .pager-next { text-align: left; align-items: flex-start; }
  .shot-frame { aspect-ratio: 4 / 3; }
  .shot-frame.is-img { aspect-ratio: auto; }
  .shot-frame.is-demo { aspect-ratio: auto; padding: 24px 12px; }
}

/* ===== v3 個人網站首頁（2026-12：參考單頁分流架構，沿用 v2 的配色與字體） ===== */
html { scroll-padding-top: 88px; }

/* 置頂選單 */
.site-nav { position: sticky; top: 0; z-index: 20; background: rgba(255, 255, 255, 0.94); border-bottom: 1px solid var(--line-soft); backdrop-filter: blur(8px); }
.site-nav .wrap { max-width: none; display: flex; align-items: center; gap: 24px; }
.nav-brand { display: inline-flex; color: var(--ink); text-decoration: none; font-weight: 900; letter-spacing: 0.2em; }

.nav-brand:hover { color: var(--ink); }
.site-nav nav { display: flex; gap: 4px; margin-left: auto; }
.site-nav nav a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 14px; border-radius: 999px; color: var(--ink); font-weight: 700; text-decoration: none; white-space: nowrap; }

.site-nav .lang-btn { margin: 0; flex-shrink: 0; }
html[lang="en"] .nav-brand { letter-spacing: 0.02em; }
@media (prefers-reduced-motion: reduce) { .site-nav nav a { transition: none; } }
@media (max-width: 700px) {
  .site-nav .wrap { flex-wrap: wrap; gap: 0 12px; min-height: 0; padding-top: 10px; }
  .nav-brand { margin-right: auto; }
  .site-nav nav { order: 3; width: 100%; margin: 6px -16px 0; padding: 0 12px 4px; overflow-x: auto; scrollbar-width: none; }
  .site-nav nav::-webkit-scrollbar { display: none; }
  .site-nav nav a { padding: 0 12px; font-size: 14px; }
}

/* 主視覺：姓名縮小、定位大標 */

.headline { margin: 0 0 20px; font-family: "Noto Sans TC", sans-serif; font-weight: 900; line-height: 1.32; color: var(--ink); letter-spacing: 0.02em; }
.headline .hl { background: linear-gradient(transparent 64%, rgba(31, 111, 235, 0.26) 64%); padding: 0 0.04em; }

.facts { display: flex; flex-wrap: wrap; gap: 4px 0; margin: 24px 0 0; font-family: var(--num); font-weight: 700; color: var(--ink); }
.facts span + span::before { content: "・"; margin: 0 6px; color: var(--accent); }
@media (max-width: 600px) {
  
  .headline { font-size: 28px; }
}

/* 首頁區塊 */

.home-sec .wrap { max-width: none; }
.about-grid { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); align-items: start; }

.stats-row { list-style: none; margin: 24px 0 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.stats-row li { padding: 16px 18px 18px; background: var(--panel); border-top: 4px solid var(--ink); border-radius: 0 0 12px 12px; }
.stats-row .num { display: block; font-family: var(--num); font-weight: 700; line-height: 1.15; color: var(--ink); }
.stats-row .arr { margin: 0 4px; color: var(--accent); }
.stats-row .lbl { display: block; margin-top: 4px; color: var(--muted); }

/* 兩條主線 */

@media (max-width: 960px) {
  .about-grid { grid-template-columns: 1fr; gap: 28px; }
}

@media (max-width: 600px) {
  .home-sec { padding-top: 48px; }
  .stats-row { grid-template-columns: 1fr; }
  .stats-row li { display: flex; align-items: baseline; gap: 12px; }
  .stats-row .num { font-size: 26px; flex-shrink: 0; }
  .stats-row .lbl { margin: 0; }
}
@media (max-width: 700px) {
  html { scroll-padding-top: 120px; }
  html[lang="en"] .site-nav nav a { padding: 0 9px; font-size: 13px; }
}

/* 大標 A+D：手機上每句維持一行 */
@media (max-width: 600px) { .headline { font-size: 25px; letter-spacing: 0; } }
@media (max-width: 360px) { .headline { font-size: 22px; } }
/* 網站名稱「丁.」：句點就是「一丁點」的點，用藍色 */

.nav-brand img { width: 40px; height: 40px; }

/* ===== v3.1 留白（2026-12，參考 xdedu.tw 的量測：內容寬約 1070–1180px 置中，內文 15–16px，選單與按鈕 14px 粗體） =====
   內容不再撐滿整個螢幕：所有區塊的內容寬上限 1168px（扣掉左右 48px 內距，實際內容約 1072px），背景色仍延伸到兩側 */
:root { --maxw: 1168px; }
footer .wrap, .hero .wrap, .site-nav .wrap, .home-sec .wrap { max-width: var(--maxw); }
/* 頁首底邊的深藍短線跟著內容左緣走 */
.hero::after { left: max(48px, calc(50% - var(--maxw) / 2 + 48px)); right: auto; width: 85px; height: 4px; background: var(--ink); }
@media (max-width: 600px) { .hero::after { left: 16px; width: 61px; background: var(--ink); } }

/* 字級收斂 */
.site-nav .wrap { min-height: 68px; }
.site-nav nav a { font-size: 14px; }
.btn { font-size: 14px; min-height: 48px; padding: 0 24px; }
.hero { padding: 56px 0 72px; }
@media (min-width: 761px) {
  .hero .wrap { grid-template-columns: 220px minmax(0, 1fr); gap: 56px; }
  .hero .wrap > img { width: 220px; height: 273px; }
}
/* 平板直式（601–760px）：照片和文字上下排，讓大標有足夠寬度 */
@media (min-width: 601px) and (max-width: 760px) {
  .hero .wrap { grid-template-columns: 1fr; gap: 28px; }
  .hero .wrap > img { width: 160px; height: 198px; }
}
.hero .intro { font-size: 15px; line-height: 1.85; max-width: 600px; }
.headline { font-size: clamp(30px, 3vw, 44px); }
.facts { font-size: 13px; }

/* 區塊之間多一點呼吸 */
.home-sec { padding: 72px 0 8px; }
.home-sec:last-of-type { padding-bottom: 88px; }
.block-title { margin-bottom: 28px; }
.about-grid { gap: 56px; }
.about-grid .about-text p { font-size: 15px; line-height: 1.85; }
.stats-row .num { font-size: 24px; }
.stats-row .lbl { font-size: 13px; }
.about-list dt, .about-list dd { font-size: 14px; }

.row-main p { font-size: 14px; }

@media (max-width: 600px) {
  .hero { padding: 40px 0 48px; }
  .btn { padding: 0 18px; }
  .home-sec { padding-top: 52px; }
  .stats-row .num { font-size: 22px; }
}

/* v3.2（2026-12）：選單與頁尾回到滿版（左右貼齊視窗邊距），中間內容維持 1168px 置中 */
.site-nav .wrap, footer .wrap { max-width: none; }
.nav-brand { gap: 12px; }
.nav-brand .brand-en { font-family: var(--num); font-size: 16px; font-weight: 700; letter-spacing: 0.22em; line-height: 1; color: var(--ink); }
/* 主視覺和「關於」的銜接處：拿掉深藍短線，「關於」往上靠 */
.hero::after { display: none; }
.hero { padding-bottom: 56px; }
#about { padding-top: 44px; }
@media (max-width: 600px) {
  .hero { padding-bottom: 40px; }
  #about { padding-top: 36px; }
  .nav-brand .brand-en { font-size: 14px; letter-spacing: 0.18em; }
}
/* CONGYOU 的字母底線和 LOGO 底緣（鉤和藍點的底，48 格中的第 42.25 格）對齊 */
.nav-brand { align-items: flex-end; }
.nav-brand .brand-en { margin-bottom: calc(40px * 5.75 / 48 - 0.1875em); } 

/* v3.3（2026-12）：主視覺拿掉姓名標誌，大標改成 h1 */
.hero h1.headline { margin: 0 0 20px; font-family: "Noto Sans TC", sans-serif; font-weight: 900; font-size: clamp(30px, 3vw, 44px); line-height: 1.32; letter-spacing: 0.02em; color: var(--ink); }
html[lang="en"] .hero h1.headline { letter-spacing: 0; font-size: clamp(26px, 2.5vw, 38px); line-height: 1.25; }
@media (max-width: 600px) {
  .hero h1.headline { font-size: 25px; letter-spacing: 0; }
  html[lang="en"] .hero h1.headline { font-size: 24px; }
}
@media (max-width: 360px) { .hero h1.headline { font-size: 22px; } }

/* 專長與作品：每張卡寫能做的事（標籤），下面列代表作品 */
.track-tags { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 24px; padding: 0; }
.track-tags li { padding: 4px 12px; border-radius: 999px; font-size: 13px; font-weight: 700; line-height: 1.6; }

/* 作品內頁：頂端改用和首頁相同的選單，內容上方留白補回來 */
section.block.detail { padding-top: 40px; }
@media (max-width: 600px) { section.block.detail { padding-top: 28px; } }
@media (min-width: 601px) and (max-width: 900px) {
  .hero h1.headline { font-size: 26px; }
  html[lang="en"] .hero h1.headline { font-size: 22px; }
}
/* 大標換行時平均分配，不讓「AI。」單獨掉到下一行 */
.hero h1.headline { text-wrap: balance; }

/* v3.4（2026-12）：「作品」依專長分組（設計／AI 自動化），組名列放說明與能力標籤，下面接作品列表 */
.work-group + .work-group { margin-top: 56px; }
.group-head { display: grid; align-items: start; background: var(--panel); border: 1px solid var(--line-soft); border-radius: 14px; }
.group-head h3 { margin: 0; font-size: 24px; font-weight: 900; line-height: 1.3; color: var(--ink); }
.group-head p { margin: 2px 0 14px; font-size: 15px; color: var(--text); }
.group-head .track-tags { margin: 0; }
.group-head .track-tags li { background: #fff; border: 1px solid var(--line); color: var(--ink); }
.work-group .work-list { margin-top: 8px; }
.row-main h4 { margin: 0 0 6px; font-size: 19px; font-weight: 900; line-height: 1.4; color: var(--ink); }
@media (max-width: 760px) {
  .group-head { grid-template-columns: 1fr; gap: 8px; padding: 20px; }
  .group-head h3 { font-size: 22px; }
  .work-group + .work-group { margin-top: 40px; }
}
/* 組名列和下面的作品列對齊：組名對齊分類欄、說明對齊作品標題 */
.group-head { margin: 0 -16px; padding: 24px 16px; grid-template-columns: 140px minmax(0, 1fr); gap: 32px; }
@media (max-width: 1279px) { .group-head { grid-template-columns: 110px minmax(0, 1fr); gap: 20px; } }
@media (max-width: 760px) { .group-head { margin: 0; padding: 20px; grid-template-columns: 1fr; gap: 8px; } }

/* 選單目前位置（樣式 D）：深藍底白字膠囊；捲到哪一區就標示哪一項 */
.site-nav nav a { transition: color 150ms ease-out; }
/* 樣式 E：目前位置是藍字＋文字下方 2px 藍色底線；滑鼠停留只變藍字，不加底色 */
.site-nav nav a:hover { background: transparent; color: var(--accent); }
.site-nav nav a[aria-current="location"] { color: var(--accent); text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 6px; }
@media (prefers-reduced-motion: reduce) { .site-nav nav a { transition: none; } }
/* 沒有大數字的效益卡：標題直接貼頂 */
.stat .lbl:first-child { margin-top: 0; font-size: 17px; }

/* v4（2026-12-02）：選單與主視覺的響應式排版，照參考網站（xdedu.tw）手機版重排；照片縮小、字級再降一級（同日第二次調整）。
   手機（≤767）：選單分兩列（上：品牌＋翻譯鈕；下：四個選單項左右平均分散，中間一條細線）；
                 主視覺文字在上、照片在下並撐滿欄寬；大標加大並固定三行，重點色塊跟著每一行。
   平板（768–1023）、筆電（1024–1439）、大螢幕（≥1440）：照片靠左、文字靠右，
                 照片寬、間距、字級用 clamp() 隨螢幕寬度連續縮放，不是只在幾個斷點跳一格。 */
.site-nav nav a { font-size: 14px; }
.hero .btn { font-size: 13px; min-height: 38px; padding: 0 20px; }
/* 兩個按鈕的字級與外框高度一樣，寬度各自依文字決定 */
.hero .actions { align-items: center; }
@media (min-width: 768px) {
  .hero { padding: clamp(40px, 5vw, 72px) 0 clamp(44px, 5vw, 72px); }
  .hero .wrap { grid-template-columns: clamp(160px, 14vw, 210px) minmax(0, 1fr); gap: clamp(32px, 4.5vw, 64px); align-items: center; }
  .hero .wrap > img { width: 100%; height: auto; aspect-ratio: 220 / 273; }
  .hero h1.headline { font-size: clamp(24px, 2.9vw, 38px); letter-spacing: 0.02em; text-wrap: balance; }
  html[lang="en"] .hero h1.headline { font-size: clamp(22px, 2.4vw, 34px); }
  .hero .intro { font-size: 15px; line-height: 1.85; max-width: 38em; }
  .facts { font-size: 13px; }
}
@media (max-width: 767px) {
  html { scroll-padding-top: 120px; }
  .site-nav .wrap { flex-wrap: wrap; align-items: center; gap: 0 12px; min-height: 0; padding-top: 12px; padding-bottom: 0; }
  .nav-brand { margin-right: auto; }
  .site-nav nav { order: 3; flex: 0 0 100%; width: 100%; margin: 10px 0 0; padding: 0; border-top: 1px solid var(--line-soft); justify-content: space-between; gap: 0; overflow: visible; }
  .site-nav nav a { min-height: 46px; padding: 0 2px; font-size: 14px; }

  .hero { padding: 32px 0 44px; --fs: clamp(26px, 7.2vw, 34px); --lh: 1.3; }
  html[lang="en"] .hero { --fs: clamp(23px, 6.4vw, 31px); --lh: 1.25; }
  /* 手機背景的白色「丁」固定 280px，和選單下方的主視覺對得上 */
  .hero-mark { right: -70px; top: -30px; width: 280px; }
  /* 手機主視覺：大標佔滿一行；簡介繞開右上角的背景「丁」：在簡介前面放一個靠右的浮動空盒（寬 144px、
     高度 = 丁的鉤底（距頁首頂端 242px）加 10px 空隙，扣掉大標占的高度），文字就會在丁旁邊折行、鉤底以下延伸到整行寬。
     下方分兩欄，左欄放兩個按鈕和事實，右欄放照片（去背照之後直接換檔）。文字外層 div 用 display: contents 讓子元素直接排進這個格線 */
  .hero .wrap { grid-template-columns: minmax(0, 1fr) clamp(130px, 44%, 180px); column-gap: 16px; row-gap: 0; align-items: start; }
  .hero .wrap > div { display: contents; }
  .hero h1.headline { grid-column: 1 / -1; grid-row: 1; margin-bottom: 18px; font-size: var(--fs); line-height: var(--lh); letter-spacing: 0; text-wrap: wrap; }
  html:not([lang="en"]) .hero h1.headline { max-width: 9.4em; }
  html[lang="en"] .hero h1.headline { font-size: var(--fs); line-height: var(--lh); max-width: 12.5em; text-wrap: balance; }
  .headline .hl { -webkit-box-decoration-break: clone; box-decoration-break: clone; }
  .hero .intro { grid-column: 1 / -1; grid-row: 2; max-width: none; margin-bottom: 22px; font-size: 14px; line-height: 1.85; }
  .hero .intro::before { content: ""; float: right; width: 144px; height: max(0px, calc(202px - 2 * var(--lh) * var(--fs) - 18px)); }
  .hero .actions { grid-column: 1; grid-row: 3; display: grid; justify-items: start; width: 100%; gap: 8px; }
  .hero .btn { min-height: 36px; padding: 0 16px; font-size: 13px; }
  .hero .btn svg { width: 14px; height: 14px; }
  .hero .actions .btn { justify-content: center; white-space: nowrap; }
  .hero .facts { grid-column: 1; grid-row: 4; flex-direction: column; align-items: flex-start; gap: 6px; margin-top: 18px; font-size: 12px; }
  .hero .facts span + span::before { display: none; }
  .hero .wrap > img { grid-column: 2; grid-row: 3 / span 2; align-self: start; width: 100%; height: auto; aspect-ratio: 5 / 7; object-position: center 22%; border-radius: 20px; }
}

/* 主視覺底下的三個事實：每項前面一個小圖示，最後一項是微發光的綠點（表示持續更新中） */
.facts { gap: 8px 20px; }
.facts span { display: inline-flex; align-items: center; gap: 7px; }
.facts span + span::before { display: none; }
.facts svg { flex-shrink: 0; width: 15px; height: 15px; color: var(--accent); }
.live-dot { flex-shrink: 0; width: 8px; height: 8px; margin: 0 3px; border-radius: 50%; background: #22C55E; box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.55); animation: live-glow 2.4s ease-out infinite; }
@keyframes live-glow { 0% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.55); } 70% { box-shadow: 0 0 0 7px rgba(34, 197, 94, 0); } 100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); } }
@media (prefers-reduced-motion: reduce) { .live-dot { animation: none; box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.25); } }

/* 丁點縮圖：改用正面半身大頭渲染（assets/dotti/front.png，用 3D 模型正對鏡頭渲染，不歪頭、不旋轉，左眼眨眼），
   身體在下緣被圖邊切掉，圖的下緣剛好貼齊縮圖框下緣；左右留白一樣，水平置中。
   圖的底色 #F3F6FA 和縮圖框底色一樣，邊界看不出來。 */
.row-thumb.cover-dotti img { width: 100%; height: 100%; object-fit: contain; object-position: center; }

/* v5（2026-12-02）：去背半身形象照（assets/photo/portrait.webp，680 × 800，順時針轉 5 度）。
   文字在左、照片在右；照片下緣貼齊主視覺和「關於」的交界線（用負的 margin-bottom 抵掉主視覺的下內距），
   照片疊在背景白色「丁」前面。DOM 順序改成文字在前、照片在後。 */
.hero .wrap > img.hero-portrait { border-radius: 0; box-shadow: none; object-fit: contain; object-position: center bottom; }
@media (min-width: 768px) {
  .hero { --pb: clamp(44px, 5vw, 72px); padding-bottom: var(--pb); }
  /* 人物整體縮小：頭頂約在大標第二行的高度（2026-12-02 使用者標紅線） */
  .hero .wrap { grid-template-columns: minmax(0, 1fr) clamp(200px, calc(24.5vw - 10px), 320px); gap: clamp(24px, 4vw, 64px); align-items: center; }
  .hero .wrap > img.hero-portrait { grid-column: 2; grid-row: 1; align-self: end; width: 100%; height: auto; aspect-ratio: 680 / 800; margin-bottom: calc(-1 * var(--pb)); translate: -15px 0; }
  /* 照片往中間（左）挪 15px */
  /* 背景「丁」的鉤尾藏到人物後面：鉤的左緣至少在照片左緣往內 8%（人物身體在照片底部幾乎占滿寬度）。
     --P 是照片寬、--m 是照片右緣到視窗右緣的距離；丁本來的位置（--r: -110px）已經夠就不動，只在照片太窄時把丁往右推。
     鉤左緣距視窗右緣 = --r + 丁寬 × 27/34。 */
  .hero-bg { --P: clamp(200px, calc(24.5vw - 10px), 320px); --m: max(48px, calc(50vw - 536px)); --r: min(-110px, calc(var(--m) + 0.92 * var(--P) - var(--w) * 27 / 34)); }
}
@media (max-width: 767px) {
  /* 交界線往上收到事實下方：下內距只留 8px，照片一樣貼齊交界線 */
  .hero { --pb: 8px; padding-bottom: var(--pb); }
  /* 照片從簡介下緣（按鈕上方 22px）一直到交界線，高度跟著左邊按鈕＋事實走，寬度依 680:800 等比例。
     contain: size 讓照片不參與列高計算，列高只由左邊內容決定，照片再用百分比高度填滿。
     右欄寬度不讓左邊按鈕被壓到：--lw 是左邊最寬的按鈕＋欄間距（中文 150px、英文 195px）；照片比右欄寬時在欄內等比例縮小、靠下對齊。 */
  .hero { --lw: 150px; }
  html[lang="en"] .hero { --lw: 195px; }
  .hero .wrap { grid-template-columns: minmax(0, 1fr) min(190px, 52%, calc(100% - var(--lw))); }
  .hero .wrap > img.hero-portrait { grid-column: 2; grid-row: 3 / span 2; align-self: start; justify-self: end; contain: size; width: auto; max-width: 100%; height: calc(100% + 22px + var(--pb)); aspect-ratio: 680 / 800; margin-top: -22px; margin-bottom: calc(-1 * var(--pb)); }
}

/* v6（2026-12-03）：主視覺第二顆按鈕改成「聯絡我」，展開後是信箱（mailto）和 LINE ID（按一下複製）；
   「看履歷」移到頁尾 LOGO 和信箱之間，深藍底上的小外框按鈕，選單往上展開。 */
.contact-menu { min-width: 260px; }
.contact-menu a, .contact-menu .copy-line { display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px 12px; border: 0; border-radius: 8px; background: none; color: var(--ink); font: inherit; font-size: 14px; text-align: left; text-decoration: none; white-space: nowrap; cursor: pointer; }
.contact-menu svg { flex-shrink: 0; color: var(--accent); }
.contact-menu .copy-line span { color: var(--text); }
.contact-menu .copy-line b { font-family: Inter, sans-serif; font-weight: 600; }
.contact-menu .copy-hint { margin-left: auto; padding-left: 12px; font-style: normal; font-size: 12px; font-weight: 700; color: var(--accent); }
.contact-menu a:hover, .contact-menu a:focus-visible, .contact-menu .copy-line:hover, .contact-menu .copy-line:focus-visible { background: var(--panel); color: var(--accent); outline: none; }
.footer-btn { display: inline-flex; align-items: center; gap: 6px; min-height: 32px; padding: 0 14px; border: 1px solid rgba(255, 255, 255, .35); border-radius: 999px; background: transparent; color: #fff; font: inherit; font-size: 13px; font-weight: 700; cursor: pointer; transition: border-color 150ms ease-out, color 150ms ease-out; }
.footer-btn:hover { border-color: #9CC2FF; color: #9CC2FF; }
.footer-btn:focus-visible { outline: 2px solid #9CC2FF; outline-offset: 2px; }
.footer-btn svg { width: 14px; height: 14px; }
footer .dl-menu { top: auto; bottom: calc(100% + 6px); }
footer .dl-menu:not([hidden]) { display: flex; flex-direction: column; gap: 2px; }
footer .dl-menu a { display: block; margin: 0; color: var(--ink); }
@media (prefers-reduced-motion: reduce) { .footer-btn { transition: none; } }
