:root {
  --sky-blue: #4D96FF;
  --mint-green: #6BCB77;
  --sunshine-yellow: #FFD93D;
  --coral-pink: #FF8B94;
  --lavender-purple: #C9B1FF;
  --cream-white: #FFF9E6;
  --light-gray: #F5F5F5;
  --text-gray: #555555;
  --success-green: #6BCB77;
  --error-red: #FF6B6B;
  --orange-warm: #FFA94D;
  --peach: #FFCBA4;
  --teal: #4ECDC4;
  --rose: #FFB7C5;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Comic Sans MS', 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  background:
    radial-gradient(circle at top left, rgba(255, 183, 197, 0.35), transparent 30%),
    radial-gradient(circle at top right, rgba(201, 177, 255, 0.3), transparent 30%),
    radial-gradient(circle at bottom, rgba(78, 205, 196, 0.25), transparent 35%),
    linear-gradient(180deg, #fffef6 0%, #fff5e7 100%);
  min-height: 100vh;
  color: var(--text-gray);
  overflow-x: hidden;
}

.decor-element {
  position: fixed;
  font-size: 34px;
  opacity: 0.35;
  pointer-events: none;
  z-index: 0;
}

.decor-cloud-1 { top: 5%; left: 5%; animation: float 8s ease-in-out infinite; }
.decor-cloud-2 { top: 15%; right: 10%; animation: float 10s ease-in-out infinite reverse; }
.decor-cloud-3 { bottom: 10%; left: 20%; animation: float 12s ease-in-out infinite; }
.decor-star-1 { top: 20%; left: 80%; animation: twinkle 2s ease-in-out infinite; }
.decor-star-2 { top: 60%; right: 5%; animation: twinkle 3s ease-in-out infinite; }
.decor-bubble-1 { top: 30%; left: 10%; animation: bounce 4s ease-in-out infinite; }
.decor-bubble-2 { bottom: 20%; right: 15%; animation: bounce 5s ease-in-out infinite; }
.decor-heart-1 { top: 70%; left: 15%; animation: float 6s ease-in-out infinite; }

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

@keyframes twinkle {
  0%, 100% { opacity: 0.25; transform: scale(1); }
  50% { opacity: 0.9; transform: scale(1.25); }
}

@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-18px); }
}

@keyframes pop {
  0% { transform: scale(0.75); opacity: 0; }
  50% { transform: scale(1.08); }
  100% { transform: scale(1); opacity: 1; }
}

@keyframes wiggle {
  0%, 100% { transform: rotate(-2deg); }
  50% { transform: rotate(2deg); }
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-10px); }
  40% { transform: translateX(10px); }
  60% { transform: translateX(-6px); }
  80% { transform: translateX(6px); }
}

@keyframes correctPulse {
  0% { box-shadow: 0 0 0 0 rgba(107, 203, 119, 0.75); }
  70% { box-shadow: 0 0 0 24px rgba(107, 203, 119, 0); }
  100% { box-shadow: 0 0 0 0 rgba(107, 203, 119, 0); }
}

@keyframes rainbow {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

.top-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(77, 150, 255, 0.12);
}

.nav-container {
  max-width: 1000px;
  margin: 0 auto;
  padding: 12px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.nav-home {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  color: var(--text-gray);
  font-weight: 800;
  font-size: 16px;
  transition: all 0.3s ease;
}

.nav-home:hover {
  color: var(--coral-pink);
  transform: translateX(-2px);
}

.nav-icon {
  font-size: 22px;
  animation: wiggle 3s ease-in-out infinite;
}

.nav-brand {
  color: var(--coral-pink);
}

.nav-links,
.footer-links {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.nav-links {
  justify-content: flex-end;
}

.nav-links a,
.footer-links a {
  color: #666;
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
}

.nav-links a:hover,
.footer-links a:hover {
  color: var(--sky-blue);
}

.container {
  max-width: 920px;
  margin: 0 auto;
  padding: 24px 20px 60px;
  position: relative;
  z-index: 1;
}

.page-header {
  text-align: center;
  padding: 20px 0 28px;
}

.page-badge {
  display: inline-block;
  background: linear-gradient(135deg, var(--rose), var(--coral-pink), var(--sunshine-yellow));
  background-size: 200% 200%;
  color: white;
  padding: 7px 20px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 14px;
  box-shadow: 0 4px 14px rgba(255, 139, 148, 0.3);
  animation: rainbow 6s ease infinite;
}

.page-title {
  font-size: 34px;
  color: #2b2b2b;
  margin-bottom: 10px;
  letter-spacing: 1px;
}

.page-title::after {
  content: '';
  display: block;
  width: 60px;
  height: 4px;
  background: linear-gradient(90deg, var(--sky-blue), var(--coral-pink));
  margin: 12px auto 0;
  border-radius: 999px;
}

.page-subtitle {
  color: #888;
  font-size: 15px;
}

/* 顶部设置栏 */
.settings-bar {
  display: flex;
  justify-content: center;
  margin-bottom: 20px;
}

.setting-group {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  background: white;
  padding: 10px 18px;
  border-radius: 999px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.06);
  border: 2px solid rgba(255, 183, 197, 0.3);
  flex-wrap: wrap;
  justify-content: center;
}

.setting-label {
  font-size: 15px;
  font-weight: 700;
  color: #555;
}

.segmented {
  display: inline-flex;
  background: #f7f1e3;
  padding: 4px;
  border-radius: 999px;
  gap: 4px;
}

.seg-btn {
  border: none;
  background: transparent;
  padding: 7px 14px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 700;
  color: #888;
  cursor: pointer;
  transition: all 0.25s ease;
  font-family: inherit;
}

.seg-btn:hover {
  color: var(--coral-pink);
}

.seg-btn.active {
  background: linear-gradient(135deg, var(--coral-pink), var(--sunshine-yellow));
  color: white;
  box-shadow: 0 2px 8px rgba(255, 139, 148, 0.35);
}

/* 玩法介绍卡片 */
.play-guide {
  background: white;
  border-radius: 20px;
  padding: 16px 22px;
  /* 顶部也预留间距（双重保险），确保与上方操作按钮明显分离 */
  margin-top: 8px;
  margin-bottom: 22px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.05);
  border: 2px dashed rgba(78, 205, 196, 0.4);
  display: flex;
  align-items: flex-start;
  gap: 14px;
  animation: pop 0.35s ease;
}

