/* 英语单词练习视觉：借鉴 Duolingo 的「玩具质感」——厚底阴影按钮、圆润粗体、
   吉祥物引导、撒花正反馈；配色仍以家庭系统的莓果粉为主，绿/蓝/黄分别承担
   「答对 / 信息 / 奖励」的语义。所有规则限定在 .eng-home 内，不污染其他模块。 */

.eng-home {
  --eng-green: #58cc02;
  --eng-green-dark: #46a302;
  --eng-blue: #1cb0f6;
  --eng-blue-dark: #1899d6;
  --eng-yellow: #ffc800;
  --eng-orange: #ff9600;
  --eng-pink: #d94f7c;
  --eng-pink-dark: #b93c66;
  --eng-ink: #3c3c3c;
  --eng-muted: #8a8a8a;
  --eng-line: #e8e8e8;
  --eng-cream: #fffdf8;
  font-family: "Smiley Sans Oblique", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
}

/* ---------- 吉祥物引导 ---------- */

.eng-mascot-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 2px 0 4px;
}

.eng-mascot-avatar {
  width: 82px;
  height: 82px;
  flex: 0 0 auto;
  animation: eng-bob 2.6s ease-in-out infinite;
  filter: drop-shadow(0 5px 2px rgba(60, 40, 20, .16));
}

@keyframes eng-bob {
  0%, 100% { transform: translateY(0) rotate(-2deg); }
  50% { transform: translateY(-6px) rotate(2deg); }
}

.eng-mascot-bubble {
  position: relative;
  flex: 1;
  min-width: 0;
  padding: 12px 16px;
  background: #ffffff;
  border: 2px solid var(--eng-line);
  border-radius: 18px;
  box-shadow: 0 4px 0 var(--eng-line);
  font-size: 17px;
  font-weight: 800;
  line-height: 1.45;
  color: var(--eng-ink);
}

.eng-mascot-bubble::before {
  content: "";
  position: absolute;
  left: -11px;
  top: 30px;
  width: 0;
  height: 0;
  border: 9px solid transparent;
  border-right-color: #ffffff;
  border-left: 0;
}

.eng-mascot-bubble small {
  display: block;
  margin-top: 3px;
  font-weight: 600;
  color: var(--eng-muted);
}

/* ---------- 立体按钮：按下时沉下去 ---------- */

.eng-home .btn {
  border-radius: 14px;
  border: 2px solid transparent;
  font-weight: 800;
  font-size: 16px;
  transition: transform .09s ease, box-shadow .09s ease, filter .12s ease;
}

.eng-home .btn:not(:disabled):active {
  transform: translateY(3px);
  box-shadow: 0 1px 0 var(--eng-line);
}

.eng-home .btn.primary {
  background: var(--eng-pink);
  border-color: var(--eng-pink-dark);
  box-shadow: 0 5px 0 var(--eng-pink-dark);
  color: #ffffff;
}

.eng-home .btn.primary:active { box-shadow: 0 2px 0 var(--eng-pink-dark); }

.eng-home .btn.ghost {
  background: #ffffff;
  border-color: var(--eng-line);
  box-shadow: 0 4px 0 var(--eng-line);
  color: var(--eng-ink);
}

.eng-home .btn.ghost:active { box-shadow: 0 1px 0 var(--eng-line); }

/* ---------- 首页 ---------- */

.eng-home .math-home-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 4px 0 8px;
}

.eng-home .math-home-summary > div {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 12px 6px;
  background: #ffffff;
  border: 2px solid var(--eng-line);
  border-radius: 18px;
  box-shadow: 0 4px 0 var(--eng-line);
  text-align: center;
}

.eng-home .math-home-summary b {
  font-size: 26px;
  font-weight: 800;
  line-height: 1.1;
}

.eng-home .math-home-summary span {
  font-size: 13px;
  font-weight: 700;
  color: var(--eng-muted);
}

