/* ASIFT 樣式
 * 品牌色：主色 #70B7E8、輔助黃 #FFE39A、輔助綠 #A8DCC0、輔助粉 #F3B8C8、背景 #FFFDF7、文字 #34445A
 * 對比說明：白字放在 #70B7E8 上對比不足（約 2.2:1），因此按鈕使用深色文字；連結使用較深的品牌藍 #23628F。 */
:root {
  --blue: #70B7E8;
  --blue-d: #4A93C8;
  --blue-ink: #23628F;
  --yellow: #FFE39A;
  --green: #A8DCC0;
  --green-d: #6FBF95;
  --pink: #F3B8C8;
  --bg: #FFFDF7;
  --ink: #34445A;
  --ink-soft: #6B7A8F;
  --line: #E4E7EC;
  --card: #FFFFFF;
  --sky: #E3F2FC;
  --radius: 18px;
  --radius-s: 12px;
  --shadow: 0 6px 20px rgba(52, 68, 90, .08);
  --font: "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", system-ui, -apple-system, "Segoe UI", sans-serif;
  --fs: 1rem;
  --card-border: 1px solid var(--line);
  /* 插圖用色（依年齡層覆寫） */
  --i-blue: var(--blue); --i-blue-d: var(--blue-d); --i-yellow: var(--yellow); --i-green: var(--green); --i-green-d: var(--green-d);
  --i-pink: var(--pink); --i-ink: var(--ink); --i-ink-soft: #8A97A8; --i-white: #fff; --i-face: #DDF0FC; --i-panel: #F2F8FD;
  --i-sky: #E3F2FC; --i-wall: #FFF6E3; --i-floor: #F2DDB8; --i-skin: #F8D7BE; --i-skin2: #D9A47E; --i-hair: #5A4636; --i-hair2: #2E2A27;
  --i-sw: 1;
}

/* ---------- 五個年齡層的視覺風格 ---------- */
/* 幼兒園：水彩繪本、可愛角色（大字、圓角、柔和） */
[data-age="kinder"] {
  --fs: 1.18rem; --radius: 30px; --radius-s: 22px;
  --i-panel: #FFF4DC; --i-face: #E8F5FD; --i-ink-soft: #A3AEBB;
  --card-border: 2px solid #FCEBC4;
}
[data-age="kinder"] body {
  background:
    radial-gradient(circle at 10% 20%, rgba(243, 184, 200, .25), transparent 40%),
    radial-gradient(circle at 90% 10%, rgba(255, 227, 154, .35), transparent 40%),
    radial-gradient(circle at 70% 90%, rgba(168, 220, 192, .3), transparent 45%), var(--bg);
  background-attachment: fixed;
}
[data-age="kinder"] .ill { filter: saturate(.9); }
[data-age="kinder"] .lesson-points li { font-size: 1.25rem; }

/* 國小：彩色漫畫、情境插畫（粗框、漫畫陰影） */
[data-age="elem"] {
  --radius: 16px; --card-border: 3px solid var(--ink);
  --shadow: 5px 5px 0 var(--ink); --fs: 1.06rem;
  --i-panel: #FFF8E1;
}
[data-age="elem"] .ill .s-ink, [data-age="elem"] .scene rect, [data-age="elem"] .concept rect { stroke: var(--ink); stroke-width: 2.5; }
[data-age="elem"] .btn { box-shadow: 3px 3px 0 var(--ink); border: 2px solid var(--ink); }

/* 國中：科學圖解、資訊圖表（方格紙背景） */
[data-age="junior"] {
  --radius: 12px; --i-panel: #F1FAF5;
  --card-border: 1px solid #CFE7DA;
}
[data-age="junior"] body {
  background-color: var(--bg);
  background-image: linear-gradient(rgba(112, 183, 232, .09) 1px, transparent 1px), linear-gradient(90deg, rgba(112, 183, 232, .09) 1px, transparent 1px);
  background-size: 24px 24px;
}