.guide-icon {
  font-size: 32px;
  flex-shrink: 0;
  line-height: 1.2;
}

.guide-body {
  flex: 1;
  min-width: 0;
}

.guide-title {
  font-size: 16px;
  font-weight: 800;
  color: #333;
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.guide-title .tag {
  display: inline-block;
  font-size: 12px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--teal), var(--sky-blue));
  color: white;
  letter-spacing: 0.5px;
}

.guide-text {
  font-size: 14px;
  color: #777;
  line-height: 1.75;
}

.guide-text strong {
  color: var(--coral-pink);
  font-weight: 800;
}

/* 进入题目页后的顶部栏 */
.game-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: white;
  border-radius: 999px;
  padding: 10px 14px 10px 10px;
  margin-bottom: 18px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.06);
  border: 2px solid rgba(255, 183, 197, 0.3);
  flex-wrap: wrap;
}

.game-header .back-btn {
  padding: 9px 16px;
  font-size: 14px;
  flex-shrink: 0;
}

.game-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 18px;
  font-weight: 800;
  color: #333;
  flex: 1;
  justify-content: center;
  min-width: 120px;
}

.game-icon {
  font-size: 26px;
  filter: drop-shadow(0 2px 3px rgba(0,0,0,0.1));
}

.game-header-right {
  flex-shrink: 0;
}

.setting-group.compact {
  box-shadow: none;
  border: none;
  background: transparent;
  padding: 0 !important;
  margin: 0;
}

/* 首页/题目页 切换动效 */
#home-wrap,
#game-wrap {
  animation: pop 0.4s ease;
}

.mode-selector {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-bottom: 22px;
}

.mode-card {
  background: white;
  border: 3px solid transparent;
  border-radius: 22px;
  padding: 22px 14px;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.06);
  position: relative;
  overflow: hidden;
}

.mode-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--sky-blue), var(--coral-pink));
  transform: scaleX(0);
  transition: transform 0.3s ease;
}

.mode-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.1);
}

.mode-card:hover::before {
  transform: scaleX(1);
}

.mode-card.active {
  border-color: var(--coral-pink);
  background: linear-gradient(135deg, rgba(255, 183, 197, 0.15), rgba(255, 217, 61, 0.1));
  box-shadow: 0 8px 24px rgba(255, 139, 148, 0.18);
}

.mode-card.active::before {
  transform: scaleX(1);
}

.mode-icon {
  font-size: 46px;
  margin-bottom: 8px;
  display: block;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.1));
}

.mode-name {
  font-size: 18px;
  font-weight: 800;
  color: #333;
  margin-bottom: 4px;
}

.mode-desc {
  font-size: 12px;
  color: #999;
  line-height: 1.5;
}

.progress-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: white;
  border-radius: 999px;
  padding: 12px 22px;
  margin-bottom: 22px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.06);
  border: 2px solid rgba(255, 217, 61, 0.2);
}

.progress-info {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  font-weight: 600;
}

.progress-stars {
  font-size: 18px;
  filter: drop-shadow(0 1px 2px rgba(255, 170, 0, 0.4));
}

.progress-count {
  font-weight: 800;
  color: var(--sky-blue);
  font-size: 16px;
}

