/* 中亚商务俄语 · 30天自适应学习系统 —— 手机优先样式 */
:root {
  --bg: #eef1f7;
  --card: #ffffff;
  --ink: #212a3d;
  --muted: #7a8498;
  --line: #e7ebf3;
  --accent: #2f6bff;
  --accent-soft: #e9f0ff;
  --good: #12b76a;
  --good-soft: #e6f8f0;
  --warn: #f79009;
  --warn-soft: #fef3e2;
  --bad: #f04438;
  --bad-soft: #fdecea;
  --radius: 16px;
  --shadow: 0 2px 12px rgba(33, 42, 61, 0.07);
  --topbar-h: 56px;
  --tabbar-h: 64px;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.55;
  padding-top: var(--topbar-h);
  padding-bottom: calc(var(--tabbar-h) + 12px);
}
button { font-family: inherit; cursor: pointer; }

/* ---------- 顶栏 ---------- */
.topbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 50;
  height: var(--topbar-h);
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
  display: flex; align-items: center;
}
.topbar-inner {
  width: 100%; max-width: 560px; margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 14px;
}
.brand { font-weight: 800; font-size: 17px; letter-spacing: 0.2px; }
.brand small { color: var(--muted); font-weight: 600; font-size: 12px; margin-left: 6px; }
.icon-btn {
  border: none; background: none; font-size: 19px; padding: 8px;
  border-radius: 10px;
}
.icon-btn:active { background: var(--line); }

/* ---------- 主视图 ---------- */
#view { max-width: 560px; margin: 0 auto; padding: 10px 0 4px; }

/* ---------- 卡片 ---------- */
.card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px;
  margin: 10px 12px;
}
.card h3 { margin: 0 0 10px; font-size: 15px; }
.section-title {
  margin: 18px 12px 6px;
  font-size: 13px; font-weight: 700; color: var(--muted);
  letter-spacing: 1px;
}

/* ---------- 英雄区 ---------- */
.hero {
  margin: 10px 12px;
  border-radius: var(--radius);
  padding: 20px 18px;
  background: linear-gradient(135deg, #2f6bff 0%, #5b8cff 60%, #7fa5ff 100%);
  color: #fff;
  box-shadow: 0 6px 18px rgba(47, 107, 255, 0.28);
}
.hero .hello { font-size: 13px; opacity: 0.9; }
.hero .big { font-size: 22px; font-weight: 800; margin: 6px 0; }
.hero .sub { font-size: 13px; opacity: 0.95; }
.hero .cta-row { display: flex; gap: 10px; margin-top: 14px; }
.hero .cta {
  flex: 1; border: none; border-radius: 12px; padding: 12px 8px;
  font-size: 14px; font-weight: 700; color: #2f6bff; background: #fff;
  box-shadow: 0 2px 6px rgba(0,0,0,0.12);
}
.hero .cta:active { transform: scale(0.97); }
.hero .cta .n { display: block; font-size: 19px; }

/* ---------- 统计条 ---------- */
.stat-row { display: flex; gap: 10px; margin: 10px 12px; }
.stat {
  flex: 1; background: var(--card); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 12px 10px; text-align: center;
}
.stat .num { font-size: 21px; font-weight: 800; color: var(--accent); }
.stat .lbl { font-size: 12px; color: var(--muted); margin-top: 2px; }

/* ---------- 快速入口 ---------- */
.quick-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 10px 12px; }
.quick {
  background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 16px 14px; display: flex; align-items: center; gap: 12px;
  border: none; text-align: left; color: var(--ink);
}
.quick .ic { font-size: 26px; }
.quick .t { font-size: 15px; font-weight: 700; }
.quick .d { font-size: 12px; color: var(--muted); }
.quick:active { background: var(--accent-soft); }

/* ---------- 进度条 ---------- */
.bar { height: 8px; background: var(--line); border-radius: 99px; overflow: hidden; }
.bar-fill { height: 100%; background: var(--accent); border-radius: 99px; transition: width 0.4s ease; }
.bar-fill.good { background: var(--good); }

