/* ============================================================
   周周英语口语 Web 版样式（手机优先，孩子看得清楚）
   ============================================================ */
* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
:root {
  --bg: #fff8ec;
  --card: #ffffff;
  --primary: #ff8a3d;
  --primary-dark: #f2701d;
  --green: #34c274;
  --red: #f0453d;
  --blue: #4a90e2;
  --text: #3d3229;
  --muted: #9a8d7d;
  --line: #f0e6d6;
  --shadow: 0 6px 18px rgba(180, 130, 60, .12);
}
html, body { height: 100%; }
body {
  font-family: -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--bg); color: var(--text);
  max-width: 520px; margin: 0 auto; min-height: 100vh;
}
.hidden { display: none !important; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }
input { font-family: inherit; }

/* ---------- 通用 ---------- */
.card {
  background: var(--card); border-radius: 18px; box-shadow: var(--shadow);
  padding: 18px; margin: 12px 14px;
}
.btn { border-radius: 14px; font-weight: 600; transition: transform .1s; }
.btn:active { transform: scale(.96); }
.btn-primary { background: var(--primary); color: #fff; }
.btn-big { width: 100%; padding: 14px; font-size: 18px; margin-top: 6px; }
.btn-mini {
  background: #fff; border: 1.5px solid var(--line); border-radius: 20px;
  padding: 6px 12px; font-size: 13px; color: var(--text);
}
.btn-mini.ghost { background: transparent; }
.msg { color: var(--red); font-size: 14px; text-align: center; min-height: 20px; margin-top: 8px; }

/* ---------- 登录页 ---------- */
.gate-hero { text-align: center; padding: 46px 0 18px; }
.gate-logo { font-size: 64px; }
.gate-hero h1 { font-size: 26px; margin-top: 6px; }
.gate-sub { color: var(--muted); margin-top: 6px; font-size: 14px; }
.gate-card { padding: 22px; }
.seg { display: flex; background: #f6efe2; border-radius: 12px; padding: 4px; margin-bottom: 16px; }
.seg-btn { flex: 1; padding: 10px; border-radius: 10px; font-size: 15px; color: var(--muted); }
.seg-btn.active { background: #fff; color: var(--text); font-weight: 700; box-shadow: 0 2px 6px rgba(0,0,0,.06); }
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.field input {
  width: 100%; padding: 13px 14px; font-size: 16px;
  border: 1.5px solid var(--line); border-radius: 12px; outline: none; background: #fffdf8;
}
.field input:focus { border-color: var(--primary); }
.gate-tip { text-align: center; color: var(--muted); font-size: 12px; margin-top: 12px; }

/* ---------- 顶栏 ---------- */
.topbar {
  display: flex; justify-content: space-between; align-items: center;
  padding: 14px 14px 4px; gap: 8px;
}
.topbar-left { display: flex; align-items: center; gap: 10px; }
.topbar-right { display: flex; gap: 8px; align-items: center; }
.avatar { font-size: 34px; }
.hello { font-size: 15px; }
.points-line { font-size: 13px; color: var(--muted); }
.practice-title { font-size: 15px; max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.page-title { font-size: 18px; font-weight: 700; padding: 14px 16px 8px; }

/* ---------- 系列 / 册 / 单元 ---------- */
.series-list { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; padding: 4px 14px; }
.series-card {
  background: var(--card); border-radius: 16px; box-shadow: var(--shadow);
  padding: 16px 14px; text-align: left;
}
.series-card .sc-emoji { font-size: 28px; }
.series-card .sc-name { font-weight: 700; margin-top: 6px; font-size: 15px; }
.series-card .sc-desc { font-size: 12px; color: var(--muted); margin-top: 4px; line-height: 1.5; }
.panel-head { display: flex; align-items: center; gap: 10px; padding: 10px 14px 4px; }
.panel-title { font-weight: 700; font-size: 15px; }
.book-list, .unit-list { padding: 8px 14px; display: flex; flex-direction: column; gap: 10px; }
.book-item, .unit-item {
  background: var(--card); border-radius: 14px; box-shadow: var(--shadow);
  padding: 14px 16px; text-align: left; font-size: 15px; font-weight: 600;
  display: flex; justify-content: space-between; align-items: center;
}
.book-item small, .unit-item small { color: var(--muted); font-weight: 400; }
.unit-item.locked { opacity: .5; }

/* ---------- 跟练 ---------- */
.level-seg { margin: 10px 14px; }
.lv-btn { font-size: 14px; padding: 9px; }
.item-list { padding: 4px 14px; display: flex; flex-direction: column; gap: 8px; }
.item-row {
  background: var(--card); border-radius: 14px; box-shadow: var(--shadow);
  padding: 13px 16px; text-align: left;
  display: flex; justify-content: space-between; align-items: center; gap: 10px;
}
.item-row .ir-text { font-size: 16px; font-weight: 600; }
.item-row .ir-text .phon { font-size: 12px; color: var(--blue); font-weight: 400; margin-left: 8px; }
.item-row .ir-zh { font-size: 12px; color: var(--muted); margin-top: 3px; }
.item-row .ir-pass { font-size: 18px; }

#practice-card { margin: 12px 14px; background: var(--card); border-radius: 18px; box-shadow: var(--shadow); padding: 16px; }
.pc-head { display: flex; justify-content: space-between; align-items: center; }
.pc-pos { font-size: 13px; color: var(--muted); }
.pc-text-wrap { text-align: center; padding: 18px 6px 8px; }
.pc-text { font-size: 30px; font-weight: 700; line-height: 1.4; }
.pc-text .w { display: inline-block; padding: 1px 4px; border-radius: 8px; margin: 0 2px; }
.pc-text .w.bad { background: #fde3e1; color: var(--red); box-shadow: 0 0 0 1.5px var(--red) inset; }
.pc-phonetic { color: var(--blue); font-size: 16px; margin-top: 6px; min-height: 20px; }
.pc-zh { color: var(--muted); font-size: 14px; margin-top: 4px; }

.pc-score-wrap { display: flex; align-items: center; gap: 14px; padding: 10px 6px; }
.score-ring {
  width: 76px; height: 76px; border-radius: 50%; flex: none;
  display: flex; align-items: baseline; justify-content: center; align-items: center;
  font-size: 26px; font-weight: 800; color: #fff; background: var(--muted);
}
.score-ring.pass { background: var(--green); }
.score-ring.fail { background: var(--red); }
.score-detail { font-size: 13px; color: var(--muted); line-height: 1.8; }

.corrections { background: #fff5f4; border-radius: 12px; padding: 10px 12px; margin: 8px 0; }
.correction-line { font-size: 14px; margin: 6px 0; line-height: 1.6; }
.correction-line b { color: var(--red); }
.correction-line .tip { color: #7a6a58; }

.pc-actions { display: flex; justify-content: center; gap: 26px; padding: 12px 0 4px; }
.btn-round {
  width: 84px; height: 84px; border-radius: 50%;
  font-size: 26px; line-height: 1.15; color: #fff;
  background: var(--blue); box-shadow: var(--shadow);
}
.btn-round span { font-size: 13px; font-weight: 600; }
.btn-round.btn-rec { background: var(--red); }
.btn-round.btn-next { background: var(--green); }
.btn-round.recording { animation: pulse 1s infinite; }
@keyframes pulse { 0%,100% { transform: scale(1);} 50% { transform: scale(1.08);} }
.pc-state { text-align: center; color: var(--muted); font-size: 14px; min-height: 22px; padding-top: 6px; }
.pc-tries { text-align: center; font-size: 12px; color: var(--muted); }

/* ---------- 奖励中心 ---------- */
.reward-me { padding: 18px; }
.rm-row { display: flex; align-items: center; gap: 14px; }
.rm-pet { font-size: 52px; }
.rm-info { flex: 1; }
.rm-name { font-weight: 700; font-size: 17px; }
.rm-level { font-size: 13px; color: var(--muted); margin-top: 2px; }
.rm-points { font-size: 16px; font-weight: 700; color: var(--primary-dark); margin-top: 4px; }
.btn-feed {
  background: var(--primary); color: #fff; border-radius: 14px;
  padding: 10px 12px; font-size: 14px; line-height: 1.4; text-align: center;
}
.btn-feed small { font-size: 11px; font-weight: 400; opacity: .9; }
.hunger-bar { height: 10px; background: #f0e6d6; border-radius: 6px; margin-top: 12px; overflow: hidden; }
.hunger-fill { height: 100%; background: var(--green); border-radius: 6px; transition: width .4s; }
.hunger-label { font-size: 12px; color: var(--muted); margin-top: 4px; text-align: right; }
.rm-extra { font-size: 12px; color: var(--muted); margin-top: 8px; line-height: 1.8; }

.gift-list { display: flex; flex-direction: column; gap: 10px; padding: 4px 14px 30px; }
.gift-item {
  background: var(--card); border-radius: 14px; box-shadow: var(--shadow);
  padding: 14px 16px; display: flex; justify-content: space-between; align-items: center; gap: 12px;
}
.gift-info .g-name { font-weight: 700; font-size: 15px; }
.gift-info .g-desc { font-size: 12px; color: var(--muted); margin-top: 3px; }
.gift-info .g-cost { font-size: 13px; color: var(--primary-dark); font-weight: 700; margin-top: 3px; }
.btn-redeem { background: var(--primary); color: #fff; padding: 9px 16px; border-radius: 12px; font-size: 14px; flex: none; }
.btn-redeem:disabled { background: #d8cfbf; }

/* ---------- Toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: 80px; transform: translateX(-50%);
  background: rgba(40, 32, 24, .92); color: #fff; padding: 11px 20px;
  border-radius: 12px; font-size: 14px; z-index: 99; max-width: 86%;
  text-align: center; line-height: 1.5;
}
