/* =========================================================
   小奥英语方块学院 · 样式表
   主题：我的世界 / 像素方块风（小学 3-6 年级）
   ========================================================= */

:root {
  --ink:       #2b2b2b;
  --ink-soft:  #4a4a4a;
  --ink-faint: #7d7d7d;

  --sky-1: #6fc4ff;
  --sky-2: #a5ddff;
  --sky-3: #d8f2ff;

  --grass:      #6abe45;
  --grass-d:    #4c9130;
  --dirt:       #a5713f;
  --dirt-d:     #7c5227;
  --stone:      #8f8f8f;
  --diamond:    #4fd8e8;
  --diamond-d:  #2ba8b8;
  --gold:       #fcce3a;
  --gold-d:     #d9a413;
  --redstone:   #e8453c;
  --redstone-d: #b52f28;
  --wood:       #b07a45;
  --wood-d:     #87562c;
  --copper:     #e08a4c;
  --copper-d:   #b3652e;
  --green:      #5cc95c;
  --green-d:    #3a9c3a;
  --purple:     #a678f0;
  --purple-d:   #7d4fd0;
  --blue:       #58a6ff;
  --blue-d:     #2f7fd6;

  --card:   #fffef5;
  --line:   #2f2f2f;

  --block-border: 3px solid var(--line);
  --block-shadow: 6px 6px 0 rgba(35, 45, 60, .25);
  --shadow-sm: 3px 3px 0 rgba(35, 45, 60, .22);

  --font: "Comic Sans MS", "Chalkboard SE", "PingFang SC", "Microsoft YaHei",
          "Hiragino Sans GB", system-ui, sans-serif;
  --font-en: "Comic Sans MS", "Trebuchet MS", "Segoe UI", Verdana, sans-serif;
}

* { box-sizing: border-box; }

/* hidden 属性必须始终生效 */
[hidden] { display: none !important; }

html, body { margin: 0; padding: 0; min-height: 100%; }

body {
  font-family: var(--font);
  color: var(--ink);
  background: linear-gradient(180deg, var(--sky-1) 0%, var(--sky-2) 55%, var(--sky-3) 100%);
  background-attachment: fixed;
  padding-bottom: 90px;
  -webkit-font-smoothing: antialiased;
}

/* ============ 背景装饰 ============ */
.bg { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }

.pixel-sun {
  position: absolute; top: 46px; right: 8%;
  width: 22px; height: 22px; background: #ffe95c;
  box-shadow: 0 -8px 0 #ffe95c, 0 8px 0 #ffe95c, -8px 0 0 #ffe95c, 8px 0 0 #ffe95c,
              -8px -8px 0 #fff3a8, 8px -8px 0 #fff3a8, -8px 8px 0 #fff3a8, 8px 8px 0 #fff3a8,
              0 0 0 3px #f2c200;
  animation: sun-spin 24s linear infinite;
}
@keyframes sun-spin { to { transform: rotate(360deg); } }

/* 像素云（方块拼成） */
.cloud {
  position: absolute; width: 20px; height: 20px; background: #ffffff;
  box-shadow: 20px 0 0 #fff, 40px 0 0 #fff, 60px 0 0 #fff, 80px 0 0 #fff,
              10px -20px 0 #fff, 30px -20px 0 #fff, 50px -20px 0 #fff,
              -20px 0 0 #eef7ff, -40px 0 0 #eef7ff;
  opacity: .92;
  animation: cloud-drift 60s linear infinite;
}
.cloud.c1 { top: 10%; left: -160px; animation-duration: 55s; }
.cloud.c2 { top: 24%; left: -260px; animation-duration: 75s; transform: scale(1.3); }
.cloud.c3 { top: 6%;  left: -80px;  animation-duration: 95s; transform: scale(.8); }
@keyframes cloud-drift { to { transform: translateX(130vw); } }

