/* ============================================================
   本地通 Bendihua · Apple 风格 UI v2（Aria 设计稿 BENDIHUA_APPLE_UI_v1）
   Token 见 :root；橙色 #FF6B35 仅用于：CTA / 用户气泡 / L1高亮底 /
   返回箭头 / 免费次数胶囊。就医红线横幅保持警示红（不变）。
   ============================================================ */

:root {
  /* ---- Apple 风格设计 Token (BENDIHUA_APPLE_UI_v1) ---- */
  --bg: #F5F5F7;
  --surface: #FFFFFF;
  --ink: #1D1D1F;
  --ink-2: #6E6E73;
  --ink-3: #AEAEB2;
  --accent: #FF6B35;          /* 开口橙：唯一 CTA 色 */
  --accent-soft: #FFF1EA;     /* L1 高亮底 / 引导条底 */
  --line: #E5E5EA;
  --radius-card: 20px;
  --radius-bubble: 18px;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro SC", "PingFang SC",
          "Helvetica Neue", "Noto Sans SC", "Microsoft YaHei", sans-serif;

  /* ---- 兼容旧变量名（app.js 内联样式/旧选择器引用，不删） ---- */
  --primary: var(--accent);
  --primary-dark: #E5551F;
  --primary-soft: var(--accent-soft);
  --card: var(--surface);
  --bubble-ai: #FFFFFF;
  --bubble-user: var(--accent);
  --bubble-user-ink: #FFFFFF;
  --green: #34C759;
  --orange: #f79009;
  --red: #f04438;
  --radius: var(--radius-card);
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.04), 0 4px 16px rgba(0, 0, 0, 0.05);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
}

* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body { height: 100%; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--ink);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

#app {
  max-width: 480px;
  margin: 0 auto;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  position: relative;
  overflow: hidden;
}

.hidden { display: none !important; }

.view {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

/* ---------- 通用控件 ---------- */
.btn {
  border: none;
  border-radius: 100px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.08s ease, opacity 0.15s ease, background 0.15s ease;
  padding: 12px 24px;
  min-height: 48px;
  font-family: inherit;
}
.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }

.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:not(:disabled):hover { background: var(--primary-dark); }
.btn-lg { height: 52px; font-size: 15px; font-weight: 600; padding: 0 40px; }

.btn-ghost { background: transparent; color: var(--ink-2); border: 1px solid var(--line); }
.btn-xs { font-size: 12px; padding: 8px 12px; min-height: 44px; display: inline-flex; align-items: center; }

/* 返回箭头 = 橙色允许位之一 */
.icon-btn {
  border: none; background: transparent;
  font-size: 22px; color: var(--accent);
  width: 44px; height: 44px;
  border-radius: 50%;
  cursor: pointer; line-height: 1;
}
.icon-btn:active { background: rgba(0, 0, 0, 0.06); }

/* ---------- ③ 品牌页/开启页（P1 欢迎页） ---------- */
#view-welcome { justify-content: center; align-items: center; text-align: center; padding: 24px; position: relative; }

.welcome-wrap { width: 100%; max-width: 360px; }

.welcome-back { position: absolute; top: calc(8px + var(--safe-t)); left: 6px; z-index: 5; color: var(--accent); }

.welcome-intro { margin: 14px 4px 0; font-size: 15px; color: var(--ink-2); line-height: 1.7; }

/* "你将学习 [目标语]" 醒目行 */
.welcome-learn {
  display: inline-block;
  margin: 14px auto 2px;
  padding: 8px 20px;
  background: var(--surface);
  color: var(--ink);
  border-radius: 999px;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.45;
  box-shadow: var(--shadow);
}
.welcome-learn-cn { display: block; font-size: 12px; font-weight: 500; color: var(--ink-3); margin-top: 2px; }