.progress-track {
  flex: 1;
  max-width: 220px;
  height: 12px;
  background: linear-gradient(180deg, #f0f0f0, #fafafa);
  border-radius: 999px;
  margin: 0 18px;
  overflow: hidden;
  border: 1px solid #eee;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--teal), var(--sky-blue), var(--lavender-purple), var(--coral-pink));
  background-size: 300% 100%;
  border-radius: 999px;
  transition: width 0.4s ease;
  animation: rainbow 4s linear infinite;
  width: 0%;
}

.question-panel {
  background: white;
  border-radius: 28px;
  padding: 34px 26px;
  box-shadow: 0 10px 32px rgba(0, 0, 0, 0.07);
  margin-bottom: 22px;
  animation: pop 0.45s ease;
  border: 2px solid rgba(255, 183, 197, 0.25);
  position: relative;
}

.question-panel::before {
  content: '';
  position: absolute;
  top: -10px; left: 24px;
  font-size: 28px;
  opacity: 0.7;
}

.question-prompt {
  text-align: center;
  font-size: 22px;
  font-weight: 800;
  color: #2b2b2b;
  margin-bottom: 24px;
  line-height: 1.5;
}

.question-prompt .hint {
  font-size: 15px;
  color: #aaa;
  font-weight: 500;
  display: block;
  margin-top: 6px;
}

.objects-display {
  display: grid;
  /* 固定每行 5 个，自动分行排列，便于幼儿逐个数 */
  grid-template-columns: repeat(5, 56px);
  justify-content: center;
  gap: 10px 12px;
  padding: 24px 20px;
  background:
    linear-gradient(135deg, rgba(255, 219, 164, 0.35), rgba(255, 183, 197, 0.25)),
    repeating-linear-gradient(45deg, transparent, transparent 20px, rgba(255,255,255,0.2) 20px, rgba(255,255,255,0.2) 40px);
  border-radius: 22px;
  margin-bottom: 24px;
  min-height: 140px;
  justify-items: center;
  align-content: center;
  border: 3px dashed rgba(255, 183, 197, 0.5);
}

/* 当物品数量少时，也保持居中排列（不要靠左） */
.objects-display.small {
  grid-template-columns: repeat(3, 56px);
}

/* 选项按钮内部的小物品区（选项按钮只有 1/4 屏宽，用 3 列合适） */
.objects-display.mini {
  padding: 10px 8px;
  margin-bottom: 0;
  min-height: 0;
  border: none;
  background: transparent;
  /* 3 个一行，刚好适配 4 列的 choice-btn 宽度 */
  grid-template-columns: repeat(3, 38px);
  gap: 6px 8px;
  /* 防止溢出 */
  width: 100%;
  box-sizing: border-box;
  overflow: hidden;
}

.objects-display.mini .object-item {
  width: 38px;
  height: 38px;
  font-size: 28px;
  border-radius: 10px;
}

.object-item {
  font-size: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  background: white;
  border-radius: 16px;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.08);
  animation: pop 0.35s ease backwards;
  transition: transform 0.2s ease;
}

.object-item:hover {
  transform: scale(1.1) rotate(-4deg);
}

.object-item:nth-child(1) { animation-delay: 0.04s; }
.object-item:nth-child(2) { animation-delay: 0.08s; }
.object-item:nth-child(3) { animation-delay: 0.12s; }
.object-item:nth-child(4) { animation-delay: 0.16s; }
.object-item:nth-child(5) { animation-delay: 0.20s; }
.object-item:nth-child(6) { animation-delay: 0.24s; }
.object-item:nth-child(7) { animation-delay: 0.28s; }
.object-item:nth-child(8) { animation-delay: 0.32s; }
.object-item:nth-child(9) { animation-delay: 0.36s; }
.object-item:nth-child(10) { animation-delay: 0.40s; }

.number-show {
  text-align: center;
  font-size: 110px;
  font-weight: 900;
  background: linear-gradient(135deg, var(--coral-pink), var(--sunshine-yellow), var(--sky-blue), var(--lavender-purple));
  background-size: 300% 300%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin: 18px 0 8px;
  animation: rainbow 5s ease infinite;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.1));
}

.number-zh {
  text-align: center;
  font-size: 24px;
  color: #999;
  margin-bottom: 22px;
  font-weight: 600;
  letter-spacing: 6px;
}

.compare-area {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 16px;
  align-items: stretch;
  margin-bottom: 24px;
}

.compare-group {
  background: linear-gradient(135deg, rgba(255, 219, 164, 0.35), rgba(255, 183, 197, 0.3));
  border-radius: 24px;
  padding: 24px 18px;
  min-height: 180px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(48px, 1fr));
  gap: 8px;
  justify-items: center;
  align-content: center;
  border: 3px solid rgba(255, 183, 197, 0.4);
  position: relative;
  transition: all 0.3s ease;
}

.compare-group.left {
  background: linear-gradient(135deg, rgba(78, 205, 196, 0.25), rgba(77, 150, 255, 0.3));
  border-color: rgba(77, 150, 255, 0.45);
}

