/* 知權 32 — 明亮活潑：亮藍、朱印紅、薄荷、紫、橘 */
/* jf open 粉圓（SIL OFL 1.1），授權見 fonts/OFL-LICENSE.txt */
@font-face {
  font-family: 'jf open huninn';
  src: url('../fonts/jf-openhuninn-2.1.woff2') format('woff2');
  font-display: swap;
}
:root {
  --paper: #F5F7FF;
  --surface: #FFFFFF;
  --surface-2: #EFF3FC;
  --ink: #172036;
  --ink-2: #4A556E;
  --ink-3: #7F8AA3;
  --line: #DDE3F0;
  --blue: #2F6BFF;
  --blue-deep: #1F4FD1;
  --blue-soft: #E3ECFF;
  --seal: #E5383B;
  --seal-deep: #B3232A;
  --seal-soft: #FFE5E5;
  --green: #12974A;
  --green-deep: #0B7A3A;
  --green-soft: #DDF7E7;
  --amber: #FFB020;
  --pink: #FF5FA2;
  --mint: #2EC4B6;
  --purple: #7C5CFF;
  --orange: #FF8A3D;
  --radius: 14px;
  --font: 'jf open huninn', 'Noto Sans TC', 'PingFang TC', 'Microsoft JhengHei', 'Heiti TC', sans-serif;
  --font-seal: 'Noto Serif TC', 'Songti TC', 'PMingLiU', serif;
  --tab-h: 64px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #10172A; --surface: #1A2340; --surface-2: #222D50; --ink: #EEF2FF; --ink-2: #B3BDD9; --ink-3: #8390B3;
    --line: #2E3A62; --blue: #6E98FF; --blue-deep: #4570E6; --blue-soft: #233466; --seal: #FF5A5D; --seal-deep: #C93A3E;
    --seal-soft: #46202A; --green: #3DD68C; --green-deep: #22A866; --green-soft: #173D33; --amber: #FFC14D;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #10172A; --surface: #1A2340; --surface-2: #222D50; --ink: #EEF2FF; --ink-2: #B3BDD9; --ink-3: #8390B3;
  --line: #2E3A62; --blue: #6E98FF; --blue-deep: #4570E6; --blue-soft: #233466; --seal: #FF5A5D; --seal-deep: #C93A3E;
  --seal-soft: #46202A; --green: #3DD68C; --green-deep: #22A866; --green-soft: #173D33; --amber: #FFC14D;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font-family: var(--font); font-size: 16px; line-height: 1.7;
  font-feature-settings: 'palt' 0;
  -webkit-tap-highlight-color: transparent;
}
body.no-scroll { overflow: hidden; }
h1, h2, h3 { line-height: 1.35; margin: 0; }
p { margin: 0; }
a { color: var(--blue); }
button, input, select { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--amber); outline-offset: 2px; border-radius: 6px; }
[hidden] { display: none !important; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--surface); padding: 8px 12px; z-index: 99; }
.skip:focus { left: 8px; }
.muted { color: var(--ink-2); font-size: .94rem; }
.noscript { padding: 24px; text-align: center; }

/* ───── 版面 ───── */
.shell {
  display: grid; grid-template-columns: 1fr; grid-template-areas: "top" "view";
  min-height: 100dvh; padding-bottom: calc(var(--tab-h) + env(safe-area-inset-bottom));
}
.side, .rail { display: none; }
.topbar {
  grid-area: top; position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 12px;
  padding: calc(8px + env(safe-area-inset-top)) 16px 8px;
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.view { grid-area: view; width: 100%; max-width: 640px; margin: 0 auto; padding: 16px 16px 40px; outline: none; }

.tab-bar {
  position: fixed; inset: auto 0 0 0; z-index: 30; display: grid; grid-template-columns: repeat(5, 1fr);
  height: calc(var(--tab-h) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom);
  background: var(--surface); border-top: 1px solid var(--line);
}
.tab-bar a {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  text-decoration: none; color: var(--ink-3); font-size: .75rem; font-weight: 700;
}
.tab-bar a .nav-icon { width: 24px; height: 24px; }
.tab-bar a.on { color: var(--blue); }
.tab-bar a.on .nav-icon { stroke-width: 2.4; }

@media (min-width: 760px) {
  .shell {
    grid-template-columns: 220px minmax(0, 1fr); grid-template-areas: "side top" "side view";
    padding-bottom: 0;
  }
  .tab-bar { display: none; }
  .side {
    display: flex; flex-direction: column; gap: 20px; grid-area: side;
    position: sticky; top: 0; height: 100dvh; padding: 22px 14px;
    border-right: 1px solid var(--line); background: var(--surface);
  }
  .topbar .brand.compact { display: none; }
  .topbar { justify-content: flex-end; padding: 12px 28px; }
  .view { padding: 28px 28px 64px; }
}
@media (min-width: 1100px) {
  .shell { grid-template-columns: 240px minmax(0, 1fr) 320px; grid-template-areas: "side top top" "side view rail"; }
  .rail { display: flex; flex-direction: column; gap: 16px; grid-area: rail; padding: 28px 28px 28px 0; position: sticky; top: 64px; align-self: start; }
}

.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); }
.brand-seal i { font-style: normal; }
.brand-seal {
  width: 42px; height: 42px; border-radius: 9px;
  background: var(--seal); color: #FFF7F2; font-family: var(--font-seal); font-weight: 900; font-size: .78rem; line-height: 1;
  box-shadow: inset 0 0 0 2px var(--seal), inset 0 0 0 4px #FFF7F2;
  transform: rotate(-4deg);
}

.brand-text { display: flex; flex-direction: column; line-height: 1.25; }
.brand-text b { font-size: 1.2rem; font-weight: 900; }
.brand-text small { color: var(--ink-2); font-size: .8rem; }

.side-nav { display: flex; flex-direction: column; gap: 4px; }
.side-nav a {
  display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-radius: 12px;
  text-decoration: none; color: var(--ink-2); font-weight: 700; border: 2px solid transparent;
}
.side-nav a:hover { background: var(--surface-2); }
.side-nav a.on { color: var(--blue); background: var(--blue-soft); }
.side-nav .nav-icon { width: 22px; height: 22px; }
.side-nav .side-card { margin-top: 12px; border-top: 1px solid var(--line); border-radius: 0 0 12px 12px; padding-top: 16px; }

.top-stats { display: flex; gap: 6px; margin-left: auto; }
.stat {
  display: inline-flex; align-items: center; gap: 2px; padding: 4px 10px; border-radius: 999px;
  font-weight: 900; font-variant-numeric: tabular-nums; background: var(--surface); border: 1px solid var(--line); font-size: .92rem;
}
.stat.streak { color: var(--ink-3); }
.stat.streak.lit { color: var(--amber); }
.stat.heart { color: var(--seal); }
.stat.xp { color: var(--blue); }

/* ───── 按鈕 ───── */
.btn {
  --b: var(--blue); --bd: var(--blue-deep); --fg: #fff;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 48px; padding: 10px 22px; border-radius: 14px; border: 0;
  background: var(--b); color: var(--fg); font-weight: 900; font-size: 1rem; letter-spacing: .04em;
  box-shadow: 0 4px 0 var(--bd); cursor: pointer; transition: transform .06s, box-shadow .06s, filter .15s;
}
.btn:hover { filter: brightness(1.06); }
.btn:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--bd); }
.btn:disabled { --b: var(--line); --bd: color-mix(in srgb, var(--line) 70%, var(--ink-3)); --fg: var(--ink-3); cursor: not-allowed; filter: none; }
.btn.danger { --b: var(--seal); --bd: var(--seal-deep); }
.btn.ghost { --b: var(--surface); --bd: var(--line); --fg: var(--blue); border: 2px solid var(--line); }
.btn.danger-text { --fg: var(--seal); }
.btn.small { min-height: 36px; padding: 4px 14px; font-size: .88rem; }
.btn.block { width: 100%; }
.icon-btn { border: 0; background: none; font-size: 1.4rem; color: var(--ink-3); width: 40px; height: 40px; border-radius: 10px; cursor: pointer; }
.icon-btn:hover { background: var(--surface-2); }