.eng-home .math-home-summary > div:nth-child(1) b { color: var(--eng-orange); }
.eng-home .math-home-summary > div:nth-child(2) b { color: var(--eng-green-dark); }
.eng-home .math-home-summary > div:nth-child(3) b { color: var(--eng-blue-dark); }

.eng-home .math-start,
.eng-home .math-question.eng-card,
.eng-home .eng-card,
.eng-home .eng-feedback-card,
.eng-home .eng-option-card {
  border-radius: 22px;
  padding: 20px 18px;
  background: #ffffff;
  border: 2px solid var(--eng-line);
  box-shadow: 0 5px 0 var(--eng-line);
}

.eng-home .math-start h3 {
  margin: 0 0 6px;
  font-size: 22px;
  font-weight: 800;
}

.eng-home .math-start-emoji {
  display: inline-grid;
  place-items: center;
  width: 50px;
  height: 50px;
  margin-bottom: 8px;
  border-radius: 16px;
  background: #fff0f5;
  border: 2px solid #f8d3e1;
  font-size: 27px;
}

/* 今日任务横幅 */
.eng-home .math-start:has(.math-start-emoji) {
  border-left: 7px solid var(--eng-pink);
}

/* 定级挑战：金色 BOSS 卡 */
.eng-challenge-card {
  position: relative;
  overflow: hidden;
  border-radius: 24px;
  padding: 20px 18px;
  margin: 4px 0;
  background: linear-gradient(135deg, #fff7d6 0%, #ffe6a1 100%);
  border: 3px solid #ffd54f;
  box-shadow: 0 6px 0 #eab400;
}

.eng-challenge-card::after {
  content: "";
  position: absolute;
  right: -42px;
  top: -54px;
  width: 170px;
  height: 170px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .34);
  pointer-events: none;
}

.eng-boss-tag {
  position: absolute;
  right: 14px;
  top: 14px;
  z-index: 1;
  padding: 4px 12px;
  border-radius: 999px;
  background: var(--eng-orange);
  color: #ffffff;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .5px;
  box-shadow: 0 3px 0 #d97d00;
}

.eng-challenge-head {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 12px;
}

.eng-challenge-emoji { font-size: 40px; line-height: 1; }

.eng-challenge-title { display: flex; flex-direction: column; gap: 2px; }

.eng-challenge-title b { font-size: 22px; font-weight: 800; color: #8a5a00; }

.eng-challenge-card p {
  position: relative;
  z-index: 1;
  margin: 12px 0;
  line-height: 1.5;
}

.eng-challenge-result { font-weight: 800; color: #8a5a00; }

.eng-challenge-actions {
  position: relative;
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
}

.eng-challenge-actions .btn { flex: 1 1 140px; }

.eng-done-tag {
  align-self: center;
  font-weight: 800;
  color: #8a5a00;
}

.eng-progress-pill {
  padding: 5px 14px;
  border-radius: 999px;
  background: var(--eng-green);
  color: #ffffff;
  font-weight: 800;
  box-shadow: 0 3px 0 var(--eng-green-dark);
}

.eng-challenge-track {
  height: 12px;
  border-radius: 999px;
  background: #ffffff;
  border: 2px solid #f0d38a;
  overflow: hidden;
  margin: 0 2px 14px;
}

.eng-challenge-track-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--eng-yellow), var(--eng-orange));
  transition: width .3s ease;
}

/* 词书进度：一册一个关卡卡片 */
.eng-home .math-kp-title {
  font-size: 18px;
  font-weight: 800;
  margin-top: 8px;
}

.eng-home .math-kp-list { gap: 10px; }

.eng-home .math-kp-row {
  align-items: center;
  padding: 12px 14px;
  border-radius: 16px;
  background: #ffffff;
  border: 2px solid var(--eng-line);
  box-shadow: 0 3px 0 var(--eng-line);
}

.eng-home .math-kp-row.locked { opacity: .62; }

.eng-home .math-kp-emoji {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  flex: 0 0 auto;
  border-radius: 13px;
  background: #fff7dd;
  font-size: 20px;
}