.compare-group.right {
  background: linear-gradient(135deg, rgba(255, 169, 77, 0.3), rgba(255, 139, 148, 0.35));
  border-color: rgba(255, 169, 77, 0.45);
}

.compare-group::before {
  content: '';
  position: absolute;
  top: -12px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  font-size: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: white;
  box-shadow: 0 3px 8px rgba(0,0,0,0.1);
  font-weight: 900;
}

.compare-group.left::before {
  content: 'A';
  left: 20px;
  color: var(--sky-blue);
}

.compare-group.right::before {
  content: 'B';
  right: 20px;
  color: var(--orange-warm);
}

.compare-symbol {
  font-size: 52px;
  font-weight: 900;
  color: var(--sunshine-yellow);
  text-align: center;
  align-self: center;
  text-shadow: 0 3px 8px rgba(255, 170, 0, 0.3);
  animation: wiggle 2s ease-in-out infinite;
}

.compare-question {
  text-align: center;
  font-size: 19px;
  color: #666;
  margin-bottom: 10px;
  font-weight: 600;
}

/* 形状卡片 */
.shape-card {
  width: 72px;
  height: 72px;
  border-radius: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: white;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08);
  font-size: 50px;
  transition: transform 0.2s ease;
}

/* 形状/颜色题干大图标 - 居中展示 */
.shape-hero,
.color-hero {
  margin: 18px auto 6px;
  width: 110px;
  height: 110px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 26px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.1);
}

.shape-hero {
  font-size: 90px;
  background: linear-gradient(135deg, rgba(255, 219, 164, 0.5), rgba(255, 183, 197, 0.45));
}

.color-hero {
  border: 4px solid white;
  filter: drop-shadow(0 4px 8px rgba(0,0,0,0.12));
}

.shape-card:hover {
  transform: scale(1.1) rotate(4deg);
}

/* 颜色块 */
.color-block {
  width: 70px;
  height: 70px;
  border-radius: 20px;
  display: inline-block;
  box-shadow: 0 4px 12px rgba(0,0,0,0.12), inset 0 -4px 0 rgba(0,0,0,0.08);
  transition: transform 0.2s ease;
  border: 3px solid white;
}

.color-block:hover {
  transform: scale(1.1) rotate(-4deg);
}

/* 排序区 */
.sort-area {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(70px, 1fr));
  gap: 14px;
  padding: 24px 18px;
  margin-bottom: 20px;
  background: linear-gradient(135deg, rgba(201, 177, 255, 0.25), rgba(78, 205, 196, 0.2));
  border-radius: 22px;
  border: 3px dashed rgba(77, 150, 255, 0.35);
  justify-items: center;
}

.sort-item {
  font-size: 42px;
  background: white;
  padding: 14px 18px;
  border-radius: 18px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
  font-weight: 800;
  cursor: pointer;
  transition: all 0.25s ease;
  color: #333;
}

.sort-item:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 18px rgba(0,0,0,0.12);
}

.sort-item.selected {
  background: linear-gradient(135deg, var(--sunshine-yellow), var(--coral-pink));
  color: white;
  transform: scale(1.05);
}

.sort-answer-row {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  padding: 18px;
  background: linear-gradient(135deg, rgba(255, 249, 230, 0.8), rgba(255, 217, 61, 0.12));
  border-radius: 18px;
  margin-bottom: 20px;
  min-height: 80px;
  border: 2px dotted rgba(255, 217, 61, 0.6);
}

.sort-slot {
  width: 60px;
  height: 60px;
  border-radius: 16px;
  background: white;
  border: 3px dashed rgba(77, 150, 255, 0.4);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 30px;
  font-weight: 800;
  color: var(--sky-blue);
  cursor: pointer;
  transition: all 0.2s ease;
}

.sort-slot:hover {
  border-color: var(--coral-pink);
  transform: scale(1.05);
}

.sort-slot.filled {
  border-style: solid;
  background: linear-gradient(135deg, rgba(255, 183, 197, 0.2), rgba(255, 217, 61, 0.2));
  color: #333;
}

.sort-arrow {
  font-size: 28px;
  color: #bbb;
  font-weight: 700;
}

/* 找不同/找相同 网格 */
.find-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  padding: 22px;
  background: linear-gradient(135deg, rgba(255, 219, 164, 0.3), rgba(201, 177, 255, 0.25));
  border-radius: 22px;
  margin-bottom: 22px;
  border: 3px solid rgba(255, 183, 197, 0.3);
}

.find-item {
  aspect-ratio: 1 / 1;
  background: white;
  border-radius: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 42px;
  cursor: pointer;
  box-shadow: 0 3px 10px rgba(0,0,0,0.06);
  transition: all 0.25s ease;
}

