/* ============================================================
 * style.css — 全部样式（移动端优先 · 剧场沉浸主题）
 * 暗底 + 聚光灯色调：深紫墨蓝底 + 琥珀金强调
 * 纯 CSS 动画；含 @media print A4 打印样式
 * ============================================================ */

:root {
  --bg: #14101f;
  --bg2: #1c1630;
  --card: #241c3d;
  --card2: #2d2350;
  --gold: #f5b942;
  --gold2: #ffcf6b;
  --text: #f2ecff;
  --muted: #9d92c0;
  --danger: #ff7a7a;
  --ok: #6fe3a5;
  --radius: 18px;
}

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

html, body { height: 100%; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB",
    "Microsoft YaHei", "Segoe UI", Roboto, sans-serif;
  font-size: 16px;
  line-height: 1.55;
}

#app {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  background:
    radial-gradient(120% 60% at 50% -10%, rgba(245, 185, 66, 0.14), transparent 60%),
    linear-gradient(180deg, var(--bg2), var(--bg) 40%);
  position: relative;
  box-shadow: 0 0 60px rgba(0, 0, 0, 0.5);
}

.page { padding: 14px 16px 96px; animation: fadeUp 0.28s ease both; }

@keyframes fadeUp { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes pop { 0% { opacity: 0; transform: scale(0.85); } 100% { opacity: 1; transform: scale(1); } }

/* ---------------- 顶栏 ---------------- */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 2px 16px;
}
.topbar h1 { font-size: 22px; letter-spacing: 1px; }
.topbar h1::before { content: ''; display: inline-block; width: 8px; height: 8px; border-radius: 50%;
  background: var(--gold); margin-right: 8px; box-shadow: 0 0 12px var(--gold); vertical-align: 2px; }
.topbar-right { display: flex; gap: 8px; }

.pill {
  display: inline-block; padding: 4px 12px; border-radius: 999px;
  background: var(--card); color: var(--muted); font-size: 12px;
  text-decoration: none; border: 1px solid rgba(255, 255, 255, 0.06);
}
.pill.gold { color: #2a1e05; background: var(--gold); font-weight: 700; }
.pill.done { color: var(--ok); border-color: rgba(111, 227, 165, 0.35); }
.pill.doing { color: var(--gold2); border-color: rgba(245, 185, 66, 0.35); }
.stage-pill { padding: 4px 12px; border-radius: 999px; background: var(--card); color: var(--gold2); font-size: 12px; }

/* ---------------- 按钮 ---------------- */
.btn {
  display: inline-block; border: none; cursor: pointer; border-radius: 14px;
  padding: 13px 22px; font-size: 16px; font-weight: 700; text-align: center;
  text-decoration: none; color: var(--text); background: var(--card2);
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}
.btn:active { transform: scale(0.96); }
.btn.gold { background: linear-gradient(135deg, var(--gold), #e89b2e); color: #2a1e05;
  box-shadow: 0 6px 18px rgba(245, 185, 66, 0.3); }
.btn.big { width: 100%; padding: 16px; font-size: 17px; }
.btn.tiny { padding: 6px 12px; font-size: 12px; border-radius: 999px; }
.btn.small { padding: 9px 14px; font-size: 13px; }
.btn.ghost { background: transparent; border: 1px solid rgba(255, 255, 255, 0.15); color: var(--muted); }

/* ---------------- 底部 tab ---------------- */
.tabbar {
  position: fixed; bottom: 0; left: 50%; transform: translateX(-50%);
  width: 100%; max-width: 480px; display: flex;
  background: rgba(20, 16, 31, 0.92); backdrop-filter: blur(10px);
  border-top: 1px solid rgba(255, 255, 255, 0.07); z-index: 50;
  padding-bottom: env(safe-area-inset-bottom);
}
.tab {
  flex: 1; display: flex; flex-direction: column; align-items: center;
  padding: 9px 0 8px; text-decoration: none; color: var(--muted); font-size: 11px; gap: 2px;
}
.tab i { font-style: normal; font-size: 20px; filter: grayscale(0.6); }
.tab.on { color: var(--gold2); }
.tab.on i { filter: none; transform: translateY(-1px); }

/* ---------------- 任务页 ---------------- */
.stats-row { display: flex; gap: 12px; align-items: stretch; margin-bottom: 14px; }
.ring {
  --deg: 0deg; width: 96px; height: 96px; border-radius: 50%; flex-shrink: 0;
  background: conic-gradient(var(--gold) var(--deg), rgba(255, 255, 255, 0.08) var(--deg));
  display: flex; align-items: center; justify-content: center;
}
.ring-in {
  width: 76px; height: 76px; border-radius: 50%; background: var(--bg2);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
}
.ring-in b { font-size: 20px; color: var(--gold2); }
.ring-in span { font-size: 10px; color: var(--muted); }
.stat-chip {
  flex: 1; background: var(--card); border-radius: var(--radius);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.05);
}
.stat-chip b { font-size: 24px; color: var(--gold2); }
.stat-chip span { font-size: 11px; color: var(--muted); }

.hint-bar {
  background: rgba(245, 185, 66, 0.12); border: 1px solid rgba(245, 185, 66, 0.3);
  color: var(--gold2); border-radius: 14px; padding: 11px 14px; font-size: 13px;
  margin-bottom: 12px; cursor: pointer; animation: pop 0.25s ease both;
}
.hs-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  background: var(--card); border-radius: 14px; padding: 10px 14px; font-size: 13px;
  margin-bottom: 12px; color: var(--muted); border: 1px dashed rgba(245, 185, 66, 0.4);
}

