/* dlg.css · 场景对话互动微课引擎样式(两站共用)
   全部规则限定在 .dlg 根下,颜色/字号令牌沿用站内 styles.css(春碧天蓝,浅色 + prefers-color-scheme 深色);
   拼音用 Andika(andika.woff2 与本文件同目录);汉字用站内 --hanzi(霞鹜文楷)。
   来源:对话重构/原型/lab/styles.css(兰已验收的样板),只加不改。 */
@font-face{font-family:"Andika";src:local("Andika"),url("andika.woff2") format("woff2");font-display:swap}
.dlg{
  --py:"Andika","Andika New Basic","Charis SIL","Doulos SIL",system-ui,sans-serif;
  --picplate:#FBFDFA; --shadow:rgba(0,0,0,.04); --glow:rgba(17,122,169,.35);
  flex:1;display:flex;flex-direction:column;min-height:100dvh;width:100%;
  color:var(--ink);font:16px/1.65 var(--ui);
}
@media (prefers-color-scheme: dark){
  .dlg{--picplate:#ECE6DA; --shadow:rgba(0,0,0,.25); --glow:rgba(78,195,240,.3)}
}
.dlg *{box-sizing:border-box;-webkit-tap-highlight-color:transparent}
.dlg button{font:inherit;cursor:pointer;border:none;background:none;color:inherit;padding:0;margin:0}
.dlg button:disabled{cursor:default}
.dlg img{max-width:100%}
.dlg .hanzi{font-family:var(--hanzi)}
.dlg .py{font-family:var(--py)}
.dlg [hidden]{display:none!important}

/* ---------- 壳:顶栏 + 分段进度 ---------- */
.dlg .topbar{display:flex;align-items:center;gap:10px;padding:12px 16px 8px}
.dlg .topbar .x{display:flex;align-items:center;justify-content:center;width:44px;height:44px;margin:-8px 0 -8px -12px;border-radius:12px;color:var(--mute)}
.dlg .topbar .x:active{background:var(--rule)}
.dlg .topbar .title{font-size:14px;font-weight:600;color:var(--ink2);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.dlg .segbar{display:flex;gap:3px;padding:0 16px 10px}
.dlg .segbar i{flex:1;height:4px;border-radius:3px;background:var(--rule);transition:background .25s}
.dlg .segbar i.on{background:var(--accent)}
.dlg .segbar i.cur{background:var(--accent2)}
.dlg .stage{flex:1;padding:10px 20px 30px;display:flex;flex-direction:column;animation:dlg-rise .22s ease-out}
.dlg .stage .grow{flex:1}
@keyframes dlg-rise{from{opacity:0;transform:translateY(8px)}to{opacity:1}}
/* 底部常驻 */
.dlg .foot{position:sticky;bottom:0;z-index:5;background:var(--paper);
      padding:10px 20px calc(20px + env(safe-area-inset-bottom))}
.dlg .foot-row{display:flex;gap:10px}
.dlg .btn{display:block;width:100%;min-height:52px;padding:14px 18px;border-radius:14px;font-size:17px;font-weight:600;
     text-align:center;background:var(--accent);color:var(--onAccent);transition:transform .08s,opacity .15s}
.dlg .btn:active{transform:scale(.98)}
.dlg .btn.ghost{background:var(--card);color:var(--accent);border:1.5px solid var(--accent)}
.dlg .btn.link{background:none;color:var(--accent);font-size:13px;font-weight:700;min-height:44px;padding:8px;width:auto;display:inline-flex;align-items:center;gap:8px}
.dlg .btn:disabled{opacity:.45;pointer-events:none}
.dlg .foot-row .btn{flex:1}
.dlg .foot-row .btn.ghost{flex:0 0 auto;width:auto;padding-left:16px;padding-right:16px}
/* 反馈底板(对/错) */
.dlg .sheet{border-radius:18px 18px 0 0;padding:18px 20px calc(20px + env(safe-area-inset-bottom));
       margin:0 -20px calc(-20px - env(safe-area-inset-bottom));display:flex;flex-direction:column;gap:12px;
       animation:dlg-fbrise .3s cubic-bezier(.2,.8,.3,1) both}
@keyframes dlg-fbrise{from{opacity:0;transform:translateY(12px)}to{opacity:1;transform:none}}
.dlg .sheet.ok{background:var(--successSoft)}
.dlg .sheet.no{background:var(--accent2Soft)}
.dlg .sheet .head{display:flex;align-items:center;gap:10px}
.dlg .sheet .ic{width:34px;height:34px;border-radius:99px;display:flex;align-items:center;justify-content:center;flex:none}
.dlg .sheet.ok .ic{background:var(--success);color:var(--onSuccess)}
.dlg .sheet.no .ic{background:var(--accent2);color:var(--onAccent2)}
.dlg .sheet .ttl{font-size:18px;font-weight:700}
.dlg .sheet.ok .ttl{color:var(--success)}
.dlg .sheet.no .ttl{color:var(--accent2)}
.dlg .sheet .sub{font-size:14.5px;color:var(--ink2);line-height:1.5}
.dlg .sheet .sub .hanzi{font-size:19px;color:var(--ink)}
.dlg .sheet .sub .py{font-size:12.5px;display:block;color:var(--mute)}
.dlg .sheet .btn{margin-top:2px}
.dlg .sheet.ok .btn{background:var(--success);color:var(--onSuccess)}
.dlg .sheet.no .btn{background:var(--accent2);color:var(--onAccent2)}
.dlg .sheet .btn.link{background:none;color:var(--ink2);margin:-6px auto 0}
/* ---------- 通用件 ---------- */
.dlg .q-instr{font-size:16.5px;font-weight:600;margin:6px 0 14px;text-align:center}
.dlg .spk{display:inline-flex;align-items:center;justify-content:center;width:40px;height:40px;border-radius:99px;
     background:var(--accentSoft);color:var(--accent);flex:none;transition:transform .1s}
.dlg .spk:active{transform:scale(.92)}
.dlg .spk.big{width:84px;height:84px}
.dlg .spk.playing{animation:dlg-pulse 1s ease-in-out infinite}
@keyframes dlg-pulse{50%{transform:scale(1.06)}}
.dlg .turtle{display:inline-flex;align-items:center;justify-content:center;width:40px;height:40px;border-radius:99px;background:var(--accentSoft);color:var(--accent)}
.dlg .hint{font-size:12.5px;color:var(--mute);text-align:center}
.dlg .pill{display:inline-block;padding:3px 10px;border-radius:99px;font-size:12px;background:var(--accentSoft);color:var(--accent);font-weight:600}
/* 人物 + 气泡(styles.css .line/.bub) */
.dlg .line{display:flex;gap:10px;align-items:flex-start;margin-bottom:12px}
.dlg .line.me{flex-direction:row-reverse}
.dlg .line .ava{flex:none;width:56px;height:56px}
.dlg .line .ava svg{display:block;width:100%;height:100%}
.dlg .line .bub{background:var(--card);border:1px solid var(--rule);border-radius:14px;padding:9px 13px;max-width:82%;min-width:0}
.dlg .line.me .bub{background:var(--accentSoft);border-color:transparent}
.dlg .line .who{font-size:11px;color:var(--mute);margin-bottom:2px}
.dlg .line .zhrow{display:flex;align-items:center;gap:8px}
.dlg .line .zh{font-family:var(--hanzi);font-size:20px;line-height:1.55;overflow-wrap:anywhere}
.dlg .line .zh.big{font-size:24px}
.dlg .line .py{font-family:var(--py);font-size:12.5px;color:var(--accent);margin-top:2px}
.dlg .line .en{font-size:13px;color:var(--mute);margin-top:2px}
.dlg .line .bub.tap{cursor:pointer}
.dlg .line .bub.tap:active{opacity:.8}
/* 选项 */
.dlg .opts{display:flex;flex-direction:column;gap:10px;margin-top:8px}
.dlg .opt{background:var(--card);border:1.5px solid var(--rule);border-radius:13px;padding:13px 16px;color:var(--ink);
     display:flex;align-items:center;gap:12px;min-height:44px;text-align:left;width:100%;transition:border-color .12s}
.dlg .opt .zh{font-family:var(--hanzi);font-size:20px;line-height:1.4}
.dlg .opt .py{font-family:var(--py);font-size:12.5px;color:var(--accent)}
.dlg .opt.sel{border-color:var(--accent)}
.dlg .opt.right{border-color:var(--success);background:var(--successSoft);color:var(--success)}
.dlg .opt.right .py{color:var(--success)}
.dlg .opt.wrong{border-color:var(--accent2);background:var(--accent2Soft);color:var(--accent2);animation:dlg-shake .3s}
.dlg .opt.wrong .py{color:var(--accent2)}
.dlg .opt:disabled{opacity:.55}
.dlg .opt.right:disabled, .dlg .opt.wrong:disabled{opacity:1}
@keyframes dlg-shake{25%{transform:translateX(-5px)}75%{transform:translateX(5px)}}
/* 词块 / 槽线 */
.dlg .slotline{min-height:56px;border-bottom:2px solid var(--rule);display:flex;flex-wrap:wrap;gap:8px;align-items:center;padding:8px 2px;margin-bottom:16px}
.dlg .tilebay{display:flex;flex-wrap:wrap;gap:9px;justify-content:center}
.dlg .tile{background:var(--card);border:1.5px solid var(--rule);border-radius:11px;padding:9px 14px;font-family:var(--hanzi);
      font-size:21px;line-height:1.2;min-height:44px;display:flex;align-items:center;color:var(--ink);transition:opacity .15s}
.dlg .tile.in{background:var(--accentSoft);border-color:var(--accent)}
.dlg .tile.used{opacity:.25;pointer-events:none}
.dlg .tile:active{transform:scale(.96)}
/* 配对 */
.dlg .match{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;margin-top:6px}
.dlg .mitem{background:var(--card);border:1.5px solid var(--rule);border-radius:12px;padding:13px 10px;text-align:center;
       font-size:17px;color:var(--ink);min-height:56px;display:flex;align-items:center;justify-content:center;overflow-wrap:anywhere}
.dlg .mitem.hz{font-family:var(--hanzi);font-size:20px}
.dlg .mitem.sel{border-color:var(--accent2);background:var(--accent2Soft)}
.dlg .mitem.lock{border-color:var(--success);background:var(--successSoft);color:var(--success);pointer-events:none}
.dlg .mitem.err{animation:dlg-shake .3s;border-color:var(--accent2)}
/* 填空槽 */
.dlg .blank{display:inline-block;min-width:64px;border-bottom:2px solid var(--accent);margin:0 4px;text-align:center;color:var(--accent);line-height:1.3;cursor:pointer;vertical-align:baseline}
.dlg .blank:empty::after{content:"\00a0"}
/* ---------- 单元开始 ---------- */
.dlg .startcard{flex:1;display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center;gap:14px}
.dlg .scenebox{width:220px;height:160px;border-radius:20px;background:var(--card);border:1px solid var(--rule);position:relative}
.dlg .scenebox .a1{position:absolute;left:18px;top:22px}
.dlg .scenebox .a2{position:absolute;right:18px;top:22px}
.dlg .scenebox .a3{position:absolute;left:82px;top:12px}
.dlg .scenebox .cake{position:absolute;left:0;right:0;bottom:14px;display:flex;justify-content:center}
.dlg .startcard .zh{font-family:var(--hanzi);font-size:34px;font-weight:700;letter-spacing:.06em}
.dlg .startcard .en{font-size:15px;color:var(--ink2);padding:0 6px}
.dlg .startcard .meta{font-size:13px;color:var(--mute)}
/* ---------- 词卡 ---------- */
.dlg .vcard{position:relative;background:var(--card);border:1px solid var(--rule);border-radius:20px;padding:30px 22px;text-align:center;box-shadow:0 2px 14px var(--shadow)}
.dlg .vcard .newtag{position:absolute;left:14px;top:-10px;transform:rotate(-10deg);background:var(--celebrate);color:var(--onCelebrate);font-size:11px;border-radius:6px;padding:2px 7px;font-weight:700}
.dlg .vcard .w{font-family:var(--hanzi);font-size:76px;line-height:1.25;font-weight:700}
.dlg .vcard .py{font-size:19px;color:var(--accent);margin-top:2px;font-weight:600}
.dlg .vcard .en{font-size:17px;color:var(--ink2);margin-top:8px}
.dlg .vcard .spkrow{display:flex;justify-content:center;margin-top:12px}
.dlg .vex{margin-top:16px;padding-top:14px;border-top:1px dashed var(--rule)}
.dlg .vex button{display:inline-flex;align-items:center;gap:8px;min-height:44px;padding:4px 10px;border-radius:10px}
.dlg .vex button:active{background:var(--accentSoft)}
.dlg .vex .zh{font-family:var(--hanzi);font-size:19px;border-bottom:2px dotted var(--accent)}
.dlg .vex .en{font-size:13px;color:var(--mute);margin-top:3px}
/* ---------- 只听拼句 ---------- */
.dlg .listenrow{display:flex;align-items:center;justify-content:center;gap:14px;margin:8px 0 18px}
.dlg .listenrow .grp{display:flex;align-items:center;gap:12px}
.dlg .bigspk{width:124px;height:124px;border-radius:24px;background:var(--accent);color:var(--onAccent);display:flex;align-items:center;justify-content:center;box-shadow:0 6px 20px var(--glow)}
.dlg .bigspk:active{transform:scale(.97)}
.dlg .bigspk.playing{animation:dlg-pulse 1s ease-in-out infinite}
.dlg .turtle.sq{width:52px;height:52px;border-radius:16px}
.dlg .prompt-en{font-size:14px;color:var(--ink2);text-align:center;margin:4px 0 10px}
/* ---------- 开口说 / 看图说 ---------- */
.dlg .saycard{background:var(--card);border:1px solid var(--rule);border-radius:20px;padding:26px 22px;text-align:center}
.dlg .saycard .ava{display:flex;justify-content:center;margin-bottom:12px}
.dlg .saycard .zh{font-family:var(--hanzi);font-size:26px;line-height:1.5;font-weight:700}
.dlg .saycard .py{font-family:var(--py);font-size:14px;color:var(--accent);margin-top:6px}
.dlg .saycard .ctl{display:flex;justify-content:center;gap:12px;margin-top:12px}
.dlg .micwrap{display:flex;flex-direction:column;align-items:center;gap:10px;margin:12px 0 4px}
.dlg .mic{width:84px;height:84px;border-radius:99px;background:var(--accent);color:var(--onAccent);display:flex;align-items:center;justify-content:center;box-shadow:0 6px 20px var(--glow);transition:transform .1s}
.dlg .mic:active{transform:scale(.95)}
.dlg .mic.on{background:var(--celebrate);color:var(--onCelebrate);box-shadow:0 0 0 8px var(--celebrateSoft);animation:dlg-pulse 1.1s ease-in-out infinite}
.dlg .mic:disabled{opacity:.5}
.dlg .heard{font-family:var(--hanzi);font-size:18px;color:var(--ink2);min-height:1.4em;text-align:center}
.dlg .pictray{width:200px;height:200px;border-radius:28px;background:var(--picplate);border:1px solid var(--rule);display:flex;align-items:center;justify-content:center}
.dlg .pictray img{width:168px;height:168px;object-fit:contain;display:block}
.dlg .picwrap{flex:1;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:14px}
/* ---------- 语音留言 ---------- */
.dlg .msgcard{background:var(--card);border:1px solid var(--rule);border-radius:20px;padding:22px 20px;display:flex;flex-direction:column;align-items:center;gap:12px}
.dlg .msgcard .name{font-size:15px;font-weight:700}
.dlg .msgcard .meta{font-size:12.5px;color:var(--mute)}
.dlg .msgcard .row{display:flex;align-items:center;gap:12px;width:100%}
.dlg .playbtn{width:52px;height:52px;border-radius:99px;background:var(--accent);color:var(--onAccent);display:flex;align-items:center;justify-content:center;flex:none}
.dlg .playbtn:active{transform:scale(.95)}
.dlg .wave{flex:1;display:flex;align-items:center;gap:3px;height:40px}
.dlg .wave i{flex:1;border-radius:2px;background:var(--rule);transition:background .15s}
.dlg .wave i.on{background:var(--accent)}
.dlg .msgcard .reveal{width:100%;text-align:center;padding-top:10px;border-top:1px dashed var(--rule)}
.dlg .msgcard .reveal .zh{font-family:var(--hanzi);font-size:20px}
.dlg .msgcard .reveal .py{font-family:var(--py);font-size:12.5px;color:var(--accent)}
.dlg .q2{font-size:16.5px;font-weight:600;margin:18px 0 10px;text-align:center}
/* ---------- 完成 ---------- */
.dlg .donepage{flex:1;display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center;padding:10px 4px}
.dlg .sealbox{width:150px;height:150px;border:5px solid var(--celebrate);border-radius:16px;color:var(--celebrate);
         display:flex;flex-direction:column;align-items:center;justify-content:center;font-family:var(--hanzi);
         transform:rotate(-6deg);animation:dlg-stampin .5s cubic-bezier(.2,1.6,.4,1) both;margin-bottom:22px}
.dlg .sealbox .big{font-size:64px;font-weight:700;line-height:1}
.dlg .sealbox .small{font-size:14px;font-weight:700;margin-top:4px;letter-spacing:.15em}
@keyframes dlg-stampin{0%{transform:rotate(-6deg) scale(2.2);opacity:0}60%{transform:rotate(-6deg) scale(.94);opacity:1}100%{transform:rotate(-6deg) scale(1)}}
.dlg .donepage .cando{font-size:17px;font-weight:700;margin-bottom:6px}
.dlg .donepage .sub{font-size:13.5px;color:var(--mute);margin-bottom:22px}
.dlg .stats{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px;width:100%}
.dlg .stat{background:var(--card);border:1px solid var(--rule);border-radius:14px;padding:12px 8px}
.dlg .stat b{display:block;font-size:22px;font-weight:700}
.dlg .stat.c b{color:var(--success)}
.dlg .stat.s b{color:var(--accent)}
.dlg .stat.t b{color:var(--accent2)}
.dlg .stat span{font-size:12px;color:var(--mute)}
.dlg-toast{position:fixed;left:50%;bottom:110px;transform:translateX(-50%);background:var(--ink);color:var(--paper);
       padding:9px 16px;border-radius:99px;font-size:13.5px;z-index:60;animation:dlg-rise .2s}
/* ---------- 回放 ---------- */
.dlg .recap-title{text-align:center;font-family:var(--hanzi);font-size:18px;font-weight:700;color:var(--ink2);margin-bottom:12px}
.dlg .recap .line .bub{cursor:pointer}
.dlg .recap.nopy .line .py{display:none}
.dlg .recap .line.now .bub{box-shadow:0 0 0 2px var(--accent)}
.dlg .foot .btn.ghost.on{background:var(--accent);color:var(--onAccent)}
/* ---------- 暂停/退出 ---------- */
.dlg .pause{flex:1;display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center;gap:12px;padding:20px}
.dlg .pause .t{font-size:20px;font-weight:700}
.dlg .pause .s{font-size:14px;color:var(--ink2);max-width:320px}
/* 窄屏(375) */
@media (max-width:380px){
  .dlg .stage{padding:8px 16px 24px}
  .dlg .foot{padding-left:16px;padding-right:16px}
  .dlg .tile{font-size:20px;padding:8px 12px}
  .dlg .vcard .w{font-size:68px}
  .dlg .saycard .zh{font-size:24px}
  .dlg .stat b{font-size:20px}
}
/* 麦克风真正开始收音后的状态(兰 09-10:iPhone 上点麦要等半秒才真开始) */
.dlg .mic.live{box-shadow:0 0 0 14px var(--celebrateSoft)}
/* 选回复:问和答挨着(兰 09-10:中间空太多,像断成两截) */
.dlg .gap{height:18px;flex:none}

/* ---------- 正式版新增 ---------- */
/* 台词词图:气泡旁 64px(规格 §2b:图替中文说"这是什么") */
.dlg .wpic{flex:none;width:64px;height:64px;border-radius:14px;background:var(--picplate);border:1px solid var(--rule);display:flex;align-items:center;justify-content:center;align-self:center}
.dlg .wpic img{width:54px;height:54px;object-fit:contain;display:block}
.dlg .listenrow .wpic{margin-left:4px}
.dlg .line.haspic .bub{max-width:none}   /* 带词图的气泡把剩余宽度吃满,窄屏(375)不至于两三个字一行 */
/* 开始页场景图(scene_pic / 第一张词图) */
.dlg .scenebox.pic{display:flex;align-items:center;justify-content:center;background:var(--picplate);overflow:hidden}
.dlg .scenebox.pic img{width:150px;height:150px;object-fit:contain;display:block}
.dlg .topbar .title{font-family:var(--hanzi);font-size:16px}
.dlg .foot > .btn{margin-top:8px}
.dlg .foot > .foot-row + .btn{margin-top:8px}
/* 无障碍:减弱动效 */
@media (prefers-reduced-motion: reduce){
  .dlg *,.dlg *::before,.dlg *::after{animation:none!important;transition-duration:.01ms!important}
}

/* §2c 拼句先听一遍 */
.lfrow{display:flex;justify-content:center;margin:6px 0 2px}
.lf{display:inline-flex;align-items:center;gap:6px;padding:8px 14px;border-radius:999px;border:1.5px solid var(--accent,#117AA9);background:var(--card,#fff);color:var(--accent,#117AA9);font:600 14px system-ui,sans-serif;cursor:pointer}
.lf.playing{background:var(--accentSoft,#DDEEF7)}

/* 09-12 对抗检查:小屏遮挡 */
body.dlg-on .ac-btn,body.dlg-on .cb-mute{display:none!important}
.dlg .tile,.dlg .opt,.dlg .mitem,.dlg .btn,.dlg .fb,.dlg .fbrow{scroll-margin-bottom:120px}
.dlg .stage{padding-bottom:40px}