.find-item:hover {
  transform: translateY(-4px) scale(1.04);
  box-shadow: 0 8px 18px rgba(0,0,0,0.12);
}

.find-item.picked {
  background: linear-gradient(135deg, var(--sunshine-yellow), var(--coral-pink));
  transform: scale(1.08);
  box-shadow: 0 6px 16px rgba(255, 139, 148, 0.35);
}

/* 简单加减 - 苹果算式 */
.math-eq {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 28px 22px;
  background: linear-gradient(135deg, rgba(78, 205, 196, 0.2), rgba(201, 177, 255, 0.25));
  border-radius: 24px;
  margin-bottom: 24px;
  border: 3px solid rgba(78, 205, 196, 0.3);
  flex-wrap: wrap;
}

/* 减法模式：改纵向布局，让「原来有 / 划掉」的说明单独占一行 */
.math-eq.math-eq-sub {
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.math-eq.math-eq-sub .emoji-group {
  min-width: 220px;
}

.math-eq .emoji-group {
  display: grid;
  /* 每行最多 5 个，避免减法物品多的时候被挤扁 */
  grid-template-columns: repeat(5, 44px);
  gap: 6px;
  justify-content: center;
  justify-items: center;
  background: white;
  padding: 12px 14px;
  border-radius: 18px;
  box-shadow: 0 3px 8px rgba(0,0,0,0.06);
  min-width: 90px;
}

.math-eq .emoji-item {
  font-size: 30px;
  width: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  position: relative;
  transition: all 0.2s;
}

/* 划掉的物品：红斜线 + 半透明灰色，表示被移除了 */
.math-eq .emoji-item.crossed-out {
  opacity: 0.5;
  filter: grayscale(0.4);
  background: rgba(255, 107, 107, 0.12);
}

.math-eq .emoji-item.crossed-out::after {
  content: '';
  position: absolute;
  inset: 4px;
  background-image: linear-gradient(to top right,
    transparent 46%,
    var(--error-red) 46%,
    var(--error-red) 54%,
    transparent 54%);
  border-radius: 6px;
  pointer-events: none;
}

/* 减法的「原来有/划掉」提示行 */
.math-eq .eq-annotation {
  font-size: 18px;
  font-weight: 700;
  color: #555;
  background: white;
  padding: 8px 16px;
  border-radius: 999px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.06);
  line-height: 1.6;
}

.math-eq .eq-annotation strong {
  display: inline-block;
  min-width: 1.5em;
  text-align: center;
  color: var(--sky-blue);
  font-size: 22px;
  margin: 0 4px;
}

.math-eq .eq-annotation .anno-label {
  color: #888;
  font-weight: 500;
  font-size: 14px;
  margin: 0 2px;
}

.math-eq .eq-annotation .anno-label.anno-del {
  color: var(--error-red);
}

.math-eq .op {
  font-size: 40px;
  font-weight: 900;
  color: var(--coral-pink);
}

.math-eq .eq {
  font-size: 40px;
  font-weight: 900;
  color: var(--sky-blue);
}

.math-eq .eq-box {
  width: 82px;
  height: 82px;
  border-radius: 20px;
  background: white;
  border: 3px dashed var(--sunshine-yellow);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 40px;
  font-weight: 900;
  color: var(--coral-pink);
  box-shadow: 0 3px 10px rgba(0,0,0,0.06);
  animation: wiggle 2.5s ease-in-out infinite;
}

/* 分类模式 */
.category-area {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 18px;
  margin-bottom: 20px;
}

