/* =========================================================
   style.css —— 红狼教官 · 三角洲英语特训营
   深色军事 HUD 风格 · 橙色高亮 · 对孩子依然友好温暖
   ========================================================= */

:root {
  --bg: #0E1116;
  --bg2: #131820;
  --panel: #171D26;
  --panel2: #1D242F;
  --line: #2A3340;
  --line2: #39445333;
  --ink: #E8EDF4;
  --ink-dim: #93A3BC;
  --ink-faint: #5D6B80;
  --orange: #FF7A1A;
  --orange2: #FF9A47;
  --amber: #FFC53D;
  --green: #4ADE80;
  --red: #FF5A5A;
  --blue: #4DA3FF;
  --radius: 14px;
  --font: "Microsoft YaHei", "PingFang SC", "Segoe UI", system-ui, sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
}
body { min-height: 100vh; overflow-x: hidden; }
button { font-family: inherit; }

/* ============ 背景：战术网格 + 雷达 ============ */
.bg { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }

.grid-overlay {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(77,163,255,.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(77,163,255,.05) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: radial-gradient(ellipse 90% 70% at 50% 30%, #000 30%, transparent 100%);
}

.radar {
  position: absolute; top: -140px; right: -140px;
  width: 460px; height: 460px; border-radius: 50%;
  border: 1px solid rgba(255,122,26,.16);
  background:
    radial-gradient(circle, rgba(255,122,26,.06) 0%, transparent 62%);
}
.radar::before, .radar::after {
  content: ""; position: absolute; border-radius: 50%;
  border: 1px dashed rgba(255,122,26,.14);
}
.radar::before { inset: 70px; }
.radar::after { inset: 150px; }
.radar-sweep {
  position: absolute; inset: 0; border-radius: 50%;
  background: conic-gradient(from 0deg, rgba(255,122,26,.22), transparent 70deg, transparent 360deg);
  animation: sweep 7s linear infinite;
}
@keyframes sweep { to { transform: rotate(360deg); } }
.radar-dot {
  position: absolute; width: 6px; height: 6px; border-radius: 50%;
  background: var(--orange); box-shadow: 0 0 10px var(--orange);
  animation: blip 4s ease-in-out infinite;
}
.radar-dot.d1 { top: 34%; left: 44%; }
.radar-dot.d2 { top: 58%; left: 28%; animation-delay: 1.4s; }
.radar-dot.d3 { top: 22%; left: 68%; animation-delay: 2.6s; }
@keyframes blip { 0%, 100% { opacity: .15; } 50% { opacity: .9; } }

.scanline {
  position: absolute; left: 0; right: 0; height: 120px; top: -120px;
  background: linear-gradient(180deg, transparent, rgba(77,163,255,.045), transparent);
  animation: scan 9s linear infinite;
}
@keyframes scan { to { transform: translateY(calc(100vh + 240px)); } }

.hazard {
  position: absolute; left: 0; right: 0; height: 10px; opacity: .5;
  background: repeating-linear-gradient(-45deg, #FF7A1A 0 14px, #161B22 14px 28px);
}
.hazard-top { top: 0; }
.hazard-bottom { bottom: 0; }

.floaters span {
  position: absolute; bottom: -40px; left: var(--x);
  font-size: calc(14px * var(--s)); color: var(--orange);
  opacity: .22;
  animation: floatUp calc(16s / var(--s)) linear infinite;
  animation-delay: var(--d);
}
@keyframes floatUp {
  from { transform: translateY(0) rotate(0deg); }
  to { transform: translateY(-108vh) rotate(24deg); }
}

.fx-layer { position: fixed; inset: 0; pointer-events: none; z-index: 60; }
.confetti-piece {
  position: absolute; width: 9px; height: 14px; border-radius: 2px;
  animation: fall 2.8s ease-in forwards;
}
@keyframes fall {
  to { transform: translateY(105vh) rotate(720deg); opacity: .2; }
}

/* ============ Toast ============ */
.toast {
  position: fixed; top: 18px; left: 50%; transform: translate(-50%, -90px);
  z-index: 90; padding: 12px 22px; border-radius: 12px;
  background: #202836; border: 1px solid var(--line);
  color: var(--ink); font-size: 14px; font-weight: 600;
  box-shadow: 0 12px 32px rgba(0,0,0,.5);
  transition: transform .3s cubic-bezier(.34,1.56,.64,1);
  max-width: min(88vw, 480px); text-align: center;
}
.toast.show { transform: translate(-50%, 0); }
.toast.good { border-color: var(--green); color: var(--green); }
.toast.bad { border-color: var(--red); color: var(--red); }
.toast.info { border-color: var(--blue); color: var(--blue); }

.env-warn {
  position: relative; z-index: 5; margin: 12px auto 0; max-width: 860px;
  padding: 12px 18px; border-radius: 12px;
  background: #3A2B14; border: 1px solid #8A6420; color: #FFD98A;
  font-size: 13.5px; line-height: 1.7;
}

/* ============ 应用框架 ============ */
.app {
  position: relative; z-index: 5;
  max-width: 880px; margin: 0 auto;
  padding: 20px 20px 128px;
}

/* ============ 顶栏 ============ */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 14px; flex-wrap: wrap;
  padding: 16px 18px;
  background: linear-gradient(135deg, var(--panel) 0%, var(--bg2) 100%);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  clip-path: polygon(0 0, calc(100% - 22px) 0, 100% 22px, 100% 100%, 22px 100%, 0 calc(100% - 22px));
}
.brand { display: flex; align-items: center; gap: 14px; }
.mascot {
  width: 84px; height: 92px; flex: 0 0 auto;
  display: flex; align-items: center; justify-content: center;
  filter: drop-shadow(0 6px 14px rgba(226,59,59,.28));
  transition: transform .3s cubic-bezier(.34,1.56,.64,1);
}
.mascot.happy { animation: cheer .9s cubic-bezier(.34,1.56,.64,1); }
@keyframes cheer {
  0% { transform: scale(1); } 30% { transform: scale(1.18) rotate(-6deg); }
  60% { transform: scale(1.1) rotate(5deg); } 100% { transform: scale(1); }
}
.wolf { width: 100%; height: 100%; }
.wolf .mouth { transform-origin: 60px 100px; }
.wolf.talking .mouth { animation: woof .32s ease-in-out infinite alternate; }
@keyframes woof { from { transform: scaleY(.6); } to { transform: scaleY(1.25); } }

.brand-text h1 {
  margin: 0; font-size: 26px; letter-spacing: 2px; font-weight: 900;
  background: linear-gradient(90deg, #FF9A47, #FFC53D);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.brand-text p {
  margin: 4px 0 0; font-size: 12px; letter-spacing: 3px;
  color: var(--ink-faint); font-weight: 700; text-transform: uppercase;
}

.stats { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.stat {
  display: flex; align-items: center; gap: 6px;
  padding: 8px 12px; border-radius: 10px;
  background: var(--panel2); border: 1px solid var(--line);
  font-size: 15px; font-weight: 800;
}
.stat span { font-size: 16px; }
.stat b { min-width: 18px; text-align: center; }
.stat-star b { color: var(--amber); }
.stat-fire b { color: var(--orange); }
.stat-grade b { color: var(--blue); font-size: 14px; }
.stat.pop { animation: statPop .5s cubic-bezier(.34,1.56,.64,1); }
@keyframes statPop { 40% { transform: scale(1.22); } }

/* ============ 军衔徽章（顶栏） ============ */
.stat-rank {
  cursor: pointer; padding: 7px 12px; gap: 9px; border-color: #6B4A1B;
  background: linear-gradient(135deg, #33210D, #241806);
  transition: transform .15s, border-color .15s;
}
.stat-rank:hover { transform: translateY(-2px); border-color: var(--amber); }
.stat-rank > span { font-size: 20px; }
.rank-box { display: flex; flex-direction: column; gap: 2px; min-width: 74px; }
.rank-box b { color: var(--amber); font-size: 13.5px; }
.rank-bar {
  height: 5px; border-radius: 4px; overflow: hidden;
  background: rgba(255,197,61,.15); border: 1px solid rgba(255,197,61,.25);
}
.rank-bar i {
  display: block; height: 100%; width: 0;
  background: linear-gradient(90deg, var(--amber), var(--orange));
  transition: width .5s ease;
}
.rank-box em { font-style: normal; font-size: 10px; color: var(--ink-faint); font-weight: 700; }

/* ============ 成就墙 ============ */
.ach-summary {
  padding: 11px 15px; border-radius: 10px;
  background: linear-gradient(135deg, #33210D, #241806);
  border: 1px solid #6B4A1B; color: #FFD98A;
  font-size: 13.5px; font-weight: 800;
}
.rank-road {
  display: flex; gap: 6px; justify-content: space-between; margin: 4px 0 2px;
}
.rank-node {
  flex: 1; text-align: center; padding: 9px 4px 7px; border-radius: 10px;
  background: var(--bg2); border: 1px solid var(--line); opacity: .55;
}
.rank-node.reached { opacity: 1; border-color: #6B4A1B; background: #241806; }
.rank-node.current { border-color: var(--amber); box-shadow: 0 0 0 1px rgba(255,197,61,.35); }
.rank-node-icon { font-size: 22px; }
.rank-node-name { font-size: 12px; font-weight: 900; color: var(--ink); margin-top: 3px; }
.rank-node.ach-node-current .rank-node-name { color: var(--amber); }
.rank-node-need { font-size: 10.5px; color: var(--ink-faint); font-weight: 700; margin-top: 1px; }
.ach-list {
  display: grid; grid-template-columns: 1fr 1fr; gap: 8px;
  margin-top: 12px;
}
.ach-item {
  display: flex; gap: 10px; align-items: center;
  padding: 10px 12px; border-radius: 11px;
  background: var(--bg2); border: 1px solid var(--line);
  filter: grayscale(1); opacity: .55;
}
.ach-item.got { filter: none; opacity: 1; border-color: #6B4A1B; background: #241806; }
.ach-icon { font-size: 26px; flex: 0 0 auto; }
.ach-info { min-width: 0; }
.ach-name { font-size: 13.5px; font-weight: 900; color: var(--ink); }
.ach-item.got .ach-name { color: var(--amber); }
.ach-desc { font-size: 11.5px; color: var(--ink-dim); margin-top: 2px; line-height: 1.5; }
.ach-date { font-size: 10.5px; color: var(--ink-faint); font-weight: 700; margin-top: 3px; }

.icon-btn {
  width: 40px; height: 40px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--panel2); font-size: 18px; cursor: pointer;
  transition: transform .15s, border-color .15s;
}
.icon-btn:hover { transform: translateY(-2px); border-color: var(--orange); }

/* ============ 通讯气泡 ============ */
.hintbar { display: flex; align-items: stretch; gap: 10px; margin-top: 14px; }
.bubble {
  flex: 1 1 auto; display: flex; align-items: center;
  padding: 13px 18px; border-radius: 12px;
  background: linear-gradient(135deg, #232B18 0%, #1B2312 100%);
  border: 1px solid #4A5A26;
  border-left: 4px solid var(--green);
  color: #D8F0BE; font-size: 15px; font-weight: 600; line-height: 1.55;
  min-height: 52px;
}
.bubble.flash { animation: bubbleFlash .6s ease; }
@keyframes bubbleFlash { 0% { background: rgba(74,222,128,.25); } }
.topic-chip {
  flex: 0 0 auto; display: flex; flex-direction: column; justify-content: center;
  padding: 6px 16px; border-radius: 12px; text-align: center;
  background: var(--panel2); border: 1px solid var(--line);
  font-size: 11px; color: var(--ink-faint); font-weight: 700; letter-spacing: 1px;
}
.topic-chip b { font-size: 14px; color: var(--orange2); margin-top: 2px; }

/* ============ 舞台 ============ */
.stage-wrap { margin-top: 16px; }
.stage { display: none; }
.stage.active { display: block; animation: stageIn .35s ease; }
@keyframes stageIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}

.sub-tabs { display: flex; gap: 8px; margin-bottom: 12px; }
.sub-panel { display: none; }
.sub-panel.active { display: block; animation: stageIn .3s ease; }
.sub-tab {
  flex: 1; padding: 11px 10px; border-radius: 10px; cursor: pointer;
  background: var(--panel); border: 1px solid var(--line);
  color: var(--ink-dim); font-size: 14px; font-weight: 800; letter-spacing: 1px;
  transition: all .18s;
}
.sub-tab:hover { border-color: var(--orange); color: var(--ink); }
.sub-tab.active {
  background: linear-gradient(135deg, #4A2C10, #33210D);
  border-color: var(--orange); color: var(--orange2);
  box-shadow: 0 0 0 1px rgba(255,122,26,.25), 0 4px 14px rgba(255,122,26,.12);
}

.panel-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; flex-wrap: wrap; margin-bottom: 12px;
}
.panel-title {
  font-size: 17px; font-weight: 900; letter-spacing: 1px; color: var(--ink);
  padding-left: 12px; border-left: 4px solid var(--orange);
}
.head-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.quiz-score { font-size: 13px; color: var(--ink-dim); font-weight: 700; }
.quiz-score b { color: var(--amber); font-size: 17px; }

.mini-btn {
  padding: 8px 14px; border-radius: 9px; cursor: pointer;
  background: var(--panel2); border: 1px solid var(--line);
  color: var(--ink); font-size: 13px; font-weight: 700;
  transition: all .15s;
}
.mini-btn:hover { border-color: var(--orange); transform: translateY(-1px); }
.mini-btn.on { background: #33210D; border-color: var(--orange); color: var(--orange2); }

/* ============ 卡片通用 ============ */
.mission-card, .sentence-card, .quiz-card, .fix-input-card {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 18px;
  clip-path: polygon(0 0, calc(100% - 16px) 0, 100% 16px, 100% 100%, 16px 100%, 0 calc(100% - 16px));
}
.mission-loading, .sentence-loading, .quiz-loading {
  text-align: center; padding: 34px 10px; color: var(--ink-dim);
  font-size: 14.5px; font-weight: 600;
}
.mission-title {
  display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap;
  margin-bottom: 12px;
}
.mission-title span {
  font-size: 19px; font-weight: 900; color: var(--amber); letter-spacing: .5px;
}
.mission-title i { font-style: normal; font-size: 13px; color: var(--ink-faint); font-weight: 600; }

.mission-audio { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.listen-note { font-size: 12.5px; color: var(--ink-faint); font-weight: 600; }

.mission-transcript, .mission-transcript-cn {
  padding: 12px 14px; border-radius: 10px; margin-bottom: 12px;
  background: var(--bg2); border: 1px dashed var(--line);
  font-size: 16px; line-height: 1.8; color: var(--ink);
}
.mission-transcript-cn { font-size: 13.5px; color: var(--ink-dim); }

.mission-progress { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.progress-wrap { margin-bottom: 14px; }
.progress-bar {
  flex: 1; height: 8px; border-radius: 6px; overflow: hidden;
  background: var(--bg2); border: 1px solid var(--line);
}
.progress-bar i {
  display: block; height: 100%; width: 0;
  background: linear-gradient(90deg, var(--orange), var(--amber));
  transition: width .4s ease;
}
.mission-progress span, .progress-text {
  font-size: 12px; color: var(--ink-faint); font-weight: 800; letter-spacing: 1px;
  white-space: nowrap;
}
.progress-text { text-align: right; margin-top: 6px; }

.mission-q { font-size: 17px; font-weight: 800; line-height: 1.6; }
.mission-qcn { font-size: 13.5px; color: var(--ink-dim); margin: 4px 0 14px; font-weight: 600; }

/* ============ 选项 ============ */
.options {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px;
}
.opt-btn {
  padding: 14px 12px; border-radius: 11px; cursor: pointer;
  background: var(--panel2); border: 1.5px solid var(--line);
  color: var(--ink); font-size: 16px; font-weight: 700;
  transition: all .15s;
}
.opt-btn:hover:not(:disabled) { border-color: var(--orange); transform: translateY(-2px); }
.opt-btn.right {
  background: rgba(74,222,128,.14); border-color: var(--green); color: var(--green);
  animation: optPulse .5s ease;
}
.opt-btn.wrong {
  background: rgba(255,90,90,.12); border-color: var(--red); color: var(--red);
  animation: shake .4s ease;
}
.opt-btn.dim { opacity: .38; }
@keyframes optPulse { 40% { transform: scale(1.05); } }
@keyframes shake { 25% { transform: translateX(-5px); } 75% { transform: translateX(5px); } }

.quiz-blank {
  display: inline-block; min-width: 64px; text-align: center;
  padding: 0 8px; margin: 0 3px; border-radius: 8px;
  background: rgba(255,122,26,.12); border: 1.5px dashed var(--orange);
  color: var(--orange2); font-weight: 900;
}
.quiz-blank.filled { border-style: solid; }

.quiz-feedback {
  margin-top: 14px; padding: 13px 16px; border-radius: 11px;
  font-size: 14.5px; line-height: 1.75; font-weight: 600;
}
.quiz-feedback.good { background: rgba(74,222,128,.1); border: 1px solid rgba(74,222,128,.4); color: #B7F0CB; }
.quiz-feedback.bad { background: rgba(255,197,61,.08); border: 1px solid rgba(255,197,61,.35); color: #FFE3A0; }
.fb-title { display: block; font-weight: 900; font-size: 15.5px; margin-bottom: 4px; }

.quiz-next-wrap { display: flex; justify-content: center; margin-top: 16px; }
.quiz-done { text-align: center; padding: 18px 8px; }
.quiz-done .big { font-size: 52px; }
.quiz-done h3 { margin: 8px 0 6px; font-size: 20px; color: var(--amber); }
.quiz-done p { margin: 0; color: var(--ink-dim); font-size: 14.5px; font-weight: 600; }

/* ============ 按钮 ============ */
.primary-btn {
  padding: 13px 26px; border: none; border-radius: 11px; cursor: pointer;
  background: linear-gradient(135deg, var(--orange), #E85D04);
  color: #FFF; font-size: 15.5px; font-weight: 900; letter-spacing: 1px;
  box-shadow: 0 5px 0 #A33E00, 0 10px 22px rgba(255,122,26,.3);
  transition: transform .12s, box-shadow .12s;
}
.primary-btn:hover { transform: translateY(-2px); }
.primary-btn:active { transform: translateY(3px); box-shadow: 0 2px 0 #A33E00; }
.primary-btn:disabled { opacity: .55; cursor: wait; transform: none; }
.primary-btn.lg { padding: 15px 40px; font-size: 17px; }

.ghost-btn {
  padding: 10px 18px; border-radius: 10px; cursor: pointer;
  background: transparent; border: 1px solid var(--line);
  color: var(--ink-dim); font-size: 13.5px; font-weight: 700;
}
.ghost-btn:hover { border-color: var(--red); color: var(--red); }

.round-btn {
  width: 44px; height: 44px; border-radius: 50%; cursor: pointer;
  background: var(--panel2); border: 1.5px solid var(--line);
  color: var(--ink); font-size: 18px;
  display: inline-flex; align-items: center; justify-content: center;
  transition: all .15s;
}
.round-btn:hover { border-color: var(--orange); transform: scale(1.08); }

/* ============ 聊天 ============ */
.chat-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.chat-title { font-size: 17px; font-weight: 900; letter-spacing: 1px; padding-left: 12px; border-left: 4px solid var(--orange); }
.chat-log {
  height: 340px; overflow-y: auto; padding: 14px;
  background: var(--bg2); border: 1px solid var(--line); border-radius: var(--radius);
  display: flex; flex-direction: column; gap: 12px;
  scroll-behavior: smooth;
}
.msg { display: flex; gap: 10px; align-items: flex-start; }
.msg.me { flex-direction: row-reverse; }
.avatar {
  width: 38px; height: 38px; flex: 0 0 auto; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; font-size: 19px;
  background: var(--panel2); border: 1px solid var(--line);
}
.msg.me .avatar { background: #22314A; border-color: #33507A; }
.bubble-msg {
  max-width: 78%; padding: 11px 15px; border-radius: 13px;
  background: var(--panel2); border: 1px solid var(--line);
  font-size: 15px; line-height: 1.7;
}
.msg.me .bubble-msg { background: #22314A; border-color: #33507A; }
.msg-en { font-weight: 700; }
.msg-cn { margin-top: 7px; padding-top: 7px; border-top: 1px dashed var(--line); color: var(--ink-dim); font-size: 13.5px; }
.msg-tip { margin-top: 7px; font-size: 13px; color: var(--amber); font-weight: 600; }
.msg-tools { margin-top: 8px; display: flex; gap: 8px; flex-wrap: wrap; }
.tool-btn {
  padding: 5px 11px; border-radius: 8px; cursor: pointer; font-size: 12px; font-weight: 700;
  background: transparent; border: 1px solid var(--line); color: var(--ink-dim);
}
.tool-btn:hover { border-color: var(--orange); color: var(--orange2); }
.tool-btn.on { border-color: var(--orange); color: var(--orange2); }

.typing { display: inline-flex; gap: 5px; padding: 4px 0; }
.typing i {
  width: 8px; height: 8px; border-radius: 50%; background: var(--ink-faint);
  animation: blink 1.2s ease-in-out infinite;
}
.typing i:nth-child(2) { animation-delay: .18s; }
.typing i:nth-child(3) { animation-delay: .36s; }
@keyframes blink { 40% { transform: translateY(-5px); opacity: 1; } }

.chips { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.chips-lite { margin-top: 12px; }
.chip {
  padding: 8px 14px; border-radius: 999px; cursor: pointer;
  background: var(--panel2); border: 1px solid var(--line);
  color: var(--ink-dim); font-size: 13px; font-weight: 600;
  transition: all .15s;
}
.chip:hover { border-color: var(--orange); color: var(--orange2); transform: translateY(-1px); }

.composer { display: flex; gap: 10px; margin-top: 12px; align-items: center; }
.input {
  flex: 1; padding: 13px 16px; border-radius: 11px; outline: none;
  background: var(--bg2); border: 1.5px solid var(--line);
  color: var(--ink); font-size: 15px; font-family: inherit;
  transition: border-color .15s;
}
.input:focus { border-color: var(--orange); }
.textarea { resize: vertical; min-height: 74px; line-height: 1.7; width: 100%; }
.send-btn {
  padding: 13px 22px; border-radius: 11px; border: none; cursor: pointer;
  background: linear-gradient(135deg, var(--orange), #E85D04);
  color: #FFF; font-weight: 900; font-size: 14.5px;
  box-shadow: 0 4px 0 #A33E00;
  transition: transform .12s;
}
.send-btn:active { transform: translateY(3px); box-shadow: none; }
.send-btn:disabled { opacity: .55; }

/* ============ 麦克风 ============ */
.mic-btn {
  position: relative; width: 64px; height: 64px; flex: 0 0 auto;
  border-radius: 50%; border: none; cursor: pointer;
  background: linear-gradient(135deg, var(--orange), #E85D04);
  box-shadow: 0 5px 0 #A33E00, 0 10px 24px rgba(255,122,26,.35);
  transition: transform .15s;
}
.mic-btn.mic-sm { width: 52px; height: 52px; }
.mic-btn:hover { transform: scale(1.06); }
.mic-btn.disabled { opacity: .5; cursor: not-allowed; }
.mic-icon { font-size: 24px; }
.mic-ring {
  position: absolute; inset: -4px; border-radius: 50%;
  border: 3px solid rgba(255,122,26,.5); opacity: 0; pointer-events: none;
}
.mic-btn.recording .mic-ring { animation: ring 1.4s ease-out infinite; }
.mic-btn.recording .mic-ring.r2 { animation-delay: .7s; }
@keyframes ring {
  0% { transform: scale(1); opacity: .8; }
  100% { transform: scale(1.65); opacity: 0; }
}
.repeat-bottom { display: flex; align-items: center; gap: 16px; justify-content: center; margin-top: 16px; }
.mic-hint { font-size: 14px; color: var(--ink-dim); font-weight: 700; }
.mic-hint.live { color: var(--orange2); animation: blink2 1s ease-in-out infinite; }
@keyframes blink2 { 50% { opacity: .55; } }

/* ============ 跟读句子卡 ============ */
.sentence-card { text-align: left; }
.sentence-body { animation: stageIn .3s ease; }
.sentence-en { font-size: 26px; font-weight: 900; line-height: 1.55; color: var(--amber); }
.sentence-cn { margin-top: 8px; font-size: 14px; color: var(--ink-dim); font-weight: 600; }
.sentence-tools { display: flex; gap: 10px; margin-top: 14px; }

.score-card {
  margin-top: 18px; display: flex; gap: 18px; align-items: center;
  padding: 18px; border-radius: var(--radius);
  background: var(--panel); border: 1px solid var(--line);
  animation: stageIn .35s ease;
}
.score-ring { position: relative; width: 108px; height: 108px; flex: 0 0 auto; }
.ring-bg { fill: none; stroke: var(--bg2); stroke-width: 9; }
.ring-fg {
  fill: none; stroke: var(--orange); stroke-width: 9; stroke-linecap: round;
  stroke-dasharray: 327; stroke-dashoffset: 327;
  transform: rotate(-90deg); transform-origin: center;
  transition: stroke-dashoffset .8s cubic-bezier(.22,1,.36,1), stroke .4s;
}
.score-num {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  gap: 3px; font-weight: 900;
}
.score-num b { font-size: 34px; color: var(--ink); }
.score-num i { font-style: normal; font-size: 13px; color: var(--ink-faint); }
.score-detail { flex: 1; min-width: 0; }
.score-stars { font-size: 22px; letter-spacing: 4px; min-height: 30px; }
.word-chips { display: flex; flex-wrap: wrap; gap: 7px; margin: 8px 0; }
.wchip {
  padding: 5px 11px; border-radius: 8px; font-size: 14.5px; font-weight: 700;
  background: var(--panel2); border: 1px solid var(--line); color: var(--ink);
}
.wchip.good { background: rgba(74,222,128,.12); border-color: rgba(74,222,128,.5); color: var(--green); }
.wchip.close { background: rgba(255,197,61,.1); border-color: rgba(255,197,61,.5); color: var(--amber); }
.wchip.miss { background: rgba(255,90,90,.1); border-color: rgba(255,90,90,.5); color: var(--red); }
.score-say { font-size: 14px; color: var(--ink-dim); line-height: 1.7; font-weight: 600; }

/* ============ 病句门诊 ============ */
.fix-input-card .fix-actions { margin-top: 12px; display: flex; justify-content: flex-end; }
.fix-result { margin-top: 16px; }
.fix-block {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px 18px; margin-bottom: 12px;
}
.fix-block h3 {
  margin: 0 0 10px; font-size: 14px; letter-spacing: 1px;
  color: var(--ink-faint); font-weight: 800;
  display: flex; align-items: center; gap: 10px;
}
.fix-sentence { font-size: 18px; font-weight: 800; line-height: 1.7; }
.fix-sentence .del { background: rgba(255,90,90,.16); color: var(--red); text-decoration: line-through; padding: 1px 5px; border-radius: 5px; }
.fix-sentence .ins { background: rgba(74,222,128,.14); color: var(--green); padding: 1px 5px; border-radius: 5px; }
.err-item { display: flex; gap: 12px; align-items: flex-start; padding: 9px 0; }
.err-item + .err-item { border-top: 1px dashed var(--line); }
.err-badge {
  width: 24px; height: 24px; flex: 0 0 auto; border-radius: 50%;
  background: var(--orange); color: #FFF; font-size: 13px; font-weight: 900;
  display: flex; align-items: center; justify-content: center;
}
.err-body { font-size: 14.5px; line-height: 1.7; }
.err-body .w { color: var(--red); font-weight: 800; }
.err-body .r { color: var(--green); font-weight: 800; }
.err-body .why { display: block; color: var(--ink-dim); font-size: 13.5px; margin-top: 2px; }
.fix-ok { text-align: center; padding: 30px 16px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); }
.fix-ok .big { font-size: 56px; }
.fix-ok h3 { margin: 10px 0 6px; font-size: 21px; color: var(--green); }
.fix-ok p { margin: 0; color: var(--ink-dim); font-weight: 600; }
.praise-bar {
  display: flex; align-items: center; gap: 10px;
  padding: 13px 18px; border-radius: 11px;
  background: linear-gradient(135deg, #3A2B14, #2A1F0E);
  border: 1px solid #8A6420; color: #FFD98A; font-size: 14.5px; font-weight: 700;
}

/* ============ 作文特训 ============ */
.write-prompt {
  font-size: 17px; font-weight: 800; line-height: 1.7; color: var(--amber);
  margin-bottom: 6px;
}
.write-prompt-en { font-size: 13.5px; color: var(--ink-faint); font-weight: 600; margin-bottom: 6px; }
.write-toolrow { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 12px; }
#writeInput { margin-top: 12px; width: 100%; }
.write-card .fix-actions { margin-top: 12px; display: flex; justify-content: flex-end; }
.write-result { margin-top: 16px; }
.wr-score {
  display: flex; gap: 18px; align-items: center;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px; margin-bottom: 12px;
}
.wr-strengths { margin-bottom: 12px; }
.wr-strengths li { margin: 6px 0; line-height: 1.7; font-size: 14.5px; }
.wr-strengths { padding-left: 22px; color: var(--ink); font-weight: 600; }
.wr-block {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px 18px; margin-bottom: 12px;
}
.wr-block h3 { margin: 0 0 10px; font-size: 14px; letter-spacing: 1px; color: var(--ink-faint); font-weight: 800; }
.wr-improved { font-size: 17px; font-weight: 800; line-height: 1.8; color: var(--amber); }
.wr-improved-cn { margin-top: 8px; font-size: 13.5px; color: var(--ink-dim); line-height: 1.8; }
.wr-comment { font-size: 15px; font-weight: 700; line-height: 1.7; }

/* ============ Dock ============ */
.dock {
  position: fixed; left: 50%; bottom: 14px; transform: translateX(-50%);
  z-index: 40; display: flex; gap: 6px;
  padding: 8px; border-radius: 16px;
  background: rgba(23,29,38,.92); border: 1px solid var(--line);
  backdrop-filter: blur(10px);
  box-shadow: 0 12px 34px rgba(0,0,0,.5);
  max-width: calc(100vw - 20px);
}
.dock-btn {
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  min-width: 66px; padding: 9px 10px; border-radius: 11px; cursor: pointer;
  background: transparent; border: 1px solid transparent;
  color: var(--ink-faint); transition: all .18s;
}
.dock-btn:hover { color: var(--ink); border-color: var(--line); }
.dock-btn.active {
  background: linear-gradient(135deg, #4A2C10, #33210D);
  border-color: var(--orange);
  color: var(--orange2);
  box-shadow: 0 4px 14px rgba(255,122,26,.22);
}
.dock-ico { font-size: 21px; line-height: 1; }
.dock-label { font-size: 11.5px; font-weight: 800; letter-spacing: 1px; }

/* ============ 弹窗 ============ */
.modal-mask {
  position: fixed; inset: 0; z-index: 80;
  background: rgba(6,8,12,.72); backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center; padding: 18px;
}
.modal {
  width: min(560px, 100%); max-height: 86vh; overflow-y: auto;
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius);
  clip-path: polygon(0 0, calc(100% - 18px) 0, 100% 18px, 100% 100%, 18px 100%, 0 calc(100% - 18px));
}
.modal-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px; border-bottom: 1px solid var(--line);
  position: sticky; top: 0; background: var(--panel); z-index: 2;
}
.modal-head h2 { margin: 0; font-size: 18px; letter-spacing: 1px; }
.close-btn {
  width: 34px; height: 34px; border-radius: 9px; cursor: pointer;
  background: var(--panel2); border: 1px solid var(--line); color: var(--ink-dim); font-size: 15px;
}
.close-btn:hover { border-color: var(--red); color: var(--red); }
.modal-body { padding: 18px 20px; display: flex; flex-direction: column; gap: 18px; }
.modal-foot { padding: 14px 20px 20px; display: flex; justify-content: flex-end; }

.field label { display: block; font-size: 13px; font-weight: 800; letter-spacing: 1px; color: var(--ink-dim); margin-bottom: 9px; }
.pill-group { display: flex; gap: 8px; }
.pill-group.wrap { flex-wrap: wrap; }
.pill {
  padding: 9px 16px; border-radius: 999px; cursor: pointer;
  background: var(--panel2); border: 1.5px solid var(--line);
  color: var(--ink-dim); font-size: 13.5px; font-weight: 700; transition: all .15s;
}
.pill:hover { border-color: var(--orange); color: var(--ink); }
.pill.active { background: #33210D; border-color: var(--orange); color: var(--orange2); }
input[type="range"] { width: 100%; accent-color: var(--orange); }
select.input { appearance: auto; }
.field-note { margin-top: 8px; font-size: 12.5px; color: var(--ink-faint); line-height: 1.7; }
.link-btn { background: none; border: none; color: var(--blue); cursor: pointer; font-size: 12.5px; font-weight: 700; padding: 0; }
#keyStatus { font-weight: 800; }
#keyStatus.ok { color: var(--green); }
#keyStatus.err { color: var(--red); }

/* ============ 错题档案 ============ */
.notebook-list { display: flex; flex-direction: column; gap: 10px; }
.nb-item {
  padding: 13px 15px; border-radius: 11px;
  background: var(--bg2); border: 1px solid var(--line);
}
.nb-wrong { font-size: 14.5px; color: var(--red); font-weight: 700; }
.nb-right { font-size: 14.5px; color: var(--green); font-weight: 700; margin-top: 4px; }
.nb-why { font-size: 13px; color: var(--ink-dim); margin-top: 5px; }
.nb-meta { display: flex; align-items: center; justify-content: space-between; margin-top: 9px; }
.nb-tag {
  font-size: 11px; color: var(--ink-faint); font-weight: 700;
  padding: 3px 9px; border-radius: 999px; border: 1px solid var(--line);
}
.nb-play {
  padding: 6px 12px; border-radius: 8px; cursor: pointer; font-size: 12px; font-weight: 700;
  background: transparent; border: 1px solid var(--line); color: var(--ink-dim);
}
.nb-play:hover { border-color: var(--orange); color: var(--orange2); }
.nb-empty { text-align: center; padding: 40px 16px; color: var(--ink-faint); font-size: 14px; line-height: 2; font-weight: 600; }
.nb-empty .big { font-size: 44px; display: block; }

/* ============ 响应式 ============ */
@media (max-width: 760px) {
  .app { padding: 12px 12px 126px; }
  .topbar { padding: 12px 14px; }
  .mascot { width: 62px; height: 68px; }
  .brand-text h1 { font-size: 20px; }
  .brand-text p { font-size: 10px; letter-spacing: 2px; }
  .stat { padding: 6px 9px; font-size: 13px; }
  .sentence-en { font-size: 21px; }
  .options { grid-template-columns: 1fr; }
  .chat-log { height: 300px; }
  /* 小屏：气泡和话题分两行，避免溢出 */
  .hintbar { flex-direction: column; align-items: stretch; gap: 8px; }
  .topic-chip { flex-direction: row; align-items: baseline; gap: 8px; align-self: flex-start; }
  .topic-chip b { margin-top: 0; }
  .bubble { flex: 1 1 auto; }
  .dock-btn { min-width: 54px; padding: 8px 6px; }
  .dock-label { font-size: 10px; }
  .ach-list { grid-template-columns: 1fr; }
  .rank-box { min-width: 60px; }
  .radar { width: 300px; height: 300px; top: -110px; right: -110px; }
}

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: #2A3340; border-radius: 6px; }
::-webkit-scrollbar-thumb:hover { background: #394453; }
