/* AX Web Lab 介面樣式（UX-04 元件）。token 在 tokens.css。 */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  font-weight: 500;
  overflow-wrap: anywhere;
  min-height: 100vh;
}
img, svg { max-width: 100%; }
a { color: var(--coral-ink); text-underline-offset: 3px; }
:focus-visible { outline: 3px solid var(--coral-ink); outline-offset: 3px; border-radius: 10px; }
h1, h2, h3, h4 { font-family: var(--font-round); font-weight: 800; line-height: var(--lh-tight); margin: 0; }
p { margin: 0 0 var(--sp-3); }
.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 var(--gutter); }
.nw { display: inline-block; }
.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip { position: absolute; left: -999px; top: 8px; }
.skip:focus { left: 8px; z-index: 50; background: var(--ink); color: var(--bg); padding: 8px 12px; border-radius: var(--r-sm); }
[hidden] { display: none !important; }

/* 貼紙 */
.sticker { background: var(--surface); border: var(--bw) solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow); }
.sticker.flat { box-shadow: none; }
.sticker.dashed { border-style: dashed; box-shadow: none; }

/* 頁首頁尾 */
.top .wrap { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); padding-top: var(--sp-4); padding-bottom: var(--sp-4); }
.brand { display: inline-flex; align-items: center; gap: var(--sp-2); font-family: var(--font-round); font-weight: 800; font-size: var(--fs-lg); color: var(--ink); text-decoration: none; }
.brand .mascot { width: 40px; height: 34px; }
.brand:has(.wordmark) { min-height: 44px; }
.wordmark {
  display: inline-flex; align-items: baseline; gap: .23em; white-space: nowrap;
  font: 750 22px/1.08 system-ui, sans-serif; letter-spacing: -.055em;
}
.wordmark b {
  position: relative; isolation: isolate; padding-right: .1em;
  font-size: 1.32em; font-style: italic; font-weight: 900; letter-spacing: -.085em;
}
.wordmark b::after {
  content: ""; position: absolute; z-index: -1; inset: auto -.01em .02em .08em;
  height: .18em; background: var(--sun); transform: skewX(-20deg);
}
.top .meta { font-size: var(--fs-sm); color: var(--ink-2); text-align: right; line-height: 1.5; }
.top .meta b { color: var(--ink); }
footer.foot { padding: var(--sp-8) 0 var(--sp-16); font-size: var(--fs-sm); color: var(--ink-2); }
footer.foot .wrap { display: flex; flex-wrap: wrap; gap: var(--sp-3) var(--sp-6); align-items: center; justify-content: space-between; }
footer.foot nav.links { display: flex; flex-wrap: wrap; column-gap: var(--sp-4); }
footer.foot nav.links a { display: inline-flex; align-items: center; min-height: var(--sp-11); }
.made { display: inline-flex; align-items: center; gap: var(--sp-2); flex-wrap: wrap; }
.made img { height: 22px; width: auto; }
.logo-dark { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .logo-light { display: none; }
  :root:not([data-theme="light"]) .logo-dark { display: inline; }
}
:root[data-theme="dark"] .logo-light { display: none; }
:root[data-theme="dark"] .logo-dark { display: inline; }
.demo-badge { position: fixed; right: 10px; bottom: 10px; z-index: 40; background: var(--ink); color: var(--bg); font-size: 12px; padding: 4px 12px; border-radius: var(--r-pill); }

/* 按鈕 */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--sp-2);
  font-family: var(--font-round); font-weight: 800; font-size: 18px; line-height: 1.3;
  border: var(--bw) solid var(--line); border-radius: var(--r-pill); padding: 11px 26px;
  background: var(--coral-ink); color: var(--on-coral); box-shadow: 4px 4px 0 var(--line);
  cursor: pointer; text-decoration: none; min-height: 48px;
  transition: transform var(--dur-fast) var(--ease-out), box-shadow var(--dur-fast) var(--ease-out);
}
.btn:hover { transform: translate(-1px, -1px); box-shadow: 5px 5px 0 var(--line); }
.btn:active { transform: translate(3px, 3px); box-shadow: 1px 1px 0 var(--line); }
.btn.ghost { background: var(--surface); color: var(--ink); font-size: var(--fs-md); padding: 8px 18px; min-height: 44px; }
.btn.sun { background: var(--sun); color: var(--on-sun); }
.btn:disabled, .btn[aria-disabled="true"] { background: var(--soft); color: var(--ink-2); box-shadow: none; cursor: not-allowed; border-style: dashed; transform: none; }
.linkish { font: inherit; background: none; border: 0; padding: 0; color: var(--coral-ink); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }

/* 標籤 pill：顏色只在小圖示上，字一律用 ink */
.pill { display: inline-flex; align-items: center; gap: 6px; font-family: var(--font-round); font-weight: 800; font-size: var(--fs-sm); border: 2px solid var(--line); border-radius: var(--r-pill); padding: 1px 12px 1px 6px; background: var(--surface); color: var(--ink); white-space: nowrap; }
.pill .dot { width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--line); display: inline-grid; place-items: center; font-size: 11px; line-height: 1; color: var(--on-fill); flex: none; }
.pill.good .dot { background: var(--good-fill); }
.pill.mid .dot { background: var(--mid-fill); }
.pill.bad .dot { background: var(--bad-fill); border-radius: 5px; transform: rotate(8deg); }
.pill.neutral .dot { background: var(--neutral-fill); border-style: dashed; }
.pill.lock .dot { background: var(--sun); border-radius: 5px; }
.pill.plain { padding-left: 12px; }