.category-box {
  border-radius: 22px;
  padding: 18px;
  min-height: 200px;
  background: white;
  border: 3px solid;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.category-box.animals {
  border-color: rgba(107, 203, 119, 0.6);
  background: linear-gradient(135deg, rgba(107, 203, 119, 0.12), white);
}

.category-box.fruits {
  border-color: rgba(255, 139, 148, 0.6);
  background: linear-gradient(135deg, rgba(255, 139, 148, 0.12), white);
}

.category-box.vehicles {
  border-color: rgba(77, 150, 255, 0.6);
  background: linear-gradient(135deg, rgba(77, 150, 255, 0.12), white);
}

.category-box.toys {
  border-color: rgba(201, 177, 255, 0.6);
  background: linear-gradient(135deg, rgba(201, 177, 255, 0.12), white);
}

.category-title {
  font-size: 16px;
  font-weight: 800;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.category-box.animals .category-title { color: var(--mint-green); }
.category-box.fruits .category-title { color: var(--coral-pink); }
.category-box.vehicles .category-title { color: var(--sky-blue); }
.category-box.toys .category-title { color: var(--lavender-purple); }

.category-items {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  flex: 1;
  align-content: flex-start;
  width: 100%;
}

.pick-pool {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 10px;
  padding: 18px;
  background: linear-gradient(135deg, rgba(255, 217, 61, 0.18), rgba(255, 183, 197, 0.18));
  border-radius: 22px;
  margin-bottom: 20px;
  border: 3px dashed rgba(255, 217, 61, 0.55);
  justify-items: center;
}

.pick-item {
  font-size: 38px;
  background: white;
  width: 62px;
  height: 62px;
  border-radius: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 3px 10px rgba(0,0,0,0.07);
  transition: all 0.25s ease;
}

.pick-item:hover {
  transform: translateY(-3px) rotate(-5deg);
  box-shadow: 0 8px 18px rgba(0,0,0,0.12);
}

.pick-item.used {
  opacity: 0.3;
  pointer-events: none;
  transform: scale(0.92);
}

/* 选中高亮（分分类模式：物品被点中后的状态） */
.pick-item.selected {
  background: linear-gradient(135deg, rgba(255, 217, 61, 0.65), rgba(255, 183, 197, 0.65)) !important;
  transform: translateY(-4px) scale(1.05);
  box-shadow: 0 10px 22px rgba(255, 139, 148, 0.35), 0 0 0 4px rgba(255, 217, 61, 0.4);
  z-index: 5;
  position: relative;
}

/* 放错后物品卡片摇晃动画（分分类模式） */
.pick-item.wrong-shake {
  animation: shake 0.55s ease;
  transform-origin: center;
}

/* 选项按钮 - 升级版 */
.choices-grid {
  display: grid;
  /* minmax(0,1fr) 防止子元素固定宽度撑破grid */
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-top: 22px;
}

.choices-grid.three-cols {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.choices-grid.two-cols {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.choice-btn {
  background: white;
  border: 3px solid #f0e6d2;
  border-radius: 20px;
  padding: 18px 10px;
  font-size: 26px;
  font-weight: 800;
  color: #333;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  font-family: inherit;
  position: relative;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
  /* 防止内部物品区撑破按钮 */
  overflow: hidden;
  min-width: 0;
  width: 100%;
  box-sizing: border-box;
}

.choice-btn::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 10%;
  right: 10%;
  height: 4px;
  background: linear-gradient(90deg, var(--coral-pink), var(--sunshine-yellow));
  border-radius: 999px;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.choice-btn:hover {
  border-color: var(--coral-pink);
  transform: translateY(-3px);
  background: linear-gradient(135deg, #fffaf3, #fff0f3);
  box-shadow: 0 8px 18px rgba(255, 139, 148, 0.15);
}

.choice-btn:hover::after {
  opacity: 1;
}

.choice-btn.correct {
  border-color: var(--success-green);
  background: linear-gradient(135deg, rgba(107, 203, 119, 0.15), rgba(78, 205, 196, 0.12));
  color: var(--success-green);
  animation: correctPulse 0.7s ease;
}

.choice-btn.correct::after {
  background: linear-gradient(90deg, var(--mint-green), var(--teal));
  opacity: 1;
}

.choice-btn.wrong {
  border-color: var(--error-red);
  background: linear-gradient(135deg, rgba(255, 107, 107, 0.1), rgba(255, 139, 148, 0.08));
  color: var(--error-red);
  animation: shake 0.5s ease;
}

.choice-btn:disabled {
  cursor: not-allowed;
}

.choice-btn small {
  font-size: 12px;
  color: #aaa;
  font-weight: 500;
  display: block;
  margin-top: 4px;
}

.action-bar {
  display: flex;
  justify-content: center;
  gap: 14px;
  /* 和下面的玩法介绍卡片留白，避免按钮和玩法紧贴在一起 */
  margin-top: 10px;
  margin-bottom: 24px;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 30px;
  border-radius: 999px;
  border: none;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.25s ease;
  font-family: inherit;
}

.btn-primary {
  background: linear-gradient(135deg, var(--coral-pink), var(--orange-warm), var(--sunshine-yellow));
  background-size: 200% 200%;
  color: white;
  box-shadow: 0 6px 18px rgba(255, 139, 148, 0.4);
  animation: rainbow 5s ease infinite;
}

.btn-primary:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 26px rgba(255, 139, 148, 0.5);
}

.btn-secondary {
  background: white;
  color: #555;
  border: 2px solid #f0e6d2;
  box-shadow: 0 3px 8px rgba(0,0,0,0.05);
}

.btn-secondary:hover {
  border-color: var(--sky-blue);
  color: var(--sky-blue);
  transform: translateY(-2px);
}

/* 对错反馈弹窗：主题风格一致 */
.feedback-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  pointer-events: none;
  animation: pop 0.4s ease;
  background: radial-gradient(circle at center, rgba(0,0,0,0.15), transparent 65%);
}

.feedback-card {
  background: white;
  padding: 26px 44px 28px;
  border-radius: 36px;
  text-align: center;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.18);
  animation: pop 0.45s cubic-bezier(0.34, 1.56, 0.64, 1);
  position: relative;
  min-width: 220px;
}

.feedback-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 8px;
  border-radius: 36px 36px 0 0;
}

.feedback-card.correct {
  border: 4px solid rgba(107, 203, 119, 0.35);
}
.feedback-card.correct::before {
  background: linear-gradient(90deg, var(--mint-green), var(--teal));
}

.feedback-card.wrong {
  border: 4px solid rgba(255, 139, 148, 0.4);
}
.feedback-card.wrong::before {
  background: linear-gradient(90deg, var(--coral-pink), var(--orange-warm));
}

.feedback-big-emoji {
  font-size: 110px;
  line-height: 1;
  display: inline-block;
  animation: wiggle 1.4s ease-in-out infinite;
  margin-bottom: 10px;
}

.feedback-title {
  font-size: 34px;
  font-weight: 900;
  margin-bottom: 6px;
}
.feedback-card.correct .feedback-title { color: var(--success-green); }
.feedback-card.wrong   .feedback-title { color: var(--coral-pink); }

.feedback-sub {
  font-size: 16px;
  color: #888;
  font-weight: 600;
}

/* 错题面板 */
.wrong-panel {
  background: white;
  border-radius: 28px;
  padding: 30px 24px;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.1);
  animation: pop 0.45s ease;
  border: 3px solid rgba(255, 139, 148, 0.25);
}