/* ───── 印章 ───── */
.seal {
  --sz: 52px;
  display: inline-grid; place-items: center; flex: none; width: var(--sz); height: var(--sz); border-radius: calc(var(--sz) * .24);
  color: var(--ink-2); background: var(--surface-2); box-shadow: inset 0 0 0 1.5px var(--line);
  font-family: var(--font-seal); font-weight: 900; line-height: 1;
}
.stack { display: flex; flex-direction: column; align-items: center; line-height: 1; }
.stack i { font-style: normal; display: block; }
.seal-in { display: flex; flex-direction: column; align-items: center; gap: calc(var(--sz) * .015); }
.seal-in small { font-size: calc(var(--sz) * .17); font-weight: 700; opacity: .7; }
.seal-in b { font-size: calc(var(--sz) * .36); font-weight: 900; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
/* 學過的條文：紅色印章 */
.seal.done {
  color: #FFF6F0; background: var(--seal); transform: rotate(-3deg);
  box-shadow: inset 0 0 0 2px var(--seal), inset 0 0 0 3.5px #FFF6F0;
}
.seal.done .seal-in small { opacity: .9; }
.seal.big { --sz: 84px; }

/* ───── 學習路徑 ───── */
.path { display: flex; flex-direction: column; gap: 28px; }
.unit-head {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 12px;
  padding: 18px 20px; border-radius: 18px; color: #fff; background: var(--u, var(--blue));
  box-shadow: 0 5px 0 var(--ud, var(--blue-deep));
}
.unit-0 { --u: #2F6BFF; --ud: #1F4FD1; }
.unit-1 { --u: #12A594; --ud: #0B7C70; }
.unit-2 { --u: #7C5CFF; --ud: #5B3DD9; }
.unit-3 { --u: #FF7A2F; --ud: #D95E14; }
.unit-4 { --u: #F0508C; --ud: #C73670; }
.unit-no { font-size: .82rem; opacity: .85; font-weight: 700; }
.unit-head h2 { font-size: 1.35rem; font-weight: 900; }
.unit-desc { font-size: .92rem; opacity: .92; }
.unit-icon { flex: none; display: grid; place-items: center; width: 52px; height: 52px; border-radius: 14px; background: rgba(255,255,255,.14); }
.unit-icon .ico { width: 28px; height: 28px; }
.unit-progress { display: flex; gap: 4px; margin: 12px 4px 0; }
.unit-progress i { flex: 1; height: 5px; border-radius: 3px; background: var(--line); }
.unit-progress i.on { background: var(--seal); }

.nodes { list-style: none; margin: 48px 0 0; padding: 0; display: flex; flex-direction: column; align-items: center; gap: 44px; }
.nodes li { position: relative; transform: translateX(calc(var(--off) * var(--amp))); }
.path { --amp: min(96px, 22vw); }
.nodes li:has(.node-pop:not([hidden])) { z-index: 20; }
.nodes li.pop-open { z-index: 20; }
.node-wrap { position: relative; display: flex; flex-direction: column; align-items: center; }
.node {
  position: relative; width: 78px; height: 78px; border-radius: 14px; padding: 0; cursor: pointer;
  font-family: var(--font-seal); font-weight: 900; border: 3px dashed var(--line); background: var(--surface); color: var(--ink-3);
  transition: transform .12s;
}
.node:hover:not(.locked) { transform: scale(1.04); }
.node-face { display: flex; flex-direction: column; align-items: center; justify-content: center; height: 100%; gap: 2px; }
.node-face .v { font-size: 1.05rem; gap: 1px; }
.node-face.len-4 .v { font-size: .9rem; }
.node-face.len-5 .v { font-size: .74rem; gap: 0; }
.node-face small { font-family: var(--font); font-size: .62rem; font-weight: 700; line-height: 1; margin-top: 2px; }
.node-face .node-ic { width: 32px; height: 32px; }
.node.scenario { border-radius: 50%; }
.node.current, .node.open {
  border: 3px solid var(--blue); color: var(--blue); background: var(--surface);
  box-shadow: 0 5px 0 var(--blue-deep);
}
.node.current::after {
  content: ''; position: absolute; inset: -9px; border-radius: 20px; border: 3px solid var(--blue);
  opacity: .35; animation: pulse 1.8s ease-out infinite;
}
.node.scenario.current::after { border-radius: 50%; }
.node.done {
  border: 0; color: #FFF6F0; background: var(--seal); transform: rotate(-4deg);
  box-shadow: inset 0 0 0 3px var(--seal), inset 0 0 0 5px #FFF6F0, 0 4px 0 var(--seal-deep);
}
.node.done.scenario { transform: none; }
.node.done:hover { transform: rotate(-4deg) scale(1.04); }
.node.locked { cursor: pointer; opacity: .7; }
.node-tip {
  position: absolute; top: -40px; left: 50%; transform: translateX(-50%); white-space: nowrap;
  background: var(--surface); color: var(--blue); border: 2px solid var(--line); border-radius: 10px;
  padding: 2px 10px; font-family: var(--font); font-size: .82rem; font-weight: 900;
  animation: bob 1.6s ease-in-out infinite;
}
.node-pop {
  position: absolute; top: calc(100% + 12px); z-index: 10; width: 250px; padding: 14px;
  background: var(--surface);  border-radius: 16px;
  box-shadow: 0 10px 28px rgba(16, 32, 64, .16); display: flex; flex-direction: column; gap: 10px;
  transform-origin: 50% 0; animation: pop-in .22s cubic-bezier(.3, 1.4, .5, 1) both;
}
.node-pop.leaving { animation: pop-out .16s ease-in both; pointer-events: none; }
@keyframes pop-in { from { opacity: 0; transform: translateY(-8px) scale(.9); } to { opacity: 1; transform: none; } }
@keyframes pop-out { from { opacity: 1; transform: none; } to { opacity: 0; transform: translateY(-6px) scale(.94); } }
@media (prefers-reduced-motion: reduce) { .node-pop, .node-pop.leaving { animation: none; } }
.pop-title { font-weight: 900; white-space: pre-line; line-height: 1.5; }
.pop-sub { color: var(--ink-2); font-size: .9rem; }
.pop-sub.pre { white-space: pre-line; }
.path-end { display: flex; flex-direction: column; align-items: center; gap: 14px; text-align: center; color: var(--ink-2); padding: 20px 0 8px; }

@keyframes pulse { from { transform: scale(.92); opacity: .5; } to { transform: scale(1.12); opacity: 0; } }
@keyframes bob { 50% { transform: translate(-50%, -4px); } }

/* ───── 一般頁 ───── */
.page { display: flex; flex-direction: column; gap: 16px; }
.page-title { font-size: 1.7rem; font-weight: 900; }
.lead { color: var(--ink-2); }
.sec-title { font-size: 1.15rem; font-weight: 900; margin-top: 12px; }
.hero-card {
  background: var(--surface);  border-radius: 18px; padding: 20px;
  display: flex; flex-direction: column; gap: 14px;
}
.review-hero > div { display: flex; align-items: baseline; gap: 12px; }
.big-num { font-size: 3.2rem; font-weight: 900; color: var(--seal); line-height: 1; font-variant-numeric: tabular-nums; }
.hint { color: var(--ink-3); font-size: .86rem; }

.mastery { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 8px; }
.m-cell {
  display: flex; flex-direction: column; gap: 2px; padding: 8px 10px; border-radius: 10px; text-decoration: none;
  background: var(--surface);  color: var(--ink-2); min-height: 66px;
}
.m-cell b { font-size: 1.1rem; font-weight: 900; font-family: var(--font-seal); }
.m-cell span { font-size: .74rem; line-height: 1.35; }
.lv1 { background: color-mix(in srgb, var(--seal) 12%, var(--surface)); border-color: color-mix(in srgb, var(--seal) 25%, var(--line)); }
.lv2 { background: color-mix(in srgb, var(--seal) 28%, var(--surface)); border-color: transparent; color: var(--ink); }
.lv3 { background: color-mix(in srgb, var(--seal) 50%, var(--surface)); border-color: transparent; color: var(--ink); }
.lv4 { background: color-mix(in srgb, var(--seal) 75%, var(--surface)); border-color: transparent; color: #fff; }
.lv5 { background: var(--seal); border-color: transparent; color: #fff; }
.m-cell.due { outline: 3px solid var(--amber); outline-offset: -3px; }
.legend { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 6px 14px; color: var(--ink-2); font-size: .85rem; }
.legend li { display: flex; align-items: center; gap: 6px; }
.m-swatch { width: 16px; height: 16px; border-radius: 4px; border: 1px solid var(--line); }

.scene-list { display: flex; flex-direction: column; gap: 12px; }
.scene-card {
  display: flex; align-items: center; gap: 14px; text-align: left; padding: 16px; border-radius: 16px; cursor: pointer;
  background: var(--surface); border: 2px solid var(--line); box-shadow: 0 4px 0 var(--line);
}
.scene-card:hover { border-color: var(--blue); }
.scene-card:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--line); }
.scene-emoji { width: 52px; height: 52px; display: grid; place-items: center; background: var(--blue-soft); color: var(--blue); border-radius: 50%; flex: none; }
.scene-emoji .ico { width: 26px; height: 26px; }
.scene-body { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.scene-body strong { font-size: 1.05rem; }
.scene-body span { color: var(--ink-2); font-size: .92rem; }
.scene-body small { color: var(--ink-3); font-size: .8rem; }
.scene-score { font-family: var(--font-seal); font-weight: 900; color: var(--seal); border: 2px solid var(--seal); border-radius: 8px; padding: 2px 8px; transform: rotate(-4deg); }

.search-wrap { position: relative; display: block; }
.search-wrap .ico { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--ink-3); pointer-events: none; }
.search {
  width: 100%; min-height: 48px; padding: 10px 16px 10px 44px; border-radius: 14px; border: 2px solid var(--line); background: var(--surface);
}
.search:focus { border-color: var(--blue); outline: none; }
.law-list { display: flex; flex-direction: column; gap: 8px; }
.chap { font-size: 1rem; color: var(--ink-2); margin: 14px 0 2px; font-weight: 900; }
.law-row {
  display: flex; align-items: center; gap: 14px; padding: 12px 14px; border-radius: 14px; text-decoration: none; color: var(--ink);
  background: var(--surface); 
}
.law-row:hover { background: var(--surface-2); }
.law-row-body { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.law-row-body span { color: var(--ink-2); font-size: .86rem; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.pips { display: flex; gap: 3px; flex: none; }
.pips i { width: 6px; height: 16px; border-radius: 2px; background: var(--line); }
.pips i.on { background: var(--seal); }
.empty { color: var(--ink-2); padding: 20px 0; }
.source { color: var(--ink-3); font-size: .85rem; }
.back { text-decoration: none; font-weight: 700; display: inline-flex; align-items: center; gap: 2px; }
.pager { display: flex; justify-content: space-between; }
.pager a { text-decoration: none; font-weight: 700; display: inline-flex; align-items: center; gap: 2px; }
.row-actions { display: flex; gap: 10px; }
.row-actions.wrap { flex-wrap: wrap; }

/* 法條卡 */
.law-card {
  background: var(--surface);  border-radius: 18px; padding: 20px;
  display: flex; flex-direction: column; gap: 14px;
}
.law-card header { display: flex; align-items: center; gap: 14px; }
.law-card header .seal { --sz: 64px; }
.law-chapter { color: var(--ink-3); font-size: .85rem; }
.law-card h2 { font-size: 1.35rem; font-weight: 900; }
.one-line {
  display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 12px;
  background: color-mix(in srgb, var(--amber) 16%, var(--surface)); font-size: 1.08rem; font-weight: 700;
}
.one-line .ico { flex: none; color: var(--amber); width: 22px; height: 22px; margin-top: 3px; }
.plain { margin: 0; padding-left: 1.2em; display: flex; flex-direction: column; gap: 4px; }
.plain li::marker { color: var(--blue); }
.terms { margin: 0; padding: 12px 14px; background: var(--surface-2); border-radius: 12px; display: flex; flex-direction: column; gap: 6px; }
.terms-title { display: flex; align-items: center; gap: 6px; font-weight: 700; color: var(--ink-2); font-size: .9rem; }
.terms div { display: flex; gap: 8px; flex-wrap: wrap; }
.terms dt { font-weight: 700; color: var(--blue); }
.terms dt::after { content: '＝'; color: var(--ink-3); margin-left: 4px; }
.terms dd { margin: 0; color: var(--ink-2); }
.keys { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.keys li { background: var(--blue-soft); color: var(--blue); border-radius: 8px; padding: 2px 10px; font-weight: 700; font-size: .9rem; }
.guard { background: var(--seal-soft); padding: 12px 14px; border-radius: 12px; }
.guard strong { color: var(--seal); display: inline-flex; align-items: center; gap: 6px; }
.use { background: var(--blue-soft); padding: 12px 14px; border-radius: 12px; }
.use strong { color: var(--blue); display: inline-flex; align-items: center; gap: 6px; }
.use p { margin: 6px 0 0; line-height: 1.65; }
.orig summary { cursor: pointer; font-weight: 700; color: var(--ink-2); }
.orig p { font-weight: 400; font-family: 'Noto Serif TC', var(--font); line-height: 1.95; margin-top: 8px; color: var(--ink-2); }

/* 口袋卡 */
.pocket-steps { list-style: none; counter-reset: s; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.pocket-steps li {
  counter-increment: s; display: flex; gap: 14px; align-items: flex-start; padding: 14px 16px;
  background: var(--surface);  border-radius: 14px;
}
.pocket-steps li::before {
  content: counter(s); flex: none; width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center;
  background: var(--blue); color: #fff; font-weight: 900;
}
.pocket-steps li > div { flex: 1; }
.pocket-steps p { color: var(--ink-2); font-size: .94rem; }
.pocket-steps a { flex: none; font-size: .82rem; font-weight: 700; text-decoration: none; white-space: nowrap; }
.nums { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; margin: 0; }
.nums div { background: var(--surface);  border-radius: 14px; padding: 12px 14px; }
.nums dt { font-size: 1.4rem; font-weight: 900; color: var(--seal); }
.nums dd { margin: 0; color: var(--ink-2); font-size: .88rem; }
.disclaimer { color: var(--ink-3); font-size: .85rem; }

/* 我的 */
.stat-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin: 0; }
@media (min-width: 560px) { .stat-grid { grid-template-columns: repeat(4, 1fr); } }
.stat-grid div { background: var(--surface);  border-radius: 14px; padding: 12px 14px; }
.stat-grid dt { color: var(--ink-3); font-size: .82rem; }
.stat-grid dd { margin: 0; font-size: 1.3rem; font-weight: 900; }
.week {
  position: relative; display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; height: 150px;
  background: var(--surface);  border-radius: 14px; padding: 12px;
}
.wk { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 4px; min-height: 0; }
.wk-bar { width: 100%; max-width: 30px; min-height: 3px; border-radius: 6px 6px 2px 2px; background: var(--blue-soft); }
.wk.met .wk-bar { background: var(--blue); }
.wk-val { font-size: .74rem; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.wk-day { font-size: .8rem; color: var(--ink-3); font-weight: 700; }
.wk.today .wk-day { color: var(--blue); }
.badges { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.badges li {
  display: flex; flex-direction: column; align-items: center; text-align: center; gap: 2px; padding: 14px 10px;
  background: var(--surface);  border-radius: 14px; opacity: .55;
}
.badges li.got { opacity: 1; }
.badge-icon { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 50%; background: var(--surface-2); color: var(--ink-3); margin-bottom: 4px; }
.badge-icon .ico { width: 26px; height: 26px; }
.badges li.got .badge-icon { background: color-mix(in srgb, var(--amber) 20%, var(--surface)); color: var(--amber); }
.badges small { color: var(--ink-2); font-size: .78rem; line-height: 1.4; }
.settings { display: flex; flex-direction: column; background: var(--surface);  border-radius: 14px; }
.setting { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--line); cursor: pointer; }
.setting:last-child { border-bottom: 0; }
.setting > span { display: flex; flex-direction: column; }
.setting small { color: var(--ink-3); font-size: .8rem; }
.setting select { padding: 6px 10px; border-radius: 10px; border: 2px solid var(--line); background: var(--surface-2); }
.setting input[type="checkbox"] {
  appearance: none; width: 48px; height: 28px; border-radius: 999px; background: var(--line); position: relative; flex: none; cursor: pointer; transition: background .15s;
}
.setting input[type="checkbox"]::after {
  content: ''; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; transition: transform .15s;
  box-shadow: 0 1px 2px rgba(0,0,0,.25);
}
.setting input[type="checkbox"]:checked { background: var(--green); }
.setting input[type="checkbox"]:checked::after { transform: translateX(20px); }

/* 右側欄 */
.rail-card { background: var(--surface);  border-radius: 16px; padding: 16px; display: flex; flex-direction: column; gap: 10px; text-decoration: none; color: var(--ink); }
.rail-card h3 { font-size: 1.02rem; font-weight: 900; display: flex; align-items: center; gap: 8px; }
.rail-card h3 .ico { color: var(--blue); }
.pocket-promo h3 .ico { color: var(--seal); }
.pocket-promo:hover { background: var(--surface-2); }
.pocket-promo p { color: var(--ink-2); font-size: .92rem; }
.goal { display: flex; align-items: center; gap: 10px; }
.goal span { font-size: .85rem; font-weight: 700; white-space: nowrap; color: var(--ink-2); }
.bar { flex: 1; height: 14px; border-radius: 999px; background: var(--line); overflow: hidden; }
.bar > i { display: block; height: 100%; width: 0; border-radius: inherit; background: var(--amber); transition: width .35s ease; }

/* ───── 課程畫面 ───── */
.session {
  position: fixed; inset: 0; z-index: 50; background: var(--paper);
  display: grid; grid-template-rows: auto 1fr auto; animation: rise .22s ease-out;
}
@keyframes rise { from { transform: translateY(16px); opacity: 0; } }
.session-top {
  display: flex; align-items: center; gap: 12px; width: 100%; max-width: 760px; margin: 0 auto;
  padding: calc(12px + env(safe-area-inset-top)) 16px 12px;
}
.session-top .bar > i { background: var(--green); }
.hearts-mini { font-weight: 900; color: var(--seal); min-width: 44px; text-align: right; font-variant-numeric: tabular-nums; }
.stage { overflow-y: auto; padding: 8px 16px 24px; }
.stage > * { max-width: 640px; margin: 0 auto; }
.ex { display: flex; flex-direction: column; gap: 16px; }
.ex-type { color: var(--ink-3); font-weight: 700; font-size: .9rem; }
.ex-q { font-size: 1.3rem; font-weight: 900; }
.scene {
  display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 14px;
  background: var(--blue-soft); color: var(--ink);
}
.scene-icon { flex: none; color: var(--blue); margin-top: 4px; }
.speech { display: flex; gap: 10px; align-items: flex-start; }
.speech .who { flex: none; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: var(--blue); color: #fff; }
.speech .who .ico { width: 22px; height: 22px; }
.speech p {
  position: relative; background: var(--surface); border: 2px solid var(--line); border-radius: 4px 16px 16px 16px;
  padding: 10px 14px; font-weight: 700;
}

.choices { display: flex; flex-direction: column; gap: 10px; }
.choices.tf { display: grid; grid-template-columns: 1fr 1fr; }
.choice {
  display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; padding: 14px 16px; min-height: 56px;
  border-radius: 14px; border: 2px solid var(--line); background: var(--surface); box-shadow: 0 4px 0 var(--line); cursor: pointer;
  transition: transform .06s;
}
.choices.tf .choice { justify-content: center; font-size: 1.15rem; font-weight: 900; min-height: 84px; }
.choice:hover:not(:disabled) { background: var(--surface-2); }
.choice:active:not(:disabled) { transform: translateY(3px); box-shadow: 0 1px 0 var(--line); }
.choice kbd {
  flex: none; display: grid; place-items: center; width: 26px; height: 26px; border-radius: 7px; border: 2px solid var(--line);
  font-family: var(--font); font-size: .8rem; color: var(--ink-3);
}
.choices.tf kbd { display: none; }
.choice.sel { border-color: var(--blue); background: var(--blue-soft); box-shadow: 0 4px 0 var(--blue); }
.choice.sel kbd { border-color: var(--blue); color: var(--blue); }
.choice.right { border-color: var(--green); background: var(--green-soft); box-shadow: 0 4px 0 var(--green); }
.choice.bad { border-color: var(--seal); background: var(--seal-soft); box-shadow: 0 4px 0 var(--seal); }
.choice:disabled { cursor: default; }
.choices.say .choice { font-weight: 500; }

.law-quote {
  font-family: 'Noto Serif TC', var(--font); font-size: 1.15rem; line-height: 2.1; padding: 18px;
  background: var(--surface); border: 2px solid var(--line); border-radius: 14px;
}
.slot {
  display: inline-block; min-width: 4.5em; padding: 0 8px; margin: 0 2px; text-align: center;
  border-bottom: 3px solid var(--blue); color: var(--blue); font-weight: 900; font-family: var(--font);
}
.slot.right { border-color: var(--green); color: var(--green); }
.slot.bad { border-color: var(--seal); color: var(--seal); text-decoration: line-through; }
.bank { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
.bank.col { flex-direction: column; align-items: stretch; }
.chip {
  padding: 10px 16px; min-height: 48px; border-radius: 12px; border: 2px solid var(--line); background: var(--surface);
  box-shadow: 0 3px 0 var(--line); font-weight: 700; cursor: pointer;
}
.chip.wide { width: 100%; text-align: left; font-weight: 500; }
.chip.used { opacity: .3; pointer-events: none; }
.chip:disabled { cursor: default; }
.order-answer { list-style: none; counter-reset: o; margin: 0; padding: 12px; min-height: 80px; display: flex; flex-direction: column; gap: 8px; border: 2px dashed var(--line); border-radius: 14px; }
.order-answer li { counter-increment: o; display: flex; align-items: center; gap: 10px; }
.order-answer li::before { content: counter(o); font-weight: 900; color: var(--blue); width: 1.2em; text-align: center; }
.order-answer li.placeholder { color: var(--ink-3); justify-content: center; }
.order-answer li.placeholder::before { content: none; }
.order-answer li.right .chip { border-color: var(--green); background: var(--green-soft); }
.order-answer li.bad .chip { border-color: var(--seal); background: var(--seal-soft); }
.chip.placed { border-color: var(--blue); }

.match { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.match-col { display: flex; flex-direction: column; gap: 10px; }
.tile {
  min-height: 64px; padding: 10px 12px; border-radius: 12px; border: 2px solid var(--line); background: var(--surface);
  box-shadow: 0 3px 0 var(--line); font-size: .94rem; font-weight: 700; cursor: pointer; line-height: 1.45;
}
.tile.sel { border-color: var(--blue); background: var(--blue-soft); }
.tile.right { border-color: var(--green); background: var(--green-soft); color: var(--green); opacity: .7; cursor: default; }
.tile.shake, .chip.shake { animation: shake .35s; border-color: var(--seal); }
@keyframes shake { 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }

.teach .law-card { margin-top: 8px; }

.check-bar { border-top: 2px solid var(--line); background: var(--surface); padding: 16px 16px calc(16px + env(safe-area-inset-bottom)); }
.check-bar:empty { display: none; }
.check-inner { max-width: 760px; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.check-inner .btn { min-width: 140px; }
.check-bar.is-right { background: var(--green-soft); border-color: transparent; }
.check-bar.is-bad { background: var(--seal-soft); border-color: transparent; }
.fb { flex-wrap: wrap; }
.fb-text { flex: 1 1 280px; display: flex; flex-direction: column; gap: 4px; max-height: 40vh; overflow-y: auto; }
.fb-title { font-size: 1.25rem; font-weight: 900; }
.is-right .fb-title { color: var(--green); }
.is-bad .fb-title { color: var(--seal); }
.fb-ans { white-space: pre-line; }
.fb-exp { font-size: .94rem; }
.fb-ref { font-size: .82rem; color: var(--ink-3); }
@media (max-width: 559px) {
  .fb .btn { width: 100%; }
}

.end { display: flex; flex-direction: column; align-items: center; gap: 18px; text-align: center; padding-top: 6vh; }
.end h2 { font-size: 1.6rem; font-weight: 900; }
.end-icon { color: var(--seal); }
.end-icon .ico { width: 72px; height: 72px; }
.big-stamp .stack { gap: .08em; }
.big-stamp {
  display: grid; place-items: center; width: 150px; height: 150px; border-radius: 16px;
  font-family: var(--font-seal); font-weight: 900; font-size: 3rem;
  color: #FFF6F0; background: var(--seal);
  box-shadow: inset 0 0 0 5px var(--seal), inset 0 0 0 9px #FFF6F0;
  animation: stamp .55s cubic-bezier(.2, 1.6, .4, 1) .35s both;
}
@keyframes stamp {
  0% { transform: scale(2.4) rotate(8deg); opacity: 0; }
  60% { transform: scale(.94) rotate(-7deg); opacity: 1; }
  100% { transform: scale(1) rotate(-6deg); opacity: 1; }
}
.stats { display: flex; gap: 12px; margin: 0; flex-wrap: wrap; justify-content: center; }
.stats div { min-width: 96px;  border-radius: 14px; padding: 8px 14px; background: var(--surface); }
.stats dt { font-size: .8rem; color: var(--ink-3); }
.stats dd { margin: 0; font-size: 1.4rem; font-weight: 900; font-variant-numeric: tabular-nums; }
.new-badges { list-style: none; padding: 0; margin: 0; font-weight: 700; }

/* 提示與對話框 */
.toasts { position: fixed; left: 50%; bottom: calc(var(--tab-h) + 16px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 90; display: flex; flex-direction: column; gap: 8px; width: max-content; max-width: calc(100vw - 32px); }
.toast { display: flex; align-items: center; gap: 8px; background: var(--ink); color: var(--paper); padding: 10px 16px; border-radius: 12px; font-weight: 700; animation: rise .2s; transition: opacity .3s; }
.toast.out { opacity: 0; }
.modal-wrap { position: fixed; inset: 0; z-index: 100; background: rgba(10, 18, 34, .5); display: grid; place-items: center; padding: 16px; }
.modal { width: min(400px, 100%); background: var(--surface); border-radius: 18px; padding: 22px; display: flex; flex-direction: column; gap: 10px; }
.modal h3 { font-size: 1.2rem; font-weight: 900; }
.modal p { color: var(--ink-2); }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 8px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001s !important; animation-iteration-count: 1 !important; transition: none !important; }
}

@media print {
  .side, .topbar, .tab-bar, .rail, .row-actions, .skip { display: none !important; }
  body { background: #fff; color: #000; }
  .shell { display: block; padding: 0; }
  .view { max-width: none; padding: 0; }
  .pocket-steps li, .nums div { break-inside: avoid; border-color: #999; }
}

/* ───── 圖示 ───── */
.ico { width: 1.15em; height: 1.15em; flex: none; vertical-align: -0.2em; }
.ico.fill { fill: currentColor; }
.stat .ico { width: 18px; height: 18px; margin-right: 3px; }
.stat-grid .flame { color: var(--amber); margin-right: 4px; }
.tf-label { display: inline-flex; align-items: center; gap: 10px; }
.tf-label .ico { width: 28px; height: 28px; stroke-width: 2.6; }
.tf-o { color: var(--green); }
.tf-x { color: var(--seal); }
.hearts-mini { display: inline-flex; align-items: center; justify-content: flex-end; gap: 4px; }
.hearts-mini.scene-ic { color: var(--blue); }
.icon-btn { display: grid; place-items: center; }
.icon-btn .ico { width: 24px; height: 24px; }
.new-badges li { display: flex; align-items: center; justify-content: center; gap: 6px; }
.new-badges .ico { color: var(--amber); }

/* ───── 載入畫面 ───── */
.splash {
  position: fixed; inset: 0; z-index: 200; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px;
  background: var(--blue); color: #fff; text-align: center; padding: 24px; transition: opacity .6s ease, visibility .6s;
}
.splash.out { opacity: 0; visibility: hidden; }
.splash-seal {
  width: 112px; height: 112px; border-radius: 18px;
  background: var(--seal); color: #FFF6F0; font-family: var(--font-seal); font-weight: 900; font-size: 1.9rem; line-height: 1;
  box-shadow: inset 0 0 0 4px var(--seal), inset 0 0 0 8px #FFF6F0, 0 12px 30px rgba(0,0,0,.25);
  animation: stamp .6s cubic-bezier(.2, 1.6, .4, 1) .15s both;
}
.splash-seal i { font-style: normal; }
.splash-name { font-size: 1.7rem; font-weight: 900; margin-top: 4px; letter-spacing: .08em; animation: fadeUp .5s ease .55s both; }
.splash-sub { opacity: .85; animation: fadeUp .5s ease .65s both; }
.splash-tip { font-size: .88rem; opacity: .8; max-width: 300px; min-height: 1.6em; }
@keyframes load { from { transform: translateX(-110%); } to { transform: translateX(260%); } }
@keyframes fadeUp { from { opacity: 0; transform: translateY(10px); } }

/* ───── 動態 ───── */
.view > .enter { animation: fadeUp .28s ease-out both; }
.stat.bump { animation: bump .5s ease; }
.stat.drop { animation: shake .4s ease; }
@keyframes bump { 40% { transform: scale(1.18); } }
.node.just-stamped { animation: stampNode .65s cubic-bezier(.2, 1.6, .4, 1) .25s both; }
@keyframes stampNode {
  0% { transform: scale(2.2) rotate(10deg); opacity: 0; }
  60% { transform: scale(.94) rotate(-6deg); opacity: 1; }
  100% { transform: rotate(-4deg); opacity: 1; }
}
.check-bar.is-right .check-inner, .check-bar.is-bad .check-inner { animation: fadeUp .22s ease-out; }
.check-bar.is-right, .check-bar.is-bad { animation: barIn .25s ease-out; }
@keyframes barIn { from { transform: translateY(30%); } }
.choice.right { animation: pop .3s ease; }
.choice.bad { animation: shake .35s ease; }
@keyframes pop { 50% { transform: scale(1.03); } }
.ex, .teach { animation: fadeUp .25s ease-out; }
.session-top .bar > i { position: relative; overflow: hidden; }
.session-top .bar > i::after {
  content: ''; position: absolute; inset: 3px 8px auto 8px; height: 4px; border-radius: 4px; background: rgba(255,255,255,.35);
}
.unit-progress i { transition: background .3s; }
.end .stats div { animation: fadeUp .35s ease-out both; }
.end .stats div:nth-child(1) { animation-delay: .7s; }
.end .stats div:nth-child(2) { animation-delay: .8s; }
.end .stats div:nth-child(3) { animation-delay: .9s; }

/* ───── 角色 ───── */
.char { position: relative; width: var(--size, 96px); flex: none; display: flex; flex-direction: column; align-items: center; transition: opacity .25s, filter .25s; }
.char svg { width: 100%; display: block; overflow: visible; }
/* 角色動作規則集中在檔案後段「角色動作」區 */
.char.dim { opacity: .45; filter: saturate(.6); }
.char-name { font-size: .8rem; font-weight: 700; color: var(--ink-2); margin-top: 2px; }
@keyframes breathe { 50% { transform: scaleY(1.015) translateY(-1px); } }
@keyframes sway { 0%, 100% { transform: rotate(0); } 30% { transform: rotate(-2deg); } 60% { transform: rotate(1.5deg); } }
@keyframes blink { 0%, 93%, 100% { transform: scaleY(1); } 95% { transform: scaleY(.1); } }
@keyframes talk { from { transform: scaleY(.4); } to { transform: scaleY(1.1); } }
@keyframes think { 50% { transform: rotate(5deg); } }
@keyframes hop { 0% { transform: translateY(0); } 35% { transform: translateY(-16px) scale(1.03); } 65% { transform: translateY(0) scale(.98, 1.02); } 100% { transform: none; } }
@keyframes jolt { 30% { transform: translateY(-6px); } 60% { transform: translateY(1px); } }

/* 角色＋對話泡泡 */
.talk-row { display: flex; align-items: flex-end; gap: 10px; }
.bubble {
  position: relative; flex: 1; min-width: 0; background: var(--surface); border-radius: 18px 18px 18px 4px;
  padding: 12px 16px; margin-bottom: 18px; box-shadow: 0 1px 0 var(--line);
}
.bubble b { display: block; font-size: .8rem; color: var(--ink-3); }
.bubble p { font-weight: 700; }
.mentor-row { margin-bottom: 4px; }
.mentor-row .bubble p { font-weight: 700; color: var(--blue); }
.q-wrap { display: flex; flex-direction: column; gap: 8px; max-width: 640px; margin: 0 auto; }

/* 故事對話 */
.story { display: flex; flex-direction: column; gap: 14px; }
.story-stage {
  display: flex; justify-content: space-around; align-items: flex-end; padding: 8px 0 4px;
  position: sticky; top: -8px; z-index: 2; background: var(--paper); box-shadow: 0 10px 12px -10px rgba(16, 32, 64, .18);
}
.thread { display: flex; flex-direction: column; gap: 10px; padding-bottom: 8px; }
.line { max-width: 82%; padding: 10px 14px; border-radius: 18px; background: var(--surface); animation: fadeUp .25s ease-out; }
.line b { display: block; font-size: .78rem; color: var(--ink-3); }
.line.left { align-self: flex-start; border-bottom-left-radius: 4px; }
.line.right { align-self: flex-end; border-bottom-right-radius: 4px; background: var(--blue-soft); }
.line.ask p { font-weight: 700; }
.line.ok { background: var(--green-soft); }
.line.no { background: var(--seal-soft); }
.replies { display: flex; flex-direction: column; gap: 8px; }
.replies.in-thread { align-self: stretch; animation: fadeUp .25s ease-out; }
.reply {
  display: flex; align-items: center; gap: 10px; text-align: left; padding: 12px 14px; min-height: 52px; border-radius: 16px;
  border: 2px solid var(--line); background: var(--surface); box-shadow: 0 3px 0 var(--line); cursor: pointer; font: inherit;
}
.reply kbd { flex: none; display: grid; place-items: center; width: 24px; height: 24px; border-radius: 7px; border: 2px solid var(--line); font-family: var(--font); font-size: .78rem; color: var(--ink-3); }
.reply.sel { border-color: var(--blue); background: var(--blue-soft); box-shadow: 0 3px 0 var(--blue); }
.reply.right { border-color: var(--green); background: var(--green-soft); box-shadow: 0 3px 0 var(--green); }
.reply.bad { border-color: var(--seal); background: var(--seal-soft); box-shadow: 0 3px 0 var(--seal); animation: shake .35s; }
.reply:disabled { cursor: default; }
.reply-label { font-weight: 900; font-size: 1.1rem; }
.chat-ex .talk-row .bubble { border-radius: 18px 18px 18px 4px; }

/* 誰說得對 */
.who-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.who-card {
  display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 12px 10px 14px; border-radius: 18px; cursor: pointer;
  border: 2px solid var(--line); background: var(--surface); box-shadow: 0 4px 0 var(--line); font: inherit; text-align: center;
}
.who-name { font-size: .8rem; color: var(--ink-3); font-weight: 700; }
.who-say { font-weight: 700; line-height: 1.5; }
.who-card.sel { border-color: var(--blue); background: var(--blue-soft); box-shadow: 0 4px 0 var(--blue); }
.who-card.right { border-color: var(--green); background: var(--green-soft); box-shadow: 0 4px 0 var(--green); }
.who-card.bad { border-color: var(--seal); background: var(--seal-soft); box-shadow: 0 4px 0 var(--seal); }
.who-card:disabled { cursor: default; }

/* 選數字 */
.num-sentence { font-size: 1.3rem; font-weight: 700; text-align: center; padding: 18px; background: var(--surface); border-radius: 16px; }
.num-slot { display: inline-block; min-width: 2.4em; margin: 0 6px; padding: 0 8px; border-bottom: 3px solid var(--blue); color: var(--blue); font-weight: 900; font-size: 1.6rem; }
.num-slot.right { color: var(--green); border-color: var(--green); }
.num-slot.bad { color: var(--seal); border-color: var(--seal); }
.num-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.num-tile {
  min-height: 72px; border-radius: 16px; border: 2px solid var(--line); background: var(--surface); box-shadow: 0 4px 0 var(--line);
  font-size: 1.7rem; font-weight: 900; cursor: pointer; font-variant-numeric: tabular-nums;
}
.num-tile.sel { border-color: var(--blue); color: var(--blue); background: var(--blue-soft); box-shadow: 0 4px 0 var(--blue); }
.num-tile.right { border-color: var(--green); color: var(--green); background: var(--green-soft); box-shadow: 0 4px 0 var(--green); }
.num-tile.bad { border-color: var(--seal); color: var(--seal); background: var(--seal-soft); box-shadow: 0 4px 0 var(--seal); }

/* 找錯處 */
.spot-box { background: var(--surface); border-radius: 16px; padding: 18px; display: flex; flex-direction: column; gap: 12px; }
.spot-line { display: flex; flex-wrap: wrap; gap: 8px; font-size: 1.15rem; line-height: 1.6; }
.seg { padding: 6px 10px; border-radius: 10px; border: 2px dashed var(--line); background: transparent; cursor: pointer; font: inherit; font-weight: 700; }
.seg.sel { border-style: solid; border-color: var(--blue); background: var(--blue-soft); }
.seg.bad-seg { border-style: solid; border-color: var(--seal); background: var(--seal-soft); color: var(--seal); text-decoration: line-through; }
.seg.miss { border-style: solid; border-color: var(--ink-3); }
.seg:disabled { cursor: default; }
.seg-fix { display: flex; align-items: center; gap: 6px; color: var(--green); font-weight: 900; }

/* 完整條文 */
.reveal { display: flex; flex-direction: column; gap: 14px; max-width: 640px; margin: 0 auto; }

/* 結算 */
.end-hero { display: flex; align-items: flex-end; justify-content: center; gap: 8px; }

/* S 形路徑上的角色 */
.path-host {
  position: absolute; top: 50%; left: 50%; pointer-events: none;
  transform: translate(calc(-50% + var(--side) * (var(--amp) + 70px)), -50%);
}
@media (max-width: 420px) { .path-host .char { --size: 72px !important; } }
.node.mix { border-radius: 50%; }

/* 新聞改編標籤 */
.news-tag { display: flex; align-items: flex-start; gap: 8px; padding: 10px 12px; border-radius: 12px; background: color-mix(in srgb, var(--amber) 20%, var(--surface)); font-size: .9rem; font-weight: 700; }
.news-tag .ico { flex: none; color: var(--orange); margin-top: 3px; }
.news-badge { align-self: flex-start; margin-top: 4px; padding: 1px 8px; border-radius: 999px; background: var(--amber); color: #3A2600; font-size: .74rem; font-weight: 700; }
.after { max-width: 420px; padding: 14px 16px; border-radius: 14px; background: var(--surface); text-align: left; display: flex; flex-direction: column; gap: 6px; }
.after p { font-size: .94rem; color: var(--ink-2); }
.after a { font-weight: 700; font-size: .9rem; }
.char-name { color: var(--c, var(--ink-2)); }

/* 彩紙 */
.confetti { position: fixed; inset: 0; z-index: 300; pointer-events: none; overflow: hidden; }
.confetti i { position: absolute; top: 0; left: 0; display: block; will-change: transform; }
  100% { transform: translate(var(--dx), 105vh) rotate(var(--rot)); opacity: 0; }
}
.thread { cursor: pointer; }

/* ───── 角色動作 ─────
   原則：表情用淡入淡出切換；姿勢（頭歪、手的位置）用 translate／rotate 屬性加 transition，
   和持續播放的 transform 動畫（呼吸、晃頭）疊加，所以換動作時會從原本的位置慢慢移過去。 */
.char svg { animation: breathe 3.4s ease-in-out infinite; animation-delay: var(--delay); transform-origin: 50% 100%; }
.char .c-body { transform-box: fill-box; }
.char .c-head, .char .c-head-back {
  transform-box: fill-box; transform-origin: 50% 90%;
  animation: sway 6s ease-in-out infinite; animation-delay: var(--delay);
  transition: rotate .5s ease, translate .5s ease;
}
.char.custom .c-head, .char.custom .c-head-back { transform-box: view-box; transform-origin: 60px 98px; }
.char[data-mood="sad"] .c-head, .char[data-mood="sad"] .c-head-back { rotate: -6deg; translate: 0 3px; }
.char[data-mood="think"] .c-head, .char[data-mood="think"] .c-head-back { rotate: 6deg; }
.char.react[data-mood="happy"] svg { animation: hop .7s cubic-bezier(.3, 1.6, .5, 1); }
.char.react[data-mood="surprised"] svg { animation: jolt .4s ease; }

/* 五官：淡入淡出 */
.char .brows, .char .eyes, .char .mouth { opacity: 0; transition: opacity .18s ease; }
.char .brows-normal, .char .eyes-open, .char .m-idle { opacity: 1; }
.char[data-mood="talk"] .m-idle { opacity: 0; }
.char[data-mood="talk"] .m-talk { opacity: 1; }
.char[data-mood="happy"] :is(.eyes-open, .m-idle, .brows-normal) { opacity: 0; }
.char[data-mood="happy"] :is(.eyes-happy, .m-happy, .brows-up) { opacity: 1; }
.char[data-mood="sad"] :is(.brows-normal, .m-idle) { opacity: 0; }
.char[data-mood="sad"] :is(.brows-sad, .m-sad) { opacity: 1; }
.char[data-mood="surprised"] :is(.brows-normal, .m-idle) { opacity: 0; }
.char[data-mood="surprised"] :is(.brows-up, .m-surprised) { opacity: 1; }
.char[data-mood="think"] .m-idle { opacity: 0; }
.char[data-mood="think"] .m-think { opacity: 1; }
.char.has-surprised[data-mood="surprised"] .eyes-open { opacity: 0; }
.char.has-surprised[data-mood="surprised"] .eyes-surprised { opacity: 1; }
.char.has-closed[data-mood="think"] .eyes-open { opacity: 0; }
.char.has-closed[data-mood="think"] .eyes-closed { opacity: 1; }

/* 講話：嘴巴開合 */
.char[data-mood="talk"] .m-talk, .char .talk-mouth { transform-box: fill-box; transform-origin: center; animation: talk .18s ease-in-out infinite alternate; }

/* 眨眼：沒有閉眼圖層的用壓扁；有閉眼圖層的用換圖（只在平常、講話、難過時眨） */
.char:not(.has-closed) .eyes-open { transform-box: fill-box; transform-origin: center; animation: blink 4.8s infinite; animation-delay: var(--delay); }
.char.has-closed:is([data-mood="idle"], [data-mood="talk"], [data-mood="sad"]) .eyes-open { animation: blink-hide 4.8s infinite; animation-delay: var(--delay); }
.char.has-closed:is([data-mood="idle"], [data-mood="talk"], [data-mood="sad"]) .eyes-closed { animation: blink-show 4.8s infinite; animation-delay: var(--delay); }
@keyframes blink-hide { 0%, 93%, 97.5%, 100% { opacity: 1; } 94%, 97% { opacity: 0; } }
@keyframes blink-show { 0%, 93%, 97.5%, 100% { opacity: 0; } 94%, 97% { opacity: 1; } }

/* 手：姿勢用 translate 慢慢移過去；小動作用 transform 動畫疊加 */
.char .c-hand { transform-box: view-box; transition: translate .45s cubic-bezier(.34, 1.3, .5, 1); }
.char[data-mood="think"] .c-hand-a { translate: 12px -22px; }
.char[data-mood="happy"] .c-hand-a { translate: -6px -18px; }
.char[data-mood="happy"] .c-hand-b { translate: 6px -18px; }
.char[data-mood="surprised"] .c-hand-a { translate: -4px -30px; }
.char[data-mood="surprised"] .c-hand-b { translate: 4px -30px; }
.char[data-mood="sad"] .c-hand { translate: 0 4px; }
.char[data-mood="talk"] .c-hand-b { animation: gesture .6s ease-in-out infinite alternate; }
.char[data-mood="happy"] .c-hand { animation: cheer .5s ease-in-out infinite alternate; }
.char[data-mood="think"] .c-hand-a { animation: tap 1.6s ease-in-out infinite; }
@keyframes gesture { from { transform: translateY(0); } to { transform: translate(2px, -7px); } }
@keyframes cheer { from { transform: translateY(0); } to { transform: translateY(-4px); } }
@keyframes tap { 50% { transform: translateY(-2px); } }
.char.dim { opacity: .45; filter: saturate(.6); }

/* 聊天訊息：輸入中三個點、送出時彈一下 */
.dots { display: inline-flex; gap: 4px; padding: 6px 2px; vertical-align: middle; }
.dots i { width: 7px; height: 7px; border-radius: 50%; background: var(--ink-3); animation: dot 1s ease-in-out infinite; }
.dots i:nth-child(2) { animation-delay: .15s; }
.dots i:nth-child(3) { animation-delay: .3s; }
@keyframes dot { 0%, 60%, 100% { transform: translateY(0); opacity: .5; } 30% { transform: translateY(-5px); opacity: 1; } }
.line.pop, .bubble p.pop { animation: msg-pop .28s cubic-bezier(.3, 1.4, .5, 1); }
@keyframes msg-pop { from { transform: scale(.92); } }
.line.cont { margin-top: -4px; }
.line.left.cont { border-top-left-radius: 6px; }
.line.right.cont { border-top-right-radius: 6px; }

/* 間距修正：選項與前後訊息、題目與導師泡泡、結算區塊 */
.replies.in-thread { margin: 6px 0 12px; }
.replies.in-thread + .line { margin-top: 4px; }
.q-wrap { gap: 14px; }
.mentor-row .bubble { margin-bottom: 12px; }
.chat-ex .talk-row { margin: 4px 0 6px; }
.reply-label { margin-top: 4px; }
.who-grid { margin-top: 6px; }
.num-grid { margin-top: 4px; }
.spot-box { margin-top: 4px; }
.end .after { margin-top: 4px; }
.news-tag { margin-bottom: 2px; }
/* 中文斷行：避免標點落到行首、少出現單字一行 */
.line p, .bubble p, .who-say, .reply span, .choice span, .fb-exp, .plain li { line-break: strict; text-wrap: pretty; }

/* 題目區塊的上下節奏：情境卡、題目、提示之間保持一致間距 */
.ex-head { display: flex; flex-direction: column; gap: 14px; }
.ex-head:empty { display: none; }
.ex-head .scene + .ex-q { margin-top: 2px; }
.scene + .talk-row, .talk-row + .ex-q { margin-top: 4px; }
.thread { scroll-margin-bottom: 24px; }

/* ───── 慶祝：持續跳舞 ─────
   一輪 4.8 秒：左右踏步兩次 → 跳起來轉一圈 → 再踏步；頭跟著點、雙手輪流揮，旁邊有星星閃。 */
.char[data-mood="dance"] :is(.eyes-open, .m-idle, .brows-normal) { opacity: 0; }
.char[data-mood="dance"] :is(.eyes-happy, .m-happy, .brows-up) { opacity: 1; }
.char[data-mood="dance"] svg { animation: dance 4.8s ease-in-out infinite; transform-origin: 50% 100%; }
.char[data-mood="dance"] :is(.c-head, .c-head-back) { animation: head-bob .6s ease-in-out infinite alternate; }
.char[data-mood="dance"] .c-hand-a { translate: -8px -26px; animation: wave .6s ease-in-out infinite alternate; }
.char[data-mood="dance"] .c-hand-b { translate: 8px -26px; animation: wave .6s ease-in-out infinite alternate-reverse; }
@keyframes dance {
  0%, 100% { transform: none; }
  6% { transform: translate(-4px, -9px) rotate(-7deg); }
  12% { transform: scale(1.04, .96); }
  18% { transform: translate(4px, -9px) rotate(7deg); }
  24% { transform: scale(1.04, .96); }
  30% { transform: translate(-4px, -9px) rotate(-7deg); }
  36% { transform: scale(1.04, .96); }
  42% { transform: translate(4px, -9px) rotate(7deg); }
  48% { transform: scale(1.08, .9); }
  56% { transform: translateY(-34px) rotateY(180deg) scale(1.04); }
  64% { transform: translateY(-34px) rotateY(360deg); }
  70% { transform: scale(1.1, .88); }
  76% { transform: translate(-4px, -9px) rotate(-7deg); }
  82% { transform: scale(1.04, .96); }
  88% { transform: translate(4px, -9px) rotate(7deg); }
  94% { transform: scale(1.04, .96); }
}
@keyframes head-bob { from { rotate: -6deg; } to { rotate: 6deg; } }
@keyframes wave { from { transform: translate(0, 0); } to { transform: translate(0, -9px) rotate(-12deg); } }
.char[data-mood="dance"]::before, .char[data-mood="dance"]::after {
  content: ''; position: absolute; width: 18px; height: 18px; pointer-events: none;
  clip-path: polygon(50% 0, 61% 38%, 100% 50%, 61% 62%, 50% 100%, 39% 62%, 0 50%, 39% 38%);
  animation: twinkle 1.2s ease-in-out infinite;
}
.char[data-mood="dance"]::before { background: var(--amber); top: 6%; left: -4%; }
.char[data-mood="dance"]::after { background: var(--pink); top: 22%; right: -6%; width: 14px; height: 14px; animation-delay: .6s; }
@keyframes twinkle { 0%, 100% { transform: scale(0) rotate(0); opacity: 0; } 40% { transform: scale(1.15) rotate(45deg); opacity: 1; } 70% { transform: scale(.8) rotate(90deg); opacity: .8; } }
@media (prefers-reduced-motion: reduce) {
  .char[data-mood="dance"] svg, .char[data-mood="dance"] :is(.c-head, .c-head-back, .c-hand), .char[data-mood="dance"]::before, .char[data-mood="dance"]::after { animation: none; }
}
/* 慶祝時一直開心揮手 */
.cheer-char[data-mood="happy"] .c-hand { animation: cheer .45s ease-in-out infinite alternate; }

/* 出題泡泡：開場白＋情境＋題目 */
.mentor-row .bubble .say p { color: var(--ink); }
.mentor-row .bubble .say-lead { color: var(--blue); font-size: .92rem; }
.mentor-row .bubble .say-scene { font-weight: 500; color: var(--ink-2); margin-top: 6px; }
.mentor-row .bubble .say-q { font-size: 1.15rem; font-weight: 900; line-height: 1.5; margin-top: 6px; }
.say.pop { animation: msg-pop .28s cubic-bezier(.3, 1.4, .5, 1); }
.ex { transition: opacity .3s ease, translate .3s ease; }
.ex.wait { opacity: 0; translate: 0 10px; pointer-events: none; }
/* 對話裡第三位角色（例如路過的墨鏡大哥） */
.line.left.extra { background: color-mix(in srgb, var(--surface) 82%, var(--ink-3)); }
/* 角色加大後，路徑上的角色往外移一點 */
.path-host { transform: translate(calc(-50% + var(--side) * (var(--amp) + 84px)), -50%); }
@media (max-width: 420px) {
  .path-host .char { --size: 96px !important; }
  .path-host { transform: translate(calc(-50% + var(--side) * (var(--amp) + 64px)), -50%); }
}
.end-hero .char { margin-left: -6px; }

/* ───── 跳躍不被裁切：上方預留空間 ───── */
.story-stage { padding-top: 30px; top: -30px; }
.q-wrap { padding-top: 18px; }
.chat-ex, .ex:has(> .talk-row:first-child) { padding-top: 14px; }
.end-hero { padding-top: 44px; }
.end { padding-top: 2vh; }

/* ───── 角色個性：每個人的待機、講話、開心、跳舞都不一樣 ─────
   手的座標：c-hand-a 在右下（約 86,117），c-hand-b 在左下（約 34,117）。 */

/* 王律師：冷靜。動作小、慢；講話時一手抬起來比重點；開心只點頭；跳舞是收斂的側步 */
.char-wang svg { animation-duration: 4.6s; }
.char-wang .c-head { animation: sway-sm 8s ease-in-out infinite; animation-delay: var(--delay); }
.char-wang[data-mood="talk"] .c-hand-b { animation: none; }
.char-wang[data-mood="talk"] .c-hand-a { translate: -10px -26px; animation: point 1.4s ease-in-out infinite; }
.char-wang.react[data-mood="happy"] svg { animation: nod .6s ease; }
.char-wang[data-mood="happy"] .c-hand { animation: none; }
.char-wang[data-mood="happy"] .c-hand-b { translate: 0 0; }
.char-wang[data-mood="happy"] .c-hand-a { translate: -10px -22px; }
.char-wang[data-mood="dance"] svg { animation: dance-cool 2.4s ease-in-out infinite; }
.char-wang[data-mood="dance"] .c-hand-a { translate: -10px -24px; animation: point .6s ease-in-out infinite alternate; }
.char-wang[data-mood="dance"] .c-hand-b { translate: 0 -4px; animation: none; }

/* 林警員：站得挺、不太晃；講話手刀比劃；開心敬禮；跳舞是踏步 */
.char-lin .c-head { animation: sway-sm 7s ease-in-out infinite; }
.char-lin[data-mood="talk"] .c-hand-b { animation: chop .45s ease-in-out infinite alternate; }
.char-lin[data-mood="dance"] svg { animation: march .9s ease-in-out infinite; }
.char-lin[data-mood="dance"] .c-hand-a { translate: 0 -10px; animation: swing .45s ease-in-out infinite alternate; }
.char-lin[data-mood="dance"] .c-hand-b { translate: 0 -10px; animation: swing .45s ease-in-out infinite alternate-reverse; }

/* 巡邏員警：不耐煩。原地抖腳；講話用手指戳；開心是得意地抬下巴 */
.char-patrol svg { animation: jitter 2.2s ease-in-out infinite; }
.char-patrol[data-mood="talk"] .c-hand-b { animation: none; }
.char-patrol[data-mood="talk"] .c-hand-a { translate: -20px -18px; animation: jab .35s ease-in-out infinite alternate; }
.char-patrol.react[data-mood="happy"] svg { animation: nod .5s ease; }
.char-patrol[data-mood="happy"] .c-head { rotate: -7deg; }
.char-patrol[data-mood="happy"] .c-hand { animation: none; translate: 0 0; }
.char-patrol.react[data-mood="surprised"] svg { animation: jolt .3s ease 2; }

/* 奇米：厭世社畜。駝背、晃很慢、呼吸像嘆氣；講話懶懶地揮手；開心只小跳；跳舞是懶人點頭 */
.char-ming svg { animation: sigh 5.5s ease-in-out infinite; }
.char-ming .c-head { rotate: 4deg; translate: 0 2px; animation: sway 10s ease-in-out infinite; }
.char-ming[data-mood="talk"] .c-hand-b { animation: gesture 1.2s ease-in-out infinite alternate; }
.char-ming.react[data-mood="happy"] svg { animation: hop-sm .6s ease; }
.char-ming[data-mood="happy"] .c-hand-b { translate: 0 0; animation: none; }
.char-ming[data-mood="happy"] .c-hand-a { translate: -6px -24px; animation: cheer .7s ease-in-out infinite alternate; }
.char-ming[data-mood="dance"] svg { animation: lazy 1.6s ease-in-out infinite; }
.char-ming[data-mood="dance"] :is(.c-head, .c-head-back) { animation: head-bob 1.1s ease-in-out infinite alternate; }
.char-ming[data-mood="dance"] .c-hand-a { translate: -6px -14px; }
.char-ming[data-mood="dance"] .c-hand-b { translate: 6px -14px; animation-duration: 1.1s; }

/* 小酷：活力爆表。待機也在彈；講話兩手一起比；開心大跳；跳舞最嗨 */
.char-chi svg { animation: bounce 1.8s ease-in-out infinite; }
.char-chi .c-head { animation: sway 3.6s ease-in-out infinite; }
.char-chi[data-mood="talk"] .c-hand-a { animation: gesture .5s ease-in-out infinite alternate-reverse; }
.char-chi[data-mood="talk"] .c-hand-b { animation-duration: .5s; }
.char-chi.react[data-mood="happy"] svg { animation: hop-big .8s cubic-bezier(.3, 1.4, .5, 1); }
.char-chi[data-mood="happy"] .c-hand-a { translate: -4px -34px; }
.char-chi[data-mood="happy"] .c-hand-b { translate: 4px -34px; }
.char-chi[data-mood="dance"] svg { animation-duration: 3.6s; }
.char-chi[data-mood="dance"] .c-hand-a { translate: -4px -34px; animation-duration: .4s; }
.char-chi[data-mood="dance"] .c-hand-b { translate: 4px -34px; animation-duration: .4s; }

/* 徐大媽：熱情。左右搖；講話時手揮來揮去（哎唷～）；開心拍手；跳舞扭腰 */
.char-chen svg { animation: rock 4s ease-in-out infinite; }
.char-chen[data-mood="talk"] .c-hand-b { animation: none; }
.char-chen[data-mood="talk"] .c-hand-a { translate: -8px -20px; animation: fan .5s ease-in-out infinite alternate; }
.char-chen[data-mood="happy"] .c-hand-a { translate: -22px -18px; animation: clap-a .32s ease-in-out infinite alternate; }
.char-chen[data-mood="happy"] .c-hand-b { translate: 22px -18px; animation: clap-b .32s ease-in-out infinite alternate; }
.char-chen[data-mood="dance"] svg { animation: wiggle 1.2s ease-in-out infinite; }
.char-chen[data-mood="dance"] .c-hand-a { translate: -22px -18px; animation: clap-a .3s ease-in-out infinite alternate; }
.char-chen[data-mood="dance"] .c-hand-b { translate: 22px -18px; animation: clap-b .3s ease-in-out infinite alternate; }

/* 阿凱：酒吧店長，很有節奏感。待機輕輕點頭；講話握拳；開心舉拳；跳舞甩頭 */
.char-kai .c-head { animation: groove 1.9s ease-in-out infinite; }
.char-kai[data-mood="talk"] .c-hand-b { animation: pump .5s ease-in-out infinite alternate; }
.char-kai[data-mood="happy"] .c-hand-b { translate: 0 0; animation: none; }
.char-kai[data-mood="happy"] .c-hand-a { translate: -4px -44px; animation: pump .4s ease-in-out infinite alternate; }
.char-kai[data-mood="dance"] svg { animation: bounce .55s ease-in-out infinite; }
.char-kai[data-mood="dance"] :is(.c-head, .c-head-back) { animation: headbang .55s ease-in-out infinite; }
.char-kai[data-mood="dance"] .c-hand-a { translate: -4px -44px; animation: pump .275s ease-in-out infinite alternate; }
.char-kai[data-mood="dance"] .c-hand-b { translate: 0 -6px; animation: none; }

/* 便衣男子：酷。幾乎不動，身體微微斜；講話時推墨鏡；開心只是嘴角上揚；跳舞是滑步 */
.char-guy svg { animation: none; rotate: -2deg; }
.char-guy .c-head { animation: none; rotate: 2deg; }
.char-guy[data-mood="talk"] .c-hand-b { animation: none; }
.char-guy[data-mood="talk"] .c-hand-a { animation: shades 1.8s ease-in-out 1 both; }
.char-guy.react[data-mood="happy"] svg { animation: nod .6s ease; }
.char-guy[data-mood="happy"] .c-hand { animation: none; translate: 0 0; }
.char-guy[data-mood="dance"] svg { animation: slide 2.4s ease-in-out infinite; rotate: 0deg; }
.char-guy[data-mood="dance"] .c-hand-a { translate: -8px -18px; animation: none; }
.char-guy[data-mood="dance"] .c-hand-b { translate: 0 0; animation: none; }

@keyframes sway-sm { 0%, 100% { transform: rotate(0); } 50% { transform: rotate(-1deg); } }
@keyframes point { 0%, 100% { transform: translateY(0); } 50% { transform: translate(1px, -4px); } }
@keyframes nod { 30% { transform: translateY(-5px); } 60% { transform: translateY(1px); } }
@keyframes dance-cool { 0%, 100% { transform: translateX(0); } 25% { transform: translate(-6px, -4px) rotate(-3deg); } 50% { transform: translateX(0) scale(1.02, .98); } 75% { transform: translate(6px, -4px) rotate(3deg); } }
@keyframes chop { from { transform: translateY(0); } to { transform: translate(-3px, -10px); } }
@keyframes march { 0%, 100% { transform: translateY(0) rotate(0); } 25% { transform: translateY(-8px) rotate(-2deg); } 50% { transform: translateY(0); } 75% { transform: translateY(-8px) rotate(2deg); } }
@keyframes swing { from { transform: translateY(6px); } to { transform: translateY(-8px); } }
@keyframes jitter { 0%, 70%, 100% { transform: translateY(0); } 75%, 85%, 95% { transform: translateY(-2px); } 80%, 90% { transform: translateY(0); } }
@keyframes jab { from { transform: translate(0, 0); } to { transform: translate(-5px, -3px); } }
@keyframes sigh { 0%, 100% { transform: none; } 40% { transform: scaleY(1.025) translateY(-1px); } 60% { transform: scaleY(.985) translateY(1px); } }
@keyframes hop-sm { 40% { transform: translateY(-8px); } 70% { transform: translateY(0) scale(1.02, .98); } }
@keyframes lazy { 0%, 100% { transform: rotate(-2deg); } 50% { transform: rotate(2deg) translateY(-3px); } }
@keyframes bounce { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-4px) scale(.99, 1.01); } }
@keyframes hop-big { 0% { transform: none; } 35% { transform: translateY(-26px) rotate(-6deg) scale(1.04); } 65% { transform: translateY(0) scale(1.06, .94); } 100% { transform: none; } }
@keyframes rock { 0%, 100% { transform: rotate(-2deg); } 50% { transform: rotate(2deg); } }
@keyframes fan { from { transform: rotate(-10deg) translateX(-3px); } to { transform: rotate(10deg) translateX(3px); } }
@keyframes clap-a { from { transform: translateX(0); } to { transform: translateX(-6px); } }
@keyframes clap-b { from { transform: translateX(0); } to { transform: translateX(6px); } }
@keyframes wiggle { 0%, 100% { transform: rotate(-7deg) translateX(-3px); } 50% { transform: rotate(7deg) translateX(3px); } }
@keyframes groove { 0%, 100% { transform: rotate(0) translateY(0); } 50% { transform: rotate(1.5deg) translateY(1px); } }
@keyframes pump { from { transform: translateY(0); } to { transform: translateY(-8px); } }
@keyframes headbang { 0%, 100% { rotate: -4deg; translate: 0 0; } 50% { rotate: 6deg; translate: 0 3px; } }
@keyframes shades { 0%, 100% { transform: translate(0, 0); } 30%, 60% { transform: translate(-6px, -54px); } }
@keyframes slide { 0%, 100% { transform: translateX(0) skewX(0); } 25% { transform: translateX(-12px) skewX(6deg); } 50% { transform: translateX(0); } 75% { transform: translateX(12px) skewX(-6deg); } }
@media (prefers-reduced-motion: reduce) {
  .char svg, .char .c-head, .char .c-head-back, .char .c-hand { animation: none !important; }
}

/* 結算畫面：真的遇到怎麼辦 */
.end-tips { align-self: stretch; display: flex; flex-direction: column; gap: 10px; text-align: left; margin-top: 8px; animation: fadeUp .35s ease-out 1.1s both; }
.end-tips h3 { font-size: 1.05rem; font-weight: 900; text-align: center; }
.tip-card { display: flex; flex-direction: column; gap: 8px; padding: 14px 16px; border-radius: 16px; background: var(--surface); box-shadow: 0 2px 0 var(--line); }
.tip-art { font-size: .8rem; font-weight: 700; color: var(--ink-3); }
.fb-guard { display: flex; gap: 8px; align-items: flex-start; font-size: .92rem; line-height: 1.6; line-break: strict; text-wrap: pretty; }
.fb-guard .ico { flex: none; width: 18px; height: 18px; margin-top: 3px; color: var(--green-deep, var(--green)); }
.fb-story summary { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; font-weight: 700; font-size: .88rem; color: var(--blue); list-style: none; }
.fb-story summary::-webkit-details-marker { display: none; }
.fb-story summary .ico { width: 16px; height: 16px; }
.fb-story p { margin-top: 6px; font-size: .9rem; color: var(--ink-2); line-height: 1.6; animation: fadeUp .25s ease-out; }
/* 反派巡警：驚訝＝飆髒話（揮拳亂抖），難過＝不爽（握拳發抖） */
.char-patrol[data-mood="surprised"] .c-hand-a { translate: -6px -34px; animation: pump .14s ease-in-out infinite alternate; }
.char-patrol[data-mood="surprised"] .c-hand-b { translate: 0 0; }
.char-patrol[data-mood="sad"] .c-hand { translate: 0 -4px; animation: tremble .12s linear infinite alternate; }
.char-patrol[data-mood="sad"] .c-head { rotate: 0deg; translate: 0 1px; }
@keyframes tremble { from { transform: translateX(-1px); } to { transform: translateX(1px); } }

/* ───── 列表留白：法條列表、熟練度格子、情境卡 ───── */
.law-list { gap: 12px; }
.chap { margin: 22px 0 4px; letter-spacing: .04em; }
.law-row { gap: 16px; padding: 16px 16px 16px 14px; border-radius: 16px; }
.law-row-body { gap: 6px; }
.law-row-body strong, .law-row-body b { font-size: 1.02rem; line-height: 1.4; }
.law-row-body span { font-size: .88rem; line-height: 1.65; }
.law-row .pips { align-self: center; margin-left: 4px; }
.mastery { grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); gap: 10px; }
.m-cell { gap: 6px; padding: 12px 12px 14px; border-radius: 12px; min-height: 84px; }
.m-cell span { font-size: .78rem; line-height: 1.5; }
.scene-list { gap: 14px; }
.scene-card { gap: 16px; padding: 18px 18px; }
.scene-body { gap: 4px; }
.scene-body span { line-height: 1.6; }
.scene-body small { margin-top: 2px; }

/* ───── 新角色個性 ───── */
/* 里長伯：講話很有架勢，手往外比；開心拍拍肚子；跳舞是老派搖擺 */
.char-lizhang svg { animation: sway-sm 5s ease-in-out infinite; }
.char-lizhang .c-head { animation: sway 7s ease-in-out infinite; }
.char-lizhang[data-mood="talk"] .c-hand-b { animation: none; }
.char-lizhang[data-mood="talk"] .c-hand-a { translate: 6px -22px; animation: wave .7s ease-in-out infinite alternate; }
.char-lizhang.react[data-mood="happy"] svg { animation: nod .6s ease; }
.char-lizhang[data-mood="happy"] .c-hand-a { translate: -18px -8px; animation: pat .35s ease-in-out infinite alternate; }
.char-lizhang[data-mood="happy"] .c-hand-b { translate: 18px -8px; animation: pat .35s ease-in-out infinite alternate-reverse; }
.char-lizhang[data-mood="dance"] svg { animation: rock 1.4s ease-in-out infinite; }
.char-lizhang[data-mood="dance"] .c-hand-a { translate: -2px -30px; animation: wave .7s ease-in-out infinite alternate; }
.char-lizhang[data-mood="dance"] .c-hand-b { translate: 0 0; animation: none; }

/* 小知姐：相機不離手。講話時舉起相機；開心拍照；驚訝時相機抱緊 */
.char-zhi .c-head { animation: sway 4.6s ease-in-out infinite; }
.char-zhi[data-mood="talk"] .c-hand-b { animation: gesture .55s ease-in-out infinite alternate; }
.char-zhi[data-mood="talk"] .c-hand-a { translate: -4px -10px; animation: none; }
.char-zhi[data-mood="happy"] .c-hand-a { translate: -14px -40px; animation: snap 1s ease-in-out infinite; }
.char-zhi[data-mood="happy"] .c-hand-b { translate: 0 0; animation: none; }
.char-zhi[data-mood="surprised"] .c-hand-a { translate: -18px -12px; }
.char-zhi[data-mood="dance"] .c-hand-a { translate: -14px -40px; animation: snap .6s ease-in-out infinite; }

/* 阿哲：菜鳥，有點緊張。待機會小小抖；講話時抓頭；開心握拳 */
.char-rookie svg { animation: bounce 2.6s ease-in-out infinite; }
.char-rookie[data-mood="talk"] .c-hand-b { animation: none; }
.char-rookie[data-mood="talk"] .c-hand-a { translate: -14px -70px; animation: scratch .3s ease-in-out infinite alternate; }
.char-rookie[data-mood="think"] .c-hand-a { translate: -14px -70px; animation: scratch .45s ease-in-out infinite alternate; }
.char-rookie[data-mood="happy"] .c-hand-a { translate: -2px -30px; animation: pump .3s ease-in-out infinite alternate; }
.char-rookie[data-mood="happy"] .c-hand-b { translate: 0 0; animation: none; }
.char-rookie[data-mood="dance"] svg { animation: march .8s ease-in-out infinite; }

/* 阿豪：外送員，很趕。待機原地踏步；講話手比很快；開心比讚 */
.char-hao svg { animation: jitter 1.4s ease-in-out infinite; }
.char-hao[data-mood="talk"] .c-hand-b { animation-duration: .3s; }
.char-hao[data-mood="talk"] .c-hand-a { animation: gesture .3s ease-in-out infinite alternate-reverse; }
.char-hao[data-mood="happy"] .c-hand-a { translate: -6px -26px; animation: none; }
.char-hao[data-mood="happy"] .c-hand-b { translate: 0 0; animation: none; }
.char-hao[data-mood="dance"] svg { animation: bounce .45s ease-in-out infinite; }

/* 小羽：法律系學生，抱著法典。講話時翻書；開心把書舉高；跳舞小碎步 */
.char-yu .c-head { animation: sway 5s ease-in-out infinite; }
.char-yu[data-mood="talk"] .c-hand-a { translate: -6px -14px; animation: point 1s ease-in-out infinite; }
.char-yu[data-mood="talk"] .c-hand-b { animation-duration: .8s; }
.char-yu[data-mood="happy"] .c-hand-a { translate: -8px -44px; animation: none; }
.char-yu[data-mood="happy"] .c-hand-b { translate: 0 0; animation: none; }
.char-yu.react[data-mood="happy"] svg { animation: hop .7s cubic-bezier(.3, 1.6, .5, 1); }
.char-yu[data-mood="dance"] svg { animation: wiggle 1.6s ease-in-out infinite; }

@keyframes pat { from { transform: translateY(0); } to { transform: translateY(-5px); } }
@keyframes snap { 0%, 70%, 100% { transform: none; } 80% { transform: translate(1px, 2px) scale(.96); } }
@keyframes scratch { from { transform: translateX(-2px); } to { transform: translateX(3px) rotate(8deg); } }

/* 原文填空：標出是第幾條 */
.quote-src { font-size: .8rem; font-weight: 700; color: var(--ink-3); margin-bottom: 6px; }

/* 連連看：中間留一條走線的空間，配對成功會畫出彩色曲線 */
.match { position: relative; grid-template-columns: 1fr 1fr; column-gap: 44px; }
.match-lines { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; overflow: visible; }
.match-lines .link { fill: none; stroke: var(--c); stroke-width: 3.5; stroke-linecap: round; stroke-dasharray: 400; stroke-dashoffset: 400; animation: draw-line .35s ease-out forwards; }
.match-lines .link.bad { stroke-dasharray: 6 6; stroke-dashoffset: 0; animation: fade-line .55s ease-in forwards; }
@keyframes draw-line { to { stroke-dashoffset: 0; } }
@keyframes fade-line { 0%, 60% { opacity: 1; } 100% { opacity: 0; } }
.tile { position: relative; }
.tile .dot { position: absolute; top: 50%; width: 12px; height: 12px; margin-top: -6px; border-radius: 50%; background: var(--surface); border: 2.5px solid var(--line); transition: background .2s, border-color .2s; }
.tile-L .dot { right: -8px; }
.tile-R .dot { left: -8px; }
.tile.sel .dot { border-color: var(--blue); background: var(--blue); }
.tile.right { border-color: var(--pc, var(--green)); background: color-mix(in srgb, var(--pc, var(--green)) 12%, var(--surface)); color: var(--ink); opacity: 1; }
.tile.right .dot { border-color: var(--pc, var(--green)); background: var(--pc, var(--green)); }

/* 數字記憶口訣 */
.memo { display: flex; gap: 8px; align-items: flex-start; padding: 12px 14px; border-radius: 12px; background: color-mix(in srgb, var(--amber) 16%, var(--surface)); line-height: 1.6; }
.memo .ico { flex: none; color: var(--amber); margin-top: 3px; width: 18px; height: 18px; }
.cheat { background: var(--surface); border-radius: 16px; padding: 14px 16px; }
.cheat summary { display: flex; align-items: center; gap: 8px; font-weight: 900; cursor: pointer; list-style: none; }
.cheat summary::-webkit-details-marker { display: none; }
.cheat summary::after { content: '展開'; margin-left: auto; font-size: .8rem; font-weight: 700; color: var(--blue); }
.cheat[open] summary::after { content: '收起'; }
.cheat-tip { margin: 12px 0 8px; font-size: .9rem; line-height: 1.65; color: var(--ink-2); }
.cheat ul { list-style: none; display: flex; flex-direction: column; padding: 0; margin: 0; }
.cheat li { display: grid; grid-template-columns: 76px 1fr auto; gap: 10px; align-items: center; padding: 9px 0; border-top: 1px solid var(--line); font-size: .9rem; }
.cheat li b { font-family: var(--font-seal); font-weight: 900; color: var(--seal); }
.cheat li a { font-size: .8rem; color: var(--ink-3); text-decoration: none; white-space: nowrap; }
.fb-memo { display: flex; gap: 6px; align-items: flex-start; font-size: .9rem; line-height: 1.6; }
.fb-memo .ico { flex: none; width: 16px; height: 16px; margin-top: 4px; color: var(--amber); }

/* ───── 出題介面精簡：小角色＋一句開場白，題目用整個寬度 ───── */
.mentor-row { align-items: center; gap: 10px; margin: 0; }
.mentor-row .bubble { flex: 0 1 auto; margin: 0; padding: 10px 14px; border-radius: 16px 16px 16px 4px; }
.mentor-row .bubble .say-lead { color: var(--blue); font-weight: 700; font-size: .95rem; }
.q-wrap { gap: 12px; padding-top: 14px; }
.ex-head .ex-q, .ex > .ex-q { font-size: 1.2rem; line-height: 1.55; }
.memo b { display: block; margin-bottom: 2px; }

/* ───── 換行：不用 pretty（在窄螢幕會提早換行、留下大片空白），只保留標點避頭尾 ───── */
.line p, .bubble p, .who-say, .reply span, .choice span, .fb-exp, .plain li, .fb-guard { text-wrap: wrap; }
.slot { min-width: 3.2em; }

/* ───── 手機：角色縮小，把空間留給題目和選項 ───── */
@media (max-width: 420px) {
  .stage { padding: 6px 14px 20px; }
  .mentor-row .char { --size: 56px !important; }
  .story-stage .char { --size: 96px !important; }
  .story-stage:has(> .char:nth-child(3)) .char { --size: 80px !important; }
  .talk-row:not(.mentor-row) .char { --size: 80px !important; }
  .who-card .char { --size: 84px !important; }
  .end-hero .char { --size: 120px !important; }
  .line { max-width: 88%; }
  .choice { padding: 12px 14px; min-height: 52px; gap: 10px; }
  .choices.tf .choice { min-height: 72px; }
  .law-quote { font-size: 1.05rem; line-height: 2; padding: 14px; }
  .check-bar { padding: 12px 14px calc(12px + env(safe-area-inset-bottom)); }
  .fb-text { max-height: 34vh; }
  .ex { gap: 14px; }
  .scene { padding: 10px 12px; }
}

/* ───── 安全區域（瀏海、圓角、橫向時的左右缺口、底部手勢列） ───── */
.topbar { padding-left: max(16px, env(safe-area-inset-left)); padding-right: max(16px, env(safe-area-inset-right)); }
.view { padding-left: max(16px, env(safe-area-inset-left)); padding-right: max(16px, env(safe-area-inset-right)); }
.tab-bar { padding-left: env(safe-area-inset-left); padding-right: env(safe-area-inset-right); }
.session { padding-left: env(safe-area-inset-left); padding-right: env(safe-area-inset-right); }
.modal-wrap { padding: max(16px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) max(16px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left)); }
.toasts { max-width: calc(100vw - 32px - env(safe-area-inset-left) - env(safe-area-inset-right)); }
.splash { padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left); }
@media (min-width: 760px) {
  .side { padding-left: max(14px, env(safe-area-inset-left)); padding-top: max(22px, env(safe-area-inset-top)); }
  .topbar { padding-top: max(12px, env(safe-area-inset-top)); padding-right: max(28px, env(safe-area-inset-right)); }
  .view { padding-right: max(28px, env(safe-area-inset-right)); }
}
/* 橫向手機：畫面很矮，頂部和底部的列不要太厚 */
@media (max-height: 480px) and (orientation: landscape) {
  .session-top { padding-top: max(6px, env(safe-area-inset-top)); padding-bottom: 6px; }
  .check-bar { padding-top: 8px; padding-bottom: max(8px, env(safe-area-inset-bottom)); }
  .story-stage .char, .talk-row .char { --size: 64px !important; }
}

/* ───── 結算印章：印章壓下 → 抬起移開 → 留下朱文印 ───── */
.stamp-scene { position: relative; width: 140px; height: 140px; flex: none; }
.imprint { width: 100%; height: 100%; color: var(--seal); font-family: var(--font-seal); rotate: -7deg; animation: imprint 1.4s ease-out .3s both; }
.stamp-tool { position: absolute; left: 50%; bottom: -8px; width: 150px; margin-left: -75px; transform-origin: 50% 100%; pointer-events: none;
  filter: drop-shadow(0 10px 10px rgba(30, 20, 10, .25)); animation: stamp-tool 1.4s cubic-bezier(.4, 0, .2, 1) .3s both; }
@keyframes stamp-tool {
  0% { transform: translate(40px, -220px) rotate(14deg); opacity: 0; }
  18% { opacity: 1; }
  34% { transform: translate(0, -10px) rotate(-7deg); }
  42% { transform: translate(0, 0) rotate(-7deg) scale(1.02, .94); }
  54% { transform: translate(0, 0) rotate(-7deg) scale(1, .97); }
  70% { transform: translate(-10px, -60px) rotate(-12deg); opacity: 1; }
  100% { transform: translate(-60px, -260px) rotate(-22deg); opacity: 0; }
}
@keyframes imprint {
  0%, 41% { opacity: 0; transform: scale(1.06); }
  44% { opacity: .95; transform: scale(1.03); }
  60%, 100% { opacity: 1; transform: scale(1); }
}
@media (prefers-reduced-motion: reduce) { .stamp-tool { display: none; } .imprint { animation: none; } }
@media (max-width: 420px) { .stamp-scene { width: 116px; height: 116px; } .stamp-tool { width: 124px; margin-left: -62px; } }

/* 對話重點：彩色底線 */
mark.hl { background: linear-gradient(transparent 60%, color-mix(in srgb, var(--amber) 55%, transparent) 60%); color: inherit; font-weight: 700; padding: 0 1px; border-radius: 2px; }
.line.right mark.hl { background: linear-gradient(transparent 60%, color-mix(in srgb, var(--amber) 60%, transparent) 60%); }

/* 對話舞台：上方間距精簡，開心跳躍幅度跟著縮小，避免被裁切 */
.story-stage { padding-top: 14px; top: -14px; }
.story-stage .char.react[data-mood="happy"] svg { animation: hop-sm .6s ease; }
@media (max-width: 420px) {
  .story-stage .char { --size: 88px !important; }
  .story-stage:has(> .char:nth-child(3)) .char { --size: 76px !important; }
  .talk-row:not(.mentor-row) .char { --size: 68px !important; }
}

/* ───── 使用說明 ───── */
.ob { position: relative; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 12px; max-width: 380px; width: 100%; padding: 28px 22px 20px; }
.ob.turn { animation: fadeUp .3s ease-out; }
.ob-art { position: relative; display: flex; align-items: flex-end; justify-content: center; height: 132px; }
.ob h2 { font-size: 1.25rem; font-weight: 900; }
.ob-body { color: var(--ink-2); line-height: 1.75; }
.ob-dots { display: flex; gap: 6px; margin: 4px 0; }
.ob-dots i { width: 8px; height: 8px; border-radius: 999px; background: var(--line); transition: width .25s, background .25s; }
.ob-dots i.on { width: 22px; background: var(--blue); }
.ob .modal-actions { width: 100%; display: flex; gap: 10px; }
.ob .modal-actions .btn { flex: 1; }
.ob .modal-actions .btn[hidden] { display: none; }
.ob-back { position: absolute; left: 10px; top: 10px; width: 40px; height: 40px; border: 0; border-radius: 50%; background: transparent; color: var(--ink-3); cursor: pointer; display: grid; place-items: center; }
.ob-back:hover { background: var(--surface-2); }
.guide-btn { display: inline-flex; align-items: center; gap: 6px; align-self: flex-start; margin: -4px 0 4px; }

/* ───── 反派民眾的動作 ───── */
/* 喧哥（爭議網紅）：大搖大擺、講話指著鏡頭、開心是囂張大笑，驚訝時雙手舉高 */
.char-long svg { animation: rock 2.6s ease-in-out infinite; }
.char-long[data-mood="talk"] .c-hand-b { animation: none; }
.char-long[data-mood="talk"] .c-hand-a { translate: -20px -22px; animation: jab .25s ease-in-out infinite alternate; }
.char-long[data-mood="happy"] .c-hand-a { translate: -2px -36px; animation: pump .3s ease-in-out infinite alternate; }
.char-long[data-mood="happy"] .c-hand-b { translate: 2px -36px; animation: pump .3s ease-in-out infinite alternate-reverse; }
.char-long[data-mood="surprised"] .c-hand-a { translate: -2px -44px; }
.char-long[data-mood="surprised"] .c-hand-b { translate: 2px -44px; }
.char-long[data-mood="sad"] .c-hand { translate: 0 -2px; animation: tremble .12s linear infinite alternate; }
/* 假陳警官：站得很正、動作很小；講話時把假證件舉起來 */
.char-scam svg { animation: breathe 5s ease-in-out infinite; }
.char-scam .c-head { animation: sway-sm 9s ease-in-out infinite; }
.char-scam[data-mood="talk"] .c-hand-b { animation: none; }
.char-scam[data-mood="talk"] .c-hand-a { translate: -12px -34px; animation: none; }
.char-scam[data-mood="happy"] .c-hand-a { translate: -8px -20px; animation: none; }
.char-scam[data-mood="happy"] .c-hand-b { translate: 0 0; animation: none; }
.char-scam.react[data-mood="happy"] svg { animation: nod .6s ease; }

/* 巡邏員警：面罩只有一份（放在 m-idle），所有表情都顯示；講話時以面罩底部為基準上下拉動 */
.char-patrol .m-idle { opacity: 1 !important; transform-box: fill-box; transform-origin: 50% 100%; }
.char-patrol[data-mood="talk"] .m-idle { animation: mask-talk .2s ease-in-out infinite alternate; }
@keyframes mask-talk { from { transform: scaleY(.95); } to { transform: scaleY(1.09); } }

/* ───── 隱藏章節：波浪分界，下方轉暗（裏版） ───── */
.dark-zone, .dark-session {
  --paper: #0D1020; --surface: #171B33; --surface-2: #1F2442; --ink: #EEF0FA; --ink-2: #AEB3CC; --ink-3: #7B82A3;
  --line: #2B3155; --blue: #8AA8FF; --blue-soft: #222B55; --seal: #FF5A5D; --seal-soft: #47202A; --green: #3DD68C; --green-soft: #173D33; --amber: #FFC14D;
}
.dark-zone { position: relative; margin: 72px -16px -40px; padding: 48px 16px 72px; background: var(--paper); color: var(--ink); }
@media (min-width: 760px) { .dark-zone { margin: 72px -28px -64px; padding: 56px 28px 96px; } }
.dark-zone::before {
  content: ''; position: absolute; left: 0; right: 0; top: -11px; height: 12px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='32' height='12' viewBox='0 0 32 12'%3E%3Cpath d='M0 6 Q8 0 16 6 T32 6 V12 H0Z' fill='%230D1020'/%3E%3C/svg%3E") repeat-x left bottom / 32px 12px;
}
.dark-intro { max-width: 520px; margin: 0 auto 28px; text-align: center; color: var(--ink-2); line-height: 1.8; }
.unit-secret { --u: #3A3F63; --ud: #262A47; }
.dark-zone.open .unit-secret { --u: #C8323A; --ud: #8E1F27; }
.unit-secret .unit-head { background: linear-gradient(135deg, var(--u), var(--ud)); }
.node.secret .q-face { font-size: 1.6rem; font-weight: 900; color: var(--ink-3); }
.dark-zone .node.locked { opacity: .55; }
.dark-zone:not(.open) .unit-progress { opacity: .3; }

.dark-session { background: var(--paper); color: var(--ink); }
.dark-session .story-stage { background: var(--paper); }
.dark-session .check-bar { background: var(--surface); border-top-color: var(--line); }
.dark-session .btn.primary:not(:disabled) { background: #3D63E6; box-shadow: 0 4px 0 #2A47B3; color: #fff; }

/* 介面導覽：聚光框＋說明泡泡 */
.tour { position: fixed; inset: 0; z-index: 90; }
.tour-hole { position: fixed; border-radius: 16px; box-shadow: 0 0 0 9999px rgba(10, 12, 24, .62); outline: 3px solid #fff; transition: left .3s, top .3s, width .3s, height .3s; pointer-events: none; }
.tour-tip { position: fixed; background: var(--surface); color: var(--ink); border-radius: 18px; padding: 16px 16px 12px; box-shadow: 0 12px 36px rgba(0, 0, 0, .28); transition: top .3s, left .3s; }
.tour-tip.turn { animation: fadeUp .25s ease-out; }
.tour-tip.wait { visibility: hidden; }
/* 第一次出現：聚光框和泡泡直接放到定位，不要從角落滑過來 */
.tour.init :is(.tour-hole, .tour-tip) { transition: none; }
.tour-tip h3 { font-size: 1.08rem; font-weight: 900; margin: 0 0 6px; }
.tour-tip p { margin: 0; color: var(--ink-2); line-height: 1.7; }
.tour-actions { display: flex; align-items: center; gap: 8px; margin-top: 12px; }
.tour-count { margin-right: auto; color: var(--ink-3); font-size: .85rem; font-variant-numeric: tabular-nums; }
@media (prefers-reduced-motion: reduce) { .tour-hole, .tour-tip { transition: none; } .tour-tip.turn { animation: none; } }

/* 查詢頁：常見問題／法條切換 */
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.page-head .page-title { margin-bottom: 0; }
.lookup-tabs { display: inline-flex; padding: 4px; border-radius: 14px; background: var(--surface-2); gap: 4px; }
.lookup-tabs a { display: inline-flex; align-items: center; gap: 6px; padding: 7px 14px; border-radius: 10px; font-weight: 800; color: var(--ink-2); text-decoration: none; }
.lookup-tabs a svg { width: 18px; height: 18px; }
.lookup-tabs a.on { background: var(--surface); color: var(--blue); box-shadow: 0 2px 0 var(--line); }
.faq-group { margin-top: 18px; }
.faq-group .chap { display: flex; align-items: center; gap: 8px; }
.faq-group .chap svg { width: 20px; height: 20px; color: var(--blue); }
.faq-item { border: 2px solid var(--line); border-radius: 16px; background: var(--surface); margin-top: 10px; overflow: hidden; }
.faq-item summary { list-style: none; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 16px; font-weight: 800; cursor: pointer; }
.faq-item summary::-webkit-details-marker { display: none; }
.faq-arrow { flex: none; width: 18px; height: 18px; color: var(--ink-3); transition: transform .2s; }
.faq-item[open] .faq-arrow { transform: rotate(90deg); }
.faq-body { padding: 0 16px 14px; }
.faq-a { margin: 0 0 8px; font-weight: 700; color: var(--ink); line-height: 1.7; }
.faq-body .plain { margin: 0 0 10px; }
.faq-refs { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 0; }
.faq-refs .chip { padding: 2px 10px; border-radius: 999px; background: var(--blue-soft); color: var(--blue); font-weight: 700; font-size: .85rem; text-decoration: none; }
.faq-src { font-size: .85rem; color: var(--ink-3); }

/* 我的：學習主題 */
.course-list { display: grid; gap: 10px; }
.course-card { display: flex; align-items: center; gap: 12px; width: 100%; padding: 14px; border: 2px solid var(--line); border-radius: 16px; background: var(--surface); color: inherit; font: inherit; text-align: left; cursor: pointer; }
.course-card.on { border-color: var(--blue); background: var(--blue-soft); cursor: default; }
.course-ic { flex: none; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; background: var(--surface-2); color: var(--blue); }
.course-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.course-body small { color: var(--ink-2); line-height: 1.5; }
.course-on { margin-left: auto; flex: none; font-size: .8rem; font-weight: 800; color: var(--blue); }

/* 四字印章：由右而左、由上而下讀（法力／滿點） */
.brand-seal, .splash-seal { display: grid; grid-template-rows: 1fr 1fr; grid-auto-flow: column; grid-auto-columns: 1fr; direction: rtl; place-items: center; padding: 7px; }
.splash-seal { padding: 18px; }

/* 錯誤回報 */
.fb-ref { display: flex; align-items: center; gap: 8px; }
.report-btn { display: inline-grid; place-items: center; width: 30px; height: 30px; margin-left: auto; border: 0; border-radius: 8px; background: transparent; color: inherit; opacity: .7; cursor: pointer; }
.report-btn:hover, .report-btn:focus-visible { opacity: 1; background: rgba(0, 0, 0, .06); }
.report-btn svg { width: 18px; height: 18px; }
.report h3 { display: flex; align-items: center; gap: 8px; }
.report h3 svg { width: 22px; height: 22px; color: var(--seal); }
.report-list { display: grid; gap: 8px; }
.report-opt { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 2px solid var(--line); border-radius: 12px; cursor: pointer; font-weight: 700; }
.report-opt:has(input:checked) { border-color: var(--blue); background: var(--blue-soft); }
.report-opt input { width: 18px; height: 18px; accent-color: var(--blue); }
.report-note { width: 100%; padding: 10px 12px; border: 2px solid var(--line); border-radius: 12px; background: var(--surface); color: var(--ink); font: inherit; resize: vertical; }

/* 我的：使用須知 */
.notice-card { padding: 16px; border-radius: 16px; background: color-mix(in srgb, var(--amber) 14%, var(--surface)); border: 2px solid color-mix(in srgb, var(--amber) 40%, var(--line)); }
.notice-head { display: flex; align-items: center; gap: 8px; margin: 0 0 8px; font-weight: 900; }
.notice-head svg { width: 20px; height: 20px; color: var(--seal); }
.notice-card ul { margin: 0; padding-left: 1.2em; display: grid; gap: 6px; color: var(--ink-2); line-height: 1.7; }
.notice-src { display: inline-block; margin-top: 10px; font-size: .9rem; font-weight: 700; color: var(--blue); }
.notice .settings { margin-top: 12px; }
.setting-btn { width: 100%; border: 0; background: transparent; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.setting-btn > svg { width: 20px; height: 20px; color: var(--ink-3); flex: none; }
.app-ver { margin-top: 24px; text-align: center; color: var(--ink-3); font-size: .85rem; }

/* ───── 反應符號：疊在角色前一層（設計圖與角色同為 120 × 142） ───── */
.emote { position: absolute; z-index: 2; pointer-events: none; animation: emote-pop .3s cubic-bezier(.3, 1.6, .5, 1) both; }
.emote svg { display: block; overflow: visible; }
.emote { top: 0; left: 0; width: 100%; aspect-ratio: 120 / 142; }
.emote svg { width: 100%; height: 100%; }
.em, .em-laugh .em-r, .em-laugh .em-l { transform-box: fill-box; transform-origin: center; }
/* 驚訝的爆炸框畫在角色後面 */
.char { isolation: isolate; }
.emote.behind { z-index: -1; }
/* 大笑：左右兩組線條輪流放大（兩格） */
.em-laugh .em-r { animation: em-two-frame .36s steps(1) infinite; }
.em-laugh .em-l { animation: em-two-frame .36s steps(1) infinite; animation-delay: -.18s; }
/* 問號：像在歪頭想，左右擺動 */
.em-question { transform-origin: 50% 100% !important; animation: em-sway 1.1s ease-in-out infinite; }
@keyframes em-sway { 0%, 100% { transform: rotate(-12deg); } 50% { transform: rotate(12deg); } }
/* 驚嘆號：跳出來，再上下彈兩下 */
.em-exclaim { transform-origin: 50% 100% !important; animation: em-spring .7s cubic-bezier(.3, 1.8, .5, 1) both, em-hop2 .5s ease-in-out .7s 2; }
@keyframes em-spring { 0% { transform: scale(.2, 1.6) translateY(10px); } 60% { transform: scale(1.1, .9); } 100% { transform: none; } }
@keyframes em-hop2 { 50% { transform: translateY(-4px); } }
/* 尷尬：汗滴慢慢往下滑 */
.em-awkward { animation: em-drip 1.6s ease-in infinite; }
@keyframes em-drip { 0% { transform: translateY(0); opacity: 1; } 75% { transform: translateY(6px); opacity: 1; } 100% { transform: translateY(9px); opacity: 0; } }
/* 困惑：一直轉 */
.em-confuse { animation: em-spin 1.4s linear infinite; }
/* 生氣：放大、縮小兩格來回 */
.em-angry { animation: em-two-frame .44s steps(1) infinite; }
/* 驚訝：爆炸框在角色後面，位置和設計圖一致，一抖一抖 */
.em-surprised { animation: em-burst .3s steps(1) infinite; }
@keyframes em-burst { 0% { transform: none; } 50% { transform: scale(1.1) rotate(4deg); } }
/* 難過：低落的線條慢慢往下垂 */
.em-sad { animation: em-gloom 1.4s ease-in-out infinite alternate; }
@keyframes em-gloom { from { transform: translateY(-2px) scaleY(.92); opacity: .75; } to { transform: translateY(2px) scaleY(1.04); opacity: 1; } }
/* 喜歡：愛心撲通撲通 */
.em-love { animation: em-beat .8s ease-in-out infinite; }
@keyframes em-beat { 0%, 40%, 100% { transform: scale(1); } 15% { transform: scale(1.2); } 28% { transform: scale(1.05); } 32% { transform: scale(1.14); } }
/* 想到：燈泡上下浮動、發光 */
.em-idea { animation: em-float .9s ease-in-out infinite alternate; filter: drop-shadow(0 0 3px rgba(255, 215, 36, .9)); }
@keyframes em-two-frame { 0% { transform: scale(1.16); } 50% { transform: scale(1); } }
@keyframes em-spin { to { transform: rotate(360deg); } }
@keyframes em-jitter { 0% { transform: scale(1) rotate(0); } 50% { transform: scale(1.1) rotate(5deg); } }
@keyframes em-float { from { transform: translateY(1px); } to { transform: translateY(-4px); } }
@keyframes emote-pop { from { opacity: 0; transform: scale(.6); } to { opacity: 1; transform: none; } }
@keyframes shake-angry { 0%, 100% { transform: translateX(0); } 20%, 60% { transform: translateX(-3px); } 40%, 80% { transform: translateX(3px); } }
@keyframes laugh-bounce { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-4px) rotate(-2deg); } }

/* 臉部：沿用原本的五官圖層組合出新表情 */
.char:is([data-mood="angry"], [data-mood="idea"], [data-mood="awkward"], [data-mood="confuse"], [data-mood="love"], [data-mood="laugh"], [data-mood="question"], [data-mood="exclaim"]) :is(.brows-normal, .m-idle) { opacity: 0; }
.char[data-mood="laugh"] .eyes-open { opacity: 0; }
.char[data-mood="laugh"] :is(.eyes-happy, .brows-up, .m-surprised) { opacity: 1; }
.char.has-surprised[data-mood="laugh"] .eyes-surprised { opacity: 0; }
.char[data-mood="laugh"] svg { animation: laugh-bounce .3s ease-in-out 5; }
.char[data-mood="laugh"] .c-hand { animation: cheer .3s ease-in-out infinite alternate; }
.char[data-mood="question"] :is(.brows-up, .m-think) { opacity: 1; }
.char[data-mood="question"] :is(.c-head, .c-head-back) { rotate: -6deg; }
.char[data-mood="question"] .c-hand-a { translate: -10px -32px; }
.char[data-mood="exclaim"] :is(.brows-up, .m-surprised) { opacity: 1; }
.char.has-surprised[data-mood="exclaim"] .eyes-open { opacity: 0; }
.char.has-surprised[data-mood="exclaim"] .eyes-surprised { opacity: 1; }
.char.react[data-mood="exclaim"] svg { animation: jolt .4s ease; }
.char[data-mood="love"] .eyes-open { opacity: 0; }
.char[data-mood="love"] :is(.eyes-happy, .brows-up, .m-happy) { opacity: 1; }
.char.react[data-mood="love"] svg { animation: hop .7s cubic-bezier(.3, 1.6, .5, 1); }
.char[data-mood="love"] .c-hand { translate: 0 -10px; }
.char[data-mood="confuse"] :is(.brows-sad, .m-think) { opacity: 1; }
.char[data-mood="confuse"] :is(.c-head, .c-head-back) { rotate: 7deg; }
.char[data-mood="confuse"] .c-hand-a { translate: -12px -30px; }
.char[data-mood="angry"] .m-sad { opacity: 1; }
/* 把「難過」的眉毛上下翻轉，就變成眉頭往下壓的生氣眉 */
.char[data-mood="angry"] .brows-sad { opacity: 1; transform-box: fill-box; transform-origin: center; scale: 1 -1; }
.char.react[data-mood="angry"] svg { animation: shake-angry .45s ease-in-out 2; }
.char[data-mood="angry"] .c-hand { translate: 0 2px; }
.char[data-mood="idea"] :is(.brows-up, .m-happy) { opacity: 1; }
.char.react[data-mood="idea"] svg { animation: jolt .45s ease; }
.char[data-mood="idea"] .c-hand-a { translate: -12px -30px; }
.char[data-mood="awkward"] :is(.brows-sad, .m-think) { opacity: 1; }
.char[data-mood="awkward"] :is(.c-head, .c-head-back) { rotate: -5deg; }
.char[data-mood="awkward"] .c-hand-a { translate: -16px -60px; }  /* 抓頭 */
@media (prefers-reduced-motion: reduce) {
  .emote, .emote svg, .em, .em-laugh g, .char[data-mood="laugh"] svg, .char.react[data-mood="angry"] svg { animation: none !important; }
}

/* 林警員開心時：推一下眼鏡（手移到鏡框中間往上推，鏡框跟著上移） */
.char-lin[data-mood="happy"] .c-hand { animation: none; }
.char-lin[data-mood="happy"] .c-hand-a { translate: none; animation: push-glasses 1.3s ease-in-out both; }
.char-lin[data-mood="happy"] .c-hand-b { translate: none; }
.char-lin[data-mood="happy"] .eyes-happy { animation: glasses-up 1.3s ease-in-out both; }
@keyframes push-glasses {
  0% { transform: none; }
  35% { transform: translate(26px, -50px); }
  50% { transform: translate(26px, -54px); }
  70% { transform: translate(26px, -53px); }
  100% { transform: none; }
}
@keyframes glasses-up { 0%, 38% { transform: none; } 50%, 72% { transform: translateY(-3px); } 100% { transform: none; } }
@media (prefers-reduced-motion: reduce) { .char-lin[data-mood="happy"] :is(.c-hand-a, .eyes-happy) { animation: none; } }
/* 推眼鏡時手和臉同色，加一圈膚色深一點的外框才看得出來 */
.char-lin[data-mood="happy"] .c-hand-a circle { stroke: #DDAA87; stroke-width: 2.6; }

/* App 圖示當 logo（側欄、頂部、載入畫面） */
.app-logo { display: block; flex: none; width: 44px; height: 44px; }

/* 自動捲到新單元時，標題不要被頂部列擋住 */
.unit { scroll-margin-top: 84px; }

/* 練習完的重點回顧 */
.reveal { display: flex; flex-direction: column; gap: 16px; }
.recap-head { display: flex; align-items: center; gap: 12px; }
.recap-kicker { margin: 0; font-weight: 800; color: var(--blue); }
.recap-head h2 { margin: 2px 0 0; font-size: 1.35rem; font-weight: 900; }
.recap-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.recap-card { background: var(--surface); border-radius: 18px; padding: 16px; display: flex; flex-direction: column; gap: 10px; box-shadow: 0 2px 0 var(--line); }
.recap-title { display: flex; align-items: center; gap: 12px; }
.recap-title h3 { margin: 0; font-size: 1.12rem; font-weight: 900; }
.recap-title .law-chapter { margin: 0 0 2px; font-size: .8rem; }
.recap-one { margin: 0; line-height: 1.7; color: var(--ink); }
.recap-card .orig summary { font-size: .9rem; }
.seal.sm { --sz: 46px; flex: none; }

/* 吉祥物熊順出現的地方 */
.path-end-art { display: flex; align-items: flex-end; justify-content: center; gap: 8px; }
.review-hero { position: relative; }
.review-bear { position: absolute; right: 12px; top: -26px; pointer-events: none; }
.faq-bear .bubble p { margin: 2px 0 0; }
/* 我的：學習主題、使用須知區塊內部的間距 */
.course-sec, .notice { display: flex; flex-direction: column; gap: 10px; }
.course-sec .sec-title, .notice .sec-title { margin-bottom: 2px; }
.course-sec > .muted { margin: 2px 4px 0; font-size: .88rem; }
.notice .settings { margin-top: 2px; }

/* 情境開場：像章節前言，逐項淡入 */
.scene-intro { min-height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 12px; padding: 24px 8px 12px; }
.scene-intro > *, .si-cast .char { animation: si-in .55s cubic-bezier(.2, .9, .3, 1) both; animation-delay: var(--d, 0s); }
.si-kicker { margin: 0; font-size: .85rem; font-weight: 900; letter-spacing: .12em; color: var(--blue); }
.si-icon { display: grid; place-items: center; width: 76px; height: 76px; border-radius: 24px; background: var(--blue-soft); color: var(--blue); animation-name: si-pop !important; }
.si-icon svg { width: 38px; height: 38px; }
.si-title { margin: 4px 0 0; font-size: 1.6rem; font-weight: 900; line-height: 1.3; }
.si-desc { margin: 0; max-width: 30em; color: var(--ink-2); line-height: 1.75; font-size: 1.05rem; }
.si-cast { display: flex; justify-content: center; flex-wrap: wrap; gap: 6px 14px; margin-top: 10px; }
.si-meta { margin: 4px 0 0; font-size: .88rem; color: var(--ink-3); }
.si-news { display: flex; align-items: flex-start; gap: 8px; max-width: 30em; margin: 6px 0 0; padding: 10px 14px; border-radius: 14px; background: color-mix(in srgb, var(--amber) 16%, var(--surface)); text-align: left; font-weight: 700; font-size: .92rem; line-height: 1.55; }
.si-news svg { flex: none; width: 18px; height: 18px; margin-top: 2px; color: #C47A00; }
.si-news small { display: block; font-weight: 400; color: var(--ink-3); }
@keyframes si-in { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes si-pop { 0% { opacity: 0; transform: scale(.4) rotate(-12deg); } 70% { opacity: 1; transform: scale(1.08) rotate(3deg); } 100% { opacity: 1; transform: none; } }
/* 每一幕換場時淡入 */
.scene-step { animation: si-in .4s ease both; }
@media (prefers-reduced-motion: reduce) { .scene-intro > *, .si-cast .char, .scene-step { animation: none !important; } }

/* ───── 啟動畫面：熊順補滿法力 ───── */
.sp-stage { position: relative; width: 200px; height: 200px; display: grid; place-items: end center; margin-bottom: 10px; }
.sp-tile { position: absolute; inset: 0; animation: sp-tile-in .5s cubic-bezier(.2, 1.4, .4, 1) both; }
.sp-bear { margin-bottom: 4px; }
.sp-spark { position: absolute; left: calc(50% + var(--x)); bottom: 40px; font-style: normal; color: var(--amber); font-size: 1rem; opacity: 0; animation: sp-spark 2.2s ease-out var(--d) infinite; }
.sp-bear { position: relative; display: block; overflow: visible; animation: sp-enter .7s cubic-bezier(.2, 1.5, .4, 1) .1s both; }
.sp-bear > g, .sp-bear > circle, .sp-head > g, .sp-head > path { transform-box: fill-box; }
.sp-head { transform-origin: 50% 100%; animation: sp-bob 2.4s ease-in-out .8s infinite; }
.sp-body { transform-origin: 50% 100%; animation: sp-breathe 2.4s ease-in-out .8s infinite; }
.sp-hand-l { transform-origin: 50% 50%; animation: sp-wave 1.2s ease-in-out .9s 2; }
.sp-eyes { transform-origin: 50% 50%; animation: sp-blink 3.2s ease-in-out 1.4s infinite; }
.sp-eyes-happy, .sp-mouth-open { opacity: 0; }
.sp-mana { width: min(220px, 70vw); margin-top: 14px; animation: fadeUp .5s ease .75s both; }
.sp-mana-label { display: flex; justify-content: space-between; align-items: baseline; font-size: .82rem; margin-bottom: 6px; }
.sp-mana-label b { font-weight: 800; opacity: .9; }
.sp-mana-label em { font-style: normal; font-weight: 900; color: var(--amber); opacity: 0; transform: scale(.4); transition: opacity .25s, transform .4s cubic-bezier(.2, 1.8, .4, 1); }
.sp-mana-bar { height: 12px; border-radius: 999px; background: rgba(255, 255, 255, .18); box-shadow: inset 0 2px 0 rgba(0, 0, 0, .12); overflow: hidden; }
.sp-mana-bar i {
  display: block; height: 100%; border-radius: inherit; transform-origin: left center; transform: scaleX(.86);
  background: linear-gradient(90deg, #FFC94D, var(--amber)) , var(--amber);
  box-shadow: inset 0 -3px 0 rgba(0, 0, 0, .12), inset 0 3px 0 rgba(255, 255, 255, .35);
  animation: sp-fill 2s cubic-bezier(.3, .7, .3, 1) .8s both; transition: transform .45s cubic-bezier(.3, 1.4, .5, 1);
}
/* 載入完成：補滿、熊順開心 */
.splash.full .sp-mana-bar i { animation: none; transform: scaleX(1); }
.splash.full .sp-mana-label em { opacity: 1; transform: none; }
.splash.full .sp-eyes, .splash.full .sp-mouth { opacity: 0; }
.splash.full .sp-eyes-happy, .splash.full .sp-mouth-open { opacity: 1; }
.splash.full .sp-brows { transform: translateY(-6px); transition: transform .25s; }
.splash.full .sp-bear { animation: sp-hop .55s cubic-bezier(.3, 1.6, .5, 1) both; }
.splash.full :is(.sp-hand-l, .sp-hand-r) { animation: none; transition: transform .3s cubic-bezier(.3, 1.6, .5, 1); }
.splash.full .sp-hand-l { transform: translate(14px, -38px); }
.splash.full .sp-hand-r { transform: translate(-14px, -38px); }
.splash.full .sp-tile { animation: sp-tile-pop .5s cubic-bezier(.3, 1.6, .5, 1) both; }
@keyframes sp-enter { from { opacity: 0; transform: translateY(60px) scale(.7); } to { opacity: 1; transform: none; } }
@keyframes sp-bob { 0%, 100% { transform: none; } 50% { transform: translateY(-2px) rotate(-2deg); } }
@keyframes sp-breathe { 0%, 100% { transform: none; } 50% { transform: scaleY(1.03); } }
@keyframes sp-wave { 0%, 100% { transform: none; } 30% { transform: translate(6px, -30px); } 55% { transform: translate(10px, -24px); } 75% { transform: translate(6px, -30px); } }
@keyframes sp-blink { 0%, 92%, 100% { transform: none; } 95% { transform: scaleY(.1); } }
@keyframes sp-spark { 0% { opacity: 0; transform: translateY(0) scale(.6); } 25% { opacity: 1; } 100% { opacity: 0; transform: translateY(-120px) scale(1.1); } }
@keyframes sp-tile-pop { 50% { transform: scale(1.06); } }
@keyframes sp-tile-in { from { opacity: 0; transform: scale(.6); } }
@keyframes sp-fill { from { transform: scaleX(.04); } to { transform: scaleX(.86); } }
@keyframes sp-hop { 0%, 100% { transform: none; } 45% { transform: translateY(-16px); } }
@media (prefers-reduced-motion: reduce) {
  .sp-tile, .sp-spark, .sp-bear, .sp-head, .sp-body, .sp-hand-l, .sp-eyes, .sp-mana, .sp-mana-bar i, .splash.full .sp-bear { animation: none !important; }
  .sp-spark { display: none; }
}
.sp-mana + .splash-tip { margin-top: 10px; }

/* iOS 連續曲線圓角的白底區塊：給角色一個乾淨的舞台（不用發光、陰影） */
:root { --squircle: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'%3E%3Cpath d='M100.0 50.0L100.0 65.4L99.9 70.3L99.8 73.8L99.6 76.7L99.3 79.1L99.0 81.3L98.6 83.2L98.2 84.9L97.7 86.5L97.2 87.9L96.6 89.2L95.9 90.4L95.2 91.5L94.4 92.6L93.5 93.5L92.6 94.4L91.5 95.2L90.4 95.9L89.2 96.6L87.9 97.2L86.5 97.7L84.9 98.2L83.2 98.6L81.3 99.0L79.1 99.3L76.7 99.6L73.8 99.8L70.3 99.9L65.4 100.0L50.0 100.0L34.6 100.0L29.7 99.9L26.2 99.8L23.3 99.6L20.9 99.3L18.7 99.0L16.8 98.6L15.1 98.2L13.5 97.7L12.1 97.2L10.8 96.6L9.6 95.9L8.5 95.2L7.4 94.4L6.5 93.5L5.6 92.6L4.8 91.5L4.1 90.4L3.4 89.2L2.8 87.9L2.3 86.5L1.8 84.9L1.4 83.2L1.0 81.3L0.7 79.1L0.4 76.7L0.2 73.8L0.1 70.3L0.0 65.4L0.0 50.0L0.0 34.6L0.1 29.7L0.2 26.2L0.4 23.3L0.7 20.9L1.0 18.7L1.4 16.8L1.8 15.1L2.3 13.5L2.8 12.1L3.4 10.8L4.1 9.6L4.8 8.5L5.6 7.4L6.5 6.5L7.4 5.6L8.5 4.8L9.6 4.1L10.8 3.4L12.1 2.8L13.5 2.3L15.1 1.8L16.8 1.4L18.7 1.0L20.9 0.7L23.3 0.4L26.2 0.2L29.7 0.1L34.6 0.0L50.0 0.0L65.4 0.0L70.3 0.1L73.8 0.2L76.7 0.4L79.1 0.7L81.3 1.0L83.2 1.4L84.9 1.8L86.5 2.3L87.9 2.8L89.2 3.4L90.4 4.1L91.5 4.8L92.6 5.6L93.5 6.5L94.4 7.4L95.2 8.5L95.9 9.6L96.6 10.8L97.2 12.1L97.7 13.5L98.2 15.1L98.6 16.8L99.0 18.7L99.3 20.9L99.6 23.3L99.8 26.2L99.9 29.7L100.0 34.6Z'/%3E%3C/svg%3E"); }
.sq-tile { background: #fff; -webkit-mask: var(--squircle) center / 100% 100% no-repeat; mask: var(--squircle) center / 100% 100% no-repeat; }
.dark-zone .path-host { isolation: isolate; padding: 12px 14px 6px; }
.dark-zone .path-host::before { content: ''; position: absolute; inset: 0; z-index: -1; background: #fff; -webkit-mask: var(--squircle) center / 100% 100% no-repeat; mask: var(--squircle) center / 100% 100% no-repeat; }
@media (max-width: 420px) {
  .dark-zone .path-host { padding: 8px 10px 4px; transform: translate(calc(-50% + var(--side) * (var(--amp) + 52px)), -50%); }
  .dark-zone .path-host .char { --size: 78px !important; }
}

/* 連結：底線離字遠一點、細一點、淡一點，滑過去才變實 */
a { text-underline-offset: .3em; text-decoration-thickness: 1.5px; text-decoration-color: color-mix(in srgb, currentColor 40%, transparent); transition: text-decoration-color .15s; }
a:hover { text-decoration-color: currentColor; }
/* 回報表單：給機器人填的隱藏欄位、個資提醒 */
.report .hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.report-hint { margin: -2px 0 0; font-size: .8rem; color: var(--ink-3); }
/* 手機：關掉雙擊放大（雙指縮放保留給需要放大字的人），也不要自動放大字級 */
html { touch-action: manipulation; -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
