:root {
  /* 版面想法：深夜藍的頁首與開場像夜晚，往下是檯燈照亮的暖紙；標題用手寫感楷體，內文用黑體 */
  --night: #232B45;
  --night-soft: #C9CFE0;
  --paper: #FFF9EE;
  --card: #FFFFFF;
  --lamp: #F4B94A;
  --lamp-deep: #8A5A0B;
  --lamp-wash: #FBEBC8;
  --sky-wash: #E9EEF6;
  --ink: #2A2433;
  --muted: #5F5866;
  --line: #EADFC8;
  --link: #3F5F8F;
  --cream: #FFF4DC;
  --display: 'LXGW WenKai TC', 'Noto Sans TC', 'PingFang TC', 'Microsoft JhengHei', serif;
  --body: 'Noto Sans TC', 'PingFang TC', 'Microsoft JhengHei', sans-serif;
  color-scheme: light;
}
* { box-sizing: border-box; }
html { font-size: 106.25%; -webkit-text-size-adjust: 100%; }
html[data-fs="l"] { font-size: 121%; }
html[data-fs="xl"] { font-size: 137.5%; }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: var(--body); line-height: 1.75; }
a { color: var(--link); }
a:hover { color: #27406A; }
a:focus-visible, button:focus-visible, main:focus-visible { outline: 3px solid var(--lamp); outline-offset: 3px; }
main:focus { outline: none; }
h1, h2, h3 { font-family: var(--display); line-height: 1.4; margin: 0; text-wrap: balance; }
p { margin: 0; }
.wrap { max-width: 1120px; margin: 0 auto; padding-left: 24px; padding-right: 24px; }
.skip { position: absolute; left: -999px; top: 0; background: var(--lamp); color: var(--ink); padding: 10px 16px; z-index: 10; }
.skip:focus { left: 8px; top: 8px; }

/* 頁首 */
.top { background: var(--night); color: var(--cream); }
.top-in { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 28px; padding-top: 14px; padding-bottom: 14px; }
.brand { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; color: var(--cream); text-decoration: none; min-height: 44px; margin-right: auto; }
.brand:hover { color: #fff; }
.brand svg { color: var(--lamp); flex: none; }
.brand-name { font-family: var(--display); font-size: 1.5rem; font-weight: 700; }
.brand-sub { font-size: 0.8rem; color: var(--night-soft); }
.nav { display: flex; flex-wrap: wrap; gap: 0 20px; }
.nav a { color: var(--cream); text-decoration: none; padding: 10px 0; font-size: 0.95rem; border-bottom: 2px solid transparent; }
.nav a:hover { color: #fff; border-bottom-color: var(--lamp); }
.nav a[aria-current="page"] { border-bottom-color: var(--lamp); }
.fs { display: flex; align-items: center; gap: 6px; }
.fs-label { font-size: 0.8rem; color: var(--night-soft); }
.fs button { font: inherit; font-size: 0.85rem; min-width: 44px; min-height: 40px; padding: 0 10px; border-radius: 20px; border: 1px solid #5A6385; background: transparent; color: var(--cream); cursor: pointer; }
.fs button[aria-pressed="true"] { background: var(--lamp); border-color: var(--lamp); color: var(--ink); font-weight: 700; }

/* 首頁開場 */
.hero { background: var(--night); color: var(--cream); }
.hero-in { display: flex; flex-wrap: wrap; align-items: center; gap: 40px; padding-top: 44px; padding-bottom: 72px; }
.hero-text { flex: 999 1 420px; min-width: 0; display: flex; flex-direction: column; gap: 22px; }
.hero h1 { font-size: clamp(2rem, 5vw, 3.1rem); line-height: 1.35; }
.hero p { max-width: 34em; font-size: 1.1rem; line-height: 1.9; color: #E6E2D6; }
.hero svg { flex: 1 1 220px; max-width: 300px; height: auto; }
.glow { animation: breathe 6s ease-in-out infinite; transform-origin: 140px 118px; }
@keyframes breathe { 0%, 100% { opacity: 0.75; } 50% { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .glow { animation: none; } }
.btns { display: flex; flex-wrap: wrap; gap: 14px; }
.btn { display: inline-flex; align-items: center; min-height: 52px; padding: 8px 26px; border-radius: 26px; background: var(--lamp); color: var(--ink); font-weight: 700; text-decoration: none; }
.btn:hover { background: #F7C766; color: var(--ink); }
.btn.ghost { background: transparent; border: 2px solid #8E97B5; color: var(--cream); font-weight: 500; }
.btn.ghost:hover { border-color: var(--cream); color: #fff; background: transparent; }

/* 共用區塊 */
.sec { padding-top: 56px; padding-bottom: 24px; display: flex; flex-direction: column; gap: 26px; }
.sec-head { display: flex; flex-direction: column; gap: 8px; }
.sec-head h2, .page h1 { font-size: 2rem; }
.sec-head p, .lead { color: var(--muted); max-width: 36em; }
.page { padding-top: 40px; padding-bottom: 64px; display: flex; flex-direction: column; gap: 28px; }
.crumb { font-size: 0.9rem; }
.crumb a { display: inline-block; padding: 8px 0; }

/* 階段卡片 */
.stages { display: flex; flex-wrap: wrap; gap: 16px; }
.stage { flex: 1 1 190px; min-width: 0; display: flex; flex-direction: column; gap: 10px; padding: 22px; border-radius: 16px; background: var(--card); border: 1px solid var(--line); color: var(--ink); text-decoration: none; }
.stage:hover { border-color: var(--lamp); color: var(--ink); }
.stage .num { font-family: var(--display); font-size: 1.8rem; color: var(--lamp-deep); line-height: 1; }
.stage .name { font-size: 1.2rem; font-weight: 700; }
.stage .q { font-size: 0.9rem; color: var(--muted); }
.stage .range { font-size: 0.85rem; color: var(--link); margin-top: auto; }

/* 影片清單 */
.stage-block { display: flex; flex-direction: column; gap: 14px; padding-top: 28px; border-top: 1px solid var(--line); }
.stage-block h2 { font-size: 1.5rem; }
.stage-block h2 span { color: var(--lamp-deep); margin-right: 10px; }
.eps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.ep { display: flex; align-items: center; gap: 16px; padding: 14px 18px; min-height: 64px; border-radius: 14px; background: var(--card); border: 1px solid var(--line); color: var(--ink); text-decoration: none; }
.ep:hover { border-color: var(--lamp); color: var(--ink); }
.ep .play { flex: none; width: 40px; height: 40px; border-radius: 50%; background: var(--night); color: var(--lamp); display: flex; align-items: center; justify-content: center; }
.ep .ep-no { flex: none; width: 5.2em; font-size: 0.85rem; color: var(--muted); }
.ep .ep-title { flex: 1 1 auto; min-width: 0; font-size: 1.05rem; font-weight: 500; }

/* 影片頁 */
.player { background: var(--night); border-radius: 18px; overflow: hidden; aspect-ratio: 16 / 9; display: flex; align-items: center; justify-content: center; color: var(--cream); }
.player video, .player iframe { width: 100%; height: 100%; border: 0; display: block; background: #000; }
.player-wait { display: flex; flex-direction: column; align-items: center; gap: 14px; padding: 24px; text-align: center; max-width: 26em; }
.player-wait svg { color: var(--lamp); }
.player-wait p { color: #E6E2D6; }
.player button.btn { border: 0; font: inherit; font-weight: 700; cursor: pointer; }
.pager { display: flex; flex-wrap: wrap; gap: 12px; justify-content: space-between; }
.pager a { flex: 1 1 260px; min-width: 0; display: flex; flex-direction: column; gap: 2px; padding: 14px 18px; border-radius: 14px; border: 1px solid var(--line); background: var(--card); text-decoration: none; color: var(--ink); }
.pager a:hover { border-color: var(--lamp); }
.pager a.next { text-align: right; }
.pager small { color: var(--muted); font-size: 0.8rem; }
.fine { font-size: 0.85rem; color: var(--muted); }

/* 言爸的信 */
.letter { background: var(--lamp-wash); border-radius: 20px; padding: clamp(28px, 5vw, 56px); display: flex; flex-wrap: wrap; gap: 24px 56px; }
.letter-side { flex: 1 1 240px; display: flex; flex-direction: column; gap: 8px; }
.eyebrow { font-size: 0.82rem; color: #6A5320; letter-spacing: 0.1em; }
.letter-body { flex: 999 1 420px; min-width: 0; max-width: 34em; font-family: var(--display); font-size: 1.22rem; line-height: 2; display: flex; flex-direction: column; gap: 18px; }
.letter-body .sign { font-size: 1.05rem; color: #4A3A12; }
.letter-body a { font-family: var(--body); font-size: 0.95rem; align-self: flex-start; padding: 10px 0; }

/* 故事清單 */
.story-list { display: flex; flex-direction: column; border-bottom: 1px solid var(--line); }
.story-row { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 28px; padding: 20px 0; border-top: 1px solid var(--line); color: var(--ink); text-decoration: none; }
.story-row:hover .who { color: var(--lamp-deep); }
.story-row .who { flex: 0 0 5.5rem; font-family: var(--display); font-size: 1.65rem; font-weight: 700; }
.story-row .now { flex: 1 1 280px; min-width: 0; font-size: 1.05rem; }
.story-row .by { flex: 1 1 240px; min-width: 0; font-size: 0.88rem; color: var(--muted); }

/* 閱讀頁（故事、信、給親友） */
.read { max-width: 36em; display: flex; flex-direction: column; gap: 22px; }
.read .meta { color: var(--muted); font-size: 0.92rem; }
.read .now-line { font-family: var(--display); font-size: 1.3rem; line-height: 1.7; color: #4A3A12; background: var(--lamp-wash); border-radius: 14px; padding: 16px 20px; }
.read .heads-up { background: var(--sky-wash); border-radius: 14px; padding: 14px 20px; font-size: 0.95rem; color: #3A4258; }
.read .body { display: flex; flex-direction: column; gap: 1.3em; font-size: 1.1rem; line-height: 2.05; overflow-wrap: anywhere; }
.read .body h2 { font-size: 1.4rem; margin-top: 0.8em; }
.read .body ul { margin: 0; padding-left: 1.3em; display: flex; flex-direction: column; gap: 4px; font-size: 0.98rem; line-height: 1.8; color: #3D3646; }
.read.hand .body { font-family: var(--display); font-size: 1.22rem; }
.tips { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 14px; }
.tips li { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 18px 22px; display: flex; flex-direction: column; gap: 6px; }
.tips strong { font-size: 1.12rem; }
.tips span { color: #454B5E; }
.plain-list { margin: 0; padding-left: 1.3em; display: flex; flex-direction: column; gap: 6px; }

/* 給親友（首頁區塊） */
.friends { background: var(--sky-wash); margin-top: 40px; }
.friends-in { display: flex; flex-wrap: wrap; gap: 28px 56px; padding-top: 56px; padding-bottom: 56px; }
.friends-side { flex: 1 1 300px; min-width: 0; display: flex; flex-direction: column; gap: 12px; }
.friends-side h2 { font-size: 2rem; }
.friends-side p { color: #454B5E; }
.friends-side a { align-self: flex-start; padding: 10px 0; }
.friends .tips { flex: 999 1 420px; min-width: 0; }
.friends .tips li { border-color: transparent; }

/* 頁尾 */
.foot { background: var(--night); color: var(--night-soft); font-size: 0.88rem; }
.foot-in { display: flex; flex-wrap: wrap; gap: 16px 48px; justify-content: space-between; padding-top: 36px; padding-bottom: 36px; }
.foot p { flex: 1 1 420px; max-width: 40em; }
.foot nav { display: flex; flex-wrap: wrap; gap: 6px 24px; }
.foot a { color: var(--cream); padding: 10px 0; }

@media (max-width: 560px) {
  .brand-sub { flex-basis: 100%; }
  .ep { flex-wrap: wrap; gap: 6px 14px; }
  .ep .ep-title { flex-basis: 100%; }
  .story-row .who { flex-basis: 100%; }
}
@media print {
  .top, .foot, .pager, .btns, .fs, .skip { display: none; }
  body { background: #fff; }
}