/* 高中：科技視覺、技術架構（深色科技面板） */
[data-age="senior"] {
  --radius: 10px; --radius-s: 8px;
  --i-panel: #1F2B3D; --i-face: #CFE6F7; --i-white: #EAF4FB; --i-wall: #263449; --i-floor: #33435A; --i-sky: #22324A;
  --i-ink-soft: #8FA3BA;
}
[data-age="senior"] .lesson-head, [data-age="senior"] .page-head { background: linear-gradient(135deg, #1F2B3D, #2C3E57); color: #EAF4FB; }
[data-age="senior"] .lesson-head .lead, [data-age="senior"] .page-head .lead, [data-age="senior"] .lesson-head .eyebrow { color: #C9DCEC; }
[data-age="senior"] .flow-n { font-family: ui-monospace, "SFMono-Regular", Menlo, monospace; }
[data-age="senior"] .lesson-head .speak-btn { background: #2C3E57; color: #EAF4FB; border-color: #4A6584; }

/* 成人：專業資訊圖表、商業視覺（簡潔、細線） */
[data-age="adult"] {
  --radius: 8px; --radius-s: 6px; --fs: .98rem;
  --i-panel: #F4F6F9; --i-pink: #E9A6B9;
  --shadow: 0 1px 3px rgba(52, 68, 90, .12);
}

/* ---------- 基本 ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 140px; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--font); font-size: var(--fs); line-height: 1.7; }
img, svg { max-width: 100%; }
a { color: var(--blue-ink); }
a:hover { text-decoration-thickness: 2px; }
h1, h2, h3, h4 { line-height: 1.3; margin: 0 0 .5em; }
h1 { font-size: clamp(1.7rem, 4.5vw, 2.6rem); }
h2 { font-size: clamp(1.3rem, 3vw, 1.7rem); }
h3 { font-size: 1.15rem; }
p { margin: 0 0 .8em; }
ul, ol { padding-left: 1.3em; margin: 0 0 .8em; }
.wrap { width: 100%; max-width: 1160px; margin: 0 auto; padding: 0 16px; }
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--ink); color: #fff; padding: 8px 12px; border-radius: 8px; z-index: 100; }
.skip:focus { left: 8px; }
:focus-visible { outline: 3px solid var(--blue-ink); outline-offset: 2px; }
.small { font-size: .88em; color: var(--ink-soft); }
.card { background: var(--card); border: var(--card-border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; margin-bottom: 20px; }

/* ---------- 按鈕 ---------- */
.btn { display: inline-flex; align-items: center; gap: .4em; background: var(--blue); color: var(--ink); font-weight: 700; border: 2px solid var(--blue); border-radius: 999px; padding: .55em 1.2em; text-decoration: none; cursor: pointer; font: inherit; font-weight: 700; min-height: 44px; }
.btn:hover { background: var(--blue-d); border-color: var(--blue-d); color: #fff; }
.btn.ghost { background: transparent; color: var(--blue-ink); border-color: var(--blue); }
.btn.ghost:hover { background: var(--sky); color: var(--ink); }
.btn.big { font-size: 1.1em; padding: .7em 1.5em; }
.btn.small { padding: .3em .9em; min-height: 38px; font-size: .92em; }
.btn:disabled { opacity: .55; cursor: default; }
.speak-btn { display: inline-flex; align-items: center; gap: .35em; background: var(--yellow); color: var(--ink); border: 2px solid #F2CF6B; border-radius: 999px; padding: .3em .9em; font: inherit; font-size: .9em; font-weight: 700; cursor: pointer; min-height: 40px; }
.speak-btn .ico { width: 1.2em; height: 1.2em; }
.speak-btn.speaking { background: var(--pink); border-color: #E596AC; }
.speak-btn.speaking::after { content: "（再按一次停止）"; font-weight: 400; }
.no-speech .speak-btn { display: none; }

/* ---------- 頁首 ---------- */
.site-header { position: sticky; top: 0; z-index: 50; background: rgba(255, 253, 247, .96); backdrop-filter: blur(6px); border-bottom: 1px solid var(--line); }
.bar { display: flex; align-items: center; gap: 12px; min-height: 60px; flex-wrap: wrap; }
.logo { display: inline-flex; align-items: center; gap: 8px; text-decoration: none; color: var(--ink); font-weight: 900; font-size: 1.35rem; letter-spacing: .04em; }
.logo-mark { width: 36px; height: 36px; }
.menu-btn { margin-left: auto; display: none; font: inherit; font-weight: 700; background: var(--sky); border: 0; border-radius: 999px; padding: .4em 1em; color: var(--ink); cursor: pointer; min-height: 44px; }
.main-nav { display: flex; flex-wrap: wrap; gap: 2px; margin-left: auto; }
.main-nav a { color: var(--ink); text-decoration: none; padding: .4em .65em; border-radius: 999px; font-weight: 600; font-size: .95rem; }
.main-nav a:hover { background: var(--sky); }
.main-nav a[aria-current="page"] { background: var(--blue); }
.agebar { border-top: 1px solid var(--line); background: #fff; }
.agebar-in { display: flex; align-items: center; gap: 6px; overflow-x: auto; padding-top: 6px; padding-bottom: 6px; scrollbar-width: thin; }
.agebar-label { font-weight: 700; font-size: .85rem; white-space: nowrap; color: var(--ink-soft); }
.age-chip { display: inline-flex; align-items: center; gap: 6px; border: 2px solid var(--line); background: #fff; border-radius: 999px; padding: 2px 12px 2px 4px; cursor: pointer; font: inherit; color: var(--ink); white-space: nowrap; min-height: 44px; }
.age-chip b { font-size: .9rem; margin-right: 4px; }
.age-chip small { font-size: .72rem; color: var(--ink-soft); }
.age-chip-ico .age-ico { width: 32px; height: 32px; display: block; }
.age-chip[aria-pressed="true"] { border-color: var(--blue-d); background: var(--sky); box-shadow: inset 0 0 0 1px var(--blue-d); }
@media (max-width: 900px) {
  .menu-btn { display: inline-flex; align-items: center; }
  .main-nav { display: none; width: 100%; flex-direction: column; padding-bottom: 10px; }
  .nav-open .main-nav { display: flex; }
  .main-nav a { padding: .7em .8em; border-radius: 10px; }
  .age-chip small { display: none; }
}

/* ---------- 頁尾 ---------- */
.site-footer { background: var(--ink); color: #E8EEF5; margin-top: 48px; padding: 36px 0 20px; }
.site-footer a { color: #fff; }
.footer-grid { display: grid; grid-template-columns: 1fr 1.2fr; gap: 24px; }
.logo-foot { color: #fff; }
.foot-tag { color: #C9D4E0; margin-top: 8px; }
.foot-links { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 20px; align-content: start; }
.foot-links a { text-decoration: none; padding: 4px 0; }
.foot-links a:hover { text-decoration: underline; }
.foot-note { border-top: 1px solid rgba(255, 255, 255, .15); margin-top: 24px; padding-top: 16px; font-size: .85rem; color: #C9D4E0; }
@media (max-width: 640px) { .footer-grid { grid-template-columns: 1fr; } }

/* ---------- 首頁 ---------- */
.hero { background: linear-gradient(180deg, var(--sky), var(--bg)); padding: 32px 0 24px; }
.hero-in { display: grid; grid-template-columns: 1.05fr 1fr; gap: 28px; align-items: center; }
.eyebrow { font-weight: 700; color: var(--blue-ink); letter-spacing: .02em; margin-bottom: .4em; font-size: .92rem; }
.hero h1 { display: flex; flex-direction: column; gap: 6px; }
.brand { font-size: clamp(2.8rem, 9vw, 4.6rem); font-weight: 900; letter-spacing: .06em; color: var(--ink); line-height: 1; }
.hero-en { font-size: clamp(1.15rem, 3vw, 1.6rem); font-weight: 800; color: var(--blue-ink); }
.hero-zh { font-size: clamp(1.15rem, 3vw, 1.45rem); font-weight: 700; }
.cta { display: flex; flex-wrap: wrap; gap: 12px; margin: 18px 0; }
.hero-note { font-size: .82rem; color: var(--ink-soft); max-width: 36em; }
.hero-art .ill { width: 100%; height: auto; }
@media (max-width: 820px) { .hero-in { grid-template-columns: 1fr; } .hero-art { order: -1; } }

.sec { padding: 44px 0; }
.sec.alt { background: rgba(227, 242, 252, .45); }
.sec-title { margin-bottom: .3em; }
.sec-lead { color: var(--ink-soft); max-width: 46em; }
.more { margin-top: 12px; font-weight: 700; }

.age-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 14px; margin-top: 12px; }
.age-card { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 2px; background: #fff; border: 3px solid var(--line); border-radius: var(--radius); padding: 18px 10px; cursor: pointer; font: inherit; color: var(--ink); box-shadow: var(--shadow); transition: transform .15s, border-color .15s; }
.age-card:hover, .age-card:focus-visible { transform: translateY(-4px); border-color: var(--blue); }
.age-card .age-ico.big { width: 76px; height: 76px; }
.age-card b { font-size: 1.3rem; }
.age-card em { font-style: normal; font-weight: 700; color: var(--blue-ink); }
.age-card small { color: var(--ink-soft); font-size: .8rem; }
.age-kinder { background: #FFF8E6; } .age-elem { background: #FFF0F4; } .age-junior { background: #EEF9F3; } .age-senior { background: #EAF5FD; } .age-adult { background: #F6F7F9; }
@media (max-width: 900px) { .age-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .age-grid > :last-child:nth-child(odd) { grid-column: span 2; } }

.know-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.know-card { display: flex; flex-direction: column; gap: 4px; text-decoration: none; color: var(--ink); margin: 0; }
.know-card:hover { border-color: var(--blue); }
.know-ill { aspect-ratio: 16 / 10; display: flex; align-items: center; justify-content: center; }
.know-ill .ill { width: 100%; height: 100%; }
.know-card b { font-size: 1.1rem; }
.know-card span { color: var(--ink-soft); font-size: .92rem; }
.can-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; width: 70%; }
.can-grid .ill { width: 100%; height: auto; }
@media (max-width: 900px) { .know-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 480px) { .know-grid { grid-template-columns: 1fr; } }
.unit-strip { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.unit-pill { display: inline-flex; align-items: center; gap: 8px; background: #fff; border: 2px solid var(--line); border-radius: 999px; padding: .35em 1em .35em .4em; text-decoration: none; color: var(--ink); font-weight: 700; min-height: 44px; }
.unit-pill span { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--yellow); }
.unit-pill:hover { border-color: var(--blue); }

.life-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.life-card { display: flex; flex-direction: column; gap: 6px; text-decoration: none; color: var(--ink); margin: 0; }
.life-card .ill { border-radius: var(--radius-s); width: 100%; height: auto; }
.life-card span { color: var(--ink-soft); font-size: .92rem; }
@media (max-width: 820px) { .life-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 480px) { .life-grid { grid-template-columns: 1fr; } }

.play-intro { display: grid; grid-template-columns: 1fr 1.6fr; gap: 24px; align-items: start; }
@media (max-width: 820px) { .play-intro { grid-template-columns: 1fr; } }
.mission { background: linear-gradient(135deg, #FFF6D9, #FDE9EF); }
.mission-quote { font-size: clamp(1.4rem, 4vw, 2.1rem); font-weight: 900; margin: 0 0 .5em; padding-left: 16px; border-left: 8px solid var(--blue); }
.principles { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-top: 16px; }
.principles li { background: #fff; border-radius: var(--radius); padding: 16px; display: flex; flex-direction: column; gap: 4px; border: var(--card-border); }
.pr-k { display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: var(--blue); font-weight: 900; font-size: 1.2rem; }
.principles li > span:last-child { color: var(--ink-soft); font-size: .92rem; }
@media (max-width: 900px) { .principles { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 480px) { .principles { grid-template-columns: 1fr; } }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 640px) { .two { grid-template-columns: 1fr; } }
.support-card { display: grid; grid-template-columns: 72px 1fr; grid-template-rows: auto auto; column-gap: 14px; text-decoration: none; color: var(--ink); margin: 0; align-items: center; }
.support-card .ill { grid-row: span 2; width: 72px; height: 72px; }
.support-card b { font-size: 1.2rem; align-self: end; }
.support-card span { color: var(--ink-soft); align-self: start; }

/* ---------- 頁面標頭 ---------- */
.page-head { background: linear-gradient(180deg, var(--sky), transparent); padding: 28px 0 12px; margin-bottom: 16px; }
.page-head-in { display: grid; grid-template-columns: 1fr 220px; gap: 20px; align-items: center; }
.page-head-ill .ill { width: 100%; height: auto; max-height: 180px; }
.lead { font-size: 1.1em; color: var(--ink-soft); }
@media (max-width: 640px) { .page-head-in { grid-template-columns: 1fr 110px; } .page-head h1 { font-size: 1.6rem; } }
.age-note { background: #fff; border: 1px dashed var(--blue); border-radius: var(--radius-s); padding: 8px 14px; font-size: .92rem; }

/* ---------- 單元學習頁 ---------- */
.unit-tabs { display: flex; gap: 8px; overflow-x: auto; padding-top: 14px; padding-bottom: 6px; scrollbar-width: thin; }
.unit-tabs a { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; text-decoration: none; color: var(--ink); background: #fff; border: 2px solid var(--line); border-radius: 999px; padding: .3em .9em .3em .35em; font-weight: 700; min-height: 44px; }
.unit-tabs a[aria-current="page"] { border-color: var(--blue-d); background: var(--sky); }
.ut-n { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--yellow); font-size: .9rem; }
.prog { font-size: .88rem; color: var(--ink-soft); margin: 4px auto 0; }
.lesson-head { display: grid; grid-template-columns: 1.1fr 1fr; gap: 24px; align-items: center; background: linear-gradient(135deg, #fff, var(--sky)); border-radius: var(--radius); padding-top: 24px; padding-bottom: 24px; margin-top: 12px; margin-bottom: 20px; border: var(--card-border); }
.lesson-ill { margin: 0; }
.lesson-ill .ill { width: 100%; height: auto; }
@media (max-width: 820px) { .lesson-head { grid-template-columns: 1fr; width: calc(100% - 32px); } .lesson-ill { order: -1; } }
.lesson-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 20px; }
.lesson-grid .card { margin-bottom: 20px; }
@media (max-width: 820px) { .lesson-grid { grid-template-columns: 1fr; } }
.lesson-points ul { list-style: none; padding: 0; }
.lesson-points li { position: relative; padding-left: 34px; margin-bottom: 12px; font-size: 1.08em; }
.lesson-points li::before { content: ""; position: absolute; left: 0; top: .25em; width: 22px; height: 22px; border-radius: 50%; background: var(--yellow); box-shadow: inset 0 0 0 6px var(--blue); }
.lesson-scene figure { margin: 0 0 10px; }
.lesson-scene .ill { width: 100%; height: auto; border-radius: var(--radius-s); }
.lesson-scene figcaption { margin-top: 8px; font-weight: 600; }
.mark-btn { margin-top: 12px; }
.mark-btn[aria-pressed="true"] { background: var(--green); border-color: var(--green-d); color: var(--ink); }
.pager { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin: 8px auto 20px; }
.src-box { font-size: .85rem; color: var(--ink-soft); }

/* 圖解：流程 */
.flow { list-style: none; padding: 0; display: flex; flex-direction: column; gap: 22px; counter-reset: f; }
.flow-step { position: relative; display: flex; align-items: center; gap: 12px; background: var(--sky); border-radius: var(--radius-s); padding: 10px 14px; font-weight: 700; }
.flow-step:not(:last-child)::after { content: ""; position: absolute; left: 30px; bottom: -20px; border: 9px solid transparent; border-top: 11px solid var(--blue-d); }
.flow-n { flex: none; display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--blue); }
.flow-step:nth-child(2n) { background: #FDF0F4; } .flow-step:nth-child(2n) .flow-n { background: var(--pink); }
.flow-step:nth-child(3n) { background: #EEF9F3; } .flow-step:nth-child(3n) .flow-n { background: var(--green); }
[data-age="kinder"] .flow-step { font-size: 1.2rem; padding: 16px; }
[data-age="senior"] .flow-step { background: #1F2B3D; color: #EAF4FB; }
/* 圖解：層級 */
.nested { font-weight: 700; }
.nest { border-radius: var(--radius-s); padding: 12px 12px 14px; margin-top: 8px; }
.nest-l { display: block; margin-bottom: 4px; }
.nest-0 { background: var(--sky); border: 2px solid var(--blue); margin-top: 0; }
.nest-1 { background: #EEF9F3; border: 2px solid var(--green-d); }
.nest-2 { background: #FDF0F4; border: 2px solid var(--pink); }
.nest-3 { background: #FFF6D6; border: 2px solid #F2CF6B; }
/* 圖解：神經網路 */
.neural-wrap .ill { width: 100%; height: auto; background: var(--i-panel); border-radius: var(--radius-s); }
.legend { list-style: none; padding: 0; margin-top: 10px; }
.legend li { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.dot { width: 14px; height: 14px; border-radius: 50%; flex: none; }
.dot-0 { background: var(--blue); } .dot-1 { background: var(--pink); } .dot-2 { background: var(--green-d); }
/* 圖解：迷你時間軸 */
.mini-tl { list-style: none; padding: 0 0 0 18px; border-left: 4px solid var(--blue); }
.mini-tl li { position: relative; margin-bottom: 12px; }
.mini-tl li::before { content: ""; position: absolute; left: -27px; top: .35em; width: 14px; height: 14px; border-radius: 50%; background: var(--yellow); border: 3px solid var(--blue-d); }
.mini-tl a { display: flex; gap: 10px; text-decoration: none; color: var(--ink); font-weight: 700; }
.mini-tl b { color: var(--blue-ink); }
.mini-tl small { display: block; color: var(--ink-soft); }

/* ---------- 名詞卡 ---------- */
.term-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
.term-grid.compact { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
.term-card { display: flex; flex-direction: column; gap: 4px; background: #fff; border: var(--card-border); border-radius: var(--radius); padding: 14px; text-decoration: none; color: var(--ink); box-shadow: var(--shadow); }
.term-card:hover { border-color: var(--blue); }
.term-card .ill { width: 56px; height: 56px; }
.term-card b { font-size: 1.1rem; }
.term-card span { color: var(--ink-soft); font-size: .9rem; }
.en { color: var(--ink-soft); font-size: .82rem; }

/* ---------- 時間軸 ---------- */
.tl-track { display: flex; gap: 10px; overflow-x: auto; padding: 8px 2px 14px; scroll-snap-type: x proximity; scrollbar-width: thin; }
.tl-dot { flex: none; scroll-snap-align: center; display: flex; flex-direction: column; align-items: flex-start; width: 150px; text-align: left; background: #fff; border: 2px solid var(--line); border-top: 6px solid var(--blue); border-radius: var(--radius-s); padding: 8px 10px; cursor: pointer; font: inherit; color: var(--ink); min-height: 88px; }
.tl-dot b { font-size: 1.2rem; }
.tl-dot span { font-size: .85rem; line-height: 1.4; }
.tl-dot.era-winter { border-top-color: var(--green-d); } .tl-dot.era-deep { border-top-color: #E596AC; } .tl-dot.era-genai { border-top-color: #F2CF6B; }
.tl-dot[aria-selected="true"] { background: var(--sky); border-color: var(--blue-d); box-shadow: var(--shadow); }
.tl-panel { min-height: 180px; }
.tl-year { font-size: 2rem; font-weight: 900; color: var(--blue-ink); margin: 0; }
.tl-nav { display: flex; gap: 10px; justify-content: flex-end; margin-top: -8px; margin-bottom: 20px; }
.src { font-size: .85rem; color: var(--ink-soft); }
.hist-list { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 16px; }
@media (max-width: 720px) { .hist-list { grid-template-columns: 1fr; } }
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0; }
.chip { font: inherit; font-weight: 700; background: #fff; border: 2px solid var(--line); color: var(--ink); border-radius: 999px; padding: .3em 1em; cursor: pointer; min-height: 40px; }
.chip[aria-pressed="true"] { background: var(--blue); border-color: var(--blue); }
.chip small { font-weight: 400; }

/* ---------- 名詞百科頁 ---------- */
.gl-tools { display: flex; flex-direction: column; gap: 6px; margin-top: 14px; }
.search input { width: 100%; font: inherit; padding: .7em 1em; border: 2px solid var(--line); border-radius: 999px; background: #fff; color: var(--ink); }
.search input:focus { border-color: var(--blue-d); outline: none; box-shadow: 0 0 0 3px rgba(112, 183, 232, .35); }
.gl-count { color: var(--ink-soft); font-size: .9rem; }
.gl-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 16px; }
@media (max-width: 720px) { .gl-list { grid-template-columns: 1fr; } }
.gl-item { display: grid; grid-template-columns: 64px 1fr; gap: 14px; align-items: start; }
.gl-item .ill { width: 64px; height: 64px; }
.gl-item h3 { margin-bottom: 0; }
.gl-cat { font-size: .8rem; font-weight: 700; color: var(--blue-ink); margin-bottom: 2px; }
.gl-item details { margin: 4px 0 10px; font-size: .92rem; color: var(--ink-soft); }
.gl-item summary { cursor: pointer; color: var(--blue-ink); font-weight: 700; }
.cat-future { background: linear-gradient(135deg, #fff, #FFF8E1); }
.flash { animation: flash 1.6s ease 2; }
@keyframes flash { 50% { box-shadow: 0 0 0 6px var(--yellow); } }
.empty { padding: 24px; text-align: center; color: var(--ink-soft); }

/* ---------- 生活應用、工具 ---------- */
.life-list .life-item { display: grid; grid-template-columns: 300px 1fr; gap: 20px; align-items: center; }
.life-item figure { margin: 0; }
.life-item .ill { width: 100%; height: auto; border-radius: var(--radius-s); }
@media (max-width: 720px) { .life-list .life-item { grid-template-columns: 1fr; } }
.caution { background: #FFF6D6; border-radius: var(--radius-s); padding: 6px 12px; font-size: .92rem; }
.tool-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 16px; }
@media (max-width: 900px) { .tool-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .tool-grid { grid-template-columns: 1fr; } }
.tool-card .ill { width: 56px; height: 56px; }
.tool-card .ex { font-size: .9rem; color: var(--ink-soft); }
.tips { font-size: .92rem; }
.checklist-card { background: #FFFBEA; }

/* ---------- 測驗與遊戲 ---------- */
.quiz { border: 0; padding: 0; margin: 0 0 8px; min-width: 0; }
.quiz legend { font-weight: 700; font-size: 1.08em; margin-bottom: 10px; padding: 0; }
.quiz-opts { display: grid; gap: 8px; }
.quiz-opt { text-align: left; font: inherit; background: #fff; border: 2px solid var(--line); border-radius: var(--radius-s); padding: .6em 1em; cursor: pointer; color: var(--ink); min-height: 48px; }
.quiz-opt:hover:not(:disabled) { border-color: var(--blue); background: var(--sky); }
.quiz-opt.right { background: var(--green); border-color: var(--green-d); font-weight: 700; }
.quiz-opt.right::before { content: "✓ "; }
.quiz-opt.wrong { background: #FDE8EE; border-color: var(--pink); text-decoration: line-through; }
.quiz-opt:disabled { cursor: default; opacity: 1; }
.quiz-fb { font-weight: 700; margin: 8px 0 0; min-height: 1.5em; }
.quiz-ex { background: var(--sky); border-radius: var(--radius-s); padding: 8px 12px; }
[data-age="kinder"] .quiz-opt { font-size: 1.2rem; padding: .8em 1em; }

.play-wrap h2 { margin-bottom: .3em; }
.isai-score, .m-score, .ch-score, .cl-score { font-weight: 700; }
.isai-list { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
@media (max-width: 640px) { .isai-list { grid-template-columns: 1fr; } }
.isai-item { display: grid; grid-template-columns: 48px 1fr; gap: 4px 10px; align-items: center; background: #fff; border: 2px solid var(--line); border-radius: var(--radius-s); padding: 10px; }
.isai-item .ill { width: 48px; height: 48px; grid-row: span 2; }
.isai-name { font-weight: 700; }
.isai-btns { display: flex; gap: 6px; flex-wrap: wrap; }
.isai-why { grid-column: 1 / -1; font-size: .9rem; }
.isai-item.right { border-color: var(--green-d); background: #F1FAF5; }
.isai-item.wrong { border-color: var(--pink); background: #FDF0F4; }
.match { display: grid; grid-template-columns: 1fr 1.6fr; gap: 12px; margin: 10px 0; }
.m-col { display: flex; flex-direction: column; gap: 8px; }
.m-item { font: inherit; text-align: left; background: #fff; border: 2px solid var(--line); border-radius: var(--radius-s); padding: 8px 12px; cursor: pointer; color: var(--ink); min-height: 56px; display: flex; align-items: center; gap: 8px; }
.m-left .ill { width: 48px; height: 48px; }
.m-item.sel { border-color: var(--blue-d); background: var(--sky); box-shadow: 0 0 0 3px rgba(112, 183, 232, .4); }
.m-item.done { background: var(--green); border-color: var(--green-d); cursor: default; }
.m-item.shake { animation: shake .35s; border-color: var(--pink); }
@keyframes shake { 25% { transform: translateX(-5px); } 75% { transform: translateX(5px); } }
.m-fb { font-weight: 700; min-height: 1.5em; }
.ch-q { border-top: 1px dashed var(--line); padding-top: 14px; margin-top: 14px; }

.age-pick h2 { margin-bottom: .2em; }
.age-pick .age-grid { margin-top: 14px; }

/* ---------- 教師、家長、關於 ---------- */
.lesson-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 16px; }
@media (max-width: 820px) { .lesson-list { grid-template-columns: 1fr; } }
.plan h4 { margin: 12px 0 4px; font-size: 1rem; color: var(--blue-ink); }
.plan-btns { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.pg-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px; }
.pg-item { background: var(--bg); border: 2px solid var(--line); border-radius: var(--radius-s); padding: 14px; }
.pg-item.current { border-color: var(--blue-d); background: var(--sky); }
.pg-item h3 { display: flex; align-items: center; gap: 6px; }
.pg-item h3 .ill { width: 36px; height: 36px; }
.checklist { list-style: none; padding: 0; }
.checklist li { margin-bottom: 8px; }
.checklist label { display: flex; gap: 10px; align-items: flex-start; cursor: pointer; }
.checklist input { width: 22px; height: 22px; flex: none; margin-top: .2em; accent-color: var(--blue-d); }
.talk { list-style: none; padding: 0; }
.talk li { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; padding: 10px 0; border-bottom: 1px dashed var(--line); font-weight: 600; }
.about .big { font-size: 1.2rem; font-weight: 700; }
.notice { background: #FFF6D6; border-left: 6px solid #F2CF6B; padding: 10px 14px; border-radius: 6px; }
.dirs li { margin-bottom: 6px; }

/* ---------- SVG 插圖顏色（由 CSS 控制，可依年齡層變化） ---------- */
.ill { display: block; }
.c-blue { fill: var(--i-blue); } .c-blue-d { fill: var(--i-blue-d); } .c-yellow { fill: var(--i-yellow); } .c-green { fill: var(--i-green); } .c-green-d { fill: var(--i-green-d); }
.c-pink { fill: var(--i-pink); } .c-ink { fill: var(--i-ink); } .c-ink-soft { fill: var(--i-ink-soft); } .c-white { fill: var(--i-white); } .c-face { fill: var(--i-face); }
.c-panel { fill: var(--i-panel); } .c-sky { fill: var(--i-sky); } .c-wall { fill: var(--i-wall); } .c-floor { fill: var(--i-floor); }
.c-skin { fill: var(--i-skin); } .c-skin2 { fill: var(--i-skin2); } .c-hair { fill: var(--i-hair); } .c-hair2 { fill: var(--i-hair2); }
.s-ink { stroke: var(--i-ink); } .s-ink-soft { stroke: var(--i-ink-soft); } .s-blue { stroke: var(--i-blue-d); } .s-pink { stroke: var(--i-pink); } .s-green { stroke: var(--i-green-d); }
.s-white { stroke: var(--i-white); } .s-yellow { stroke: var(--i-yellow); }
.limb { fill: none; stroke: var(--i-blue); stroke-width: 9; stroke-linecap: round; }
[data-age="senior"] .xx-g .c-white, [data-age="senior"] .xx .c-white { fill: #EAF4FB; }

/* 簡單動畫（尊重「減少動態」設定） */
@media (prefers-reduced-motion: no-preference) {
  .float { animation: float 4s ease-in-out infinite; transform-box: fill-box; }
  .spin { animation: spin 12s linear infinite; }
  .pulse { animation: pulse 2.4s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }
  .wave { animation: blinkw 1.6s ease-in-out infinite; }
}
@keyframes float { 50% { transform: translateY(-4px); } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pulse { 50% { transform: scale(1.18); } }
@keyframes blinkw { 50% { opacity: .3; } }

/* ---------- 列印 ---------- */
@media print {
  .site-header, .site-footer, .no-print, .speak-btn, .page-head-ill { display: none !important; }
  body { background: #fff !important; font-size: 12pt; }
  .card { box-shadow: none; border: 1px solid #ccc; break-inside: avoid; }
  body.print-one .lesson-list > :not(.print-target), body.print-one #app > .wrap > :not(.lesson-list), body.print-one .sec-title, body.print-one .page-head { display: none !important; }
  body.print-one .lesson-list { display: block; }
}