.wrong-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}

.wrong-title {
  font-size: 22px;
  font-weight: 900;
  color: #333;
  display: flex;
  align-items: center;
  gap: 10px;
}

.wrong-counter {
  font-size: 15px;
  color: #888;
  background: linear-gradient(135deg, rgba(255, 217, 61, 0.2), rgba(255, 183, 197, 0.2));
  padding: 6px 14px;
  border-radius: 999px;
  font-weight: 700;
}

.wrong-body {
  background: linear-gradient(135deg, rgba(255, 249, 230, 0.6), rgba(255, 217, 61, 0.08));
  border-radius: 22px;
  padding: 22px 18px;
  border: 2px dashed rgba(255, 183, 197, 0.45);
  margin-bottom: 18px;
  min-height: 180px;
}

.wrong-meta {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.meta-box {
  background: white;
  border-radius: 16px;
  padding: 12px 14px;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.05);
}
.meta-box.user  { border-left: 5px solid var(--error-red); }
.meta-box.right { border-left: 5px solid var(--success-green); }

.meta-label {
  font-size: 12px;
  color: #999;
  font-weight: 700;
  margin-bottom: 4px;
}

.meta-value {
  font-size: 20px;
  font-weight: 800;
  color: #333;
}
.meta-box.user  .meta-value { color: var(--error-red); }
.meta-box.right .meta-value { color: var(--success-green); }

/* 错题里的题目快照：禁用按钮/选项点击，保留视觉 */
.question-review-root button,
.question-review-root .choice-btn,
.question-review-root .find-item,
.question-review-root .pick-item,
.question-review-root .sort-item,
.question-review-root .sort-slot,
.question-review-root .category-box {
  pointer-events: none !important;
  cursor: default !important;
  opacity: 0.96;
}

.question-review-root .find-item::before,
.question-review-root .find-item::after {
  display: none;
}

.wrong-nav .nav-btn {
  border: 2px solid #eee;
  background: white;
  border-radius: 999px;
  padding: 10px 18px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  color: #555;
  font-family: inherit;
  transition: all 0.2s ease;
}
.wrong-nav .nav-btn:hover:not(:disabled) {
  border-color: var(--sky-blue);
  color: var(--sky-blue);
  transform: translateY(-2px);
}
.wrong-nav .nav-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.result-panel {
  background: white;
  border-radius: 28px;
  padding: 44px 30px;
  text-align: center;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.1);
  animation: pop 0.5s ease;
  border: 3px solid rgba(255, 183, 197, 0.3);
  position: relative;
  overflow: hidden;
}

.result-panel::before,
.result-panel::after {
  content: '🎉';
  position: absolute;
  font-size: 60px;
  opacity: 0.15;
}

.result-panel::before {
  top: 10px; left: 20px;
  transform: rotate(-20deg);
}

.result-panel::after {
  bottom: 10px; right: 20px;
  transform: rotate(20deg);
}

.result-icon {
  font-size: 100px;
  margin-bottom: 14px;
  filter: drop-shadow(0 4px 8px rgba(0,0,0,0.1));
  animation: wiggle 2s ease-in-out infinite;
}

.result-title {
  font-size: 30px;
  font-weight: 900;
  color: #2b2b2b;
  margin-bottom: 10px;
}

.result-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin: 30px 0 24px;
}