.eng-home .math-kp-name { font-size: 16px; font-weight: 800; }

.eng-home .math-kp-meta { font-size: 13px; color: var(--eng-muted); }

/* ---------- 答题页 ---------- */

.eng-eyebrow {
  display: inline-block;
  padding: 5px 13px;
  border-radius: 999px;
  background: #eaf7ff;
  color: var(--eng-blue-dark);
  font-size: 14px;
  font-weight: 800;
}

.eng-home .eng-card { padding: 22px 18px; }

.eng-home .eng-meaning {
  font-size: 30px;
  font-weight: 800;
  line-height: 1.25;
  margin: 14px 0 4px;
  color: var(--eng-ink);
}

.eng-home .eng-quiz-prompt {
  font-size: 21px;
  font-weight: 800;
  line-height: 1.4;
  margin: 14px 0 4px;
  color: var(--eng-ink);
}

.eng-home .char-listen {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  padding: 8px 16px;
  border-radius: 999px;
  border: 2px solid var(--eng-blue-dark);
  background: var(--eng-blue);
  color: #ffffff;
  font-weight: 800;
  box-shadow: 0 4px 0 var(--eng-blue-dark);
  transition: transform .09s ease, box-shadow .09s ease;
}

.eng-home .char-listen:active {
  transform: translateY(3px);
  box-shadow: 0 1px 0 var(--eng-blue-dark);
}

.eng-choices {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  width: 100%;
  margin-top: 16px;
}

.eng-choice-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  width: 100%;
  margin-top: 16px;
}

.eng-home .eng-choice {
  min-height: 72px;
  padding: 12px;
  font-size: 22px;
  font-weight: 800;
  color: var(--eng-ink);
  background: #ffffff;
  border: 2px solid var(--eng-blue);
  border-radius: 18px;
  box-shadow: 0 5px 0 var(--eng-blue-dark);
  transition: transform .09s ease, box-shadow .09s ease, background .12s ease;
}

.eng-home .eng-choice:not(:disabled):active {
  transform: translateY(4px);
  box-shadow: 0 1px 0 var(--eng-blue-dark);
  background: #f0f9ff;
}

.eng-home .eng-choice:disabled { opacity: .72; }

/* 字母块：糖果色立体按键 */
.eng-slots {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 8px;
  margin: 18px 0 14px;
}

.eng-slot {
  width: 48px;
  height: 56px;
  border: 2px dashed #c9c9c9;
  border-radius: 14px;
  background: #ffffff;
  box-shadow: inset 0 3px 5px rgba(0, 0, 0, .06);
  color: var(--eng-ink);
  font-size: 26px;
  font-weight: 800;
}

.eng-slot.filled {
  border-style: solid;
  border-color: var(--eng-green);
  background: #eefbdc;
  box-shadow: 0 3px 0 var(--eng-green-dark);
}

.eng-slot.fixed {
  width: auto;
  height: auto;
  border: none;
  background: transparent;
  box-shadow: none;
  font-size: 30px;
}

.eng-tiles {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-bottom: 18px;
}

.eng-tile {
  min-width: 48px;
  height: 54px;
  padding: 0 8px;
  border: 2px solid #f0c25a;
  border-radius: 14px;
  background: #fff2cd;
  box-shadow: 0 4px 0 #dca92f;
  color: #7a5200;
  font-size: 23px;
  font-weight: 800;
  transition: transform .09s ease, box-shadow .09s ease;
}

.eng-tile:not(:disabled):active {
  transform: translateY(3px);
  box-shadow: 0 1px 0 #dca92f;
}

.eng-tile:disabled { opacity: .3; box-shadow: none; }

.eng-tile-submit {
  width: 100%;
  min-height: 54px;
  padding: 14px;
  border: 2px solid var(--eng-green-dark);
  border-radius: 16px;
  background: var(--eng-green);
  box-shadow: 0 5px 0 var(--eng-green-dark);
  color: #ffffff;
  font-size: 18px;
  font-weight: 800;
  transition: transform .09s ease, box-shadow .09s ease;
}

