/* 首頁、小朋友頁、家長頁 */
.home { text-align: center; padding-top: 28px; }
.home-hero { font-size: 96px; line-height: 1.1; }
.home h1 { font-size: 32px; margin: 8px 0; }
.home-actions { display: flex; flex-direction: column; gap: 14px; margin: 24px 0; }
.home-actions .btn { width: 100%; min-height: 72px; font-size: 24px; }
.demo-list { display: flex; flex-direction: column; gap: 10px; text-align: left; }
.sample-link { display: flex; align-items: center; gap: 12px; padding: 10px 14px; background: var(--surface); color: var(--on-surface); border-radius: 16px; text-decoration: none; font-weight: 700; border: 1px solid rgba(127, 127, 127, 0.25); min-height: 64px; }
.sample-link .emoji { font-size: 36px; }
.sample-link span:last-child { overflow-wrap: anywhere; }

.kid-header { display: flex; align-items: center; gap: 12px; margin: 8px 0 16px; }
.kid-header .hero { font-size: 64px; }
.kid-header h1 { font-size: 28px; margin: 0; overflow-wrap: anywhere; }
.sticker-book { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 10px; margin-bottom: 20px; }
.sticker { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 10px 6px; text-align: center; background: var(--surface); color: var(--on-surface); border: 3px dashed var(--accent); border-radius: 18px; }
.sticker:nth-child(odd) { transform: rotate(-2deg); }
.sticker:nth-child(even) { transform: rotate(2deg); }
.sticker .s-hero { font-size: 44px; line-height: 1.1; }
.sticker .s-title { font-weight: 800; font-size: 15px; overflow-wrap: anywhere; }
.sticker .s-meta { font-size: 13px; opacity: 0.75; }
.game-cards { display: grid; grid-template-columns: 1fr; gap: 12px; }
.game-card { display: flex; align-items: center; gap: 14px; padding: 14px; background: var(--surface); color: var(--on-surface); border-radius: 20px; text-decoration: none; border: 3px solid var(--primary); box-shadow: 0 4px 0 rgba(0, 0, 0, 0.2); min-height: 92px; }
.game-card .g-hero { font-size: 52px; line-height: 1; flex: 0 0 auto; }
.game-card .g-text { display: flex; flex-direction: column; min-width: 0; }
.game-card .g-title { font-size: 21px; font-weight: 800; overflow-wrap: anywhere; }
.game-card .g-stars { color: #d97706; font-size: 22px; letter-spacing: 1px; }
.section-title { font-size: 22px; margin: 20px 0 10px; }

/* ---------- 家長頁 ---------- */
.make-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.make-top-actions { display: flex; gap: 8px; }
.kid-card h3, .kid-games h3 { font-size: 20px; margin-bottom: 4px; }
.game-row h4 { font-size: 19px; margin: 0 0 4px; overflow-wrap: anywhere; }
.link-input { font-size: 16px; }
.tabs { display: flex; gap: 8px; margin-bottom: 12px; flex-wrap: wrap; }
.tab { min-height: 56px; padding: 8px 16px; font: inherit; font-size: 18px; font-weight: 700; color: var(--on-bg); background: transparent; border: 2px solid rgba(127, 127, 127, 0.5); border-radius: 14px; cursor: pointer; }
.tab.is-active { background: var(--primary); color: var(--on-primary); border-color: transparent; }
.plain-textarea { font-family: var(--font); font-size: 18px; min-height: 100px; }
.chip-row .btn { flex: 0 1 auto; }
.inline-link { margin-left: 8px; font-weight: 700; }
.results-line { font-size: 17px; }
.offscreen { position: fixed; left: -9999px; top: 0; }
.status { min-height: 8px; }

.chat-help { margin-top: 16px; padding: 8px 14px 14px; border: 2px solid rgba(127, 127, 127, 0.4); border-radius: 14px; }
.chat-help summary { min-height: 56px; display: flex; align-items: center; font-weight: 800; font-size: 19px; cursor: pointer; }
.steps { padding-left: 1.4em; }

/* ---------- 家長頁：AI 幫我出 ---------- */
.file-list { list-style: none; margin: 0 0 12px; padding: 0; display: grid; gap: 6px; }
.file-list li, .file-list > div { display: flex; align-items: center; justify-content: space-between; gap: 8px; overflow-wrap: anywhere; }
.ai-progress { list-style: none; display: flex; gap: 8px; flex-wrap: wrap; margin: 12px 0; padding: 0; }
.ai-stage { padding: 8px 14px; border: 2px solid rgba(127, 127, 127, 0.5); border-radius: 999px; font-weight: 700; opacity: 0.6; }
.ai-stage.is-current { opacity: 1; border-color: var(--primary); animation: ai-pulse 1.2s ease-in-out infinite; }
.ai-stage.is-done { opacity: 1; border-color: #16a34a; }
.ai-stage.is-done::before { content: '✔ '; }
@keyframes ai-pulse { 50% { background: rgba(127, 127, 127, 0.18); } }
@media (prefers-reduced-motion: reduce) { .ai-stage.is-current { animation: none; } }

/* ---------- 頁腳、語言切換、提示字 ---------- */
.site-footer { margin-top: 28px; padding-top: 14px; border-top: 1px solid rgba(127, 127, 127, 0.3); display: flex; flex-direction: column; gap: 12px; }
.footer-links { display: flex; flex-wrap: wrap; gap: 8px 18px; }
.footer-links a, .home-links a { font-size: 17px; font-weight: 700; min-height: 44px; display: inline-flex; align-items: center; }
.lang-switch { display: flex; flex-wrap: wrap; gap: 8px; }
.lang-btn { min-height: 56px; padding: 6px 14px; font: inherit; font-size: 16px; font-weight: 700; color: var(--on-bg); background: transparent; border: 2px solid rgba(127, 127, 127, 0.5); border-radius: 12px; cursor: pointer; touch-action: manipulation; }
.lang-btn.is-active { background: var(--primary); color: var(--on-primary); border-color: transparent; }
.lang-btn:focus-visible { outline: 4px solid var(--accent); outline-offset: 2px; }
.home-links { margin: 0 0 8px; }
.hint { font-size: 16px; opacity: 0.8; margin: -6px 0 12px; }
.card-title { font-size: 20px; margin: 0 0 8px; }
.danger-zone { border: 2px solid #fca5a5; }
.facts { display: grid; grid-template-columns: max-content 1fr; gap: 4px 14px; margin: 0 0 12px; }
.facts dt { font-weight: 800; }
.facts dd { margin: 0; overflow-wrap: anywhere; }

/* ---------- 指南、法律頁、後台 ---------- */
.guide .steps { margin-bottom: 12px; }
.guide-cta { border: 3px solid var(--primary); }
.legal { overflow-wrap: anywhere; }
.legal h1 { font-size: 28px; margin: 12px 0; }
.legal h2 { font-size: 22px; margin: 22px 0 8px; }
.legal h3 { font-size: 19px; margin: 16px 0 6px; }
.legal blockquote { margin: 0 0 14px; padding: 8px 14px; border-left: 5px solid var(--accent); background: rgba(245, 158, 11, 0.12); border-radius: 8px; }
.legal blockquote p { margin: 4px 0; }
.legal hr { border: 0; border-top: 1px solid rgba(127, 127, 127, 0.35); margin: 18px 0; }
.legal li { margin-bottom: 4px; }
.legal code { font-size: 16px; padding: 1px 5px; border-radius: 6px; background: rgba(127, 127, 127, 0.18); }
.legal .table-wrap { overflow-x: auto; margin-bottom: 14px; }
.legal table { border-collapse: collapse; min-width: 100%; font-size: 16px; }
.legal th, .legal td { border: 1px solid rgba(127, 127, 127, 0.4); padding: 6px 10px; text-align: left; vertical-align: top; }
.legal th { background: rgba(127, 127, 127, 0.15); }
.placeholder { background: #fef08a; color: #422006; padding: 0 3px; border-radius: 4px; }
.actions + .hint { margin-top: 14px; }

/* ---------- 小朋友頁：設定（讀題聲音）---------- */
.settings-box { margin-top: 24px; background: var(--surface); color: var(--on-surface); border-radius: var(--radius); padding: 4px 16px 16px; border: 1px solid rgba(127, 127, 127, 0.25); }
.settings-box summary { min-height: 56px; display: flex; align-items: center; font-weight: 800; font-size: 19px; cursor: pointer; }
.voice-lang { border: 0; padding: 0; margin: 14px 0 0; min-width: 0; }
.voice-lang legend { font-weight: 800; font-size: 19px; margin-bottom: 4px; padding: 0; }
.voice-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 56px; border-top: 1px solid rgba(127, 127, 127, 0.2); }
.voice-pick { display: flex; align-items: center; gap: 8px; flex: 1 1 auto; min-width: 0; min-height: 56px; font-size: 18px; cursor: pointer; }
.voice-pick span { overflow-wrap: anywhere; }
.voice-pick input[type="radio"] { width: 28px; height: 28px; flex: 0 0 auto; margin: 0; }
.voice-row .btn { flex: 0 0 auto; }

/* ---------- 家長頁：按課程出題 ---------- */
.cur-points { border: 0; padding: 0; margin: 0 0 8px; min-width: 0; }
.cur-points legend { font-weight: 800; font-size: 19px; margin-bottom: 4px; padding: 0; }
.cur-point { display: flex; align-items: center; gap: 10px; min-height: 56px; padding: 6px 4px; border-top: 1px solid rgba(127, 127, 127, 0.2); cursor: pointer; }
.cur-point input[type="checkbox"] { width: 28px; height: 28px; flex: 0 0 auto; margin: 0; }
.cur-point > span { min-width: 0; overflow-wrap: anywhere; }

/* ---------- 家長頁：針對錯題再出 ---------- */
.retry-box { margin-top: 8px; }
