/* ============================================================
 * 每日英语 15 分钟 · v0
 * 设计原则：大按钮、少文字、有语音、无广告、无外链
 * ============================================================ */

:root {
  --blue: #2f6fed;
  --blue-dark: #1f4fc4;
  --blue-soft: #eaf0ff;
  --yellow: #ffcc4d;
  --yellow-soft: #fff6dd;
  --green: #2fbf71;
  --green-soft: #e6f8ee;
  --red: #ff6b6b;
  --red-soft: #ffecec;
  --purple: #7a5cf0;
  --ink: #1f2a44;
  --muted: #6b7890;
  --line: #e3e9f5;
  --bg: #f4f7ff;
  --card: #ffffff;
  --shadow: 0 6px 20px rgba(31, 42, 68, 0.08);
  --radius: 20px;
}

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

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  background: var(--bg);
  color: var(--ink);
  font-family: system-ui, -apple-system, "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
  font-size: 17px;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior: none;
}

button { font-family: inherit; }

.app {
  max-width: 860px;
  margin: 0 auto;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 0 16px calc(84px + env(safe-area-inset-bottom));
}

/* ---------------- 顶部栏 ---------------- */
.topbar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 0 10px;
  position: sticky;
  top: 0;
  background: linear-gradient(var(--bg) 70%, rgba(244, 247, 255, 0));
  z-index: 20;
}
.topbar-title { flex: 1; font-size: 20px; font-weight: 700; text-align: center; }
.topbar-right { min-width: 44px; display: flex; justify-content: flex-end; gap: 6px; }
.icon-btn {
  border: 0; background: transparent; font-size: 30px; line-height: 1;
  width: 44px; height: 44px; border-radius: 12px; color: var(--ink);
  display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer;
}
.icon-btn:active { background: var(--blue-soft); }
.icon-btn.ghost { visibility: hidden; }

/* ---------------- 通用 ---------------- */
.card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
}
.card + .card { margin-top: 14px; }