/* 版面 */
main { display: block; }
section.part { padding: var(--sp-11) 0 var(--sp-1); }
.part > h2, .part .h { font-size: var(--fs-2xl); margin-bottom: 6px; }
.part .lead { margin: 0 0 var(--sp-5); color: var(--ink-2); }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--sp-5); }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--sp-5); }

/* ---------------------------------------------------------------- 貓頭鷹 */
.mascot { display: block; width: 140px; height: auto; aspect-ratio: 1405 / 1190; overflow: visible; }
.mascot.sm { width: 64px; }
.mascot.md { width: 110px; }
.mascot.lg { width: 200px; }
.mascot [data-layer="eye-left"], .mascot [data-layer="eye-right"] { transform-box: fill-box; transform-origin: 50% 0; }
.mascot.alive [data-layer="eye-left"], .mascot.alive [data-layer="eye-right"] { animation: owl-blink 5.2s infinite; }
.mascot.alive [data-layer="owl"] { transform-box: fill-box; transform-origin: 50% 100%; animation: owl-sway 3.6s ease-in-out infinite; }
.mascot.alive [data-layer="prop"] { transform-box: fill-box; transform-origin: 50% 50%; animation: prop-bob 2.4s ease-in-out infinite; }
.mascot.pop [data-layer="prop"] { transform-box: fill-box; transform-origin: 50% 50%; animation: prop-pop 480ms var(--ease-pop) both; }
@keyframes owl-blink { 0%, 92%, 100% { transform: scaleY(1); } 95% { transform: scaleY(.12); } }
@keyframes owl-sway { 0%, 100% { transform: rotate(0deg); } 50% { transform: rotate(-1.6deg); } }
@keyframes prop-bob { 50% { transform: translateY(-14px) rotate(-4deg); } }
@keyframes prop-pop { from { transform: scale(.2); opacity: 0; } to { transform: scale(1); opacity: 1; } }

/* ---------------------------------------------------------------- 旁白氣泡 */
.bubble { position: relative; background: var(--surface); border: var(--bw) solid var(--line); border-radius: 18px 18px 18px 6px; box-shadow: var(--shadow-sm); padding: 10px 14px; margin: 0; max-width: 36em; }
.bubble p { margin: 0; }
.bubble .kind { display: inline-flex; align-items: center; gap: 6px; font-family: var(--font-round); font-weight: 800; font-size: var(--fs-xs); color: var(--ink-2); margin-bottom: 2px; }
.bubble .kind::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--owl); }
.bubble.k-done { background: var(--soft-2); }
.bubble.k-stuck, .bubble.k-denied, .bubble.k-blocked { border-style: dashed; }
.bubble.typing p::after { content: "▍"; animation: caret 900ms steps(2) infinite; margin-left: 2px; color: var(--ink-2); }
@keyframes caret { 50% { opacity: 0; } }
.bubble.enter { animation: bubble-in var(--dur-med) var(--ease-pop) both; }
@keyframes bubble-in { from { transform: translateY(8px) scale(.96); opacity: 0; } }
.chat { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--sp-3); }
.chat li { display: grid; grid-template-columns: 36px minmax(0, 1fr); gap: var(--sp-2); align-items: end; }
.chat li .no { font-family: var(--font-round); font-weight: 800; font-size: var(--fs-xs); color: var(--ink-2); text-align: center; padding-bottom: 6px; }

/* ---------------------------------------------------------------- 分數圓環 */
.ring { position: relative; width: 190px; height: 190px; flex: none; }
.ring svg { width: 100%; height: 100%; display: block; }
.ring .track { stroke: var(--soft); }
.ring .edge { stroke: var(--line); }
.ring .fg { stroke-linecap: round; transition: stroke-dasharray var(--dur-slow) var(--ease-pop); }
.ring.good .fg { stroke: var(--good-fill); }
.ring.mid .fg { stroke: var(--mid-fill); }
.ring.bad .fg { stroke: var(--bad-fill); }
.ring.none .fg { stroke: var(--neutral-fill); }
.ring .num { font-family: var(--font-round); font-weight: 800; font-size: var(--fs-score); fill: var(--ink); }
.ring .sub { font-size: 13px; fill: var(--ink-2); }
.ring.sm { width: 88px; height: 88px; }

/* ---------------------------------------------------------------- 三面向條 */
.facets { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--sp-5); margin-top: var(--sp-6); }
.facet { padding: var(--sp-4) var(--sp-4) var(--sp-3); display: grid; grid-template-columns: 48px minmax(0, 1fr) auto; gap: var(--sp-1) var(--sp-3); align-items: center; }
.facet .ic { width: 48px; height: 48px; grid-row: span 2; }
.facet h2, .facet h3 { font-size: var(--fs-lg); }
.facet .val { font-family: var(--font-round); font-weight: 800; font-size: 26px; line-height: 1; text-align: right; }
.facet .val small { font-size: var(--fs-xs); color: var(--ink-2); font-family: var(--font-sans); }
.facet .bar { grid-column: 2 / -1; height: 14px; border: 2px solid var(--line); border-radius: var(--r-pill); background: var(--soft); overflow: hidden; }
.facet .bar i { display: block; height: 100%; width: var(--w, 0%); border-right: 2px solid var(--line); transition: width var(--dur-slow) var(--ease-out); }
.facet .bar i[data-w="0"] { border-right: 0; }
.facet.good .bar i { background: var(--good-fill); }
.facet.mid .bar i { background: var(--mid-fill); }
.facet.bad .bar i { background: var(--bad-fill); background-image: repeating-linear-gradient(-45deg, transparent 0 6px, rgba(43,33,24,.18) 6px 9px); }
.facet.none .bar i { background: var(--neutral-fill); }
.facet .note { grid-column: 1 / -1; margin: 0; font-size: var(--fs-sm); color: var(--ink-2); }

