/* 学霸星球·英语听力王 —— 视觉对齐「数学题霸」设计语言
   灰蓝紫渐变底 · 蓝紫渐变主按钮 · 毛玻璃白卡 · 渐变竖条标题 */
:root {
  --brand: #1f5fd6;
  --brand-dark: #1d4ed8;
  --brand-soft: #eef4ff;
  --violet: #8b5cf6;
  --grad: linear-gradient(135deg, #1f5fd6, #8b5cf6);
  --grad-btn: linear-gradient(135deg, #1f5fd6, #3b82f6);
  --bg: #eef1f5;
  --card: #ffffff;
  --text: #1a1d21;
  --muted: #8b9199;
  --sub: #4b5563;
  --line: #e5e7eb;
  --danger: #e11d48;
  --warn: #f59e0b;
  --radius: 14px;
  --shadow: 0 4px 28px rgba(16,24,40,.07), 0 1px 4px rgba(16,24,40,.04);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; }
body {
  font: 15px/1.6 "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", -apple-system, sans-serif;
  background: linear-gradient(165deg, #e3edfd 0%, #ece7fc 48%, #e4f0fd 100%);
  background-attachment: fixed;
  color: var(--text);
}
/* 背景装饰光晕：左上蓝、右下紫，让页面有"品牌色氛围"而不是白板 */
body::before {
  content: '';
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(560px 360px at 12% -4%, rgba(31,95,214,.14), transparent 62%),
    radial-gradient(640px 420px at 96% 30%, rgba(139,92,246,.12), transparent 65%),
    radial-gradient(520px 380px at 50% 108%, rgba(59,130,246,.10), transparent 60%);
}
#app { max-width: 640px; margin: 0 auto; min-height: 100vh; display: flex; flex-direction: column; }
.hidden { display: none !important; }

/* 顶栏 */
.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 8px; padding: 10px 14px; background: rgba(255,255,255,.82); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); border-bottom: 1px solid rgba(229,231,235,.8); box-shadow: 0 2px 12px rgba(16,24,40,.04); }
.topbar-title { flex: 1; display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 16px; letter-spacing: -.2px; min-width: 0; }
.topbar-title span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.logo-dot { width: 27px; height: 27px; border-radius: 9px; background: var(--grad); box-shadow: 0 3px 8px rgba(31,95,214,.35); flex: none; position: relative; }
.logo-dot::after { content: '听'; position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: #fff; font-size: 14px; font-weight: 800; }
.icon-btn { border: none; background: none; font-size: 20px; line-height: 1; padding: 6px 10px; border-radius: 10px; cursor: pointer; color: var(--text); }
.icon-btn:active { background: rgba(31,95,214,.08); }
.view { flex: 1; padding: 14px 14px 90px; }
.foot { position: fixed; bottom: 0; left: 0; right: 0; max-width: 640px; margin: 0 auto; display: flex; justify-content: space-between; padding: 8px 16px; font-size: 12px; color: var(--muted); background: rgba(238,241,245,.92); backdrop-filter: blur(8px); }
.foot a { color: var(--brand); text-decoration: none; font-weight: 600; }
.toast { position: fixed; bottom: 90px; left: 50%; transform: translateX(-50%); background: rgba(15,20,28,.92); color: #fff; padding: 9px 16px; border-radius: 10px; font-size: 14px; z-index: 99; max-width: 80%; box-shadow: 0 8px 24px rgba(15,20,28,.3); }

/* 通用卡片：毛玻璃白卡 + 柔和大阴影 */
.card { background: rgba(255,255,255,.88); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border: 1px solid rgba(229,231,235,.8); border-radius: var(--radius); padding: 16px; margin-bottom: 12px; box-shadow: var(--shadow); }
.card h2 { margin: 0 0 6px; font-size: 18px; font-weight: 800; letter-spacing: .02em; }
.card h3 { margin: 0 0 8px; font-size: 15px; font-weight: 700; display: flex; align-items: center; gap: 7px; }
.card h3::before { content: ''; width: 3px; height: 14px; border-radius: 2px; background: var(--grad); flex: none; }
.sub { color: var(--muted); font-size: 13px; }

/* 首页 hero：蓝紫渐变大卡（首屏品牌锚点）+ 白字数据胶囊 */
.hero { text-align: left; background: linear-gradient(135deg, #1f5fd6 0%, #6d4fd8 55%, #8b5cf6 100%); border: none; color: #fff; box-shadow: 0 10px 30px rgba(31,95,214,.30); position: relative; overflow: hidden; }
.hero::after { content: ''; position: absolute; right: -46px; top: -46px; width: 150px; height: 150px; border-radius: 50%; background: rgba(255,255,255,.10); }
.hero::before { content: ''; position: absolute; right: 34px; bottom: -58px; width: 110px; height: 110px; border-radius: 50%; background: rgba(255,255,255,.07); }
.hero h2 { font-size: 23px; margin-bottom: 8px; color: #fff; letter-spacing: -.3px; position: relative; z-index: 1; }
.hero .hero-bar { width: 72px; height: 4px; border-radius: 2px; background: rgba(255,255,255,.85); margin-bottom: 12px; position: relative; z-index: 1; }
.hero .sub { color: rgba(255,255,255,.88); line-height: 1.8; position: relative; z-index: 1; }
.hero-chips { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; position: relative; z-index: 1; }
.hchip { background: rgba(255,255,255,.16); border: 1px solid rgba(255,255,255,.30); border-radius: 999px; padding: 4px 12px; font-size: 12px; color: #fff; backdrop-filter: blur(4px); }
.hchip b { font-size: 14px; color: #fff; margin-right: 2px; font-weight: 800; }

/* 首页年级格 */
.grade-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.grade-card { position: relative; overflow: hidden; background: rgba(255,255,255,.92); border: 1px solid rgba(229,231,235,.9); border-radius: var(--radius); padding: 16px 14px 14px; text-align: center; box-shadow: var(--shadow); cursor: pointer; transition: .15s; }
.grade-card::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3.5px; background: var(--grad); opacity: .9; }
.grade-card:hover { border-color: #a5c0ea; transform: translateY(-3px); box-shadow: 0 12px 28px rgba(31,95,214,.16); }
.grade-card:active { border-color: var(--brand); }
.grade-card.locked { opacity: .55; cursor: not-allowed; }
.grade-card.locked::before { background: #cbd2dc; }
.grade-card.locked .g-ico { background: #c7cdd6; box-shadow: none; }
.grade-card.locked .g-badge { background: #eef0f2; color: var(--muted); box-shadow: none; }
.g-ico { width: 42px; height: 42px; margin: 0 auto 9px; border-radius: 14px; background: var(--grad); color: #fff; font-weight: 800; font-size: 18px; display: flex; align-items: center; justify-content: center; box-shadow: 0 4px 10px rgba(31,95,214,.28); }
.grade-card .g-name { font-weight: 800; font-size: 16px; }
.grade-card .g-sub { font-size: 12px; color: var(--muted); margin-top: 2px; }
.grade-card .g-badge { display: inline-block; margin-top: 9px; font-size: 11px; background: var(--grad-btn); color: #fff; border: none; padding: 4px 13px; border-radius: 999px; font-weight: 600; box-shadow: 0 2px 6px rgba(31,95,214,.25); }
@media (min-width: 560px) { .grade-grid { grid-template-columns: repeat(3, 1fr); } }
/* 浮动客服条（对照题霸：右下常驻购买入口，避开底部信息栏） */
.cs-float { position: fixed; bottom: 46px; right: max(14px, calc(50vw - 306px)); z-index: 60; background: linear-gradient(135deg, #10b981, #059669); color: #fff; border: none; border-radius: 999px; padding: 10px 16px; font-size: 13px; font-weight: 700; box-shadow: 0 6px 18px rgba(5,150,105,.35); cursor: pointer; transition: .15s; }
.cs-float:hover { transform: translateY(-2px); box-shadow: 0 10px 24px rgba(5,150,105,.45); }
.cs-float:active { transform: translateY(0); }
.badge-gray { background: #eef0f2 !important; color: var(--muted) !important; border-color: #e5e7eb !important; }

/* 单元列表 */
.unit-item { display: flex; align-items: center; gap: 12px; background: rgba(255,255,255,.88); border: 1px solid rgba(229,231,235,.8); border-radius: var(--radius); padding: 14px; margin-bottom: 10px; cursor: pointer; box-shadow: var(--shadow); transition: .12s; }
.unit-item:hover { border-color: #a5c0ea; }
.unit-item:active { background: var(--brand-soft); }
.unit-no { width: 40px; height: 40px; border-radius: 11px; background: var(--brand-soft); border: 1px solid #d7e2f5; color: var(--brand); font-weight: 700; display: flex; align-items: center; justify-content: center; flex: none; }
.unit-item .u-t { font-weight: 600; }
.unit-item .u-s { font-size: 12px; color: var(--muted); }
.unit-item .arrow { margin-left: auto; color: #9aa1ab; }

/* 篇目列表 */
.piece-item { display: flex; align-items: center; gap: 10px; background: rgba(255,255,255,.88); border: 1px solid rgba(229,231,235,.7); border-radius: 12px; padding: 12px 14px; margin-bottom: 8px; cursor: pointer; box-shadow: 0 1px 3px rgba(16,24,40,.05); transition: .12s; }
.piece-item:hover { border-color: #a5c0ea; }
.piece-item:active { background: var(--brand-soft); }
.piece-item .p-idx { font-size: 12px; color: #9aa5b5; font-weight: 600; width: 30px; flex: none; font-variant-numeric: tabular-nums; }
.piece-item .p-t { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; }
.p-done { color: var(--brand); font-size: 13px; flex: none; }
.p-lock { color: var(--muted); font-size: 13px; flex: none; }

/* 播放器 */
.player-card { position: sticky; top: 56px; z-index: 10; }
.p-title { font-weight: 700; font-size: 16px; margin-bottom: 2px; }
.player-row { display: flex; align-items: center; gap: 10px; margin-top: 10px; }
.play-btn { width: 52px; height: 52px; border-radius: 50%; border: none; background: var(--grad-btn); color: #fff; font-size: 22px; cursor: pointer; flex: none; display: flex; align-items: center; justify-content: center; box-shadow: 0 3px 10px rgba(31,95,214,.28); }
.play-btn.playing { background: #1a1d21; box-shadow: 0 3px 10px rgba(16,24,40,.3); }
.rate-group, .mini-group { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { border: 1px solid #d8dce2; background: #fff; border-radius: 999px; padding: 5px 12px; font-size: 13px; cursor: pointer; color: var(--sub); }
.chip.on { background: var(--grad-btn); border-color: transparent; color: #fff; font-weight: 600; box-shadow: 0 2px 8px rgba(31,95,214,.25); }
.prog { height: 5px; background: #e8ecf1; border-radius: 999px; margin-top: 12px; overflow: hidden; }
.prog > div { height: 100%; background: var(--grad); width: 0; transition: width .2s; }

/* 原文逐句 */
.sent { padding: 9px 10px; border-radius: 10px; margin-bottom: 6px; cursor: pointer; border: 1px solid transparent; }
.sent.cur { background: var(--brand-soft); border-color: #a5c0ea; }
.sent .sp { display: inline-block; font-size: 11px; color: var(--brand); background: var(--brand-soft); border: 1px solid #d7e2f5; border-radius: 6px; padding: 0 6px; margin-right: 6px; vertical-align: 1px; }
.sent.cur .sp { background: #fff; }
.sent .zh { color: var(--muted); font-size: 13px; }
.masked .en { filter: blur(5px); user-select: none; }
.masked .zh { visibility: hidden; }
.word-tag { color: #b45309; border-bottom: 2px dotted #f0d9b8; cursor: help; font-weight: 600; }
.mode-note { font-size: 12px; color: var(--muted); margin-top: 6px; }

/* 题目 */
.q-card { border-left: 4px solid; border-image: linear-gradient(180deg, #1f5fd6, #8b5cf6) 1; border-image-slice: 1; }
.q-stem { font-weight: 600; margin-bottom: 10px; }
.opt { display: flex; align-items: center; gap: 10px; border: 1.5px solid #d8dce2; border-radius: 12px; padding: 12px; margin-bottom: 8px; cursor: pointer; background: #fff; font-size: 15px; transition: .12s; }
.opt:hover { border-color: #a8b3c2; }
.opt .opt-emoji { font-size: 26px; }
.opt.sel-right { border-color: var(--brand); background: var(--brand-soft); }
.opt.sel-wrong { border-color: var(--danger); background: #fff1f2; }
.opt.reveal { border-color: var(--brand); }
.opt.disabled { pointer-events: none; }
.tf-en { font-style: italic; }
.q-feedback { font-size: 13px; margin-top: 4px; }
.q-feedback.ok { color: var(--brand-dark); }
.q-feedback.bad { color: var(--danger); }
.score-bar { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.score-num { font-size: 22px; font-weight: 800; color: var(--brand-dark); }

/* 按钮：蓝渐变主按钮（题霸 .btn） */
.btn { display: inline-block; border: none; border-radius: 10px; padding: 12px 18px; font-size: 14px; font-weight: 600; cursor: pointer; background: var(--grad-btn); color: #fff; text-align: center; box-shadow: 0 3px 10px rgba(31,95,214,.28); transition: .15s; }
.btn:hover { filter: brightness(1.08); transform: translateY(-1px); box-shadow: 0 5px 14px rgba(31,95,214,.34); }
.btn:active { filter: brightness(.96); transform: none; }
.btn.ghost { background: #fff; color: var(--sub); border: 1px solid #d8dce2; box-shadow: none; }
.btn.ghost:hover { border-color: #a8b3c2; background: #f5f6f8; }
.btn.gray { background: #eef0f2; color: var(--muted); box-shadow: none; }
.btn.full { display: block; width: 100%; }
.btn-row { display: flex; gap: 10px; margin-top: 12px; }
.btn-row .btn { flex: 1; }

/* 锁定提示 */
.lock-box { text-align: center; padding: 26px 16px; }
.lock-emoji { font-size: 40px; }
.lock-box h3 { margin: 10px 0 4px; justify-content: center; }
.lock-box h3::before { display: none; }

/* 辨音特训 */
.pair-grid { display: grid; grid-template-columns: 1fr; gap: 8px; }
.pair-item { display: flex; align-items: center; gap: 8px; background: rgba(255,255,255,.88); border: 1px solid rgba(229,231,235,.7); padding: 10px 14px; border-radius: 12px; box-shadow: 0 1px 3px rgba(16,24,40,.05); font-size: 14px; }
.pair-item .hint { color: var(--muted); font-size: 12px; margin-left: auto; }
.dict-quiz .big-word { font-size: 30px; font-weight: 800; text-align: center; margin: 14px 0; letter-spacing: 1px; }
.dict-quiz .ipa { text-align: center; color: var(--muted); font-size: 13px; }

/* 我的 */
.me-row { display: flex; align-items: center; gap: 10px; padding: 12px 0; border-bottom: 1px solid #eef0f3; }
.me-row:last-child { border-bottom: none; }
.me-row .m-t { flex: 1; }
.me-row .m-v { color: var(--muted); font-size: 13px; }
.stat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; text-align: center; }
.stat-grid .num { font-size: 22px; font-weight: 800; color: var(--brand); }
.stat-grid .lbl { font-size: 12px; color: var(--muted); }
.lic-input { width: 100%; border: 1.5px solid #d8dce2; border-radius: 12px; padding: 12px; font-size: 15px; text-transform: uppercase; letter-spacing: 1px; }
.lic-input:focus { outline: none; border-color: var(--brand); }
.word-item { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px dashed var(--line); }
.word-item:last-child { border-bottom: none; }
.word-item .del { color: var(--danger); cursor: pointer; font-size: 13px; margin-left: auto; }

.wrong-item { display: flex; align-items: center; gap: 10px; background: rgba(255,255,255,.88); border: 1px solid rgba(229,231,235,.7); border-radius: 12px; padding: 12px 14px; margin-bottom: 8px; cursor: pointer; }
.wrong-item .w-t { flex: 1; min-width: 0; font-size: 14px; }
.empty-tip { text-align: center; color: var(--muted); padding: 40px 0; font-size: 14px; }

/* 考试模式 */
.exam-entry { border: 1.5px dashed #a5c0ea; background: linear-gradient(180deg, #f2f7ff, rgba(255,255,255,.9)); }
.exam-card { border-top: 4px solid; border-image: var(--grad) 1; border-image-slice: 1; border-left: none; border-right: none; }
.exam-progress { font-size: 12px; color: var(--muted); letter-spacing: 1px; margin-bottom: 10px; }
.exam-big { font-size: 26px; font-weight: 800; line-height: 1.3; }
.exam-note { font-size: 13px; color: var(--sub); margin-top: 8px; }
.exam-rate { margin-top: 12px; font-size: 13px; color: var(--muted); display: flex; align-items: center; gap: 8px; }
.rate-pill { border: 1px solid #d8dce2; background: #fff; border-radius: 999px; padding: 4px 14px; font-size: 13px; cursor: pointer; color: var(--sub); }
.rate-pill.on { background: var(--grad-btn); border-color: transparent; color: #fff; font-weight: 600; }
.exam-score { font-size: 56px; font-weight: 800; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; text-align: center; line-height: 1.2; }
.exam-score span { font-size: 20px; font-weight: 600; margin-left: 4px; -webkit-text-fill-color: initial; }
.exam-actions { display: flex; flex-direction: column; gap: 10px; margin-top: 14px; }

/* 考试：试卷 / 答题卡 / 讲评 */
.paper-card h3 { margin-bottom: 10px; }
.opt.picked { border-color: var(--warn); background: #fffbeb; box-shadow: 0 0 0 1px var(--warn); }
.btn:disabled { opacity: .45; pointer-events: none; }
.as-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; }
.as-chip { text-align: center; padding: 8px 0; border-radius: 8px; background: #eef0f2; font-size: 13px; cursor: pointer; color: var(--muted); transition: .12s; }
.as-chip.done { background: var(--brand-soft); color: var(--brand); border: 1px solid #a5c0ea; font-weight: 700; }
.rev-q { padding: 10px 0; border-bottom: 1px dashed var(--line); }
.rev-q:last-child { border-bottom: none; }
.rev-stem { font-weight: 600; margin-bottom: 6px; }
.rev-ok { color: var(--brand-dark); font-weight: 700; }
.rev-bad { color: var(--danger); font-weight: 700; }
.rev-replay { font-size: 12px; color: var(--brand); font-weight: 400; margin-left: 6px; }
.rev-opt { padding: 7px 10px; border: 1px solid #d8dce2; border-radius: 10px; margin-bottom: 6px; font-size: 14px; }
.rev-opt.rev-right { border-color: var(--brand); background: var(--brand-soft); }
.rev-opt.rev-wrong { border-color: var(--danger); background: #fff1f2; }
.rev-tag { font-size: 12px; color: var(--muted); margin-left: 6px; }

/* 购买页（题霸结构：扎心钩子 → 价值点卡 → 正文 → 微信行） */
.buy-card h2 { text-align: center; font-size: 20px; }
.bhook { background: #fff5f5; border-left: 3px solid var(--danger); border-radius: 0 8px 8px 0; padding: 9px 12px; margin: 12px 0; font-size: 12.5px; line-height: 1.9; color: #7f1d1d; }
.bpts { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; margin: 0 0 12px; }
.bp { background: #f7faff; border: 1px solid #e4edfb; border-radius: 9px; padding: 8px 10px; }
.bp b { display: block; font-size: 12.5px; color: var(--brand-dark); margin-bottom: 2px; }
.bp span { font-size: 11px; color: #64748b; line-height: 1.5; }
.bline { font-size: 12.5px; line-height: 1.9; color: var(--sub); }
.bprice { display: flex; gap: 10px; margin: 10px 0; }
.bprice > div { flex: 1; text-align: center; border: 1.5px solid #d7e2f5; background: #f7faff; border-radius: 12px; padding: 12px 8px; }
.bprice .p-n { font-size: 22px; font-weight: 800; color: var(--brand-dark); }
.bprice .p-t { font-size: 12px; color: var(--sub); font-weight: 600; margin-top: 2px; }
.bprice .p-s { font-size: 11px; color: var(--muted); margin-top: 2px; }
.buyrow { display: flex; align-items: center; justify-content: space-between; gap: 10px; background: #f7f9fc; border: 1px solid #e6ecf5; border-radius: 9px; padding: 9px 12px; margin: 8px 0 0; font-size: 13px; }
.buyrow.wx { background: #f2fbf5; border-color: #d5eedd; }
.buyrow b { font-size: 15px; letter-spacing: .4px; color: #0f172a; }
.mini { border: 1px solid #cfdcf3; background: #fff; color: var(--brand); border-radius: 7px; padding: 3px 9px; font-size: 11.5px; cursor: pointer; white-space: nowrap; }
.mini:hover { background: #eef4ff; }
.buytip { font-size: 11.5px; color: var(--muted); line-height: 1.7; margin: 10px 0 0; }
@media (max-width: 480px) { .bpts { grid-template-columns: 1fr 1fr; } .bprice { flex-direction: column; } }