/* 漂浮的小方块 */
.bg-block {
  position: absolute; width: 16px; height: 16px; opacity: .5;
  animation: bob 5s ease-in-out infinite;
}
.bg-block.b1 { left: 6%;  top: 38%; background: var(--diamond); box-shadow: 0 0 0 2px #2f6f77 inset; animation-delay: 0s; }
.bg-block.b2 { left: 88%; top: 46%; background: var(--gold);    box-shadow: 0 0 0 2px #8a6a10 inset; animation-delay: 1.2s; }
.bg-block.b3 { left: 12%; top: 70%; background: var(--redstone);box-shadow: 0 0 0 2px #7a1c18 inset; animation-delay: 2.4s; }
@keyframes bob { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-14px); } }

/* 底部草地 + 泥土 */
.grass {
  position: absolute; left: 0; right: 0; bottom: 0; height: 64px;
  background:
    repeating-linear-gradient(90deg, #6abe45 0 32px, #5ea83c 32px 64px),
    linear-gradient(#6abe45, #6abe45);
  border-top: 6px solid #7ecf57;
  box-shadow: 0 10px 0 0 var(--dirt), 0 74px 0 0 var(--dirt-d) inset;
}
.grass::after {
  content: ""; position: absolute; left: 0; right: 0; top: 22px; height: 36px;
  background: repeating-linear-gradient(90deg, var(--dirt) 0 32px, #96622f 32px 64px);
  box-shadow: inset 0 6px 0 rgba(0,0,0,.12);
}

/* ============ 顶部栏（MC 快捷栏风） ============ */
.topbar {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  max-width: 1100px; margin: 14px auto 0; padding: 10px 16px;
  background: rgba(48, 52, 62, .94);
  border: 3px solid #1d2026;
  box-shadow: 0 5px 0 rgba(20, 24, 30, .45);
}
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.mascot.mini { width: 46px; height: 46px; flex: none; }
.mascot svg { width: 100%; height: 100%; display: block; }
.mascot.big { width: 170px; height: 170px; margin: 0 auto; animation: mascot-bob 3.2s ease-in-out infinite; }
@keyframes mascot-bob { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }

.brand-text { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
.brand-text strong { color: #ffe95c; font-size: 17px; letter-spacing: 1px; white-space: nowrap; }
.brand-text span { color: #cfd8e6; font-size: 12px; }

.topbar-right { display: flex; align-items: center; gap: 8px; flex: none; }

.gem-pill {
  display: flex; align-items: center; gap: 6px;
  background: #1d2026; border: 2px solid #565d6a;
  padding: 6px 12px; color: #7ee7f2; font-weight: bold; font-size: 15px;
}
.gem-pill.spin-in { animation: spin-in .5s ease; }
@keyframes spin-in { 0% { transform: scale(1) rotate(0); } 40% { transform: scale(1.35) rotate(-8deg); } 100% { transform: scale(1) rotate(0); } }

.round-btn {
  width: 40px; height: 40px; font-size: 18px; cursor: pointer;
  background: #6b7280; color: #fff; border: 2px solid #1d2026;
  box-shadow: inset 2px 2px 0 rgba(255,255,255,.25), inset -2px -2px 0 rgba(0,0,0,.3);
}
.round-btn:hover { background: #7d8593; }
.round-btn:active { transform: translateY(2px); box-shadow: none; }

/* ============ 主容器 ============ */
#main { max-width: 1100px; margin: 0 auto; padding: 0 16px; }
.screen { display: none; }
.screen.is-active { display: block; animation: screen-in .35s ease; }
@keyframes screen-in { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

/* ============ 首页 Hero ============ */
.hero {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  margin: 26px 0 8px; text-align: center;
}
.speech-bubble {
  position: relative; display: inline-block;
  background: var(--card); border: var(--block-border); box-shadow: var(--block-shadow);
  padding: 18px 24px; max-width: 640px;
}
.speech-bubble::before {
  content: ""; position: absolute; top: -14px; left: 50%; transform: translateX(-50%);
  border: 7px solid transparent; border-bottom-color: var(--line);
}
.hero-line-1 { margin: 0 0 6px; font-size: 20px; font-weight: bold; color: #b52f28; }
.hero-line-2 { margin: 0; font-size: 15px; color: var(--ink-soft); line-height: 1.6; }

/* ============ 按钮（MC 石按钮风） ============ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  font-family: var(--font); font-weight: bold; font-size: 15px;
  padding: 11px 22px; cursor: pointer; color: #fff; text-shadow: 1px 1px 0 rgba(0,0,0,.35);
  background: var(--stone); border: 2px solid var(--line);
  box-shadow: inset 2px 2px 0 rgba(255,255,255,.35), inset -2px -3px 0 rgba(0,0,0,.3), 3px 3px 0 rgba(35,45,60,.3);
  transition: transform .06s ease;
}
.btn:active { transform: translateY(3px); box-shadow: inset 2px 2px 0 rgba(255,255,255,.35), inset -2px -3px 0 rgba(0,0,0,.3); }
.btn:disabled { opacity: .55; cursor: wait; }
.btn.green  { background: var(--grass); }
.btn.blue   { background: var(--blue); }
.btn.purple { background: var(--purple); }
.btn.orange { background: var(--copper); }
.btn.ghost  { background: #e8e4d5; color: var(--ink); text-shadow: none; }
.btn.small  { padding: 7px 14px; font-size: 13px; }

/* ============ 模式卡片（技能方块） ============ */
.mode-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px; margin: 22px 0 8px; max-width: 980px; margin-inline: auto;
}
.mode-card {
  position: relative; display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 20px 14px 16px; cursor: pointer; font-family: var(--font);
  background: var(--card); border: var(--block-border); box-shadow: var(--block-shadow);
  overflow: hidden; transition: transform .12s ease, box-shadow .12s ease;
}
.mode-card::before {
  content: ""; position: absolute; top: 0; left: 0; right: 0; height: 12px;
}
.mode-card.m-speak::before  { background: repeating-linear-gradient(90deg, var(--grass) 0 16px, var(--grass-d) 16px 32px); }
.mode-card.m-listen::before { background: repeating-linear-gradient(90deg, var(--diamond) 0 16px, var(--diamond-d) 16px 32px); }
.mode-card.m-quiz::before   { background: repeating-linear-gradient(90deg, var(--gold) 0 16px, var(--gold-d) 16px 32px); }
.mode-card.m-read::before   { background: repeating-linear-gradient(90deg, var(--wood) 0 16px, var(--wood-d) 16px 32px); }
.mode-card.m-write::before  { background: repeating-linear-gradient(90deg, var(--copper) 0 16px, var(--copper-d) 16px 32px); }

.mode-card:hover { transform: translateY(-5px); box-shadow: 8px 11px 0 rgba(35,45,60,.28); }
.mode-card:active { transform: translateY(0); box-shadow: var(--block-shadow); }

.mode-emoji { font-size: 40px; margin-top: 8px; }
.mode-name  { font-size: 17px; font-weight: bold; letter-spacing: 1px; }
.mode-desc  { font-size: 12.5px; color: var(--ink-soft); line-height: 1.55; text-align: center; }
.mode-go    { margin-top: 4px; font-size: 13px; font-weight: bold; color: #b52f28; }

/* ============ 首页底部进度条 ============ */
.today-strip {
  display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 10px;
  max-width: 760px; margin: 20px auto; padding: 12px 18px;
  background: rgba(48, 52, 62, .94); color: #dfe6f0; font-size: 13.5px;
  border: 3px solid #1d2026; box-shadow: var(--shadow-sm);
}
.badge-chip {
  background: #2b2f38; border: 2px solid #565d6a; color: #ffe95c;
  padding: 3px 10px; font-weight: bold; font-size: 13px; white-space: nowrap;
}
.divider { width: 2px; height: 14px; background: #565d6a; }
.hl { color: #7ee7f2; font-weight: bold; }

.home-foot {
  display: flex; flex-direction: column; gap: 8px; align-items: center;
  text-align: center; margin: 6px 0 26px;
}
.tip { font-size: 13px; color: var(--ink-soft); }
.support-warn {
  font-size: 13px; color: #8a5a00; background: #fff3cf;
  border: 2px solid #e0b000; padding: 8px 14px; max-width: 560px;
}

/* ============ 课程页 ============ */
.lesson-head {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  margin: 18px 0 14px;
}
.lesson-head h2 { margin: 0; font-size: 20px; letter-spacing: 1px; flex: 1; min-width: 120px; }
.level-pill {
  font-size: 12.5px; font-weight: bold; color: #fff;
  background: var(--purple); border: 2px solid var(--line); padding: 4px 12px;
  box-shadow: 2px 2px 0 rgba(35,45,60,.25);
}

#stage { display: flex; flex-direction: column; align-items: center; gap: 14px; padding-bottom: 30px; }

/* ============ 通用卡片 ============ */
.card {
  width: 100%; max-width: 760px;
  background: var(--card); border: var(--block-border); box-shadow: var(--block-shadow);
  padding: 22px 24px; display: flex; flex-direction: column; align-items: center; gap: 12px;
  text-align: center;
}
.repeat-tag {
  font-size: 12.5px; font-weight: bold; color: #fff;
  background: #3a3f4a; border: 2px solid var(--line); padding: 4px 12px;
  box-shadow: 2px 2px 0 rgba(35,45,60,.25);
}

/* ============ 聊天区 ============ */
.chat-box {
  width: 100%; max-width: 760px; height: 44vh; min-height: 300px; overflow-y: auto;
  background: var(--card); border: var(--block-border); box-shadow: var(--block-shadow);
  padding: 16px; display: flex; flex-direction: column; gap: 14px;
}
/* 作文页：还没有批改结果时不显示空面板 */
#chatBox:empty { display: none; }
.msg { display: flex; gap: 10px; align-items: flex-start; }
.msg.user { flex-direction: row-reverse; }
.msg-avatar {
  width: 46px; height: 46px; flex: none; display: flex; align-items: center; justify-content: center;
  background: #fff; border: 2px solid var(--line); font-size: 24px; overflow: hidden;
}
.msg-avatar svg { width: 100%; height: 100%; }
.bubble-wrap { max-width: 78%; display: flex; flex-direction: column; gap: 6px; }
.msg.user .bubble-wrap { align-items: flex-end; }
.bubble {
  background: #fff; border: 2px solid var(--line); box-shadow: var(--shadow-sm);
  padding: 10px 14px; font-size: 15px; line-height: 1.65; text-align: left;
}
.msg.teacher .bubble { background: #eef9ff; }
.msg.user .bubble { background: #f4ffe8; }
.en-line { font-family: var(--font-en); }
.zh-line { color: var(--ink-soft); font-size: .92em; border-left: 3px solid #c8c8c8; padding-left: 8px; }

/* 中英开关：隐藏中文行 */
.bubble.zh-hidden .zh-line { display: none; }

/* 作文批改的段落样式 */
.ln-cheer { background: #fff8dc; padding: 4px 8px; }
.ln-fix   { background: #f0f6ff; padding: 4px 8px; }
.ln-model { background: #eafff0; padding: 4px 8px; font-family: var(--font-en); }
.ln-tip   { background: #fdf0ff; padding: 4px 8px; }
.ln-say   { font-weight: bold; }

.bubble-tools { display: flex; gap: 6px; }
.mini-btn {
  font-family: var(--font); font-size: 12px; cursor: pointer;
  background: #e8e4d5; color: var(--ink); border: 2px solid var(--line);
  padding: 3px 8px; box-shadow: 2px 2px 0 rgba(35,45,60,.22);
}
.mini-btn:active { transform: translate(1px,1px); box-shadow: 1px 1px 0 rgba(35,45,60,.22); }

.typing { display: inline-flex; gap: 5px; padding: 4px 2px; }
.typing i {
  width: 8px; height: 8px; background: var(--ink-faint); display: block;
  animation: typing-b 1.2s infinite;
}
.typing i:nth-child(2) { animation-delay: .15s; }
.typing i:nth-child(3) { animation-delay: .3s; }
@keyframes typing-b { 0%,60%,100% { transform: translateY(0); opacity: .5; } 30% { transform: translateY(-6px); opacity: 1; } }

/* ============ 输入条 ============ */
.input-bar {
  width: 100%; max-width: 760px; display: flex; gap: 8px; align-items: center;
}
.icon-btn {
  width: 48px; height: 48px; flex: none; font-size: 21px; cursor: pointer;
  background: var(--card); border: var(--block-border); box-shadow: var(--shadow-sm);
}
.icon-btn:disabled { opacity: .55; }
.icon-btn.mic.recording { background: var(--redstone); animation: mic-pulse 1s infinite; }
.icon-btn.send { background: var(--grass); }
@keyframes mic-pulse { 0%,100% { transform: scale(1); } 50% { transform: scale(1.12); } }
.text-input, .answer-input, .write-area {
  font-family: var(--font); font-size: 15px; color: var(--ink);
  background: #fff; border: var(--block-border); padding: 12px 14px; outline: none;
  box-shadow: inset 2px 2px 0 rgba(0,0,0,.06);
}
.text-input { flex: 1; min-width: 0; }
.text-input:focus, .answer-input:focus, .write-area:focus { border-color: var(--diamond-d); }

.listen-hint {
  font-size: 13.5px; color: var(--ink-soft); min-height: 20px; text-align: center;
}
.listen-hint.live { color: #b52f28; font-weight: bold; animation: blink 1s infinite; }
@keyframes blink { 50% { opacity: .45; } }

/* ============ 话题 chips ============ */
.chip-row { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; max-width: 760px; }
.chip {
  font-family: var(--font); font-size: 13.5px; cursor: pointer;
  background: var(--card); border: 2px solid var(--line); padding: 7px 14px;
  box-shadow: 2px 2px 0 rgba(35,45,60,.22); color: var(--ink);
}
.chip:hover { background: #fff8dc; }
.chip.active { background: var(--grass); color: #fff; text-shadow: 1px 1px 0 rgba(0,0,0,.3); }

/* ============ 听力模式 ============ */
.listen-question-mark {
  font-size: 64px; line-height: 1;
  animation: bob 2.4s ease-in-out infinite;
}
.listen-cn-hint { font-size: 14px; color: var(--ink-soft); }

.answer-row { display: flex; gap: 8px; width: 100%; max-width: 560px; align-items: center; }
.answer-input { flex: 1; min-width: 0; }

.answer-reveal {
  width: 100%; background: #eef9ff; border: 2px dashed var(--blue);
  padding: 12px 16px;
}
.sentence-en { font-family: var(--font-en); font-size: 19px; font-weight: bold; }
.sentence-cn { margin-top: 4px; font-size: 14px; color: var(--ink-soft); }

.score-gems { font-size: 34px; letter-spacing: 6px; }
.score-gems .off { opacity: .22; filter: grayscale(1); }
.score-line { font-size: 16px; font-weight: bold; }

.diff-box {
  width: 100%; background: #fff; border: 2px solid var(--line);
  padding: 12px 16px; font-family: var(--font-en); font-size: 17px; line-height: 1.9;
}
.w-ok  { color: #1f7a2e; background: #dcffe4; padding: 1px 4px; }
.w-bad { color: #b52f28; background: #ffe1df; padding: 1px 4px; text-decoration: underline wavy #b52f28; }
.w-extra { color: #8a5a00; background: #fff3cf; padding: 1px 4px; }

.feedback-box {
  width: 100%; max-width: 560px;
  background: #fdf0ff; border: 2px solid var(--purple); padding: 12px 16px;
  font-size: 15px; line-height: 1.7;
}
.feedback-box.fb-good { background: #eafff0; border-color: var(--green-d); }

.repeat-actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }

/* ============ 笔试模式 ============ */
.quiz-question { font-family: var(--font-en); font-size: 22px; font-weight: bold; line-height: 1.5; }
.quiz-cn { font-size: 14px; color: var(--ink-soft); }
.quiz-options { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; width: 100%; max-width: 560px; }
.option-btn {
  display: flex; align-items: center; gap: 10px; text-align: left;
  font-family: var(--font); font-size: 15.5px; cursor: pointer;
  background: #fff; border: 2px solid var(--line); padding: 12px 14px;
  box-shadow: var(--shadow-sm); transition: transform .08s ease;
}
.option-btn:hover:not(:disabled) { background: #fff8dc; transform: translateY(-2px); }
.option-btn:disabled { cursor: default; opacity: .85; }
.option-btn.small { padding: 9px 12px; font-size: 14px; }
.opt-letter {
  width: 28px; height: 28px; flex: none; display: flex; align-items: center; justify-content: center;
  background: #3a3f4a; color: #ffe95c; font-weight: bold; font-size: 14px;
  border: 2px solid var(--line);
}
.option-btn.ok  { background: #dcffe4; border-color: var(--green-d); box-shadow: 0 0 0 3px #b9edd3, var(--shadow-sm); }
.option-btn.ok .opt-letter { background: var(--green-d); color: #fff; }
.option-btn.bad { background: #ffe1df; border-color: var(--redstone-d); opacity: .8; }
.option-btn.bad .opt-letter { background: var(--redstone-d); color: #fff; }

/* ============ 阅读模式 ============ */
.read-title { margin: 4px 0 0; font-family: var(--font-en); font-size: 24px; }
.read-title-zh { font-size: 15px; color: var(--ink-soft); font-weight: normal; margin-left: 8px; }
.passage { width: 100%; background: #fffdf2; border: 2px solid var(--gold-d); padding: 16px 20px; text-align: left; }
.passage-line {
  margin: 0 0 8px; font-family: var(--font-en); font-size: 16.5px; line-height: 1.7;
}
.read-zh {
  width: 100%; background: #f4f4f4; border: 2px dashed var(--ink-faint);
  padding: 12px 16px; font-size: 14px; color: var(--ink-soft); line-height: 1.8;
}
.block-title { font-size: 14px; font-weight: bold; color: var(--ink-soft); margin-top: 6px; letter-spacing: 1px; }
.glossary { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.word-chip {
  background: #fff; border: 2px solid var(--diamond-d); padding: 5px 12px;
  font-size: 13.5px; box-shadow: 2px 2px 0 rgba(35,45,60,.18);
}
.rq { width: 100%; background: #fff; border: 2px solid var(--line); padding: 14px 16px; text-align: left; box-shadow: var(--shadow-sm); }
.rq-q { font-family: var(--font-en); font-size: 15.5px; font-weight: bold; margin-bottom: 10px; display: flex; align-items: center; gap: 8px; }
.rq-opts { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.rq-fb { margin-top: 10px; }
.rq-fb:empty { display: none; }

/* ============ 作文模式 ============ */
.write-card { max-width: 760px; }
.write-topic-en { font-family: var(--font-en); font-size: 21px; font-weight: bold; }
.write-hints { font-size: 13.5px; color: var(--ink-soft); }
.write-hints b { color: var(--copper-d); }
.write-starter { font-size: 13.5px; color: var(--ink-soft); display: flex; align-items: center; gap: 6px; flex-wrap: wrap; justify-content: center; }
.starter-line { font-family: var(--font-en); background: #fff8dc; border: 2px solid var(--gold-d); padding: 2px 8px; }
.write-area { width: 100%; max-width: 640px; resize: vertical; line-height: 1.7; }
.write-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; width: 100%; max-width: 640px; }
.word-count { font-size: 13px; color: var(--ink-faint); }

/* ============ 抽屉面板 ============ */
.drawer-mask {
  position: fixed; inset: 0; background: rgba(20, 25, 35, .5); z-index: 90;
}
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 100;
  width: min(400px, 92vw); overflow-y: auto;
  background: var(--card); border-left: 4px solid var(--line);
  padding: 22px 20px; display: flex; flex-direction: column; gap: 14px;
  animation: drawer-in .25s ease;
}
@keyframes drawer-in { from { transform: translateX(60px); opacity: 0; } to { transform: none; opacity: 1; } }
.drawer h3 { margin: 0 0 4px; font-size: 18px; letter-spacing: 1px; }
.badge-line { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.badge-note { font-size: 12.5px; color: var(--ink-faint); }
.stat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.stat-card {
  background: #fff; border: 2px solid var(--line); padding: 12px 8px; text-align: center;
  box-shadow: var(--shadow-sm);
}
.stat-card .num { font-size: 24px; font-weight: bold; color: var(--diamond-d); }
.stat-card .lab { font-size: 12px; color: var(--ink-soft); margin-top: 2px; }

.week-chart { display: flex; align-items: flex-end; gap: 6px; height: 110px; }
.week-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px; height: 100%; justify-content: flex-end; }
.week-col .cnt { font-size: 11px; color: var(--ink-faint); min-height: 14px; }
.week-bar {
  width: 70%; background: var(--grass); border: 2px solid var(--line); border-bottom: none;
  min-height: 6px;
}
.week-col.zero .week-bar { background: #d9d9d9; }
.week-col.today .week-bar { background: var(--gold); }
.week-col .day { font-size: 11px; color: var(--ink-soft); }

.bar-list { display: flex; flex-direction: column; gap: 10px; }
.bar-row .bar-head { display: flex; justify-content: space-between; font-size: 12.5px; color: var(--ink-soft); margin-bottom: 4px; }
.bar-track { height: 14px; background: #e3e0d2; border: 2px solid var(--line); }
.bar-fill { height: 100%; transition: width .4s ease; }
.c-speak  { background: var(--grass); }
.c-listen { background: var(--diamond); }
.c-quiz   { background: var(--gold); }
.c-read   { background: var(--wood); }
.c-write  { background: var(--copper); }

.drawer-foot { margin-top: auto; display: flex; flex-direction: column; gap: 10px; }
.api-line { font-size: 12px; color: var(--ink-faint); line-height: 1.6; }
.api-line.ok { color: var(--green-d); }
.api-line.bad { color: var(--redstone-d); }

/* ============ 设置控件 ============ */
.switch-row, .range-row, .voice-row {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  font-size: 14px;
}
.switch-row input[type="checkbox"] { width: 20px; height: 20px; accent-color: var(--grass); }
.range-row { flex-direction: column; align-items: stretch; }
.range-row input[type="range"] { width: 100%; accent-color: var(--blue); }
.seg { display: flex; gap: 0; }
.seg button {
  font-family: var(--font); font-size: 13px; cursor: pointer;
  background: #e8e4d5; border: 2px solid var(--line); padding: 7px 14px; color: var(--ink);
}
.seg button.on { background: var(--grass); color: #fff; text-shadow: 1px 1px 0 rgba(0,0,0,.3); }
.voice-row select {
  font-family: var(--font); font-size: 13px; max-width: 220px;
  border: 2px solid var(--line); background: #fff; padding: 6px;
}

/* ============ 骨架屏 / 特效 ============ */
.skeleton {
  background: linear-gradient(90deg, #e8e4d5 25%, #f4f1e4 50%, #e8e4d5 75%);
  background-size: 200% 100%; animation: shimmer 1.3s infinite;
}
@keyframes shimmer { to { background-position: -200% 0; } }

.burst-layer { position: fixed; inset: 0; pointer-events: none; z-index: 200; }
.burst-star {
  position: absolute; font-size: 22px; animation: burst .9s ease-out forwards;
}
@keyframes burst {
  0% { transform: translate(0, 0) scale(.6); opacity: 1; }
  100% { transform: translate(var(--dx), var(--dy)) rotate(var(--rot)) scale(1.15); opacity: 0; }
}
.float-up {
  position: fixed; z-index: 210; font-size: 20px; font-weight: bold; color: #2ba8b8;
  text-shadow: 1px 1px 0 #fff; pointer-events: none; animation: float-up 1s ease-out forwards;
}
@keyframes float-up { to { transform: translateY(-60px); opacity: 0; } }

.shake { animation: shake .45s ease; }
@keyframes shake {
  0%,100% { transform: translateX(0); }
  20% { transform: translateX(-8px); } 40% { transform: translateX(8px); }
  60% { transform: translateX(-5px); } 80% { transform: translateX(5px); }
}

.toast {
  position: fixed; left: 50%; bottom: 96px; transform: translateX(-50%); z-index: 300;
  background: #2f3440; color: #fff; font-size: 14px; padding: 12px 20px;
  border: 3px solid #1d2026; box-shadow: var(--shadow-sm); max-width: 86vw;
  animation: toast-in .25s ease;
}
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, 12px); } to { opacity: 1; transform: translate(-50%, 0); } }

/* 奥特曼计时器呼吸灯 */
.timer { animation: timer-glow 1.6s ease-in-out infinite; }
@keyframes timer-glow { 0%,100% { fill: #58c6ff; } 50% { fill: #aeeaff; } }
.eyes { animation: blink-eyes 4.5s infinite; transform-origin: 60px 36px; }
@keyframes blink-eyes { 0%,92%,100% { transform: scaleY(1); } 95% { transform: scaleY(.1); } }

/* ============ 移动端适配 ============ */
@media (max-width: 640px) {
  .topbar { margin: 10px 10px 0; padding: 8px 10px; }
  .brand-text strong { font-size: 14px; }
  .brand-text span { font-size: 10.5px; }
  .mascot.big { width: 130px; height: 130px; }
  .mode-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .quiz-options, .rq-opts { grid-template-columns: 1fr; }
  .chat-box { height: 40vh; }
  .write-foot { flex-direction: column; }
  .pixel-sun { right: 4%; }
}