/* ---------------------------------------------------------------- 結論卡 */
.hello { display: grid; grid-template-columns: auto auto minmax(0, 1fr); gap: var(--sp-6); align-items: center; padding: var(--sp-6) var(--sp-8); margin-top: var(--sp-2); }
.hello h1 { font-size: var(--fs-3xl); margin: var(--sp-2) 0 6px; }
.hello .why { margin: 0 0 var(--sp-4); color: var(--ink-2); }
.hello .tags { display: flex; flex-wrap: wrap; gap: var(--sp-2); }
.next { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; }
.thin-note { display: flex; gap: var(--sp-3); align-items: flex-start; margin-top: var(--sp-4); padding: var(--sp-3) var(--sp-4); font-size: var(--fs-md); border: 2px dashed var(--line); border-radius: var(--r-md); background: var(--soft-2); }
.thin-note b { font-family: var(--font-round); }

/* ---------------------------------------------------------------- 瀏覽器外框與即時畫面 */
.window { overflow: hidden; padding: 0; }
.window .bar { display: flex; align-items: center; gap: 6px; padding: 8px 12px; border-bottom: var(--bw) solid var(--line); background: var(--soft); }
.window .bar i { width: 11px; height: 11px; border-radius: 50%; border: 2px solid var(--line); background: var(--surface); flex: none; }
.window .bar i:nth-child(1) { background: var(--coral); }
.window .bar i:nth-child(2) { background: var(--sun); }
.window .addr { margin-left: 6px; flex: 1; min-width: 0; font-size: var(--fs-xs); background: var(--surface); border: 2px solid var(--line); border-radius: var(--r-pill); padding: 0 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--ink-2); }
.screen { position: relative; background: var(--soft-2); aspect-ratio: 16 / 10; overflow: hidden; }
.screen img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: top left; display: block; transition: opacity var(--dur-med) var(--ease-out); }
.screen img.out { opacity: 0; }
.screen .placeholder { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; padding: var(--sp-5); color: var(--ink-2); font-size: var(--fs-md); }
.screen .placeholder .mascot { margin: 0 auto var(--sp-2); }
.target { position: absolute; left: var(--x); top: var(--y); width: var(--w); height: var(--h); border: 3px solid var(--coral-ink); border-radius: 8px; box-shadow: 0 0 0 3px rgba(255,255,255,.8); pointer-events: none; transition: all var(--dur-med) var(--ease-out); }
.target.stuck { border-color: var(--bad-ink); border-style: dashed; }
.target .tag { position: absolute; left: -3px; bottom: 100%; margin-bottom: 4px; white-space: nowrap; background: var(--bad-ink); color: #fff; font-family: var(--font-round); font-weight: 800; font-size: 12px; padding: 0 8px; border-radius: var(--r-pill); }
.pulse { position: absolute; left: var(--cx); top: var(--cy); width: 34px; height: 34px; margin: -17px 0 0 -17px; border-radius: 50%; border: 3px solid var(--coral-ink); background: rgba(228, 87, 46, .25); pointer-events: none; animation: pulse 1.4s ease-out infinite; }
.pulse.tap::after { content: ""; position: absolute; inset: -3px; border-radius: 50%; border: 3px solid var(--coral-ink); animation: ripple 700ms ease-out 1 both; }
@keyframes pulse { 0% { transform: scale(.8); } 60% { transform: scale(1.15); } 100% { transform: scale(.8); } }
@keyframes ripple { from { transform: scale(1); opacity: 1; } to { transform: scale(3); opacity: 0; } }

/* 進度：三個圓點 */
.progress { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-3) var(--sp-5); padding: var(--sp-3) var(--sp-4); }
.progress ol { list-style: none; margin: 0; padding: 0; display: flex; gap: var(--sp-2); align-items: center; flex-wrap: wrap; }
.progress li { display: inline-flex; align-items: center; gap: 6px; font-size: var(--fs-sm); color: var(--ink-2); }
.progress li .pt { width: 26px; height: 26px; border-radius: 50%; border: var(--bw) solid var(--line); background: var(--surface); display: inline-grid; place-items: center; font-size: 12px; font-weight: 800; color: var(--ink); flex: none; }
.progress li.is-now { color: var(--ink); font-weight: 700; }
.progress li.is-now .pt { background: var(--sun); }
.progress li.is-done .pt { background: var(--good-fill); }
.progress li.is-locked .pt { background: var(--soft); border-style: dashed; }
.progress li + li::before { content: ""; width: 18px; height: 0; border-top: 2px dashed var(--ink-2); margin-right: 2px; }
.progress .count { margin-left: auto; font-family: var(--font-round); font-weight: 800; }