.result-stat {
  background: linear-gradient(135deg, var(--cream-white), #fff);
  border-radius: 20px;
  padding: 22px 10px;
  box-shadow: inset 0 -3px 0 rgba(0,0,0,0.04);
}

.stat-value {
  font-size: 36px;
  font-weight: 900;
  color: var(--sky-blue);
  display: block;
}

.stat-label {
  font-size: 13px;
  color: #999;
  margin-top: 6px;
  font-weight: 600;
}

.result-stat.good .stat-value {
  color: var(--success-green);
}

.result-stat.bad .stat-value {
  color: var(--error-red);
}

.encouragement {
  font-size: 17px;
  color: #777;
  margin-bottom: 28px;
  line-height: 1.7;
  font-weight: 500;
}

.site-footer {
  text-align: center;
  padding: 34px 20px;
  color: #999;
  font-size: 13px;
}

.footer-links {
  justify-content: center;
  margin-bottom: 14px;
}

@media (max-width: 680px) {
  .page-title {
    font-size: 25px;
  }

  .game-header {
    gap: 8px;
    padding: 10px;
    flex-direction: column;
    align-items: stretch;
    border-radius: 22px;
  }

  .game-header .back-btn {
    align-self: flex-start;
  }

  .game-title {
    justify-content: center;
    order: -1;
    font-size: 20px;
  }

  .game-header-right {
    width: 100%;
  }

  .game-header-right .setting-group {
    padding: 6px 10px !important;
  }

  .game-header-right .setting-label {
    width: auto;
  }

  .settings-bar {
    padding: 0 4px;
  }

  .setting-group {
    width: 100%;
    gap: 8px;
    padding: 10px 12px;
  }

  .setting-label {
    width: 100%;
    text-align: center;
  }

  .segmented {
    width: 100%;
    justify-content: space-between;
  }

  .seg-btn {
    flex: 1;
    padding: 8px 10px;
    font-size: 13px;
  }

  .play-guide {
    padding: 14px 16px;
    gap: 10px;
  }

  .guide-icon {
    font-size: 28px;
  }

  .mode-selector {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }

  .mode-card {
    display: flex;
    align-items: center;
    text-align: left;
    padding: 16px 14px;
    gap: 12px;
  }

  .mode-icon {
    font-size: 34px;
    margin-bottom: 0;
    flex-shrink: 0;
  }

  .mode-info {
    flex: 1;
  }

  .mode-name {
    font-size: 15px;
    margin-bottom: 2px;
  }

  .mode-desc {
    font-size: 11px;
  }

  .choices-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .choices-grid.three-cols {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .compare-area {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .compare-symbol {
    transform: rotate(90deg);
    padding: 4px 0;
  }

  .result-stats {
    grid-template-columns: 1fr;
  }

  .number-show {
    font-size: 80px;
  }

  .object-item {
    width: 48px;
    height: 48px;
    font-size: 36px;
    border-radius: 14px;
  }

  .objects-display {
    /* 手机端固定每行 4 个，自动分行 */
    grid-template-columns: repeat(4, 46px);
    gap: 8px 10px;
    padding: 18px 14px;
  }

  .objects-display .object-item {
    width: 46px;
    height: 46px;
    font-size: 36px;
    border-radius: 12px;
  }

  .objects-display.mini {
    /* 手机端选项是 2 列，每列更窄，每行 2 个 */
    grid-template-columns: repeat(2, 34px);
    gap: 6px 8px;
  }

  .objects-display.mini .object-item {
    width: 34px;
    height: 34px;
    font-size: 24px;
    border-radius: 10px;
  }

  .progress-bar {
    flex-wrap: wrap;
    gap: 10px;
    padding: 12px 18px;
  }

  .progress-track {
    order: 3;
    max-width: 100%;
    width: 100%;
    margin: 0;
  }

  .find-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .category-area {
    grid-template-columns: 1fr;
  }

  .pick-pool {
    grid-template-columns: repeat(4, 1fr);
  }

  .sort-answer-row {
    gap: 6px;
    padding: 14px 10px;
  }

  .sort-slot {
    width: 48px;
    height: 48px;
    font-size: 24px;
  }

  /* 手机端：算一算模式缩小尺寸 */
  .math-eq {
    padding: 18px 12px;
    gap: 10px;
  }

  .math-eq .emoji-group {
    grid-template-columns: repeat(5, 36px);
    gap: 4px;
    padding: 10px 10px;
    min-width: 0 !important;
  }

  .math-eq .emoji-item {
    width: 36px;
    height: 36px;
    font-size: 24px;
  }

  .math-eq .eq-annotation {
    font-size: 14px;
    padding: 6px 12px;
  }

  .math-eq .eq-annotation strong {
    font-size: 18px;
    min-width: 1.2em;
  }

  .math-eq .eq-box {
    width: 64px;
    height: 64px;
    font-size: 30px;
    border-radius: 16px;
  }

  .math-eq .op,
  .math-eq .eq {
    font-size: 28px;
  }

  .choice-btn div[style*="44px"] {
    font-size: 32px !important;
  }
}

@media (max-width: 420px) {
  .mode-selector {
    grid-template-columns: 1fr;
  }
}
