
  :root {
    --bg: #0a0a0b;
    --surface: #121214;
    --card: #161618;
    --ink: #f5f5f7;
    --muted: #8e8e93;
    --faint: #636366;
    --accent: #ff9f0a;
    --accent-soft: rgba(255,159,10,.14);
    --ok: #30d158;
    --ok-soft: rgba(48,209,88,.12);
    --line: rgba(255,255,255,.06);
    --line-strong: rgba(255,255,255,.12);
  }
  * { box-sizing: border-box; margin: 0; padding: 0; }
  html, body { height: 100%; }
  body {
    background: #050506;
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "PingFang SC", "Helvetica Neue", sans-serif;
    color: var(--ink);
    display: flex; justify-content: center; align-items: stretch;
    padding: 0;
    -webkit-font-smoothing: antialiased;
  }
  @media (min-width: 420px) {
    body { padding: env(safe-area-inset-top, 6px) 6px env(safe-area-inset-bottom, 6px); }
  }
  .phone {
    width: 100%; max-width: 390px;
    background: var(--bg);
    border-radius: 0;
    overflow: hidden;
    border: none;
    height: 100vh;
    max-height: 844px;
    display: flex; flex-direction: column;
    box-shadow: none;
    position: relative;
  }
  @media (min-width: 420px) {
    .phone {
      border-radius: 32px;
      border: 1px solid var(--line-strong);
      height: min(844px, calc(100vh - 12px));
      box-shadow: 0 24px 80px rgba(0,0,0,.55);
    }
  }

  .top {
    flex: 0 0 auto;
    padding: 12px 18px 8px;
  }
  .title { font-size: 17px; font-weight: 650; letter-spacing: -.02em; }

  .scroll {
    flex: 1 1 auto;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    display: flex; flex-direction: column;
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE/Edge */
  }
  .scroll::-webkit-scrollbar { width: 0; height: 0; display: none; }

  .hero {
    position: relative;
    flex: 0 0 auto;
    height: clamp(260px, 42vh, 320px);
    margin: 0;
    border-radius: 0;
    overflow: hidden;
    background: #111;
  }
  .hero.compact {
    height: 120px;
    margin: 0 16px;
    border-radius: 16px;
  }
  .hero img {
    width: 100%; height: 100%; object-fit: cover; display: block;
    filter: brightness(.78) saturate(1.05);
  }
  .hero .veil {
    position: absolute; inset: 0;
    background:
      linear-gradient(180deg, rgba(10,10,11,.18) 0%, transparent 28%, rgba(10,10,11,.55) 62%, rgba(10,10,11,.92) 100%);
    pointer-events: none;
  }
  .hero-float {
    position: absolute; left: 18px; right: 18px; bottom: 18px;
    z-index: 2;
    display: flex; flex-direction: column; gap: 6px;
    pointer-events: none;
  }
  .hero-float .who {
    font-size: 11px; font-weight: 600; letter-spacing: .06em;
    text-transform: uppercase; color: rgba(255,159,10,.88);
    text-shadow: 0 1px 8px rgba(0,0,0,.35);
  }
  .hero-float .npc-line {
    display: flex; align-items: flex-start; gap: 8px;
    pointer-events: auto;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    width: fit-content; max-width: 100%;
  }
  .hero-float .npc-line .glyph {
    flex: 0 0 auto; width: 20px; height: 20px; margin-top: 2px;
    color: rgba(245,245,247,.55);
    display: grid; place-items: center;
    filter: drop-shadow(0 1px 6px rgba(0,0,0,.4));
  }
  .hero-float .npc-line svg { width: 18px; height: 18px; }
  .hero-float .npc-line.playing .glyph { color: var(--accent); }
  .hero-float .npc-line .en {
    font-size: 17px; font-weight: 560; line-height: 1.35;
    letter-spacing: -.015em; color: rgba(245,245,247,.96);
    text-shadow: 0 2px 16px rgba(0,0,0,.45);
  }
  .hero-float .npc-line:active { opacity: .88; }
  .hero-float .npc-line.playing .en { color: #fff; }
  .hero-float .npc-zh {
    font-size: 12px; line-height: 1.4;
    color: rgba(245,245,247,.42);
    text-shadow: 0 1px 8px rgba(0,0,0,.35);
    max-width: 92%;
    padding-left: 28px;
  }

  .body {
    padding: 12px 16px 20px;
    display: flex; flex-direction: column; gap: 14px;
  }

  .speak-line {
    display: flex; align-items: flex-start; gap: 8px;
    cursor: pointer; border-radius: 10px;
    padding: 2px 0; margin: 0 -2px;
    transition: background .15s ease;
    -webkit-tap-highlight-color: transparent;
    flex: 1; min-width: 0;
  }
  .speak-line:active { background: rgba(255,255,255,.03); }
  .speak-line .glyph {
    flex: 0 0 auto; width: 18px; height: 18px; margin-top: 2px;
    color: var(--faint); display: grid; place-items: center;
    transition: color .2s ease;
  }
  .speak-line.playing .glyph { color: var(--accent); }
  .speak-line .en {
    flex: 1; font-size: 15px; font-weight: 560; line-height: 1.45;
    letter-spacing: -.01em; min-width: 0;
  }
  .speak-line.playing .en { color: #fff; }

  .section-label {
    display: flex; align-items: center; justify-content: space-between;
    font-size: 12px; font-weight: 600; color: var(--muted);
    letter-spacing: .01em;
  }
  .section-label .sub { font-weight: 400; color: var(--faint); font-size: 11px; }

  .choices { display: flex; flex-direction: column; gap: 8px; }
  .choice {
    text-align: left;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 12px 48px 12px 14px;
    width: 100%;
    min-width: 0;
    overflow: hidden;
    position: relative;
    cursor: pointer;
    transition: border-color .2s ease, background .2s ease, transform .12s ease;
    -webkit-tap-highlight-color: transparent;
    appearance: none; font: inherit; color: inherit;
  }
  .choice:active { transform: scale(.985); }
  .choice.selected {
    border-color: rgba(255,159,10,.55);
    background: var(--accent-soft);
  }
  .choice .tip {
    font-size: 11px; color: var(--faint); margin-bottom: 6px;
    display: flex; align-items: center; gap: 6px;
  }
  .choice.selected .tip { color: var(--accent); }
  .choice .tip .dot {
    width: 5px; height: 5px; border-radius: 99px;
    background: currentColor; opacity: .6;
  }
  .choice-row {
    display: block;
    width: 100%; min-width: 0;
    padding-right: 0;
  }
  .choice .speak-line { width: 100%; }
  .choice .speak-line .en {
    font-size: 14px; font-weight: 560;
    overflow-wrap: anywhere; word-break: break-word;
  }
  .choice .zh {
    font-size: 12px; color: var(--muted); margin-top: 6px;
    padding-left: 26px; line-height: 1.35;
  }

  .mic-btn {
    position: absolute;
    right: 10px; top: 50%;
    transform: translateY(-50%);
    width: 36px; height: 36px;
    border-radius: 12px;
    display: grid; place-items: center;
    background: rgba(255,255,255,.07);
    border: 1px solid var(--line-strong);
    color: var(--muted);
    cursor: pointer;
    transition: color .2s ease, background .2s ease, border-color .2s ease, transform .12s ease;
    -webkit-tap-highlight-color: transparent;
    appearance: none; padding: 0;
    z-index: 2;
  }
  .mic-btn:active { transform: translateY(-50%) scale(.94); }
  .mic-btn svg { width: 18px; height: 18px; display: block; }
  .choice.selected .mic-btn {
    color: var(--ok);
    background: var(--ok-soft);
    border-color: rgba(48,209,88,.35);
  }
  .mic-btn:hover { color: var(--ink); background: rgba(255,255,255,.1); }

  button {
    appearance: none; border: none; cursor: pointer; font: inherit; color: inherit;
    -webkit-tap-highlight-color: transparent;
  }
  button:disabled { opacity: .35; cursor: not-allowed; }
  .btn {
    border-radius: 14px; padding: 14px 16px; font-size: 15px; font-weight: 600;
    letter-spacing: -.01em; transition: opacity .15s ease, transform .12s ease;
  }
  .btn:active:not(:disabled) { transform: scale(.985); }
  .btn.primary { background: var(--ink); color: #0a0a0b; }
  .btn.block { width: 100%; }

  .pass {
    background: var(--ok-soft);
    border: 1px solid rgba(48,209,88,.22);
    border-radius: 18px; padding: 20px 18px;
    cursor: pointer;
    transition: transform .12s ease, background .2s ease;
    -webkit-tap-highlight-color: transparent;
  }
  .pass:active { transform: scale(.985); }
  .pass .badge {
    font-size: 11px; font-weight: 700; color: var(--ok);
    letter-spacing: .04em; text-transform: uppercase; margin-bottom: 8px;
  }
  .pass .reaction { font-size: 15px; line-height: 1.5; font-weight: 500; }
  .pass .said { margin-top: 12px; font-size: 12px; color: var(--muted); line-height: 1.4; }
  .pass .continue {
    margin-top: 16px; padding-top: 14px; border-top: 1px solid rgba(48,209,88,.18);
    font-size: 12px; color: var(--ok); font-weight: 500;
    display: flex; align-items: center; justify-content: center; gap: 6px;
    opacity: .85;
  }
  .pass .continue svg { width: 14px; height: 14px; }

  .done {
    flex: 1; padding: 40px 24px; text-align: center;
    display: flex; flex-direction: column; gap: 12px;
    align-items: center; justify-content: center;
  }
  .done .emoji { font-size: 48px; line-height: 1; margin-bottom: 4px; }
  .done .title { font-size: 24px; font-weight: 650; letter-spacing: -.03em; }
  .done .hint { font-size: 13px; color: var(--muted); line-height: 1.55; max-width: 260px; }
  .done .xp { font-size: 13px; color: var(--accent); font-weight: 600; margin: 4px 0 12px; }

  .toast {
    position: absolute; left: 50%; top: 52px; transform: translateX(-50%);
    background: #2c2c2e; color: var(--ink); font-size: 12px;
    padding: 8px 14px; border-radius: 999px; opacity: 0; pointer-events: none;
    transition: opacity .2s ease; z-index: 10; white-space: nowrap;
    border: 1px solid var(--line-strong);
  }
  .toast.show { opacity: 1; }

  .wave {
    display: inline-flex; gap: 2px; height: 12px; align-items: flex-end;
    margin-left: 4px; vertical-align: middle;
  }
  .wave span {
    width: 2px; background: var(--accent); border-radius: 1px;
    animation: bounce .75s ease-in-out infinite;
  }
  .wave span:nth-child(2){ animation-delay:.1s }
  .wave span:nth-child(3){ animation-delay:.2s }
  .wave span:nth-child(4){ animation-delay:.3s }
  @keyframes bounce {
    0%,100% { height: 3px; opacity: .4 }
    50% { height: 11px; opacity: 1 }
  }

  .glyph svg { width: 14px; height: 14px; display: block; }

/* V7: one phone canvas on every screen, using the supplied demo's layout. */
body{align-items:center;overflow:hidden}button{font:inherit;color:inherit}button:disabled{cursor:default;opacity:.55}button:focus-visible{outline:2px solid var(--accent);outline-offset:3px}.phone{height:100dvh}.top{display:flex;align-items:center;justify-content:space-between;min-height:54px;padding:7px 14px;border-bottom:1px solid var(--line)}.top-left{display:flex;align-items:center;gap:5px;min-width:0}.top .title{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:272px}.icon-btn{border:0;background:none;display:grid;place-items:center;width:36px;height:40px;flex-shrink:0;color:var(--muted)}svg{width:20px;height:20px;flex-shrink:0}.speak-line{border:0;background:none;color:inherit;text-align:left;font:inherit}.speak-line:disabled{opacity:.65}.hero img{object-position:center 38%}.hero-float .npc-line{padding:0;margin:0}.hero-float .npc-line .en{font-size:17px}.hero-float .npc-zh{color:rgba(245,245,247,.66)}.hero.compact img{filter:brightness(.8)}.choice{cursor:default;padding-right:54px}.choice .mic-btn{width:40px;height:44px;right:7px}.choice .tip{line-height:1.4}.choice .speak-line{margin:0;padding:3px 0;min-height:30px}.choice .zh{color:#a5a5ab}.body{gap:12px}.scene-goal{font-size:11px;line-height:1.6;color:var(--muted);margin-top:2px}.eyebrow{font-size:10px;letter-spacing:1.5px;color:var(--accent);font-weight:600}.library-intro{padding:27px 20px 22px;background:radial-gradient(ellipse at 90% 0,rgba(255,159,10,.08),transparent 65%)}.library-intro h1{font-size:29px;line-height:1.5;letter-spacing:-.8px;margin:10px 0 12px;font-weight:650}.library-intro p{font-size:13px;line-height:1.85;color:var(--muted)}.library-meta{margin-top:20px;display:flex;justify-content:space-between;font-size:11px;color:var(--faint)}.collection-tabs{display:flex;gap:6px;padding:12px 16px 15px;background:var(--bg);position:sticky;top:0;z-index:5}.collection-tabs button{border:1px solid var(--line-strong);background:none;color:var(--muted);border-radius:9px;min-height:36px;padding:6px 12px;font-size:12px}.collection-tabs button.active{color:var(--accent);background:var(--accent-soft);border-color:rgba(255,159,10,.28)}.lesson-list{padding:0 16px;display:flex;flex-direction:column;gap:10px}.lesson-card{width:100%;display:flex;align-items:center;gap:13px;padding:10px;background:var(--card);border:1px solid var(--line);border-radius:14px;text-align:left;cursor:pointer}.lesson-card:active{border-color:var(--accent)}.lesson-card img{width:82px;height:100px;object-fit:cover;object-position:50% 35%;border-radius:8px;flex-shrink:0;background:#222}.lesson-copy{display:flex;flex-direction:column;gap:6px;flex:1;min-width:0}.lesson-copy strong{font-size:15px;font-weight:600;line-height:1.4}.lesson-tag{font-size:10px;color:var(--faint)}.lesson-copy>span:not(.lesson-tag):not(.lesson-state){font-size:11px;color:var(--muted);line-height:1.5}.lesson-state{display:flex;align-items:center;gap:4px;font-size:11px;color:var(--accent);margin-top:3px}.lesson-state.complete{color:var(--ok)}.lesson-state svg{width:12px;height:12px}.lesson-card>svg{width:14px;color:var(--faint)}.library-foot{text-align:center;font-size:10px;line-height:1.9;color:var(--faint);padding:26px 15px 30px}.resume{display:flex;align-items:center;justify-content:space-between;margin:0 16px 6px;padding:13px 15px;background:var(--accent-soft);border:1px solid rgba(255,159,10,.18);border-radius:12px;text-align:left;color:var(--accent)}.resume span{font-size:10px}.resume strong{display:block;font-size:14px;color:var(--ink);margin-top:5px}.lesson-subbar{padding:7px 18px;display:flex;align-items:center;justify-content:space-between;flex-shrink:0;color:var(--faint);font-size:10px}.lesson-subbar button{border:0;background:none;color:var(--muted);font-size:10px;padding:4px;min-height:26px}.primary-btn{display:flex;align-items:center;justify-content:center;gap:9px;border:0;border-radius:12px;background:var(--accent);color:#15110a;padding:14px 16px;width:100%;font-size:14px;font-weight:650;min-height:48px;cursor:pointer}.primary-btn svg{width:17px;height:17px}.text-btn{background:none;border:0;color:var(--muted);font-size:12px;min-height:44px;display:flex;align-items:center;justify-content:center;gap:7px;cursor:pointer}.text-btn svg{width:14px;height:14px}.self-panel{display:flex;flex-direction:column;text-align:center;gap:2px;padding:12px 0 0;border-top:1px solid var(--line);color:var(--faint);font-size:11px}.self-panel .text-btn{color:var(--accent)}.record-panel{padding:18px 15px;border:1px solid rgba(255,159,10,.24);border-radius:14px;background:var(--accent-soft);text-align:center;scroll-margin:16px}.record-panel p{font-size:12px;color:var(--muted);line-height:1.7;margin:10px 0 15px}.record-panel>.text-btn{width:100%;margin-top:5px}.record-status{display:flex;align-items:center;justify-content:center;gap:8px;font-size:13px;color:var(--ink)}.record-dot{width:7px;height:7px;background:#ff6257;border-radius:50%;animation:record-pulse 1.3s ease infinite}#record-clock{font-variant-numeric:tabular-nums;color:var(--muted)}@keyframes record-pulse{50%{opacity:.35}}.review{padding-top:23px;gap:14px}.review-label{color:var(--ok);font-size:12px;display:flex;align-items:center;gap:7px}.review-label svg{width:17px;height:17px}.review>.speak-line .en{font-size:20px;line-height:1.6}.review-zh{font-size:13px;color:var(--muted);padding-left:26px;line-height:1.7;margin-top:-6px}.own-audio{display:flex;align-items:center;gap:9px;padding:16px 13px;background:var(--card);border:1px solid var(--line-strong);border-radius:12px;font-size:13px;text-align:left}.own-audio small{margin-left:auto;color:var(--faint);font-size:11px}.own-audio.playing{border-color:var(--accent);color:var(--accent)}.review-note{font-size:12px;line-height:1.8;color:var(--muted);margin:10px 0 0}.review-actions{display:flex;justify-content:space-between}.review-actions .text-btn{min-width:100px}.completion{padding-top:24px;gap:16px}.completion h1{font-size:24px;line-height:1.5;font-weight:650}.completion>.speak-line .en{font-size:16px}.completion-zh{font-size:13px;line-height:1.8;color:var(--muted)}.completion-count{display:flex;align-items:center;gap:15px;border-block:1px solid var(--line);padding:18px 0}.completion-count strong{font-size:38px;font-weight:500;color:var(--accent)}.completion-count span{font-size:12px;line-height:1.8}.completion-count small{font-size:10px;color:var(--faint)}.said-list h2{font-size:12px;font-weight:500;color:var(--muted);margin-bottom:8px}.said-item{display:flex;gap:10px;border-bottom:1px solid var(--line);padding:14px 0}.said-item>span{font-size:10px;color:var(--faint);padding-top:7px}.said-item>div{flex:1;min-width:0}.said-item .en{font-size:14px}.said-item p{padding-left:26px;font-size:11px;line-height:1.7;color:var(--muted);margin:4px 0}.said-item small{font-size:9px;color:var(--faint);padding-left:26px}.muted{color:var(--muted)}#help{margin:auto;width:min(358px,calc(100vw - 32px));max-height:calc(100dvh - 50px);overflow:auto;border:1px solid var(--line-strong);border-radius:18px;background:#161618;color:var(--ink);padding:30px 24px;font-size:13px;line-height:1.9}#help::backdrop{background:rgba(0,0,0,.7)}#help h2{font-size:23px;margin:7px 0 16px}#help ol{padding-left:20px}#help li{margin-bottom:10px}#help p{font-size:12px;margin:16px 0}#help .primary-btn{margin-top:24px}.help-close{position:absolute;right:12px;top:6px;font-size:24px;color:var(--muted);border:0;background:none;width:36px;height:40px}.toast{position:fixed;left:50%;bottom:30px;top:auto;width:min(350px,calc(100vw - 32px));max-width:350px;margin:0;transform:translate(-50%,10px);z-index:100;line-height:1.7;font-size:12px;pointer-events:none}.toast.show{transform:translate(-50%,0)}
@media(min-width:420px){.phone{height:min(844px,calc(100dvh - 12px))}}@media(max-width:360px){.hero-float .npc-line .en{font-size:16px}.choice .speak-line .en{font-size:13px}.library-intro h1{font-size:27px}.top .title{max-width:220px}.lesson-card{gap:10px}.lesson-card img{width:72px}.lesson-copy strong{font-size:14px}}@media(prefers-reduced-motion:reduce){*,*::before,*::after{animation:none!important;transition:none!important;scroll-behavior:auto!important}}

/* Recording stays in the current response card; no scene replacement or automatic scroll. */
.scroll{overflow-anchor:none}.choice .mic-btn{top:30px;transform:none}.choice .mic-btn:active{transform:scale(.94)}.choice.is-recording .mic-btn{color:#ff6257;background:rgba(255,98,87,.13);border-color:rgba(255,98,87,.5)}.inline-practice:empty{display:none}.inline-practice{margin-right:-40px;margin-top:12px;padding-top:10px;border-top:1px solid var(--line-strong)}.inline-status{font-size:11px;line-height:1.7;color:var(--muted);display:flex;align-items:center;gap:6px}.inline-status svg{width:14px;height:14px}.recording-status{color:#ff8a81;flex-wrap:wrap}.recording-status #record-clock{margin-left:auto;font-size:10px}.recorded-status{color:var(--ok)}.inline-actions{display:flex;align-items:center;gap:8px;margin-top:7px}.inline-link{display:inline-flex;align-items:center;justify-content:center;gap:4px;min-height:40px;background:none;border:0;padding:4px 2px;font-size:12px;color:var(--muted);cursor:pointer}.inline-link svg{width:14px;height:14px}.inline-practice .own-audio{border:0;background:none;padding:4px 2px;min-height:40px;border-radius:5px;font-size:12px}.inline-confirm{display:flex;align-items:center;justify-content:center;gap:3px;margin-left:auto;background:var(--accent);color:#17110a;border:0;border-radius:8px;min-height:40px;padding:8px 12px;font-size:12px;font-weight:600;cursor:pointer}.inline-confirm svg{width:13px;height:13px}.inline-error{font-size:11px;line-height:1.8;color:#ffb5ac}.choice.has-recording{border-color:rgba(48,209,88,.35)}