/* 旅程頁 */
.journey { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr); gap: var(--sp-6); align-items: start; margin-top: var(--sp-5); }
.journey .side { display: grid; gap: var(--sp-4); }
.who { display: flex; gap: var(--sp-3); align-items: center; }
.who h1 { font-size: var(--fs-xl); }
.who p { margin: 0; color: var(--ink-2); font-size: var(--fs-md); }
.journey .log { max-height: 460px; overflow-y: auto; padding: var(--sp-1) var(--sp-1) var(--sp-3); overscroll-behavior: contain; }
.score-peek { display: flex; align-items: center; gap: var(--sp-4); padding: var(--sp-3) var(--sp-4); }
.score-peek .txt { min-width: 0; }
.score-peek h2 { font-size: var(--fs-lg); }
.score-peek p { margin: 0; font-size: var(--fs-sm); color: var(--ink-2); }
.score-peek.waiting .ring .fg { opacity: 0; }
.keep-link { font-size: var(--fs-sm); color: var(--ink-2); display: flex; flex-wrap: wrap; gap: var(--sp-2); align-items: center; }

/* 結束覆蓋 */
.finale { position: absolute; inset: 0; display: grid; place-items: center; background: color-mix(in srgb, var(--bg) 82%, transparent); text-align: center; padding: var(--sp-4); animation: fade-in var(--dur-med) var(--ease-out) both; }
.finale .mascot { margin: 0 auto; width: min(220px, 46%); }
.finale strong { display: block; font-family: var(--font-round); font-size: var(--fs-2xl); }
@keyframes fade-in { from { opacity: 0; } }
.end-card { padding: var(--sp-5); display: grid; gap: var(--sp-3); animation: slide-up var(--dur-med) var(--ease-pop) both; }
.end-card h2 { font-size: var(--fs-xl); }
.end-card .row { display: flex; flex-wrap: wrap; gap: var(--sp-3); align-items: center; }
@keyframes slide-up { from { transform: translateY(18px); opacity: 0; } }

/* ---------------------------------------------------------------- 底片格（逐格回放） */
.film { padding: var(--sp-4) var(--sp-4) var(--sp-3); }
.film h3 { font-size: var(--fs-lg); }
.film .sum { display: flex; flex-wrap: wrap; gap: var(--sp-2); align-items: center; margin: var(--sp-2) 0 var(--sp-3); }
.film .story { margin: 0 0 var(--sp-3); font-size: var(--fs-md); color: var(--ink-2); }
.strip { list-style: none; margin: 0; padding: 6px 4px 12px; display: grid; grid-auto-flow: column; grid-auto-columns: minmax(150px, 190px); gap: var(--sp-3); overflow-x: auto; scroll-snap-type: x proximity; background: repeating-linear-gradient(90deg, var(--line) 0 8px, transparent 8px 16px) top / 100% 4px no-repeat, repeating-linear-gradient(90deg, var(--line) 0 8px, transparent 8px 16px) bottom / 100% 4px no-repeat; }
.strip li { scroll-snap-align: start; }
.frame { display: grid; gap: 4px; width: 100%; text-align: left; font: inherit; color: inherit; background: var(--surface); border: var(--bw) solid var(--line); border-radius: var(--r-md); padding: 6px; cursor: pointer; }
.frame .thumb { position: relative; aspect-ratio: 16 / 10; border-radius: 8px; overflow: hidden; background: var(--soft-2); border: 2px solid var(--line); }
.frame .thumb img { width: 100%; height: 100%; object-fit: cover; object-position: top left; display: block; }
.frame .cap { font-size: var(--fs-xs); line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.frame .no { font-family: var(--font-round); font-weight: 800; font-size: var(--fs-xs); display: flex; justify-content: space-between; gap: 4px; }
.frame.stuck { border-color: var(--bad-ink); border-width: 3px; box-shadow: 0 0 0 3px var(--soft); }
.frame.stuck .flag { color: var(--bad-ink); }
.frame.done .flag { color: var(--good-ink); }
.frame .target { border-width: 2px; }
.zoom-body { display: grid; gap: var(--sp-3); }
.zoom-body .screen { border: 2px solid var(--line); border-radius: var(--r-md); }

/* ---------------------------------------------------------------- 旅程卡與上鎖區 */
.trips { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: var(--sp-5); }
.locked-col { display: grid; gap: var(--sp-5); align-content: start; }
.locked { padding: var(--sp-4) var(--sp-5); background: repeating-linear-gradient(-45deg, var(--surface) 0 12px, var(--soft) 12px 24px); }
.locked h3 { font-size: 18px; display: flex; gap: var(--sp-3); align-items: center; }
.locked h3 svg { width: 28px; height: 28px; flex: none; }
.locked p { margin: 6px 0 0; font-size: var(--fs-md); color: var(--ink-2); }

/* 檢查清單 */
.checks { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--sp-5); align-items: start; }
.checks details { padding: 0; overflow: hidden; }
.checks summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: var(--sp-2); padding: var(--sp-3) var(--sp-4); background: var(--soft); }
.checks details[open] summary { border-bottom: var(--bw) solid var(--line); }
.checks summary::-webkit-details-marker { display: none; }
.checks summary h3 { font-size: 19px; }
.checks summary .count { margin-left: auto; font-size: var(--fs-sm); font-weight: 700; white-space: nowrap; }
.checks summary::after { content: "▸"; font-size: 14px; }
.checks details[open] summary::after { content: "▾"; }
.checks ul { list-style: none; margin: 0; padding: 6px 14px 10px; }
.checks li { display: grid; grid-template-columns: 30px minmax(0, 1fr); gap: 10px; padding: 9px 0; align-items: start; }
.checks li + li { border-top: 2px dashed var(--soft); }
.checks .t { font-weight: 700; display: block; line-height: 1.5; }
.checks .d { font-size: var(--fs-sm); color: var(--ink-2); display: block; line-height: 1.6; }
.checks .bonus-wrap { grid-column: 1 / -1; }
.st { width: 28px; height: 28px; display: grid; place-items: center; font-weight: 800; font-size: 15px; line-height: 1; border: var(--bw) solid var(--line); color: var(--on-fill); font-style: normal; }
.st.pass { background: var(--good-fill); border-radius: 50%; }
.st.fail { background: var(--bad-fill); border-radius: 8px; transform: rotate(8deg); }
.st.not_applicable { background: var(--surface); color: var(--ink-2); border-radius: 50%; border-style: dashed; }
.st.unknown { background: var(--neutral-fill); border-radius: 50%; border-style: dotted; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: var(--fs-sm); margin: 0 0 var(--sp-4); color: var(--ink-2); }
.legend span { display: inline-flex; gap: 6px; align-items: center; }
.legend .st { width: 22px; height: 22px; font-size: 12px; border-width: 2px; }

