/* ==========================================================
   蘇雋程 Nelson 作品集 — 共用樣式（全站只用這一份）
   換強調色：只改 :root 裡 --accent 開頭的三行
   ========================================================== */

:root {
  --bg: #f7f6f2;
  --surface: #ffffff;
  --ink: #17161c;
  --ink-2: #56545f;
  --ink-3: #8a8894;
  --line: #e3e1d9;

  --accent: #5b34f0;
  --accent-dark: #4322c9;
  --accent-soft: #efebff;
  --on-accent: #ffffff;

  --yellow: #ffd84d;
  --pink: #ff5c8a;
  --orange: #ff9b55;
  --teal: #12b5a6;
  --blue: #2256d9;

  --ok: #1c7c54;
  --ok-soft: #e6f4ed;
  --warn: #8a4a0c;
  --warn-soft: #fff0d8;
  --bad: #a3262e;
  --bad-soft: #fde9ea;
  --neutral-soft: #ecebfa;

  --font-body: "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", system-ui, sans-serif;
  --font-display: "Space Grotesk", var(--font-body);

  --wrap: 1120px;
  --radius: 14px;
  --radius-lg: 22px;
}

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

html { scroll-behavior: smooth; scroll-padding-top: 96px; -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.8;
  overflow-wrap: anywhere;
}

img, svg { max-width: 100%; }

a { color: var(--accent); text-underline-offset: 0.2em; }
a:hover { color: var(--accent-dark); }

button, input { font: inherit; }
button { cursor: pointer; }

:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 4px; }
main:focus { outline: none; }

/* balance／pretty：標題與段落換行時，避免最後一行只剩一兩個字 */
h1, h2, h3 { line-height: 1.3; margin: 0; font-weight: 900; letter-spacing: 0.01em; text-wrap: balance; }
p { margin: 0 0 1em; text-wrap: pretty; }

[hidden] { display: none !important; }

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

.skip {
  position: absolute; left: -999px; top: 0;
  background: var(--ink); color: #fff; padding: 8px 16px; z-index: 100;
}
.skip:focus { left: 8px; top: 8px; }

/* ---------- 頁首：滿版色帶 + 置中的膠囊導覽列 ---------- */

