/* ═══════════════════════════════════════════════════════
   红狼老师的英语小屋 · 像素风（Minecraft 风格）视觉系统
   浅色主题 / 方块边框 / 3D 凸起按钮 / crispEdges 像素感
   ═══════════════════════════════════════════════════════ */

:root {
  /* 天空与地面 */
  --sky1: #8FD0F0;
  --sky2: #C8EBFB;
  --sky3: #E8F7FF;
  --grass1: #6FBF4A;
  --grass2: #56A335;
  --dirt: #A9764A;
  --dirt2: #8B5E3B;
  --stone: #B9B9B9;

  /* 木头/木板（面板底色） */
  --wood1: #F5E6C8;
  --wood2: #E8D4AC;
  --wood-line: #C9A87C;
  --plank: #FFF8E7;

  --ink: #2E2116;
  --ink-soft: #6B5A48;
  --line: #C9A87C;

  /* 功能色 */
  --red: #C1440E;
  --red-2: #E05A18;
  --red-deep: #8E2A0A;
  --gold: #F5B942;
  --gold-2: #D99A1F;
  --emerald: #3FA34D;
  --emerald-2: #2E7D38;
  --diamond: #3EC6C6;
  --diamond-2: #2A9E9E;
  --lapis: #3B6FD4;
  --lapis-2: #2A54A8;
  --amethyst: #8B5CD6;
  --amethyst-2: #6B41AD;

  --radius: 0px;

  --font-px: "Press Start 2P", "Silkscreen", "DotGothic16", "Zpix", "Fusion Pixel",
             "Minecraft", "Consolas", "Courier New", "Microsoft YaHei", monospace;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html, body {
  margin: 0; padding: 0; min-height: 100%;
  font-family: "Microsoft YaHei", "PingFang SC", "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--sky3);
  overflow-x: hidden;
  -webkit-font-smoothing: none;
  font-smooth: never;
  image-rendering: pixelated;
}

button, input, select { font-family: inherit; }
button { cursor: pointer; }

/* 所有方块统一用"外描边 + 内高光"制造像素 3D 感 */
.block {
  border: 4px solid #7A5C3E;
  box-shadow:
    inset -4px -4px 0 0 rgba(0,0,0,.18),
    inset  4px  4px 0 0 rgba(255,255,255,.55),
    6px 6px 0 0 rgba(60,40,20,.28);
}

/* ═══════════ 像素天空背景 ═══════════ */
.px-sky { position: fixed; inset: 0; z-index: 0; overflow: hidden; pointer-events: none; }
.px-sky { background: linear-gradient(180deg, var(--sky1) 0%, var(--sky2) 46%, var(--sky3) 74%, #F3FBE8 100%); }

.px-sun {
  position: absolute; top: 26px; right: 40px; width: 96px; height: 96px;
  background: var(--gold);
  box-shadow:
    0 -16px 0 0 var(--gold),  0 16px 0 0 var(--gold),
    -16px 0 0 0 var(--gold), 16px 0 0 0 var(--gold),
    0 0 0 16px var(--gold);
  box-shadow:
    -16px 0 0 -4px var(--gold-2), 16px 0 0 -4px var(--gold-2),
    0 -16px 0 -4px var(--gold-2), 0 16px 0 -4px var(--gold-2),
    0 0 0 18px rgba(245,185,66,.4);
  animation: sunBlink 3.2s steps(2, end) infinite;
}
@keyframes sunBlink { 0%,100% { transform: scale(1); } 50% { transform: scale(1.07); } }

/* 像素云：用方块的组合做出阶梯轮廓 */
.px-cloud {
  position: absolute; background: #FFFFFF;
  box-shadow:
    0 -14px 0 0 #FFFFFF,
    -14px 0 0 0 #FFFFFF,
    14px 0 0 0 #FFFFFF,
    0 0 0 14px #FFFFFF;
  opacity: .92;
}
.c1 { width: 56px; height: 28px; top: 12%; left: -140px; animation: drift 54s linear infinite; }
.c2 { width: 40px; height: 20px; top: 25%; left: -120px; animation: drift 74s linear infinite 9s; }
.c3 { width: 72px; height: 32px; top: 5%;  left: -180px; animation: drift 92s linear infinite 22s; }
@keyframes drift { to { transform: translateX(calc(100vw + 260px)); } }

/* 像素山丘：用 repeating 阶梯模拟 */
.px-hill {
  position: absolute; bottom: 128px; background: #7FCB57;
  box-shadow:
    0 -18px 0 0 #7FCB57,
    0 -36px 0 0 #8ED863,
    inset -6px -6px 0 0 rgba(0,0,0,.10),
    inset  6px  6px 0 0 rgba(255,255,255,.22);
}
.h1 { width: 46%; height: 92px; left: -4%; }
.h2 { width: 38%; height: 68px; left: 54%; background: #74C24E; box-shadow: 0 -18px 0 0 #74C24E, inset -6px -6px 0 0 rgba(0,0,0,.10), inset 6px 6px 0 0 rgba(255,255,255,.2); }

/* 像素地面 */
.px-ground {
  position: absolute; bottom: 0; left: 0; right: 0; height: 132px;
  background: linear-gradient(180deg, var(--grass1) 0 26px, var(--grass2) 26px 30px, var(--dirt) 30px 100%);
  box-shadow: inset 0 6px 0 0 rgba(255,255,255,.22);
}
.px-ground::after {
  content: ""; position: absolute; inset: 40px 0 auto 0; height: 92px;
  background-image:
    linear-gradient(90deg, rgba(139,94,59,.55) 2px, transparent 2px),
    linear-gradient(180deg, rgba(139,94,59,.55) 2px, transparent 2px),
    linear-gradient(90deg, rgba(255,255,255,.12) 30px, transparent 30px);
  background-size: 30px 30px, 30px 30px, 30px 30px;
  background-position: 4px 6px, 4px 6px, 0 0;
}

/* 像素树 */
.px-tree { position: absolute; bottom: 118px; }
.px-tree::before {           /* 树冠 */
  content: ""; position: absolute; left: -30px; bottom: 46px;
  width: 60px; height: 46px; background: #4E9E33;
  box-shadow: 0 -14px 0 0 #5CB03C, -14px 0 0 0 #4E9E33, 14px 0 0 0 #4E9E33;
}
.px-tree::after {            /* 树干 */
  content: ""; position: absolute; left: -8px; bottom: 0;
  width: 16px; height: 50px; background: var(--dirt2);
  box-shadow: inset -5px 0 0 0 rgba(0,0,0,.22);
}
.t1 { left: 4%; }
.t2 { left: 88%; }

/* ═══════════ 顶栏 ═══════════ */
.topbar {
  position: relative; z-index: 5;
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  padding: 12px 22px;
  background: var(--wood1);
  border-bottom: 6px solid #8B5E3B;
  box-shadow: inset 0 -6px 0 0 rgba(0,0,0,.10), 0 6px 0 0 rgba(60,40,20,.18);
}
.brand { display: flex; align-items: center; gap: 12px; }

/* 像素方块 logo（3x3 颜色网格） */
.brand-logo {
  display: grid; grid-template-columns: repeat(3, 8px); grid-template-rows: repeat(3, 8px);
  gap: 0; border: 4px solid #7A5C3E;
  box-shadow: 4px 4px 0 0 rgba(60,40,20,.3);
}
.bl-px:nth-child(1) { background: var(--red); }
.bl-px:nth-child(2) { background: var(--gold); }
.bl-px:nth-child(3) { background: var(--emerald); }
.bl-px:nth-child(4) { background: var(--diamond); }
.bl-px:nth-child(5) { background: var(--lapis); }
.bl-px:nth-child(6) { background: var(--amethyst); }
.bl-px:nth-child(7) { background: var(--red-2); }
.bl-px:nth-child(8) { background: var(--emerald-2); }
.bl-px:nth-child(9) { background: var(--gold-2); }
.brand-logo { animation: logoSpin 4s steps(8, end) infinite; }
@keyframes logoSpin { 0%,88%,100% { transform: rotate(0); } 94% { transform: rotate(-6deg); } }

.brand-text h1 {
  margin: 0; font-size: 21px; letter-spacing: 1px; color: var(--red-deep);
  text-shadow: 2px 2px 0 #FFFFFF, 3px 3px 0 rgba(140,60,20,.35);
}
.brand-text p { margin: 3px 0 0; font-size: 11.5px; color: var(--ink-soft); letter-spacing: .5px; }

.topbar-right { display: flex; align-items: center; gap: 9px; }
.stat-pill {
  display: flex; align-items: center; gap: 7px;
  background: var(--gold); border: 4px solid #7A5C3E;
  padding: 5px 13px; font-weight: 700; font-size: 15px; color: #4A2F05;
  box-shadow: inset -3px -3px 0 0 rgba(0,0,0,.2), inset 3px 3px 0 0 rgba(255,255,255,.5), 4px 4px 0 0 rgba(60,40,20,.3);
}
.stat-pill.fire { background: var(--red-2); color: #FFF3E0; }
.stat-ico { font-size: 15px; }

.icon-btn {
  width: 42px; height: 42px; border: 4px solid #7A5C3E; background: #FFF8E7;
  font-size: 18px; color: var(--ink);
  box-shadow: inset -3px -3px 0 0 rgba(0,0,0,.16), inset 3px 3px 0 0 rgba(255,255,255,.7), 4px 4px 0 0 rgba(60,40,20,.3);
  transition: transform .08s steps(2);
}
.icon-btn:hover { transform: translate(-2px, -2px); }
.icon-btn:active { transform: translate(2px, 2px); box-shadow: inset 3px 3px 0 0 rgba(0,0,0,.2); }

/* ═══════════ 布局 ═══════════ */
.stage {
  position: relative; z-index: 4;
  display: grid; grid-template-columns: 296px minmax(440px, 1fr) 272px;
  gap: 16px; padding: 16px 22px 60px; max-width: 1500px; margin: 0 auto; align-items: start;
}
@media (max-width: 1200px) {
  .stage { grid-template-columns: 1fr; }
  .side-panel { order: 3; }
}
@media (max-width: 760px) {
  .topbar { flex-wrap: wrap; padding: 10px 12px; }
  .stage { padding: 12px 10px 40px; }
  .brand-text h1 { font-size: 16px; }
  .tabs { flex-wrap: wrap; }
}

.panel {
  background: var(--wood1);
  border: 5px solid #7A5C3E;
  padding: 16px;
  box-shadow:
    inset -5px -5px 0 0 rgba(0,0,0,.10),
    inset  5px  5px 0 0 rgba(255,255,255,.5),
    7px 7px 0 0 rgba(60,40,20,.26);
}

/* ═══════════ 红狼老师面板 ═══════════ */
.buddy-panel { display: flex; flex-direction: column; align-items: center; gap: 12px; position: sticky; top: 86px; }

.buddy-wrap { position: relative; width: 100%; display: grid; place-items: center; }

.speech-pop {
  position: absolute; top: -4px; left: 50%; transform: translateX(-50%);
  background: #FFF; border: 4px solid var(--amethyst); padding: 7px 13px;
  font-size: 12.5px; font-weight: 700; color: var(--amethyst-2); white-space: nowrap;
  box-shadow: 4px 4px 0 0 rgba(60,40,20,.25); z-index: 6; animation: popIn .22s steps(3);
}
@keyframes popIn { from { transform: translateX(-50%) scale(.8); opacity: 0; } to { transform: translateX(-50%) scale(1); opacity: 1; } }

.buddy { position: relative; animation: wolfIdle 3.6s steps(4, end) infinite; }
@keyframes wolfIdle { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }

.wolf-svg { width: 208px; height: 208px; display: block; }

.buddy-name {
  position: absolute; bottom: -6px; left: 50%; transform: translateX(-50%);
  background: var(--red); color: #FFF3E0; font-size: 13px; font-weight: 700;
  padding: 4px 14px; border: 3px solid var(--red-deep); white-space: nowrap;
  box-shadow: 3px 3px 0 0 rgba(60,40,20,.3);
}
.lvl-tag {
  position: absolute; top: 2px; right: -6px;
  background: var(--gold); color: #4A2F05; font-size: 11px; font-weight: 700;
  padding: 3px 8px; border: 3px solid #7A5C3E; box-shadow: 2px 2px 0 0 rgba(60,40,20,.3);
}

/* 状态动画 */
.buddy.thinking .wolf-svg { animation: tShake .7s steps(2, end) infinite; }
@keyframes tShake { 0%,100% { transform: rotate(-1.5deg); } 50% { transform: rotate(1.5deg); } }
.buddy.thinking .eyes { animation: blink 1.1s steps(2, end) infinite; }
@keyframes blink { 0%,88%,100% { opacity: 1; } 92% { opacity: .15; } }

/* 说话：嘴巴方块上下张合 + 尾巴摇 */
.buddy.speaking .mouth { animation: mouthTalk .3s steps(2, end) infinite; }
@keyframes mouthTalk { 0%,100% { height: 2px; y: 22; } 50% { height: 4px; y: 21; } }
.buddy.speaking .tongue { animation: tongueTalk .3s steps(2, end) infinite; }
@keyframes tongueTalk { 0%,100% { opacity: 0; } 50% { opacity: 1; } }
.buddy.speaking .wolf-svg { animation: nuzzle .6s steps(3, end) infinite; }
@keyframes nuzzle { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-4px); } }

.buddy.listening .ears { animation: earPerk .8s steps(2, end) infinite; }
@keyframes earPerk { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-2px); } }

.wave-ring {
  position: absolute; width: 170px; height: 170px; border: 5px solid var(--red-2); opacity: 0; pointer-events: none;
}
.wave-ring.on { animation: ringPx 1.1s steps(4, end) infinite; }
@keyframes ringPx {
  0% { transform: scale(.72); opacity: .8; }
  100% { transform: scale(1.5); opacity: 0; }
}

/* 老师说的话（情绪价值区） */
.teacher-say {
  width: 100%; background: #FFFDF5; border: 4px solid var(--gold-2);
  padding: 10px 12px; box-shadow: inset -3px -3px 0 0 rgba(0,0,0,.06), 4px 4px 0 0 rgba(60,40,20,.18);
}
.ts-label { font-size: 11px; font-weight: 700; color: var(--gold-2); letter-spacing: 1px; margin-bottom: 5px; }
.ts-text { font-size: 13.5px; line-height: 1.65; color: var(--ink); min-height: 44px; }

.meter { width: 100%; }
.meter-label { font-size: 12px; font-weight: 700; color: var(--ink-soft); }
.meter-bar {
  height: 16px; background: #E8DCC4; border: 3px solid #7A5C3E; overflow: hidden; margin-top: 5px;
  box-shadow: inset 2px 2px 0 0 rgba(0,0,0,.12);
}
.meter-bar i {
  display: block; height: 100%; width: 0%;
  background: repeating-linear-gradient(90deg, var(--emerald) 0 6px, #5CC26B 6px 12px);
  transition: width .08s steps(4);
}

.status-line {
  width: 100%; text-align: center; font-size: 13px; font-weight: 700; color: var(--ink-soft);
  background: #FFFDF5; border: 3px solid var(--line); padding: 9px 10px; line-height: 1.5;
  min-height: 42px; display: grid; place-items: center;
}

.quiz-info { width: 100%; background: #EFE8FF; border: 3px solid var(--amethyst); padding: 9px 13px; }
.quiz-info-row { display: flex; justify-content: space-between; font-size: 13.5px; padding: 3px 0; color: var(--ink); }
.quiz-info-row b { color: var(--amethyst-2); }

/* ═══════════ 中间能力面板 ═══════════ */
.chat-panel { display: flex; flex-direction: column; min-height: 640px; padding: 0; overflow: hidden; }

.chat-head {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 13px 14px; background: var(--wood2); border-bottom: 5px solid #7A5C3E; flex-wrap: wrap;
}
.tabs { display: flex; gap: 7px; }
.tab {
  border: 4px solid #7A5C3E; background: #FFF8E7; color: var(--ink-soft);
  padding: 8px 13px; font-size: 14px; font-weight: 700;
  box-shadow: inset -3px -3px 0 0 rgba(0,0,0,.14), inset 3px 3px 0 0 rgba(255,255,255,.7), 4px 4px 0 0 rgba(60,40,20,.26);
  transition: transform .1s steps(2);
}
.tab i { font-style: normal; margin-right: 3px; }
.tab:hover { transform: translate(-1px, -1px); }
.tab:active { transform: translate(2px, 2px); }
.tab.active {
  background: var(--emerald); color: #FFFFFF; border-color: var(--emerald-2);
  box-shadow: inset -3px -3px 0 0 rgba(0,0,0,.22), inset 3px 3px 0 0 rgba(255,255,255,.35), 4px 4px 0 0 rgba(60,40,20,.3);
}
.topic-chip {
  font-size: 12px; font-weight: 700; color: var(--amethyst-2);
  background: #EFE8FF; border: 3px solid var(--amethyst); padding: 5px 11px;
}

.chat-body { flex: 1; overflow-y: auto; padding: 16px; background: #FDFAF0; }
.chat-body::-webkit-scrollbar { width: 14px; }
.chat-body::-webkit-scrollbar-track { background: #E8DCC4; }
.chat-body::-webkit-scrollbar-thumb {
  background: var(--dirt); border: 3px solid #E8DCC4;
}
.view-hidden { display: none !important; }

.msg-list { display: flex; flex-direction: column; gap: 14px; }

.msg { display: flex; gap: 9px; align-items: flex-end; animation: msgIn .2s steps(4); }
@keyframes msgIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.msg.me { flex-direction: row-reverse; }

.msg-avatar {
  width: 42px; height: 42px; display: grid; place-items: center; font-size: 20px; flex: 0 0 auto;
  border: 4px solid #7A5C3E; background: #FFF8E7;
  box-shadow: inset -3px -3px 0 0 rgba(0,0,0,.14), inset 3px 3px 0 0 rgba(255,255,255,.7), 3px 3px 0 0 rgba(60,40,20,.26);
}
.msg.ai .msg-avatar { background: #FFE0D0; }
.msg.me .msg-avatar { background: #D6E8FF; }

.bubble {
  max-width: min(560px, 76%); background: #FFFFFF; border: 4px solid #7A5C3E;
  padding: 11px 14px; font-size: 15.5px; line-height: 1.65;
  box-shadow: inset -3px -3px 0 0 rgba(0,0,0,.06), 4px 4px 0 0 rgba(60,40,20,.22);
  word-break: break-word;
}
.msg.ai .bubble { background: #FFFDF5; }
.msg.me .bubble { background: #EAF4FF; }
.bubble .msg-content { white-space: pre-wrap; }

.bubble-actions { display: flex; gap: 6px; margin-top: 9px; flex-wrap: wrap; }
.bubble-actions button {
  border: 3px solid #7A5C3E; background: #FFF8E7; font-size: 12px; padding: 4px 10px;
  font-weight: 700; color: var(--ink-soft);
  box-shadow: inset -2px -2px 0 0 rgba(0,0,0,.12), inset 2px 2px 0 0 rgba(255,255,255,.7), 3px 3px 0 0 rgba(60,40,20,.22);
  transition: transform .08s steps(2);
}
.bubble-actions button:hover { transform: translate(-1px, -1px); color: var(--red); border-color: var(--red); }
.bubble-actions button:active { transform: translate(2px, 2px); }

.typing { display: inline-flex; gap: 5px; padding: 3px 2px; }
.typing i {
  width: 9px; height: 9px; background: var(--gold);
  animation: typePx 1s steps(2, end) infinite;
}
.typing i:nth-child(2) { animation-delay: .16s; background: var(--red-2); }
.typing i:nth-child(3) { animation-delay: .32s; background: var(--emerald); }
@keyframes typePx { 0%,80%,100% { opacity: .35; } 40% { opacity: 1; } }

.heard { opacity: .7; font-style: italic; }

/* ═══════════ 评分卡（说 / 作文） ═══════════ */
.eval-shell { max-width: 96%; }

.eval-card {
  background: #FFFDF5; border: 4px solid var(--gold-2); padding: 13px;
  box-shadow: inset -3px -3px 0 0 rgba(0,0,0,.06), 4px 4px 0 0 rgba(60,40,20,.22);
}
/* 情绪价值：最上方的大鼓励条 */
.warm-bar {
  display: flex; align-items: flex-start; gap: 9px; background: #FFF2D6;
  border: 3px solid var(--gold); padding: 10px 12px; margin-bottom: 11px;
}
.warm-bar .wb-ico { font-size: 20px; line-height: 1.2; }
.warm-bar .wb-txt { font-size: 14px; font-weight: 700; line-height: 1.55; color: #7A5210; }

.eval-top { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; flex-wrap: wrap; }
.eval-score {
  min-width: 66px; height: 66px; display: grid; place-items: center;
  font-size: 23px; font-weight: 800; color: #FFF;
  background: var(--emerald); border: 4px solid var(--emerald-2);
  box-shadow: inset -3px -3px 0 0 rgba(0,0,0,.2), inset 3px 3px 0 0 rgba(255,255,255,.3), 4px 4px 0 0 rgba(60,40,20,.24);
}
.eval-score.mid { background: var(--gold); border-color: var(--gold-2); color: #4A2F05; }
.eval-score.low { background: var(--red-2); border-color: var(--red-deep); }
.eval-stars { font-size: 19px; letter-spacing: 3px; color: var(--gold); }
.eval-level { font-size: 15px; font-weight: 800; color: var(--red-deep); }

.words-row { display: flex; flex-wrap: wrap; gap: 7px; margin: 10px 0; }
.word-chip {
  padding: 6px 11px; font-size: 13.5px; font-weight: 700; border: 3px solid;
  box-shadow: inset -2px -2px 0 0 rgba(0,0,0,.08), 2px 2px 0 0 rgba(60,40,20,.16);
}
.word-chip.good { background: #E3F7E6; color: #1F7A2E; border-color: var(--emerald); }
.word-chip.fuzzy { background: #FFF2D6; color: #8A5A00; border-color: var(--gold-2); }
.word-chip.missing { background: #FFE6E0; color: #A83A18; border-color: var(--red-2); }
.word-chip small { display: block; font-size: 11px; font-weight: 600; opacity: .85; margin-top: 2px; }

.tips-list { margin: 9px 0 0; padding: 0; list-style: none; }
.tips-list li {
  font-size: 13.5px; background: #FFFFFF; border: 3px solid #E8DCC4;
  padding: 8px 11px; margin-bottom: 6px; line-height: 1.55; color: #6B5A2A;
}
.grammar-row {
  font-size: 13.5px; background: #FFFFFF; border: 3px solid #E8DCC4;
  padding: 9px 11px; margin-top: 6px; line-height: 1.6;
}
.grammar-row s { color: #C0392B; }
.grammar-row b { color: #1F7A2E; }

.section-label {
  font-size: 12px; font-weight: 800; color: var(--ink-soft); letter-spacing: 1px;
  margin: 12px 0 6px; padding-left: 8px; border-left: 4px solid var(--gold);
}

/* 作文批改专用 */
.good-point {
  background: #E3F7E6; border: 3px solid var(--emerald); padding: 9px 11px; margin-bottom: 7px;
  font-size: 13.5px; line-height: 1.6;
}
.good-point .gp-en { display: block; color: #1F7A2E; font-weight: 700; margin-top: 4px; font-size: 13px; }
.better-word {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  background: #FFF2D6; border: 3px solid var(--gold); padding: 8px 11px; margin-bottom: 7px; font-size: 13.5px;
}
.better-word .bw-from { color: #8A5A00; }
.better-word .bw-to { color: var(--emerald-2); font-weight: 800; }
.polished-box {
  background: #EAF4FF; border: 4px solid var(--lapis); padding: 11px 13px; font-size: 14.5px;
  line-height: 1.7; color: #1B3A66;
}
.polished-box .pb-en { font-weight: 700; }
.polished-box .pb-cn { display: block; font-size: 13px; color: #4A6A96; margin-top: 6px; }

.encourage-box {
  margin-top: 12px; background: linear-gradient(180deg, #FFF7E0, #FFECBF);
  border: 4px solid var(--gold-2); padding: 11px 13px;
  font-size: 14px; font-weight: 700; color: #7A5210; line-height: 1.6;
  display: flex; gap: 9px; align-items: flex-start;
}

/* ═══════════ 任务卡（听力/笔试/阅读/作文共用） ═══════════ */
.task-card { max-width: 700px; margin: 0 auto; }
.task-start { text-align: center; padding: 18px 8px; }
.task-title { font-size: 21px; margin: 0 0 6px; color: var(--red-deep); letter-spacing: 1px; }
.task-sub { color: var(--ink-soft); font-size: 13.5px; margin: 0 0 18px; line-height: 1.6; }

/* 老师开场语（每个任务卡顶部都有情绪价值） */
.task-warm {
  display: flex; gap: 10px; align-items: flex-start; text-align: left;
  background: #FFF2D6; border: 4px solid var(--gold); padding: 11px 13px; margin-bottom: 16px;
}
.task-warm .tw-ico { font-size: 22px; }
.task-warm .tw-txt { font-size: 14px; font-weight: 700; line-height: 1.6; color: #7A5210; }

/* 像素风大按钮 */
.px-btn {
  border: 4px solid #7A5C3E; background: var(--emerald); color: #FFFFFF;
  padding: 13px 28px; font-size: 15.5px; font-weight: 800; letter-spacing: 1px;
  box-shadow: inset -4px -4px 0 0 rgba(0,0,0,.22), inset 4px 4px 0 0 rgba(255,255,255,.35), 6px 6px 0 0 rgba(60,40,20,.3);
  transition: transform .09s steps(2);
}
.px-btn:hover { transform: translate(-2px, -2px); }
.px-btn:active { transform: translate(3px, 3px); box-shadow: inset 4px 4px 0 0 rgba(0,0,0,.25); }
.px-btn:disabled { opacity: .55; cursor: wait; transform: none; }
.px-btn.gold { background: var(--gold); color: #4A2F05; }
.px-btn.red { background: var(--red-2); }
.px-btn.lapis { background: var(--lapis); }
.px-btn.small { padding: 9px 18px; font-size: 13.5px; }

/* 话题选择 */
.topic-pick { display: flex; flex-wrap: wrap; gap: 9px; justify-content: center; margin-bottom: 20px; }
.topic-opt {
  border: 4px solid #7A5C3E; background: #FFF8E7; padding: 10px 16px;
  font-size: 14px; font-weight: 700; color: var(--ink-soft);
  box-shadow: inset -3px -3px 0 0 rgba(0,0,0,.12), inset 3px 3px 0 0 rgba(255,255,255,.7), 4px 4px 0 0 rgba(60,40,20,.24);
  transition: transform .09s steps(2);
}
.topic-opt:hover { transform: translate(-2px, -2px); }
.topic-opt.sel { background: var(--amethyst); color: #FFF; border-color: var(--amethyst-2); }

/* 题干 */
.q-scene { font-size: 46px; text-align: center; margin: 4px 0 10px; }
.q-stem {
  font-size: 22px; font-weight: 800; text-align: center; line-height: 1.6;
  margin-bottom: 16px; color: var(--ink); letter-spacing: .5px;
}
.q-stem .blank { color: var(--red); border-bottom: 5px solid var(--gold); padding: 0 8px; }

.q-hint {
  text-align: center; font-size: 13.5px; color: #8A5A00;
  background: #FFF2D6; border: 3px dashed var(--gold-2); padding: 9px 12px; margin-top: 13px;
  line-height: 1.55;
}

/* 选项 */
.opt-list { display: grid; grid-template-columns: 1fr 1fr; gap: 11px; }
.opt-btn {
  border: 4px solid #7A5C3E; background: #FFFFFF; padding: 14px 12px;
  font-size: 17px; font-weight: 800; color: var(--ink); text-align: left;
  box-shadow: inset -4px -4px 0 0 rgba(0,0,0,.10), inset 4px 4px 0 0 rgba(255,255,255,.85), 5px 5px 0 0 rgba(60,40,20,.24);
  transition: transform .09s steps(2);
  display: flex; align-items: center; gap: 10px;
}
.opt-btn .opt-key {
  display: grid; place-items: center; width: 26px; height: 26px; flex: 0 0 auto;
  background: var(--wood2); border: 3px solid #7A5C3E; font-size: 13px; color: var(--ink-soft);
}
.opt-btn:hover:not(:disabled) { transform: translate(-2px, -2px); border-color: var(--lapis); }
.opt-btn:disabled { cursor: default; }
.opt-btn.right { background: #E3F7E6; border-color: var(--emerald-2); color: #1F7A2E; }
.opt-btn.right .opt-key { background: var(--emerald); color: #FFF; border-color: var(--emerald-2); }
.opt-btn.wrong { background: #FFE6E0; border-color: var(--red-2); color: #A83A18; }
.opt-btn.wrong .opt-key { background: var(--red-2); color: #FFF; border-color: var(--red-deep); }
@keyframes shkPx { 0%,100% { transform: translateX(0); } 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }
.opt-btn.wrong { animation: shkPx .3s steps(3); }

/* 解析区 */
.explain-box {
  margin-top: 15px; background: #FFFFFF; border: 4px solid var(--emerald);
  padding: 12px 14px; line-height: 1.7; font-size: 14px;
  box-shadow: inset -3px -3px 0 0 rgba(0,0,0,.05), 4px 4px 0 0 rgba(60,40,20,.18);
  animation: msgIn .2s steps(4);
}
.explain-box.bad { border-color: var(--gold-2); }
.explain-box .ex-title { font-weight: 800; font-size: 14.5px; margin-bottom: 6px; color: var(--emerald-2); }
.explain-box.bad .ex-title { color: var(--gold-2); }
.explain-box .ex-where {
  margin-top: 7px; padding: 7px 10px; background: #EAF4FF; border-left: 5px solid var(--lapis);
  font-size: 13px; color: #1B3A66;
}
.explain-box .ex-read { display: flex; align-items: center; gap: 9px; margin-top: 9px; flex-wrap: wrap; }
.explain-box .ex-read span { font-size: 13px; color: var(--ink-soft); }

.task-actions { display: flex; justify-content: center; gap: 11px; margin-top: 18px; flex-wrap: wrap; }

/* ═══════════ 听力专用 ═══════════ */
.listen-player {
  display: flex; flex-direction: column; align-items: center; gap: 12px;
  background: #EAF4FF; border: 4px solid var(--lapis); padding: 20px 16px; margin-bottom: 16px;
  box-shadow: inset -3px -3px 0 0 rgba(0,0,0,.06), 4px 4px 0 0 rgba(60,40,20,.2);
}
.listen-visual { display: flex; align-items: flex-end; gap: 5px; height: 56px; }
.listen-visual i {
  width: 9px; background: var(--lapis); display: block; height: 12px;
}
.listen-visual.playing i { animation: vuPx .55s steps(3, end) infinite; }
.listen-visual.playing i:nth-child(1) { animation-delay: 0s; }
.listen-visual.playing i:nth-child(2) { animation-delay: .07s; }
.listen-visual.playing i:nth-child(3) { animation-delay: .14s; }
.listen-visual.playing i:nth-child(4) { animation-delay: .21s; }
.listen-visual.playing i:nth-child(5) { animation-delay: .28s; }
.listen-visual.playing i:nth-child(6) { animation-delay: .35s; }
.listen-visual.playing i:nth-child(7) { animation-delay: .42s; }
@keyframes vuPx { 0%,100% { height: 10px; } 50% { height: 50px; } }
.listen-tip { font-size: 13px; color: #1B3A66; font-weight: 700; text-align: center; }
.listen-count {
  font-size: 12px; color: var(--ink-soft); background: #FFF8E7;
  border: 3px solid var(--line); padding: 4px 10px;
}

/* ═══════════ 阅读专用 ═══════════ */
.story-box {
  background: #FFFDF5; border: 4px solid var(--stone); padding: 15px 17px; margin-bottom: 15px;
  box-shadow: inset -3px -3px 0 0 rgba(0,0,0,.05), 4px 4px 0 0 rgba(60,40,20,.18);
}
.story-box .story-title {
  font-size: 18px; font-weight: 800; color: var(--red-deep); margin-bottom: 3px;
}
.story-box .story-title-cn { font-size: 12.5px; color: var(--ink-soft); margin-bottom: 11px; }
.story-en { font-size: 17px; line-height: 2; color: var(--ink); font-weight: 600; }
.story-en .word-hot { color: var(--red); border-bottom: 3px solid var(--gold); cursor: help; }
.story-cn {
  margin-top: 12px; padding-top: 11px; border-top: 3px dashed #E8DCC4;
  font-size: 13.5px; line-height: 1.85; color: var(--ink-soft);
}
.story-tools { display: flex; gap: 9px; margin-top: 12px; flex-wrap: wrap; }

.new-words { margin-bottom: 15px; }
.new-word {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  background: #EFE8FF; border: 3px solid var(--amethyst); padding: 9px 12px; margin-bottom: 7px;
  font-size: 13.5px;
}
.new-word b { color: var(--amethyst-2); font-size: 15px; }
.new-word .nw-ph { color: var(--ink-soft); font-size: 12.5px; }
.new-word .nw-note { width: 100%; color: #5A4A8A; font-size: 12.5px; }

/* ═══════════ 作文专用 ═══════════ */
.writing-prompts { display: flex; flex-wrap: wrap; gap: 9px; justify-content: center; margin-bottom: 16px; }
.write-area {
  width: 100%; min-height: 150px; background: #FFFFFF;
  border: 4px solid #7A5C3E; padding: 13px 15px; font-size: 15.5px; line-height: 1.9;
  resize: vertical; outline: none; color: var(--ink);
  box-shadow: inset 3px 3px 0 0 rgba(0,0,0,.06);
  font-family: "Consolas", "Courier New", monospace;
  background-image: repeating-linear-gradient(180deg, transparent 0 30px, #E8DCC4 30px 31px);
}
.write-area:focus { border-color: var(--lapis); }
.write-meta { display: flex; justify-content: space-between; align-items: center; margin-top: 8px; flex-wrap: wrap; gap: 8px; }
.write-count { font-size: 12.5px; color: var(--ink-soft); font-weight: 700; }
.write-help {
  font-size: 13px; line-height: 1.7; color: #1B3A66; background: #EAF4FF;
  border: 3px solid var(--lapis); padding: 10px 12px; margin-top: 12px;
}

/* ═══════════ 右侧面板 ═══════════ */
.side-panel { position: sticky; top: 86px; display: flex; flex-direction: column; gap: 9px; }
.side-title {
  font-size: 13.5px; margin: 5px 0 1px; color: var(--red-deep);
  letter-spacing: 1px; font-weight: 800;
}

.achieve-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; }
.ach {
  aspect-ratio: 1; display: grid; place-items: center; gap: 2px; padding: 4px;
  background: #EFE7D6; border: 3px solid var(--line); text-align: center;
  font-size: 9.5px; font-weight: 700; color: #A89880; line-height: 1.2;
  transition: all .2s steps(3);
}
.ach.on {
  background: #FFF2D6; border-color: var(--gold-2); color: #7A5210;
  box-shadow: inset -3px -3px 0 0 rgba(0,0,0,.08), 3px 3px 0 0 rgba(60,40,20,.2);
}
.ach .ach-ico { font-size: 20px; filter: grayscale(1); opacity: .4; }
.ach.on .ach-ico { filter: none; opacity: 1; }

.word-box { display: flex; gap: 7px; }
.word-box input {
  flex: 1; min-width: 0; border: 4px solid #7A5C3E; padding: 9px 11px; font-size: 13.5px;
  outline: none; background: #FFFDF5;
}
.word-box input:focus { border-color: var(--amethyst); }
.btn-mini {
  border: 4px solid var(--amethyst-2); background: var(--amethyst); color: #FFF;
  padding: 0 14px; font-size: 13.5px; font-weight: 800;
  box-shadow: inset -3px -3px 0 0 rgba(0,0,0,.2), inset 3px 3px 0 0 rgba(255,255,255,.3), 3px 3px 0 0 rgba(60,40,20,.24);
}
.word-result {
  background: #EFE8FF; border: 4px solid var(--amethyst); padding: 12px;
  font-size: 13.5px; line-height: 1.7; animation: msgIn .2s steps(4);
}
.wr-head { display: flex; align-items: center; gap: 8px; font-size: 17px; font-weight: 800; color: var(--amethyst-2); }
.wr-ph { font-size: 12.5px; color: var(--ink-soft); font-weight: 600; }
.wr-en { font-weight: 700; margin-top: 6px; color: var(--ink); }
.wr-cn { color: var(--ink-soft); }
.wr-tip { margin-top: 7px; background: #FFF; border: 3px solid #D9CCF5; padding: 7px 9px; }

.setting-row { display: flex; align-items: center; justify-content: space-between; gap: 9px; font-size: 13px; }
.setting-row label { font-weight: 700; color: var(--ink-soft); }
.setting-row select {
  border: 4px solid #7A5C3E; padding: 6px 8px; font-size: 12.5px; background: #FFFDF5;
  outline: none; max-width: 158px; color: var(--ink);
}
.setting-row input[type=range] { max-width: 124px; accent-color: var(--emerald); }
.switch { width: 42px; height: 24px; accent-color: var(--emerald); }

/* ═══════════ 输入区 ═══════════ */
.composer {
  display: flex; align-items: center; gap: 9px; padding: 11px 14px;
  background: var(--wood2); border-top: 5px solid #7A5C3E; flex-wrap: wrap;
}
.composer-hint {
  width: 100%; font-size: 12.5px; font-weight: 700; color: #8A5A00;
  background: #FFF2D6; border: 3px solid var(--gold); padding: 6px 10px;
  line-height: 1.5; display: none;
}
.composer-hint.show { display: block; }

#textInput {
  flex: 1; min-width: 150px; border: 4px solid #7A5C3E; padding: 12px 16px;
  font-size: 15px; outline: none; background: #FFFDF5; color: var(--ink);
  box-shadow: inset 3px 3px 0 0 rgba(0,0,0,.06);
}
#textInput:focus { border-color: var(--lapis); }

.send-btn {
  width: 48px; height: 48px; flex: 0 0 auto; border: 4px solid var(--lapis-2);
  background: var(--lapis); color: #FFF; font-size: 18px;
  box-shadow: inset -3px -3px 0 0 rgba(0,0,0,.22), inset 3px 3px 0 0 rgba(255,255,255,.3), 4px 4px 0 0 rgba(60,40,20,.28);
  transition: transform .09s steps(2);
}
.send-btn:hover { transform: translate(-2px, -2px); }
.send-btn:active { transform: translate(2px, 2px); }

.mic-btn {
  position: relative; width: 64px; height: 64px; flex: 0 0 auto;
  border: 4px solid var(--red-deep); background: var(--red-2); color: #FFF; font-size: 25px;
  box-shadow: inset -4px -4px 0 0 rgba(0,0,0,.24), inset 4px 4px 0 0 rgba(255,255,255,.3), 5px 5px 0 0 rgba(60,40,20,.3);
  transition: transform .09s steps(2);
}
.mic-btn:hover { transform: translate(-2px, -2px); }
.mic-btn:active { transform: translate(3px, 3px); }
.mic-btn.recording { background: var(--emerald); border-color: var(--emerald-2); animation: micBeat .8s steps(2, end) infinite; }
@keyframes micBeat { 0%,100% { transform: scale(1); } 50% { transform: scale(1.07); } }
.mic-pulse { position: absolute; inset: -6px; border: 4px solid var(--red-2); opacity: 0; pointer-events: none; }
.mic-btn.recording .mic-pulse { border-color: var(--emerald); animation: ringPx 1.05s steps(4, end) infinite; }

/* ═══════════ 弹窗 ═══════════ */
.modal-mask {
  position: fixed; inset: 0; z-index: 50; display: grid; place-items: center;
  background: rgba(40, 30, 20, .48); padding: 20px;
}
.modal {
  background: var(--wood1); border: 6px solid #7A5C3E; padding: 24px;
  width: min(450px, 100%);
  box-shadow: inset -5px -5px 0 0 rgba(0,0,0,.1), inset 5px 5px 0 0 rgba(255,255,255,.5), 10px 10px 0 0 rgba(40,25,10,.4);
  animation: popIn2 .2s steps(3);
}
@keyframes popIn2 { from { transform: scale(.92); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.modal-wide { width: min(640px, 100%); }
.modal h2 { margin: 0 0 8px; font-size: 19px; color: var(--red-deep); letter-spacing: 1px; }
.modal-tip { font-size: 12.5px; color: var(--ink-soft); margin: 0 0 15px; line-height: 1.65; }
.modal input[type=password], .modal input[type=text] {
  width: 100%; border: 4px solid #7A5C3E; padding: 12px 14px; font-size: 14.5px;
  outline: none; margin-bottom: 12px; background: #FFFDF5; color: var(--ink);
}
.modal input:focus { border-color: var(--lapis); }
.mini-label { display: block; font-size: 12px; font-weight: 700; color: var(--ink-soft); margin-bottom: 6px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 9px; margin-top: 9px; }
.key-state { font-size: 12.5px; margin-top: 11px; font-weight: 700; line-height: 1.5; }

.help-list { padding-left: 20px; font-size: 14px; line-height: 1.9; }
.help-list b { color: var(--red); }
.help-note {
  font-size: 13px; color: #1B3A66; background: #EAF4FF; border: 4px solid var(--lapis);
  padding: 11px 13px; line-height: 1.65; margin-top: 12px;
}

/* ═══════════ 通用按钮 ═══════════ */
.btn-main {
  border: 4px solid #7A5C3E; background: var(--emerald); color: #FFF;
  padding: 12px 26px; font-size: 15px; font-weight: 800; letter-spacing: .5px;
  box-shadow: inset -4px -4px 0 0 rgba(0,0,0,.2), inset 4px 4px 0 0 rgba(255,255,255,.3), 6px 6px 0 0 rgba(60,40,20,.3);
  transition: transform .09s steps(2);
}
.btn-main:hover { transform: translate(-2px, -2px); }
.btn-main:active { transform: translate(3px, 3px); }
.btn-main:disabled { opacity: .55; cursor: wait; transform: none; }

.btn-ghost {
  border: 4px solid #7A5C3E; background: #FFF8E7; color: var(--ink-soft);
  padding: 9px 16px; font-size: 13.5px; font-weight: 700;
  box-shadow: inset -3px -3px 0 0 rgba(0,0,0,.12), inset 3px 3px 0 0 rgba(255,255,255,.7), 4px 4px 0 0 rgba(60,40,20,.22);
  transition: transform .09s steps(2);
}
.btn-ghost:hover { transform: translate(-1px, -1px); color: var(--red); border-color: var(--red); }
.btn-ghost:active { transform: translate(2px, 2px); }

.spk-btn, .eval-btn {
  border: 3px solid #7A5C3E; background: #FFF8E7; font-size: 12px; padding: 4px 10px;
  font-weight: 700; color: var(--ink-soft);
  box-shadow: inset -2px -2px 0 0 rgba(0,0,0,.12), inset 2px 2px 0 0 rgba(255,255,255,.7), 3px 3px 0 0 rgba(60,40,20,.22);
  transition: transform .08s steps(2);
}
.spk-btn:hover, .eval-btn:hover { transform: translate(-1px, -1px); color: var(--red); border-color: var(--red); }
.spk-btn:active, .eval-btn:active { transform: translate(2px, 2px); }

/* ═══════════ 等级卡片（闯关系统） ═══════════ */
.level-card {
  width: 100%; background: #FFFDF5; border: 4px solid var(--gold-2); padding: 10px 12px;
  box-shadow: inset -3px -3px 0 0 rgba(0,0,0,.06), 4px 4px 0 0 rgba(60,40,20,.18);
}
.lvl-head { display: flex; align-items: center; gap: 10px; margin-bottom: 9px; }
.lvl-ico {
  width: 40px; height: 40px; display: grid; place-items: center; font-size: 21px; flex: 0 0 auto;
  background: #FFF2D6; border: 3px solid var(--gold-2);
  box-shadow: inset -2px -2px 0 0 rgba(0,0,0,.1), 2px 2px 0 0 rgba(60,40,20,.2);
}
.lvl-meta { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.lvl-meta b { font-size: 14.5px; color: var(--red-deep); }
.lvl-meta span { font-size: 11px; color: var(--ink-soft); line-height: 1.4; }

.lvl-track { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.lvl-step {
  display: grid; place-items: center; gap: 2px; padding: 6px 2px;
  background: #EFE7D6; border: 3px solid var(--line); text-align: center;
  font-size: 10px; font-weight: 700; color: #A89880; line-height: 1.1;
}
.lvl-step i { font-style: normal; font-size: 16px; filter: grayscale(1); opacity: .45; }
.lvl-step.cur {
  background: #FFF2D6; border-color: var(--gold-2); color: #7A5210;
  box-shadow: inset -2px -2px 0 0 rgba(0,0,0,.08), 3px 3px 0 0 rgba(60,40,20,.2);
}
.lvl-step.cur i { filter: none; opacity: 1; }
.lvl-step.done { border-color: var(--emerald); color: #1F7A2E; background: #E3F7E6; }
.lvl-step.done i { filter: none; opacity: 1; }
.lvl-step.max { border-color: var(--diamond-2); color: #1A7A7A; background: #DFF7F7; }
.lvl-step.max i { filter: none; opacity: 1; }

/* ═══════════ 成就图鉴弹窗 ═══════════ */
.ach-levels { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 6px; }
.ach-level {
  display: grid; place-items: center; gap: 4px; padding: 11px 6px; text-align: center;
  background: #EFE7D6; border: 4px solid var(--line); font-size: 11px; font-weight: 700; color: #A89880;
}
.ach-level i { font-style: normal; font-size: 24px; filter: grayscale(1); opacity: .45; }
.ach-level .al-name { font-size: 12.5px; }
.ach-level .al-cond { font-size: 10.5px; line-height: 1.35; }
.ach-level.cur { background: #FFF2D6; border-color: var(--gold-2); color: #7A5210; }
.ach-level.cur i { filter: none; opacity: 1; }
.ach-level.unlocked { background: #E3F7E6; border-color: var(--emerald); color: #1F7A2E; }
.ach-level.unlocked i { filter: none; opacity: 1; }

.ach-gallery { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 8px; }
.ach-card {
  display: grid; place-items: center; gap: 3px; padding: 12px 6px; text-align: center;
  background: #EFE7D6; border: 4px solid var(--line); font-size: 10.5px; font-weight: 700;
  color: #A89880; line-height: 1.25; position: relative;
}
.ach-card .ac-ico { font-size: 24px; filter: grayscale(1); opacity: .4; }
.ach-card .ac-reward { font-size: 10px; color: #B8A88A; }
.ach-card.on {
  background: #FFF7E0; border-color: var(--gold-2); color: #7A5210;
  box-shadow: inset -3px -3px 0 0 rgba(0,0,0,.08), 3px 3px 0 0 rgba(60,40,20,.2);
}
.ach-card.on .ac-ico { filter: none; opacity: 1; }
.ach-card.on .ac-reward { color: var(--gold-2); }
.ach-card.just { animation: justPop .5s steps(4); }
@keyframes justPop { 0% { transform: scale(.7); } 60% { transform: scale(1.1); } 100% { transform: scale(1); } }

@media (max-width: 700px) {
  .ach-gallery, .ach-levels { grid-template-columns: repeat(2, 1fr); }
}

/* ═══════════ 升级横幅 ═══════════ */
.levelup-banner {
  position: fixed; top: 38%; left: 50%; transform: translate(-50%, -50%);
  z-index: 80; background: #FFF7E0; border: 6px solid var(--gold-2); padding: 26px 44px;
  text-align: center; box-shadow: 10px 10px 0 0 rgba(40,25,10,.4);
  animation: bannerIn .45s steps(5);
}
@keyframes bannerIn {
  0% { transform: translate(-50%, -50%) scale(.6); opacity: 0; }
  60% { transform: translate(-50%, -50%) scale(1.08); opacity: 1; }
  100% { transform: translate(-50%, -50%) scale(1); }
}
.levelup-banner .lu-ico { font-size: 52px; }
.levelup-banner .lu-title { font-size: 22px; font-weight: 800; color: var(--red-deep); margin: 8px 0 4px; letter-spacing: 2px; }
.levelup-banner .lu-sub { font-size: 13.5px; color: #7A5210; font-weight: 700; line-height: 1.6; }

/* ═══════════ 星星雨 / Toast ═══════════ */
.confetti-layer { position: fixed; inset: 0; pointer-events: none; z-index: 60; overflow: hidden; }
.confetti { position: absolute; width: 14px; height: 14px; animation: fallPx 1.8s steps(12) forwards; }
@keyframes fallPx {
  0% { transform: translateY(-40px) rotate(0); opacity: 1; }
  100% { transform: translateY(105vh) rotate(360deg); opacity: 0; }
}

.toast {
  position: fixed; bottom: 32px; left: 50%; transform: translateX(-50%);
  background: var(--ink); color: #FFF8E7; padding: 12px 24px; font-size: 14px; font-weight: 700;
  z-index: 70; border: 4px solid #7A5C3E; max-width: 90vw; text-align: center; line-height: 1.5;
  box-shadow: 6px 6px 0 0 rgba(40,25,10,.4);
}
.toast.err { background: var(--red); }
.toast.ok { background: var(--emerald); }