/* 最該先修：便利貼 */
.note-wrap { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: var(--sp-6); align-items: center; }
.postit { position: relative; background: var(--sun); color: var(--on-sun); border: var(--bw) solid #2B2118; border-radius: 6px 6px 26px 6px; box-shadow: var(--shadow); padding: 26px 24px 20px; transform: rotate(-.8deg); }
.postit::before { content: ""; position: absolute; top: -14px; left: 50%; width: 90px; height: 26px; margin-left: -45px; background: rgba(255,255,255,.65); border: 2px solid rgba(43,33,24,.25); transform: rotate(3deg); }
.postit .lbl { display: inline-block; font-family: var(--font-round); font-weight: 800; font-size: var(--fs-sm); background: #2B2118; color: var(--sun); border-radius: var(--r-pill); padding: 0 12px; }
.postit h3 { font-size: var(--fs-xl); margin: var(--sp-2) 0 4px; }
.postit p { margin: 0; }
.fake { filter: blur(6px); user-select: none; margin: var(--sp-3) 0 0; opacity: .75; }
.veil { display: inline-block; margin-top: 10px; font-size: var(--fs-sm); font-weight: 700; background: #fff; color: #2B2118; border: 2px solid #2B2118; border-radius: var(--r-pill); padding: 2px 12px; }

/* 解鎖 */
.bags { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--sp-5); }
.bag { padding: var(--sp-5); }
.bag.full { background: var(--sun); color: var(--on-sun); }
.bag h3 { font-size: var(--fs-lg); margin-bottom: 6px; }
.bag .price { font-family: var(--font-round); font-weight: 800; font-size: 28px; margin: 0 0 6px; }
.bag ul { margin: 0; padding: 0; list-style: none; font-size: var(--fs-md); }
.bag li { padding: 5px 0 5px 30px; position: relative; }
.bag li::before { content: "✓"; position: absolute; left: 0; top: 7px; width: 22px; height: 22px; border-radius: 50%; background: var(--good-fill); color: var(--on-fill); display: grid; place-items: center; font-size: 12px; line-height: 22px; text-align: center; border: 2px solid var(--line); }
.bag.full li::before { content: "＋"; background: #2B2118; color: var(--sun); border-color: #2B2118; }
.bag .note { font-size: var(--fs-sm); margin: var(--sp-2) 0 0; }
.buy { display: flex; flex-wrap: wrap; gap: var(--sp-3) var(--sp-5); align-items: center; margin-top: var(--sp-6); }
.buy small { font-size: var(--fs-sm); color: var(--ink-2); }
.status-line { min-height: 1.4em; font-size: var(--fs-sm); font-weight: 700; color: var(--ink); margin: var(--sp-2) 0 0; }

/* 關於這次測試 */
.about { display: flex; gap: var(--sp-3); align-items: flex-start; margin-top: var(--sp-8); padding: var(--sp-4) var(--sp-5); font-size: var(--fs-md); color: var(--ink-2); }
.about .mascot { width: 56px; flex: none; }
.about b { color: var(--ink); font-family: var(--font-round); }
.about p { margin: 0; }

/* ---------------------------------------------------------------- 問題卡 */
.issues { display: grid; gap: var(--sp-6); counter-reset: issue; }
.issue { padding: var(--sp-5) var(--sp-6); display: grid; gap: var(--sp-3); }
.issue header { display: grid; gap: var(--sp-2); }
.issue h3 { font-size: var(--fs-xl); }
.issue h3::before { counter-increment: issue; content: counter(issue) "．"; color: var(--coral-ink); }
.issue .tags { display: flex; flex-wrap: wrap; gap: var(--sp-2); }
.issue h4 { font-size: 17px; margin-top: var(--sp-2); }
.issue p { margin: 0; }
.issue ol.fix { margin: 0; padding-left: 1.4em; display: grid; gap: 6px; }
.issue code { font-family: var(--font-mono); font-size: .92em; background: var(--soft); border: 1px solid var(--line); border-radius: 6px; padding: 0 5px; overflow-wrap: anywhere; }
.issue .obs { font-size: var(--fs-sm); color: var(--ink-2); }
.tech { border: 2px dashed var(--line); border-radius: var(--r-md); padding: 0 var(--sp-4); background: var(--soft-2); font-size: var(--fs-sm); }
.tech summary { cursor: pointer; padding: var(--sp-2) 0; font-weight: 700; }
.tech[open] { padding-bottom: var(--sp-3); }
.tech p { margin: 0 0 var(--sp-2); }

/* 複製指令框 */
.copybox { border: var(--bw) solid var(--line); border-radius: var(--r-md); overflow: hidden; background: var(--surface); }
.copybox .head { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); padding: 6px 6px 6px 14px; background: var(--soft); border-bottom: 2px solid var(--line); flex-wrap: wrap; }
.copybox .head b { font-family: var(--font-round); font-size: var(--fs-md); }
.copybox pre { margin: 0; padding: var(--sp-3) var(--sp-4); max-height: 220px; overflow: auto; white-space: pre-wrap; font-family: var(--font-mono); font-size: 13.5px; line-height: 1.65; color: var(--ink); }
.copybox .done-msg { font-size: var(--fs-sm); font-weight: 700; }

/* ---------------------------------------------------------------- 首頁 */
.hero .wrap { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr); gap: var(--sp-8); align-items: center; padding-top: var(--sp-6); padding-bottom: var(--sp-6); }
.hero .kicker { margin: 0 0 var(--sp-3); }
.hero h1 { font-size: clamp(28px, 4.2vw, 46px); margin-bottom: var(--sp-5); }
.hero h1 .nw:last-child { color: var(--coral-ink); }
.part > .wrap > h2 { margin-bottom: var(--sp-4); }
.form { padding: var(--sp-5); display: grid; gap: var(--sp-4); }
.field { display: grid; gap: 6px; }
.field label { font-family: var(--font-round); font-weight: 800; }
.field input { font: inherit; font-size: 17px; border: var(--bw) solid var(--line); border-radius: var(--r-md); padding: 10px 14px; background: var(--surface); color: var(--ink); width: 100%; min-height: 48px; }
.field input[aria-invalid="true"] { border-color: var(--bad-ink); border-style: dashed; }
.field .hint { font-size: var(--fs-sm); color: var(--ink-2); margin: 0; }
.field .err { font-size: var(--fs-sm); color: var(--bad-ink); font-weight: 700; margin: 0; }
.consent { display: grid; grid-template-columns: 26px minmax(0, 1fr); gap: 10px; align-items: start; background: var(--soft); border-radius: var(--r-md); padding: var(--sp-3); font-size: var(--fs-md); }
.consent input { width: 24px; height: 24px; margin: 3px 0 0; accent-color: var(--coral-ink); }
.go { display: flex; flex-wrap: wrap; gap: var(--sp-3); align-items: center; }
.go small { font-size: var(--fs-sm); color: var(--ink-2); }
.stage { position: relative; display: grid; justify-items: center; gap: var(--sp-3); }
.stage .mascot { width: min(300px, 80%); }
.stage .bubble { justify-self: start; }
.tasks .task { padding: var(--sp-5); display: grid; gap: 6px; align-content: start; }
.task .pic { width: 64px; height: 64px; }
.task h3 { font-size: var(--fs-lg); }
.task .q { font-family: var(--font-round); font-weight: 800; color: var(--coral-ink); }
.task p { margin: 0; font-size: var(--fs-md); color: var(--ink-2); }
.path { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--sp-4); counter-reset: stop; }
.path li { position: relative; padding: var(--sp-4); }
.path li .dot { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: var(--sun); border: var(--bw) solid var(--line); font-family: var(--font-round); font-weight: 800; margin-bottom: var(--sp-2); }
.path h3 { font-size: 18px; }
.path p { margin: 4px 0 0; font-size: var(--fs-md); color: var(--ink-2); }
.never { margin-top: var(--sp-5); padding: var(--sp-3) var(--sp-4); display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; font-size: var(--fs-md); }
.never span::before { content: "✕ "; color: var(--bad-ink); font-weight: 800; }
.faq { display: grid; gap: var(--sp-3); }
.faq details { padding: var(--sp-3) var(--sp-5); }
.faq summary { cursor: pointer; font-family: var(--font-round); font-weight: 800; font-size: 18px; }
.faq details p { margin: var(--sp-2) 0 0; color: var(--ink-2); }

