/* Xuexila 小学英语学习网站 — 公共样式（儿童友好 / 移动优先） */
/* Vue 挂载前隐藏模板，避免页面闪现代码 */
[v-cloak] { display: none !important; }
:root {
  --primary: #4f7cff;
  --primary-dark: #3a63d8;
  --accent: #ff9f43;
  --green: #2ecc71;
  --red: #ff6b6b;
  --purple: #9b59b6;
  --bg: #f5f7fb;
  --card: #ffffff;
  --text: #2c3e50;
  --muted: #8a94a6;
  --border: #e8ecf4;
  --radius: 16px;
  --shadow: 0 4px 16px rgba(80, 100, 160, 0.08);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { font-size: 16px; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}
a { color: var(--primary); text-decoration: none; }

/* ---------------- 布局 ---------------- */
.container { max-width: 720px; margin: 0 auto; padding: 16px 16px 88px; }
.page-title { font-size: 1.35rem; font-weight: 700; margin: 8px 0 16px; display: flex; align-items: center; gap: 8px; }
.page-title .sub { font-size: 0.85rem; color: var(--muted); font-weight: 400; }

/* 顶部栏 */
.topbar {
  position: sticky; top: 0; z-index: 50;
  background: linear-gradient(135deg, var(--primary), #6a8dff);
  color: #fff; padding: 14px 16px;
  display: flex; align-items: center; justify-content: space-between;
  border-radius: 0 0 20px 20px;
  box-shadow: var(--shadow);
}
.topbar .brand { font-weight: 800; font-size: 1.1rem; letter-spacing: 0.5px; }
.topbar .user-info { display: flex; align-items: center; gap: 10px; font-size: 0.9rem; }
.topbar .points-chip {
  background: rgba(255,255,255,0.22); border-radius: 999px; padding: 4px 12px;
  font-weight: 700; font-size: 0.85rem;
}

/* 底部导航 */
.bottom-nav {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 50;
  background: #fff; display: flex; justify-content: space-around;
  padding: 6px 0 max(6px, env(safe-area-inset-bottom));
  border-top: 1px solid var(--border);
}
.bottom-nav a {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  color: var(--muted); font-size: 0.68rem; padding: 4px 10px; border-radius: 10px;
}
.bottom-nav a .ico { font-size: 1.35rem; line-height: 1.1; }
.bottom-nav a.active { color: var(--primary); background: #eef2ff; }

/* ---------------- 卡片 ---------------- */
.card {
  background: var(--card); border-radius: var(--radius);
  padding: 16px; box-shadow: var(--shadow); margin-bottom: 14px;
  border: 1px solid var(--border);
}
.card h3 { margin: 0 0 10px; font-size: 1.02rem; }

/* 网格快捷入口 */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.quick-entry {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 16px 8px; background: var(--card); border-radius: var(--radius);
  border: 1px solid var(--border); box-shadow: var(--shadow);
  color: var(--text); font-size: 0.85rem; font-weight: 600;
}
.quick-entry .ico { font-size: 1.8rem; }
.quick-entry:active { transform: scale(0.97); }

/* 统计块 */
.stat-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 14px; }
.stat-box { background: var(--card); border-radius: var(--radius); padding: 12px 8px; text-align: center; border: 1px solid var(--border); }
.stat-box .num { font-size: 1.5rem; font-weight: 800; color: var(--primary); }
.stat-box .num.orange { color: var(--accent); }
.stat-box .num.green { color: var(--green); }
.stat-box .num.purple { color: var(--purple); }
.stat-box .label { font-size: 0.75rem; color: var(--muted); margin-top: 2px; }

/* ---------------- 按钮 ---------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: none; border-radius: 14px; padding: 12px 20px;
  font-size: 1rem; font-weight: 700; cursor: pointer; user-select: none;
  background: var(--primary); color: #fff; transition: all 0.15s;
}
.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn.green { background: var(--green); }
.btn.orange { background: var(--accent); }
.btn.red { background: var(--red); }
.btn.ghost { background: #fff; color: var(--primary); border: 2px solid var(--primary); }
.btn.gray { background: #eef1f7; color: var(--text); }
.btn.block { display: flex; width: 100%; }
.btn.lg { padding: 15px 24px; font-size: 1.08rem; border-radius: 16px; }
.btn.sm { padding: 7px 14px; font-size: 0.85rem; border-radius: 10px; }

/* ---------------- 表单 ---------------- */
.form-item { margin-bottom: 14px; }
.form-item label { display: block; font-size: 0.85rem; color: var(--muted); margin-bottom: 6px; }
.input {
  width: 100%; padding: 13px 14px; font-size: 1rem;
  border: 2px solid var(--border); border-radius: 12px; background: #fff;
  color: var(--text); outline: none; font-family: inherit;
}
.input:focus { border-color: var(--primary); }
select.input { appearance: auto; }

/* ---------------- 单词卡片 ---------------- */
.word-card { text-align: center; padding: 26px 16px; }
.word-en { font-size: 2.1rem; font-weight: 800; letter-spacing: 0.5px; }
.word-phonetic { color: var(--muted); font-size: 1.05rem; margin: 6px 0; }
.word-zh { font-size: 1.25rem; color: var(--primary); font-weight: 600; }
.word-example { margin-top: 14px; padding: 12px; background: #f4f6ff; border-radius: 12px; font-size: 0.95rem; line-height: 1.6; }
.word-example .zh { color: var(--muted); font-size: 0.85rem; }

/* 得分环 */
.score-ring {
  width: 110px; height: 110px; margin: 10px auto; border-radius: 50%;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: conic-gradient(var(--sc) calc(var(--p) * 1%), #edf0f7 0);
}
.score-ring .inner {
  width: 88px; height: 88px; background: #fff; border-radius: 50%;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
}
.score-ring .val { font-size: 1.7rem; font-weight: 800; }
.score-ring .cap { font-size: 0.7rem; color: var(--muted); }

/* 逐词高亮 */
.words-line { line-height: 2.2; font-size: 1.15rem; }
.w-ok { color: var(--green); font-weight: 700; }
.w-bad { color: var(--red); font-weight: 700; text-decoration: underline wavy; }

/* 单元单词列表（跟读页） */
.word-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; max-height: 320px; overflow-y: auto; -webkit-overflow-scrolling: touch; }
.word-chip { background: #fff; border: 1.5px solid var(--border); border-radius: 12px; padding: 8px 4px; text-align: center; cursor: pointer; transition: all 0.15s; }
.word-chip .en { font-weight: 700; font-size: 0.92rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.word-chip .zh { font-size: 0.7rem; color: var(--muted); margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.word-chip.active { border-color: var(--primary); background: #eef2ff; box-shadow: 0 0 0 2px rgba(79,124,255,0.15); }
.word-chip:active { transform: scale(0.95); }
@media (max-width: 380px) { .word-grid { grid-template-columns: repeat(2, 1fr); } }

/* 录音按钮 */
.rec-btn {
  width: 84px; height: 84px; border-radius: 50%; border: none; cursor: pointer;
  font-size: 2rem; background: var(--red); color: #fff; box-shadow: 0 6px 18px rgba(255,107,107,0.4);
  transition: all 0.2s;
}
.rec-btn.recording { animation: pulse 1s infinite; background: #d63031; }
@keyframes pulse { 0%,100% { transform: scale(1); } 50% { transform: scale(1.1); } }

/* ---------------- 闪卡 ---------------- */
.flip-wrap { perspective: 1000px; }
.flip-card {
  position: relative; width: 100%; height: 260px; cursor: pointer;
  transform-style: preserve-3d; transition: transform 0.5s;
}
.flip-card.flipped { transform: rotateY(180deg); }
.flip-face {
  position: absolute; inset: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden;
  border-radius: 20px; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 10px; padding: 20px; box-shadow: var(--shadow); border: 1px solid var(--border);
}
.flip-front { background: linear-gradient(135deg, #4f7cff, #6a8dff); color: #fff; }
.flip-front .big { font-size: 2.2rem; font-weight: 800; }
.flip-back { background: #fff; transform: rotateY(180deg); }
.flip-back .big { font-size: 1.7rem; font-weight: 700; color: var(--primary); }

/* ---------------- 对话 ---------------- */
.dlg-line { display: flex; gap: 10px; padding: 10px 12px; border-radius: 14px; margin-bottom: 6px; align-items: flex-start; }
.dlg-line .speaker { flex-shrink: 0; width: 40px; height: 40px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 1.3rem; background: #eef2ff; }
.dlg-line .content { flex: 1; }
.dlg-line .en { font-size: 1.05rem; font-weight: 600; }
.dlg-line .zh { font-size: 0.85rem; color: var(--muted); margin-top: 2px; }
.dlg-line .ops { display: flex; gap: 8px; margin-top: 8px; margin-left: -60px; }
.dlg-line .ops .btn { white-space: nowrap; flex-shrink: 0; padding: 6px 10px; }
.dlg-line.active-line { background: #f4f6ff; border: 1px solid #d8e0ff; }

/* ---------------- 勋章 ---------------- */
.badge-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.badge-item { text-align: center; padding: 12px 4px; border-radius: 14px; background: #fff; border: 1px solid var(--border); }
.badge-item.locked { opacity: 0.38; filter: grayscale(0.9); }
.badge-item .ico { font-size: 2rem; }
.badge-item .name { font-size: 0.72rem; font-weight: 600; margin-top: 4px; }

/* ---------------- 列表 / 表格 ---------------- */
.list-item { display: flex; align-items: center; justify-content: space-between; padding: 13px 4px; border-bottom: 1px solid var(--border); }
.list-item:last-child { border-bottom: none; }
.muted { color: var(--muted); font-size: 0.85rem; }
.table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.table th, .table td { padding: 10px 8px; text-align: left; border-bottom: 1px solid var(--border); }
.table th { color: var(--muted); font-weight: 600; font-size: 0.8rem; }

/* 柱状图（学习时长） */
.bar-chart { display: flex; align-items: flex-end; gap: 8px; height: 120px; padding: 8px 4px 0; }
.bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; height: 100%; justify-content: flex-end; }
.bar-col .bar { width: 70%; background: linear-gradient(180deg, #6a8dff, var(--primary)); border-radius: 6px 6px 2px 2px; min-height: 2px; }
.bar-col .lab { font-size: 0.65rem; color: var(--muted); }

/* 选项 */
.opt-btn {
  display: block; width: 100%; text-align: left; padding: 13px 16px; margin-bottom: 10px;
  background: #fff; border: 2px solid var(--border); border-radius: 12px;
  font-size: 1rem; cursor: pointer; font-family: inherit; color: var(--text);
}
.opt-btn.selected { border-color: var(--primary); background: #eef2ff; }
.opt-btn.right { border-color: var(--green); background: #eafff3; }
.opt-btn.wrong { border-color: var(--red); background: #fff0f0; }

/* ---------------- 弹层 ---------------- */
.toast {
  position: fixed; left: 50%; bottom: 100px; transform: translateX(-50%);
  background: rgba(44, 62, 80, 0.92); color: #fff; padding: 10px 22px;
  border-radius: 999px; font-size: 0.9rem; z-index: 999;
  animation: fadein 0.2s; max-width: 86vw; text-align: center;
}
@keyframes fadein { from { opacity: 0; transform: translate(-50%, 10px); } to { opacity: 1; transform: translate(-50%, 0); } }

.modal-mask { position: fixed; inset: 0; background: rgba(30,40,60,0.5); z-index: 200; display: flex; align-items: center; justify-content: center; padding: 24px; }
.modal { background: #fff; border-radius: 20px; padding: 26px; max-width: 380px; width: 100%; text-align: center; animation: pop 0.25s; }
@keyframes pop { from { transform: scale(0.85); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.modal .big-ico { font-size: 3.2rem; }

/* 徽章弹出 */
.badge-pop { position: fixed; inset: 0; z-index: 300; background: rgba(20,25,45,0.65); display: flex; align-items: center; justify-content: center; }
.badge-pop .box { background: #fff; border-radius: 22px; padding: 30px; text-align: center; max-width: 320px; animation: pop 0.3s; }
.badge-pop .ico { font-size: 4rem; }
.badge-pop h2 { margin: 12px 0 4px; }

/* 进度条 */
.progress { height: 10px; background: #edf0f7; border-radius: 999px; overflow: hidden; }
.progress .fill { height: 100%; background: var(--green); border-radius: 999px; transition: width 0.3s; }

/* 单选胶囊 */
.pills { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.pill {
  padding: 8px 16px; border-radius: 999px; background: #fff; border: 2px solid var(--border);
  font-size: 0.88rem; cursor: pointer; font-weight: 600; color: var(--text);
}
.pill.active { background: var(--primary); color: #fff; border-color: var(--primary); }

/* 单行胶囊（移动端强制不换行，等宽铺满） */
.pill-row { display: flex; gap: 6px; margin-bottom: 14px; }
.pill-row .pill { flex: 1 1 0; min-width: 0; padding: 8px 2px; font-size: 0.82rem; white-space: nowrap; text-align: center; }
.pill-row .pill.auto { flex: 0 0 auto; padding: 8px 10px; }
.pill-row .divider { flex: 0 0 8px; }
@media (max-width: 360px) { .pill-row { gap: 4px; } .pill-row .pill { font-size: 0.76rem; } }

/* 音频控制条 */
.audio-bar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 10px 0; }
.audio-bar .pill { padding: 5px 12px; font-size: 0.8rem; }

/* 答对祝贺动画 */
.cheer-pop {
  position: fixed; inset: 0; z-index: 300; pointer-events: none;
  display: flex; align-items: center; justify-content: center;
}
.cheer-pop .box { text-align: center; animation: cheer-bounce 0.5s cubic-bezier(0.18, 0.89, 0.32, 1.28); }
.cheer-pop .ico { font-size: 5.2rem; filter: drop-shadow(0 8px 20px rgba(255,159,67,0.55)); }
.cheer-pop .txt { font-size: 1.5rem; font-weight: 800; color: var(--accent); margin-top: 6px; }
@keyframes cheer-bounce { 0% { transform: scale(0.3); opacity: 0; } 60% { transform: scale(1.15); opacity: 1; } 100% { transform: scale(1); } }

/* 情景对话：悬浮评分层（评分倒计时 / 得分） */
.score-float {
  position: fixed; inset: 0; z-index: 250;
  display: flex; align-items: center; justify-content: center;
  background: rgba(0,0,0,0.30);
}
.score-float-box {
  background: var(--card); border-radius: 20px; padding: 24px 48px; text-align: center;
  box-shadow: 0 14px 44px rgba(0,0,0,0.25); max-width: 78vw;
  animation: pop 0.25s ease-out;
}
.score-float .ring-anim { font-size: 2.4rem; line-height: 1; animation: pulse 1s ease-in-out infinite; }
.score-float .sec { font-size: 2.2rem; font-weight: 800; color: var(--primary); margin-top: 8px; }
.score-float .sec small { font-size: 1.1rem; font-weight: 600; color: var(--muted); }
.score-float .tip { font-size: 0.9rem; color: var(--muted); margin-top: 4px; }
.score-float .score-num { font-size: 3.4rem; font-weight: 800; line-height: 1.15; }
.score-float-box.result .score-num { animation: cheer-bounce 0.5s cubic-bezier(0.18,0.89,0.32,1.28); }

/* 对话句内的小分数徽章 */
.dlg-line .mini-score { font-weight: 800; font-size: 0.85rem; margin-left: auto; flex-shrink: 0; white-space: nowrap; }

/* 空状态 */
.empty { text-align: center; color: var(--muted); padding: 30px 0; font-size: 0.92rem; }
.spin { display: inline-block; width: 26px; height: 26px; border: 3px solid var(--border); border-top-color: var(--primary); border-radius: 50%; animation: rot 0.8s linear infinite; margin: 40px auto; }
@keyframes rot { to { transform: rotate(360deg); } }

@media (min-width: 760px) {
  .container { padding-top: 24px; }
}

/* v20260910b */

/* 闪卡单元全对通关：彩炮 + 文字居中弹跳动画（半透明遮罩上白字，5 秒自动消失） */
.perfect-pop { position: fixed; inset: 0; z-index: 300; display: flex; align-items: center; justify-content: center; background: rgba(0,0,0,0.30); cursor: pointer; }
.perfect-pop .confetti { display: flex; justify-content: center; gap: 10px; font-size: 3.4rem; line-height: 1.2; }
.perfect-pop .confetti span { animation: cheer-bounce 0.6s cubic-bezier(0.18,0.89,0.32,1.28) both; }
.perfect-pop .confetti span:nth-child(2) { animation-delay: 0.15s; }
.perfect-pop .confetti span:nth-child(3) { animation-delay: 0.3s; }
.perfect-pop .perfect-title { margin-top: 10px; font-size: 1.8rem; font-weight: 800; color: #fff; text-align: center; text-shadow: 0 4px 14px rgba(0,0,0,0.45); animation: cheer-bounce 0.6s cubic-bezier(0.18,0.89,0.32,1.28) 0.45s both; }
.perfect-pop .tip { margin-top: 8px; text-align: center; color: rgba(255,255,255,0.92); font-size: 0.95rem; }

/* v20260910c */
/* v20260910d */

/* v20260911a */