.btn {
  border: 0; border-radius: 16px; padding: 15px 22px;
  font-size: 19px; font-weight: 700; cursor: pointer;
  background: var(--blue-soft); color: var(--blue-dark);
  transition: transform 0.06s ease, filter 0.15s ease;
  min-height: 52px;
}
.btn:active { transform: scale(0.98); }
.btn.primary { background: var(--blue); color: #fff; box-shadow: 0 8px 18px rgba(47, 111, 237, 0.28); }
.btn.white { background: #fff; color: var(--blue-dark); box-shadow: 0 8px 18px rgba(0, 0, 0, 0.12); }
.btn.green { background: var(--green); color: #fff; box-shadow: 0 8px 18px rgba(47, 191, 113, 0.26); }
.btn.ghost { background: transparent; color: var(--muted); box-shadow: none; }
.btn.danger { background: var(--red-soft); color: #c22; }
.btn.small { padding: 10px 16px; font-size: 16px; min-height: 44px; border-radius: 12px; }
.btn:disabled { opacity: 0.45; }
.btn-block { display: block; width: 100%; }

.muted { color: var(--muted); }
.small { font-size: 14px; }
.center { text-align: center; }
.row { display: flex; align-items: center; gap: 10px; }
.row.between { justify-content: space-between; }
.stack > * + * { margin-top: 10px; }
.mt { margin-top: 14px; }

.hbar { height: 12px; background: #e9eefb; border-radius: 999px; overflow: hidden; }
.hbar > i { display: block; height: 100%; background: var(--blue); border-radius: 999px; transition: width 0.3s ease; }
.hbar.green > i { background: var(--green); }

/* ---------------- 首页 ---------------- */
.home-head {
  display: flex; align-items: center; gap: 12px; padding: 6px 0 14px;
}
.avatar {
  width: 56px; height: 56px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 30px; background: var(--blue-soft);
  border: 2px solid #fff; box-shadow: var(--shadow);
}
.home-name { font-size: 21px; font-weight: 800; }
.home-sub { font-size: 14px; color: var(--muted); margin-top: 2px; }
.pill {
  display: inline-flex; align-items: center; gap: 4px;
  background: var(--yellow-soft); color: #8a5b00;
  border-radius: 999px; padding: 6px 12px; font-size: 15px; font-weight: 700;
}
.pill.blue { background: var(--blue-soft); color: var(--blue-dark); }

.today-card {
  background: linear-gradient(135deg, #3a7bff, #2f5fe0);
  color: #fff; border-radius: 24px; padding: 24px;
  box-shadow: 0 14px 30px rgba(47, 95, 224, 0.30);
}
.today-card h2 { margin: 0 0 6px; font-size: 26px; }
.today-card p { margin: 0; opacity: 0.9; font-size: 16px; }

.steps { display: flex; gap: 10px; margin: 20px 0 6px; }
.step {
  flex: 1; text-align: center; font-size: 13px; color: rgba(255, 255, 255, 0.85);
}
.step i {
  display: flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; margin: 0 auto 6px; border-radius: 50%;
  background: rgba(255, 255, 255, 0.22); font-size: 17px; font-style: normal;
}
.step.on i { background: #fff; color: var(--blue-dark); }
.step.on { color: #fff; font-weight: 700; }

.done-card { text-align: center; padding: 30px 20px; }
.done-emoji { font-size: 64px; }
.done-card h2 { margin: 10px 0 4px; font-size: 26px; }
.big-points { font-size: 40px; font-weight: 800; color: #8a5b00; }

/* ---------------- 题面 ---------------- */
.q-head { font-size: 14px; color: var(--muted); margin-bottom: 8px; }
.q-title { font-size: 23px; font-weight: 800; line-height: 1.45; }
.q-sentence {
  font-size: 26px; font-weight: 800; line-height: 1.5;
  background: var(--blue-soft); border-radius: 16px; padding: 18px; margin: 12px 0;
}
.emoji-big { font-size: 96px; text-align: center; line-height: 1.2; padding: 8px 0 4px; }

.speaker-btn {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  width: 100%; min-height: 88px; border-radius: 18px; border: 2px dashed var(--blue);
  background: var(--blue-soft); color: var(--blue-dark);
  font-size: 22px; font-weight: 800; cursor: pointer; margin: 14px 0;
}
.speaker-btn:active { transform: scale(0.99); }
.speaker-btn .spk { font-size: 34px; }

.options { display: grid; gap: 12px; margin-top: 8px; }
.options.wide { grid-template-columns: 1fr; }
.opt {
  display: flex; align-items: center; gap: 12px;
  border: 2px solid var(--line); background: #fff; border-radius: 16px;
  padding: 16px 18px; font-size: 21px; font-weight: 600; text-align: left;
  cursor: pointer; min-height: 64px; color: var(--ink);
}
.opt:active { background: var(--blue-soft); }
.opt.selected { border-color: var(--blue); background: var(--blue-soft); }
.opt .idx {
  width: 34px; height: 34px; flex: 0 0 34px; border-radius: 50%;
  background: #eef2fb; color: var(--muted); font-size: 16px;
  display: flex; align-items: center; justify-content: center; font-weight: 700;
}
.opt.selected .idx { background: var(--blue); color: #fff; }
.opt.correct { border-color: var(--green); background: var(--green-soft); }
.opt.correct .idx { background: var(--green); color: #fff; }
.opt.wrong { border-color: var(--red); background: var(--red-soft); }
.opt.wrong .idx { background: var(--red); color: #fff; }

.q-progress { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.q-progress .hbar { flex: 1; }

/* ---------------- 翻卡 ---------------- */
.flash-card {
  background: #fff; border-radius: 24px; box-shadow: var(--shadow);
  padding: 28px 20px; text-align: center;
}
.flash-emoji { font-size: 110px; line-height: 1.1; }
.flash-en { font-size: 42px; font-weight: 800; letter-spacing: 0.5px; margin-top: 8px; }
.flash-zh { font-size: 20px; color: var(--muted); margin-top: 6px; }
.flash-tip {
  margin-top: 16px; background: var(--yellow-soft); border-radius: 14px;
  padding: 12px 16px; font-size: 16px; color: #8a5b00; text-align: left;
}
.sound-btn {
  margin: 16px auto 0; display: inline-flex; align-items: center; gap: 8px;
  border: 0; background: var(--blue-soft); color: var(--blue-dark);
  font-size: 18px; font-weight: 700; padding: 12px 22px; border-radius: 999px; cursor: pointer;
}

/* ---------------- 讲解 ---------------- */
.explain-card { border-left: 6px solid var(--red); }
.explain-card.ok { border-left-color: var(--green); }
.explain-q { font-size: 18px; font-weight: 700; line-height: 1.5; }
.answer-line { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0 14px; font-size: 15px; }
.tag { border-radius: 8px; padding: 4px 10px; font-weight: 700; background: #f2f5fb; color: var(--muted); }
.tag.bad { background: var(--red-soft); color: #b22; }
.tag.good { background: var(--green-soft); color: #176d3d; }

.explain-block { margin-top: 12px; }
.explain-block .lab {
  font-size: 14px; font-weight: 800; color: var(--blue-dark);
  display: inline-block; background: var(--blue-soft);
  border-radius: 8px; padding: 3px 10px; margin-bottom: 6px;
}
.explain-block p { margin: 0; font-size: 17px; line-height: 1.65; }

.ai-btn {
  margin-top: 14px; width: 100%; border: 2px dashed var(--purple);
  background: #f5f1ff; color: var(--purple); border-radius: 14px;
  padding: 13px; font-size: 17px; font-weight: 700; cursor: pointer;
}

/* ---------------- 列表 ---------------- */
.list-item {
  display: flex; align-items: center; gap: 12px;
  background: #fff; border-radius: 16px; padding: 16px 18px;
  box-shadow: var(--shadow); margin-bottom: 10px;
}
.list-item .li-main { flex: 1; min-width: 0; }
.li-title { font-size: 17px; font-weight: 700; }
.li-sub { font-size: 13px; color: var(--muted); margin-top: 3px; }
.li-emoji { font-size: 30px; }

/* ---------------- 家长端 ---------------- */
.stat-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.stat { background: #fff; border-radius: 16px; padding: 16px; box-shadow: var(--shadow); }
.stat .v { font-size: 30px; font-weight: 800; line-height: 1.2; }
.stat .k { font-size: 13px; color: var(--muted); margin-top: 4px; }

.week-chart { display: flex; align-items: flex-end; gap: 8px; height: 120px; padding-top: 10px; }
.wbar { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; justify-content: flex-end; }
.wbar i {
  display: block; width: 100%; border-radius: 8px 8px 4px 4px;
  background: #dfe7fb; min-height: 6px;
}
.wbar i.on { background: var(--blue); }
.wbar span { font-size: 11px; color: var(--muted); }

.field { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.field:last-child { border-bottom: 0; }
.field label { font-size: 16px; font-weight: 600; }
.field select, .field input[type="number"], .field input[type="text"] {
  font-size: 16px; padding: 9px 12px; border-radius: 10px;
  border: 1.5px solid var(--line); background: #fff; color: var(--ink); min-width: 110px;
}

/* ---------------- 底部导航 ---------------- */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(12px);
  border-top: 1px solid var(--line);
  display: flex; justify-content: space-around;
  padding: 6px 0 calc(6px + env(safe-area-inset-bottom));
  z-index: 30;
}
.tabbar button {
  border: 0; background: transparent; color: var(--muted);
  font-size: 12px; display: flex; flex-direction: column; align-items: center;
  gap: 2px; padding: 6px 14px; cursor: pointer; border-radius: 12px;
}
.tabbar button .t { font-size: 22px; }
.tabbar button.on { color: var(--blue-dark); font-weight: 700; }

/* ---------------- 弹层 / 提示 ---------------- */
.modal-mask {
  position: fixed; inset: 0; background: rgba(20, 30, 55, 0.45);
  display: flex; align-items: center; justify-content: center;
  padding: 20px; z-index: 100;
}
.modal {
  background: #fff; border-radius: 22px; padding: 24px;
  width: min(420px, 100%); box-shadow: 0 20px 50px rgba(0, 0, 0, 0.25);
}
.modal h3 { margin: 0 0 8px; font-size: 21px; }
.modal p { margin: 0 0 18px; color: var(--muted); font-size: 16px; line-height: 1.6; }
.modal-btns { display: flex; gap: 10px; }
.modal-btns .btn { flex: 1; }

.pin-modal { text-align: center; }
.pin-dots { display: flex; justify-content: center; gap: 14px; margin: 14px 0 20px; }
.pin-dots i { width: 14px; height: 14px; border-radius: 50%; background: #e3e9f5; }
.pin-dots i.on { background: var(--blue); }
.pin-pad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.pin-pad button {
  border: 0; background: #f2f5fb; border-radius: 14px;
  font-size: 24px; font-weight: 700; height: 60px; cursor: pointer; color: var(--ink);
}
.pin-pad button:active { background: var(--blue-soft); }
.pin-pad button.ok { background: var(--green); color: #fff; }
.pin-cancel { margin-top: 14px; }

.toast {
  position: fixed; left: 50%; bottom: 110px; transform: translateX(-50%) translateY(10px);
  background: rgba(31, 42, 68, 0.94); color: #fff; padding: 12px 20px;
  border-radius: 999px; font-size: 16px; z-index: 200; opacity: 0;
  transition: opacity 0.2s ease, transform 0.2s ease; pointer-events: none;
  max-width: 86vw; text-align: center;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---------------- 弟弟端 ---------------- */
.tiny-hero {
  display: grid; gap: 16px; margin-top: 8px;
}
.tiny-big {
  border: 0; border-radius: 26px; padding: 34px 20px;
  font-size: 30px; font-weight: 800; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  box-shadow: var(--shadow); color: var(--ink);
}
.tiny-big .e { font-size: 70px; }
.tiny-big.story { background: var(--yellow-soft); color: #7a5200; }
.tiny-big.cards { background: var(--green-soft); color: #176d3d; }

.story-text { font-size: 26px; line-height: 2; letter-spacing: 1px; }
.story-emoji { text-align: center; font-size: 110px; }

.tiny-card-big { text-align: center; padding: 20px; }
.tiny-char { font-size: 150px; line-height: 1.15; font-weight: 800; }
.tiny-pinyin { font-size: 26px; color: var(--muted); }
.tiny-word { font-size: 24px; margin-top: 6px; }

/* ---------------- 选人 ---------------- */
.picker { display: grid; gap: 16px; margin-top: 20px; }
.pick-card {
  border: 0; border-radius: 24px; padding: 26px 20px; cursor: pointer;
  background: #fff; box-shadow: var(--shadow); text-align: center;
  display: flex; flex-direction: column; align-items: center; gap: 6px;
}
.pick-card .e { font-size: 64px; }
.pick-card .n { font-size: 24px; font-weight: 800; }
.pick-card .g { font-size: 15px; color: var(--muted); }

/* ---------------- 小屏适配 ---------------- */
@media (max-width: 420px) {
  .q-title { font-size: 21px; }
  .flash-en { font-size: 36px; }
  .flash-emoji { font-size: 90px; }
  .tiny-char { font-size: 120px; }
  .stat .v { font-size: 26px; }
}

@media (min-width: 720px) {
  .home-grid { display: grid; grid-template-columns: 1.25fr 1fr; gap: 14px; align-items: start; }
  .options { grid-template-columns: 1fr 1fr; }
}
