/* PUPU 星光画布 · 低刺激图形界面设计系统
 * 原则：大触控目标、少文字、柔和低饱和、圆润无锐角、动效可一键关闭。 */
/* 色值与 palette.js 的 clinical 色板一致：低饱和、低对比、无饱和红、无强光斑。
   依据 ITU-R BT.1702-2 / WCAG 2.3.1 / ASD 光色系统综述，见 COLORS-医学依据.md。
   JS 会在启动时按孩子档案覆盖这些变量，这里是 JS 未加载时的安全兜底。 */
:root{
  --cream:#F7F4EE; --card:#FCFAF6; --ink:#3C464A; --muted:#79837F;
  --mint:#AFC7B6; --sky:#B7CBD8; --peach:#E0C9C0; --coral:#D8AFA8;
  --sun:#D9C79B; --lav:#C9C3D4; --line:#E4DFD5; --accent:#8FAE9B;
  --sprite-tint:#F1EADB; --sprite-accent:#8FA9B7;
  --shadow:0 10px 26px rgba(80,92,88,.07);
  --shadow-sm:0 5px 14px rgba(80,92,88,.06);
  --r:28px; --r-sm:18px;
  --font:"PingFang SC","Microsoft YaHei","Noto Sans CJK SC",system-ui,-apple-system,sans-serif;
}
*{box-sizing:border-box;-webkit-tap-highlight-color:transparent}
/* 平板触控规范：禁用长按菜单/双击缩放/橡皮筋，保留系统缩放能力（无障碍） */
html,body{margin:0;padding:0;min-height:100%;
  -webkit-touch-callout:none;-webkit-user-select:none;user-select:none;
  overscroll-behavior:none;-webkit-overflow-scrolling:touch}