.task-cards { display: flex; flex-direction: column; gap: 12px; }
.task-card {
  display: flex; align-items: center; gap: 14px; text-decoration: none; color: var(--text);
  background: linear-gradient(135deg, var(--card), var(--card2));
  border: 1px solid rgba(255, 255, 255, 0.06); border-radius: var(--radius);
  padding: 18px 16px; transition: transform 0.12s ease;
}
.task-card:active { transform: scale(0.98); }
.task-card i { font-style: normal; font-size: 30px; }
.task-card div { flex: 1; display: flex; flex-direction: column; }
.task-card b { font-size: 16px; }
.task-card span { font-size: 12px; color: var(--muted); margin-top: 2px; }
.task-card em { font-style: normal; color: var(--gold); font-size: 22px; }

.foot-note { text-align: center; color: var(--muted); font-size: 11px; margin-top: 22px; opacity: 0.7; }

/* ---------------- 短剧 ---------------- */
.ep-list { display: flex; flex-direction: column; gap: 12px; }
.ep-card {
  display: flex; gap: 12px; align-items: center; text-decoration: none; color: var(--text);
  background: var(--card); border-radius: var(--radius); padding: 16px;
  border: 1px solid rgba(255, 255, 255, 0.06);
}
.ep-no {
  width: 42px; height: 42px; border-radius: 50%; flex-shrink: 0;
  background: radial-gradient(circle at 35% 30%, var(--gold2), #b97f16);
  color: #2a1e05; font-weight: 800; display: flex; align-items: center; justify-content: center;
}
.ep-info { flex: 1; }
.ep-info b { font-size: 15px; }
.ep-info p { font-size: 12px; color: var(--muted); margin-top: 3px; }

.stage-light {
  height: 90px; margin: -6px -16px 4px; pointer-events: none;
  background: radial-gradient(60% 100% at 50% 0%, rgba(245, 185, 66, 0.22), transparent 70%);
}
.script { display: flex; flex-direction: column; gap: 14px; padding-bottom: 8px; }
.line { display: flex; flex-direction: column; animation: fadeUp 0.3s ease both; }
.line.me { align-items: flex-end; }
.line .speaker { font-size: 11px; color: var(--gold2); margin: 0 6px 4px; }
.bubble {
  max-width: 88%; background: var(--card); border-radius: 16px; padding: 12px 14px;
  border: 1px solid rgba(255, 255, 255, 0.06);
}
.line.me .bubble { background: linear-gradient(135deg, #3a2c14, #4a3818); border-color: rgba(245, 185, 66, 0.25); }
.bubble .en { font-size: 15px; }
.bubble .cn { font-size: 12px; color: var(--muted); margin-top: 5px; }

.t-word {
  color: var(--gold2); font-weight: 700; cursor: pointer;
  border-bottom: 1px dashed var(--gold); padding: 0 1px;
}
.t-word:active { background: rgba(245, 185, 66, 0.2); border-radius: 4px; }

.drama-progress {
  position: sticky; bottom: 76px; text-align: center; font-size: 12px; color: var(--gold2);
  background: rgba(20, 16, 31, 0.9); border: 1px solid rgba(245, 185, 66, 0.3);
  border-radius: 999px; padding: 9px; margin-top: 10px; backdrop-filter: blur(6px);
}
.drama-finish {
  text-align: center; margin-top: 12px; padding: 18px; border-radius: var(--radius);
  background: rgba(111, 227, 165, 0.1); border: 1px solid rgba(111, 227, 165, 0.35);
  color: var(--ok); font-size: 14px;
}
.drama-finish .btn { margin-top: 12px; }

/* ---------------- 词卡弹窗 ---------------- */
.modal-mask {
  position: fixed; inset: 0; background: rgba(8, 6, 16, 0.72); z-index: 100;
  display: flex; align-items: flex-end; justify-content: center;
}
.word-card {
  width: 100%; max-width: 480px; background: var(--bg2);
  border-radius: 24px 24px 0 0; padding: 26px 22px 34px; position: relative;
  border-top: 2px solid var(--gold); max-height: 86vh; overflow-y: auto;
}
.pop { animation: pop 0.22s ease both; }
.wc-close {
  position: absolute; top: 12px; right: 14px; background: var(--card); color: var(--muted);
  border: none; width: 34px; height: 34px; border-radius: 50%; font-size: 20px; cursor: pointer;
}
.wc-word { font-size: 32px; font-weight: 800; color: var(--gold2); letter-spacing: 0.5px; }
.wc-phonetic { color: var(--muted); margin-top: 2px; font-size: 14px; }
.wc-meaning { font-size: 19px; margin-top: 10px; font-weight: 700; }
.wc-example {
  margin-top: 12px; font-size: 14px; background: var(--card); border-radius: 12px; padding: 12px;
}
.wc-example span { color: var(--muted); font-size: 12px; }
.wc-mastery { margin-top: 14px; background: rgba(255, 255, 255, 0.07); border-radius: 999px; height: 14px; position: relative; }
.wc-mastery-bar { height: 100%; border-radius: 999px; background: linear-gradient(90deg, #e89b2e, var(--gold2)); transition: width 0.3s ease; }
.wc-mastery em { position: absolute; right: 2px; top: 18px; font-size: 11px; color: var(--muted); font-style: normal; }
.wc-feedback { display: flex; gap: 10px; margin-top: 30px; }
.wc-feedback.two { margin-top: 16px; }
.btn.fb { flex: 1; padding: 14px 0; }
.btn.fb.know { background: rgba(111, 227, 165, 0.16); color: var(--ok); border: 1px solid rgba(111, 227, 165, 0.4); }
.btn.fb.vague { background: rgba(245, 185, 66, 0.14); color: var(--gold2); border: 1px solid rgba(245, 185, 66, 0.4); }
.btn.fb.unknown { background: rgba(255, 122, 122, 0.13); color: var(--danger); border: 1px solid rgba(255, 122, 122, 0.4); }
.word-card > .btn.ghost.small { width: 100%; margin-top: 12px; }

/* ---------------- 复习 / 测验 ---------------- */
.quiz-head { text-align: center; color: var(--muted); font-size: 13px; margin-bottom: 14px; }
.review-card, .quiz-card {
  background: var(--card); border-radius: var(--radius); padding: 24px 20px;
  border: 1px solid rgba(255, 255, 255, 0.06); animation: pop 0.22s ease both;
}
.rc-word { font-size: 34px; font-weight: 800; text-align: center; color: var(--gold2); }
.rc-phonetic { text-align: center; color: var(--muted); margin: 4px 0 14px; }
.rc-ctx { background: var(--bg2); border-radius: 12px; padding: 12px; margin-bottom: 16px; font-size: 13px; }
.rc-ctx b { color: var(--gold2); font-size: 12px; display: block; margin-bottom: 6px; }
.rc-ctx .cn { color: var(--muted); font-size: 12px; margin-top: 4px; }
.rc-meaning { text-align: center; font-size: 20px; font-weight: 700; margin: 8px 0 4px; }
.review-card .btn.big { margin-top: 6px; }

.qc-meaning { font-size: 22px; font-weight: 800; text-align: center; }
.qc-example { background: var(--bg2); border-radius: 12px; padding: 12px; font-size: 14px; margin: 14px 0; }
.qc-example span { color: var(--muted); font-size: 12px; }
.qc-form { display: flex; flex-direction: column; gap: 12px; }
.qc-input {
  width: 100%; padding: 15px; font-size: 20px; text-align: center; letter-spacing: 2px;
  background: var(--bg); color: var(--text); border: 2px solid rgba(245, 185, 66, 0.35);
  border-radius: 14px; outline: none;
}
.qc-input:focus { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(245, 185, 66, 0.15); }
.qc-result { border-radius: 12px; padding: 14px; text-align: center; font-size: 15px; margin-bottom: 14px; }
.qc-result.ok { background: rgba(111, 227, 165, 0.12); color: var(--ok); }
.qc-result.no { background: rgba(255, 122, 122, 0.12); color: var(--danger); }
.qc-result small { color: var(--muted); }

.empty-state {
  text-align: center; padding: 60px 24px; color: var(--muted);
  display: flex; flex-direction: column; align-items: center; gap: 10px; font-size: 32px;
}
.empty-state b { font-size: 18px; color: var(--text); }
.empty-state p { font-size: 13px; }
.empty-state .btn { margin-top: 10px; font-size: 16px; }

/* ---------------- 我的 / 设置 ---------------- */
.me-card {
  background: var(--card); border-radius: var(--radius); padding: 16px;
  border: 1px solid rgba(255, 255, 255, 0.06); margin-bottom: 14px;
}
.me-card h3 { font-size: 15px; margin-bottom: 12px; }
.me-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 0; font-size: 14px; flex-wrap: wrap; }
.me-row b { color: var(--gold2); }
.me-note { font-size: 12px; color: var(--muted); margin-top: 8px; }
#remind-time {
  background: var(--bg); color: var(--text); border: 1px solid rgba(245, 185, 66, 0.35);
  border-radius: 10px; padding: 8px 12px; font-size: 16px; color-scheme: dark;
}
.stage-mini { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; }
.me-links { display: flex; flex-direction: column; gap: 10px; }
.me-link {
  display: flex; justify-content: space-between; align-items: center; gap: 8px;
  background: var(--card); border: 1px solid rgba(255, 255, 255, 0.06); color: var(--text);
  border-radius: 14px; padding: 15px 16px; font-size: 15px; text-decoration: none;
  cursor: pointer; font-family: inherit; width: 100%; text-align: left;
}
.me-link em { font-style: normal; font-size: 11px; color: var(--muted); }
.me-link.danger { color: var(--danger); justify-content: center; }

/* ---------------- 勋章与数据 ---------------- */
.data-panel { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 14px; }
.dp-item { background: var(--card); border-radius: 14px; padding: 14px 8px; text-align: center; border: 1px solid rgba(255, 255, 255, 0.05); }
.dp-item b { display: block; font-size: 22px; color: var(--gold2); }
.dp-item span { font-size: 11px; color: var(--muted); }
.chart-card { background: var(--card); border-radius: var(--radius); padding: 16px; margin-bottom: 14px; border: 1px solid rgba(255, 255, 255, 0.05); }
.chart-card h3 { font-size: 14px; margin-bottom: 14px; color: var(--muted); }
.bar-chart { display: flex; align-items: flex-end; gap: 8px; height: 120px; }
.bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; height: 100%; justify-content: flex-end; gap: 4px; }
.bar { width: 70%; background: linear-gradient(180deg, var(--gold2), #b97f16); border-radius: 6px 6px 2px 2px; position: relative; min-height: 4px; }
.bar em { position: absolute; top: -18px; left: 50%; transform: translateX(-50%); font-size: 10px; color: var(--gold2); font-style: normal; }
.bar-col span { font-size: 10px; color: var(--muted); }
.badge-wall { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.badge { background: var(--card); border-radius: var(--radius); padding: 16px 12px; text-align: center; border: 1px solid rgba(255, 255, 255, 0.05); }
.badge i { font-style: normal; font-size: 30px; display: block; }
.badge b { display: block; font-size: 14px; margin: 6px 0 2px; }
.badge span { font-size: 11px; color: var(--muted); }
.badge.locked { opacity: 0.45; }
.badge.has { border-color: rgba(245, 185, 66, 0.4); box-shadow: 0 0 18px rgba(245, 185, 66, 0.08); }

/* ---------------- 首次进入 ---------------- */
.onboarding { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; position: relative; overflow: hidden; }
.ob-glow { position: absolute; top: -80px; left: 50%; transform: translateX(-50%); width: 340px; height: 340px; border-radius: 50%; background: radial-gradient(circle, rgba(245, 185, 66, 0.28), transparent 65%); pointer-events: none; }
.ob-logo { font-size: 64px; animation: pop 0.5s ease both; }
.ob-title { font-size: 28px; margin-top: 10px; letter-spacing: 2px; }
.ob-sub { color: var(--muted); margin-top: 8px; font-size: 14px; }
.ob-ask { margin: 34px 0 16px; color: var(--gold2); font-weight: 700; }
.stage-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; width: 100%; max-width: 320px; }
.stage-btn {
  padding: 18px 0; font-size: 17px; font-weight: 700; border-radius: var(--radius); cursor: pointer;
  background: linear-gradient(135deg, var(--card), var(--card2)); color: var(--text);
  border: 1px solid rgba(245, 185, 66, 0.25); transition: transform 0.12s ease;
}
.stage-btn:active { transform: scale(0.95); background: var(--gold); color: #2a1e05; }
.ob-note { margin-top: 30px; font-size: 11px; color: var(--muted); opacity: 0.7; }

/* ---------------- toast ---------------- */
#toast-box { position: fixed; top: 16px; left: 50%; transform: translateX(-50%); z-index: 200; width: 90%; max-width: 420px; display: flex; flex-direction: column; gap: 8px; pointer-events: none; }
.toast {
  background: rgba(28, 22, 48, 0.96); border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--text); border-radius: 14px; padding: 12px 16px; font-size: 14px; text-align: center;
  opacity: 0; transform: translateY(-14px); transition: all 0.3s ease;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45); backdrop-filter: blur(8px);
}
.toast.show { opacity: 1; transform: none; }
.toast.gold { border-color: rgba(245, 185, 66, 0.55); color: var(--gold2); }
.toast.warn { border-color: rgba(255, 122, 122, 0.45); }

/* ---------------- 打印中心 ---------------- */
.print-section { background: var(--card); border-radius: var(--radius); padding: 16px; margin-bottom: 16px; border: 1px solid rgba(255, 255, 255, 0.06); }
.ps-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.ps-head h2 { font-size: 16px; }
.ps-note { font-size: 12px; color: var(--muted); margin: 8px 0 12px; }
.print-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.print-table th, .print-table td { padding: 8px 6px; border-bottom: 1px solid rgba(255, 255, 255, 0.08); text-align: left; vertical-align: top; }
.print-table th { color: var(--gold2); font-size: 12px; }
.print-table .none { text-align: center; color: var(--muted); }

/* ============================================================
 * @media print — A4 打印样式（双栏词表）
 * 点击「打印A4」时 body 带 data-print="errors|essay"，仅输出对应词库
 * ============================================================ */
@media print {
  @page { size: A4; margin: 14mm; }
  body { background: #fff !important; color: #000 !important; font-size: 11pt; }
  #app { max-width: none; box-shadow: none; background: #fff !important; min-height: auto; }
  .tabbar, .topbar, .ps-head .btn, .ps-note, .hint-bar, .hs-bar, #toast-box,
  .foot-note, .stage-light { display: none !important; }
  .page { padding: 0; animation: none; }
  .print-section { display: none; background: #fff; border: none; padding: 0; margin: 0; }
  body[data-print="errors"] .pa-errors { display: block !important; }
  body[data-print="essay"] .pa-essay { display: block !important; }
  .ps-head h2 { color: #000; font-size: 15pt; border-bottom: 2px solid #000; padding-bottom: 4mm; margin-bottom: 5mm; }

  /* 双栏词表 */
  .print-table.two-col tbody { display: grid; grid-template-columns: 1fr 1fr; column-gap: 8mm; }
  .print-table.two-col thead { display: none; }
  .print-table.two-col tr { display: block; break-inside: avoid; border-bottom: 0.4pt solid #999; padding: 2mm 0; }
  .print-table.two-col td { display: inline; border: none; padding: 0 2mm 0 0; color: #000; font-size: 10pt; }
  .print-table.two-col td:first-child { font-weight: 700; font-size: 11pt; }
  .print-table.two-col .none { display: block; color: #666; }
}

/* ============================================================
 * 第三部分：主题皮肤（CSS 变量切换，body[data-skin] 全站生效）
 * ============================================================ */
body[data-skin="dawn"] {
  --bg: #f6f3ec; --bg2: #fffdf7; --card: #ffffff; --card2: #f0ebdf;
  --gold: #e8a13a; --gold2: #c47f16; --text: #2c2620; --muted: #8d8474;
}
body[data-skin="dawn"] #app { background: linear-gradient(180deg, #fff8ea, var(--bg) 40%); }
body[data-skin="dawn"] .tabbar { background: rgba(255, 253, 247, 0.94); border-top-color: rgba(0,0,0,0.08); }
body[data-skin="dawn"] .stage-btn, body[data-skin="dawn"] .task-card, body[data-skin="dawn"] .ep-card,
body[data-skin="dawn"] .me-card, body[data-skin="dawn"] .me-link, body[data-skin="dawn"] .stat-chip,
body[data-skin="dawn"] .chart-card, body[data-skin="dawn"] .badge, body[data-skin="dawn"] .dp-item,
body[data-skin="dawn"] .print-section, body[data-skin="dawn"] .shop-card, body[data-skin="dawn"] .asset-chip { border-color: rgba(0,0,0,0.08); }
body[data-skin="dawn"] .bubble, body[data-skin="dawn"] .wc-example, body[data-skin="dawn"] .qc-example,
body[data-skin="dawn"] .rc-ctx, body[data-skin="dawn"] .word-card { background: #fffdf7; }
body[data-skin="dawn"] .line.me .bubble { background: #fdeecb; border-color: rgba(196,127,22,.35); }
body[data-skin="dawn"] .qc-input, body[data-skin="dawn"] #remind-time { background: #fff; color: #2c2620; }
body[data-skin="dawn"] .btn.ghost { border-color: rgba(0,0,0,0.18); }
body[data-skin="dawn"] .toast { background: rgba(255,253,247,.97); color: #2c2620; }
body[data-skin="dawn"] .word-card { background: #fffdf7; }

body[data-skin="mint"] {
  --bg: #0f1f1a; --bg2: #143027; --card: #1a3a2e; --card2: #1f4636;
  --gold: #5fd9a4; --gold2: #8cecC4; --text: #ecfff5; --muted: #8fb8a5;
}
body[data-skin="mint"] #app { background: radial-gradient(120% 60% at 50% -10%, rgba(95,217,164,.14), transparent 60%), linear-gradient(180deg, var(--bg2), var(--bg) 40%); }
body[data-skin="mint"] .btn.gold { background: linear-gradient(135deg, #5fd9a4, #35b07c); color: #062017; box-shadow: 0 6px 18px rgba(95,217,164,.28); }
body[data-skin="mint"] .line.me .bubble { background: linear-gradient(135deg, #14382a, #1b4a35); border-color: rgba(95,217,164,.28); }

body[data-skin="sakura"] {
  --bg: #241320; --bg2: #2e1828; --card: #3a1f31; --card2: #46253b;
  --gold: #f49ac1; --gold2: #ffc0d9; --text: #ffedf4; --muted: #c79bae;
}
body[data-skin="sakura"] #app { background: radial-gradient(120% 60% at 50% -10%, rgba(244,154,193,.16), transparent 60%), linear-gradient(180deg, var(--bg2), var(--bg) 40%); }
body[data-skin="sakura"] .btn.gold { background: linear-gradient(135deg, #f49ac1, #e0729f); color: #3d1028; box-shadow: 0 6px 18px rgba(244,154,193,.3); }
body[data-skin="sakura"] .line.me .bubble { background: linear-gradient(135deg, #41182f, #552040); border-color: rgba(244,154,193,.3); }

/* ============================================================
 * 第三部分：资产 / 头衔 / 剧情徽章 / 商店 / 仪表盘
 * ============================================================ */
.asset-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 14px; }
.asset-chip { background: var(--card); border: 1px solid rgba(255,255,255,.06); border-radius: 14px; padding: 10px 4px; text-align: center; }
.asset-chip i { font-style: normal; font-size: 18px; display: block; }
.asset-chip b { display: block; font-size: 17px; color: var(--gold2); }
.asset-chip span { font-size: 10px; color: var(--muted); }

.title-bar { height: 14px; border-radius: 999px; background: rgba(255,255,255,.08); overflow: hidden; margin: 6px 0; }
.title-bar div { height: 100%; border-radius: 999px; background: linear-gradient(90deg, #e89b2e, var(--gold2)); transition: width .3s ease; }

.story-wall { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.story-badge { background: var(--bg2); border: 1px solid rgba(255,255,255,.06); border-radius: 14px; padding: 12px 10px; text-align: center; }
.story-badge i { font-style: normal; font-size: 26px; display: block; }
.story-badge b { display: block; font-size: 13px; margin: 4px 0 2px; }
.story-badge span { font-size: 10px; color: var(--muted); }
.story-badge.locked { opacity: .45; filter: grayscale(1); }
.story-badge.has { border-color: rgba(245,185,66,.4); }

.shop-list { display: flex; flex-direction: column; gap: 12px; }
.shop-card { display: flex; align-items: center; gap: 12px; background: var(--card); border: 1px solid rgba(255,255,255,.06); border-radius: var(--radius); padding: 16px; }
.shop-card > i { font-style: normal; font-size: 30px; }
.shop-info { flex: 1; }
.shop-info b { font-size: 15px; }
.shop-info p { font-size: 12px; color: var(--muted); margin-top: 3px; }
.shop-act { display: flex; flex-direction: column; gap: 6px; align-items: flex-end; }

.note-list { display: flex; flex-direction: column; gap: 12px; }
.note-card { background: var(--card); border-radius: var(--radius); padding: 16px; border: 1px solid rgba(245,185,66,.25); }
.note-card b { color: var(--gold2); font-size: 15px; display: block; }
.note-card em { display: block; font-style: normal; font-size: 12px; color: var(--muted); margin: 6px 0; }
.note-card ul { padding-left: 18px; font-size: 13px; line-height: 1.9; }

.bar-chart.fourteen { height: 110px; gap: 4px; }
.bar-chart.fourteen .bar-col span { font-size: 8px; transform: rotate(-45deg); transform-origin: center; white-space: nowrap; }
.rc-svg { width: 100%; height: 110px; display: block; }
.ep-progress { display: flex; align-items: center; gap: 10px; margin: 10px 0; font-size: 12px; }
.ep-progress span { flex: 0 0 118px; color: var(--muted); }
.ep-progress b { flex: 0 0 38px; text-align: right; color: var(--gold2); }
.ep-bar { flex: 1; height: 10px; border-radius: 999px; background: rgba(255,255,255,.08); overflow: hidden; }
.ep-bar div { height: 100%; border-radius: 999px; background: linear-gradient(90deg, #e89b2e, var(--gold2)); }
.share-preview { min-height: 90px; display: flex; align-items: center; justify-content: center; }
.share-canvas { width: 100%; border-radius: 12px; box-shadow: 0 8px 30px rgba(0,0,0,.4); }

/* ============================================================
 * 第四部分：打印中心（3 数据源 × 3 版式 × 2 排序 + 实时预览）
 * ============================================================ */
.print-ctl { background: var(--card); border-radius: var(--radius); padding: 14px; margin-bottom: 14px; border: 1px solid rgba(255,255,255,.06); }
.print-ctl label { display: block; font-size: 12px; color: var(--muted); margin: 8px 0 6px; }
.ctl-row { display: flex; flex-wrap: wrap; gap: 8px; }
.print-actions { display: flex; gap: 10px; justify-content: center; margin: 14px 0 8px; }
.post-print-bar { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; background: rgba(245,185,66,.12); border: 1px solid rgba(245,185,66,.35); color: var(--gold2); border-radius: 14px; padding: 11px 14px; font-size: 13px; margin-bottom: 12px; animation: pop .25s ease both; }

.print-preview { background: #fff; color: #000; border-radius: 12px; padding: 20px 18px; box-shadow: 0 8px 30px rgba(0,0,0,.35); }
.pp-head h2 { font-size: 17px; border-bottom: 2px solid #000; padding-bottom: 6px; color: #000; }
.pp-head p { font-size: 11px; color: #666; margin: 5px 0 12px; }
.pp-empty { color: #888; font-size: 13px; text-align: center; padding: 20px 0; }
.pl-en { columns: 3; font-size: 12px; line-height: 2; padding-left: 18px; }
.pl-en li { break-inside: avoid; page-break-inside: avoid; }
.pl-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.pl-table th, .pl-table td { border-bottom: 1px solid #bbb; padding: 6px 5px; text-align: left; vertical-align: top; color: #000; }
.pl-table th { font-size: 11px; color: #444; }
.pl-table .w { font-weight: 700; font-size: 13px; }
.pl-table tr { break-inside: avoid; page-break-inside: avoid; }

/* 打印输出：仅输出词表预览区，隐藏 App UI；表头重复、行不跨页截断 */
@media print {
  body[data-print="list"] .print-preview { display: block !important; box-shadow: none; border-radius: 0; padding: 0; }
  body[data-print="list"] .page > *:not(.print-preview) { display: none !important; }
  body[data-print="list"] .pl-table thead { display: table-header-group; }
  .pl-table tr { break-inside: avoid; page-break-inside: avoid; }
  .pl-en li { break-inside: avoid; page-break-inside: avoid; }
}

/* ============================================================
 * 第五、六部分：剧情闯关 / 三层学习 / 道具背包
 * ============================================================ */
.story-progress-bar { position: relative; height: 26px; border-radius: 999px; background: rgba(255,255,255,.08); overflow: hidden; margin-bottom: 14px; }
.story-progress-bar div { height: 100%; border-radius: 999px; background: linear-gradient(90deg, #e89b2e, var(--gold2)); transition: width .3s ease; }
.story-progress-bar em { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 11px; color: var(--text); font-style: normal; text-shadow: 0 1px 3px rgba(0,0,0,.5); }
.inv-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 14px; }
.inv-chip { background: var(--card); border: 1px solid rgba(255,255,255,.06); border-radius: 14px; padding: 10px 4px; text-align: center; }
.inv-chip i { font-style: normal; font-size: 20px; display: block; }
.inv-chip b { display: block; font-size: 14px; color: var(--gold2); }
.inv-chip span { font-size: 10px; color: var(--muted); }
.chapter-block { margin-bottom: 18px; }
.chapter-block h3 { font-size: 15px; color: var(--gold2); margin: 0 2px 10px; }
.seg-card { display: flex; align-items: center; justify-content: space-between; gap: 10px; background: var(--card); border: 1px solid rgba(255,255,255,.06); border-radius: 14px; padding: 13px 14px; margin-bottom: 8px; text-decoration: none; color: var(--text); }
.seg-card.locked { opacity: .5; }
.seg-info { display: flex; flex-direction: column; gap: 2px; }
.seg-info b { font-size: 14px; display: flex; gap: 6px; align-items: center; }
.seg-info span { font-size: 11px; color: var(--muted); }
.choice-list { display: flex; flex-direction: column; gap: 10px; margin: 14px 0; }
.choice-opt { background: var(--bg2); border: 1px solid rgba(245,185,66,.3); color: var(--text); border-radius: 12px; padding: 13px 14px; font-size: 14px; text-align: left; cursor: pointer; font-family: inherit; line-height: 1.5; transition: transform .1s ease; }
.choice-opt:active { transform: scale(.98); background: rgba(245,185,66,.15); }
.choice-opt.eliminated { opacity: .3; text-decoration: line-through; cursor: not-allowed; }
.mask-word { text-align: center; font-size: 30px; letter-spacing: 6px; font-weight: 800; color: var(--gold2); margin: 6px 0 14px; font-family: "Courier New", monospace; }
.pick-list { display: flex; flex-direction: column; gap: 8px; }
.pick-row { display: flex; align-items: center; gap: 10px; background: var(--card); border: 1px solid rgba(255,255,255,.06); border-radius: 12px; padding: 11px 13px; cursor: pointer; }
.pick-row.on { border-color: rgba(245,185,66,.45); }
.pick-row b { font-size: 15px; }
.pick-row em { font-style: normal; font-size: 11px; color: var(--muted); margin-left: auto; }
.pick-box { font-size: 16px; }

/* ============ 第七、八部分：词库导入 / 三段式习惯养成 ============ */
.habit-bar { margin: 0 0 14px; padding: 12px 14px; border-radius: 14px;
  background: var(--card); border: 1px solid rgba(245, 185, 66, 0.25); }
.habit-bar h4 { margin: 0 0 6px; font-size: 14px; color: var(--gold2); }
.habit-task { display: flex; justify-content: space-between; font-size: 13px; color: var(--muted); padding: 3px 0; }
.habit-task.done { color: var(--gold2); }
.habit-task.done b::after { content: ' ✓'; }
.quit-hint { margin-top: 8px; padding: 8px 10px; border-radius: 10px;
  background: rgba(245, 185, 66, 0.12); border: 1px dashed rgba(245, 185, 66, 0.4);
  color: var(--gold2); font-size: 13px; display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.quit-hint button { flex: none; }
.drop-zone { border: 2px dashed rgba(245, 185, 66, 0.4); border-radius: 14px; padding: 18px;
  text-align: center; color: var(--muted); font-size: 14px; margin-bottom: 10px; transition: .2s; }
.drop-zone.over { border-color: var(--gold); background: rgba(245, 185, 66, 0.08); color: var(--gold2); }
.file-input { display: block; margin: 0 auto 10px; font-size: 13px; color: var(--muted); }
.paste-area { width: 100%; min-height: 110px; border: 1px solid rgba(255, 255, 255, 0.15); border-radius: 12px;
  padding: 10px; font-size: 13px; font-family: inherit; margin-bottom: 10px; resize: vertical;
  box-sizing: border-box; background: rgba(255, 255, 255, 0.05); color: inherit; }
.vocab-row { display: flex; align-items: center; gap: 8px; padding: 8px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07); font-size: 14px; }
.vocab-row b { flex: none; min-width: 90px; }
.vocab-row > span { flex: none; color: var(--muted); font-size: 12px; }
.vocab-row > em { flex: 1; font-style: normal; color: var(--muted); font-size: 13px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vocab-flags { display: flex; gap: 4px; flex: none; font-style: normal; }
.batch-row { display: flex; justify-content: space-between; align-items: center; gap: 8px;
  padding: 8px 0; border-bottom: 1px solid rgba(255, 255, 255, 0.07); }
.batch-row span { display: block; font-size: 12px; color: var(--muted); }
.cert-preview { margin-top: 12px; text-align: center; }
.cert-preview .share-canvas { max-width: 100%; }
body[data-skin="dawn"] .paste-area { background: #fff; color: #2c2620; }
body[data-skin="dawn"] #cert-name, body[data-skin="dawn"] #vocab-search { background: #fff; color: #2c2620; }

/* ============ 第九部分：点读 / 记忆法 / 中文选项 / 链接导入 ============ */
.tts-btn { display: inline-block; border: 1px solid rgba(245, 185, 66, 0.4); background: rgba(245, 185, 66, 0.08);
  color: var(--gold2); border-radius: 999px; padding: 1px 8px; font-size: 12px; line-height: 1.6;
  cursor: pointer; vertical-align: middle; }
.tts-btn:active { transform: scale(0.94); }
button.tts-btn { font-family: inherit; }
.wc-mnemonic { margin: 10px 0; padding: 10px 12px; border-radius: 12px;
  background: rgba(245, 185, 66, 0.08); border: 1px dashed rgba(245, 185, 66, 0.4); text-align: left; }
.wc-mnemonic b { font-size: 13px; color: var(--gold2); }
.wc-mnemonic b small { color: var(--muted); font-weight: 400; margin-left: 6px; }
.wc-mnemonic p { margin: 6px 0 0; font-size: 13px; line-height: 1.8; color: inherit; }
.ana-group { padding: 8px 0; border-bottom: 1px solid rgba(255, 255, 255, 0.07); }
.ana-group:last-of-type { border-bottom: none; }
.ana-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.ana-head b { font-size: 14px; color: var(--gold2); }
@media print { .no-print { display: none !important; } }

/* ============ 第十部分：视频直链转写 ============ */
.video-embed { position: relative; width: 100%; padding-top: 56.25%; border-radius: 12px;
  overflow: hidden; background: #000; margin-bottom: 10px; }
.video-embed iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.asr-live { max-height: 160px; overflow-y: auto; padding: 10px 12px; margin: 10px 0;
  border: 1px solid rgba(245, 185, 66, 0.3); border-radius: 12px;
  background: rgba(255, 255, 255, 0.04); font-size: 14px; line-height: 1.8; word-break: break-word; }
.asr-live .asr-interim { color: var(--muted); }

/* ============ 第十一部分：视频自动解析流水线 ============ */
.parse-steps { margin: 10px 0; padding: 10px 12px; border: 1px solid rgba(245, 185, 66, 0.22);
  border-radius: 12px; background: rgba(255, 255, 255, 0.04); font-size: 13px; line-height: 2; }
.parse-step { color: var(--muted); }
.parse-step.done { color: inherit; }
.film-strip { display: flex; gap: 6px; overflow-x: auto; padding: 4px 0; margin-top: 10px; }
.film-strip img { width: 160px; min-width: 160px; border-radius: 8px; border: 1px solid rgba(255, 255, 255, 0.12);
  background: #000; }
