/* 小学词汇通 —— 视觉风格与考试模块 (exam.css) 保持一致 */

.vocab-app {
  width: min(1180px, 100%);
  margin: 0 auto;
  padding: 12px 18px 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 100vh;
  min-height: 100svh;
  box-sizing: border-box;
}

.vocab-topbar {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: linear-gradient(135deg, #fff6ec 0%, #ffeede 55%, #ffe7f0 100%);
  border-radius: 16px;
  padding: 10px 14px;
  box-shadow: 0 12px 24px rgba(60, 40, 20, 0.12);
  overflow: hidden;
}

.vocab-deco {
  display: flex;
  gap: 14px;
  font-size: 20px;
  opacity: 0.85;
  filter: saturate(1.1);
}

.vocab-deco span {
  animation: vocabBob 2.6s ease-in-out infinite;
}
.vocab-deco span:nth-child(2n) {
  animation-duration: 3.2s;
}
.vocab-deco span:nth-child(3n) {
  animation-delay: 0.4s;
}

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

.vocab-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.vocab-name {
  font-size: 20px;
  font-weight: 800;
  color: #2f2417;
}

.vocab-title-actions {
  display: flex;
  gap: 8px;
}

.vocab-back {
  border: none;
  border-radius: 12px;
  padding: 8px 16px;
  font-size: 14px;
  font-weight: 600;
  background: #f1e6d8;
  color: #5a4631;
  cursor: pointer;
}

.vocab-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 18px;
  font-size: 14px;
  color: #7a6a55;
}

.vocab-stats b {
  color: #e86f3a;
  font-size: 16px;
}

.vocab-progress {
  height: 8px;
  border-radius: 999px;
  background: #efe2cf;
  overflow: hidden;
}

.vocab-progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #e86f3a, #f0a44b);
  transition: width 0.3s ease;
}

.vocab-main {
  flex: 1;
  width: 100%;
  background: #fff;
  border-radius: 18px;
  padding: 12px 14px 16px;
  box-shadow: 0 12px 28px rgba(60, 40, 20, 0.1);
  overflow-y: auto;
  position: relative;
  box-sizing: border-box;
}

.vocab-loading {
  text-align: center;
  color: #8a7a64;
  padding: 40px 0;
}

/* ---- 轮次标题 ---- */
.vocab-round-head {
  font-size: 15px;
  font-weight: 800;
  color: #b25a1f;
  margin-bottom: 12px;
  padding: 8px 12px;
  border-radius: 12px;
  background: linear-gradient(135deg, #fff1e0, #ffe1c4);
}

/* ---- 斩词列表 ---- */
.vocab-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.vocab-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 12px;
  border: 1px solid #f1e6d8;
  background: #fffdf9;
}

.vocab-row.done {
  border-color: #efe2cf;
  background: #fbf7f0;
}

.vocab-word-wrap {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 92px;
  flex: 0 0 auto;
}

.vocab-word {
  border: none;
  background: transparent;
  padding: 0;
  text-align: left;
  font-size: 17px;
  font-weight: 800;
  color: #2f2417;
  cursor: pointer;
  letter-spacing: 0.3px;
}

.vocab-word .spk {
  font-size: 15px;
  opacity: 0.55;
  margin-left: 6px;
}

.vocab-word-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: #9a8a72;
}

.vocab-pips {
  display: inline-flex;
  gap: 3px;
}

.vocab-pip {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #e6d8c4;
}

.vocab-pip.on {
  background: #1f9d55;
}

.vocab-mastered-tag {
  color: #1f9d55;
  font-weight: 700;
}

.vocab-need-tag {
  color: #b02a26;
  font-weight: 700;
  font-size: 12px;
}

.vocab-opts {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  flex: 1 1 260px;
}

.vocab-opt {
  border: 2px solid #efe2cf;
  border-radius: 12px;
  padding: 6px 10px;
  font-size: 14px;
  font-weight: 600;
  background: #fff;
  color: #3a2e1e;
  cursor: pointer;
  transition: transform 0.05s ease;
  flex: 1 1 auto;
  min-width: 96px;
}

