﻿* { box-sizing: border-box; }
/* 色票：卡片、按鈕的顏色都從這裡取，改顏色只改這裡。
   卡片與按鈕不畫外框，用底下一條深一點的「厚度」＋淡淡的影子做出立體感。 */
:root {
  --card-face: #ffffff;
  --card-ledge: #f0dfc6;
  --card-shadow: 0 3px 0 var(--card-ledge), 0 8px 18px rgba(150, 100, 40, 0.10);
  --btn-glow: rgba(140, 90, 30, 0.12);
  --hairline: #f3e8d8;
  --focus-ring: #6cb6e8;
  --tone-warm-face: #fff6ea;  --tone-warm-ledge: #ecd2aa;  --tone-warm-ink: #8a5a2b;
  --tone-coral-face: #ffe6da; --tone-coral-ledge: #f0a081; --tone-coral-ink: #bf4d27;
  --tone-green-face: #e2f5e6; --tone-green-ledge: #8fcf9f; --tone-green-ink: #2b7d45;
  --tone-sky-face: #e2f2fb;   --tone-sky-ledge: #8ec6e6;   --tone-sky-ink: #2a739c;
  --tone-sky-on-face: #b9e1f6;
  --tone-active-face: #ffc163; --tone-active-ledge: #e48f2a; --tone-active-ink: #6e3a06;
  --switch-off: #ddd2c4;
  --switch-on: #4fbf6e;
}
body {
  margin: 0;
  font-family: "Microsoft JhengHei", "PingFang TC", "Noto Sans TC", sans-serif;
  background: linear-gradient(180deg, #fff6e6, #eaf7ff);
  color: #3a3a3a;
  min-height: 100vh;
}

.app-header { text-align: center; padding: 18px 12px 6px; }
.app-header h1 { margin: 0; font-size: 1.8rem; color: #e2704a; }
.voice-status { font-size: 0.8rem; color: #777; margin: 6px 0 0; }
.voice-status.voice-warn { color: #c0392b; font-weight: bold; }
.audio-hint { max-width: 560px; margin-left: auto; margin-right: auto; color: #2e7d4a; }

.category-tabs, .mode-tabs {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; padding: 8px 12px;
}
.category-tab, .mode-tab {
  font-size: 1rem; padding: 10px 18px; border-radius: 999px; border: 2px solid #ffd27d;
  background: #fff; cursor: pointer; font-weight: bold;
}
.category-tab.active, .mode-tab.active { background: #ffb95a; color: #fff; border-color: #ffb95a; }

.view { padding: 10px 16px 24px; max-width: 920px; margin: 0 auto; }
.view.hidden { display: none; }

.symbol-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); gap: 14px;
}
.symbol-card {
  background: var(--card-face); border-radius: 18px; box-shadow: var(--card-shadow); padding: 10px;
  text-align: center; cursor: pointer; position: relative; transition: transform .15s;
}
.symbol-card:hover { transform: translateY(-3px); }
.symbol-card .mascot-svg { width: 64px; height: 60px; }
.mascot-visual { display: inline-block; }
.mascot-photo { object-fit: contain; border-radius: 14px; }
.mascot-fallback-hidden { display: none; }
.glyph-svg { display: block; margin: 0 auto; }
.symbol-card .card-zhuyin .glyph-svg { width: 42px; height: 38px; }
.symbol-card .card-name { font-size: 0.8rem; color: #777; }
.symbol-card .sticker-check {
  position: absolute; top: 4px; right: 8px; font-size: 1.1rem; display: none;
}
.symbol-card.unlocked .sticker-check { display: block; }
/* 練習頁分區標題（聲母／介音／韻母），橫跨整列 */
.grid-section-title { grid-column: 1 / -1; margin: 10px 0 0; font-size: 1.1rem; color: #e2704a; }
.grid-section-title:first-child { margin-top: 0; }
/* 介音、韻母沒有吉祥物：符號放大，卡片高度跟有吉祥物的卡片差不多 */
.symbol-card.no-mascot { display: flex; flex-direction: column; justify-content: center; }
.symbol-card.no-mascot .card-zhuyin .glyph-svg { width: 72px; height: 65px; }
.mascot-display.hidden, #btn-speak-name.hidden { display: none; }
/* 代表字拼法：例如 水＝ㄕㄨㄟ，目標符號是主色、其他灰色 */
.card-spell, .detail-spell { display: flex; align-items: center; justify-content: center; gap: 1px; }
.card-spell { margin-top: 2px; font-size: 0.75rem; color: #999; }
.card-spell .glyph-svg { width: 15px; height: 14px; margin: 0; }
.detail-spell { justify-content: flex-start; margin-bottom: 8px; font-size: 1.3rem; color: #555; }
.detail-spell .glyph-svg { width: 34px; height: 31px; margin: 0; }
.spell-eq { margin: 0 2px; color: #bbb; }

/* 練習詳情：蓋在符號列表上面的視窗（手機是整個畫面，電腦是置中的大卡片）。
   關掉後列表還停在原本捲到的位置，不會像以前一樣被帶到頁面最底下。 */
.detail-backdrop { position: fixed; inset: 0; z-index: 40; background: rgba(70, 45, 20, 0.35); }
.detail-backdrop.hidden { display: none; }
.detail-panel {
  position: fixed; inset: 0; z-index: 50; background: #fff;
  overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch;
  padding: 0 max(16px, env(safe-area-inset-right, 0px)) max(24px, env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px));
}
.detail-panel.hidden { display: none; }
@media (min-width: 768px) {
  .detail-panel {
    inset: 4vh auto auto 50%; transform: translateX(-50%); width: min(760px, 92vw); max-height: 92vh;
    border-radius: 22px; box-shadow: 0 20px 50px rgba(90, 50, 10, 0.25);
  }
}
body.detail-open { overflow: hidden; }
.detail-nav {
  position: sticky; top: 0; z-index: 2; display: flex; gap: 8px; background: #fff;
  padding: max(10px, env(safe-area-inset-top, 0px)) 0 10px; margin-bottom: 10px; border-bottom: 2px solid #fff0d6;
}
.detail-nav-btn {
  flex: 1; font-size: 1rem; font-weight: bold; padding: 10px 6px; border-radius: 14px; cursor: pointer;
  border: 2px solid #ffd27d; background: #fff8ec; color: #8a5a2b;
}
.detail-nav-btn:disabled { opacity: 0.35; cursor: default; }
.detail-nav-close { background: #e2704a; border-color: #e2704a; color: #fff; }
.btn-close { position: absolute; top: 12px; right: 14px; border: none; background: none; font-size: 1rem; cursor: pointer; color: #999; }

.detail-top { display: flex; gap: 20px; flex-wrap: wrap; align-items: center; }
.mascot-display .mascot-svg { width: 140px; height: 130px; }
.big-symbol .glyph-svg { width: 80px; height: 72px; }
.mascot-name { font-size: 1.2rem; margin-bottom: 8px; }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 8px; }

.btn-primary, .btn-secondary {
  font-size: 1rem; padding: 10px 16px; border-radius: 14px; border: none; cursor: pointer; font-weight: bold;
}
.btn-primary { background: #e2704a; color: #fff; }
.btn-secondary { background: #ffe3b0; color: #7a4a1a; }

.stroke-section, .trace-section { margin-top: 20px; }
.stroke-box { width: min(45vw, 170px); margin: 8px 0; }
.stroke-svg { width: 100%; }

.trace-wrap { position: relative; width: min(92vw, 320px); aspect-ratio: 10 / 9; margin: 8px 0; }
.trace-guide, .trace-canvas { position: absolute; top: 0; left: 0; width: 100%; height: 100%; border-radius: 12px; }
.trace-guide { background: #fafafa; border: 2px dashed #ddd; }
.trace-canvas { touch-action: none; }
.trace-feedback { font-weight: bold; min-height: 1.4em; }
.trace-feedback.good { color: #2e9e4a; }
.trace-feedback.retry { color: #d98a3d; }

.quiz-prompt { font-size: 1.1rem; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.quiz-symbol { display: inline-flex; }
.quiz-symbol .glyph-svg { width: 36px; height: 32px; }
.quiz-choices { display: flex; gap: 10px; flex-wrap: wrap; margin: 10px 0; }
.quiz-choice-btn {
  font-size: 1.5rem; padding: 14px 22px; border-radius: 16px; border: none; background: var(--card-face);
  box-shadow: var(--card-shadow); cursor: pointer;
}
.quiz-choice-symbol .glyph-svg { width: 44px; height: 40px; }
.quiz-choice-mascot { display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: 0.9rem; }
.quiz-choice-mascot .mascot-svg { width: 60px; height: 56px; }
.quiz-feedback { font-weight: bold; min-height: 1.4em; }
.quiz-feedback.quiz-good { color: #2e9e4a; }
.quiz-feedback.quiz-retry { color: #d98a3d; }
.quiz-done { text-align: center; padding: 20px; }
.quiz-done-emoji { font-size: 3rem; }

.app-footer { text-align: center; padding: 16px; font-size: 0.85rem; color: #777; }
.link-btn { border: none; background: none; color: #e2704a; text-decoration: underline; cursor: pointer; font-size: 0.85rem; }
#btn-parent-entry { -webkit-touch-callout: none; -webkit-user-select: none; user-select: none; touch-action: none; }
.link-btn.tap-again { color: var(--tone-coral-ink); font-weight: bold; text-decoration: none; background: var(--tone-coral-face); border-radius: 8px; padding: 2px 8px; }
.small-note { font-size: 0.72rem; color: #999; max-width: 720px; margin: 6px auto 0; }

.btn-primary, .btn-secondary, .category-tab, .mode-tab, .quiz-choice-btn {
  min-height: 44px; /* 手機/平板觸控建議的最小點擊範圍 */
}

.streak-badge { font-size: 0.85rem; color: #d98a3d; font-weight: bold; margin: 4px 0 0; }

/* 貼紙本 */
.stickerbook-banner {
  text-align: center; background: #fff1d6; border-radius: 14px;
  padding: 10px; margin-bottom: 14px; font-weight: bold; color: #c0701a;
}
.stickerbook-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(90px, 1fr)); gap: 12px;
}
.sticker-slot {
  background: var(--card-face); border-radius: 16px; box-shadow: var(--card-shadow); padding: 8px; text-align: center;
}
.sticker-slot .mascot-svg { width: 56px; height: 52px; }
.sticker-slot span { display: block; font-size: 0.75rem; color: #777; margin-top: 2px; }
.sticker-slot.locked { opacity: 0.6; background: #f4efe8; box-shadow: none; }
.sticker-placeholder { font-size: 1.8rem; color: #bbb; }

/* 家長頁 */
.parent-panel {
  position: fixed; inset: 0; background: rgba(0,0,0,0.45); display: flex;
  align-items: center; justify-content: center; padding: 16px; z-index: 50;
}
.parent-panel.hidden { display: none; }
.parent-panel-inner {
  background: #fff; border-radius: 20px; padding: 20px; max-width: 480px; width: 100%;
  max-height: 85vh; overflow-y: auto; position: relative;
}
.parent-panel-inner h2 { margin-top: 0; color: #e2704a; }
.parent-panel-inner section { margin-top: 16px; }
.parent-panel-inner h3 { font-size: 0.95rem; margin: 0 0 6px; color: #555; }
#parent-heatmap {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(36px, 1fr)); gap: 4px;
}
.heat-cell { border-radius: 8px; padding: 4px; }
.heat-cell .glyph-svg { width: 20px; height: 18px; display: block; margin: 0 auto; }
.top-wrong-row { display: flex; align-items: center; gap: 8px; font-size: 0.85rem; margin: 4px 0; }
.top-wrong-glyph .glyph-svg { width: 22px; height: 20px; }
.file-label { display: inline-block; }
#parent-daily-limit { width: 70px; font-size: 1rem; padding: 4px 6px; border-radius: 8px; border: 2px solid var(--card-ledge); }

/* 每日時間上限提示 */
.daily-limit-overlay {
  position: fixed; inset: 0; background: rgba(40,30,20,0.85); display: flex;
  align-items: center; justify-content: center; z-index: 60; text-align: center; color: #fff;
}
.daily-limit-overlay.hidden { display: none; }
.daily-limit-card { padding: 20px; }
.daily-limit-card p { font-size: 1.3rem; margin-bottom: 16px; }

/* 拼讀（注音組合） */
.syllable-intro { text-align: center; color: #777; }
.syllable-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(80px, 1fr)); gap: 10px; }
.syllable-pick-btn { background: var(--card-face); border: none; box-shadow: var(--card-shadow); border-radius: 14px; padding: 8px; cursor: pointer; text-align: center; }
.syllable-pick-glyph { display: flex; justify-content: center; gap: 2px; }
.syllable-pick-glyph .glyph-svg { width: 28px; height: 26px; }
.syllable-pick-word { display: block; font-size: 0.85rem; color: #777; margin-top: 4px; }
.syllable-contrast-tip {
  background: #fff1d6; border-radius: 12px; padding: 8px;
  font-size: 0.85rem; color: #c0701a; text-align: center; margin: 10px 0;
}

.blend-stage {
  position: relative; width: min(80vw, 280px); aspect-ratio: 1 / 1; margin: 16px auto;
  background: var(--card-face); border-radius: 20px; box-shadow: var(--card-shadow);
}
.blend-glyph {
  position: absolute; top: 10%; height: 80%;
  transition: transform .4s cubic-bezier(.6,0,.9,.3), opacity .3s;
}
.blend-glyph .glyph-svg, .blend-merged .glyph-svg { width: 100%; height: 100%; }
.blend-glyph.hidden { opacity: 0; pointer-events: none; }
.blend-glyph.bounce { animation: blend-bounce .3s ease; }
@keyframes blend-bounce { 0% { transform: translateY(0); } 50% { transform: translateY(-10px); } 100% { transform: translateY(0); } }
.blend-glyph.converge { transform: scale(0.8); opacity: 0.3; }
.blend-merged {
  position: absolute; top: 10%; left: 50%; width: 90%; height: 80%;
  transform: translateX(-50%) scale(0.9); opacity: 0;
  transition: opacity .3s, transform .3s cubic-bezier(.34,1.56,.64,1);
}
.blend-merged.show { opacity: 1; transform: translateX(-50%) scale(1.05); }
.blend-example { text-align: center; margin-top: 14px; }
.blend-example.hidden { display: none; }
.blend-example-word { font-size: 2.2rem; font-weight: bold; color: #e2704a; }
.blend-example-pinyin { font-size: 1rem; color: #888; }
.blend-controls { text-align: center; margin-top: 14px; display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }

/* 圖案按鈕（data-icon，見 js/ui-icons.js）：上面大圖案、下面一行小字，小朋友看圖就懂。
   像一顆實體按鍵：淡色底＋底下一條深一點的「厚度」，沒有外框；按下去整顆往下壓。
   圖案是去背的透明圖（tools/order_images.py 的 cutout），放在任何底色上都不會有白方框。
   底色由 data.js 的 UI_ICONS[].tone 決定，對應上面 :root 的 --tone-* 色票。 */
.icon-btn {
  --face: var(--tone-warm-face); --ledge: var(--tone-warm-ledge); --btn-ink: var(--tone-warm-ink);
  position: relative;
  display: inline-flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  background: var(--face); color: var(--btn-ink); border: none; border-radius: 20px;
  box-shadow: 0 4px 0 var(--ledge), 0 8px 16px var(--btn-glow);
  padding: 8px 12px 6px; margin-bottom: 4px; min-width: 84px; font-weight: bold; cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: transform .12s ease, box-shadow .12s ease, background-color .2s ease;
}
button.icon-btn[data-tone="coral"] { --face: var(--tone-coral-face); --ledge: var(--tone-coral-ledge); --btn-ink: var(--tone-coral-ink); }
button.icon-btn[data-tone="green"] { --face: var(--tone-green-face); --ledge: var(--tone-green-ledge); --btn-ink: var(--tone-green-ink); }
button.icon-btn[data-tone="sky"]   { --face: var(--tone-sky-face);   --ledge: var(--tone-sky-ledge);   --btn-ink: var(--tone-sky-ink); }
/* 選中的分類／模式、打開的「輪流播」：整顆換成飽和的顏色 */
button.icon-btn[data-tone].active {
  --face: var(--tone-active-face); --ledge: var(--tone-active-ledge); --btn-ink: var(--tone-active-ink);
  background: var(--face); color: var(--btn-ink);   /* 蓋過舊的 .category-tab.active 整顆塗橘 */
}
button.icon-btn[data-tone].is-on { --face: var(--tone-sky-on-face); --ledge: var(--tone-sky-ledge); }
button.icon-btn[data-tone]:active:not(:disabled) {
  transform: translateY(3px); box-shadow: 0 1px 0 var(--ledge), 0 3px 8px var(--btn-glow);
}
button.icon-btn[data-tone]:disabled { opacity: 0.35; cursor: default; }
button.icon-btn[data-tone]:focus-visible { outline: 3px solid var(--focus-ring); outline-offset: 3px; }
.icon-pic {
  display: flex; align-items: center; justify-content: center; width: 56px; height: 56px;
  transition: transform .2s cubic-bezier(.34, 1.56, .64, 1);
}
.icon-pic img { width: 100%; height: 100%; object-fit: contain; pointer-events: none; filter: drop-shadow(0 2px 2px rgba(90, 50, 10, 0.18)); }
.icon-emoji { font-size: 2.2rem; line-height: 1; }
.icon-label { font-size: 0.8rem; line-height: 1.2; }
.category-tab.icon-btn, .mode-tab.icon-btn { min-width: 92px; padding: 6px 10px 5px; }
.category-tab.icon-btn .icon-pic, .mode-tab.icon-btn .icon-pic { width: 44px; height: 44px; }
.category-tab.icon-btn .icon-label, .mode-tab.icon-btn .icon-label { font-size: 0.9rem; }
.detail-nav .icon-btn { padding: 5px 6px 4px; min-width: 0; }
.detail-nav .icon-pic { width: 38px; height: 38px; }
.detail-nav .icon-emoji { font-size: 1.6rem; }

/* ===== 按鈕小動畫（開關：data.js 的 UI_MOTION；觸發的程式在 js/ui-icons.js、app.js）=====
   平常完全不動，只在「有事發生」的時候動一下：按下去、選中、正在出聲、寫完提醒、輪流播中。
   只動圖案和按鈕外圍的波紋，按鈕本身大小不變，排版不會跳。 */
@keyframes icon-pop {         /* 剛選中的分類／模式：圖案從小彈出來一次 */
  0% { transform: scale(0.8); }
  60% { transform: scale(1.1); }
  100% { transform: scale(1); }
}
@keyframes icon-boing {       /* 按下去：輕輕壓扁再彈回 */
  0% { transform: scale(1); }
  35% { transform: scale(1.1, 0.9); }
  70% { transform: scale(0.96, 1.04); }
  100% { transform: scale(1); }
}
@keyframes icon-pulse {       /* 正在出聲：圖案慢慢放大縮小，像在呼吸 */
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.08); }
}
@keyframes btn-ripple {       /* 外圍一圈波紋往外散開（出聲中、寫完提醒按「我寫完了」） */
  0% { opacity: 0.7; transform: scale(1); }
  100% { opacity: 0; transform: scale(1.14, 1.24); }
}
@keyframes icon-spin { to { transform: rotate(360deg); } }   /* 輪流播中：箭頭慢慢轉圈 */
button.icon-btn[data-tone]::after {
  content: ''; position: absolute; inset: 0; border-radius: inherit;
  border: 3px solid var(--ledge); opacity: 0; pointer-events: none;
}
@media (hover: hover) {
  button.icon-btn[data-tone]:not(:disabled):hover .icon-pic { transform: translateY(-2px) scale(1.05); }
}
button.icon-btn[data-tone].active .icon-pic { animation: icon-pop .45s cubic-bezier(.34, 1.56, .64, 1); }
button.icon-btn[data-tone].is-on .icon-pic { animation: icon-spin 3s linear infinite; }
.icon-btn.boing .icon-pic { animation: icon-boing .42s ease-out; }
body.audio-playing .icon-btn.sounding .icon-pic,
body.audio-sequence .icon-btn.sounding .icon-pic { animation: icon-pulse .8s ease-in-out infinite; }
body.audio-playing .icon-btn.sounding::after,
body.audio-sequence .icon-btn.sounding::after,
.trace-section.has-ink .icon-btn[data-icon="done"]::after { animation: btn-ripple 1.3s ease-out infinite; }
body.no-motion .icon-btn .icon-pic, body.no-motion .icon-btn::after { animation: none !important; transition: none; }
@media (prefers-reduced-motion: reduce) {
  .icon-btn .icon-pic, .icon-btn::after { animation: none !important; transition: none; }
}

/* 唸到誰誰就動：連續唸「ㄇㄇㄇ 貓咪」時，唸注音那一下大字彈一下、唸名字那一下角色跳一下，
   小朋友看得出「現在唸的是這個」。播到哪一段由 speech.js 的 playSequence 標在 body 的 data-speaking。 */
@keyframes speak-pop {
  0% { transform: scale(1); }
  30% { transform: scale(1.18); }
  60% { transform: scale(0.96); }
  100% { transform: scale(1); }
}
@keyframes speak-hop {
  0% { transform: translateY(0) scale(1); }
  25% { transform: translateY(-14px) scale(1.03, 0.97); }
  50% { transform: translateY(0) scale(1.06, 0.94); }
  70% { transform: translateY(-5px) scale(1); }
  100% { transform: translateY(0) scale(1); }
}
#big-symbol .glyph-svg, #mascot-display .mascot-svg { transform-origin: 50% 85%; }
body[data-speaking="symbol"] #big-symbol .glyph-svg { animation: speak-pop .5s ease-out; }
body[data-speaking="name"] #mascot-display .mascot-svg { animation: speak-hop .6s ease-out; }
body.no-motion #big-symbol .glyph-svg, body.no-motion #mascot-display .mascot-svg { animation: none !important; }
@media (prefers-reduced-motion: reduce) {
  #big-symbol .glyph-svg, #mascot-display .mascot-svg { animation: none !important; }
}

/* 播放設定視窗（內容由 js/playback.js 照 data.js 的 PLAYBACK_SETTINGS 自動畫） */
.playback-panel { z-index: 70; }
.playback-preview {
  background: var(--tone-warm-face); color: var(--tone-warm-ink); border-radius: 12px;
  padding: 10px 12px; font-size: 1.05rem; line-height: 1.6; margin: 0 0 6px;
}
.setting-list { display: flex; flex-direction: column; margin-bottom: 10px; }
.setting-row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 0; border-bottom: 1px solid var(--hairline);
}
.setting-label { flex: 1; min-width: 0; font-size: 0.95rem; line-height: 1.4; }
.setting-list .setting-group { margin: 16px 0 0; font-size: 0.85rem; color: var(--tone-warm-ink); letter-spacing: 0.05em; }
.stepper { display: inline-flex; align-items: center; gap: 6px; flex: none; }
.stepper button {
  width: 40px; height: 40px; border-radius: 50%; border: none; cursor: pointer;
  background: var(--tone-warm-face); color: var(--tone-warm-ink); box-shadow: 0 3px 0 var(--tone-warm-ledge);
  font-size: 1.3rem; font-weight: bold; line-height: 1; transition: transform .1s, box-shadow .1s;
}
.stepper button:active:not(:disabled) { transform: translateY(2px); box-shadow: 0 1px 0 var(--tone-warm-ledge); }
.stepper button:disabled { opacity: 0.35; cursor: default; }
.stepper output { min-width: 4.4em; text-align: center; font-weight: bold; font-variant-numeric: tabular-nums; }
.switch {
  position: relative; flex: none; width: 56px; height: 32px; border-radius: 999px; border: none; cursor: pointer;
  background: var(--switch-off); transition: background-color .2s;
}
.switch-knob {
  position: absolute; top: 3px; left: 3px; width: 26px; height: 26px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25); transition: transform .25s cubic-bezier(.34, 1.56, .64, 1);
}
.switch[aria-checked="true"] { background: var(--switch-on); }
.switch[aria-checked="true"] .switch-knob { transform: translateX(24px); }
.detail-info .btn-open-playback { display: block; margin-top: 10px; padding: 0; }
@media (max-width: 480px) { .detail-info .btn-open-playback { margin-left: auto; margin-right: auto; } }

@media (max-width: 480px) {
  .app-header h1 { font-size: 1.4rem; }
  /* 手機上分類 2×2、模式一排四個，少佔兩排，打開就看得到注音卡片 */
  .category-tabs, .mode-tabs { display: grid; gap: 6px; padding: 6px 12px; }
  .category-tabs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .mode-tabs { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .category-tab, .mode-tab { font-size: 0.9rem; padding: 8px 4px; white-space: nowrap; }
  .category-tab.icon-btn, .mode-tab.icon-btn { min-width: 0; padding: 4px 2px; white-space: normal; }
  .category-tabs:has(.icon-btn) { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .category-tab.icon-btn .icon-pic, .mode-tab.icon-btn .icon-pic { width: 40px; height: 40px; }
  .category-tab.icon-btn .icon-label, .mode-tab.icon-btn .icon-label { font-size: 0.85rem; }
  .category-tab.icon-btn .icon-label { font-size: 0.72rem; white-space: nowrap; }  /* 分類一排四個，「卡通奇幻角色」要擠得進一行 */
  .symbol-grid { grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 10px; }
  .detail-top { justify-content: center; text-align: center; }
  .mascot-display .mascot-svg { width: 110px; height: 102px; }
  .quiz-choices { justify-content: center; }
}
