/* 三年级英语跟读乐园 - 儿童友好样式 */
:root {
  --primary: #4a6cf7;
  --primary-light: #eef2ff;
  --accent: #ff8c42;
  --success: #34c759;
  --warn: #ffcc00;
  --danger: #ff3b30;
  --bg: #f7f9ff;
  --card-bg: #ffffff;
  --text: #2d3748;
  --text-light: #8895a7;
  --radius: 16px;
}

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

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;
  padding-bottom: 48px;
}

.view { padding: 16px; }

/* ===== 兼容性提示 ===== */
.compat-warn {
  background: #fff3cd;
  color: #856404;
  padding: 12px 16px;
  font-size: 14px;
  border-bottom: 2px solid #ffeaa7;
  position: sticky;
  top: 0;
  z-index: 100;
}
.wx-warn {
  background: #ffe8e6;
  color: #b3261e;
  border-bottom-color: #ffc4c0;
  line-height: 1.6;
}

/* ===== 首页 ===== */
.home-header { text-align: center; padding: 24px 0 12px; }
.mascot { font-size: 56px; animation: bounce 2s ease-in-out infinite; }
@keyframes bounce { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
.home-header h1 { font-size: 26px; margin-top: 8px; color: var(--primary); }
.subtitle { color: var(--text-light); font-size: 14px; margin-top: 6px; }

.stats-bar {
  display: flex;
  justify-content: space-around;
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 16px;
  margin: 16px 0;
  box-shadow: 0 2px 12px rgba(74,108,247,.08);
}
.stat { text-align: center; }
.stat span { display: block; font-size: 22px; font-weight: 700; color: var(--primary); }
.stat label { font-size: 12px; color: var(--text-light); }

.growth-card, .weak-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 14px;
  box-shadow: 0 2px 12px rgba(74,108,247,.06);
}
.card-title { font-size: 15px; font-weight: 700; color: var(--text); margin-bottom: 10px; }
.growth-chart { width: 100%; height: 120px; display: block; }

.weak-list { list-style: none; }
.weak-list li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 9px 4px;
  border-bottom: 1px dashed #eef1f7;
  font-size: 14px;
}
.weak-list li:last-child { border-bottom: none; }
.weak-list .weak-word { color: var(--text); font-weight: 600; }
.weak-list .weak-score { color: var(--danger); font-size: 13px; }
.weak-list .weak-empty { color: var(--text-light); justify-content: center; font-size: 13px; }

.unit-list { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.unit-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 18px 14px;
  text-align: center;
  box-shadow: 0 2px 8px rgba(74,108,247,.06);
  cursor: pointer;
  transition: transform .15s, box-shadow .15s;
  border: 2px solid transparent;
}
.unit-card:active { transform: scale(.97); border-color: var(--primary); }
.unit-card .u-icon { font-size: 36px; }
.unit-card .u-title { font-size: 15px; font-weight: 600; margin-top: 8px; }
.unit-card .u-sub { font-size: 12px; color: var(--text-light); margin-top: 4px; }
.unit-card .u-stars { font-size: 12px; color: var(--warn); margin-top: 6px; min-height: 14px; }

/* ===== 练习页 ===== */
.practice-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 0;
}
.btn-back {
  background: none;
  border: none;
  color: var(--primary);
  font-size: 15px;
  cursor: pointer;
  padding: 8px;
}
.unit-title { font-size: 15px; font-weight: 600; }
.progress-text { font-size: 13px; color: var(--text-light); }

.tabs { display: flex; gap: 8px; margin: 12px 0; }
.tab {
  flex: 1;
  padding: 10px;
  border: none;
  border-radius: 12px;
  background: #e8ecf4;
  color: var(--text-light);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all .2s;
}
.tab.active { background: var(--primary); color: #fff; }

.item-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 28px 20px;
  text-align: center;
  box-shadow: 0 2px 12px rgba(74,108,247,.08);
}
.item-text {
  font-size: 34px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.4;
  word-break: break-word;
}
.item-ipa { font-size: 17px; color: var(--primary); margin-top: 8px; font-family: "Segoe UI", sans-serif; }
.item-zh { font-size: 15px; color: var(--text-light); margin-top: 8px; }

.action-row {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 16px;
  margin-top: 28px;
}
.btn-round {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: none;
  font-size: 26px;
  cursor: pointer;
  background: var(--primary-light);
  transition: transform .1s;
  box-shadow: 0 2px 8px rgba(0,0,0,.08);
}
.btn-round:active { transform: scale(.92); }

.btn-record {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 110px;
  height: 110px;
  border-radius: 50%;
  border: none;
  background: linear-gradient(135deg, #ff8c42, #ff6b6b);
  color: #fff;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(255,107,107,.4);
  transition: transform .1s;
  user-select: none;
}
.btn-record:active, .btn-record.recording {
  transform: scale(1.05);
  animation: pulse 1.2s ease-in-out infinite;
}
@keyframes pulse {
  0%,100% { box-shadow: 0 4px 16px rgba(255,107,107,.4); }
  50% { box-shadow: 0 4px 24px rgba(255,107,107,.8); }
}
.rec-icon { font-size: 34px; }
.rec-label { font-size: 14px; margin-top: 4px; }

.waveform-wrap { margin-top: 18px; padding: 0 8px; }
.waveform { width: 100%; height: 56px; display: block; }

.rec-hint { margin-top: 16px; font-size: 13px; color: var(--text-light); min-height: 18px; }

/* ===== 结果卡片 ===== */
.result-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 24px 20px;
  margin-top: 16px;
  text-align: center;
  box-shadow: 0 2px 12px rgba(74,108,247,.08);
  animation: slideUp .3s ease-out;
}
@keyframes slideUp { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: translateY(0); } }

.score-big { font-size: 44px; font-weight: 800; color: var(--primary); }
.score-stars { font-size: 26px; margin-top: 4px; }
.score-message { font-size: 15px; color: var(--text); margin-top: 8px; }

.word-feedback { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 16px; }
.word-chip {
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 15px;
  font-weight: 600;
}
.word-chip.good { background: #e8f8ee; color: #34c759; }
.word-chip.fuzzy { background: #fff8e1; color: #e6a700; }
.word-chip.missed { background: #ffebeb; color: #ff3b30; }

.subscores { margin-top: 18px; text-align: left; }
.subscore { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.subscore label { font-size: 13px; color: var(--text-light); width: 52px; }
.bar { flex: 1; height: 10px; background: #e8ecf4; border-radius: 5px; overflow: hidden; }
.bar div { height: 100%; background: linear-gradient(90deg, #4a6cf7, #7b9cff); border-radius: 5px; transition: width .5s ease; }

.result-actions { display: flex; gap: 12px; margin-top: 20px; }
.btn-retry, .btn-next {
  flex: 1;
  padding: 13px;
  border: none;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
}
.btn-retry { background: #e8ecf4; color: var(--text); }
.btn-next { background: var(--primary); color: #fff; }

.nav-row { display: flex; align-items: center; justify-content: space-between; margin-top: 16px; }
.btn-nav { background: none; border: none; color: var(--primary); font-size: 14px; cursor: pointer; padding: 8px; }
.dot-nav { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: #d1d9e6; }
.dot.active { background: var(--primary); transform: scale(1.3); }
.dot.done { background: var(--success); }

.footer { text-align: center; font-size: 12px; color: var(--text-light); padding: 24px 16px; }