.vocab-opt:active {
  transform: scale(0.97);
}

.vocab-opt.right {
  background: #e6f7ec;
  border-color: #1f9d55;
  color: #15713c;
}

.vocab-opt.wrong {
  background: #fdeaea;
  border-color: #d9534f;
  color: #b02a26;
}

.vocab-opt:disabled {
  cursor: default;
}

.vocab-unknown {
  border: 2px dashed #d8b48a;
  border-radius: 12px;
  padding: 6px 10px;
  font-size: 13px;
  font-weight: 700;
  background: #fff8ee;
  color: #a4703a;
  cursor: pointer;
  flex: 0 0 auto;
}

.vocab-unknown.picked {
  background: #f3e6d3;
  color: #7a5a34;
}

.vocab-unknown:disabled {
  cursor: default;
}

/* ---- 底部操作 ---- */
.vocab-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 16px;
  flex-wrap: wrap;
}

.vocab-footer-tip {
  font-size: 13px;
  color: #9a8a72;
}

.vocab-next {
  border: none;
  border-radius: 16px;
  padding: 13px 30px;
  font-size: 16px;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, #e86f3a, #f0a44b);
  box-shadow: 0 10px 18px rgba(232, 111, 58, 0.22);
  cursor: pointer;
}

.vocab-next:disabled {
  opacity: 0.5;
  cursor: default;
}

/* ---- 完成态 ---- */
.vocab-done {
  text-align: center;
  padding: 40px 12px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  align-items: center;
}

.vocab-done-title {
  font-size: 22px;
  font-weight: 800;
  color: #2f2417;
}

.vocab-done-tip {
  font-size: 15px;
  color: #7a6a55;
}

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

.vocab-done-btn {
  border: none;
  border-radius: 14px;
  padding: 12px 22px;
  font-size: 15px;
  font-weight: 700;
  background: #f1e6d8;
  color: #5a4631;
  cursor: pointer;
}

