/* 五年级英语 · 译林五上 · 一年级口语表达风格（暖黄草绿 · 大字号 · 大按钮） */
:root {
  --sun: #ffd166;
  --mint: #6ee7b7;
  --leaf: #34d399;
  --ink: #2d3436;
  --ink2: #888;
  --ink3: #bbb;
  --shadow: 0 8px 24px rgba(0,0,0,.10);
  --shadow-sm: 0 4px 12px rgba(0,0,0,.08);
  --card-border: #f0e6cf;
  --bg: #fdf6e3;
  --sky: #38bdf8;
  --coral: #ff8a5c;
}
* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
  background: var(--bg);
  color: var(--ink);
  font-size: 17px;
}
.bg { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden;
  background: linear-gradient(180deg, #fff9ea 0%, #f0fbe8 100%); }
#app { position: relative; z-index: 1; max-width: 560px; margin: 0 auto; min-height: 100vh; padding: 14px 14px 30px; }
.page { display: flex; flex-direction: column; min-height: calc(100vh - 44px); }
.route-in { animation: routeIn .3s ease; }
@keyframes routeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ===== 顶部 ===== */
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 4px 0 10px; }
.topbar .left { display: flex; align-items: center; gap: 10px; min-width: 0; }
.logo-circle { width: 44px; height: 44px; border-radius: 16px; background: linear-gradient(135deg, var(--sun), var(--mint)); display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 16px; color: #5c3a00; box-shadow: var(--shadow-sm); flex-shrink: 0; }
.text-title { font-size: 19px; font-weight: 700; line-height: 1.3; }
.text-sub { font-size: 13px; color: var(--ink2); line-height: 1.5; }
.pill { display: inline-flex; align-items: center; gap: 4px; font-size: 15px; font-weight: 700; padding: 5px 12px; border-radius: 999px; background: #fff; box-shadow: var(--shadow-sm); }
.pill.star { color: #b26a00; }
.pill.star img { width: 20px; height: 20px; }
.chip { font-size: 14px; font-weight: 600; background: #fff; border: 1.5px solid var(--card-border); padding: 5px 12px; border-radius: 999px; white-space: nowrap; color: var(--ink); }

.btn { font-family: inherit; font-size: 16px; font-weight: 700; border: none; border-radius: 999px; cursor: pointer; padding: 11px 22px; transition: transform .12s ease; }
.btn:active { transform: scale(.95); }
.btn.small { font-size: 14px; padding: 8px 16px; }
.btn.big { font-size: 18px; padding: 14px 36px; }
.btn-ghost { background: #fff; color: var(--ink); border: 1.5px solid var(--card-border); }
.btn-primary { background: linear-gradient(135deg, var(--mint), var(--leaf)); color: #064e3b; box-shadow: 0 6px 16px rgba(52,211,153,.35); }
.btn-word { background: linear-gradient(135deg, var(--sun), #ffb347); color: #5c3a00; }
.btn-talk { background: linear-gradient(135deg, var(--mint), var(--leaf)); color: #064e3b; }
.btn-stats { background: linear-gradient(135deg, #e0d7ff, #c9b8ff); color: #4c2d8f; }
.btn-kn { background: linear-gradient(135deg, #d1ecff, #b8daff); color: #0b4a7a; }

/* ===== 知识点页 ===== */
.kn-sec { margin-bottom: 12px; }
.kn-head { display: flex; justify-content: space-between; align-items: center; font-size: 16px; font-weight: 700; color: var(--ink); cursor: pointer; }
.kn-arrow { color: var(--ink-2, #8a7a55); }
.kn-body { margin-top: 10px; font-size: 14px; line-height: 1.6; }
.kn-word { padding: 8px 0; border-bottom: 1px dashed #eee3c8; }
.kn-word:last-child { border-bottom: none; }
.kn-w-top { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.kn-w-top b { font-size: 16px; }
.kn-w-ph { color: #7a8ba0; font-size: 13px; }
.kn-w-pos { color: #b06ab0; font-size: 12px; font-style: italic; }
.kn-w-cn { color: var(--ink); font-size: 14px; }
.kn-extra { color: #8a6d1f; background: #fdf6e0; border-radius: 8px; padding: 4px 8px; margin-top: 4px; font-size: 13px; }
.kn-eg { color: #4a6b4a; font-size: 13px; margin-top: 4px; }
.kn-egcn { color: #98a88a; margin-left: 8px; }
.kn-line { font-size: 15px; }
.kn-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.kn-chip { background: #eaf4ff; color: #0b4a7a; border-radius: 999px; padding: 4px 12px; font-size: 13px; }
.kn-row { padding: 6px 0; border-bottom: 1px dashed #eee3c8; display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.kn-row:last-child { border-bottom: none; }
.kn-row b { color: var(--ink); }
.kn-rowcn { color: #7a6a4a; }
.kn-gtitle { font-weight: 700; color: var(--ink); margin-top: 10px; font-size: 14px; }
.kn-gtitle:first-child { margin-top: 0; }
.kn-sent { padding: 6px 0; border-bottom: 1px dashed #eee3c8; }
.kn-ans { color: #2a7a2a; font-size: 13px; margin-left: 8px; }
.kn-sentcn { color: #7a6a4a; font-size: 13px; }
.kn-bullet { padding: 3px 0; color: #4a4a3a; }
.kn-sample { background: #f4f9ee; border-radius: 10px; padding: 10px 12px; color: #3a5a2a; font-size: 13px; line-height: 1.7; }
.btn-word img, .btn-talk img { width: 18px; height: 18px; vertical-align: -3px; margin-right: 4px; }

/* ===== 学习方法文章页 ===== */
.btn-methods { width: 100%; margin: 2px 0 14px; background: linear-gradient(135deg, #ffe9a8, var(--sun)); color: #5c3a00; font-size: 16px; padding: 11px 16px; display: flex; align-items: center; justify-content: center; gap: 8px; box-shadow: 0 6px 16px rgba(255,209,102,.40); }
.btn-methods img { width: 24px; height: 24px; border-radius: 50%; object-fit: cover; }
.mt-banner { width: 100%; border-radius: 20px; box-shadow: var(--shadow-sm); display: block; }
.mt-intro { background: #fff; border-radius: 18px; padding: 14px 16px; margin-top: 12px; font-size: 14px; line-height: 1.8; color: #6a5a3a; box-shadow: var(--shadow-sm); }
.mt-intro b { color: #b26a00; font-size: 15px; }
.mt-sec { background: #fff; border-radius: 18px; padding: 14px; margin-top: 12px; box-shadow: var(--shadow-sm); }
.mt-sec-head { display: flex; align-items: center; gap: 10px; font-size: 17px; font-weight: 800; color: var(--ink); }
.mt-badge { width: 30px; height: 30px; border-radius: 10px; color: #fff; font-size: 15px; font-weight: 800; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.mt-items { margin-top: 6px; }
.mt-item { padding: 9px 0 7px; border-bottom: 1px dashed #eee3c8; }
.mt-item:last-child { border-bottom: none; }
.mt-name { font-weight: 700; font-size: 15px; color: var(--ink); display: flex; align-items: baseline; gap: 6px; }
.mt-mark { color: #34a853; font-weight: 800; }
.mt-bad .mt-mark { color: #ef4444; }
.mt-bad .mt-name { color: #b23a3a; }
.mt-case { font-size: 13.5px; color: #6a5a3a; line-height: 1.8; margin-top: 3px; padding-left: 16px; }
.mt-en { background: #eaf4ff; color: #0b4a7a; border-radius: 6px; padding: 1px 6px; font-family: Georgia, 'Times New Roman', serif; display: inline-block; margin: 2px 0; }
.mt-line { margin: 2px 0; }
.mt-ending { text-align: center; font-size: 15px; font-weight: 700; color: #b26a00; padding: 18px 0 8px; }

/* ===== 首页统计 ===== */
.stats-row { display: flex; gap: 10px; margin: 6px 0 14px; }
.stat { flex: 1; background: #fff; border-radius: 18px; padding: 10px 6px; text-align: center; box-shadow: var(--shadow-sm); }
.stat b { display: block; font-size: 20px; color: var(--leaf); }
.stat span { font-size: 12px; color: var(--ink2); }

/* ===== 单元卡 ===== */
.unit-list { display: flex; flex-direction: column; gap: 14px; }
.unit-card { background: #fff; border-radius: 20px; padding: 14px; box-shadow: var(--shadow-sm); border-left: 6px solid var(--uc1); }
.unit-head { display: flex; align-items: center; gap: 10px; }
.unit-badge { width: 46px; height: 46px; border-radius: 14px; color: #fff; font-weight: 800; font-size: 17px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.unit-title { font-size: 19px; font-weight: 700; }
.unit-role { font-size: 13px; color: var(--ink2); }
.unit-sub { font-size: 13px; color: var(--ink2); margin-top: 6px; line-height: 1.5; }
.unit-progress { height: 7px; background: #eee; border-radius: 999px; margin-top: 8px; overflow: hidden; }
.up-fill { height: 100%; background: linear-gradient(90deg, var(--uc1), var(--uc2)); border-radius: 999px; transition: width .4s ease; }
.unit-progress-text { font-size: 12px; color: var(--ink2); margin-top: 4px; }
.unit-btns { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.unit-btns .btn { flex: 1 1 40%; padding: 10px 8px; font-size: 15px; }

/* ===== 进度条 ===== */
.progress-track { height: 12px; background: #f0e6cf; border-radius: 999px; overflow: hidden; margin-top: 4px; }
.progress-fill { height: 100%; background: linear-gradient(90deg, var(--sun), var(--mint)); border-radius: 999px; transition: width .4s ease; }
.center { text-align: center; }
.mt-8 { margin-top: 8px; }
.mt-14 { margin-top: 14px; }
.mt-16 { margin-top: 16px; }

/* ===== 单词闪卡 ===== */
.wordcard { perspective: 1200px; max-width: 420px; margin: 0 auto; }
.wordcard .wc-inner { position: relative; width: 100%; min-height: 300px; transition: transform .5s ease; transform-style: preserve-3d; }
.wordcard.flipped .wc-inner { transform: rotateY(180deg); }
.wordcard .wc-face { position: absolute; inset: 0; backface-visibility: hidden; display: flex; flex-direction: column; align-items: center; justify-content: center; border-radius: 26px; padding: 24px; box-shadow: var(--shadow); }
.wc-front { background: linear-gradient(160deg, #fff3d1, #ffe29a); }
.wc-back { background: linear-gradient(160deg, #e8f5dc, #c9e3ae); transform: rotateY(180deg); }
.wc-word { font-size: 50px; font-weight: 800; color: var(--ink); line-height: 1.15; font-family: Georgia, 'Times New Roman', serif; }
.wc-phonetic { font-size: 17px; color: var(--ink2); margin-top: 6px; font-family: Georgia, serif; }
.wc-cn { font-size: 26px; font-weight: 700; margin-top: 8px; }
.wc-example { font-size: 16px; margin-top: 12px; color: var(--ink); font-family: Georgia, serif; text-align: center; line-height: 1.6; }
.wc-example-cn { font-size: 13px; color: var(--ink2); margin-top: 4px; text-align: center; }

/* ===== 评分按钮 ===== */
.rate-row { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.rate-btn { font-family: inherit; font-size: 17px; font-weight: 700; border: none; border-radius: 18px; padding: 12px 22px; cursor: pointer; color: #fff; transition: transform .12s ease; }
.rate-btn:active { transform: scale(.94); }
.rate-ok { background: linear-gradient(135deg, #a5d6a7, #66bb6a); box-shadow: 0 6px 14px rgba(102,187,106,.4); }
.rate-mid { background: linear-gradient(135deg, #ffe082, #ffb703); box-shadow: 0 6px 14px rgba(255,183,3,.4); }
.rate-no { background: linear-gradient(135deg, #ffab91, #ff8a5c); box-shadow: 0 6px 14px rgba(255,138,92,.4); }

/* ===== 口语对话（一年级风格）===== */
.word-class-card { background: #fff; border-radius: 26px; padding: 18px 16px; box-shadow: var(--shadow); display: flex; flex-direction: column; min-height: calc(100vh - 110px); }
.wc-top { text-align: center; padding-bottom: 12px; border-bottom: 2px dashed var(--card-border); }
.wc-word-big { font-size: 46px; font-weight: 800; color: var(--ink); font-family: Georgia, serif; cursor: pointer; }
.wc-phonetic { font-size: 16px; color: var(--ink2); font-family: Georgia, serif; margin-top: 2px; }
.wc-cn { font-size: 22px; font-weight: 700; color: var(--leaf); margin-top: 2px; }
.wc-example { font-size: 15px; color: var(--ink); font-family: Georgia, serif; margin-top: 6px; cursor: pointer; line-height: 1.6; }
.talk-box { flex: 1; overflow-y: auto; padding: 12px 2px; display: flex; flex-direction: column; gap: 10px; max-height: 42vh; }
.talk-box-full { max-height: 62vh; min-height: 320px; }
.stat-record { margin-bottom: 14px; }
.stat-head { font-size: 15px; font-weight: 700; color: var(--ink); }
.stat-line { font-size: 15px; line-height: 1.7; margin-top: 6px; padding: 8px 12px; border-radius: 12px; background: #f8f3e6; }
.stat-line.me { background: linear-gradient(135deg, #fff3d1, #ffe9b8); }
.stat-line.ai { background: linear-gradient(135deg, #e8f5dc, #d9ecC4); }
.talk-bubble { display: flex; gap: 8px; max-width: 92%; }
.talk-bubble.user { align-self: flex-end; flex-direction: row-reverse; }
.tb-avatar { width: 38px; height: 38px; border-radius: 14px; background: linear-gradient(135deg, var(--sun), var(--mint)); display: flex; align-items: center; justify-content: center; font-weight: 800; color: #5c3a00; flex-shrink: 0; box-shadow: var(--shadow-sm); }
.talk-text { padding: 11px 15px; border-radius: 18px; font-size: 16px; line-height: 1.65; word-break: break-word; }
.talk-bubble.assistant .talk-text { background: var(--ai-bg, #f0f7ff); border-top-left-radius: 4px; }
.talk-bubble.user .talk-text { background: var(--me-bg, #e8f5e9); border-top-right-radius: 4px; }

.talk-input { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 6px; }
.talk-input input { flex: 1; min-width: 120px; border: 2px solid var(--card-border); border-radius: 999px; padding: 12px 16px; font-size: 16px; outline: none; background: #fff; color: var(--ink); }
.talk-input input:focus { border-color: var(--sun); }
.talk-actions { display: flex; gap: 10px; align-items: center; }
.voice-btn {
  width: 84px; height: 84px; border-radius: 50%;
  border: none; cursor: pointer;
  background: linear-gradient(145deg, #fff3d1, #ffe29a);
  box-shadow: var(--shadow);
  display: inline-flex; align-items: center; justify-content: center;
  transition: transform .15s ease;
}
.voice-btn:hover { transform: scale(1.05); }
.voice-btn:active { transform: scale(.94); }
.voice-btn.listening {
  background: linear-gradient(145deg, #e8f5dc, #c9e3ae);
  animation: voice-pulse 1.2s ease-in-out infinite;
}
@keyframes voice-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(127, 176, 105, .45); }
  50% { box-shadow: 0 0 0 20px rgba(127, 176, 105, 0); }
}
.voice-icon { width: 42px; height: 42px; border-radius: 12px; object-fit: cover; }

/* 盲盒 */
.blindbox {
  position: fixed; top: 30%; left: 50%; transform: translate(-50%, -50%) scale(.4);
  background: #fff; border-radius: 20px; padding: 14px 22px; display: flex; align-items: center; gap: 8px;
  box-shadow: 0 16px 40px rgba(245,166,35,.4); z-index: 99; opacity: 0;
}
.blindbox img { width: 40px; height: 40px; }
.blindbox div { font-size: 24px; font-weight: 800; color: #b26a00; }
.blindbox.pop { opacity: 1; transform: translate(-50%, -50%) scale(1); transition: all .3s cubic-bezier(.2,1.4,.4,1); }
.blindbox.out { opacity: 0; transform: translate(-50%, -60%) scale(.7); transition: all .35s ease; }

/* 勇气卡片 */
.courage-mask { position: fixed; inset: 0; background: rgba(30,50,40,.65); z-index: 100; display: flex; align-items: center; justify-content: center; padding: 24px; animation: fadeIn .3s ease; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.courage-card { background: linear-gradient(160deg, #FFF9EC, #FFF1D6); border-radius: 26px; padding: 26px 22px; width: 100%; max-width: 360px; text-align: center; box-shadow: 0 24px 60px rgba(0,0,0,.3); animation: popIn .45s cubic-bezier(.2,1.3,.4,1); }
@keyframes popIn { from { transform: scale(.6); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.cg-star { width: 72px; height: 72px; margin: 0 auto 10px; }
.cg-title { font-size: 26px; font-weight: 800; color: #b26a00; }
.cg-body { font-size: 16px; color: var(--ink); margin-top: 10px; line-height: 1.8; }
.cg-body b { color: var(--leaf); font-size: 20px; }
.courage-card .btn { margin-top: 18px; width: 100%; }

/* Toast */
#toast-root { position: fixed; top: 18px; left: 50%; transform: translateX(-50%); z-index: 200; display: flex; flex-direction: column; gap: 8px; align-items: center; width: 90%; max-width: 380px; pointer-events: none; }
.toast { background: rgba(40,60,50,.92); color: #fff; border-radius: 999px; padding: 10px 20px; font-size: 14px; animation: tIn .25s ease; text-align: center; }
.toast.leaving { opacity: 0; transform: translateY(-10px); transition: all .3s ease; }
@keyframes tIn { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }
.typing-dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--ink3); display: inline-block; margin: 0 2px; animation: blink 1s infinite; }
.typing-dots i:nth-child(2) { animation-delay: .2s; }
.typing-dots i:nth-child(3) { animation-delay: .4s; }
@keyframes blink { 0%,100% { opacity: .3; } 50% { opacity: 1; } }