.eng-tile-submit:not(:disabled):active {
  transform: translateY(4px);
  box-shadow: 0 1px 0 var(--eng-green-dark);
}

.eng-tile-submit:disabled {
  border-color: var(--eng-line);
  background: #f2f2f2;
  box-shadow: 0 4px 0 var(--eng-line);
  color: #aaa;
}

.eng-bar {
  height: 12px;
  border-radius: 999px;
  background: #f0f0f0;
  overflow: hidden;
  margin-top: 12px;
}

.eng-bar-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--eng-green), #8ee000);
  transition: width .3s ease;
}

.eng-mask {
  font-size: 30px;
  font-weight: 800;
  letter-spacing: 3px;
  color: var(--eng-ink);
  margin: 10px 0;
}

/* ---------- 反馈：答对撒花 ---------- */

.eng-home .math-feedback {
  position: relative;
  overflow: hidden;
  border-radius: 24px;
  padding: 26px 18px;
  background: #ffffff;
  border: 2px solid var(--eng-line);
  box-shadow: 0 5px 0 var(--eng-line);
  text-align: center;
}

.eng-home .math-feedback.ok {
  border-color: #b6e97e;
  box-shadow: 0 5px 0 #b6e97e;
  animation: eng-pop .32s cubic-bezier(.2, 1.5, .4, 1);
}

@keyframes eng-pop {
  0% { transform: scale(.9); }
  70% { transform: scale(1.03); }
  100% { transform: scale(1); }
}

.eng-confetti-box {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.eng-confetti {
  position: absolute;
  top: -20px;
  left: calc(8% + var(--i) * 14%);
  font-size: 22px;
  color: var(--eng-yellow);
  animation: eng-fall 1.4s ease-in forwards;
  animation-delay: calc(var(--i) * .09s);
  pointer-events: none;
}

@keyframes eng-fall {
  0% { transform: translateY(-10px) rotate(0); opacity: 0; }
  20% { opacity: 1; }
  100% { transform: translateY(220px) rotate(320deg); opacity: 0; }
}

.eng-home .math-feedback-icon { font-size: 52px; line-height: 1.2; }

.eng-home .math-feedback b { font-size: 24px; font-weight: 800; color: var(--eng-ink); }

.eng-feedback-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  text-align: center;
  margin-top: 12px;
  overflow: hidden;
}

.eng-feedback-emoji { font-size: 52px; line-height: 1.2; }

.eng-feedback-card b { font-size: 22px; color: var(--eng-green-dark); }

.eng-answer-word {
  font-size: 36px;
  font-weight: 800;
  color: var(--eng-ink);
  word-break: break-word;
}

.eng-home .math-award {
  display: inline-block;
  padding: 4px 14px;
  border-radius: 999px;
  background: #fff6d6;
  border: 2px solid #ffd54f;
  color: #a86e00;
  font-weight: 800;
}

/* 猜词反馈：选项状态色 */
.eng-choice.correct {
  border-color: var(--eng-green) !important;
  background: #eefbdc !important;
  box-shadow: 0 4px 0 var(--eng-green-dark) !important;
}

.eng-choice.wrong {
  border-color: #ff6b6b !important;
  background: #fff0f0 !important;
  box-shadow: 0 4px 0 #e05555 !important;
}

@media (prefers-reduced-motion: reduce) {
  .eng-mascot-avatar,
  .eng-confetti,
  .eng-home .math-feedback.ok { animation: none; }
}

@media (max-width: 480px) {
  .eng-choice-grid, .eng-choices { gap: 10px; }
  .eng-home .eng-choice { min-height: 62px; font-size: 19px; }
  .eng-slot { width: 42px; height: 50px; font-size: 23px; }
  .eng-tile { min-width: 42px; height: 48px; font-size: 21px; }
  .eng-mascot-avatar { width: 68px; height: 68px; }
  .eng-home .eng-meaning { font-size: 26px; }
}