.vocab-done-btn.primary {
  color: #fff;
  background: linear-gradient(135deg, #e86f3a, #f0a44b);
}

@media (max-width: 560px) {
  .vocab-app {
    padding: 16px 14px 20px;
  }
  .vocab-main {
    padding: 14px;
  }
  .vocab-word {
    font-size: 20px;
  }
  .vocab-word-wrap {
    min-width: 100%;
  }
  .vocab-opts {
    flex: 1 1 100%;
  }
}

/* ---- 主界面 hub ---- */
.vocab-hub {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.vocab-hub-greeting {
  font-size: 17px;
  font-weight: 600;
  color: #5a3a10;
  padding: 2px 0 8px;
}

.vocab-hub-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.vocab-hub-stat {
  flex: 1 1 120px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 14px 8px;
  border-radius: 16px;
  background: #fbf3e8;
}

.vocab-hub-stat b {
  font-size: 24px;
  color: #e86f3a;
}

.vocab-hub-stat span {
  font-size: 13px;
  color: #7a6a55;
}

.vocab-hub-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.vocab-hub-card {
  border: none;
  text-align: left;
  border-radius: 20px;
  padding: 22px 20px;
  background: linear-gradient(135deg, #fff6ec 0%, #ffe7f0 100%);
  box-shadow: 0 12px 24px rgba(60, 40, 20, 0.12);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.vocab-hub-card:active {
  transform: scale(0.99);
}

.vocab-hub-icon {
  font-size: 34px;
}

.vocab-hub-card-title {
  font-size: 19px;
  font-weight: 800;
  color: #2f2417;
}

.vocab-hub-card-sub {
  font-size: 13px;
  color: #7a6a55;
  line-height: 1.5;
}

.vocab-hub-tip {
  font-size: 13px;
  color: #9a8a72;
  text-align: center;
}

/* ---- 连线配对 ---- */
.vocab-match-board {
  position: relative;
  width: 100%;
  max-width: 640px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  gap: 80px;
}

.vocab-match-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
}

.vocab-match-svg line {
  stroke: #1f9d55;
  stroke-width: 3;
  stroke-linecap: round;
}

.vocab-match-col {
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex: 1;
  position: relative;
  z-index: 2;
}

.vocab-match-item {
  border: 2px solid #efe2cf;
  border-radius: 14px;
  padding: 13px 10px;
  font-size: 16px;
  font-weight: 700;
  background: #fff;
  color: #3a2e1e;
  cursor: pointer;
}

.vocab-match-item.selected {
  border-color: #e86f3a;
  background: #fff1e3;
}

.vocab-match-item.matched {
  border-color: #1f9d55;
  background: #e6f7ec;
  color: #15713c;
  cursor: default;
}

.vocab-match-item.wrong {
  border-color: #d9534f;
  background: #fdeaea;
  color: #b02a26;
}

@media (max-width: 560px) {
  .vocab-hub-cards {
    grid-template-columns: 1fr;
  }
  .vocab-match-board {
    gap: 30px;
  }
  .vocab-match-item {
    font-size: 15px;
    padding: 11px 8px;
  }
}

/* ---- hub 游戏解锁区 ---- */
.vocab-games {
  border-radius: 18px;
  padding: 16px;
  background: #fbf3e8;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.vocab-games-head {
  font-size: 14px;
  font-weight: 700;
  color: #8a4b14;
}

.vocab-games-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.vocab-game-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  border: none;
  border-radius: 14px;
  padding: 12px 14px;
  font-size: 15px;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, #e86f3a, #f0a44b);
  box-shadow: 0 8px 16px rgba(232, 111, 58, 0.22);
  cursor: pointer;
}

.vocab-game-btn:disabled {
  cursor: default;
  color: #9a8a72;
  background: #ece2d3;
  box-shadow: none;
}

.vocab-game-icon {
  font-size: 18px;
}

.vocab-game-label {
  flex: 1;
  text-align: left;
}

.vocab-game-cost {
  font-size: 12px;
  font-weight: 600;
  opacity: 0.92;
}

@media (max-width: 560px) {
  .vocab-games-grid {
    grid-template-columns: 1fr;
  }
}

/* ---- 听音选词 / 形近词辨析 ---- */
.vocab-quiz {
  display: flex;
  flex-direction: column;
  gap: 18px;
  align-items: center;
  padding: 8px 0;
}

.vocab-quiz-prompt {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  min-height: 90px;
  justify-content: center;
}

.vocab-quiz-audio {
  border: none;
  border-radius: 18px;
  padding: 18px 34px;
  font-size: 22px;
  font-weight: 800;
  color: #fff;
  background: linear-gradient(135deg, #e86f3a, #f0a44b);
  box-shadow: 0 10px 20px rgba(232, 111, 58, 0.25);
  cursor: pointer;
}

.vocab-quiz-zh {
  font-size: 30px;
  font-weight: 800;
  color: #2f2417;
  text-align: center;
}

.vocab-quiz-hint {
  font-size: 13px;
  color: #9a8a72;
}

.vocab-quiz-opts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  width: 100%;
  max-width: 460px;
}

.vocab-quiz-opt {
  border: 2px solid #efe2cf;
  border-radius: 14px;
  padding: 16px 12px;
  font-size: 20px;
  font-weight: 700;
  background: #fff;
  color: #3a2e1e;
  cursor: pointer;
  text-transform: lowercase;
}

.vocab-quiz-opt:active {
  transform: scale(0.98);
}

.vocab-quiz-opt.right {
  background: #e6f7ec;
  border-color: #1f9d55;
  color: #15713c;
}

.vocab-quiz-opt.wrong {
  background: #fdeaea;
  border-color: #d9534f;
  color: #b02a26;
}

.vocab-quiz-feedback {
  font-size: 16px;
  font-weight: 700;
  color: #b25a1f;
  min-height: 22px;
}

@media (max-width: 560px) {
  .vocab-quiz-zh {
    font-size: 26px;
  }
  .vocab-quiz-opt {
    font-size: 18px;
    padding: 13px 10px;
  }
}

/* ---- 单词雨 ---- */
.vocab-rain-task {
  text-align: center;
  padding: 6px 10px 8px;
  border-radius: 12px;
  background: linear-gradient(135deg, #fff1e0, #ffe1c4);
  margin-bottom: 10px;
  line-height: 1.2;
}
.rain-find-cat {
  display: block;
  font-size: 11px;
  font-weight: 700;
  color: #2980b9;
  letter-spacing: 0.08em;
}
.rain-find-hint {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: #a07048;
  letter-spacing: 0.05em;
}
.rain-find-zh {
  display: block;
  font-size: 28px;
  font-weight: 800;
  color: #c0392b;
}

.vocab-rain-area {
  position: relative;
  width: 100%;
  height: 58vh;
  min-height: 320px;
  overflow: hidden;
  border-radius: 14px;
  background: linear-gradient(180deg, #f3f8ff 0%, #eef4ec 100%);
  transition: background 0.5s ease;
}

@keyframes rainSplash {
  0%   { opacity: 0.95; transform: translate(-50%, -50%) scale(0.35); }
  35%  { opacity: 0.9;  transform: translate(-50%, -50%) scale(1.05); }
  100% { opacity: 0;    transform: translate(-50%, -50%) scale(1.5); }
}
.rain-splash {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.35);
  font-size: 56px;
  font-weight: 900;
  color: #c0392b;
  text-shadow: 0 2px 16px rgba(192, 57, 43, 0.25);
  pointer-events: none;
  z-index: 10;
  white-space: nowrap;
  animation: rainSplash 0.9s ease-out forwards;
}

.vocab-rain-word {
  position: absolute;
  top: -12%;
  border: none;
  border-radius: 12px;
  padding: 8px 12px;
  font-size: 18px;
  font-weight: 800;
  color: #2f2417;
  background: #fff;
  box-shadow: 0 4px 10px rgba(60, 40, 20, 0.18);
  cursor: pointer;
  white-space: nowrap;
  animation-name: vocabFall;
  animation-timing-function: linear;
  animation-fill-mode: forwards;
}

@keyframes vocabFall {
  from {
    top: -12%;
  }
  to {
    top: 108%;
  }
}

.vocab-rain-word.hit-right {
  background: #e6f7ec;
  color: #15713c;
  animation-play-state: paused;
}

.vocab-rain-word.hit-wrong {
  background: #fdeaea;
  color: #b02a26;
  animation-play-state: paused;
}

/* ---- 打地鼠 ---- */
.vocab-mole-target {
  font-size: 28px;
  font-weight: 800;
  color: #2f2417;
  text-align: center;
  margin-bottom: 14px;
}

.vocab-mole-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  max-width: 560px;
  margin: 0 auto;
}

.vocab-mole-hole {
  position: relative;
  height: 114px;
  border-radius: 50% 50% 14px 14px;
  background: radial-gradient(ellipse at 50% 90%, #d8c4a6 0%, #c2a985 70%);
  overflow: hidden;
  box-shadow: inset 0 -6px 10px rgba(0, 0, 0, 0.15);
}

/* 卡通老鼠：帽子在上，脸在下，从洞里钻出来 */
.vocab-mole {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  bottom: -130%;
  width: 80px;
  border: none;
  background: transparent !important;
  -webkit-appearance: none;
  appearance: none;
  cursor: pointer;
  transition: bottom 0.22s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0;
  gap: 0;
  outline: none;
}

.vocab-mole.up {
  bottom: 2px;
}

/* 打对：帽子被砸扁，然后弹回 */
@keyframes mole-bonk {
  0%   { transform: translateX(-50%) scaleY(1); }
  20%  { transform: translateX(-50%) scaleY(0.72) translateY(6px); }
  55%  { transform: translateX(-50%) scaleY(1.08); }
  100% { transform: translateX(-50%) scaleY(1); }
}
/* 打错：左右抖动 */
@keyframes mole-shake {
  0%   { transform: translateX(-50%); }
  20%  { transform: translateX(calc(-50% - 8px)); }
  45%  { transform: translateX(calc(-50% + 8px)); }
  70%  { transform: translateX(calc(-50% - 4px)); }
  100% { transform: translateX(-50%); }
}
.vocab-mole.bonk-right {
  animation: mole-bonk 0.35s ease;
}
.vocab-mole.bonk-wrong {
  animation: mole-shake 0.4s ease;
}

/* 帽子（深色小礼帽，单词写在上面）*/
.mole-hat {
  background: linear-gradient(to bottom, #5a3820, #3a2010);
  border-radius: 5px 5px 0 0;
  width: 76px;
  padding: 5px 4px 3px;
  text-align: center;
  position: relative;
  z-index: 1;
}
/* 帽檐 */
.mole-hat::after {
  content: '';
  position: absolute;
  bottom: -5px;
  left: -5px;
  right: -5px;
  height: 6px;
  background: #3a2010;
  border-radius: 2px;
  z-index: 2;
}

.vocab-mole-label {
  color: #ffe090;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.02em;
  white-space: nowrap;
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 70px;
}

/* 老鼠脸（棕色椭圆）*/
.mole-face {
  width: 68px;
  height: 58px;
  background: radial-gradient(ellipse at 38% 35%, #d4a87a, #b8905a);
  border-radius: 50% 50% 48% 48% / 44% 44% 56% 56%;
  position: relative;
  margin-top: 5px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

/* 耳朵 */
.mole-ear {
  position: absolute;
  top: -10px;
  width: 19px;
  height: 19px;
  background: #c47850;
  border-radius: 50%;
}
.mole-ear::after {
  content: '';
  position: absolute;
  top: 4px; left: 4px;
  width: 11px; height: 11px;
  background: #eba090;
  border-radius: 50%;
}
.mole-ear-l { left: 3px; }
.mole-ear-r { right: 3px; }

/* 眼睛 */
.mole-eyes {
  display: flex;
  gap: 14px;
  margin-top: 10px;
}
.mole-eye {
  width: 8px; height: 8px;
  background: #1a1008;
  border-radius: 50%;
  display: block;
  position: relative;
}
.mole-eye::after {
  content: '';
  position: absolute;
  top: 1px; left: 2px;
  width: 3px; height: 3px;
  background: rgba(255,255,255,0.75);
  border-radius: 50%;
}

/* 鼻子 */
.mole-nose {
  width: 14px; height: 9px;
  background: radial-gradient(ellipse, #f0b0b0, #d07070);
  border-radius: 50%;
  margin-top: 2px;
}

/* 打对：脸变绿 */
.vocab-mole.bonk-right .mole-face {
  background: radial-gradient(ellipse at 38% 35%, #90e890, #38b838);
}
/* 打错：脸变红 */
.vocab-mole.bonk-wrong .mole-face {
  background: radial-gradient(ellipse at 38% 35%, #f09090, #d04040);
}

@media (max-width: 560px) {
  .vocab-rain-word {
    font-size: 16px;
    padding: 7px 10px;
  }
  .vocab-mole-target {
    font-size: 24px;
  }
  .vocab-mole-hole {
    height: 96px;
  }
  .mole-face {
    width: 58px;
    height: 50px;
  }
  .mole-hat {
    width: 64px;
    padding: 4px 3px 2px;
  }
  .vocab-mole {
    width: 68px;
  }
  .vocab-mole-label {
    font-size: 11px;
  }
}

/* ==== 平板 / 横屏加宽（tablet-friendly） ==== */
@media (min-width: 760px) {
  .vocab-app {
    padding: 16px 28px 24px;
    gap: 14px;
  }
  .vocab-main {
    padding: 20px 24px 24px;
  }
  /* hub 卡片 3 列，充分利用横向空间 */
  .vocab-hub-cards {
    grid-template-columns: repeat(3, 1fr);
    gap: 18px;
  }
  /* 连连看：更宽的板、更大的间距和字号 */
  .vocab-match-board {
    max-width: 860px;
    gap: 140px;
  }
  .vocab-match-item {
    font-size: 18px;
    padding: 16px 14px;
  }
  /* 选词类：更宽的选项区、更大的字 */
  .vocab-quiz-opts {
    max-width: 720px;
    gap: 16px;
  }
  .vocab-quiz-opt {
    font-size: 22px;
    padding: 20px 14px;
  }
  .vocab-quiz-zh {
    font-size: 36px;
  }
  /* 打地鼠：更大的场地 */
  .vocab-mole-grid {
    max-width: 780px;
    gap: 20px;
  }
  .vocab-mole-hole {
    height: 134px;
  }
  .mole-face {
    width: 80px;
    height: 68px;
  }
  .mole-hat {
    width: 88px;
  }
  .vocab-mole {
    width: 92px;
  }
  .vocab-mole-label {
    font-size: 14px;
    max-width: 82px;
  }
  /* 单词雨：更高的下落区 */
  .vocab-rain-area {
    height: 64vh;
  }
  .vocab-rain-word {
    font-size: 20px;
    padding: 10px 14px;
  }
  /* 标记模式：中文选项更大更好点 */
  .vocab-word {
    font-size: 19px;
  }
  .vocab-opt {
    font-size: 16px;
    padding: 9px 14px;
  }
}

@media (min-width: 1040px) {
  /* 更宽的平板/桌面：hub 卡片 4 列 */
  .vocab-hub-cards {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* ---- 得分/扣分飘字 ---- */
.vocab-float {
  position: fixed;
  transform: translate(-50%, -50%);
  font-size: 24px;
  font-weight: 800;
  pointer-events: none;
  z-index: 50;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
  animation: vocabFloatUp 1s ease-out forwards;
}

.vocab-float.plus {
  color: #f3b938;
}

.vocab-float.minus {
  color: #d9534f;
}

@keyframes vocabFloatUp {
  0% {
    opacity: 0;
    transform: translate(-50%, -30%) scale(0.8);
  }
  20% {
    opacity: 1;
    transform: translate(-50%, -60%) scale(1.1);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -170%) scale(1);
  }
}

/* ---- 单词雨圆球（JS 物理下落，transform 定位） ---- */
.vocab-rain-ball {
  position: absolute;
  top: 0;
  left: 0;
  will-change: transform;
  min-width: 64px;
  height: 64px;
  padding: 0 18px;
  border: none;
  border-radius: 999px;
  font-size: 21px;
  font-weight: 800;
  color: #2f2417;
  background: radial-gradient(circle at 35% 28%, #ffffff, #ffe0b8 65%, #f0a44b);
  box-shadow: 0 5px 12px rgba(60, 40, 20, 0.25);
  cursor: pointer;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-transform: lowercase;
}

.vocab-rain-ball.hit-right {
  background: radial-gradient(circle at 35% 28%, #fff, #b7ecc9 65%, #1f9d55);
  color: #15713c;
}

.vocab-rain-ball.hit-wrong {
  background: radial-gradient(circle at 35% 28%, #fff, #f6c2c2 65%, #d9534f);
  color: #fff;
}

@media (min-width: 760px) {
  .vocab-rain-ball {
    min-width: 74px;
    height: 74px;
    font-size: 23px;
  }
}

/* ---- 云同步按钮（hub 头部） ---- */
.vocab-sync-btn {
  border: none;
  border-radius: 999px;
  padding: 7px 16px;
  font-size: 15px;
  font-weight: 700;
  color: #6a4a1c;
  background: #ffe7c2;
  box-shadow: 0 3px 8px rgba(60, 40, 20, 0.15);
  cursor: pointer;
  max-width: 60vw;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.vocab-sync-btn:active {
  transform: translateY(1px);
}

/* ---- 弹窗（取名 / 同步菜单） ---- */
.vocab-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(40, 26, 12, 0.5);
  animation: vocabFadeIn 0.15s ease-out;
}
@keyframes vocabFadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}
.vocab-modal {
  width: min(420px, 100%);
  background: #fffdf9;
  border-radius: 18px;
  padding: 22px 22px 18px;
  box-shadow: 0 18px 40px rgba(40, 26, 12, 0.3);
  box-sizing: border-box;
}
.vocab-modal-title {
  margin: 0 0 8px;
  font-size: 21px;
  font-weight: 800;
  color: #3a2a16;
}
.vocab-modal-desc {
  margin: 0 0 14px;
  font-size: 14px;
  line-height: 1.5;
  color: #7a6a52;
}
.vocab-modal-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 16px;
  flex-wrap: wrap;
}
.vocab-modal-btn {
  border: none;
  border-radius: 999px;
  padding: 10px 20px;
  font-size: 16px;
  font-weight: 700;
  color: #6a4a1c;
  background: #f1e6d8;
  cursor: pointer;
}
.vocab-modal-btn.primary {
  color: #fff;
  background: #f39a3a;
}
.vocab-modal-btn:active {
  transform: translateY(1px);
}

.vocab-name-input {
  width: 100%;
  box-sizing: border-box;
  border: 2px solid #eaddc8;
  border-radius: 12px;
  padding: 12px 14px;
  font-size: 18px;
  color: #3a2a16;
  background: #fff;
  outline: none;
}
.vocab-name-input:focus {
  border-color: #f3b93a;
}

.vocab-sync-body {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.vocab-sync-who {
  font-size: 16px;
  font-weight: 800;
  color: #3a2a16;
  padding: 4px 2px 6px;
}
.vocab-sync-row {
  border: none;
  border-radius: 12px;
  padding: 13px 16px;
  font-size: 16px;
  font-weight: 700;
  text-align: left;
  color: #3a2a16;
  background: #fff5e6;
  cursor: pointer;
}
.vocab-sync-row:active {
  transform: translateY(1px);
  background: #ffedd2;
}
.vocab-sync-status {
  min-height: 20px;
  font-size: 14px;
  font-weight: 600;
  color: #7a6a52;
  padding: 2px 2px 0;
}
.vocab-sync-status.ok {
  color: #1f9d55;
}
.vocab-sync-status.err {
  color: #d9534f;
}

/* ---- 每日打卡面板 ---- */
.vocab-checkin-panel {
  background: linear-gradient(135deg, #fffbf0 0%, #fff4d9 100%);
  border: 1.5px solid #f5d98a;
  border-radius: 16px;
  padding: 14px 16px 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.vocab-checkin-hdr {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.vocab-checkin-title {
  font-size: 17px;
  font-weight: 800;
  color: #3a2a16;
}
.vocab-checkin-streak-badge {
  font-size: 14px;
  font-weight: 800;
  color: #c05000;
  background: #ffe2bb;
  border-radius: 999px;
  padding: 3px 10px;
}
.vocab-checkin-cards-badge {
  font-size: 14px;
  font-weight: 800;
  color: #5a3a99;
  background: #ede0ff;
  border-radius: 999px;
  padding: 3px 10px;
}

/* 进度条行 */
.vocab-checkin-prog-row {
  display: flex;
  align-items: center;
  gap: 10px;
}
.vocab-checkin-bar {
  flex: 1;
  height: 12px;
  background: #f0e4c4;
  border-radius: 999px;
  overflow: hidden;
}
.vocab-checkin-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #f5b942, #f37a1f);
  border-radius: 999px;
  transition: width 0.4s ease;
}
.vocab-checkin-prog-label {
  font-size: 14px;
  font-weight: 700;
  color: #7a5a20;
  white-space: nowrap;
}

/* 打卡按钮 */
.vocab-checkin-btn {
  align-self: flex-start;
  border: none;
  border-radius: 999px;
  padding: 11px 24px;
  font-size: 17px;
  font-weight: 800;
  color: #fff;
  background: linear-gradient(135deg, #f5b942 0%, #f07d1e 100%);
  box-shadow: 0 4px 12px rgba(240, 125, 30, 0.4);
  cursor: pointer;
  animation: checkinPulse 1.6s ease-in-out infinite;
}
@keyframes checkinPulse {
  0%, 100% { box-shadow: 0 4px 12px rgba(240, 125, 30, 0.4); }
  50% { box-shadow: 0 4px 22px rgba(240, 125, 30, 0.7); transform: scale(1.03); }
}
.vocab-checkin-btn:active {
  animation: none;
  transform: translateY(1px);
}

/* 游戏卡兑换行 */
.vocab-checkin-card-row {
  font-size: 14px;
  font-weight: 600;
  color: #5a3a99;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.vocab-checkin-redeem-btn {
  border: none;
  border-radius: 999px;
  padding: 6px 14px;
  font-size: 14px;
  font-weight: 700;
  color: #fff;
  background: #7c51cc;
  cursor: pointer;
}
.vocab-checkin-redeem-btn:active {
  transform: translateY(1px);
}

/* 里程碑奖励表 */
.vocab-checkin-milestones {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.vocab-checkin-mil-title {
  font-size: 13px;
  font-weight: 700;
  color: #9a7a40;
}
.vocab-checkin-mil-row {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.vocab-checkin-mil-chip {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  background: #f5e9c8;
  border-radius: 10px;
  padding: 5px 10px;
  opacity: 0.7;
  min-width: 48px;
}
.vocab-checkin-mil-chip b {
  font-size: 13px;
  color: #5a3a10;
}
.vocab-checkin-mil-chip span {
  font-size: 12px;
  color: #7a5a20;
}
.vocab-checkin-mil-chip.base {
  background: #e8f5e9;
  border: 1.5px solid #81c784;
}
.vocab-checkin-mil-chip.base b {
  color: #2e7d32;
}
.vocab-checkin-mil-chip.base span {
  color: #388e3c;
}
.vocab-checkin-mil-chip.done {
  background: #ffe5a0;
  opacity: 1;
  box-shadow: 0 1px 4px rgba(240,160,0,0.25);
}
.vocab-checkin-mil-chip.done b,
.vocab-checkin-mil-chip.done span {
  color: #7a4800;
}

/* ---- 达到100词时的 toast 提示 ---- */
.vocab-checkin-toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 200;
  animation: checkinToastIn 0.3s cubic-bezier(.17,.67,.3,1.3) forwards;
}
@keyframes checkinToastIn {
  from { opacity: 0; transform: translateX(-50%) translateY(20px) scale(0.95); }
  to   { opacity: 1; transform: translateX(-50%) translateY(0)     scale(1);    }
}
.vocab-checkin-toast-inner {
  background: linear-gradient(135deg, #fff8e0, #ffe89a);
  border: 2px solid #f5b942;
  border-radius: 20px;
  padding: 18px 22px 14px;
  box-shadow: 0 8px 32px rgba(60, 40, 20, 0.22);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  min-width: 240px;
  max-width: 88vw;
  text-align: center;
}
.vocab-checkin-toast-big {
  font-size: 36px;
  line-height: 1;
}
.vocab-checkin-toast-title {
  font-size: 18px;
  font-weight: 800;
  color: #3a2a00;
}
.vocab-checkin-toast-sub {
  font-size: 14px;
  color: #7a5a10;
}
.vocab-checkin-toast-btn {
  margin-top: 4px;
  border: none;
  border-radius: 999px;
  padding: 9px 20px;
  font-size: 15px;
  font-weight: 800;
  color: #fff;
  background: linear-gradient(135deg, #f5b942, #f07d1e);
  cursor: pointer;
}

/* ---- 打卡结果弹窗内容 ---- */
.vocab-checkin-result {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.vocab-checkin-result-streak {
  font-size: 18px;
  font-weight: 800;
  color: #c05000;
}
.vocab-checkin-result-line {
  font-size: 15px;
  font-weight: 700;
  color: #3a2a16;
}
.vocab-checkin-result-line.bonus {
  color: #7c51cc;
}
.vocab-checkin-result-total {
  font-size: 17px;
  font-weight: 800;
  color: #b85a00;
  margin-top: 4px;
}
.vocab-checkin-result-cards {
  font-size: 15px;
  font-weight: 700;
  color: #5a3a99;
  margin-top: 2px;
}
.vocab-checkin-result-hint {
  font-size: 12px;
  color: #9a8060;
}