/* 狀態畫面（被擋、名額已滿、停機、連結過期、錯誤、載入中） */
.state-card { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: var(--sp-6); align-items: center; padding: var(--sp-6) var(--sp-8); margin: var(--sp-6) 0; }
.state-card h1, .state-card h2 { font-size: var(--fs-2xl); margin-bottom: var(--sp-2); }
.state-card p { color: var(--ink-2); }
.state-card .row { display: flex; flex-wrap: wrap; gap: var(--sp-3); margin-top: var(--sp-3); }
.state-card.neutral { background: var(--soft-2); }
.banner { display: flex; gap: var(--sp-4); align-items: center; padding: var(--sp-4) var(--sp-5); margin-top: var(--sp-5); background: var(--soft-2); }
.banner .mascot { width: 84px; flex: none; }
.banner h2 { font-size: var(--fs-lg); margin-bottom: 4px; }
.banner p { margin: 0; color: var(--ink-2); font-size: var(--fs-md); }
.skeleton { background: linear-gradient(90deg, var(--soft) 0 40%, var(--soft-2) 50%, var(--soft) 60% 100%) 0 0 / 300% 100%; border-radius: var(--r-md); animation: shimmer 1.6s linear infinite; min-height: 18px; }
@keyframes shimmer { to { background-position: -150% 0; } }

