﻿:root{
  --ink:#1B2233;--muted:#6B7280;--paper:#FBF7EF;--card:#FFFFFF;
  --navy:#182848;--navy2:#243B67;--gold:#F5B942;--gold2:#FFD77A;
  --coral:#F26B5E;--green:#2FA36B;--line:#E9E2D6;--soft:#F4EEE3;
  --num:"SFMono-Regular",Consolas,"Liberation Mono",monospace;
}
*{box-sizing:border-box;-webkit-tap-highlight-color:transparent}
html,body{margin:0;padding:0;background:#EFE9DE;color:var(--ink);font-family:"Segoe UI","PingFang SC","Microsoft YaHei",system-ui,sans-serif}
body{min-height:100vh}
button,input,select{font:inherit;color:inherit}
button{border:0;background:none;cursor:pointer}
input,select{outline:none}
#app{max-width:760px;margin:0 auto;min-height:100vh;background:var(--paper);box-shadow:0 0 60px rgba(24,40,72,.08)}
.hidden{display:none!important}
.spacer{flex:1}
.screen,.lesson-screen{min-height:100vh;display:flex;flex-direction:column;background:var(--paper)}
.scroll{flex:1;overflow:auto;padding:0 20px 90px}
.kick,.login-kicker{font-size:10px;letter-spacing:.22em;color:var(--gold);font-weight:800;text-transform:uppercase}

/* ---------- top bar ---------- */
.topbar{height:60px;display:flex;align-items:center;gap:12px;padding:0 18px;border-bottom:1px solid var(--line);background:rgba(251,247,239,.94);backdrop-filter:blur(12px);position:sticky;top:0;z-index:30}
.brand{display:flex;align-items:center;gap:10px;font-weight:800;letter-spacing:.04em}
.brand small{display:block;font-size:8px;color:var(--muted);letter-spacing:.18em;font-weight:600}
.mark{width:32px;height:32px;border-radius:9px;background:linear-gradient(145deg,var(--gold),#E09A20);color:var(--navy);display:grid;place-items:center;font-size:12px;font-weight:900;box-shadow:0 5px 14px rgba(224,154,32,.3)}
.icon-btn{width:38px;height:38px;border-radius:50%;display:grid;place-items:center;font-size:18px;background:#fff;border:1px solid var(--line)}
.bgm-toggle{color:var(--navy);font-size:17px;position:relative}
.bgm-toggle.on{background:var(--gold);border-color:var(--gold)}
.top-user{display:flex;align-items:center;gap:8px;font-size:12px;font-weight:600;padding:4px 6px 4px 12px;border-radius:99px;background:#fff;border:1px solid var(--line)}
.avatar-dot{width:27px;height:27px;border-radius:50%;background:var(--navy);color:var(--gold);display:grid;place-items:center;font-size:11px;font-weight:800}

/* ---------- map ---------- */
.hero{margin-top:16px;padding:22px;border-radius:22px;background:linear-gradient(135deg,var(--navy),var(--navy2));color:#fff;position:relative;overflow:hidden;box-shadow:0 16px 38px rgba(24,40,72,.18)}
.hero:after{content:"";position:absolute;width:160px;height:160px;border-radius:50%;background:radial-gradient(circle,rgba(245,185,66,.32),transparent 68%);right:-40px;top:-60px}
.hero-top{display:flex;justify-content:space-between;align-items:flex-start;gap:14px;position:relative;z-index:1}
.hero h1{font-size:28px;line-height:1.15;margin:0;letter-spacing:-.03em}
.hero p{font-size:11px;color:#CBD5E1;margin:8px 0 0}
.big-num{font-family:var(--num);font-size:31px;font-weight:800;color:var(--gold)}
.big-num small{font-size:11px;color:#CBD5E1;font-weight:500}
.bar{height:5px;background:rgba(255,255,255,.18);border-radius:99px;overflow:hidden;margin-top:18px}
.bar i{display:block;height:100%;background:linear-gradient(90deg,var(--gold),var(--gold2));border-radius:99px;transition:width .4s}
.bar.mini{margin-top:7px;background:#E9E2D6;height:4px}
.bar.mini i{background:var(--coral)}
.tabs{display:flex;border-bottom:1px solid var(--line);margin:0 -20px;padding:0 20px;position:sticky;top:60px;background:rgba(251,247,239,.96);backdrop-filter:blur(10px);z-index:20}
.tabs button{flex:1;padding:15px 0 13px;font-size:13px;color:var(--muted);border-bottom:2px solid transparent;margin-bottom:-1px;font-weight:600}
.tabs button.on{color:var(--ink);border-color:var(--gold)}
.vol{margin-top:24px}
.vol-head{display:flex;justify-content:space-between;align-items:baseline;margin-bottom:6px}
.vol-head h3{font-size:10px;letter-spacing:.18em;color:var(--muted);margin:0;font-weight:800;text-transform:uppercase}
.vol-head span{font-size:10px;color:#A39A88;font-family:var(--num)}
.lesson{display:grid;grid-template-columns:42px 1fr auto;gap:12px;align-items:center;padding:15px 0;border-bottom:1px solid var(--line);text-align:left;width:100%}
.lesson:active{opacity:.65}
.lesson .no{font-family:var(--num);font-size:12px;color:var(--gold);font-weight:800}
.lesson .tt{display:block;font-size:14px;font-weight:700;line-height:1.3}
.lesson .tg{display:block;font-size:10px;color:var(--muted);margin-top:4px}
.lesson .go{font-size:17px;color:var(--coral)}
.lesson.locked{opacity:.48}
.lock-ico{font-size:10px;padding:3px 7px;border-radius:99px;background:#EEE7DA;color:var(--muted)}
.sc{font-family:var(--num);font-size:12px;color:var(--green);font-weight:800}
.empty{padding:34px 10px;text-align:center;color:var(--muted);font-size:12px;line-height:1.8}
.bottom-nav{position:fixed;bottom:0;left:50%;transform:translateX(-50%);width:100%;max-width:760px;height:62px;display:flex;background:rgba(255,255,255,.96);border-top:1px solid var(--line);backdrop-filter:blur(14px);z-index:40}
.bottom-nav button{flex:1;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:3px;color:var(--muted);font-size:9px}
.bottom-nav button.on{color:var(--navy)}
.bottom-nav .ico{width:26px;height:26px;border-radius:8px;display:grid;place-items:center;background:var(--soft);font-size:11px;font-weight:800}
.bottom-nav button.on .ico{background:var(--gold);color:var(--navy)}

/* ---------- login ---------- */
.login{min-height:100vh;padding:42px 28px 36px;background:linear-gradient(160deg,#101B33 0%,#1B2B50 55%,#233A64 100%);color:#fff;position:relative;overflow:hidden;display:flex;flex-direction:column}
.login-orb{position:absolute;border-radius:50%;filter:blur(2px);pointer-events:none}
.login-orb.a{width:240px;height:240px;right:-90px;top:-80px;background:radial-gradient(circle,rgba(245,185,66,.28),transparent 68%)}
.login-orb.b{width:280px;height:280px;left:-140px;bottom:-100px;background:radial-gradient(circle,rgba(242,107,94,.2),transparent 68%)}
.login-head{position:relative;z-index:1;margin-top:28px}
.login-title{font-size:52px;line-height:1.02;margin:16px 0 18px;letter-spacing:-.06em;font-weight:800}
.login-title em{font-style:normal;color:var(--gold)}
.login-sub{font-size:13px;line-height:1.9;color:#CBD5E1;margin:0}
.role-switch{display:flex;background:rgba(255,255,255,.09);border-radius:12px;padding:4px;margin:30px 0 18px;position:relative;z-index:1}
.role-switch button{flex:1;padding:10px;border-radius:9px;font-size:12px;color:#CBD5E1;font-weight:700}
.role-switch button.on{background:var(--gold);color:var(--navy)}
.login form{position:relative;z-index:1}
.field{margin-bottom:13px}
.field label{display:block;font-size:10px;letter-spacing:.08em;color:#AAB6CC;margin-bottom:6px;font-weight:700}
.field input,.field select{width:100%;height:46px;border-radius:11px;border:1px solid rgba(255,255,255,.16);background:rgba(255,255,255,.08);color:#fff;padding:0 14px;font-size:14px}
.field input::placeholder{color:#7E8DA8}
.field select option{color:var(--ink)}
.pw-wrap{position:relative}
.pw-wrap input{padding-right:58px}
.pw-eye{position:absolute;right:8px;top:8px;height:30px;padding:0 10px;border-radius:8px;background:rgba(255,255,255,.12);color:#CBD5E1;font-size:10px}
.btn{min-height:48px;border-radius:12px;padding:0 18px;font-weight:800;font-size:14px;background:var(--navy);color:#fff;display:inline-flex;align-items:center;justify-content:center;gap:8px}
.btn.accent{background:linear-gradient(135deg,var(--gold),#E9A32C);color:var(--navy);box-shadow:0 10px 24px rgba(233,163,44,.28);width:100%}
.btn.ghost{background:#fff;color:var(--ink);border:1px solid var(--line);width:100%}
.btn.small{min-height:38px;padding:0 12px;font-size:11px;border-radius:9px;width:auto}
.register-tip{text-align:center;font-size:11px;color:#AAB6CC;margin-top:18px;position:relative;z-index:1}
.link-btn{color:var(--gold);font-weight:800;font-size:11px;margin-left:4px}
.demo-box{margin-top:16px;padding:10px 12px;border-radius:10px;background:rgba(245,185,66,.1);border:1px solid rgba(245,185,66,.25);font-size:10px;color:#CBD5E1;text-align:center;position:relative;z-index:1}
.demo-box b{color:var(--gold)}
.login-foot{margin-top:auto;padding-top:26px;text-align:center;font-size:9px;color:#72819E;line-height:1.8;position:relative;z-index:1}
.rule{height:1px;background:rgba(255,255,255,.12);margin:24px 0 20px}
.register .form-grid{display:grid;grid-template-columns:1fr 1fr;gap:12px}
.register .login-sub{font-size:12px;margin-top:4px}
.register .btn.accent{margin-top:6px}
/* ---------- lesson shell ---------- */
.lesson-top{height:64px;display:flex;align-items:center;gap:12px;padding:0 16px;border-bottom:1px solid var(--line);background:rgba(251,247,239,.95);position:sticky;top:0;z-index:30;backdrop-filter:blur(12px)}
.lesson-top .mid{flex:1;min-width:0}
.lesson-top .k{font-size:9px;letter-spacing:.1em;color:var(--gold);font-weight:800;text-transform:uppercase}
.lesson-top .t{font-size:14px;font-weight:800;margin-top:2px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.stage{flex:1;padding:16px 16px 110px;display:flex;flex-direction:column}
.lesson-foot{position:fixed;bottom:0;left:50%;transform:translateX(-50%);width:100%;max-width:760px;padding:12px 18px calc(12px + env(safe-area-inset-bottom));display:flex;align-items:center;justify-content:space-between;gap:12px;background:rgba(251,247,239,.96);border-top:1px solid var(--line);backdrop-filter:blur(12px);z-index:35}
.lesson-foot .count{font-family:var(--num);font-size:11px;color:var(--muted)}
.lesson-foot .btn{min-height:44px;min-width:130px;width:auto;padding:0 22px}
.scene{flex:1;display:flex;flex-direction:column;animation:slideUp .32s ease both}
@keyframes slideUp{from{opacity:0;transform:translateY(12px)}to{opacity:1;transform:none}}

/* ---------- cover / end ---------- */
.cover{background:linear-gradient(145deg,var(--navy),var(--navy2));border-radius:24px;padding:26px 24px 0;color:#fff;overflow:hidden;position:relative;min-height:500px;justify-content:flex-start}
.cover:before{content:"";position:absolute;inset:0;background:radial-gradient(circle at 80% 10%,rgba(245,185,66,.2),transparent 40%);pointer-events:none}
.cover .kick{position:relative;z-index:2}
.cover h2{font-size:34px;line-height:1.08;letter-spacing:-.04em;margin:14px 0 12px;position:relative;z-index:2}
.cover .sub{font-size:14px;color:#CBD5E1;position:relative;z-index:2}
.cover .meta{font-size:10px;color:#8FA0BE;margin-top:16px;position:relative;z-index:2}
.cover-cast{display:flex;justify-content:space-between;align-items:flex-end;margin-top:auto;position:relative;z-index:2}
.cover-cast .char{position:relative;height:210px;width:auto;animation:float 3.8s ease-in-out infinite}
.cover-cast .char:nth-child(2){animation-delay:.5s}
.cover-cast .char img{height:100%;width:auto;display:block;filter:drop-shadow(0 14px 20px rgba(0,0,0,.3))}
.end-scene{align-items:center;justify-content:center;text-align:center;background:linear-gradient(150deg,var(--navy),#2A4476);border-radius:24px;color:#fff;padding:30px 22px;min-height:480px;position:relative;overflow:hidden}
.end-cast{display:flex;justify-content:center;gap:6px;height:190px;margin-bottom:10px}
.end-cast .char{width:auto;height:100%}
.end-cast img{height:100%;width:auto}
.end-scene .ring{width:66px;height:66px;border-radius:50%;border:2px solid var(--gold);color:var(--gold);display:grid;place-items:center;font-family:var(--num);font-size:22px;font-weight:800;margin:0 auto 12px}
.end-scene h2{font-size:24px;margin:4px 0 8px}
.end-scene p{font-size:12px;color:#CBD5E1;margin:0}
@keyframes float{0%,100%{transform:translateY(0)}50%{transform:translateY(-8px)}}

/* ---------- dialogue ---------- */
.dialogue-scene{gap:10px}
.dlg-head{display:flex;align-items:flex-end;justify-content:space-between;gap:10px}
.dlg-head h3{font-size:18px;margin:3px 0 0;letter-spacing:-.02em}
.ghost-pill{font-size:10px;padding:6px 10px;border-radius:99px;border:1px solid var(--line);background:#fff;color:var(--muted)}
.dlg-stage{position:relative;height:300px;margin-top:4px;border-radius:20px;background:linear-gradient(180deg,#F2EBDD,#FBF7EF);overflow:hidden;border:1px solid var(--line)}
.dlg-stage:before{content:"";position:absolute;left:50%;bottom:-80px;width:340px;height:180px;transform:translateX(-50%);border-radius:50%;background:rgba(245,185,66,.14);filter:blur(10px)}
.dlg-bubble{position:relative;z-index:5;margin:16px 14px 0;background:#fff;border:1px solid var(--line);border-radius:18px;padding:12px 15px;box-shadow:0 10px 26px rgba(30,40,60,.09);min-height:96px;animation:bubbleIn .25s ease both}
.dlg-bubble.from-lily{margin-right:30%}
.dlg-bubble.from-trolli{margin-left:30%}
.dlg-bubble:after{content:"";position:absolute;bottom:-8px;width:16px;height:16px;background:#fff;border-right:1px solid var(--line);border-bottom:1px solid var(--line);transform:rotate(45deg)}
.dlg-bubble.from-lily:after{left:44px}
.dlg-bubble.from-trolli:after{right:44px}
@keyframes bubbleIn{from{opacity:0;transform:translateY(7px) scale(.98)}to{opacity:1;transform:none}}
.bubble-name{display:inline-block;font-size:9px;font-weight:900;letter-spacing:.08em;color:var(--navy);background:var(--gold);padding:3px 9px;border-radius:99px;margin-bottom:6px}
.bubble-en{font-size:16px;line-height:1.45;font-weight:800;letter-spacing:-.01em}
.bubble-zh{font-size:11px;color:var(--muted);margin-top:5px;line-height:1.5}
.char{position:absolute;bottom:-16px;height:170px;transition:transform .28s ease,opacity .28s ease,filter .28s ease;z-index:3}
.char img{height:100%;width:auto;display:block;filter:drop-shadow(0 10px 14px rgba(30,40,60,.18));transform-origin:bottom center}
.char-lily{left:2%}
.char-trolli{right:2%}
.char.active{transform:translateY(-8px) scale(1.05);filter:drop-shadow(0 0 14px rgba(245,185,66,.5));z-index:4}
.char:not(.active){opacity:.6;transform:translateY(8px) scale(.95)}
.dlg-lines{display:flex;flex-direction:column;gap:6px;max-height:200px;overflow:auto;padding-right:2px}
.dlg-line{display:flex;align-items:flex-start;gap:8px;text-align:left;padding:9px 10px;border-radius:11px;border:1px solid transparent;background:transparent}
.dlg-line.on{background:#fff;border-color:var(--line);box-shadow:0 5px 14px rgba(30,40,60,.05)}
.dlg-who{flex:none;font-size:8px;font-weight:900;padding:3px 6px;border-radius:6px;margin-top:1px}
.dlg-who.lily{background:#FDE4C9;color:#A74B20}
.dlg-who.trolli{background:#FFF0BD;color:#7A5A00}
.dlg-text{font-size:11px;line-height:1.45;color:#475467}
.dlg-play{flex:none;margin-left:auto;color:var(--gold);font-size:10px}
.dlg-controls{display:flex;gap:7px;flex-wrap:wrap;justify-content:center;padding-top:2px}
.dlg-controls .btn{flex:1;min-width:88px;min-height:40px;font-size:10px;padding:0 8px}
.dlg-audio{display:none}
/* ---------- board ---------- */
.board-scene{justify-content:center}
.board-scene h2{font-size:26px;letter-spacing:-.03em;margin:8px 0 18px}
.board-list{display:flex;flex-direction:column;gap:10px}
.board-item{display:grid;grid-template-columns:42px 1fr;gap:12px;align-items:center;background:#fff;border:1px solid var(--line);border-radius:14px;padding:13px 14px;box-shadow:0 6px 18px rgba(30,40,60,.04)}
.bk{width:38px;height:38px;border-radius:11px;background:linear-gradient(145deg,var(--gold),#E9A32C);color:var(--navy);display:grid;place-items:center;font-family:var(--num);font-size:11px;font-weight:900}
.board-item b{display:block;font-size:14px;line-height:1.35}
.board-item span{display:block;font-size:10px;color:var(--muted);margin-top:3px;line-height:1.5}

/* ---------- shadow ---------- */
.shadow-scene{justify-content:flex-start}
.shadow-scene h2{font-size:25px;letter-spacing:-.03em;margin:8px 0 6px}
.shadow-tip{font-size:11px;color:var(--muted);line-height:1.7;margin:0 0 14px}
.shadow-list{display:flex;flex-direction:column;gap:10px}
.shadow-card{background:#fff;border:1px solid var(--line);border-radius:15px;padding:13px 14px;box-shadow:0 6px 18px rgba(30,40,60,.04)}
.shadow-en{font-size:15px;font-weight:800;line-height:1.4}
.shadow-cn{font-size:10px;color:var(--muted);margin-top:4px}
.shadow-actions{display:flex;gap:7px;flex-wrap:wrap;margin-top:10px}
.shadow-actions .btn{min-height:34px;font-size:10px;padding:0 10px}
.shadow-result{display:flex;align-items:center;gap:8px;margin-top:9px;font-size:10px;color:var(--muted);flex-wrap:wrap}
.score{display:inline-block;font-family:var(--num);font-weight:900;font-size:11px;padding:3px 8px;border-radius:99px}
.score.good{background:#DDF5E8;color:#197A4A}
.score.mid{background:#FFF2CC;color:#8A6400}
.score.low{background:#FDE2DE;color:#B23A2E}

/* ---------- quote / recap ---------- */
.quote-scene,.recap-scene{justify-content:center;text-align:center;padding:20px}
.quote-mark{font-size:72px;line-height:.6;color:var(--gold);font-family:Georgia,serif}
.quote-scene blockquote{font-size:24px;line-height:1.4;font-weight:800;letter-spacing:-.03em;margin:18px 12px 14px}
.quote-scene .note{font-size:11px;color:var(--muted)}
.recap-card{background:linear-gradient(145deg,var(--navy),var(--navy2));color:#fff;border-radius:22px;padding:28px 22px;box-shadow:0 16px 36px rgba(24,40,72,.18)}
.recap-card h2{font-size:22px;margin:0 0 12px;color:var(--gold)}
.recap-card p{font-size:17px;line-height:1.6;font-weight:700;margin:0 0 12px}
.recap-card span{font-size:11px;color:#CBD5E1}
/* ---------- quiz ---------- */
.quiz{padding:22px 18px 120px;flex:1}
.q-kicker{font-size:9px;letter-spacing:.16em;color:var(--gold);font-weight:900;text-transform:uppercase}
.q-title{font-size:21px;line-height:1.45;font-weight:800;margin:10px 0 20px;letter-spacing:-.02em}
.q-options{display:flex;flex-direction:column;gap:9px}
.option{display:flex;align-items:center;gap:12px;text-align:left;background:#fff;border:1px solid var(--line);border-radius:13px;padding:13px 14px;font-size:13px;line-height:1.45;min-height:54px}
.option .l{flex:none;width:28px;height:28px;border-radius:8px;background:var(--soft);display:grid;place-items:center;font-family:var(--num);font-size:10px;font-weight:800;color:var(--muted)}
.option.correct{border-color:#75C79B;background:#F0FBF5}
.option.correct .l{background:var(--green);color:#fff}
.option.wrong{border-color:#F0A79F;background:#FFF5F3}
.option.wrong .l{background:var(--coral);color:#fff}
.option:disabled{opacity:1}
.feedback{margin-top:14px;padding:13px 15px;border-radius:12px;font-size:11px;line-height:1.65;background:#FFF5F3;border:1px solid #F3D3CD;color:#8F3A30}
.feedback.ok{background:#F0FBF5;border-color:#CBEBD9;color:#1E6F4B}
.feedback b{display:block;font-size:12px;margin-bottom:3px}
.dots{display:flex;gap:5px;margin-top:8px}
.dots i{height:3px;flex:1;border-radius:99px;background:#E5DDD0}
.dots i.done{background:var(--gold)}
.dots i.on{background:var(--coral)}

/* ---------- result ---------- */
.result{padding-top:18px}
.result-hero{display:flex;gap:16px;align-items:center;padding:20px;border-radius:20px;background:linear-gradient(145deg,var(--navy),var(--navy2));color:#fff}
.stamp{flex:none;width:82px;height:82px;border-radius:50%;border:2px solid var(--gold);display:flex;flex-direction:column;align-items:center;justify-content:center;color:var(--gold)}
.stamp b{font-family:var(--num);font-size:18px}
.stamp i{font-style:normal;font-size:8px;color:#CBD5E1;margin-top:2px}
.result-hero h2{font-size:23px;margin:0 0 6px}
.result-hero p{font-size:10px;line-height:1.7;color:#CBD5E1;margin:0}
.next-card{margin-top:14px;padding:16px;border-radius:16px;background:#fff;border:1px solid var(--line)}
.next-card .k{font-size:9px;color:var(--gold);font-weight:900;letter-spacing:.1em}
.next-card .t{font-size:17px;font-weight:800;margin-top:4px}
.next-card .d{font-size:10px;color:var(--muted);margin-top:4px}

/* ---------- me / teacher ---------- */
.profile{display:flex;align-items:center;gap:14px;padding:20px 0}
.profile .pic{width:58px;height:58px;border-radius:18px;background:linear-gradient(145deg,var(--gold),#E09A20);color:var(--navy);display:grid;place-items:center;font-size:22px;font-weight:900}
.profile h3{font-size:19px;margin:0}
.profile p{font-size:10px;color:var(--muted);margin:4px 0 0}
.section{margin-top:20px}
.section h2{font-size:14px;margin:0 0 10px;letter-spacing:.02em}
.stat-row{display:grid;grid-template-columns:repeat(3,1fr);gap:8px}
.stat{background:#fff;border:1px solid var(--line);border-radius:13px;padding:13px 8px;text-align:center}
.stat b{display:block;font-family:var(--num);font-size:18px}
.stat span{display:block;font-size:9px;color:var(--muted);margin-top:3px}
.notice{margin-top:16px;padding:12px 14px;border-radius:11px;background:var(--soft);font-size:10px;color:var(--muted);line-height:1.7}
.admin-row{display:flex;align-items:center;justify-content:space-between;gap:12px;width:100%;text-align:left;padding:13px 0;border-bottom:1px solid var(--line)}
.admin-row .nm{font-size:14px;font-weight:800}
.admin-row .meta{font-size:9px;color:var(--muted);margin-top:3px}
.admin-row .right{font-family:var(--num);font-size:11px;text-align:right;color:var(--navy);font-weight:800}
.admin-row .right span{font-family:inherit;font-size:9px;color:var(--coral);font-weight:700}
.mini-bar{height:4px;background:#EEE7DA;border-radius:99px;margin-top:7px;overflow:hidden}
.mini-bar i{display:block;height:100%;background:var(--gold);border-radius:99px}
.detail-list{background:#fff;border:1px solid var(--line);border-radius:14px;padding:0 13px}
.form-grid{display:grid;grid-template-columns:1fr 1fr;gap:10px}
.form-grid .full{grid-column:1/-1}
.section .field label{color:var(--muted)}
.section .field input,.section .field select{background:#fff;border-color:var(--line);color:var(--ink);height:42px;font-size:13px}
.toast{position:fixed;left:50%;bottom:calc(28px + env(safe-area-inset-bottom));transform:translate(-50%,16px);background:var(--navy);color:#fff;font-size:12px;padding:11px 16px;border-radius:10px;opacity:0;pointer-events:none;transition:.25s;z-index:99;max-width:82vw;text-align:center;line-height:1.5}
.toast.show{opacity:1;transform:translate(-50%,0)}

@media (min-width:720px){
  .dlg-stage{height:340px}
  .char{height:205px}
  .cover{min-height:560px}
  .cover-cast .char{height:250px}
}
@media (max-width:420px){
  .login{padding:32px 20px 30px}
  .login-title{font-size:44px}
  .hero h1{font-size:24px}
  .cover h2{font-size:29px}
  .dlg-bubble.from-lily{margin-right:12%}
  .dlg-bubble.from-trolli{margin-left:12%}
  .char{height:150px}
  .dlg-stage{height:270px}
  .q-title{font-size:19px}
  .dlg-controls .btn{min-width:72px}
}
/* character size balance */
.char-lily{left:2%;height:188px}
.char-trolli{right:2%;height:166px}
.cover-cast .char-lily{height:228px}
.cover-cast .char-trolli{height:202px}
.end-cast .char-lily{height:210px}
.end-cast .char-trolli{height:188px}
@media (max-width:420px){
  .char-lily{height:170px}
  .char-trolli{height:150px}
  .cover-cast .char-lily{height:205px}
  .cover-cast .char-trolli{height:182px}
}
/* lesson page strip */
.page-strip{display:flex;gap:6px;overflow-x:auto;padding:9px 16px;background:rgba(251,247,239,.96);border-bottom:1px solid var(--line);position:sticky;top:64px;z-index:29;scrollbar-width:none;backdrop-filter:blur(10px)}
.page-strip::-webkit-scrollbar{display:none}
.page-dot{flex:none;min-width:30px;height:25px;border-radius:8px;font-family:var(--num);font-size:9px;font-weight:800;color:var(--muted);background:#EFE8DC;border:1px solid transparent;transition:transform .2s,background .2s,color .2s}
.page-dot.done{color:var(--navy);background:#FFF3D5}
.page-dot.on{color:var(--navy);background:var(--gold);border-color:var(--gold);box-shadow:0 4px 10px rgba(245,185,66,.35);transform:translateY(-1px)}
/* end page + cover character positioning */
.end-scene{padding:34px 22px 48px;justify-content:center}
.end-cast{display:flex;justify-content:center;align-items:flex-end;gap:10px;height:220px;margin-bottom:18px;position:relative;z-index:2}
.end-cast .char{position:relative;bottom:auto;left:auto;right:auto;height:100%;width:auto;flex:none;transform:none;opacity:1}
.end-cast .char img{height:100%;width:auto;display:block;filter:drop-shadow(0 12px 18px rgba(0,0,0,.25))}
.cover-cast .char{position:relative;bottom:auto;left:auto;right:auto}
@media (max-width:420px){
  .end-cast{height:190px;margin-bottom:14px}
  .end-scene{padding:28px 18px 40px}
}
/* cover / end contrast: deep plum instead of navy */
.cover{background:linear-gradient(145deg,#241236 0%,#3B1F52 55%,#5A2E57 100%);border:1px solid rgba(245,185,66,.22);box-shadow:0 18px 42px rgba(36,18,54,.24)}
.cover:before{background:radial-gradient(circle at 82% 8%,rgba(245,185,66,.30),transparent 42%)}
.end-scene{background:linear-gradient(150deg,#241236 0%,#3B1F52 55%,#5A2E57 100%);border:1px solid rgba(245,185,66,.22);box-shadow:0 18px 42px rgba(36,18,54,.2)}
/* fit 12 page dots on a phone */
.page-strip{gap:5px;padding:9px 14px}
.page-dot{min-width:28px}
/* Trolli speaking close-up */
.char-trolli img.grin{height:100%;width:auto;aspect-ratio:1;object-fit:cover;border-radius:50%;border:3px solid var(--gold);box-shadow:0 0 0 4px rgba(245,185,66,.18),0 12px 26px rgba(36,18,54,.3);background:#1c2638;filter:none;animation:talkBob .26s ease-in-out infinite alternate}
@keyframes talkBob{from{transform:scale(1) rotate(-1deg)}to{transform:scale(1.04) rotate(1deg)}}
/* ---------- 9:16 phone stage ---------- */
html,body{height:100%}
body{display:flex;align-items:center;justify-content:center;background:#0d0912;overflow:hidden}
#app{
  width:min(100vw, calc(100dvh * 9 / 16));
  height:min(100dvh, calc(100vw * 16 / 9));
  min-height:0;max-width:none;position:relative;overflow:hidden;
  box-shadow:0 24px 80px rgba(0,0,0,.45);border-radius:0;
}
.screen,.lesson-screen{min-height:100%;height:100%}
.scroll{height:100%;overflow-y:auto}
.login{min-height:100%;height:100%;overflow-y:auto}
.bottom-nav,.lesson-foot{position:absolute;left:0;right:0;bottom:0;transform:none;width:auto;max-width:none}
.lesson-screen{overflow:hidden}
.stage{min-height:0;overflow-y:auto}
.quiz{overflow-y:auto}
.page-strip{top:64px}
@media (min-width:720px){#app{border-radius:18px}}
/* 9:16 compact tweaks */
.page-strip{gap:4px;padding:9px 12px}
.page-dot{min-width:26px}
@media (max-height:760px){
  .dlg-stage{height:232px}
  .char-lily{height:150px}
  .char-trolli{height:132px}
  .dlg-lines{max-height:86px}
  .dlg-bubble{min-height:78px;padding:9px 12px}
  .bubble-en{font-size:14px}
  .bubble-zh{font-size:10px}
  .dlg-controls .btn{min-height:34px}
  .stage{padding-bottom:82px}
}