/* v0.17 品牌页目标语快捷切换：\"你将学习 XX\" 可点 → 底部弹出滚动选择，就地生效不返回 */
.welcome-learn-tap { cursor: pointer; transition: transform .1s ease, background .15s ease; }
.welcome-learn-tap::after { content: "✎"; font-size: 11px; font-weight: 700; color: var(--accent); margin-left: 8px; vertical-align: 2px; opacity: .95; }
.welcome-learn-tap:active { transform: scale(.97); background: var(--accent-soft); }
.wl-sheet-mask {
  position: fixed; inset: 0; z-index: 80;
  background: rgba(29, 29, 31, .46);
  display: flex; align-items: flex-end; justify-content: center;
  animation: wlFade .18s ease;
}
.wl-sheet {
  background: var(--surface); width: 100%; max-width: 480px;
  border-radius: 20px 20px 0 0;
  padding: 6px 16px calc(18px + env(safe-area-inset-bottom));
  box-shadow: 0 -10px 32px rgba(0, 0, 0, .14);
  animation: wlUp .24s cubic-bezier(.2, .9, .28, 1);
  max-height: 74vh; overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.wl-sheet-grab { width: 36px; height: 4px; border-radius: 2px; background: var(--line); margin: 6px auto 10px; }
.wl-sheet h4 { font-size: 16px; font-weight: 700; text-align: center; margin: 2px 0 14px; color: var(--ink); }
.wl-sheet .lang-list { padding: 0; }
.wl-sheet .lang-card.current { border-color: var(--accent); }
.wl-sheet .lang-card.current .lang-badge { background: var(--accent); color: #fff; }
.wl-sheet .lang-check { margin-left: auto; font-size: 14px; color: var(--accent); font-weight: 800; }
.wl-sheet-cancel {
  width: 100%; margin-top: 14px; padding: 13px;
  border: none; border-radius: 14px;
  background: var(--bg); color: var(--ink-2);
  font-size: 15px; font-weight: 600; cursor: pointer;
}
@keyframes wlFade { from { opacity: 0; } to { opacity: 1; } }
@keyframes wlUp { from { transform: translateY(40%); opacity: .6; } to { transform: translateY(0); opacity: 1; } }

/* 品牌 logo：56px 橙色圆 + 💬 */
.logo {
  width: 56px; height: 56px;
  margin: 0 auto 16px;
  background: var(--accent);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 28px;
  box-shadow: 0 6px 18px rgba(255, 107, 53, 0.32);
  animation: pop 0.5s ease;
}
@keyframes pop { 0% { transform: scale(0.6); opacity: 0; } 100% { transform: scale(1); opacity: 1; } }

.brand { font-size: 34px; font-weight: 700; letter-spacing: -0.3px; color: var(--ink); }

/* 主标语 34px/700（P1：敢开口，办成事。） */
.slogan-main { font-size: 34px; font-weight: 700; letter-spacing: -0.3px; color: var(--ink); }
.slogan { font-size: 17px; font-weight: 600; margin: 10px 0 4px; }
.slogan-en, .subline-en, .tip-en { color: var(--ink-3); font-weight: 400; }
.slogan-en { font-size: 14px; display: block; margin-top: 4px; }

.subline { color: var(--ink-2); font-size: 14px; margin: 12px 0 28px; }
.subline-en { font-size: 13px; }

/* 免费次数胶囊（accent-soft 底橙字）；≤1 次时 JS 加 .trial-low → 警示黄 */
.trial-hint {
  margin-top: 18px; font-size: 13px; font-weight: 600;
  color: var(--accent);
  background: var(--accent-soft);
  display: inline-block;
  padding: 6px 16px;
  border-radius: 999px;
}
.trial-hint.trial-low { color: #B8860B; background: #FFF8DC; }
.tiny { margin-top: 28px; font-size: 12px; color: var(--ink-3); }

/* ---------- ② 场景选择页 ---------- */
.page-head, .chat-head {
  display: flex; align-items: center; gap: 6px;
  padding: calc(10px + var(--safe-t)) 14px 10px;
  background: rgba(245, 245, 247, 0.88);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  position: sticky; top: 0; z-index: 5;
}
.head-title { flex: 1; text-align: center; margin-right: 40px; }
.head-zh { font-size: 17px; font-weight: 700; }
.head-en { font-size: 12px; color: var(--ink-3); }

.step-badge {
  display: inline-block;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  padding: 3px 9px;
  border-radius: 999px;
  margin-bottom: 5px;
}
.lang-native-summary {
  text-align: center;
  font-size: 12px;
  color: var(--ink-3);
  margin: 2px 16px 8px;
}

/* 身份提示条 */
.role-bar {
  margin: 2px 16px 0;
  padding: 9px 14px;
  background: var(--accent-soft);
  border: none;
  border-radius: 12px;
  text-align: center;
  font-size: 13px;
  color: var(--accent);
  flex-shrink: 0;
}
.role-bar a {
  color: var(--accent);
  font-weight: 600;
  text-decoration: none;
  margin-left: 4px;
  padding: 10px 2px;
  vertical-align: middle;
  margin-top: -10px;
  margin-bottom: -10px;
}
.role-bar a:active { text-decoration: underline; }

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

/* iOS 列表卡：白底 20px 圆角、图标 52px 圆角方块、整卡热区 ≥44pt */
.scene-card {
  position: relative;
  display: flex; align-items: center; gap: 16px;
  min-height: 72px;
  background: var(--surface); border-radius: var(--radius-card);
  padding: 18px; box-shadow: var(--shadow);
  cursor: pointer; border: 1.5px solid transparent;
  transition: border-color 0.15s ease, transform 0.1s ease;
}
.scene-card:active { transform: scale(0.98); border-color: var(--accent); }

.scene-card.scene-top { border-color: rgba(255, 107, 53, 0.45); }
.rec-badge {
  position: absolute;
  top: -10px; right: 14px;
  background: var(--accent);
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  line-height: 1;
  padding: 5px 10px;
  border-radius: 999px;
  box-shadow: 0 2px 6px rgba(255, 107, 53, 0.35);
  white-space: nowrap;
}

/* 图标 52px 圆角方块（--bg 底） */
.scene-emoji {
  width: 52px; height: 52px;
  background: var(--bg);
  border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  font-size: 28px; line-height: 1; flex-shrink: 0;
}
.scene-info { flex: 1; }
.scene-name { font-size: 19px; font-weight: 600; }
.scene-name-en { font-size: 13px; color: var(--ink-3); margin-left: 6px; font-weight: 500; }
.scene-desc { font-size: 14px; color: var(--ink-2); margin-top: 2px; }
.scene-desc-en { font-size: 12px; color: var(--ink-3); }
.scene-context { font-size: 12px; color: var(--accent); margin-top: 3px; opacity: 0.9; }
.scene-go { color: var(--ink-3); font-size: 22px; font-weight: 700; }

.scene-tip { text-align: center; font-size: 12px; color: var(--ink-3); padding: 0 16px calc(18px + var(--safe-b)); }
.tip-en { display: block; }

/* ---------- ①⑤ 角色选择页 ---------- */
.role-sub {
  text-align: center;
  font-size: 13px;
  color: var(--ink-2);
  margin: 2px 16px 10px;
  line-height: 1.5;
}
.role-sub .sub-en { display: block; color: var(--ink-3); font-size: 12px; }

.role-list { padding: 4px 16px 10px; display: flex; flex-direction: column; gap: 14px; }

.role-card {
  display: flex; align-items: center; gap: 16px;
  min-height: 72px;
  background: var(--surface); border-radius: var(--radius-card);
  padding: 18px; box-shadow: var(--shadow);
  cursor: pointer; border: 1.5px solid transparent;
  transition: border-color 0.15s ease, transform 0.1s ease;
}
.role-card:active { transform: scale(0.98); border-color: var(--accent); }

.role-emoji {
  width: 52px; height: 52px;
  background: var(--bg);
  border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  font-size: 28px; line-height: 1; flex-shrink: 0;
}
.role-info { flex: 1; }
.role-name { font-size: 19px; font-weight: 600; }
.role-name-en { font-size: 13px; color: var(--ink-3); margin-left: 6px; font-weight: 500; }
.role-desc { font-size: 14px; color: var(--ink-2); margin-top: 2px; }
.role-desc-en { font-size: 12px; color: var(--ink-3); }
.role-go { color: var(--ink-3); font-size: 22px; font-weight: 700; }

.role-skip, .lang-skip { text-align: center; padding: 10px 16px calc(22px + var(--safe-b)); }
.role-skip a, .lang-skip a {
  display: inline-block;
  min-height: 44px;
  line-height: 44px;
  padding: 0 20px;
  font-size: 14px;
  color: var(--ink-2);
  text-decoration: none;
  border-radius: 999px;
}
.role-skip a:active, .lang-skip a:active { color: var(--accent); background: rgba(0, 0, 0, 0.05); }

/* ---------- ①④ 语言层 ---------- */
.lang-target-note {
  margin: 2px 16px 12px;
  padding: 9px 14px;
  text-align: center;
  background: var(--accent-soft);
  border: none;
  border-radius: 12px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--accent);
  flex-shrink: 0;
}

.lang-list { padding: 4px 16px 10px; display: flex; flex-direction: column; gap: 12px; }

.lang-card {
  display: flex; align-items: center; gap: 14px;
  min-height: 72px;
  background: var(--surface); border-radius: var(--radius-card);
  padding: 14px 18px; box-shadow: var(--shadow);
  cursor: pointer; border: 1.5px solid transparent;
  transition: border-color 0.15s ease, transform 0.1s ease;
}
.lang-card:active { transform: scale(0.98); border-color: var(--accent); }

.lang-badge {
  width: 48px; height: 48px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg); color: var(--ink);
  border: none;
  font-size: 20px; font-weight: 700;
}
.lang-info { flex: 1; min-width: 0; }
.lang-name { font-size: 19px; font-weight: 600; }
.lang-name-en { font-size: 13px; color: var(--ink-3); font-weight: 500; margin-top: 1px; }
.lang-go { color: var(--ink-3); font-size: 22px; font-weight: 700; }

.lang-other-box { display: flex; gap: 8px; padding: 0 16px 4px; }
.lang-other-box input {
  flex: 1; min-width: 0;
  border: 1.5px solid var(--line); border-radius: 999px;
  padding: 10px 14px; font-size: 15px; font-family: inherit;
  background: #fff; outline: none;
}
.lang-other-box input:focus { border-color: var(--accent); background: #fff; }

/* ---------- ③ 对话页（P3 核心） ---------- */
#view-chat { display: flex; flex-direction: column; }
#view-chat.hidden { display: none; }

.chat-head {
  border-bottom: 0.5px solid var(--line);
  box-shadow: none;
  background: rgba(245, 245, 247, 0.88);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.chat-title { flex: 1; text-align: center; font-weight: 700; font-size: 17px; }
.chat-title #chat-emoji { margin-right: 4px; }
.chat-head .btn-ghost { flex-shrink: 0; }

.chat-body {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 16px 14px 10px;
  display: flex; flex-direction: column; gap: 12px;
}

.chat-placeholder { text-align: center; color: var(--ink-3); font-size: 13px; margin: 20px 10px; }

/* 气泡：AI 白底左下 6px；用户橙底右下 6px，16px 字 */
.bubble {
  max-width: 84%;
  border-radius: var(--radius-bubble);
  padding: 12px 15px;
  font-size: 15px;
  box-shadow: var(--shadow);
  animation: rise 0.22s ease;
  word-break: break-word;
}
@keyframes rise { from { transform: translateY(8px); opacity: 0; } to { transform: none; opacity: 1; } }

.bubble-ai { background: var(--bubble-ai); align-self: flex-start; border-bottom-left-radius: 6px; box-shadow: 0 1px 3px rgba(0,0,0,.05); }
.bubble-user {
  background: var(--bubble-user);
  color: var(--bubble-user-ink);
  align-self: flex-end;
  border-bottom-right-radius: 6px;
  font-size: 16px;
}
.bubble-user .line-pinyin, .bubble-user .line-en,
.bubble-user .line-correct .cn, .bubble-user .line-guide,
.bubble-user .line-tip { color: rgba(255,255,255,0.92) !important; }
.bubble-user .tts-btn { color: #fff; background: rgba(255,255,255,0.18); border-color: rgba(255,255,255,0.4); }

/* v2.1 发音匹配度条（语音直发后显示在用户气泡下方） */
.match-bar {
  align-self: flex-end;
  max-width: 84%;
  background: #fff;
  border: 1px solid var(--line, #e4e7ec);
  border-radius: 13px;
  padding: 8px 11px;
  font-size: 12px;
  line-height: 1.5;
  box-shadow: 0 2px 8px rgba(20,30,70,.06);
  display: flex; flex-direction: column; gap: 4px;
  animation: rise 0.22s ease;
}
.match-bar .mb-ic { font-size: 13px; }
.match-bar .mb-tx { color: var(--ink, #1d2939); }
.match-bar .mb-tx b { font-size: 13px; }
.match-bar .mb-st { height: 5px; border-radius: 999px; background: #eef0f4; overflow: hidden; }
.match-bar .mb-st span { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg,#27ae60,#3dd68c); transition: width .4s; }
.match-bar.ok .mb-st span { background: linear-gradient(90deg,#f79009,#fbbf24); }
.match-bar.try .mb-st span { background: linear-gradient(90deg,#f04438,#f97066); }
.match-bar .mb-expect { font-size: 10.5px; color: var(--ink-3, #98a2b3); background: #f6f8fa; border-radius: 8px; padding: 4px 7px; }
.match-bar .mb-expect i { font-style: normal; color: #5e5ce6; font-weight: 600; }

/* 回复内结构化行 */
.line { margin: 2px 0; }
.line + .line { margin-top: 6px; }

/* L1 中文主句 20px/700 accent-soft 底圆角10px */
.line-correct {
  font-weight: 700;
  font-size: 20px;
  line-height: 1.45;
  color: var(--ink);
  background: var(--accent-soft);
  border-radius: 10px;
  padding: 7px 11px;
  margin-top: 4px;
}
.bubble-user .line-correct { background: rgba(255,255,255,0.16); }
.line-correct .cn { color: var(--accent); }

/* 拼音 L2 14px --ink-3；英文释义 L3 14px 行高1.5 */
.line-pinyin { color: var(--ink-3); font-size: 14px; font-style: normal; }
.line-en { color: var(--ink-3); font-size: 14px; line-height: 1.5; }

/* 引导行 14px 斜体 橙色 */
.line-guide { color: var(--accent); font-size: 14px; font-style: italic; }
.line-section { font-weight: 700; margin-top: 8px !important; }
.line-step { color: var(--ink-2); font-size: 14px; padding-left: 6px; }
.line-tip { color: var(--ink-2); font-size: 13px; }

/* 纠错轮：错误句灰底删除线在上，正确句高亮块顶替 */
.line-wrong, .bubble .del-line {
  text-decoration: line-through;
  color: var(--ink-3);
  background: rgba(0,0,0,0.04);
  border-radius: 8px;
  padding: 4px 9px;
}

/* 🔊 发音按钮 */
.tts-btn {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  margin-left: 7px;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 600;
  color: var(--accent);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 999px;
  cursor: pointer;
  font-family: inherit;
  line-height: 1.4;
  vertical-align: middle;
  transition: transform 0.08s ease, background 0.15s ease, color 0.15s ease;
}
.tts-btn:active { transform: scale(0.92); background: var(--accent-soft); }
.tts-btn.playing {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
  animation: tts-pulse 1s ease-in-out infinite;
}
@keyframes tts-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.55; }
}
.tts-btn .tts-label { font-size: 12px; }

.mode-tag {
  font-size: 10px; color: var(--ink-3);
  margin-top: 6px; letter-spacing: 0.5px;
  text-align: center;
}

/* 会话结束卡片（P4：🎉 居中标题区 + 生词卡独立成块） */
.done-card {
  align-self: stretch;
  background: var(--surface);
  border: none;
  border-radius: var(--radius-card);
  padding: 18px 16px;
  margin-top: 6px;
  box-shadow: var(--shadow);
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  text-align: center;
}

/* ---------- 输入栏（固定底部 + safe-area） ---------- */
.chat-inputbar {
  padding: 8px 12px calc(10px + var(--safe-b));
  background: rgba(245, 245, 247, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-top: 0.5px solid var(--line);
}
.inputbar-row { display: flex; align-items: center; gap: 8px; }
.voice-toggle { flex-shrink: 0; width: 44px; height: 44px; font-size: 20px; }
.voice-mode { flex: 1; min-width: 0; }

.hold-talk {
  width: 100%; min-height: 44px;
  border: 1.5px solid var(--line);
  border-radius: 999px;
  background: #fff;
  padding: 9px 16px;
  font-size: 16px;
  font-weight: 600;
  color: var(--ink);
  font-family: inherit;
  cursor: pointer;
  text-align: center;
  line-height: 1.35;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
  -webkit-user-select: none; user-select: none;
  touch-action: none;
}
.hold-talk .hold-en { display: block; font-size: 11px; color: var(--ink-3); font-weight: 400; }
.hold-talk:active, .hold-talk.hold-pressed {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent);
}
.hold-talk.hold-pressed .hold-en { color: var(--accent); }

#chat-form { display: flex; gap: 8px; }
#chat-input {
  flex: 1; min-width: 0;
  border: 1.5px solid transparent;
  border-radius: 999px;
  padding: 11px 16px;
  font-size: 15px;
  font-family: inherit;
  background: #fff;
  outline: none;
  box-shadow: var(--shadow);
}
#chat-input:focus { border-color: var(--accent); background: #fff; }
#btn-send { padding: 11px 22px; min-height: 44px; flex-shrink: 0; }
#btn-butler-send { padding: 11px 22px; min-height: 44px; flex-shrink: 0; }
/* 管家页输入区与主对话页同构（v0.11 Bug2） */
#butler-form { display: flex; gap: 8px; }
#butler-input {
  flex: 1; min-width: 0;
  border: 1.5px solid transparent;
  border-radius: 999px;
  padding: 11px 16px;
  font-size: 15px;
  font-family: inherit;
  background: #fff;
  outline: none;
  box-shadow: var(--shadow);
}
#butler-input:focus { border-color: var(--accent); background: #fff; }

.chat-tips { font-size: 11.5px; color: var(--ink-3); text-align: center; margin-top: 6px; }
.chat-tips b { color: var(--ink-2); }

.voice-status {
  position: fixed;
  left: 50%; transform: translateX(-50%);
  bottom: calc(104px + var(--safe-b));
  z-index: 20;
  background: rgba(29, 29, 31, 0.92);
  color: #fff;
  font-size: 13.5px;
  padding: 8px 18px;
  border-radius: 999px;
  white-space: nowrap;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.22);
  pointer-events: none;
}
.voice-status.cancel { background: rgba(198, 51, 51, 0.95); }

.toast {
  position: fixed;
  left: 50%; transform: translateX(-50%);
  bottom: 32%;
  z-index: 30;
  max-width: 78%;
  background: rgba(29, 29, 31, 0.82);
  color: #fff;
  font-size: 13px;
  line-height: 1.5;
  padding: 10px 18px;
  border-radius: 12px;
  text-align: center;
  pointer-events: none;
}

/* ---------- 桌面端适配（>640px 居中卡片化） ---------- */
@media (min-width: 700px) {
  #app { box-shadow: 0 0 40px rgba(0, 0, 0, 0.08); border-left: 1px solid var(--line); border-right: 1px solid var(--line); }
}

/* ---------- P5 订阅页 / P6 支付结果页 ---------- */
/* 微信内引导条：accent-soft 底 11.5px + 复制链接 */
.wx-guide {
  margin: 10px 16px 0;
  padding: 10px 12px;
  background: var(--accent-soft);
  border: none;
  border-radius: 12px;
  font-size: 11.5px;
  color: var(--accent);
  display: flex;
  align-items: center;
  gap: 8px;
}
.wx-guide button {
  flex-shrink: 0;
  border: none;
  background: var(--accent);
  color: #fff;
  border-radius: 999px;
  padding: 8px 14px;
  min-height: 36px;
  font-size: 12px;
  font-family: inherit;
  cursor: pointer;
}

/* 定价卡：¥30 大数字 44px/700 + 权益白卡 ✓ 列表 */
.pay-card {
  margin: 14px 16px;
  background: var(--surface);
  border: none;
  border-radius: var(--radius-card);
  padding: 24px 18px 16px;
  text-align: center;
  box-shadow: var(--shadow);
}
.pay-price { font-size: 44px; font-weight: 700; color: var(--ink); letter-spacing: -0.5px; }
.pay-price span { font-size: 15px; font-weight: 400; color: var(--ink-3); }
.pay-cancel { color: var(--ink-2); font-size: 13px; margin: 4px 0 14px; }
.pay-perks {
  list-style: none; text-align: left;
  margin: 0 auto 14px; max-width: 300px;
  background: var(--bg);
  border-radius: 14px;
  padding: 12px 18px;
  font-size: 15px;
  line-height: 2.2;
  color: var(--ink);
}
.pay-trial-note { color: var(--accent); font-size: 12.5px; font-weight: 600; margin-bottom: 14px; }
.pay-btn { width: 100%; height: 52px; font-size: 15px; font-weight: 600; margin-top: 10px; }
.pay-alipay { background: var(--accent); }
.pay-wxpay { background: #07C160; }
.pay-state { color: var(--ink-2); font-size: 13px; margin-top: 10px; }

/* P6 结果页：成功=72px 绿徽章；失败=灰底 😕 双按钮 */
.result-wrap { padding: 80px 24px 0; text-align: center; }
.result-icon {
  width: 72px; height: 72px;
  margin: 0 auto;
  border-radius: 50%;
  background: #E8F8EE;
  display: flex; align-items: center; justify-content: center;
  font-size: 38px;
  color: #07C160;
}
.result-icon.fail { background: #F2F2F7; color: var(--ink-3); }
.result-title { font-size: 22px; margin: 16px 0 6px; color: var(--ink); }
.result-sub { color: var(--ink-2); font-size: 14px; margin-bottom: 26px; }
.result-wrap .btn { width: min(320px, 100%); }
.result-wrap .tiny { margin-top: 18px; }

/* ---- 生词卡 / 付费墙弹层 / 生词本 ---- */
/* P4/P0-3 生词卡：2 列网格 */
.vocab-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 10px 0; width: 100%; }
.vocab-chip {
  display: flex; flex-direction: column; align-items: flex-start; gap: 2px;
  background: var(--bg);
  border: none;
  border-radius: 14px;
  padding: 10px 12px;
  font-size: 14px;
  margin: 0;
  text-align: left;
}
.done-card .vocab-cards { margin: 10px 0 2px; }
.vocab-chip .vw { font-weight: 700; font-size: 20px; color: var(--ink); }  /* 词条 20px/700 */
.vocab-chip .vp { color: var(--ink-3); font-size: 13px; }
.vocab-chip .vg { color: var(--ink-2); font-size: 13px; }
.vocab-chip .vs { color: var(--ink-3); font-size: 11px; width: 100%; }
.vocab-chip.vocab-review { cursor: pointer; }

.modal-mask { position:fixed; inset:0; background:rgba(29,29,31,.5); z-index:90;
  display:flex; align-items:center; justify-content:center; padding:18px; }
.modal-card { background:#fff; border-radius:var(--radius-card); padding:18px 16px; max-width:360px;
  width:100%; max-height:82vh; overflow-y:auto; text-align:center;
  box-shadow:0 12px 40px rgba(0,0,0,.25); }
.pw-title { font-size:17px; font-weight:800; color:var(--ink); }
.pw-sub { font-size:12.5px; color:var(--ink-3); margin:4px 0 10px; }
.pw-review { text-align:left; margin-bottom:10px; }
.pw-item { display:flex; gap:8px; padding:6px 10px; align-items:baseline;
  background:var(--bg); border-radius:10px; margin-bottom:6px; font-size:13.5px; }
.pw-item b { color:var(--accent); }
.pw-item span { color:var(--ink-3); font-size:11.5px; }
.pw-item em { font-style:normal; color:var(--ink-2); font-size:12px; }
.pw-anchor { font-size:12.5px; color:var(--accent); background:var(--accent-soft);
  border-radius:10px; padding:8px; margin-bottom:12px; line-height:1.55; }
#btn-pw-keep { margin-top:8px; width:100%; }
.vocab-entry-row { text-align:center; padding:10px 0 22px; }
.vocab-entry-row a { color:var(--accent); font-size:14px; text-decoration:none; font-weight:600;
  display:inline-block; min-height:44px; line-height:44px; padding:0 16px; }

/* 就医红线横幅：警示红，不被新风格吞掉（app.js 内联红横幅兜底样式） */
.red-banner, .medical-red {
  background: #FDECEC !important;
  color: #C0392B !important;
  border: 1px solid rgba(192, 57, 43, 0.35) !important;
  border-radius: 12px !important;
}

.hidden { display:none !important; }

/* ---------- v1.2 品牌页「实时访问动态」跑马灯（社交证明 + 录屏素材） ---------- */
.visit-ticker {
  margin-top: 24px; width: 100%; padding: 12px 16px;
  border: 1px solid var(--accent-soft); border-radius: 12px;
  background: linear-gradient(135deg, #f6fff8, #f0fbf5);
  text-align: center; box-sizing: border-box;
}
.visit-ticker-label {
  display: block; font-size: 11px; font-weight: 700;
  color: var(--accent); letter-spacing: .5px; margin-bottom: 6px;
}
.visit-ticker-body {
  font-size: 13px; color: var(--ink-2); line-height: 1.7;
  min-height: 20px; word-break: break-word;
}