/* 對話框 */
dialog { max-width: 620px; width: calc(100% - 32px); max-height: calc(100% - 32px); border: var(--bw) solid var(--line); border-radius: var(--r-lg); background: var(--surface); color: var(--ink); padding: 0; box-shadow: 6px 6px 0 var(--line); }
dialog.wide { max-width: 980px; }
dialog::backdrop { background: rgba(43, 33, 24, .5); }
.dlg-head { position: sticky; top: 0; z-index: 1; display: flex; justify-content: space-between; align-items: center; gap: var(--sp-3); padding: var(--sp-3) var(--sp-5); border-bottom: var(--bw) solid var(--line); background: var(--sun); color: var(--on-sun); }
.dlg-head h2 { font-size: var(--fs-lg); }
.dlg-body { padding: var(--sp-4) var(--sp-5) var(--sp-5); font-size: var(--fs-md); display: grid; gap: var(--sp-3); }
.dlg-body p, .dlg-body ul { margin: 0; }
.dlg-body ul { padding-left: 1.3em; display: grid; gap: 4px; }
.dlg-body label.ack { display: grid; grid-template-columns: 26px minmax(0, 1fr); gap: 10px; align-items: start; background: var(--soft); border-radius: var(--r-md); padding: var(--sp-3); }
.dlg-body label.ack input { width: 24px; height: 24px; margin: 2px 0 0; accent-color: var(--coral-ink); }
.x { font: inherit; font-size: var(--fs-md); background: var(--surface); border: 2px solid #2B2118; border-radius: var(--r-pill); padding: 2px 14px; color: #2B2118; cursor: pointer; min-height: 36px; }
.tbd { background: var(--soft); border: 1px dashed var(--line); border-radius: 6px; padding: 0 4px; font-weight: 700; }

/* 同意書全文 */
.doc { max-width: 760px; padding: var(--sp-6) var(--sp-8); margin: var(--sp-5) auto; }
.doc h1 { font-size: var(--fs-2xl); margin-bottom: var(--sp-3); }
.doc h2 { font-size: var(--fs-lg); margin: var(--sp-6) 0 var(--sp-2); }
.doc ol { padding-left: 1.4em; display: grid; gap: 6px; margin: 0 0 var(--sp-3); }
.doc .draft { padding: var(--sp-3) var(--sp-4); border: 2px dashed var(--line); border-radius: var(--r-md); background: var(--soft-2); font-size: var(--fs-md); }
.doc .ver { color: var(--ink-2); font-size: var(--fs-md); }

/* ---------------------------------------------------------------- 響應式 */
@media (max-width: 900px) {
  .hello { grid-template-columns: auto minmax(0, 1fr); padding: var(--sp-5); }
  .hello .txt { grid-column: 1 / -1; }
  .hello .mascot { width: 100px; }
  .ring { width: 160px; height: 160px; justify-self: center; }
  .facets, .checks, .trips, .bags, .grid-3, .grid-2 { grid-template-columns: minmax(0, 1fr); }
  .note-wrap { grid-template-columns: minmax(0, 1fr); }
  .note-wrap .point { display: none; }
  .journey { grid-template-columns: minmax(0, 1fr); }
  .journey .log { max-height: none; }
  .hero .wrap { grid-template-columns: minmax(0, 1fr); }
  .stage { order: -1; }
  .stage .mascot { width: 170px; }
  .path { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .state-card { grid-template-columns: minmax(0, 1fr); padding: var(--sp-5); }
  .state-card .mascot { width: 120px; }
}
@media (max-width: 420px) {
  :root { --gutter: 16px; }
  body { font-size: 16px; }
  .hero h1 { font-size: clamp(24px, 7.5vw, 28px); }
  .hello { gap: var(--sp-3); padding: var(--sp-4); }
  .ring { width: 140px; height: 140px; }
  .hello .mascot { width: 84px; }
  .btn { width: 100%; }
  .btn.ghost { width: auto; }
  .sticker { box-shadow: 4px 4px 0 var(--line); }
  .path { grid-template-columns: minmax(0, 1fr); }
  .issue { padding: var(--sp-4); }
  .doc { padding: var(--sp-5) var(--sp-4); }
  .facet .val { font-size: 22px; }
  .top .meta { font-size: var(--fs-xs); }
}

/* ---------------------------------------------------------------- 減少動態 */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

/* ---------------------------------------------------------------- 列印（存成 PDF） */
@media print {
  :root { --bg: #fff; --surface: #fff; --soft: #f3ece4; --soft-2: #faf6f1; --ink: #000; --ink-2: #333; --line: #000; --shadow: none; --shadow-sm: none; }
  @page { margin: 14mm; }
  body { font-size: 11.5pt; background: #fff; }
  .top .wrap, .wrap { max-width: none; padding: 0; }
  .no-print, .skip, .demo-badge, .btn, .copybox .head button, footer.foot .links, dialog { display: none !important; }
  .sticker { box-shadow: none !important; border-width: 1.5px; }
  section.part { padding-top: 18px; break-inside: auto; }
  .issue, .film, .facet, .hello, .checks details { break-inside: avoid; }
  .hello { grid-template-columns: auto minmax(0, 1fr); }
  .hello .mascot { display: none; }
  .facets, .checks { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .strip { grid-auto-flow: row; grid-template-columns: repeat(4, minmax(0, 1fr)); overflow: visible; background: none; }
  .frame .cap { -webkit-line-clamp: unset; display: block; }
  .copybox pre { max-height: none; overflow: visible; }
  details.tech > *:not(summary) { display: block; }
  .postit { transform: none; }
  a { color: #000; }
  .print-only { display: block !important; }
}
.print-only { display: none; }

/* 小工具 */
.tight { margin: 4px 0 0; }
.demo-target { --x: 38.44%; --y: 37.5%; --w: 23.13%; --h: 18.75%; }

/* 首頁的排班小幫手範例 */
.sample-window { align-self: start; }
.sample-window-foot, .sample-actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-3); }
.sample-window-foot { justify-content: space-between; padding: var(--sp-4); border-top: var(--bw) solid var(--line); }
.sample-window-foot small, .sample-score small { display: block; font-size: var(--fs-sm); color: var(--ink-2); }
.sample-window-foot .btn, .sample-actions .btn { width: auto; }
.sample-result { display: grid; grid-template-columns: minmax(0, .88fr) minmax(0, 1.12fr); margin-top: var(--sp-6); overflow: hidden; }
.sample-score, .sample-observation { padding: clamp(20px, 3vw, 34px); }
.sample-score { background: var(--soft-2); border-right: 2px dashed var(--line); }
.sample-score h3 { font-size: var(--fs-xl); }
.sample-total { display: flex; align-items: baseline; gap: var(--sp-2); margin: var(--sp-2) 0; font-weight: 700; }
.sample-total strong { font: 800 clamp(52px, 5vw, 76px)/1.1 var(--font-round); }
.sample-meters { display: grid; gap: 6px; margin: 0 0 var(--sp-3); }
.sample-meters > div, .sample-meters dd { display: flex; align-items: center; gap: var(--sp-3); }
.sample-meters dt { font-weight: 700; }
.sample-meters dd { flex: 1; min-width: 0; margin: 0; }
.sample-meters meter { flex: 1; min-width: 0; height: 11px; border: 0; border-radius: var(--r-pill); background: var(--neutral-fill); }
.sample-meters meter::-webkit-meter-bar { height: 11px; border: 0; background: var(--neutral-fill); }
.sample-meters meter::-webkit-meter-optimum-value { background: var(--mid-ink); }
.sample-meters meter::-moz-meter-bar { background: var(--mid-ink); }
.sample-score .btn { margin-top: var(--sp-4); }
.sample-observation { align-self: center; }
.sample-observation h4 { font-size: var(--fs-2xl); text-wrap: balance; margin: var(--sp-3) 0; }
.sample-observation p:not(.pill) { color: var(--ink-2); }
:is(#sample-replay, #sample-share) .x { min-height: 44px; }
#sample-replay { max-width: 720px; }
.sample-say { display: grid; grid-template-columns: 46px minmax(0, 1fr); align-items: end; gap: var(--sp-2); }
.sample-actions { justify-content: flex-end; }
.sample-share-image { display: block; width: 100%; height: auto; border: 1px solid var(--line); border-radius: var(--r-md); }
#sample-post { width: 100%; padding: var(--sp-3); background: var(--soft-2); color: var(--ink); border: 1px solid var(--line); border-radius: var(--r-sm); font: inherit; resize: vertical; }
#sample-copy-status:empty { display: none; }
@media (max-width: 680px) {
  .sample-result { grid-template-columns: minmax(0, 1fr); }
  .sample-score { border-right: 0; border-bottom: 2px dashed var(--line); }
  .sample-actions { justify-content: flex-start; }
  .sample-say { grid-template-columns: 36px minmax(0, 1fr); }
  .sample-say .mascot { width: 36px; height: auto; }
}
.bob { animation: owl-bob 3.2s ease-in-out infinite; }
@keyframes owl-bob { 50% { transform: translateY(-6px) rotate(-1.5deg); } }
.progress li .pt svg { width: 16px; height: 16px; }
.stage-wrap { position: relative; }
.end-slot:empty { display: none; }
@media (prefers-reduced-motion: reduce) { .bob { animation: none; } }
.veil svg, .pill svg, .tbd svg { width: 18px; height: 18px; vertical-align: -4px; }
.locked h3 svg { width: 28px; height: 28px; }
.issues { grid-template-columns: minmax(0, 1fr); }
.issue > *, .film > * { min-width: 0; }
.who { margin-top: var(--sp-2); }
.who .mascot { flex: none; }
@media (max-width: 900px) {
  .journey .side .log { order: -1; max-height: 240px; }
  .journey .side .end-slot { order: -2; }
  .who .mascot { width: 72px; }
}
.next { flex-wrap: nowrap; text-align: left; justify-content: space-between; }
.next > span[aria-hidden] { flex: none; }
/* 深色模式：深藍貓頭鷹加一圈淺色貼紙邊，才不會沉進深色底 */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .mascot { filter: drop-shadow(2px 0 0 var(--line)) drop-shadow(-2px 0 0 var(--line)) drop-shadow(0 2px 0 var(--line)) drop-shadow(0 -2px 0 var(--line)); }
}
:root[data-theme="dark"] .mascot { filter: drop-shadow(2px 0 0 var(--line)) drop-shadow(-2px 0 0 var(--line)) drop-shadow(0 2px 0 var(--line)) drop-shadow(0 -2px 0 var(--line)); }
.hero .state-card { grid-template-columns: auto minmax(0, 1fr); padding: var(--sp-5); gap: var(--sp-4); }
.hero .state-card .mascot { width: 110px; }
.hero .state-card h2 { font-size: var(--fs-xl); }
.zoom-body .screen { max-height: 62vh; }