.band {
  height: 96px;
  background:
    radial-gradient(60% 140% at 8% 0%, #5b34f0 0 38%, transparent 38.5%),
    radial-gradient(40% 160% at 38% 110%, #ff5c8a 0 40%, transparent 40.5%),
    radial-gradient(36% 150% at 62% -10%, #ffb020 0 42%, transparent 42.5%),
    radial-gradient(44% 170% at 92% 100%, #12b5a6 0 40%, transparent 40.5%),
    #ffd84d;
}

/* 導覽列會跟著捲動停在上方；外層不擋滑鼠，只有膠囊本身可點 */
.nav {
  position: sticky;
  top: 12px;
  z-index: 30;
  margin: -30px auto 0;
  padding: 0 20px;
  display: flex;
  justify-content: center;
  pointer-events: none;
}

.nav__bar {
  pointer-events: auto;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
  box-shadow: 0 8px 24px rgba(25, 25, 36, 0.06);
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: center;
  gap: 4px 18px;
  padding: 8px 12px 8px 24px;
}

.nav__brand {
  font-weight: 900;
  font-size: 17px;
  color: var(--ink);
  text-decoration: none;
  white-space: nowrap;
  padding-right: 18px;
  border-right: 1px solid var(--line);
}
.nav__brand:hover { color: var(--ink); }
.nav__brand span { font-family: var(--font-display); font-weight: 700; color: var(--accent); margin-left: 6px; }

.nav__links { display: flex; flex-wrap: wrap; gap: 2px; list-style: none; margin: 0; padding: 0; }
.nav__links a {
  display: block;
  padding: 6px 14px;
  border-radius: 999px;
  color: var(--ink-2);
  text-decoration: none;
  font-size: 15px;
  font-weight: 500;
}
.nav__links a:hover,
.nav__links a[aria-current="page"] { background: var(--accent-soft); color: var(--accent-dark); }

/* ---------- 共用元件 ---------- */

.eyebrow {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--accent);
  margin: 0 0 14px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 10px 24px;
  border-radius: 999px;
  border: 1.5px solid var(--ink);
  color: var(--ink);
  background: transparent;
  font-weight: 700;
  font-size: 16px;
  text-decoration: none;
}
.btn:hover { background: var(--ink); color: #fff; }
.btn--primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.btn--primary:hover { background: var(--accent-dark); border-color: var(--accent-dark); color: #fff; }

/* 文字連結：後面帶箭頭的那種 */
.more {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 36px;
  color: var(--accent);
  font-size: 15px;
  font-weight: 700;
  text-decoration: none;
}
.more:hover { text-decoration: underline; }

.section { padding-top: 84px; }
.section__head { margin-bottom: 32px; display: grid; gap: 14px 56px; align-items: end; }
.section__num {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 15px;
  color: var(--accent);
  letter-spacing: 0.08em;
  display: block;
  margin-bottom: 10px;
}
.section__head h2 { font-size: clamp(1.6rem, 3.2vw, 2.3rem); }
.section__head p { color: var(--ink-2); margin: 0; }
.section__head--row { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: end; }

/* ---------- 首頁：首屏 ---------- */

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  gap: 48px;
  align-items: center;
  padding-top: 72px;
}
.hero h1 { font-size: clamp(2.1rem, 4.7vw, 3.7rem); line-height: 1.25; letter-spacing: 0; }
.hero h1 em { font-style: normal; color: var(--accent); }
.hero__lead { font-size: clamp(1.02rem, 1.5vw, 1.15rem); color: var(--ink-2); margin: 24px 0 28px; }
.hero__lead strong { color: var(--ink); font-weight: 700; }
.hero__actions { display: flex; flex-wrap: wrap; gap: 12px; }

/* 經歷卡：時間軸，白底，和下面的特點卡同一種樣式 */
.pathcard {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 28px 30px;
  min-width: 0;
}
.pathcard h2 { font-size: 1.3rem; margin-bottom: 18px; }
.path { list-style: none; margin: 0 0 14px 6px; padding: 0; }
.path li { position: relative; padding: 0 0 18px 22px; border-left: 2px solid var(--line); }
.path li:last-child { border-left-color: transparent; padding-bottom: 6px; }
.path li::before {
  content: "";
  position: absolute;
  left: -7px;
  top: 7px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--accent);
}
.path time { display: block; font-family: var(--font-display); font-size: 14px; font-weight: 500; color: var(--ink-2); line-height: 1.6; }
.path strong { display: block; font-size: 1.08rem; font-weight: 900; line-height: 1.5; }
.path li > span { display: block; font-size: 15px; color: var(--ink-2); line-height: 1.6; }
.pathcard__links { display: flex; flex-wrap: wrap; gap: 2px 22px; border-top: 1px solid var(--line); padding-top: 10px; }

/* 進行中的那一筆：圓點向外擴散，「進行中」後面三個點依序亮起 */
.path li.is-current::before {
  background: var(--surface);
  border: 3px solid var(--accent);
  animation: path-pulse 2s ease-out infinite;
}
.ing { color: var(--accent); font-family: var(--font-body); font-weight: 700; }
.ing__dots { display: inline-flex; gap: 3px; margin-left: 4px; vertical-align: 0.12em; }
.ing__dots i { width: 4px; height: 4px; border-radius: 50%; background: currentColor; opacity: 0.25; animation: ing-dot 1.4s ease-in-out infinite; }
.ing__dots i:nth-child(2) { animation-delay: 0.2s; }
.ing__dots i:nth-child(3) { animation-delay: 0.4s; }
@keyframes path-pulse {
  0% { box-shadow: 0 0 0 0 rgba(91, 52, 240, 0.45); }
  70%, 100% { box-shadow: 0 0 0 9px rgba(91, 52, 240, 0); }
}
@keyframes ing-dot {
  0%, 70%, 100% { opacity: 0.25; }
  35% { opacity: 1; }
}

/* ---------- 首頁：我的不同 ---------- */

.traits { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.trait {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 28px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  min-width: 0;
}
.trait h3 { font-size: 1.25rem; margin-bottom: 12px; }
.trait p { color: var(--ink-2); font-size: 16px; margin: 0 0 12px; }
.trait .trait__kicker { font-size: 14px; font-weight: 700; color: var(--accent); margin: 0 0 8px; letter-spacing: 0.04em; }
.trait .more { margin-top: auto; }

/* ---------- 作品卡片與彩色封面 ---------- */

.works { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 30px 24px; }
.works--wall { grid-template-columns: repeat(3, minmax(0, 1fr)); padding: 12px 0 8px; }
.work { min-width: 0; }
.work__link { display: block; color: var(--ink); text-decoration: none; border-radius: 18px; }
.work__link:hover { color: var(--ink); }
.work__link:hover .cover { transform: translateY(-4px); }
.work__link:hover .more { text-decoration: underline; }
.work h3 { font-size: 1.15rem; line-height: 1.5; margin: 16px 0 6px; }
.work p { color: var(--ink-2); font-size: 16px; margin: 0 0 4px; }

.cover {
  min-height: 230px;
  border-radius: 18px;
  padding: 22px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 18px;
  background: var(--yellow);
  color: #191924;
  transition: transform 0.16s ease;
}
.cover--purple { background: var(--accent); color: #fff; }
.cover--yellow { background: var(--yellow); }
.cover--teal { background: var(--teal); }
.cover--blue { background: var(--blue); color: #fff; }
.cover--orange { background: var(--orange); }
.cover--pink { background: var(--pink); }
.cover__top { display: flex; gap: 12px; justify-content: space-between; align-items: center; flex-wrap: wrap; }
.cover__top small { font-size: 13px; letter-spacing: 0.04em; }
.cover__status { font-size: 12px; padding: 3px 10px; border: 1px solid currentColor; border-radius: 999px; white-space: nowrap; line-height: 1.6; }
.cover__title { font-size: clamp(1.45rem, 2.7vw, 1.9rem); font-weight: 900; line-height: 1.35; }
.works--wall .cover { min-height: 215px; padding: 20px; }
.works--wall .cover__title { font-size: 1.5rem; }
.cover__keys { display: flex; gap: 12px; flex-wrap: wrap; font-size: 13px; }
.cover__keys span { border-bottom: 1px solid currentColor; padding-bottom: 3px; line-height: 1.5; }

/* ---------- 首頁：我怎麼做事 ---------- */

.legend { display: flex; flex-wrap: wrap; gap: 8px 24px; list-style: none; margin: 0 0 18px; padding: 0; font-size: 14px; color: var(--ink-2); }
.legend li { display: flex; align-items: center; gap: 8px; }

/* 「我」是紫色實心，「AI」是灰色 */
.who {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  height: 26px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
}
.who--me { background: var(--accent); color: #fff; }
.who--ai { background: #dddbd2; color: var(--ink); font-family: var(--font-display); }

.howsteps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 14px; counter-reset: s; }
.howstep {
  counter-increment: s;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  min-width: 0;
}
.howstep__top { display: flex; align-items: center; justify-content: space-between; width: 100%; margin-bottom: 14px; }
.howstep__top::after { content: counter(s, decimal-leading-zero); font-family: var(--font-display); font-weight: 700; font-size: 14px; color: var(--ink-3); }
.howstep h3 { font-size: 1.12rem; margin-bottom: 8px; }
.howstep p { color: var(--ink-2); font-size: 15px; line-height: 1.75; margin: 0 0 10px; }
.howstep .more { margin-top: auto; font-size: 14px; }
.howstep--ai { background: #f0eee6; border-style: dashed; border-color: #b9b6aa; }

/* ---------- 聯絡邀請、頁尾、回頂端 ---------- */

.cta {
  margin-top: 84px;
  padding: 40px 44px;
  border-radius: var(--radius-lg);
  background: var(--accent-soft);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}
.cta > div:first-child { flex: 1 1 320px; min-width: 0; }
.cta .eyebrow { margin-bottom: 8px; }
.cta h2 { font-size: clamp(1.4rem, 2.8vw, 1.9rem); margin-bottom: 10px; }
.cta p { color: var(--ink-2); margin: 0; }
.cta__actions { display: flex; flex-wrap: wrap; gap: 12px; }
.cta .btn:not(.btn--primary) { background: var(--surface); }
.cta .btn:not(.btn--primary):hover { background: var(--ink); }

.footer { margin-top: 84px; border-top: 1px solid var(--line); padding: 26px 0 48px; color: var(--ink-2); font-size: 14px; }
.footer__in { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px 32px; flex-wrap: wrap; }
.footer p { margin: 0 0 4px; max-width: 54em; }
.footer nav { display: flex; gap: 20px; }
.footer nav a { color: var(--ink-2); text-decoration: none; }
.footer nav a:hover { color: var(--accent); text-decoration: underline; }

.page-controls { position: fixed; right: 20px; bottom: 20px; z-index: 40; display: flex; gap: 8px; }
.page-controls button {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 7px 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
  box-shadow: 0 3px 15px rgba(25, 25, 36, 0.08);
  font-size: 14px;
  color: var(--ink);
}
.page-controls button:hover { border-color: var(--accent); color: var(--accent); }

/* ---------- 內頁標題區（作品集、關於我、聯絡） ---------- */

.phead {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 0.9fr);
  gap: 24px 48px;
  align-items: end;
  padding-top: 64px;
}
.phead--center { align-items: center; }
.phead h1 { font-size: clamp(2rem, 4.4vw, 3.3rem); line-height: 1.25; letter-spacing: 0; }
.phead h1 em { font-style: normal; color: var(--accent); }
.phead__lead { font-size: clamp(1.02rem, 1.5vw, 1.15rem); color: var(--ink-2); margin: 0; }
.phead > div > .phead__lead { margin-top: 20px; }

/* 資訊卡：求職方向（白底，和首頁的卡片一致） */
.factcard {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 26px 28px;
  min-width: 0;
}
.factcard h2 { font-size: 1.2rem; margin-bottom: 14px; }
.facts { margin: 0; }
.facts > div + div { margin-top: 12px; }
.facts dt { font-size: 13px; color: var(--ink-2); font-weight: 500; }
.facts dd { margin: 2px 0 0; font-size: 16px; font-weight: 700; line-height: 1.7; }
.facts a { color: var(--ink); }
.factcard .btn { margin-top: 18px; }

/* 左欄標題、右欄內容：寬螢幕右邊不留空 */
.block { padding-top: 64px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 18px; }
.block > h2 { font-size: clamp(1.35rem, 2.4vw, 1.7rem); }
.block__body { min-width: 0; }
.block__body > :last-child { margin-bottom: 0; }
.block__lead { font-size: 1.15rem; font-weight: 700; margin: 0 0 22px; }

/* 我的故事：四小段 */
.story { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 28px 40px; }
.story h3 { font-size: 1.08rem; margin-bottom: 8px; }
.story h3 span { display: block; font-family: var(--font-display); font-size: 14px; font-weight: 700; color: var(--accent); letter-spacing: 0.04em; margin-bottom: 2px; }
.story p { color: var(--ink-2); font-size: 16px; margin: 0; }

.timeline { list-style: none; margin: 0; padding: 0; border-top: 1.5px solid var(--ink); }
.timeline > li { display: grid; grid-template-columns: 160px minmax(0, 1fr); gap: 8px 24px; padding: 22px 0; border-bottom: 1px solid var(--line); }
.timeline time { font-family: var(--font-display); font-size: 15px; font-weight: 500; color: var(--ink-2); padding-top: 3px; }
.timeline h3 { font-size: 1.15rem; line-height: 1.5; }
.timeline p { color: var(--ink-2); font-size: 16px; margin: 0 0 8px; }
.timeline .timeline__org { font-size: 15px; margin: 0 0 10px; }
.timeline ul { list-style: disc; margin: 0 0 8px; padding-left: 1.2em; color: var(--ink-2); font-size: 16px; }
.timeline ul li { margin: 4px 0; }
.timeline__body > :last-child { margin-bottom: 0; }

.tag {
  display: inline-block;
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
  padding: 6px 10px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-dark);
  white-space: nowrap;
  vertical-align: middle;
  margin-left: 8px;
}

.chips { border-top: 1.5px solid var(--ink); }
.chips > div { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px 24px; padding: 18px 0; border-bottom: 1px solid var(--line); align-items: start; }
.chips h3 { font-size: 15px; color: var(--accent); letter-spacing: 0.04em; padding-top: 5px; }
.chips ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.chips li { background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 4px 14px; font-size: 15px; }

/* ---------- 作品集：搜尋與篩選 ---------- */

.filters { border-top: 1px solid var(--line); margin-top: 40px; padding: 26px 0 10px; }
.search-row { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; }
.search-row label { font-size: 15px; font-weight: 700; white-space: nowrap; }
input[type="search"] {
  flex: 1;
  min-width: 0;
  min-height: 48px;
  padding: 10px 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  color: var(--ink);
}
.reset-button { min-height: 44px; border: 0; background: transparent; color: var(--accent); font-size: 14px; font-weight: 700; padding: 8px 4px; white-space: nowrap; }
.reset-button:hover { text-decoration: underline; }
.filter-group { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 10px; }
.filter-label { min-width: 76px; font-size: 14px; font-weight: 700; }
.filter-button { border: 1px solid var(--line); border-radius: 999px; min-height: 40px; padding: 6px 16px; font-size: 14px; background: var(--surface); color: var(--ink); }
.filter-button:hover { border-color: var(--accent); }
.filter-button[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: #fff; }
.result-count { font-size: 14px; color: var(--ink-2); margin: 16px 0 0; }

.no-results { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 36px; margin: 12px 0 0; text-align: center; }
.no-results h2 { font-size: 1.3rem; margin-bottom: 8px; }
.no-results p { color: var(--ink-2); }

.archive { margin-top: 44px; }
.archive details { background: #efeee8; border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 22px; }
.archive summary { min-height: 44px; display: flex; align-items: center; gap: 12px; font-weight: 700; cursor: pointer; }
.archive summary span { font-size: 13px; font-weight: 500; color: var(--ink-2); }
.archive p { font-size: 15px; color: var(--ink-2); margin: 8px 0 4px; }

/* ---------- 聯絡頁 ---------- */

/* 兩張等寬的卡：左邊寫信、右邊 104 履歷 */
.contact-layout { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; padding-top: 44px; align-items: stretch; }
.contact-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 30px 32px; min-width: 0; display: flex; flex-direction: column; align-items: flex-start; }
.contact-card h2 { font-size: 1.4rem; margin-bottom: 10px; }
.contact-card p { color: var(--ink-2); font-size: 16px; margin: 0 0 16px; }
.email-address { display: inline-block; font-size: clamp(1.15rem, 2.5vw, 1.5rem); font-weight: 900; color: var(--ink); }
.contact-card .hero__actions { margin-top: 18px; }
.contact-card .copy-feedback { min-height: 28px; font-size: 14px; margin: 12px 0 0; color: var(--ink); }
/* 示意按鈕：虛線外框、不能點，等 104 履歷連結補上後換成正式按鈕（做法見 README） */
.btn--placeholder { border-style: dashed; border-color: var(--ink-3); color: var(--ink-2); cursor: not-allowed; }
.btn--placeholder:hover { background: transparent; color: var(--ink-2); }
.contact-card .placeholder-note { font-size: 14px; margin: 12px 0 0; }
.placeholder-note .tag { margin: 0 8px 0 0; }

/* ---------- 作品內頁 ---------- */

.breadcrumbs { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; font-size: 14px; color: var(--ink-2); padding-top: 40px; }
.breadcrumbs a { text-decoration: none; font-weight: 700; }
.breadcrumbs a:hover { text-decoration: underline; }

.case-header { padding: 18px 0 30px; }
.case-header .eyebrow { font-size: 14px; margin-bottom: 12px; }
.case-header h1 { font-size: clamp(1.9rem, 3.9vw, 2.9rem); line-height: 1.3; letter-spacing: 0; }
.case-summary { font-size: clamp(1.02rem, 1.5vw, 1.15rem); color: var(--ink-2); margin: 16px 0 0; max-width: 46em; }

.archive-note { background: #efeee8; border-left: 4px solid var(--accent); padding: 16px 20px; font-size: 15px; margin: 0 0 24px; }

/* 章節列：一條細框，裡面等寬分格。1px 的間隙露出底色當分隔線，換成幾欄都整齊 */
.case-section-nav {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(0, 1fr);
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}
.case-section-nav a {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 8px 6px;
  background: var(--surface);
  font-size: 14px;
  line-height: 1.4;
  text-align: center;
  color: var(--ink-2);
  text-decoration: none;
}
.case-section-nav a:hover { background: var(--accent-soft); color: var(--accent-dark); }
.case-section-nav a:focus-visible { outline-offset: -3px; border-radius: 0; }

.case-section { margin-top: 44px; padding-top: 40px; border-top: 1px solid var(--line); }
.case-section-nav + .case-section { border-top: 0; margin-top: 0; padding-top: 44px; }
.case-section h2 { font-size: clamp(1.35rem, 2.4vw, 1.7rem); margin-bottom: 16px; }
.case-section > p { color: var(--ink-2); margin: 0; }

/* 原本／現在 */
.ba { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.ba__card { border-radius: var(--radius); padding: 24px 26px; min-width: 0; }
.ba__card--before { background: #efeee8; border: 1px solid var(--line); }
.ba__card--after { background: var(--accent-soft); border: 1px solid #d9d0ff; }
.ba__label { font-size: 14px; font-weight: 700; letter-spacing: 0.06em; margin: 0 0 8px; color: var(--ink-2); }
.ba__card--after .ba__label { color: var(--accent-dark); }
.ba__text { font-size: 17px; margin: 0; color: var(--ink); }
.ba__note { display: block; font-size: 14px; color: var(--ink-2); margin-top: 8px; }

.case-io { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin: 24px 0 0; }
.case-io > div { padding: 16px 20px; border-left: 3px solid var(--accent); background: var(--surface); }
.case-io > div:nth-child(2) { border-color: var(--teal); }
.case-io dt { font-size: 14px; font-weight: 700; margin-bottom: 6px; }
.case-io dd { font-size: 16px; margin: 0; color: var(--ink-2); }

/* 處理流程：滑鼠移上去、點選或鍵盤聚焦都會切換說明 */
.case-flow-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.case-flow-head h2 { margin: 0; }
.case-flow-head span { font-size: 14px; color: var(--ink-2); }
.case-nodes { display: grid; grid-template-columns: repeat(var(--case-count), minmax(0, 1fr)); gap: 12px; list-style: none; padding: 0; margin: 22px 0; }
.case-nodes li { min-width: 0; }
.case-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-height: 124px;
  padding: 16px 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
  line-height: 1.5;
}
.case-step > span {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--yellow);
  color: #191924;
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 700;
}
.case-step strong { font-size: 15px; font-weight: 700; }
.case-step small { font-size: 12px; color: var(--ink-2); }
/* 「目前顯示」平常只是隱形、仍佔位置，切換步驟時節點高度才不會跳動 */
.case-step .node-selected { visibility: hidden; color: var(--accent); font-weight: 700; }
.case-step:hover { border-color: var(--accent); }
.case-step[aria-pressed="true"] { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.case-step[aria-pressed="true"] > span { background: var(--accent); color: #fff; }
.case-step[aria-pressed="true"] .node-selected { visibility: visible; }
.case-step-detail { background: var(--surface); border-left: 4px solid var(--accent); padding: 22px 24px; }
.case-step-detail h3 { font-size: 1.2rem; margin-bottom: 10px; }
.case-step-detail p { font-size: 16px; margin: 0; }
.case-step-detail .case-focus { font-size: 14px; color: var(--ink-2); margin-top: 12px; }

/* 程式畫面：實際截圖。圖片不放大超過原尺寸，點圖另開原圖 */
.shot { margin: 22px 0 0; min-width: 0; }
.shot a { display: inline-block; max-width: 100%; border: 1px solid #ced3dd; border-radius: var(--radius); overflow: hidden; box-shadow: 0 12px 28px rgba(32, 39, 61, 0.05); background: var(--surface); line-height: 0; }
.shot img { display: block; max-width: 100%; max-height: 720px; width: auto; height: auto; }
.shot figcaption { font-size: 14px; color: var(--ink-2); margin: 12px 2px 0; }

/* 直式或接近方形的截圖：左邊截圖、右邊畫面對照，右邊不留空 */
.shot-side { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 24px; align-items: start; margin-top: 22px; }
.shot-side > * { min-width: 0; }
.shot-side .shot { margin-top: 0; }
.case-section .shot-side h3.shot-heading { margin-top: 0; }
.shot-side .shot-notes { grid-template-columns: minmax(0, 1fr); }

/* 畫面對照：用截圖上看得到的字說明每一區 */
.case-section h3.shot-heading { font-size: 1.15rem; margin: 30px 0 14px; }
.shot-notes { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 16px; }
.shot-notes li { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 20px; min-width: 0; }
.shot-notes li:last-child:nth-child(odd) { grid-column: 1 / -1; }
.shot-notes strong { display: block; font-size: 16px; margin-bottom: 4px; }
.shot-notes span { display: block; font-size: 15px; color: var(--ink-2); line-height: 1.7; }
/* 輸出示意直接放表格時（沒有視窗外框），補上白底 */
.case-section > .mock-table-wrap { background: var(--surface); }

/* 技術選擇：我提的條件 → 採用的做法 */
.tech-lead { font-size: 15px; margin-bottom: 16px !important; }
.tech-arch { font-size: 15px; margin-top: 14px !important; }

/* 輸出示意：Windows 風格外框，資料一律虛構 */
.mock-window { background: var(--surface); border: 1px solid #ced3dd; border-radius: var(--radius); overflow: hidden; box-shadow: 0 12px 28px rgba(32, 39, 61, 0.05); margin: 22px 0 0; min-width: 0; }
.mock-titlebar { display: flex; justify-content: space-between; align-items: center; gap: 12px; background: #f0f2f7; border-bottom: 1px solid #dfe3eb; min-height: 44px; padding-left: 16px; font-size: 13px; color: #454859; }
.mock-title { font-weight: 500; min-width: 0; padding: 10px 0; }
.mock-window-controls { display: flex; align-items: stretch; align-self: stretch; flex-shrink: 0; font: 17px/1 system-ui, sans-serif; color: #535767; }
.mock-window-controls > span { display: flex; align-items: center; justify-content: center; width: 38px; }
.mock-window-controls > span:last-child { font-size: 22px; }
.mock-body { padding: 22px; min-width: 0; }
.mock-toolbar { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 10px; padding: 0 0 16px; font-size: 14px; color: var(--ink-2); }
.mock-table-wrap { overflow-x: auto; border: 1px solid #e0e4ec; border-radius: 9px; max-width: 100%; overscroll-behavior-x: contain; }
.mock-table { border-collapse: collapse; width: 100%; min-width: 580px; font-size: 14px; line-height: 1.6; }
.mock-table th, .mock-table td { padding: 12px 14px; text-align: left; vertical-align: middle; border-bottom: 1px solid #e5e8ef; white-space: nowrap; }
.mock-table th { font-weight: 700; background: #f3f5f9; color: #454859; }
.mock-table tbody th { background: transparent; color: var(--ink); }
.mock-table tr:last-child td, .mock-table tbody tr:last-child th { border-bottom: 0; }
.mock-table tbody tr:nth-child(even) { background: #fafbfd; }
.mock-table small { display: block; font-size: 12px; }
.mock-status { display: inline-block; padding: 4px 9px; border-radius: 6px; background: #eef0f5; color: #4f5362; font-size: 12px; line-height: 1.5; font-weight: 700; white-space: nowrap; }
.mock-status[data-state="ok"] { background: var(--ok-soft); color: #1e5c3b; }
.mock-status[data-state="warn"] { background: var(--warn-soft); color: var(--warn); }
.mock-status[data-state="error"] { background: var(--bad-soft); color: var(--bad); }
.mock-status[data-state="neutral"] { background: var(--neutral-soft); color: #4d4385; }
.mock-cell-attention { background: #fff6d3 !important; color: #725419; }
.mock-cell-review { color: var(--bad) !important; font-weight: 700; text-decoration: underline dotted; text-underline-offset: 4px; }
.mock-highlight { background: var(--accent-soft); color: #4b3194; }
p.mock-highlight { border-radius: 8px; padding: 10px 14px; font-size: 14px; margin: 0 0 8px; }
span.mock-highlight { border-radius: 6px; padding: 3px 8px; }
.mock-note { font-size: 14px; color: var(--ink-2); margin: 16px 0 0; }
.mock-caption, .case-section > .mock-caption { font-size: 14px; color: var(--ink-2); margin: 12px 2px 0; }
.mock-window .mock-caption { margin: 0; padding: 0 22px 16px; }
.mock-output-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 210px), 1fr)); gap: 14px; }
.mock-output-card { background: #f7f8fc; border: 1px solid #e0e4ed; border-radius: 10px; padding: 18px; min-width: 0; font-size: 14px; }
.mock-output-card h3 { font-size: 1.02rem; margin: 4px 0 8px; }
.mock-output-card p { color: var(--ink-2); margin: 0 0 8px; }
.mock-output-card p.mock-highlight { color: #4b3194; }
.mock-output-card > :last-child { margin-bottom: 0; }

.case-decisions { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; }
.case-decisions article { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px 24px; }
.case-decisions h3 { font-size: 1.1rem; line-height: 1.5; margin-bottom: 8px; }
.case-decisions p { font-size: 16px; margin: 0; color: var(--ink-2); }

.case-outcomes { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.case-section > p + .case-outcomes { margin-top: 20px; }
.outcome-card { min-width: 0; background: #fff5c9; border: 1px solid #eee0a5; border-radius: var(--radius); padding: 22px; }
.outcome-card:nth-child(2) { background: #edf1ff; border-color: #d9e1ff; }
.outcome-card:nth-child(3) { background: #e9f7f2; border-color: #cce8de; }
.outcome-label { font-size: 13px; font-weight: 700; color: var(--ink-2); margin: 0 0 8px; }
.outcome-value { font-size: 1.3rem; line-height: 1.45; font-weight: 900; margin: 0 0 10px; }
.outcome-description { font-size: 15px; color: var(--ink-2); margin: 0; }

.case-table { border-collapse: collapse; width: 100%; font-size: 16px; table-layout: fixed; }
.case-table th, .case-table td { padding: 14px 16px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.case-table thead th { font-size: 14px; background: #efeee8; font-weight: 700; }
.case-table tbody th { font-weight: 700; width: 35%; }

.verification-note { font-size: 15px; margin-bottom: 14px !important; }
.case-list { margin: 0; padding-left: 1.4em; }
.case-list li { margin-bottom: 10px; }
.case-example { margin-top: 26px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; }
.case-example h3 { font-size: 1.15rem; margin-bottom: 6px; }
.case-example > p { font-size: 14px; margin: 0 0 14px; color: var(--ink-2); }

.case-neighbours { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-top: 56px; padding-top: 28px; border-top: 1.5px solid var(--ink); }
.case-neighbours a { display: flex; flex-direction: column; gap: 4px; padding: 18px 22px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); color: var(--ink); text-decoration: none; min-height: 96px; }
.case-neighbours a:hover { border-color: var(--accent); color: var(--accent); }
.case-neighbours small { color: var(--ink-2); font-size: 13px; }
.case-neighbours strong { font-size: 1.05rem; font-weight: 700; }
.case-neighbours a:only-child.is-next { grid-column: 2; }
.case-bottom { display: flex; gap: 12px; flex-wrap: wrap; padding-top: 28px; }

/* ---------- 寬螢幕 ---------- */

@media (min-width: 900px) {
  .section__head { grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr); }
  .section__head--row { display: flex; }
  .block { grid-template-columns: 200px minmax(0, 1fr); gap: 48px; }
  .block > h2 { position: sticky; top: 96px; align-self: start; }
  .chips > div { grid-template-columns: 150px minmax(0, 1fr); }
}

/* ---------- 窄螢幕 ---------- */

@media (max-width: 1000px) {
  .howsteps { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .works--wall { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  /* 章節列放不下一排九格時，改成三欄三列 */
  .case-section-nav { grid-auto-flow: row; grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 860px) {
  .hero { grid-template-columns: minmax(0, 1fr); gap: 36px; padding-top: 52px; }
  .phead, .contact-layout, .shot-side { grid-template-columns: minmax(0, 1fr); }
  .case-section .shot-side h3.shot-heading { margin-top: 6px; }
  .phead { padding-top: 48px; align-items: start; }
  .case-nodes { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .case-nodes > li:last-child:nth-child(odd) { grid-column: 1 / -1; }
  .case-outcomes { grid-template-columns: minmax(0, 1fr); }
  .case-step { min-height: 0; }
}

@media (max-width: 700px) {
  .howsteps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .traits, .works, .story, .ba, .case-io, .shot-notes { grid-template-columns: minmax(0, 1fr); }
  .timeline > li { grid-template-columns: minmax(0, 1fr); gap: 2px; }
}

@media (max-width: 640px) {
  body { font-size: 16px; }
  .wrap { padding: 0 20px; }
  .band { height: 76px; }
  .nav { padding: 0 12px; }
  .nav__bar { border-radius: 22px; padding: 8px 10px 8px 16px; gap: 2px 10px; }
  .nav__brand { font-size: 16px; padding-right: 10px; }
  .nav__brand span { display: none; }
  .nav__links a { padding: 6px 8px; font-size: 14px; }
  .section { padding-top: 60px; }
  .block { padding-top: 48px; }
  .trait, .pathcard, .factcard, .contact-card, .case-example { padding: 22px; }
  .cta { margin-top: 60px; padding: 28px 24px; }
  .cta h2 br { display: none; }
  .footer { margin-top: 60px; }
  .works--wall { grid-template-columns: minmax(0, 1fr); }
  .search-row { flex-wrap: wrap; gap: 8px; }
  .search-row label { flex-basis: 100%; }
  .filter-label { flex-basis: 100%; }
  .mock-body { padding: 14px; }
  .mock-window .mock-caption { padding: 0 14px 14px; }
  .mock-titlebar { padding-left: 12px; font-size: 12px; }
  .mock-window-controls > span { width: 28px; }
  .case-neighbours { grid-template-columns: minmax(0, 1fr); }
  .case-neighbours a:only-child.is-next { grid-column: auto; }
  .case-table th, .case-table td { padding: 11px 10px; font-size: 15px; }
  .page-controls { right: 14px; bottom: 14px; }
}

@media (max-width: 480px) {
  .howsteps { grid-template-columns: minmax(0, 1fr); }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .cover { transition: none; }
  .work__link:hover .cover { transform: none; }
  .path li.is-current::before, .ing__dots i { animation: none; }
  .ing__dots i { opacity: 1; }
}

@media print {
  .band, .nav, .page-controls, .hero__actions, .filters { display: none; }
  body { background: #fff; }
}