/* ---------- 底部导航 ---------- */
.tabbar {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 50;
  height: calc(var(--tabbar-h) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(10px);
  border-top: 1px solid var(--line);
  display: flex;
}
.tab {
  flex: 1; border: none; background: none;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 2px; font-size: 11px; color: var(--muted);
}
.tab .ic { font-size: 20px; line-height: 1; }
.tab.active { color: var(--accent); font-weight: 700; }

/* ---------- 通用按钮 ---------- */
.btn {
  display: block; width: 100%;
  border: none; border-radius: 13px;
  padding: 14px 16px; font-size: 15px; font-weight: 700;
  background: var(--accent); color: #fff;
  margin: 8px 0;
}
.btn:active { opacity: 0.85; }
.btn.ghost { background: var(--accent-soft); color: var(--accent); }
.btn.warn { background: var(--warn); color: #fff; }
.btn.danger { background: var(--bad-soft); color: var(--bad); }
.btn.gray { background: var(--line); color: var(--ink); }
.btn:disabled { opacity: 0.5; }

/* ---------- 记忆卡 ---------- */
.fc-card {
  min-height: 320px;
  display: flex; flex-direction: column;
  padding: 22px 18px;
}
.fc-top { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); }
.fc-tag {
  background: var(--accent-soft); color: var(--accent);
  padding: 3px 9px; border-radius: 99px; font-weight: 700;
}
.fc-body {
  flex: 1; display: flex; flex-direction: column;
  align-items: center; justify-content: center; text-align: center;
  gap: 14px;
}
.fc-ru { font-size: 30px; font-weight: 800; line-height: 1.35; word-break: break-word; }
.fc-tr { color: var(--muted); font-size: 16px; }
.fc-cn { font-size: 19px; font-weight: 700; color: var(--accent); }
.play-btn {
  border: none; background: var(--accent-soft); color: var(--accent);
  width: 52px; height: 52px; border-radius: 50%; font-size: 22px;
  display: inline-flex; align-items: center; justify-content: center;
}
.play-btn:active { background: var(--accent); color: #fff; }
.grade-row { display: flex; gap: 8px; margin-top: 14px; }
.grade {
  flex: 1; border: none; border-radius: 13px; padding: 14px 4px;
  font-size: 14px; font-weight: 800;
}
.grade.again { background: var(--bad-soft); color: var(--bad); }
.grade.hard { background: var(--warn-soft); color: var(--warn); }
.grade.good { background: var(--good-soft); color: var(--good); }
.fc-progress { font-size: 13px; color: var(--muted); text-align: center; margin-top: 12px; }

/* ---------- 测验 ---------- */
.chip-row { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0 4px; }
.chip {
  border: 1px solid var(--line); background: var(--card);
  border-radius: 99px; padding: 8px 14px; font-size: 13px; font-weight: 600;
  color: var(--ink);
}
.chip.on { background: var(--accent); color: #fff; border-color: var(--accent); }
.opt {
  display: block; width: 100%;
  border: 1.5px solid var(--line); background: var(--card);
  border-radius: 13px; padding: 14px 14px; margin: 8px 0;
  font-size: 15px; text-align: left; color: var(--ink);
}
.opt:active { background: var(--accent-soft); }
.opt.correct { border-color: var(--good); background: var(--good-soft); font-weight: 700; }
.opt.wrong { border-color: var(--bad); background: var(--bad-soft); }
.opt:disabled { opacity: 1; }
.q-progress { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--muted); }
.q-progress .bar { flex: 1; }
.answer-line {
  background: var(--accent-soft); color: var(--accent);
  border-radius: 12px; padding: 12px 14px; font-size: 14px; font-weight: 600;
}
.pair-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.pair {
  border: 1.5px solid var(--line); background: var(--card);
  border-radius: 12px; padding: 12px 10px; font-size: 14px; text-align: center;
  min-height: 52px; display: flex; align-items: center; justify-content: center;
}
.pair.pick { border-color: var(--accent); background: var(--accent-soft); }
.pair.match { border-color: var(--good); background: var(--good-soft); color: var(--good); font-weight: 700; }
.pair.err { border-color: var(--bad); background: var(--bad-soft); }
.pair:disabled { opacity: 1; }

/* ---------- 对话 ---------- */
.talk-item { display: flex; align-items: center; gap: 12px; }
.talk-item .meta { flex: 1; }
.talk-item .nm { font-size: 15px; font-weight: 700; }
.talk-item .st { font-size: 12px; color: var(--muted); }
.talk-sp { font-size: 11px; font-weight: 800; padding: 3px 9px; border-radius: 99px; }
.talk-sp.a { background: var(--accent-soft); color: var(--accent); }
.talk-sp.b { background: var(--warn-soft); color: var(--warn); }
.talk-ru { font-size: 21px; font-weight: 800; line-height: 1.4; }
.talk-tr { color: var(--muted); font-size: 14px; margin-top: 6px; }
.talk-cn { margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--line); font-size: 15px; }
.talk-ctrl { display: flex; gap: 8px; margin-top: 16px; }
.talk-ctrl .btn { margin: 0; flex: 1; padding: 12px 6px; font-size: 14px; }
.talk-nav { display: flex; justify-content: space-between; align-items: center; margin-top: 12px; }

/* ---------- 计划 ---------- */
.day-row { border: 1px solid var(--line); border-radius: 13px; margin: 8px 0; overflow: hidden; }
.day-head {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 12px; background: var(--card);
}
.day-head .dn {
  width: 42px; height: 42px; border-radius: 12px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  background: var(--accent-soft); color: var(--accent);
  font-weight: 800; font-size: 13px;
}
.day-head .dn.done { background: var(--good-soft); color: var(--good); }
.day-info { flex: 1; font-size: 14px; font-weight: 700; }
.day-info small { display: block; font-size: 12px; color: var(--muted); font-weight: 500; }
.stars { display: flex; gap: 3px; font-size: 17px; }
.stars span { opacity: 0.25; }
.stars span.on { opacity: 1; }
.day-body { padding: 10px 14px 14px; background: #fafbfe; border-top: 1px solid var(--line); font-size: 13px; color: #3a4458; }
.check-row {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 12px; background: var(--card); border-radius: 12px;
  margin: 6px 0; font-size: 14px;
}
.check-row input { width: 20px; height: 20px; accent-color: var(--good); flex-shrink: 0; }
.check-row.off { opacity: 0.55; }
.week-tag {
  background: var(--card); border-radius: 99px; padding: 5px 12px;
  font-size: 12px; font-weight: 700; color: var(--muted);
  display: inline-block; margin: 4px 12px;
}

/* ---------- 弹窗 / Toast ---------- */
.modal-overlay {
  position: fixed; inset: 0; z-index: 90;
  background: rgba(20, 26, 40, 0.45);
  display: flex; align-items: flex-end; justify-content: center;
}
.sheet {
  background: var(--card); width: 100%; max-width: 560px;
  border-radius: 20px 20px 0 0;
  padding: 18px 18px calc(18px + env(safe-area-inset-bottom));
  max-height: 84vh; overflow-y: auto;
}
.sheet h3 { margin: 0 0 12px; }
#toast {
  position: fixed; left: 50%; bottom: calc(var(--tabbar-h) + 26px); z-index: 99;
  transform: translateX(-50%) translateY(20px);
  background: #222b3d; color: #fff;
  padding: 10px 18px; border-radius: 99px; font-size: 14px;
  opacity: 0; pointer-events: none; transition: all 0.25s ease;
  max-width: 86vw; text-align: center;
}
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---------- 结果页 ---------- */
.result-big { font-size: 40px; text-align: center; margin: 6px 0; }
.result-score { text-align: center; font-size: 26px; font-weight: 800; color: var(--accent); }
.miss-item {
  display: flex; align-items: center; gap: 10px;
  background: var(--card); border: 1px solid var(--line);
  border-radius: 12px; padding: 10px 12px; margin: 6px 0;
}
.miss-item .r { flex: 1; }
.miss-item .r .ru { font-weight: 700; font-size: 14px; }
.miss-item .r .cn { font-size: 12px; color: var(--muted); }
.small-note { font-size: 12px; color: var(--muted); text-align: center; margin: 10px 0; }

@media (min-width: 640px) {
  .sheet { border-radius: 20px; margin-bottom: 24px; }
}