button,a,select,input{touch-action:manipulation}
input,select{-webkit-user-select:text;user-select:text}
body{
  font-family:var(--font); color:var(--ink); background:var(--cream);
  background-image:radial-gradient(circle at 12% 8%,rgba(175,199,182,.16),transparent 34%),
                   radial-gradient(circle at 88% 12%,rgba(224,201,192,.14),transparent 32%),
                   radial-gradient(circle at 50% 100%,rgba(183,203,216,.12),transparent 42%);
  background-attachment:fixed; font-size:18px; line-height:1.5;
}
button{font-family:inherit;font-size:inherit;color:inherit;cursor:pointer;border:0;background:none}
button:focus-visible{outline:4px solid #F5A65B;outline-offset:3px}
svg{display:block;width:100%;height:100%}
.hidden{display:none !important}

/* ---------- 布局 ---------- */
#app{min-height:100vh;padding-bottom:132px}
.topbar{
  position:sticky;top:0;z-index:30;display:flex;align-items:center;justify-content:space-between;
  gap:14px;padding:12px 26px;background:rgba(255,249,242,.90);backdrop-filter:blur(10px);
  border-bottom:1px solid var(--line);min-height:78px;
}
.tb-left,.tb-right{display:flex;align-items:center;gap:10px;flex-wrap:wrap}
.tb-child{display:flex;align-items:center;gap:12px}
.tb-avatar{width:52px;height:52px;border-radius:18px;display:flex;align-items:center;justify-content:center;padding:7px;box-shadow:var(--shadow-sm)}
.tb-name{font-size:21px;font-weight:700;letter-spacing:.5px}
.tb-pill{display:flex;align-items:center;gap:7px;padding:8px 16px;border-radius:999px;background:#fff;box-shadow:var(--shadow-sm);font-weight:700;font-size:17px}
.tb-pill svg{width:24px;height:24px}
.icon-btn{width:52px;height:52px;border-radius:18px;background:#fff;box-shadow:var(--shadow-sm);padding:12px;transition:transform .18s}
.icon-btn:hover{transform:translateY(-2px)}
.icon-btn.on{background:var(--mint)}
.main{max-width:1240px;margin:0 auto;padding:26px 26px 10px}
.view{animation:fadein .32s ease both}
@keyframes fadein{from{opacity:0;transform:translateY(10px)}to{opacity:1;transform:none}}
.view-head{display:flex;align-items:flex-end;justify-content:space-between;gap:16px;flex-wrap:wrap;margin-bottom:22px}
.view-title{font-size:30px;font-weight:800;margin:0;letter-spacing:1px}
.view-sub{font-size:16px;color:var(--muted);margin:6px 0 0}
.bottomnav{
  position:fixed;left:50%;bottom:18px;transform:translateX(-50%);z-index:35;
  display:flex;gap:12px;padding:12px 18px;border-radius:34px;background:rgba(255,255,255,.96);
  box-shadow:0 16px 40px rgba(80,100,110,.16);border:1px solid var(--line);
}
.nav-btn{width:96px;min-height:88px;border-radius:24px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:4px;padding:8px;color:var(--muted);font-size:14px;font-weight:700;transition:transform .18s,background .18s}
.nav-btn svg{width:38px;height:38px}
.nav-btn:hover{transform:translateY(-3px)}
.nav-btn.active{background:var(--mint);color:var(--ink)}
.nav-btn.small{width:76px;min-height:76px}

/* ---------- 通用块 ---------- */
.card{background:var(--card);border-radius:var(--r);box-shadow:var(--shadow);padding:24px}
.big-btn{
  min-height:88px;min-width:96px;padding:16px 26px;border-radius:var(--r-sm);
  background:#fff;box-shadow:var(--shadow-sm);font-weight:800;font-size:20px;
  display:inline-flex;align-items:center;justify-content:center;gap:12px;transition:transform .18s,box-shadow .18s;
}
.big-btn svg{width:38px;height:38px}
.big-btn:hover{transform:translateY(-3px);box-shadow:var(--shadow)}
.big-btn.primary{background:var(--mint);color:var(--ink)}
.big-btn.warm{background:var(--peach)}
.big-btn.sky{background:var(--sky)}
.big-btn.ghost{border:2px dashed var(--line);box-shadow:none;background:rgba(255,255,255,.55)}
.big-btn.round{width:112px;height:112px;border-radius:50%;padding:0;flex-direction:column;font-size:16px}
.big-btn:disabled{opacity:.5;cursor:not-allowed;transform:none}
.row{display:flex;gap:14px;flex-wrap:wrap;align-items:center}
.grid{display:grid;gap:18px}
.tag{display:inline-flex;align-items:center;gap:6px;padding:5px 12px;border-radius:999px;background:var(--cream);font-size:14px;color:var(--muted);font-weight:600}
.muted{color:var(--muted)}
.tiny{font-size:14px}

/* ---------- 选择孩子 ---------- */
.child-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(230px,1fr));gap:22px}
.child-card{
  background:#fff;border-radius:32px;box-shadow:var(--shadow);padding:26px 20px;
  display:flex;flex-direction:column;align-items:center;gap:14px;min-height:270px;
  transition:transform .2s,box-shadow .2s;position:relative;overflow:hidden;
}
.child-card:hover{transform:translateY(-5px);box-shadow:0 20px 42px rgba(90,105,115,.16)}
.child-card::before{content:"";position:absolute;inset:0 0 auto 0;height:9px;background:var(--cc,#A8E6CF)}
.child-avatar{width:132px;height:132px;border-radius:50%;padding:16px;background:var(--cc,#A8E6CF);box-shadow:inset 0 -8px 18px rgba(255,255,255,.5)}
.child-name{font-size:26px;font-weight:800}
.child-tags{display:flex;gap:8px;flex-wrap:wrap;justify-content:center}
.add-child{border:3px dashed var(--line);background:rgba(255,255,255,.6);box-shadow:none;justify-content:center}
.add-child svg{width:78px;height:78px}

/* ---------- 今日首页 ---------- */
.hello-card{display:flex;align-items:center;gap:22px;padding:26px 30px;background:linear-gradient(120deg,#FFF3E2,#F3FBF6);border-radius:var(--r);box-shadow:var(--shadow);margin-bottom:24px}
.hello-ico{width:98px;height:98px;flex:0 0 98px}
.hello-txt h2{margin:0 0 6px;font-size:28px}
.hello-txt p{margin:0;color:var(--muted);font-size:17px}
.schedule{display:flex;gap:14px;flex-wrap:wrap;margin-bottom:26px}
.sched-item{
  position:relative;display:flex;flex-direction:column;align-items:center;gap:8px;
  width:132px;padding:16px 10px;border-radius:24px;background:#fff;box-shadow:var(--shadow-sm);
  font-weight:700;font-size:16px;
}
.sched-item svg{width:56px;height:56px}
/* 当前这一件事只用静态描边标出：不呼吸、不循环缩放 */
.sched-item.now{outline:4px solid var(--sun);outline-offset:3px}
.sched-item.done{opacity:.62}
.sched-item.done::after{content:"";position:absolute;top:8px;right:10px;width:24px;height:24px;border-radius:50%;background:var(--mint)}
.nav-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(210px,1fr));gap:20px}
.nav-card{display:flex;flex-direction:column;align-items:center;gap:12px;padding:28px 18px;border-radius:30px;background:#fff;box-shadow:var(--shadow);min-height:210px;transition:transform .2s}
.nav-card:hover{transform:translateY(-5px)}
.nav-card svg{width:82px;height:82px}
.nav-card b{font-size:21px}

/* ---------- 说说话 ---------- */
.talk-grid{display:grid;grid-template-columns:minmax(300px,1fr) minmax(320px,1.2fr);gap:22px}
.target-card{display:flex;flex-direction:column;align-items:center;gap:10px;padding:24px;border-radius:var(--r);background:linear-gradient(160deg,#FFF6E9,#FFFFFF);box-shadow:var(--shadow)}
.target-ico{width:150px;height:150px}
.target-word{font-size:34px;font-weight:800;letter-spacing:2px}
.mic-wrap{display:flex;flex-direction:column;align-items:center;gap:14px;padding:22px}
.mic-btn{
  width:186px;height:186px;border-radius:50%;background:var(--coral);color:#fff;
  display:flex;align-items:center;justify-content:center;padding:38px;box-shadow:0 14px 34px rgba(255,138,146,.4);
  transition:transform .2s;
}
.mic-btn:hover{transform:scale(1.04)}
/* 正在听＝静态换底色 + 静态描边，绝不一圈圈扩散 */
.mic-btn.listening{background:#E9A6A6;outline:5px solid var(--sun);outline-offset:4px}
.mic-btn svg{width:100%;height:100%}
.mic-hint{font-size:17px;color:var(--muted);text-align:center}
.aac-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(118px,1fr));gap:14px}
.aac-card{
  background:#fff;border-radius:22px;box-shadow:var(--shadow-sm);padding:14px 10px;
  display:flex;flex-direction:column;align-items:center;gap:6px;font-weight:700;font-size:17px;min-height:132px;
  transition:transform .16s,background .16s;
}
.aac-card:hover{transform:translateY(-3px);background:#FFF6E9}
.aac-card svg{width:66px;height:66px}
.aac-card.sel{background:var(--mint)}
.feedback{border-radius:var(--r);padding:22px;background:#fff;box-shadow:var(--shadow);margin-top:18px}
.fb-praise{font-size:22px;font-weight:800;margin-bottom:12px}
.fb-model{display:flex;align-items:center;gap:14px;padding:14px 18px;border-radius:20px;background:var(--cream);font-size:21px;font-weight:700}
.fb-model svg{width:52px;height:52px;flex:0 0 52px}
.fb-model .mini-btn.ok{margin-left:auto}
.choice-row{display:flex;gap:14px;flex-wrap:wrap;margin-top:14px}
.star-badge{display:inline-flex;align-items:center;gap:8px;padding:8px 16px;border-radius:999px;background:#FFF3D6;font-weight:800}
.star-badge svg{width:26px;height:26px}

/* ---------- 图形画布 ---------- */
.studio{display:grid;grid-template-columns:190px minmax(0,1fr);gap:20px}
.tray{display:flex;flex-direction:column;gap:10px;max-height:560px;overflow:auto;padding:4px}
.tray-item{
  display:flex;align-items:center;gap:10px;padding:10px 12px;border-radius:18px;background:#fff;
  box-shadow:var(--shadow-sm);font-weight:700;cursor:grab;min-height:72px;
}
.tray-item svg{width:52px;height:52px;flex:0 0 52px}
.tray-item:hover{background:#FFF6E9}
.stage-wrap{display:flex;flex-direction:column;gap:14px}
.canvas-stage{
  position:relative;width:100%;aspect-ratio:16/9;border-radius:var(--r);
  background:linear-gradient(160deg,#FFFDF8,#F2F7F5);border:3px dashed #DCCFC0;
  box-shadow:var(--shadow);overflow:hidden;touch-action:none;
}
.canvas-stage.dragover{border-color:var(--mint);background:#F1FBF6}
.stage-empty{position:absolute;inset:0;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:10px;color:var(--muted);pointer-events:none}
.stage-empty svg{width:90px;height:90px;opacity:.6}
.scene-item{position:absolute;width:96px;height:96px;transform:translate(-50%,-50%);cursor:grab;filter:drop-shadow(0 8px 10px rgba(70,80,90,.16));transition:transform .12s}
.scene-item:active{cursor:grabbing}
.scene-item:hover{transform:translate(-50%,-50%) scale(1.07)}
.scene-item .del{position:absolute;top:-6px;right:-6px;width:28px;height:28px;border-radius:50%;background:#fff;box-shadow:var(--shadow-sm);padding:5px;opacity:0}
.scene-item:hover .del{opacity:1}
.style-row{display:flex;gap:12px;flex-wrap:wrap}
.style-card{display:flex;flex-direction:column;align-items:center;gap:4px;padding:10px 16px;border-radius:20px;background:#fff;box-shadow:var(--shadow-sm);font-weight:700;min-width:92px}
.style-card svg{width:44px;height:44px}
.style-card.sel{outline:4px solid var(--sun);outline-offset:2px}
.action-row{display:flex;gap:14px;align-items:center;flex-wrap:wrap;margin-top:6px}
.result-card{margin-top:20px;display:none}
.result-card.show{display:block;animation:pop .4s ease both}
@keyframes pop{from{opacity:0;transform:scale(.96)}to{opacity:1;transform:none}}
.result-img{width:100%;border-radius:22px;box-shadow:var(--shadow);display:block}

/* ---------- 作品册 ---------- */
.works-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(260px,1fr));gap:20px}
.work-card{background:#fff;border-radius:24px;box-shadow:var(--shadow);overflow:hidden}
.work-card img{width:100%;display:block;aspect-ratio:16/9;object-fit:cover}
.work-meta{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:14px 16px}
.work-empty{text-align:center;padding:70px 20px;color:var(--muted)}

/* ---------- 老师面板 ---------- */
.teacher-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(330px,1fr));gap:20px}
.panel{background:#fff;border-radius:var(--r);box-shadow:var(--shadow);padding:22px}
.panel h3{margin:0 0 14px;font-size:20px}
.form-row{display:flex;align-items:center;justify-content:space-between;gap:14px;padding:10px 0;border-bottom:1px solid var(--line);flex-wrap:wrap}
.form-row:last-child{border-bottom:0}
.form-row label{font-weight:700;min-width:110px}
input[type=text],input[type=number],input[type=password],select{
  font-family:inherit;font-size:17px;padding:10px 14px;border:2px solid var(--line);border-radius:14px;background:var(--cream);max-width:220px;
}
input[type=range]{width:190px;accent-color:#7EC8E3}
.pinpad{display:grid;grid-template-columns:repeat(3,1fr);gap:10px;max-width:280px;margin:0 auto}
.pin-key{min-height:64px;border-radius:18px;background:var(--cream);font-size:24px;font-weight:800;box-shadow:var(--shadow-sm)}
.pin-key:hover{background:var(--mint)}
.pin-dots{text-align:center;font-size:30px;letter-spacing:10px;margin:12px 0 18px;min-height:40px}
.chip{display:inline-flex;align-items:center;gap:6px;padding:8px 14px;border-radius:999px;background:var(--cream);font-weight:700;font-size:15px}
.chip svg{width:22px;height:22px}
.word-row,.corr-row,.model-row{display:flex;align-items:center;gap:12px;padding:10px 0;border-bottom:1px solid var(--line);flex-wrap:wrap}
.word-row svg,.corr-row svg{width:40px;height:40px;flex:0 0 40px}
.mastery-bar{flex:1;min-width:100px;height:12px;border-radius:99px;background:var(--cream);overflow:hidden}
.mastery-bar i{display:block;height:100%;background:var(--mint);border-radius:99px}
.report-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(140px,1fr));gap:12px}
.stat{background:var(--cream);border-radius:18px;padding:14px;text-align:center;min-width:0}
.stat b{display:block;font-size:26px;line-height:1.15;overflow-wrap:anywhere}
.stat span{display:block;font-size:13px;color:var(--muted);line-height:1.3;margin-top:2px}
/* 老师在窄面板里看的状态卡：字小一点，但绝不允许数字与标签粘成一行 */
.veil-teacher .report-grid{grid-template-columns:repeat(auto-fit,minmax(104px,1fr));gap:8px}
.veil-teacher .stat{padding:10px 8px;border-radius:14px}
.veil-teacher .stat b{font-size:19px}
.veil-teacher .stat span{font-size:12px}
.mini-btn{padding:8px 14px;border-radius:14px;background:var(--cream);font-weight:700;font-size:15px}
.mini-btn.ok{background:var(--mint)}
.mini-btn.warn{background:#FFE2E2}

/* ---------- 引导 / 强化 / 提示 ---------- */
.guide-bubble{
  position:fixed;top:86px;left:50%;transform:translateX(-50%);z-index:60;
  width:min(540px,calc(100% - 40px));margin:0;
  display:flex;gap:12px;align-items:center;padding:10px 16px;border-radius:24px;
  background:rgba(252,250,246,.97);box-shadow:0 12px 30px rgba(80,100,110,.14);
  border:3px solid var(--accent);
  animation:slidedown .3s ease both;
}
@keyframes slidedown{from{opacity:0;transform:translate(-50%,-8px)}to{opacity:1;transform:translate(-50%,0)}}
.guide-ico{width:48px;height:48px;flex:0 0 48px}
.guide-text{font-size:18px;font-weight:700;margin-bottom:10px}
.guide-actions{display:flex;gap:10px}
.gbtn{display:inline-flex;align-items:center;gap:6px;padding:9px 14px;border-radius:14px;background:var(--cream);font-weight:700;font-size:15px}
.gbtn svg{width:24px;height:24px}
.gbtn.primary{background:var(--mint)}
.guide-target{position:relative;outline:4px solid var(--accent);outline-offset:4px;border-radius:20px;z-index:5}
.guide-target-strong{outline-width:7px;animation:none !important}
/* 只做轻度遮挡：保留一点原来的画面，避免孩子觉得整个屏幕突然消失 */
.overlay{position:fixed;inset:0;z-index:80;background:rgba(255,249,242,.64);backdrop-filter:blur(4px);display:flex;align-items:center;justify-content:center;padding:20px}
.modal{background:#fff;border-radius:32px;box-shadow:0 24px 60px rgba(80,100,110,.24);padding:30px;max-width:520px;width:100%;text-align:center}
.modal h2{margin:10px 0 6px;font-size:26px}
.modal p{color:var(--muted);margin:0 0 20px}
.modal-ico{width:110px;height:110px;margin:0 auto}
.reinforce{text-align:center;animation:pop .45s ease both}
.reinforce .modal-ico{width:160px;height:160px}
.toast{position:fixed;left:50%;top:96px;transform:translateX(-50%);z-index:90;padding:14px 26px;border-radius:999px;background:#fff;box-shadow:var(--shadow);font-weight:700}

/* ---------- 低刺激模式 ---------- */
body.low-stimulus *{animation:none !important;transition:none !important;box-shadow:none !important}
body.low-stimulus{background-image:none;background:#FBF7F0}
body.low-stimulus .card,body.low-stimulus .panel,body.low-stimulus .child-card,
body.low-stimulus .nav-card,body.low-stimulus .aac-card,body.low-stimulus .big-btn,
body.low-stimulus .bottomnav,body.low-stimulus .canvas-stage{border:2px solid #E3D9CB}
body.low-stimulus .mic-btn{background:#E9A6A6}
body.low-stimulus .sched-item.now{outline:3px solid #E9C77A}
body.low-stimulus .guide-bubble{border-color:#E9C77A}

/* ---------- 响应式 ---------- */
@media(max-width:900px){
  .talk-grid{grid-template-columns:1fr}
  .studio{grid-template-columns:1fr}
  .tray{flex-direction:row;max-height:none;overflow-x:auto}
  .tray-item{flex-direction:column;min-width:86px;text-align:center}
  .main{padding:18px 16px 10px}
  .topbar{padding:10px 16px}
  .view-title{font-size:25px}
}
@media(max-width:560px){
  .bottomnav{gap:4px;padding:8px;bottom:10px}
  .nav-btn{width:70px;min-height:72px;font-size:12px}
  .nav-btn svg{width:30px;height:30px}
  .guide-bubble{top:76px;width:calc(100% - 20px);margin:0}
  .mic-btn{width:150px;height:150px;padding:30px}
  .tb-name{font-size:18px}
}
@media(prefers-reduced-motion:reduce){*{animation:none !important;transition:none !important}}

/* ================= 医学安全覆盖（优先级最高） =================
   零闪烁：删除所有循环亮度/缩放动画。WCAG 2.3.1 要求 ≤3 次/秒，
   ITU-R BT.1702-2 特别禁止饱和红闪烁；这里更保守——完全没有闪烁，
   状态变化只靠「静态」底色 / 边框 / 图标，一次性的淡入不算 flash。 */
.sched-item.now,.mic-btn.listening,.guide-target-strong,.reinforce .modal-ico{animation:none !important}
.mic-btn.listening{background:var(--coral);outline:6px solid var(--sun);outline-offset:4px}
.guide-target-strong{outline-width:8px}
.result-card.show{animation:fadein .3s ease both}
@keyframes pop{from{opacity:0}to{opacity:1}}
body{background-attachment:scroll}

/* ---- 意图猜想：多图形方案选择 ---- */
.intent-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(210px,1fr));gap:20px;margin-top:18px}
.intent-card{
  background:var(--card);border-radius:30px;box-shadow:var(--shadow);
  min-height:238px;padding:22px 16px;display:flex;flex-direction:column;
  align-items:center;justify-content:center;gap:10px;transition:none;
  border:3px solid transparent;
}
.intent-card:hover{border-color:var(--line)}
.intent-card.focus{outline:7px solid var(--sun);outline-offset:4px;border-color:var(--sun)}
.intent-card.chosen{background:var(--mint)}
.intent-ico{width:118px;height:118px;flex:0 0 118px}
.intent-label{font-size:24px;font-weight:800}
.intent-group{font-size:14px;color:var(--muted)}
.choice-bar{display:flex;gap:14px;flex-wrap:wrap;align-items:center;margin-top:20px}
.scan-btn{min-height:88px;padding:14px 26px;border-radius:24px;background:var(--sky);font-weight:800;font-size:20px}
.palette-grid{display:flex;gap:12px;flex-wrap:wrap;margin-top:12px}
.palette-card{display:flex;align-items:center;gap:10px;padding:12px 16px;border-radius:20px;background:var(--card);border:3px solid transparent;min-height:72px;font-weight:700}
.palette-card.sel{border-color:var(--accent)}
.swatch{width:40px;height:40px;border-radius:12px;flex:0 0 40px;border:1px solid var(--line)}
.link-row{display:flex;gap:12px;flex-wrap:wrap;align-items:center;margin-top:14px}
.link-dot{width:14px;height:14px;border-radius:50%;background:var(--mint);display:inline-block}
.link-dot.off{background:var(--line)}

/* ---- iPad / 安卓平板：安全区、触控目标、横屏 ----
   触控目标全部 ≥88px，高于 Apple HIG 44pt 与 Material 48dp 的建议值；
   相邻目标间距 ≥12px，避免误触。不禁用系统缩放（无障碍要求）。 */
.topbar{padding-top:calc(12px + env(safe-area-inset-top,0px));
  padding-left:calc(26px + env(safe-area-inset-left,0px));
  padding-right:calc(26px + env(safe-area-inset-right,0px))}
.bottomnav{bottom:calc(18px + env(safe-area-inset-bottom,0px))}
#app{padding-bottom:calc(132px + env(safe-area-inset-bottom,0px))}
button{min-height:48px}
.tray-item,.aac-card,.intent-card,.big-btn,.nav-btn,.style-card{min-height:88px}
@media (orientation:landscape) and (max-height:640px){
  .main{padding-top:14px}
  .hello-card{padding:16px 22px}
  .hello-ico{width:72px;height:72px;flex-basis:72px}
  .mic-btn{width:140px;height:140px;padding:28px}
  .intent-card{min-height:190px}
  .intent-ico{width:88px;height:88px;flex-basis:88px}
  .guide-bubble{top:76px}
}

/* 「选一选」压缩纵向占用：主操作栏与底部导航必须同屏可见 */
.view-choose .view-head{margin-bottom:14px}
.view-choose .hello-card{padding:16px 22px;margin-bottom:14px}
.view-choose .hello-ico{width:72px;height:72px;flex-basis:72px}
.view-choose .hello-txt h2{font-size:24px}
.view-choose .intent-grid{margin-top:12px;gap:14px}
.view-choose .intent-card{min-height:188px;padding:14px 12px}
.view-choose .intent-ico{width:92px;height:92px;flex-basis:92px}
.view-choose .intent-label{font-size:22px}
.view-choose .choice-bar{margin-top:12px}

/* 图标尺寸兜底：全局 svg{width:100%} 在按钮里必须被显式约束，否则会被撑成大方块 */
.scan-btn{display:inline-flex;align-items:center;justify-content:center;gap:10px}
.scan-btn svg{width:32px;height:32px;flex:0 0 32px}
.mini-btn svg{display:inline-block;width:22px;height:22px;flex:0 0 22px;vertical-align:-5px}

/* ================= 陪伴精灵向导 =================
   孩子二选一后浮层只出现一个精灵；介绍气泡固定顶部，不遮挡主操作；
   精灵本体 pointer-events:none，绝不拦住孩子的点击。零循环闪烁动画。 */
.sprite-layer{
  position:fixed;inset:0;z-index:55;pointer-events:none;
  padding-top:env(safe-area-inset-top,0px);
}
.sprite-figure{
  position:absolute;left:12px;top:140px;width:124px;height:158px;
  pointer-events:none;transform-origin:50% 100%;
  transition:left .65s ease,top .65s ease;
  filter:drop-shadow(0 10px 16px rgba(80,100,110,.16));
}
.sprite-figure svg{display:block;width:100%;height:100%}
.sprite-figure img{display:block;width:100%;height:100%;object-fit:contain;user-select:none;-webkit-user-drag:none}
.sprite-bubble{
  /* 靠左且背景不吃点击：孩子照样能点到被气泡「盖住」的功能按钮 */
  position:fixed;top:calc(92px + env(safe-area-inset-top,0px));
  left:calc(16px + env(safe-area-inset-left,0px));
  transform:none;z-index:62;pointer-events:none;
  width:min(400px,calc(100% - 32px));
  /* 完全不透明：被高亮放大的卡片不会从气泡背后透出文字，孩子只读这一句 */
  background:#FCFAF6;border:3px solid var(--sprite-accent);
  border-radius:26px;padding:10px 16px 12px;
  box-shadow:0 14px 34px rgba(80,100,110,.14);
}
.sprite-bubble button,.sprite-bubble input{pointer-events:auto}
.sb-head{display:flex;align-items:center;gap:10px;flex-wrap:wrap;margin-bottom:8px}
.sb-name{display:inline-flex;align-items:center;gap:6px;font-weight:800;font-size:18px;color:var(--ink)}
.sb-name svg{width:22px;height:22px;flex:0 0 22px}
.sb-board{font-size:14px;color:var(--muted);font-weight:700}
.sb-close{
  margin-left:auto;width:44px;height:44px;border-radius:14px;background:var(--cream);
  font-size:26px;line-height:1;color:var(--muted);font-weight:700;
}
.sb-body{display:flex;flex-direction:column;gap:4px}
.sb-title{display:flex;align-items:center;gap:8px;font-size:19px;font-weight:800}
.sb-title svg{width:26px;height:26px;flex:0 0 26px}
.sb-text{font-size:16px;color:var(--muted);line-height:1.5}
.sb-actions{display:flex;gap:10px;flex-wrap:wrap;margin-top:10px}
.sb-actions .gbtn{min-height:48px}
.sprite-name-panel{margin-top:10px;padding:12px;border-radius:18px;background:var(--cream)}
.snp-label{font-size:15px;font-weight:700;margin-bottom:8px}
.sprite-quick-row{display:flex;gap:8px;flex-wrap:wrap}
.sprite-quick{
  display:inline-flex;align-items:center;gap:6px;min-height:48px;padding:6px 12px;
  border-radius:14px;background:#fff;font-weight:700;font-size:16px;
}
.sprite-quick svg{width:26px;height:26px;flex:0 0 26px}
.sprite-quick:hover{background:var(--sprite-tint)}
.sprite-name-row{display:flex;gap:10px;flex-wrap:wrap;margin-top:10px}
#sprite-name-input{
  flex:1;min-width:160px;min-height:48px;padding:8px 14px;border-radius:14px;
  border:2px solid var(--line);background:#fff;font-size:17px;font-family:inherit;
}

/* 被介绍到的功能：加框 + 改底色 + 放大 10%（三者同时生效） */
.sprite-focus{
  position:relative;z-index:6;
  outline:5px solid var(--sprite-accent);outline-offset:5px;border-radius:22px;
  background:var(--sprite-tint) !important;
  /* !important 挡住 :hover 的 translateY，保证放大 10% 始终稳定 */
  transform:scale(1.1) !important;transform-origin:center;
  transition:transform .3s ease,background-color .3s ease,outline-color .3s ease;
}
body[data-sprite-who="girl"] .sprite-bubble{border-color:#C9A19B}

/* 说说话页：这一页的主人是「孩子的语言」，气泡必须让位。
   缩到 300px、去掉大段说明，只留一句动作指令。 */
body[data-view="talk"] .sprite-bubble{width:min(300px,calc(100% - 32px));padding:8px 12px 10px;border-radius:20px}
/* 只留「一句动作指令」：标题、长说明、次要按钮全部收起，避免同一句话说两遍 */
body[data-view="talk"] .sprite-bubble .sb-title{display:none}
body[data-view="talk"] .sprite-bubble .sb-text{display:none}
body[data-view="talk"] .sprite-bubble .sb-more{display:none}
body[data-view="talk"] .sprite-bubble .sb-step{font-size:16px;margin-top:2px}

/* 欢迎页：两个精灵只在这里同时出现，供孩子二选一 */
.sprite-pick-box{margin-top:26px;padding:22px;border-radius:var(--r);background:var(--card);box-shadow:var(--shadow)}
.sprite-pick-box h3{margin:0 0 6px;font-size:22px}
.sprite-pick-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(220px,1fr));gap:18px;margin-top:16px}
.sprite-pick-card{
  display:flex;flex-direction:column;align-items:center;gap:8px;
  min-height:230px;padding:16px;border-radius:26px;background:#fff;border:4px solid var(--line);
  box-shadow:var(--shadow-sm);font-weight:700;
}
.sprite-pick-card.sel{border-color:var(--accent);background:var(--cream)}
.sprite-pick-art{width:96px;height:120px}
.sprite-pick-art svg{display:block;width:100%;height:100%}
.sprite-pick-art img{display:block;width:100%;height:100%;object-fit:contain;user-select:none;-webkit-user-drag:none}
.sprite-pick-name{font-size:21px;font-weight:800}
.sprite-pick-wand{display:flex;align-items:center;gap:6px;font-size:15px;color:var(--muted)}
.sprite-pick-wand svg{width:22px;height:56px;flex:0 0 22px}
.sprite-name-box{margin-top:18px;padding:16px;border-radius:22px;background:var(--cream)}
.sprite-name-box>label{display:block;font-weight:800;font-size:18px;margin-bottom:10px}
.sprite-settings{margin-top:14px;padding:14px;border-radius:20px;background:var(--cream)}
.sprite-settings .row{margin-top:10px}
.sprite-settings .big-btn svg{width:22px;height:52px;flex:0 0 22px}
.sprite-settings input{min-height:48px;padding:8px 14px;border-radius:14px;border:2px solid var(--line);background:#fff;font-size:17px;font-family:inherit}

@media (max-width:560px){
  .sprite-figure{width:96px;height:122px}
  .sprite-bubble{top:calc(78px + env(safe-area-inset-top,0px));width:calc(100% - 32px);padding:10px 14px}
  /* 精灵页在窄屏要整体压缩，否则「开始」按钮会被小头像行挤到屏外 */
  .sprite-stage{padding:2px 0;overflow-y:auto}
  .sprite-stage .sprite-pick-box{padding:8px 8px 6px}
  .sprite-stage .sprite-pick-grid{gap:8px}
  .sprite-stage .sprite-pick-card{padding:4px 3px 6px;border-width:3px;border-radius:18px}
  .sprite-stage .sprite-pick-art{width:clamp(64px,9.5vh,92px);height:clamp(80px,12vh,116px)}
  .sprite-stage .sprite-pick-name{font-size:17px}
  .sprite-stage .sprite-pick-wand{font-size:11px}
  .sprite-stage .sprite-pick-wand svg{width:13px;height:30px;flex:0 0 13px}
  .sprite-stage .sprite-name-box{margin-top:6px;padding:6px 8px;border-radius:16px}
  .sprite-stage .sprite-name-box>label{font-size:12px;margin-bottom:4px}
  .sprite-stage .sprite-quick-row{gap:6px}
  .sprite-stage .sprite-quick{min-height:34px;font-size:11px;padding:2px 7px}
  .sprite-stage .sprite-quick svg{width:16px;height:16px}
  /* 窄屏把名字快捷选项收成横向一行（可左右滑），省下两行高度给开始按钮 */
  .sprite-stage .sprite-quick-row{flex-wrap:nowrap;overflow-x:auto;gap:6px;padding-bottom:2px}
  .sprite-stage .sprite-quick{flex:0 0 auto}
  .sprite-stage .sprite-name-row{margin-top:5px;gap:6px}
  .sprite-stage .sprite-name-row .big-btn{min-height:40px;font-size:13px;padding:4px 8px}
  .sprite-stage .sprite-pick-name{font-size:15px}
  .sprite-stage .sprite-pick-wand{font-size:10px}
  .sprite-start{margin-top:8px;min-height:50px;font-size:16px}
  .sprite-start-row .sprite-start{font-size:14px}
}
@media (orientation:landscape) and (max-height:640px){
  .sprite-bubble{top:calc(78px + env(safe-area-inset-top,0px))}
  .sprite-figure{width:96px;height:122px}
}

/* ===== 开场问好 / 一步一动作引导 =====
   低饱和、零循环动画；两张大图卡 ≥88px 适合平板触摸；
   提示层级只加静态描边与底色，绝不闪烁、绝不用高亮红。 */
/* 问好时把背景柔和淡下去，减少同时出现的可点元素；遮罩不吃点击 */
/* 问好不再把整页淡掉：一机一号后第二次打开是「直接进工作页」，
   背景必须一直是画布本身，否则看起来像又进了一个新页面。
   只在精灵附近的对话气泡上做视觉聚焦，画面其余部分保持原样。 */
.sprite-layer.greeting::before{
  content:'';position:absolute;inset:0;
  background:transparent;pointer-events:none;
}
.sprite-bubble.greeting{width:min(480px,calc(100% - 32px))}

/* ===== 精灵温柔出场（一次性，≤0.5s）=====
   只改 opacity + translateY：淡入 + 缓慢上移。
   没有缩放弹跳、没有旋转、没有闪光、没有循环，避免光敏性风险。
   每次问好 / 第一次选定伙伴 / 从休息中唤醒时由 sprite.js 重播一次。 */
@keyframes sprite-arrive{
  from{opacity:0;transform:translateY(14px)}
  to{opacity:1;transform:translateY(0)}
}
@keyframes sprite-veil{from{opacity:0}to{opacity:1}}
.sprite-figure.sp-arrive{animation:sprite-arrive .46s cubic-bezier(.22,.61,.36,1) both}
.sprite-bubble.sp-arrive{animation:sprite-arrive .44s cubic-bezier(.22,.61,.36,1) both}
.sprite-layer.sp-arrive.greeting::before{animation:sprite-veil .42s ease both}
/* 医学安全：低刺激 / 系统「减少动态效果」连一次性动画也不播（含 ::before 伪元素） */
body.low-stimulus .sprite-layer::before,
body.low-stimulus .sprite-layer.sp-arrive::before{animation:none !important}
@media(prefers-reduced-motion:reduce){
  .sprite-layer::before,.sprite-layer.sp-arrive::before{animation:none !important}
}

/* ============================================================
   精灵动作库（2026-11-15）
   —— 全部一次性、单方向、低幅度。只动 opacity / transform。
      绝无循环播放、无闪烁、无旋转多次、无缩放弹跳。
      由 sprite.js 的 playMotion() 统一派发，并且受「动画预算」限制：
      同一时刻只播一个动作，两次动作间隔 ≥900ms。
   每条都带 low-stimulus / prefers-reduced-motion 的关闭规则。
   ============================================================ */

/* ① 入场：首次确认页两选一，左右错开依次上浮（孩子先看左、再看右） */
@keyframes sp-in-left{
  from{opacity:0;transform:translateY(12px) translateX(-6px)}
  to{opacity:1;transform:none}
}
@keyframes sp-in-right{
  from{opacity:0;transform:translateY(12px) translateX(6px)}
  to{opacity:1;transform:none}
}
.sprite-pick-card.pick-in-left{animation:sp-in-left .42s cubic-bezier(.22,.61,.36,1) both}
.sprite-pick-card.pick-in-right{animation:sp-in-right .42s .12s cubic-bezier(.22,.61,.36,1) both}

/* ② 选定：被选中的轻轻下一沉（像点头答应），未选中的淡一点 */
@keyframes sp-chosen{
  0%{transform:translateY(0)}
  55%{transform:translateY(4px)}
  100%{transform:translateY(0)}
}
.sprite-pick-card.pick-chosen{animation:sp-chosen .34s ease both}
.sprite-pick-card.pick-unsel{opacity:.55;transition:opacity .3s ease}

/* ③ 答题：做对时点一次头（下沉 4px 回位，绝不跳起、绝不闪） */
@keyframes sp-nod{
  0%{transform:translateY(0)}
  50%{transform:translateY(4px)}
  100%{transform:translateY(0)}
}
.sprite-figure.sp-nod{animation:sp-nod .34s ease both}

/* ④ 等待：孩子没反应时身体前倾 2px，表示「我还在等你」（不催、不重复喊） */
@keyframes sp-lean{
  from{transform:translateY(0)}
  to{transform:translateY(-2px)}
}
.sprite-figure.sp-lean{animation:sp-lean .3s ease both;animation-fill-mode:forwards}

/* ⑤ 点错：歪一下头 2.5° 再回正，表示「我们一起再看看」（不判错） */
@keyframes sp-tilt{
  0%{transform:rotate(0)}
  45%{transform:rotate(-2.5deg)}
  100%{transform:rotate(0)}
}
.sprite-figure.sp-tilt{animation:sp-tilt .36s ease both}

/* ⑥ 换形象：老师改性别 / 改名字后交叉淡换，避免突然换脸 */
@keyframes sp-swap{
  from{opacity:0}
  to{opacity:1}
}
.sprite-figure.sp-swap{animation:sp-swap .4s ease both}

/* ⑦ 休息：淡出 + 轻轻下沉（不是瞬间消失） */
@keyframes sp-rest{
  from{opacity:1;transform:translateY(0)}
  to{opacity:0;transform:translateY(10px)}
}
.sprite-figure.sp-rest{animation:sp-rest .38s ease both;animation-fill-mode:forwards}

/* ⑧ 到达：切板块滑行结束时的轻微一顿（不硬着陆），只改位移、不改尺寸 */
@keyframes sp-settle{
  0%{transform:translateY(0)}
  40%{transform:translateY(2px)}
  100%{transform:translateY(0)}
}
.sprite-figure.sp-settle{animation:sp-settle .26s ease both}

/* 医学安全总闸：低刺激 / 减少动态效果下，动作库一律不播 */
body.low-stimulus .sprite-figure,
body.low-stimulus .sprite-pick-card,
body.low-stimulus .sprite-pick-card.pick-in-left,
body.low-stimulus .sprite-pick-card.pick-in-right,
body.low-stimulus .sprite-pick-card.pick-chosen{animation:none !important}
body.low-stimulus .sprite-figure.sp-rest{opacity:0}
body.low-stimulus .sprite-pick-card.pick-unsel{opacity:1}
@media(prefers-reduced-motion:reduce){
  .sprite-figure,.sprite-figure.sp-nod,.sprite-figure.sp-lean,.sprite-figure.sp-tilt,
  .sprite-figure.sp-swap,.sprite-figure.sp-settle,
  .sprite-pick-card.pick-in-left,.sprite-pick-card.pick-in-right,
  .sprite-pick-card.pick-chosen{animation:none !important}
  .sprite-figure.sp-rest{animation:none !important;opacity:0}
  .sprite-pick-card.pick-unsel{opacity:1}
}
.sb-greet{display:flex;flex-direction:column;gap:10px}
.sg-lines{display:flex;flex-direction:column;gap:2px}
.sg-line{font-size:20px;font-weight:800;color:var(--ink);line-height:1.35}
.sg-choices{display:grid;grid-template-columns:1fr 1fr;gap:12px;margin-top:4px}
.sg-choice{
  display:flex;flex-direction:column;align-items:center;justify-content:center;gap:4px;
  min-height:96px;padding:10px;border-radius:20px;
  border:3px solid var(--line);background:var(--card);
  text-align:center;cursor:pointer;
}
.sg-choice:hover{background:var(--cream);border-color:var(--accent)}
.sg-choice svg{width:38px;height:38px;flex:0 0 38px}
.sg-choice b{font-size:18px;font-weight:800;color:var(--ink);white-space:nowrap}
.sg-choice span{font-size:13px;color:var(--muted);line-height:1.3}
.sb-step{
  display:flex;align-items:center;gap:8px;
  font-size:20px;font-weight:800;color:var(--ink);line-height:1.35;
  padding:8px 12px;border-radius:14px;background:var(--cream);
}
.sb-step svg{width:26px;height:26px;flex:0 0 26px}
.sb-step-strong{outline:3px solid var(--sprite-accent);outline-offset:2px;background:var(--sprite-tint)}
.sb-more{display:flex;gap:8px;flex-wrap:wrap;margin-top:8px;padding-top:8px;border-top:1px solid var(--line)}
.sb-more .gbtn.mini{min-height:40px;padding:4px 10px;font-size:14px;border-radius:12px}
.sb-more .gbtn.mini svg{width:18px;height:18px;flex:0 0 18px}
@media (max-width:560px){
  .sg-choices{grid-template-columns:1fr}
  .sg-choice{min-height:84px}
  .sg-line{font-size:18px}
  .sb-step{font-size:18px}
}

/* ===== AI 文生图：两类画面 / 语音加料 / 等待 / 结果 ===== */
.cat-row{display:flex;align-items:center;gap:14px;flex-wrap:wrap;margin:0 0 16px}
.cat-label{font-size:18px;font-weight:800;color:var(--ink)}
.cat-card{
  min-width:210px;min-height:96px;flex:0 1 240px;
  display:flex;align-items:center;gap:12px;padding:14px 18px;
  border-radius:22px;border:3px solid var(--line);background:var(--card);
  cursor:pointer;text-align:left;
  transition:transform .2s ease,border-color .2s ease;
}
.cat-card svg{width:52px;height:52px;flex:0 0 52px}
.cat-card b{display:block;font-size:20px;font-weight:800;color:var(--ink);white-space:nowrap}
.cat-card span{display:block;font-size:14px;color:var(--muted);margin-top:2px;white-space:nowrap}
.cat-card.sel{border-color:var(--accent);background:var(--cream);transform:scale(1.04)}
.cat-card:active{transform:scale(1.02)}

.say-row{display:flex;align-items:center;gap:12px;flex-wrap:wrap;margin:12px 0}
.say-row .big-btn{min-height:64px;font-size:17px}
.say-row .big-btn svg{width:26px;height:26px;flex:0 0 26px}

.ai-wait{display:flex;align-items:center;gap:18px;margin:0 0 16px;padding:18px 22px;border-radius:24px}
.ai-wait svg{width:76px;height:76px;flex:0 0 76px}
.ai-wait b{display:block;font-size:22px;color:var(--ink)}
.ai-wait span{display:block;color:var(--muted);font-size:16px;margin-top:4px}

.ai-chip{display:inline-block;padding:6px 14px;border-radius:999px;font-size:15px;font-weight:700;margin-bottom:12px}
.ai-chip.ok{background:#E3EEE7;color:#4F7162}
.ai-chip.local{background:#F1E9DC;color:#8A735A}
.ai-spec{font-size:17px;color:var(--muted);margin:10px 0 4px}
.prompt-fold{margin:10px 0 0;font-size:14px;color:var(--muted)}
.prompt-fold summary{cursor:pointer;padding:6px 0;min-height:32px}
.prompt-fold code{display:block;white-space:pre-wrap;word-break:break-word;background:var(--cream);padding:12px;border-radius:14px;font-size:13px;line-height:1.6;color:var(--ink)}
.result-video{width:100%;max-height:420px;border-radius:20px;margin-top:12px;background:#EDE7E4}
.big-btn[disabled]{opacity:.62;cursor:default;transform:none}
.bridge-state{display:flex;gap:12px;flex-wrap:wrap;margin:14px 0}
.chip.ok{background:#E3EEE7;color:#4F7162}

@media (max-width:560px){
  .cat-card{min-width:150px;min-height:84px;padding:10px 12px}
  .cat-card svg{width:40px;height:40px;flex:0 0 40px}
  .cat-card b{font-size:17px}
}

/* ==================================================================
   一屏画布工作台（最高优先级覆盖）
   不翻页、不滚屏：所有孩子功能常驻在同一块屏幕画布上；
   结果 / 画册 / 方案 / 反馈都是「画布内的一张卡片」，页面本体永不切换。
   连续闪烁一律删除；只在孩子主动切换区域或出现新结果时柔和提示一次。
   ================================================================== */
html,body{height:100%;overflow:hidden}
#app{
  height:100vh;height:100dvh;display:grid;
  grid-template-rows:auto minmax(0,1fr) auto;
  padding:0;overflow:hidden;
}
.topbar{
  position:relative;top:auto;min-height:56px;padding:6px 16px;
  padding-top:calc(6px + env(safe-area-inset-top,0px));
  padding-left:calc(16px + env(safe-area-inset-left,0px));
  padding-right:calc(16px + env(safe-area-inset-right,0px));
  backdrop-filter:none;background:rgba(255,249,242,.96);
}
.tb-avatar{width:40px;height:40px;border-radius:14px;padding:6px}
.tb-name{font-size:18px}
.tb-pill{padding:5px 12px;font-size:15px}
.tb-pill svg{width:20px;height:20px}
.icon-btn{width:42px;height:42px;border-radius:14px;padding:9px}
.main{
  position:relative;width:100%;max-width:none;margin:0;min-height:0;overflow:hidden;
  display:grid;grid-template-rows:auto minmax(0,1fr);gap:8px;padding:8px 12px;
}

/* 今日一条：问候 + 视觉日程 + 大图入口，压在一行，不滚动 */
.daystrip{
  display:flex;align-items:center;gap:8px;min-height:0;overflow:hidden;
  background:var(--card);border-radius:20px;padding:5px 9px;box-shadow:var(--shadow-sm);
}
.daystrip .hello-card{
  display:flex;align-items:center;gap:9px;margin:0;padding:4px 12px;flex:0 0 auto;
  min-height:52px;border-radius:16px;background:linear-gradient(120deg,#FFF3E2,#F3FBF6);box-shadow:none;
}
.daystrip .hello-ico{width:36px;height:36px;flex:0 0 36px}
.daystrip .day-txt h2{margin:0;font-size:16px;white-space:nowrap}
.daystrip .day-txt p{margin:0;font-size:12px;color:var(--muted);white-space:nowrap}
.daystrip .schedule{display:flex;gap:6px;flex-wrap:nowrap;margin:0;flex:1;min-width:0;overflow:hidden}
.daystrip .sched-item{
  width:auto;min-width:56px;max-width:110px;flex:1 1 0;padding:4px 6px;gap:2px;
  min-height:52px;border-radius:14px;font-size:12px;box-shadow:none;
  outline-width:2px;outline-offset:1px;
}
.daystrip .sched-item svg{width:26px;height:26px}
.daystrip .sched-item.done::after{width:12px;height:12px;top:5px;right:6px}
.daystrip .nav-grid{display:flex;gap:6px;flex:0 0 auto;grid-template-columns:none}
.daystrip .nav-card{
  min-height:52px;width:56px;padding:4px;gap:2px;border-radius:14px;
  box-shadow:none;border:2px solid var(--line);
}
.daystrip .nav-card svg{width:26px;height:26px}
.daystrip .nav-card b{font-size:11px;white-space:nowrap}

/* 三栏工作台：左工具 / 中画布 / 右说话，全部同屏常驻 */
.desk{
  display:grid;grid-template-columns:minmax(150px,15%) minmax(0,1fr) minmax(240px,22%);
  gap:10px;min-height:0;height:100%;
}
.zone{
  min-height:0;overflow:hidden;border-radius:22px;
  background:rgba(255,255,255,.55);border:2px solid var(--line);
  padding:8px;display:flex;flex-direction:column;gap:6px;
}
.zone.zone-stage{position:relative;padding:0;background:#FFFDF8}
.zone h3.zh{font-size:13px;font-weight:800;color:var(--muted);margin:0;letter-spacing:.5px}
.zone.focus{border-color:var(--accent)}
/* 偶尔一次：孩子主动换区域时，这一块柔和变一下底色，只播 1 次、不循环 */
.zone.soft-once{animation:soft-once .55s ease 1 both}
@keyframes soft-once{
  0%{background-color:rgba(255,255,255,.55)}
  45%{background-color:#E7F0EA}
  100%{background-color:rgba(255,255,255,.55)}
}
@keyframes fadein-once{from{opacity:0;transform:translateY(8px)}to{opacity:1;transform:none}}

/* 左：素材 / 两类画面 / 风格 / 语音 / 主操作 */
.tray{
  display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:5px;
  max-height:none;overflow:hidden;padding:0;flex:0 0 auto;
}
.tray-item{min-height:50px;padding:5px 7px;gap:5px;border-radius:12px;font-size:13px;display:flex;align-items:center}
.tray-item svg{width:32px;height:32px;flex:0 0 32px}
.tray-item span{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
/* 两类画面竖排各占一行：窄栏里「照片一样的」也能完整显示，不被裁字 */
.cat-row{display:flex;flex-direction:column;gap:5px;margin:0;flex-wrap:nowrap}
.cat-label{display:none}
.cat-card{min-width:0;flex:0 0 auto;min-height:52px;padding:6px 8px;gap:6px;border-radius:14px;border-width:2px}
.cat-card svg{width:28px;height:28px;flex:0 0 28px}
.cat-card b{font-size:14px}
.cat-card span{display:none}
.cat-card.sel,.cat-card:active{transform:none}
.style-row{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:5px;flex-wrap:nowrap}
.style-card{min-width:0;min-height:48px;padding:4px 2px;border-radius:12px;font-size:11px;gap:0}
.style-card svg{width:26px;height:26px}
.style-card.sel{outline-width:2px;outline-offset:1px}
.say-row{margin:0;gap:6px;flex-wrap:nowrap}
.say-row .big-btn{min-height:48px;min-width:0;flex:1;font-size:13px;padding:6px 10px}
.say-row .big-btn svg{width:20px;height:20px;flex:0 0 20px}
.say-row .tiny,.say-row .tag,.say-row .mini-btn{display:none}
.action-row{margin:0;gap:6px;flex-wrap:nowrap}
.action-row .big-btn{min-height:52px;min-width:0;flex:1;font-size:14px;padding:6px 8px;white-space:nowrap}
.action-row .big-btn svg{width:24px;height:24px;flex:0 0 24px}
.action-row .tag{display:none}

/* 中：一整块画纸，永远在背后 */
.canvas-stage{
  width:100%;height:100%;flex:1;min-height:0;aspect-ratio:auto;
  border-radius:20px;border-width:2px;
}
.stage-empty svg{width:56px;height:56px}
.stage-empty span{font-size:15px}
.scene-item{width:64px;height:64px}
.scene-item .del{width:24px;height:24px}
/* 画布内卡片层：结果 / 画册 / 方案 / 反馈都在这同一块画布里，不换页 */
.stage-overlay{
  position:absolute;inset:0;z-index:8;padding:10px;overflow:hidden;
  border-radius:20px;background:rgba(252,250,246,.97);
  display:flex;flex-direction:column;gap:8px;
}
.overlay-card{
  flex:1;min-height:0;overflow:hidden;background:var(--card);
  border-radius:18px;padding:10px 14px;box-shadow:var(--shadow-sm);
  display:flex;flex-direction:column;gap:8px;
}
.overlay-card.stage-card-in{animation:fadein-once .42s ease 1 both}
.overlay-head{display:flex;align-items:center;gap:8px;flex:0 0 auto}
.overlay-head b{font-size:17px;font-weight:800}
.overlay-head .big-btn{min-height:44px;min-width:0;font-size:13px;padding:4px 12px;margin-left:auto}
.overlay-head .big-btn svg{width:20px;height:20px;flex:0 0 20px}
.result-card{margin:0;display:none;flex:1;min-height:0;overflow:hidden;padding:0;background:none;box-shadow:none}
.result-card.show{display:flex;flex-direction:column;animation:fadein-once .42s ease 1 both}
.result-card h3{font-size:17px;margin:0 0 4px}
.result-img{width:100%;height:auto;max-height:calc(100% - 96px);object-fit:contain;border-radius:14px}
.result-card .action-row{flex-wrap:wrap;flex:0 0 auto}
.result-card .action-row .big-btn{min-height:48px;font-size:14px;padding:6px 12px;flex:0 1 auto}
.result-card .action-row .big-btn svg{width:22px;height:22px}
.prompt-fold{overflow:hidden;max-height:56px;margin:2px 0 0}
.ai-spec{font-size:13px;margin:4px 0 0}
.ai-wait{padding:10px 14px;margin:0;border-radius:16px;flex:0 0 auto}
.ai-wait svg{width:44px;height:44px;flex:0 0 44px}
.ai-wait b{font-size:16px}.ai-wait span{font-size:13px}

/* 画册卡 / 方案卡 / 反馈卡，都在画布内 */
.works-grid{grid-template-columns:repeat(auto-fill,minmax(170px,1fr));gap:8px;margin:0;overflow:hidden;flex:1;align-content:start}
.work-card img{aspect-ratio:16/9}
.work-meta{padding:6px 10px;font-size:12px;flex-wrap:wrap}
.work-meta .mini-btn{font-size:11px;padding:4px 7px}
.work-empty{padding:12px;flex:1;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:8px}
.work-empty svg{width:56px !important;height:56px !important;margin:0}
.work-empty .big-btn{min-height:48px;font-size:14px;padding:6px 14px}
.zone-head{
  display:flex;align-items:center;gap:8px;padding:6px 10px;border-radius:14px;
  background:linear-gradient(120deg,#FFF3E2,#F3FBF6);flex:0 0 auto;
}
.zone-head .hello-ico{width:32px;height:32px;flex:0 0 32px}
.zone-head .hello-txt h2{margin:0;font-size:15px}
.zone-head .hello-txt p{margin:0;font-size:12px;color:var(--muted)}
.intent-grid{grid-template-columns:repeat(auto-fit,minmax(128px,1fr));gap:8px;margin:0;flex:1;align-content:start;overflow:hidden}
.intent-card{min-height:180px;padding:8px 6px;border-radius:18px;gap:4px}
.intent-ico{width:62px;height:62px;flex:0 0 62px}
.intent-label{font-size:16px;text-align:center}
.intent-group{font-size:11px;text-align:center}
.choice-bar{margin:0;gap:6px;flex:0 0 auto;flex-wrap:nowrap;overflow:hidden}
.choice-bar .big-btn,.choice-bar .scan-btn{min-height:48px;min-width:0;flex:1;font-size:13px;padding:6px 8px}
.choice-bar .scan-btn svg{width:20px;height:20px;flex:0 0 20px}
.link-note{margin:0;padding:6px 10px;border-radius:12px;background:var(--cream);font-size:11px;color:var(--muted)}
.feedback{margin:0;padding:8px 12px;border-radius:16px;flex:0 0 auto}
.fb-praise{font-size:16px;margin-bottom:4px}
.fb-model{padding:6px 10px;font-size:15px;gap:8px}
.fb-model svg{width:32px;height:32px;flex:0 0 32px}
.feedback .choice-row{gap:6px;margin-top:6px}
.feedback .aac-card{min-height:56px;padding:4px;font-size:12px}
.feedback .aac-card svg{width:30px;height:30px}
.feedback .row{margin-top:4px}

/* 右：说话常驻（目标词 / 麦克风 / AAC 图卡 / 组成句子 / 帮我选） */
.zone-side .target-card{padding:5px;gap:3px;border-radius:14px;background:none;box-shadow:none;flex:0 0 auto}
.zone-side .target-ico{width:52px;height:52px}
.zone-side .target-word{font-size:20px;letter-spacing:1px}
.zone-side .target-card .big-btn{min-height:44px;font-size:13px;padding:4px 10px}
.zone-side .target-card .big-btn svg{width:20px;height:20px}
.zone-side .mic-wrap{padding:3px;gap:3px;flex:0 0 auto}
.zone-side .mic-btn{width:86px;height:86px;padding:18px}
.zone-side .mic-hint{font-size:12px}
.zone-side h3.zh{margin:2px 0}
.aac-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:6px}
.aac-card{min-height:66px;padding:5px 6px;border-radius:14px;font-size:13px;gap:2px}
.aac-card svg{width:34px;height:34px}
.zone-side .row{margin-top:4px;gap:4px;flex-wrap:nowrap;overflow:hidden}
.zone-side .tag{font-size:11px;padding:3px 8px;white-space:nowrap}
.zone-side .mini-btn{font-size:12px;padding:5px 8px;white-space:nowrap}
.zone-side .big-btn{min-height:48px;min-width:0;flex:1;font-size:13px;padding:5px 8px;white-space:nowrap}
.zone-side .big-btn svg{width:22px;height:22px;flex:0 0 22px}
/* 右栏两个操作按钮竖排各占一行，文字不再被窄栏裁掉 */
.zone-side .row.side-actions{flex-direction:column;align-items:stretch;gap:5px}
.zone-side .row.side-actions .big-btn{width:100%;flex:0 0 auto;min-height:46px;font-size:12px;padding:4px 6px}
.zone-side .row.side-actions .big-btn svg{width:20px;height:20px;flex:0 0 20px}
.zone-side .fb-model{font-size:13px;padding:5px 8px;gap:6px;flex-wrap:wrap}
.zone-side .fb-model svg{width:26px;height:26px;flex:0 0 26px}
.zone-side .fb-model .big-btn{min-height:40px;font-size:12px}

/* 底部区域带：静态一行，点它只「聚焦」当前那块，不换页、不滚动 */
.bottomnav{
  position:relative;left:auto;bottom:auto;transform:none;z-index:35;
  display:flex;justify-content:center;gap:6px;flex-wrap:nowrap;overflow:hidden;
  margin:0;padding:6px 12px;border-radius:0;
  padding-bottom:calc(6px + env(safe-area-inset-bottom,0px));
  background:rgba(255,255,255,.96);border:0;border-top:1px solid var(--line);box-shadow:none;
}
.nav-btn{
  width:auto;min-width:72px;max-width:150px;flex:1 1 0;min-height:58px;
  border-radius:16px;padding:4px;font-size:12px;gap:2px;
}
.nav-btn svg{width:26px;height:26px}
.nav-btn.small{width:auto;min-height:58px}
.nav-btn.active{background:var(--mint);color:var(--ink)}

/* 欢迎 / 老师：同一屏内的浮层，不另开页面；只有成人设置区内部可滚动 */
.veil{
  position:absolute;inset:0;z-index:20;overflow:hidden;
  background:rgba(252,250,246,.98);border-radius:20px;
  display:flex;flex-direction:column;
}
.veil .view{animation:none;padding:10px 14px;overflow:hidden;flex:1;min-height:0;display:flex;flex-direction:column}
.veil .view-head{margin-bottom:6px}
.veil .view-title{font-size:20px}
.veil .view-sub{font-size:12px;margin:2px 0 0}
/* ===== 启动页＝精灵页 =====
   第一眼就是两位小伙伴的大图，中间起名字，最下面一行小圆头像确认「我是谁」。
   零循环动画、触控目标 ≥88px、低饱和。 */
.view-sprite-first{gap:0}
.sprite-stage{flex:1;min-height:0;display:flex;align-items:center;justify-content:center;padding:4px 0 10px;overflow:hidden}
.sprite-stage .sprite-pick-box{
  margin:0;width:100%;max-width:780px;padding:10px 12px;
  background:transparent;box-shadow:none;
}
.sprite-stage .sprite-pick-grid{
  grid-template-columns:repeat(2,minmax(0,1fr));gap:16px;margin:0;
}
.sprite-stage .sprite-pick-card{
  min-height:0;padding:10px 8px 12px;gap:2px;border-radius:26px;
  border:4px solid var(--line);background:#fff;
}
.sprite-stage .sprite-pick-card.sel{border-color:var(--accent);background:var(--cream)}
/* 每次打开先问好：精灵页顶部一行问候，不遮挡精灵、不弹浮层 */
.sprite-greet-line{
  display:flex;align-items:center;gap:8px;flex-wrap:wrap;
  margin:0 0 8px;padding:8px 12px;border-radius:16px;
  background:var(--cream);border:2px solid var(--line);
  font-size:15px;color:var(--ink);
}
.sprite-greet-line svg{width:22px;height:22px;flex:0 0 22px}
.sprite-greet-line .mini-btn{margin-left:auto;min-height:36px}

/* 精灵大图：尽量占满卡片，孩子一眼能看清表情与装扮 */
.sprite-stage .sprite-pick-art{
  /* 首次确认页空间更足（没有底栏），精灵可以画得更大、更好认 */
  width:clamp(104px,15vh,176px);height:clamp(130px,19vh,222px);
}
.sprite-stage .sprite-pick-name{font-size:23px;margin-top:4px}
.sprite-stage .sprite-pick-wand{font-size:13px;gap:4px}
.sprite-stage .sprite-pick-wand svg{width:16px;height:40px;flex:0 0 16px}

/* 起名区：压在两张精灵卡下面，宽度一致 */
.sprite-stage .sprite-name-box{margin-top:8px;padding:8px 12px;border-radius:18px}
.sprite-stage .sprite-name-box>label{font-size:15px;margin-bottom:8px}
.sprite-stage .sprite-quick-row{gap:8px}
.sprite-stage .sprite-quick{min-height:44px;font-size:14px}
.sprite-start{width:100%;margin-top:9px;min-height:56px;font-size:18px;justify-content:center}
.sprite-start-row{display:grid;grid-template-columns:1fr 1fr;gap:10px;margin-top:9px}
.sprite-start-row .sprite-start{margin-top:0;font-size:16px}
/* 开始按钮用墨绿实底 + 白字，比浅天空蓝更清楚是「主操作」 */
.sprite-stage .sprite-start.sky{background:var(--accent);color:#fff}
.sprite-stage .sprite-start.primary{background:var(--accent);color:#fff}
.sprite-stage .sprite-start svg{width:26px;height:26px;flex:0 0 26px}

/* 旧欢迎页的孩子卡已由「精灵页 + 小头像行」取代，这里只留兜底尺寸 */
.veil-welcome .sprite-pick-box{margin-top:8px;padding:10px}
.veil-teacher{background:rgba(252,250,246,.99)}
.veil-teacher .view-head .row{flex-wrap:nowrap;overflow:hidden;gap:6px}
.veil-teacher .view-head .big-btn{min-height:44px;font-size:13px;padding:5px 10px;white-space:nowrap}
.veil-teacher .teacher-grid{
  grid-template-columns:repeat(auto-fit,minmax(280px,1fr));gap:10px;
  overflow:auto;flex:1;min-height:0;
}
.veil-teacher .panel{padding:12px;border-radius:18px}
.veil-teacher .big-btn{min-height:48px;font-size:14px;padding:6px 12px}
.veil-teacher .pinpad{max-width:240px}
.veil-teacher .pin-key{min-height:52px}
.veil .view-head{display:flex;align-items:center;justify-content:space-between;gap:10px}

/* 一屏画布：旧引导条落到画纸上方的空白处，不再压住「今日条」的视觉日程 */
.guide-bubble{top:calc(128px + env(safe-area-inset-top,0px))}

/* 欢迎页：介绍气泡靠右上角，绝不压住孩子的大头像卡（问候态仍居中醒目） */
body[data-view="welcome"] .sprite-bubble:not(.greeting){
  left:auto;right:calc(16px + env(safe-area-inset-right,0px));
  top:calc(64px + env(safe-area-inset-top,0px));
  width:min(320px,calc(100% - 32px));
}

/* 医学安全低刺激 / 系统减少动态效果：连「偶尔一次」也一起关掉 */
body.low-stimulus .zone.soft-once,body.low-stimulus .overlay-card.stage-card-in,
body.low-stimulus .result-card.show{animation:none !important}
@media(prefers-reduced-motion:reduce){
  .zone.soft-once,.overlay-card.stage-card-in,.result-card.show{animation:none !important}
}

/* 矮屏 / 窄屏：只允许元素变小，绝不出现滚动条 */
@media (max-height:820px){
  .main{gap:6px;padding:6px 10px}
  .daystrip{padding:4px 8px}
  .daystrip .hello-card,.daystrip .sched-item,.daystrip .nav-card{min-height:44px}
  .zone{gap:4px;padding:6px}
  .tray-item{min-height:44px}
  .cat-card{min-height:48px}
  .style-card{min-height:42px}
  .bottomnav{padding-top:4px}
  .nav-btn{min-height:52px}
  .zone-side .mic-btn{width:72px;height:72px;padding:15px}
  .aac-card{min-height:58px}
  .intent-card{min-height:180px}
}
/* ---- 语义扩展引导：精灵问一句，孩子点一张大图卡，全在中间画纸内 ----
   两列固定网格 + 行高均分，卡片再多也不会撑出滚动条；零循环闪烁动画。 */
.expand-entry{margin:0}
.expand-entry .big-btn{width:100%;min-height:46px;font-size:12px;padding:4px 6px;gap:4px}
.expand-entry .big-btn svg{width:20px;height:20px;flex:0 0 20px}
.exp-ask{display:flex;align-items:center;gap:10px;flex:0 0 auto;padding:8px 10px;
  border-radius:16px;background:rgba(231,240,234,.6);border:2px solid var(--line)}
.exp-avatar{width:46px;height:46px;flex:0 0 46px;border-radius:50%;
  background:rgba(255,255,255,.82);display:flex;align-items:center;justify-content:center}
.exp-avatar svg{width:34px;height:34px}
.exp-ask-txt{flex:1;min-width:0}
.exp-ask-txt b{font-size:14px;color:var(--muted)}
.exp-ask-txt p{margin:2px 0 0;font-size:18px;font-weight:800;line-height:1.4;color:var(--ink)}
.exp-ask .big-btn{min-height:44px;min-width:0;font-size:12px;padding:4px 10px;flex:0 0 auto}
.exp-ask .big-btn svg{width:20px;height:20px;flex:0 0 20px}
.exp-heard{flex:0 0 auto}
.exp-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));
  grid-auto-rows:minmax(88px,1fr);gap:8px;flex:1;min-height:0}
.exp-card{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:2px;
  min-height:88px;padding:6px 8px;border-radius:16px;border:2px solid var(--line);
  background:rgba(255,255,255,.72);cursor:pointer;text-align:center;color:var(--ink)}
.exp-card:hover{border-color:var(--accent);background:#F7FAF7}
.exp-card b{font-size:16px;font-weight:800}
.exp-card .exp-hint{font-size:12px;color:var(--muted)}
.exp-card em{font-style:normal;font-size:12px;color:var(--muted);line-height:1.35}
.exp-ico{display:block;width:58px;height:58px;flex:0 0 auto}
.exp-ico svg{width:58px;height:58px}
.exp-done{flex:1;min-height:0;display:flex;flex-direction:column;align-items:center;
  justify-content:center;gap:6px;text-align:center;box-shadow:none;background:rgba(255,255,255,.6)}
.exp-done-ico svg{width:46px;height:46px}
.exp-done b{font-size:16px}
.exp-done p{margin:0;font-size:20px;font-weight:800;line-height:1.5}
.exp-done .choice-bar{justify-content:center}
.expand-pane .choice-bar{flex-wrap:wrap;gap:6px;flex:0 0 auto}
.expand-pane .choice-bar .big-btn{min-height:46px;font-size:12px;padding:5px 10px;flex:0 1 auto}
.expand-pane .choice-bar .big-btn svg{width:20px;height:20px;flex:0 0 20px}
.expand-pane .link-note{flex:0 0 auto;font-size:12px}
@media (max-height:820px){
  .exp-ico,.exp-ico svg{width:42px;height:42px}
  .exp-ask-txt p{font-size:16px}
  .exp-card b{font-size:14px}
  .exp-card em{font-size:11px}
  .exp-done p{font-size:17px}
}

@media (max-width:900px){
  .desk{grid-template-columns:minmax(112px,18%) minmax(0,1fr) minmax(180px,26%);gap:6px}
  .daystrip .nav-grid{display:none}
  .daystrip .hello-card{padding:4px 8px}
  .daystrip .day-txt p{display:none}
  .daystrip .day-txt h2{font-size:14px}
  .nav-btn{min-width:60px;font-size:11px}
  .intent-grid{grid-template-columns:repeat(auto-fit,minmax(112px,1fr))}
  .works-grid{grid-template-columns:repeat(auto-fill,minmax(140px,1fr))}
}
/* ===== 首次确认页（一生只出现一次） =====
   一机一号：这里不是「选谁在用」，而是第一次使用时挑一个陪着孩子的小伙伴。
   确认后 onboarded=true，以后打开直接进工作页。 */
.first-hello{
  display:flex;align-items:baseline;gap:10px;flex-wrap:wrap;
  margin:0 0 10px;padding:8px 14px;border-radius:16px;
  background:var(--cream);border:2px solid var(--line);
}
.first-hello b{font-size:17px}
.first-hello span{font-size:13px;color:var(--muted)}
.first-once-note{margin:8px 0 0;text-align:center;font-size:12px}

/* ===== 人物设定（老师面板，唯一能改性别 / 重走首次确认的地方） ===== */
.persona-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(160px,1fr));gap:12px;margin-top:12px}
.persona-card{
  display:flex;flex-direction:column;align-items:center;gap:4px;
  padding:10px 8px 12px;border-radius:20px;background:#fff;
  border:3px solid var(--line);box-shadow:var(--shadow-sm);
}
.persona-card.sel{border-color:var(--accent);background:var(--cream)}
.persona-art{width:96px;height:126px}
.persona-art img{display:block;width:100%;height:100%;object-fit:contain}
.persona-card b{font-size:16px}
.persona-card span{font-size:12px;color:var(--muted)}


/* ============================================================
   说说话：语言能力优先（2026-11-15）
   ------------------------------------------------------------
   这批孩子文字对话能力几乎没有或极差，所以这一页的布局优先级是：
     语音按钮（最大，最上）> 正在说的句子 > 意图分组 > 词卡 > 目标词
   全页零文字输入框。所有触控目标 ≥44px，适合平板直接点。
   ============================================================ */

/* ① 语音：整块最大、最上，孩子一眼看到「按这里说话」 */
.say-voice{
  display:flex;align-items:center;gap:10px;
  padding:7px 8px;border-radius:18px;background:var(--mint);
  flex:0 0 auto;
}
.say-mic{
  width:62px;height:62px;border-radius:50%;flex:0 0 62px;
  display:grid;place-items:center;background:#8FBBA6;
  box-shadow:0 6px 16px rgba(80,110,100,.22);
  transition:none; /* 医学安全：不加任何过渡动画 */
}
.say-mic svg{width:34px;height:34px}
.say-mic.listening{background:#D9A98F}
.say-voice-txt{display:flex;flex-direction:column;gap:2px;min-width:0}
.say-voice-txt b{font-size:15px;color:#2F4A3E}
.say-voice-txt span{font-size:11px;color:#4A6A5C;line-height:1.3}

/* ② 我正在说：句子条 + 两个主操作 */
.say-sentence-wrap{flex:0 0 auto;margin-top:8px}
.say-sentence{
  padding:9px 10px;border-radius:18px;background:var(--cream);
  border:2px solid var(--line);
}
.say-line{display:flex;align-items:center;gap:8px}
.say-line svg{width:24px;height:24px;flex:0 0 24px}
.say-line b{font-size:17px;color:var(--ink);line-height:1.35;word-break:break-all}
.say-actions{display:flex;align-items:center;gap:6px;flex-wrap:wrap;margin-top:8px}
/* 右栏很窄：主操作各占一半宽度，「念给我听 / 说好了」永远不挤在一起 */
.say-actions .big-btn{flex:1 1 calc(50% - 3px);min-height:46px;font-size:12px;
  padding:4px 5px;gap:4px;min-width:0;white-space:normal;line-height:1.15;text-align:center}
.say-actions .big-btn svg{width:18px;height:18px;flex:0 0 18px}
.say-actions .big-btn span,.say-actions .big-btn{overflow:hidden;text-overflow:ellipsis}
.say-actions .mini-btn{flex:1 1 calc(50% - 3px);min-height:46px;font-size:12px}
.say-empty{
  padding:12px;border-radius:16px;background:#F7F4EE;
  border:2px dashed var(--line);text-align:center;
  font-size:13px;color:var(--muted);
}

/* ③ 意图分组：横向一排大按钮，点哪个换哪组词 */
.say-tabs{
  /* 五组必须全部看得见：等分五列，不横向滚动（滚动会让孩子以为「就只有这些」） */
  display:grid;grid-template-columns:repeat(5,minmax(0,1fr));
  gap:4px;margin-top:8px;flex:0 0 auto;
}
.say-tab{
  display:flex;flex-direction:column;align-items:center;justify-content:center;gap:1px;
  min-width:0;min-height:54px;padding:3px 2px;border-radius:13px;
  background:#fff;border:2px solid var(--line);
  font-size:10px;font-weight:800;color:var(--muted);line-height:1.1;
  overflow:hidden;
}
.say-tab span{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:100%}
.say-tab svg{width:22px;height:22px}
.say-tab.sel{background:var(--cream);border-color:var(--accent);color:var(--ink)}

/* ④ 词卡：大图 + 大字，一排两三个，平板好点 */
.say-grid{
  /* 右栏只有约 250px：三列紧凑，一屏能放 9 张，卡片等宽不破形 */
  display:grid;grid-template-columns:repeat(3,minmax(0,1fr));
  gap:7px;margin-top:8px;flex:1 1 auto;min-height:0;
  overflow-y:auto;align-content:start;
}
.say-card{
  display:flex;flex-direction:column;align-items:center;justify-content:center;gap:1px;
  min-height:70px;padding:4px 2px;border-radius:14px;
  background:#fff;border:2px solid var(--line);box-shadow:var(--shadow-sm);
  font-size:12px;font-weight:800;color:var(--ink);line-height:1.15;
  text-align:center;word-break:keep-all;overflow:hidden;
}
.say-card svg{width:32px;height:32px;flex:0 0 32px}
.say-card span{white-space:nowrap}
.say-card.sel{background:var(--mint);border-color:var(--accent)}

/* ⑤ 底部：目标词收小 + 两个兜底操作 */
.say-foot{display:flex;align-items:center;gap:6px;flex:0 0 auto;margin-top:8px;flex-wrap:wrap}
.say-target{display:flex;align-items:center;gap:5px;min-width:0;flex:0 1 auto}
.say-target .tiny{white-space:nowrap;flex:0 0 auto}
.say-target-btn{
  display:inline-flex;align-items:center;gap:5px;flex-wrap:nowrap;
  min-height:46px;padding:3px 8px;border-radius:13px;
  background:#fff;border:2px solid var(--line);
  font-size:13px;font-weight:800;color:var(--ink);white-space:nowrap;
}
.say-target-btn svg{width:22px;height:22px;flex:0 0 22px}
.say-foot-acts{display:grid;grid-template-columns:1fr 1fr;gap:5px;flex:1 1 100%}
.say-foot-acts .big-btn{min-height:46px;font-size:11px;
  padding:3px 4px;gap:3px;min-width:0;overflow:hidden}
.say-foot-acts .big-btn svg{width:16px;height:16px;flex:0 0 16px}
/* 「说的有点乱 · 帮我选」太长：窄栏里折成两行，字号再小一点，绝不截断成半个字 */
.say-foot-acts .big-btn{white-space:normal;line-height:1.15;text-align:center;font-size:10px}

/* 窄屏：语音块与句子条再压一点，保证词卡有位置 */
@media (max-width:560px){
  .say-mic{width:64px;height:64px;flex:0 0 64px}
  .say-mic svg{width:34px;height:34px}
  .say-voice-txt b{font-size:15px}
  .say-voice-txt span{font-size:11px}
  .say-grid{grid-template-columns:repeat(3,minmax(0,1fr))}
  .say-card{min-height:66px;font-size:11px}
  .say-card svg{width:28px;height:28px}
}

/* 语音识别结果：让孩子看见「我刚刚说了什么」 */
.say-heard{
  display:flex;align-items:flex-start;gap:6px;
  padding:4px 2px 6px;border-bottom:1px dashed var(--line);margin-bottom:6px;
}
.say-heard svg{width:20px;height:20px;flex:0 0 20px;margin-top:2px}
.say-heard span{font-size:13px;color:var(--muted);line-height:1.4}
.say-heard b{color:var(--ink);font-size:15px}

/* ============================================================
   说说话 · 中区主场地（宽屏）
   ------------------------------------------------------------
   右栏只有 240px，「我想要的」「一起玩」这类四个字会被截成「我…」。
   语言是第一优先级，所以宽屏时把中间画纸区让给语言练习：
   词卡可以放 4~5 列、字放得下，语音与句子也更大。
   小屏不启用（仍只用右栏），避免挤出屏幕。
   ============================================================ */
.say-stage{height:100%;min-height:0;display:flex}
.say-big{
  flex:1;min-height:0;display:flex;flex-direction:column;gap:8px;
  padding:10px;border-radius:22px;background:var(--card);
  box-shadow:var(--shadow-sm);overflow:hidden;
}
/* 宽屏：说说话时右栏收窄，把宽度让给中区 */
@media (min-width:900px){
  .desk.desk-say{grid-template-columns:minmax(150px,14%) minmax(0,1fr) minmax(210px,190px)}
}
@media (max-width:899px){
  /* 小屏不铺中区，只用右栏，避免挤出屏幕 */
  .say-stage{display:none}
}

.say-voice-big{padding:10px 12px;border-radius:20px}
.say-voice-big .say-mic{width:76px;height:76px;flex:0 0 76px}
.say-voice-big .say-mic svg{width:40px;height:40px}
.say-voice-big .say-voice-txt b{font-size:19px}
.say-voice-big .say-voice-txt span{font-size:13px}
.say-voice-goal{margin-left:auto;display:flex;flex-direction:column;align-items:flex-end;gap:2px}
.say-voice-goal .tiny{font-size:11px}

.say-sentence-big{padding:10px 12px}
.say-sentence-big .say-line b{font-size:22px}
.say-sentence-big .say-actions .big-btn{font-size:15px;min-height:50px;flex:0 1 auto;min-width:130px}
.say-sentence-big .say-actions .big-btn svg{width:22px;height:22px;flex:0 0 22px}
.say-sentence-big .say-actions .mini-btn{min-height:50px;font-size:13px;flex:0 1 auto;min-width:92px}
.say-empty.big{padding:16px;font-size:15px}

/* 中区的分组：五列等宽，四个字放得下 */
.say-tabs-big{grid-template-columns:repeat(5,minmax(0,1fr));gap:8px}
.say-tabs-big .say-tab{min-height:64px;font-size:13px;padding:5px 4px}
.say-tabs-big .say-tab svg{width:26px;height:26px}

/* 中区词卡：自适应多列，卡片更大，字绝不截断 */
.say-grid-big{
  grid-template-columns:repeat(auto-fit,minmax(112px,1fr));
  gap:9px;
}
.say-grid-big .say-card{min-height:96px;font-size:15px;padding:7px 4px;gap:3px}
.say-grid-big .say-card svg{width:46px;height:46px}

.say-big-foot{display:flex;gap:8px;flex:0 0 auto;margin-top:2px}
.say-big-foot .big-btn{flex:1 1 0;min-height:50px;font-size:14px;gap:7px}
.say-big-foot .big-btn svg{width:22px;height:22px;flex:0 0 22px}

/* 宽屏说说话：右栏只留「状态 + 兜底」，不重复中区已经有的语音/句子/词卡。
   避免同一屏出现两套一模一样的按钮，孩子会不知道点哪边。 */
@media (min-width:900px){
  .desk.desk-say .zone-side .say-voice .say-mic{width:46px;height:46px;flex:0 0 46px}
  .desk.desk-say .zone-side .say-voice .say-mic svg{width:26px;height:26px}
  .desk.desk-say .zone-side .say-voice-txt b{font-size:13px}
  .desk.desk-say .zone-side .say-voice-txt span{font-size:10px}
  /* 右栏的句子条、分组、词卡在中区已经有了：这里收起来，只留语音与目标词 */
  .desk.desk-say .zone-side .say-sentence-wrap,
  .desk.desk-say .zone-side .say-tabs,
  .desk.desk-say .zone-side .say-grid{display:none}
  .desk.desk-say .zone-side .say-foot-acts{display:none}
  .desk.desk-say .zone-side{overflow-y:auto}
  /* 说说话时气泡不压右栏：贴到中区右下，避开所有功能列 */
  body[data-view="talk"] .sprite-bubble{max-width:min(300px,calc(100% - 24px))}
}

/* 说说话页的问好/引导气泡：压成顶部一条窄提示，不遮挡任何词卡。
   语言练习是这一页的主角，气泡只保留一句可听可看的小提示。 */
.sprite-bubble.sb-strip{
  max-width:min(420px,calc(100% - 40px)) !important;
  padding:6px 10px !important;
  border-radius:14px !important;
  border-width:2px !important;
  max-height:56px;overflow:hidden;
}
.sprite-bubble.sb-strip .sb-head{margin-bottom:2px}
.sprite-bubble.sb-strip .sb-name{font-size:13px}
.sprite-bubble.sb-strip .sb-board{display:none}
.sprite-bubble.sb-strip .sb-title,
.sprite-bubble.sb-strip .sb-text,
.sprite-bubble.sb-strip .sb-more,
.sprite-bubble.sb-strip .sb-actions,
.sprite-bubble.sb-strip .sg-choices{display:none !important}
.sprite-bubble.sb-strip .sb-step{
  font-size:13px !important;margin:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;
}
/* 问好阶段的窄条：只留一行问候语 */
.sprite-bubble.sb-strip .sg-lines{flex-direction:row;flex-wrap:nowrap;overflow:hidden}
.sprite-bubble.sb-strip .sg-line{
  font-size:13px !important;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;
}
.sprite-bubble.sb-strip .sg-line:nth-child(n+2){display:none}
.sprite-bubble.sb-strip .sb-close{width:32px;height:32px;font-size:16px}

/* 说说话页的中区栈：语言练习在下，反馈/方案卡片浮在上面 */
.say-stack{position:relative;height:100%;min-height:0;display:flex}
.say-stack .say-stage{flex:1;min-width:0}
.say-stack .stage-overlay{position:absolute;inset:0}


/* ============================================================
   老师面板：精灵必须让位（2026-11-15）
   ------------------------------------------------------------
   老师和家长在这一页要改参数、填地址、看统计。精灵的问候气泡会
   直接把「语言模型」整块盖住，导致根本没法操作 —— 这不是美观问题，
   是可用性问题。所以老师页面里精灵不出气泡、也不出形象。
   ============================================================ */
body[data-view="teacher"] .sprite-layer,
body[data-view="teacher"] .sprite-layer.greeting{display:none !important}

/* ============================================================
   登录 / 邀请码页（网页版入口）
   ------------------------------------------------------------
   这一页是给**家长与老师**看的，不是给孩子看的。
   所以它不走儿童界面的低饱和、大字卡风格，而是一张干净的卡片：
   该清楚的地方清楚（输入框要够大、够好点），该克制的地方克制（不用强烈色块）。
   孩子永远不会看到这一页 —— 登录一次后 cookie 记住 180 天。
   ============================================================ */
.auth-view{
  min-height:100vh;display:flex;align-items:center;justify-content:center;
  padding:24px 16px;background:linear-gradient(180deg,#FBF9F4 0%,#F4F1EA 100%);
}
.auth-card{
  width:100%;max-width:430px;background:#fff;border-radius:24px;
  padding:28px 26px 22px;box-shadow:0 12px 40px rgba(90,100,110,.13);
  border:1px solid rgba(120,130,140,.10);
}
.auth-brand{text-align:center;margin-bottom:20px}
.auth-brand svg{width:48px;height:48px;margin:0 auto 8px;display:block}
.auth-brand h1{font-size:25px;margin:0 0 6px;color:var(--ink);letter-spacing:.5px}
.auth-brand p{font-size:13px;color:var(--muted);margin:0;line-height:1.5}

.auth-tabs{display:grid;grid-template-columns:1fr 1fr;gap:8px;margin:16px 0 18px}
.auth-tab{
  min-height:46px;border-radius:14px;background:var(--cream);
  border:2px solid transparent;font-size:14px;font-weight:700;color:var(--muted);
}
.auth-tab.sel{background:#fff;border-color:var(--accent);color:var(--ink)}

.auth-form{display:flex;flex-direction:column;gap:6px}
.auth-form label{font-size:13px;font-weight:700;color:#5A6672;margin-top:8px}
/* 注意要连 input[type] 一起压过全局的 `input[type=text],input[type=password]`
   规则，否则 password 框会被全局的 max-width:220px 卡住，比上面的输入框窄一截，
   看起来像排版错位。 */
.auth-form input.auth-input,
input.auth-input[type=text],
input.auth-input[type=password],
input.auth-input{
  min-height:52px;padding:0 14px;border-radius:14px;font-size:16px;
  border:2px solid var(--line);background:#FCFBF8;color:var(--ink);
  /* 16px 以上：iOS 聚焦输入框时不会自动放大页面 */
  font-family:inherit;width:100%;max-width:none;box-sizing:border-box;
}
.auth-input:focus{outline:none;border-color:var(--accent);background:#fff}
.auth-code{letter-spacing:2px;text-transform:uppercase;font-weight:700;font-size:18px}

.auth-primary{
  width:100%;min-height:54px;margin-top:16px;border-radius:16px;
  /* 登录页是给家长/老师用的，不是儿童界面。
     儿童界面用低饱和薄荷绿是对的（低刺激），但成人主按钮用那个色值
     会显得像「禁用状态」，反而让人不敢点。这里用更明确的中深绿。 */
  background:#5E8B77;color:#fff;font-size:17px;font-weight:800;
  border:none;cursor:pointer;
  transition:background .15s ease;
}
.auth-primary:hover:not(:disabled){background:#4F7A67}
.auth-primary:active:not(:disabled){background:#446B5A}
.auth-primary:disabled{background:#A9BDB3;cursor:default}

.auth-err{
  background:#FDECEC;border:1px solid #F3C9C9;color:#A34A4A;
  padding:10px 14px;border-radius:12px;font-size:14px;line-height:1.5;margin-bottom:4px;
}
.auth-note{
  background:var(--cream);border-radius:14px;padding:14px 16px;margin:8px 0 4px;
  font-size:13.5px;line-height:1.6;color:#5A6672;
}
.auth-note b{display:block;margin-bottom:4px;color:var(--ink);font-size:15px}
.auth-note p{margin:0}

.auth-foot{
  margin:18px 0 0;text-align:center;font-size:12px;line-height:1.7;color:var(--muted);
}

/* 手机上把卡片铺满，避免两侧留白过多 */
@media (max-width:480px){
  .auth-view{padding:12px;align-items:flex-start}
  .auth-card{padding:22px 18px 18px;border-radius:20px;margin-top:12px}
  .auth-brand h1{font-size:22px}
}

/* 预览模式登录页的「开通并进入」：一个动作，做成整页最醒目的东西 */
.auth-enter{
  min-height:62px;font-size:19px;font-weight:800;margin-top:4px;
  box-shadow:0 6px 18px rgba(120,140,150,.18);
}
/* 文字型次要入口：不抢按钮的视觉，但要好点（≥44px） */
.auth-link{
  display:inline-block;min-height:44px;padding:10px 14px;
  background:none;border:none;color:var(--muted);
  font-size:13px;font-family:inherit;cursor:pointer;
  text-decoration:underline;text-underline-offset:3px;
}
.auth-link:hover{color:var(--ink)}
