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

body {
  font-family: 'Microsoft YaHei', 'Arial', sans-serif;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  min-height: 100vh;
  color: #333;
  overflow-x: hidden;
}

/* 标题样式 */
h2 {
  font-size: 2.5em;
  color: #fff;
  text-align: center;
  margin-bottom: 30px;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

@media (max-width: 1024px) {
  h2 {
    font-size: 2.2em;
    margin-bottom: 25px;
  }
}

@media (max-width: 768px) {
  h2 {
    font-size: 1.8em;
    margin-bottom: 20px;
  }
}

@media (max-width: 480px) {
  h2 {
    font-size: 1.5em;
    margin-bottom: 15px;
  }
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
  width: 100%;
}

/* 小屏幕容器优化 */
@media (max-width: 1024px) {
  .container {
    padding: 15px;
  }
}

@media (max-width: 768px) {
  .container {
    padding: 10px;
  }
}

/* 屏幕切换 */
.screen {
  display: none;
  min-height: 100vh;
  padding: 20px;
}

@media (max-width: 1024px) {
  .screen {
    padding: 15px;
  }
}

@media (max-width: 768px) {
  .screen {
    padding: 10px;
    min-height: auto;
  }
}

.screen.active {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

/* 主界面 */
.title {
  font-size: 3.5em;
  color: #fff;
  text-align: center;
  margin-bottom: 10px;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.subtitle {
  font-size: 1.5em;
  color: #fff;
  text-align: center;
  margin-bottom: 40px;
  opacity: 0.9;
}

/* 中等屏幕优化 */
@media (max-width: 1024px) {
  .title {
    font-size: 2.8em;
  }

  .subtitle {
    font-size: 1.3em;
    margin-bottom: 30px;
  }
}

.menu-buttons {
  display: flex;
  flex-direction: column;
  gap: 20px;
  align-items: center;
  margin-bottom: 40px;
}

@media (max-width: 1024px) {
  .menu-buttons {
    gap: 15px;
    margin-bottom: 30px;
  }
}

@media (max-width: 768px) {
  .menu-buttons {
    gap: 12px;
    margin-bottom: 20px;
  }
}

.btn {
  padding: 20px 40px;
  font-size: 1.5em;
  border: none;
  border-radius: 15px;
  cursor: pointer;
  transition: all 0.3s;
  font-weight: bold;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
  min-width: 250px;
}

/* 按钮下方英文副标题 */
.btn .en {
  display: block;
  font-size: 0.5em;
  font-weight: 600;
  opacity: 0.9;
  margin-top: 6px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

@media (max-width: 1024px) {
  .btn {
    padding: 16px 32px;
    font-size: 1.3em;
    min-width: 220px;
  }
}

@media (max-width: 768px) {
  .btn {
    padding: 14px 28px;
    font-size: 1.1em;
    min-width: 200px;
    border-radius: 12px;
  }
}

.btn-primary {
  background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
  color: white;
}

.btn-primary:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

.btn-secondary {
  background: white;
  color: #667eea;
}

.btn-secondary:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

.btn-back {
  background: #6c757d;
  color: white;
  margin-top: 30px;
}

.btn-small {
  padding: 10px 20px;
  font-size: 1em;
  min-width: auto;
}

.progress-summary {
  display: flex;
  gap: 40px;
  justify-content: center;
  margin-top: 30px;
}

@media (max-width: 1024px) {
  .progress-summary {
    gap: 30px;
    margin-top: 25px;
  }
}

@media (max-width: 768px) {
  .progress-summary {
    gap: 20px;
    margin-top: 20px;
    flex-wrap: wrap;
  }
}

.stat-item {
  background: rgba(255, 255, 255, 0.2);
  padding: 20px 30px;
  border-radius: 15px;
  text-align: center;
  backdrop-filter: blur(10px);
}

@media (max-width: 1024px) {
  .stat-item {
    padding: 16px 24px;
  }
}

@media (max-width: 768px) {
  .stat-item {
    padding: 12px 18px;
    border-radius: 12px;
  }
}

.stat-label {
  display: block;
  color: #fff;
  font-size: 1em;
  margin-bottom: 10px;
}

@media (max-width: 768px) {
  .stat-label {
    font-size: 0.9em;
    margin-bottom: 8px;
  }
}

.stat-value {
  width: 45px;
  box-sizing: border-box;
  display: block;
  color: #fff;
  font-size: 2em;
  font-weight: bold;
}

@media (max-width: 1024px) {
  .stat-value {
    font-size: 1.7em;
  }
}

@media (max-width: 768px) {
  .stat-value {
    font-size: 1.5em;
  }
}

/* 关卡选择 */
.level-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
  margin: 30px 0;
}

@media (max-width: 1024px) {
  .level-grid {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 15px;
    margin: 25px 0;
  }
}

@media (max-width: 768px) {
  .level-grid {
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 12px;
    margin: 20px 0;
  }
}

.level-card {
  background: white;
  border-radius: 20px;
  padding: 30px;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

@media (max-width: 1024px) {
  .level-card {
    padding: 24px;
    border-radius: 16px;
  }
}

@media (max-width: 768px) {
  .level-card {
    padding: 18px;
    border-radius: 12px;
  }
}

.level-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
}

.level-icon {
  font-size: 4em;
  margin-bottom: 15px;
}

@media (max-width: 1024px) {
  .level-icon {
    font-size: 3.2em;
    margin-bottom: 12px;
  }
}

@media (max-width: 768px) {
  .level-icon {
    font-size: 2.5em;
    margin-bottom: 10px;
  }
}

.level-title {
  font-size: 1.2em;
  font-weight: bold;
  color: #333;
  margin-bottom: 10px;
}

/* 关卡卡片下方英文副标题 */
.level-en {
  font-size: 0.85rem;
  color: #5a6b7b;
  font-weight: 500;
  margin-top: -4px;
  margin-bottom: 8px;
}

@media (max-width: 1024px) {
  .level-title {
    font-size: 1.1em;
    margin-bottom: 8px;
  }
}

@media (max-width: 768px) {
  .level-title {
    font-size: 1em;
    margin-bottom: 6px;
  }
}

.level-stars {
  color: #ffd700;
  font-size: 1.5em;
}

@media (max-width: 768px) {
  .level-stars {
    font-size: 1.2em;
  }
}

/* 游戏界面 */
.game-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 30px;
  background: rgba(255, 255, 255, 0.9);
  padding: 15px 20px;
  border-radius: 15px;
  flex-wrap: wrap;
  gap: 10px;
}

@media (max-width: 1024px) {
  .game-header {
    margin-bottom: 20px;
    padding: 12px 16px;
  }
}

@media (max-width: 768px) {
  .game-header {
    margin-bottom: 15px;
    padding: 10px 12px;
    border-radius: 12px;
  }
}

.game-stats {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
}

@media (max-width: 1024px) {
  .game-stats {
    gap: 15px;
  }
}

@media (max-width: 768px) {
  .game-stats {
    gap: 10px;
  }
}

.stat {
  font-size: 1.2em;
  font-weight: bold;
  color: #333;
}

@media (max-width: 1024px) {
  .stat {
    font-size: 1.1em;
  }
}

@media (max-width: 768px) {
  .stat {
    font-size: 1em;
  }
}

/* 练习区域 */
.practice-area {
  background: rgba(255, 255, 255, 0.95);
  border-radius: 20px;
  padding: 40px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.2);
}

@media (max-width: 1024px) {
  .practice-area {
    padding: 30px;
    border-radius: 16px;
  }
}

@media (max-width: 768px) {
  .practice-area {
    padding: 20px;
    border-radius: 12px;
  }
}

.task-display {
  text-align: center;
  margin-bottom: 30px;
}

@media (max-width: 1024px) {
  .task-display {
    margin-bottom: 25px;
  }
}

@media (max-width: 768px) {
  .task-display {
    margin-bottom: 20px;
  }
}

.task-text {
  font-size: 4em;
  font-weight: bold;
  color: #667eea;
  margin-bottom: 20px;
  min-height: 100px;
  display: flex;
  align-items: center;
  justify-content: center;
  word-break: break-word;
  line-height: 1.2;
}

@media (max-width: 1024px) {
  .task-text {
    font-size: 3em;
    min-height: 80px;
    margin-bottom: 15px;
  }
}

@media (max-width: 768px) {
  .task-text {
    font-size: 2.2em;
    min-height: 60px;
    margin-bottom: 12px;
  }
}

.task-image {
  font-size: 4.5em;
  margin: 20px 0;
}

@media (max-width: 1024px) {
  .task-image {
    font-size: 4.5em;
    margin: 15px 0;
  }
}

@media (max-width: 768px) {
  .task-image {
    font-size: 3.5em;
    margin: 12px 0;
  }
}

.input-area {
  margin: 30px 0;
  text-align: center;
}

@media (max-width: 1024px) {
  .input-area {
    margin: 25px 0;
  }
}

@media (max-width: 768px) {
  .input-area {
    margin: 20px 0;
  }
}

.input-hint {
  font-size: 1.5em;
  color: #6c757d;
  margin-top: 10px;
}

@media (max-width: 1024px) {
  .input-hint {
    font-size: 1.3em;
  }
}

@media (max-width: 768px) {
  .input-hint {
    font-size: 1.1em;
    margin-top: 8px;
  }
}

.input-hint .highlight {
  color: #667eea;
  font-weight: bold;
  font-size: 1.2em;
}

/* 虚拟键盘 */
.virtual-keyboard-container {
  margin: 30px 0;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}

.virtual-keyboard-container::-webkit-scrollbar {
  height: 8px;
}

.virtual-keyboard-container::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.1);
  border-radius: 4px;
}

.virtual-keyboard-container::-webkit-scrollbar-thumb {
  background: rgba(102, 126, 234, 0.5);
  border-radius: 4px;
}

.virtual-keyboard-container::-webkit-scrollbar-thumb:hover {
  background: rgba(102, 126, 234, 0.7);
}

@media (max-width: 1024px) {
  .virtual-keyboard-container {
    margin: 25px 0;
  }
}

@media (max-width: 768px) {
  .virtual-keyboard-container {
    margin: 20px 0;
  }
}

.virtual-keyboard {
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: #e9ecef;
  padding: 20px;
  border-radius: 15px;
  min-width: fit-content;
}

@media (max-width: 1024px) {
  .virtual-keyboard {
    padding: 16px;
    gap: 6px;
    border-radius: 12px;
  }
}

@media (max-width: 768px) {
  .virtual-keyboard {
    padding: 12px;
    gap: 5px;
    border-radius: 10px;
  }
}

.keyboard-row {
  display: flex;
  justify-content: center;
  gap: 6px;
  flex-wrap: nowrap;
}

@media (max-width: 1024px) {
  .keyboard-row {
    gap: 5px;
  }
}

@media (max-width: 768px) {
  .keyboard-row {
    gap: 4px;
  }
}

.key {
  min-width: 50px;
  height: 50px;
  background: white;
  border: 2px solid #dee2e6;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2em;
  font-weight: bold;
  color: #333;
  cursor: pointer;
  transition: all 0.2s;
  user-select: none;
  flex-shrink: 0;
}

@media (max-width: 1024px) {
  .key {
    min-width: 42px;
    height: 42px;
    font-size: 1.1em;
    border-radius: 7px;
  }
}

@media (max-width: 768px) {
  .key {
    min-width: 35px;
    height: 35px;
    font-size: 0.95em;
    border-radius: 6px;
    border-width: 1.5px;
  }
}

.key:hover {
  background: #f8f9fa;
  transform: scale(1.05);
}

.key.active {
  background: #667eea;
  color: white;
  border-color: #667eea;
  transform: scale(1.1);
  box-shadow: 0 4px 10px rgba(102, 126, 234, 0.4);
}

.key.highlight {
  background: #ffd700;
  color: #333;
  border-color: #ffd700;
  animation: pulse 1s infinite;
}

@keyframes pulse {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.15);
  }
}

.key.space {
  min-width: 300px;
}

@media (max-width: 1024px) {
  .key.space {
    min-width: 250px;
  }
}

@media (max-width: 768px) {
  .key.space {
    min-width: 200px;
    font-size: 0.85em;
  }
}

/* 反馈区域 */
.feedback-area {
  text-align: center;
  min-height: 100px;
  margin-top: 20px;
}

@media (max-width: 1024px) {
  .feedback-area {
    min-height: 80px;
    margin-top: 15px;
  }
}

@media (max-width: 768px) {
  .feedback-area {
    min-height: 60px;
    margin-top: 12px;
  }
}

.feedback {
  font-size: 2em;
  font-weight: bold;
  padding: 20px;
  border-radius: 15px;
  animation: fadeIn 0.3s;
}

@media (max-width: 1024px) {
  .feedback {
    font-size: 1.6em;
    padding: 16px;
  }
}

@media (max-width: 768px) {
  .feedback {
    font-size: 1.3em;
    padding: 12px;
    border-radius: 12px;
  }
}

.feedback.correct {
  color: #28a745;
  background: #d4edda;
}

.feedback.wrong {
  color: #dc3545;
  background: #f8d7da;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* 游戏模式 */
.game-area {
  background: rgba(255, 255, 255, 0.95);
  border-radius: 20px;
  padding: 20px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.2);
  position: relative;
  width: 100%;

  height: 600px;
}

@media (max-width: 1024px) {
  .game-area {
    padding: 16px;
    border-radius: 16px;
    height: 500px;
    max-width: 100%;
  }
}

@media (max-width: 768px) {
  .game-area {
    padding: 12px;
    border-radius: 12px;
    height: 400px;
  }
}

.game-canvas {
  width: 100%;
  height: 100%;
  position: relative;
  background: linear-gradient(180deg, #87ceeb 0%, #98d8c8 100%);
  border-radius: 15px;
  overflow: hidden;
}

@media (max-width: 1024px) {
  .game-canvas {
    border-radius: 12px;
  }
}

@media (max-width: 768px) {
  .game-canvas {
    border-radius: 10px;
  }
}

.game-score {
  position: absolute;
  top: 20px;
  right: 20px;
  background: rgba(255, 255, 255, 0.9);
  padding: 15px 20px;
  border-radius: 10px;
  font-size: 1.2em;
  font-weight: bold;
  z-index: 10;
}

@media (max-width: 1024px) {
  .game-score {
    top: 15px;
    right: 15px;
    padding: 12px 16px;
    font-size: 1.1em;
  }
}

@media (max-width: 768px) {
  .game-score {
    top: 10px;
    right: 10px;
    padding: 8px 12px;
    font-size: 0.95em;
    border-radius: 8px;
  }
}

.bubble {
  position: absolute;
  width: 60px;
  height: 60px;
  background: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2em;
  font-weight: bold;
  color: #667eea;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
  cursor: pointer;
  transition: all 0.1s;
  animation: floatUp linear;
}

@media (max-width: 1024px) {
  .bubble {
    width: 50px;
    height: 50px;
    font-size: 1.7em;
  }
}

@media (max-width: 768px) {
  .bubble {
    width: 40px;
    height: 40px;
    font-size: 1.4em;
  }
}

.bubble:hover {
  transform: scale(1.1);
}

@keyframes floatUp {
  from {
    bottom: -60px;
  }
  to {
    bottom: 100%;
  }
}

/* 进度界面 */
.progress-details {
  background: white;
  border-radius: 20px;
  padding: 30px;
  margin: 20px 0;
}

@media (max-width: 1024px) {
  .progress-details {
    padding: 24px;
    border-radius: 16px;
  }
}

@media (max-width: 768px) {
  .progress-details {
    padding: 18px;
    border-radius: 12px;
    margin: 15px 0;
  }
}

.progress-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px;
  border-bottom: 1px solid #e9ecef;
  flex-wrap: wrap;
  gap: 10px;
}

@media (max-width: 768px) {
  .progress-item {
    padding: 12px;
    font-size: 0.95em;
  }
}

.progress-item:last-child {
  border-bottom: none;
}

/* 设置界面 */
.settings-list {
  background: white;
  border-radius: 20px;
  padding: 30px;
  margin: 20px 0;
}

@media (max-width: 1024px) {
  .settings-list {
    padding: 24px;
    border-radius: 16px;
  }
}

@media (max-width: 768px) {
  .settings-list {
    padding: 18px;
    border-radius: 12px;
    margin: 15px 0;
  }
}

.setting-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px;
  border-bottom: 1px solid #e9ecef;
  flex-wrap: wrap;
  gap: 10px;
}

@media (max-width: 768px) {
  .setting-item {
    padding: 12px;
  }
}

.setting-item:last-child {
  border-bottom: none;
}

.setting-item label {
  font-size: 1.2em;
  font-weight: bold;
}

@media (max-width: 1024px) {
  .setting-item label {
    font-size: 1.1em;
  }
}

@media (max-width: 768px) {
  .setting-item label {
    font-size: 1em;
  }
}

.setting-item input[type='checkbox'] {
  width: 30px;
  height: 30px;
  cursor: pointer;
}

@media (max-width: 768px) {
  .setting-item input[type='checkbox'] {
    width: 25px;
    height: 25px;
  }
}

.setting-item select {
  padding: 10px 15px;
  font-size: 1em;
  border-radius: 8px;
  border: 2px solid #dee2e6;
  cursor: pointer;
}

@media (max-width: 768px) {
  .setting-item select {
    padding: 8px 12px;
    font-size: 0.95em;
  }
}

/* 响应式设计 - 超小屏幕 */
@media (max-width: 480px) {
  .title {
    font-size: 2em;
  }

  .subtitle {
    font-size: 1em;
    margin-bottom: 20px;
  }

  .btn {
    padding: 12px 24px;
    font-size: 1em;
    min-width: 180px;
  }

  .level-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .task-text {
    font-size: 1.8em;
    min-height: 50px;
  }

  .key {
    min-width: 30px;
    height: 30px;
    font-size: 0.85em;
  }

  .key.space {
    min-width: 180px;
  }

  .game-area {
    height: 350px;
  }

  .bubble {
    width: 35px;
    height: 35px;
    font-size: 1.2em;
  }
}

/* 字体大小设置 */
body.font-large .task-text {
  font-size: 5em;
}

body.font-xlarge .task-text {
  font-size: 6em;
}

/* 字体大小设置在小屏幕上的适配 */
@media (max-width: 1024px) {
  body.font-large .task-text {
    font-size: 3.8em;
  }

  body.font-xlarge .task-text {
    font-size: 4.5em;
  }
}

@media (max-width: 768px) {
  body.font-large .task-text {
    font-size: 2.8em;
  }

  body.font-xlarge .task-text {
    font-size: 3.2em;
  }
}

@media (max-width: 480px) {
  body.font-large .task-text {
    font-size: 2.2em;
  }

  body.font-xlarge .task-text {
    font-size: 2.5em;
  }
}

/* 计时显示 */
.stat .timer {
  font-variant-numeric: tabular-nums;
  color: #e83e8c;
}

#listen-btn {
  background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
  color: #fff;
}

/* 英语情景填句（Level 6）：缺词句子 */
.task-sentence {
  font-size: 2.6em;
  font-weight: bold;
  color: #444;
  margin: 10px 0 6px;
  line-height: 1.5;
  word-break: break-word;
}

@media (max-width: 1024px) {
  .task-sentence {
    font-size: 2em;
  }
}

@media (max-width: 768px) {
  .task-sentence {
    font-size: 1.5em;
  }
}

.blank {
  display: inline-block;
  min-width: 2.4em;
  border-bottom: 4px solid #667eea;
  color: #667eea;
  padding: 0 6px;
  margin: 0 4px;
}

.blank.filled {
  border-bottom-color: #28a745;
  color: #28a745;
}

/* 中文拼音输入区（Level 7） */
.chinese-area {
  text-align: center;
  margin: 10px 0 20px;
}

.chinese-prompt {
  font-size: 2.4em;
  font-weight: bold;
  color: #444;
  margin-bottom: 6px;
}

.chinese-pinyin {
  font-size: 1.6em;
  color: #667eea;
  margin-bottom: 16px;
  letter-spacing: 2px;
}

@media (max-width: 768px) {
  .chinese-prompt {
    font-size: 1.7em;
  }
  .chinese-pinyin {
    font-size: 1.2em;
  }
}

.chinese-input {
  width: 90%;
  max-width: 560px;
  font-size: 2em;
  padding: 14px 18px;
  border: 3px solid #dee2e6;
  border-radius: 14px;
  text-align: center;
  color: #2b2b2b;
  outline: none;
  transition: border-color 0.2s;
}

.chinese-input:focus {
  border-color: #667eea;
}

.chinese-chars {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin: 22px 0 14px;
}

.char-btn {
  min-width: 64px;
  height: 64px;
  font-size: 2em;
  font-weight: bold;
  color: #333;
  background: #fff;
  border: 2px solid #dee2e6;
  border-radius: 12px;
  cursor: pointer;
  user-select: none;
  transition: all 0.15s;
}

.char-btn:hover {
  background: #f1f3ff;
  transform: translateY(-3px);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.char-btn:active {
  transform: scale(0.95);
}

.char-btn.used {
  opacity: 0.35;
  pointer-events: none;
}

.btn-char-back {
  background: #6c757d;
  color: #fff;
  margin-top: 8px;
}

/* 成绩弹窗 */
.result-overlay {
  position: fixed;
  inset: 0;
  background: rgba(40, 30, 80, 0.55);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
}

.result-card {
  background: #fff;
  border-radius: 24px;
  padding: 36px 40px;
  max-width: 460px;
  width: 100%;
  text-align: center;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
  animation: popIn 0.35s ease;
}

@keyframes popIn {
  from { transform: scale(0.8); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.result-card h2 {
  color: #5a4b9c;
  margin-bottom: 16px;
  text-shadow: none;
}

.result-stars {
  font-size: 2.8em;
  margin-bottom: 18px;
  letter-spacing: 6px;
}

.result-stats {
  font-size: 1.25em;
  color: #444;
  line-height: 1.9;
  margin-bottom: 24px;
}

.result-stats .time-big {
  font-size: 1.4em;
  font-weight: bold;
  color: #e83e8c;
}

.result-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: center;
}

.result-actions .btn {
  min-width: 240px;
  margin: 0;
}

.share-toast {
  margin-top: 16px;
  min-height: 22px;
  font-size: 1em;
  color: #28a745;
  font-weight: bold;
}


/* ==================================================================
   SEO 内容区与页脚（搜索引擎可见的静态说明区域，不影响上方游戏界面）
   ================================================================== */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: #fff;
  color: #333;
  padding: 10px 16px;
  border-radius: 0 0 8px 0;
  z-index: 9999;
}
.skip-link:focus {
  left: 0;
}

.seo-content {
  position: relative;
  z-index: 1;
  max-width: 900px;
  margin: 0 auto;
  padding: 30px 20px 10px;
}

.seo-card {
  background: rgba(255, 255, 255, 0.96);
  border-radius: 16px;
  padding: 24px 26px;
  margin-bottom: 20px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
  color: #333;
  line-height: 1.85;
}

.seo-card h2 {
  color: #5a4b9c;
  font-size: 1.5em;
  text-align: left;
  text-shadow: none;
  margin: 0 0 14px;
  padding-bottom: 10px;
  border-bottom: 2px solid #ece7ff;
}

.seo-card p {
  margin: 0 0 10px;
  font-size: 15px;
}

.seo-card strong {
  color: #4b3f86;
}

.seo-meta {
  font-size: 13px;
  color: #6b7280;
  background: #f6f4ff;
  border-radius: 8px;
  padding: 8px 12px;
  margin-top: 12px;
}

.seo-feature-list,
.seo-level-list,
.seo-steps {
  margin: 0;
  padding-left: 22px;
}

.seo-feature-list li,
.seo-level-list li,
.seo-steps li {
  margin-bottom: 8px;
  font-size: 15px;
}

.seo-card details {
  border-bottom: 1px solid #ece7ff;
  padding: 10px 0;
}

.seo-card details:last-of-type {
  border-bottom: none;
}

.seo-card summary {
  cursor: pointer;
  font-weight: 600;
  color: #4b3f86;
  font-size: 15px;
  list-style: none;
}

.seo-card summary::-webkit-details-marker {
  display: none;
}

.seo-card summary::before {
  content: "+ ";
  color: #8b7fd4;
}

.seo-card details[open] summary::before {
  content: "\2212 ";
}

.seo-card details p {
  margin: 8px 0 0;
  color: #555;
  font-size: 14.5px;
}

.seo-card code {
  background: #f0edff;
  color: #6a4fc4;
  padding: 2px 6px;
  border-radius: 5px;
  font-size: 13.5px;
}

.site-footer {
  max-width: 900px;
  margin: 0 auto;
  padding: 18px 20px 34px;
  text-align: center;
  color: rgba(255, 255, 255, 0.92);
  font-size: 13.5px;
}

.site-footer nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 14px;
  margin-bottom: 10px;
}

.site-footer a {
  color: #fff;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.site-footer a:hover {
  opacity: 0.85;
}

.footer-note {
  margin: 0;
  line-height: 1.8;
}

@media (max-width: 768px) {
  .seo-card {
    padding: 18px 16px;
  }

  .seo-card h2 {
    font-size: 1.25em;
  }
}

/* ============================================================
   糖果 / 黏土风皮肤（theme-candy）—— 拟物版
   哑光泡沫颗粒 + 膨胀浮雕 + 顶部镜面高光 + 底部厚度唇边 + 马卡龙装饰
   默认主题不受影响；仅当 <body data-theme="candy"> 时生效
   ============================================================ */
body[data-theme="candy"] {
  /* ---- 拟物材质变量（后代规则可直接复用） ---- */
  --grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='g'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23g)' opacity='0.25'/%3E%3C/svg%3E");

  --card-base: linear-gradient(168deg, #FFFEFB 0%, #FFF7EC 46%, #FBEBDD 100%);
  --card-gloss: radial-gradient(circle at 24% 7%, rgba(255, 255, 255, 0.95) 0 11%, rgba(255, 255, 255, 0) 36%);
  --card-shadow:
    0 30px 54px rgba(190, 82, 116, 0.24),
    0 8px 16px rgba(190, 82, 116, 0.14),
    0 3px 0 rgba(255, 255, 255, 0.9),
    inset 0 7px 12px rgba(255, 255, 255, 0.95),
    inset 0 -11px 18px rgba(233, 178, 200, 0.5),
    inset 9px 0 15px rgba(255, 255, 255, 0.55),
    inset -9px 0 15px rgba(233, 178, 200, 0.22),
    inset 0 0 0 1px rgba(255, 255, 255, 0.65);

  --btn-gloss: radial-gradient(ellipse at 32% 12%, rgba(255, 255, 255, 0.95) 0 7%, rgba(255, 255, 255, 0.3) 18%, rgba(255, 255, 255, 0) 40%);

  --btn-pink:
    0 20px 32px rgba(206, 74, 122, 0.42),
    0 5px 0 rgba(203, 66, 112, 0.6),
    inset 0 7px 11px rgba(255, 255, 255, 0.55),
    inset 0 -9px 14px rgba(178, 48, 96, 0.5),
    inset 0 0 0 1px rgba(255, 255, 255, 0.4);
  --btn-mint:
    0 20px 32px rgba(74, 155, 122, 0.34),
    0 5px 0 rgba(64, 145, 112, 0.55),
    inset 0 7px 11px rgba(255, 255, 255, 0.6),
    inset 0 -9px 14px rgba(50, 130, 96, 0.42),
    inset 0 0 0 1px rgba(255, 255, 255, 0.45);
  --btn-amber:
    0 20px 32px rgba(190, 130, 30, 0.34),
    0 5px 0 rgba(178, 120, 24, 0.55),
    inset 0 7px 11px rgba(255, 255, 255, 0.6),
    inset 0 -9px 14px rgba(160, 105, 12, 0.4),
    inset 0 0 0 1px rgba(255, 255, 255, 0.45);

  --puff-shadow:
    0 7px 12px rgba(199, 91, 122, 0.24),
    0 3px 0 rgba(228, 172, 195, 0.6),
    inset 0 4px 7px rgba(255, 255, 255, 0.92),
    inset 0 -5px 9px rgba(233, 178, 200, 0.45),
    inset 0 0 0 1px rgba(255, 255, 255, 0.75);

  /* ---- 场景背景：柔雾粉 + 马卡龙 + 糖果小点 ---- */
  background:
    radial-gradient(circle at 91% 11%, #FFF3E0 0 28px, #FFDCB8 28px 38px, #F3B78C 38px 44px, transparent 45px),
    radial-gradient(circle at 9% 88%, #EDFBF3 0 32px, #BCEAD7 32px 42px, #8ED9BE 42px 48px, transparent 49px),
    radial-gradient(circle at 21% 17%, rgba(255, 158, 196, 0.5) 0 12px, transparent 13px),
    radial-gradient(circle at 78% 63%, rgba(160, 226, 200, 0.55) 0 15px, transparent 16px),
    radial-gradient(circle at 63% 90%, rgba(255, 214, 130, 0.5) 0 10px, transparent 11px),
    radial-gradient(circle at 33% 76%, rgba(255, 255, 255, 0.55) 0 9px, transparent 10px),
    radial-gradient(circle at 12% 20%, rgba(255, 224, 138, 0.26) 0 92px, transparent 93px),
    radial-gradient(circle at 82% 82%, rgba(255, 158, 196, 0.24) 0 132px, transparent 133px),
    linear-gradient(160deg, #FFE7F0 0%, #FBD3E2 45%, #F5C7DC 100%);
  background-attachment: fixed;
  color: #6a4453;
}

/* 标题 / 副标题 */
body[data-theme="candy"] .title {
  color: #fff;
  text-shadow: 0 4px 14px rgba(199, 91, 122, 0.55);
}
body[data-theme="candy"] .subtitle {
  color: #a83f63;
  opacity: 1;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.9);
}

/* 章节标题（选关 / 进度 / 设置 / 关卡说明 等） */
body[data-theme="candy"] h2 {
  color: #fff;
  text-shadow: 0 3px 9px rgba(199, 91, 122, 0.55);
}

/* 通用卡片：奶油泡沫实体（颗粒 + 光泽 + 浮雕） */
body[data-theme="candy"] .level-card,
body[data-theme="candy"] .seo-card,
body[data-theme="candy"] .result-card,
body[data-theme="candy"] .practice-area,
body[data-theme="candy"] .game-header,
body[data-theme="candy"] .game-area,
body[data-theme="candy"] .stat-item {
  border-radius: 34px;
  background-color: #FFFDF8;
  background-image: var(--grain), var(--card-gloss), var(--card-base);
  background-blend-mode: soft-light, normal, normal;
  box-shadow: var(--card-shadow);
}

/* 关卡卡片 */
body[data-theme="candy"] .level-card {
  border: none;
  padding: 28px 18px;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}
body[data-theme="candy"] .level-card:hover {
  transform: translateY(-7px);
  box-shadow:
    0 38px 64px rgba(190, 82, 116, 0.3),
    0 10px 18px rgba(190, 82, 116, 0.16),
    0 3px 0 rgba(255, 255, 255, 0.9),
    inset 0 7px 12px rgba(255, 255, 255, 0.95),
    inset 0 -11px 18px rgba(233, 178, 200, 0.5),
    inset 9px 0 15px rgba(255, 255, 255, 0.55),
    inset -9px 0 15px rgba(233, 178, 200, 0.22),
    inset 0 0 0 1px rgba(255, 255, 255, 0.65);
}
body[data-theme="candy"] .level-title { color: #8a4a63; }
body[data-theme="candy"] .level-en { color: #b98ca0; }
body[data-theme="candy"] .level-icon { filter: drop-shadow(0 6px 9px rgba(199, 91, 122, 0.32)); }

/* 按钮：糖果软胶实体（镜面高光 + 厚度唇边） */
body[data-theme="candy"] .btn {
  border-radius: 30px;
  color: #fff;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.18);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
body[data-theme="candy"] .btn-primary {
  background-image: var(--btn-gloss),
    linear-gradient(168deg, #FFB7D6 0%, #FF8FBC 44%, #F56CA6 100%);
  box-shadow: var(--btn-pink);
}
body[data-theme="candy"] .btn-secondary {
  background-image: var(--btn-gloss),
    linear-gradient(168deg, #D6F2E4 0%, #A9E3C9 44%, #7ED2B3 100%);
  color: #1f5340;
  text-shadow: none;
  box-shadow: var(--btn-mint);
}
body[data-theme="candy"] .btn-back {
  background-image: var(--btn-gloss),
    linear-gradient(168deg, #FFE9C0 0%, #FFD07A 44%, #F4B242 100%);
  color: #6b3f07;
  text-shadow: none;
  box-shadow: var(--btn-amber);
}
body[data-theme="candy"] .btn-small {
  background-image: var(--btn-gloss),
    linear-gradient(168deg, #FFC9DE 0%, #FF9EC4 100%);
  color: #fff;
  box-shadow: var(--btn-pink);
}
body[data-theme="candy"] .btn:hover {
  transform: translateY(-4px);
}
body[data-theme="candy"] .btn:active {
  transform: translateY(2px);
}

/* 听按钮 */
body[data-theme="candy"] #listen-btn {
  background-image: var(--btn-gloss),
    linear-gradient(168deg, #FFB7D6 0%, #FF8FBC 100%);
  color: #fff;
  border-radius: 24px;
  box-shadow: var(--btn-pink);
}

/* 进度统计块：加厚立体感 */
body[data-theme="candy"] .stat-item {
  padding: 20px 30px;
  border-radius: 26px;
  box-shadow:
    var(--puff-shadow),
    0 14px 26px rgba(199, 91, 122, 0.22);
}
body[data-theme="candy"] .stat-label { color: #c08aa0; }
body[data-theme="candy"] .stat-value { color: #ff6fa3; }

/* 练习区文字 */
body[data-theme="candy"] .task-text { color: #ff6fa3; }
body[data-theme="candy"] .input-hint { color: #a8788c; }
body[data-theme="candy"] .input-hint .highlight { color: #ff6fa3; }
body[data-theme="candy"] .feedback-area { color: #8a4a63; }
body[data-theme="candy"] .feedback { border-radius: 18px; }

/* 中文拼音输入区 */
body[data-theme="candy"] .chinese-prompt { color: #8a4a63; }
body[data-theme="candy"] .chinese-pinyin { color: #ff7fb0; }
body[data-theme="candy"] .chinese-input {
  background-color: #FFFDF8;
  background-image: var(--card-base);
  border: 3px solid #FFD3E2;
  border-radius: 20px;
  box-shadow:
    inset 0 4px 8px rgba(233, 178, 200, 0.45),
    inset 0 -3px 6px rgba(255, 255, 255, 0.9);
}
body[data-theme="candy"] .chinese-input:focus { border-color: #ff7fb0; }

/* 选字按钮：膨胀糖果方块 */
body[data-theme="candy"] .char-btn {
  border: none;
  border-radius: 18px;
  color: #8a4a63;
  background-color: #FFFDF8;
  background-image: var(--card-gloss), var(--card-base);
  box-shadow: var(--puff-shadow);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
body[data-theme="candy"] .char-btn:hover {
  transform: translateY(-4px);
  box-shadow:
    0 12px 18px rgba(199, 91, 122, 0.3),
    0 3px 0 rgba(228, 172, 195, 0.6),
    inset 0 4px 7px rgba(255, 255, 255, 0.95),
    inset 0 -5px 9px rgba(233, 178, 200, 0.45),
    inset 0 0 0 1px rgba(255, 255, 255, 0.8);
}
body[data-theme="candy"] .char-btn:active { transform: translateY(1px) scale(0.96); }
body[data-theme="candy"] .char-btn.used { opacity: 0.38; }
body[data-theme="candy"] .btn-char-back {
  background-image: var(--btn-gloss),
    linear-gradient(168deg, #FFE9C0 0%, #FFD07A 100%);
  color: #6b3f07;
  box-shadow: var(--btn-amber);
}

/* 虚拟键盘：膨胀糖果键 */
body[data-theme="candy"] .virtual-keyboard {
  background-color: #FFEAF2;
  background-image: var(--grain);
  background-blend-mode: soft-light;
  border-radius: 26px;
  box-shadow:
    inset 0 5px 12px rgba(199, 91, 122, 0.16),
    inset 0 -4px 10px rgba(255, 255, 255, 0.7);
}
body[data-theme="candy"] .key {
  border: none;
  border-radius: 16px;
  color: #8a4a63;
  background-color: #FFFDF8;
  background-image: var(--card-gloss), var(--card-base);
  box-shadow: var(--puff-shadow);
}
body[data-theme="candy"] .key:hover {
  transform: translateY(-3px);
}
body[data-theme="candy"] .key.active {
  background-image: var(--btn-gloss),
    linear-gradient(168deg, #FFB7D6 0%, #FF8FBC 100%);
  color: #fff;
  transform: scale(1.08);
  box-shadow: var(--btn-pink);
}
body[data-theme="candy"] .key.highlight {
  background-image: var(--btn-gloss),
    linear-gradient(168deg, #FFE9A0 0%, #FFC94D 100%);
  color: #6b3f07;
  border: none;
  box-shadow: var(--btn-amber);
}

/* 成绩弹窗 */
body[data-theme="candy"] .result-overlay {
  background: rgba(122, 62, 92, 0.55);
}
body[data-theme="candy"] .result-card h2 { color: #ff6fa3; }
body[data-theme="candy"] .result-stats { color: #8a4a63; }
body[data-theme="candy"] .result-stats .time-big { color: #ff6fa3; }

/* SEO 内容卡片 */
body[data-theme="candy"] .seo-card { color: #5a3d4a; }
body[data-theme="candy"] .seo-card h2 {
  color: #ff6fa3;
  border-bottom-color: #ffe1ec;
}
body[data-theme="candy"] .seo-card strong { color: #d65a82; }
body[data-theme="candy"] .seo-meta {
  background: #fff1f6;
  color: #b07a90;
}
body[data-theme="candy"] .seo-card summary { color: #c75b7a; }
body[data-theme="candy"] .seo-card summary::before { color: #ff9ec4; }
body[data-theme="candy"] .seo-card details { border-bottom-color: #ffe1ec; }
body[data-theme="candy"] .seo-card code {
  background: #ffe1ec;
  color: #d65a82;
}

/* 设置控件 */
body[data-theme="candy"] .setting-item label { color: #8a4a63; }
body[data-theme="candy"] input[type="checkbox"] { accent-color: #ff7fb0; width: 20px; height: 20px; }
body[data-theme="candy"] select {
  background-color: #FFFDF8;
  background-image: var(--card-base);
  color: #8a4a63;
  border: 2px solid #ffd3e2;
  border-radius: 14px;
  padding: 6px 10px;
  box-shadow: inset 0 3px 6px rgba(233, 178, 200, 0.4);
}

/* 页脚 */
body[data-theme="candy"] .site-footer { color: rgba(138, 74, 99, 0.92); }
body[data-theme="candy"] .site-footer a { color: #c75b7a; }

/* ============================================================
   换肤提示条（首页主菜单）
   ============================================================ */
.skin-hint {
  display: block;
  margin: 24px auto 0;
  padding: 12px 24px;
  max-width: 92%;
  font-size: 1em;
  font-family: inherit;
  font-weight: 700;
  color: #fff;
  background: rgba(255, 255, 255, 0.2);
  border: 2px solid rgba(255, 255, 255, 0.38);
  border-radius: 999px;
  cursor: pointer;
  backdrop-filter: blur(6px);
  transition: transform 0.2s ease, background 0.2s ease;
}
.skin-hint:hover {
  transform: translateY(-2px);
  background: rgba(255, 255, 255, 0.32);
}

/* ============================================================
   星空皮肤（theme-starry）—— 深色夜空 + 星点 + 月晕 + 微光卡片
   ============================================================ */
body[data-theme="starry"] {
  --grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='g'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23g)' opacity='0.25'/%3E%3C/svg%3E");
  --card-base: linear-gradient(168deg, #2C3364 0%, #232A56 46%, #1C2249 100%);
  --card-gloss: radial-gradient(circle at 24% 6%, rgba(180, 200, 255, 0.22) 0 12%, rgba(180, 200, 255, 0) 38%);
  --card-shadow:
    0 26px 50px rgba(0, 0, 0, 0.5),
    0 10px 20px rgba(0, 0, 0, 0.35),
    0 0 30px rgba(120, 145, 255, 0.12),
    inset 0 7px 14px rgba(165, 190, 255, 0.14),
    inset 0 -12px 20px rgba(0, 0, 0, 0.38),
    inset 0 0 0 1px rgba(150, 175, 255, 0.18);
  --btn-gloss: radial-gradient(ellipse at 32% 12%, rgba(255, 255, 255, 0.35) 0 7%, rgba(255, 255, 255, 0.08) 18%, rgba(255, 255, 255, 0) 42%);
  --btn-violet:
    0 20px 34px rgba(80, 60, 200, 0.5),
    0 5px 0 rgba(70, 52, 180, 0.7),
    inset 0 7px 11px rgba(200, 210, 255, 0.28),
    inset 0 -9px 14px rgba(35, 20, 110, 0.55),
    inset 0 0 0 1px rgba(190, 200, 255, 0.28);
  --btn-teal:
    0 20px 34px rgba(30, 150, 150, 0.4),
    0 5px 0 rgba(24, 130, 128, 0.6),
    inset 0 7px 11px rgba(220, 255, 252, 0.4),
    inset 0 -9px 14px rgba(10, 90, 88, 0.45),
    inset 0 0 0 1px rgba(210, 250, 246, 0.35);
  --btn-gold:
    0 20px 34px rgba(190, 140, 40, 0.4),
    0 5px 0 rgba(170, 120, 26, 0.6),
    inset 0 7px 11px rgba(255, 245, 210, 0.5),
    inset 0 -9px 14px rgba(120, 80, 6, 0.45),
    inset 0 0 0 1px rgba(255, 240, 200, 0.4);
  --puff-shadow:
    0 7px 14px rgba(0, 0, 0, 0.45),
    0 3px 0 rgba(12, 16, 40, 0.7),
    inset 0 4px 8px rgba(170, 195, 255, 0.16),
    inset 0 -5px 10px rgba(0, 0, 0, 0.4),
    inset 0 0 0 1px rgba(150, 175, 255, 0.2);

  background:
    radial-gradient(circle at 88% 12%, #FFF8E2 0 23px, #FFEBB0 23px 31px, rgba(255, 226, 160, 0.26) 31px 56px, transparent 57px),
    radial-gradient(circle at 16% 22%, #ffffff 0 1.6px, transparent 2.6px),
    radial-gradient(circle at 34% 12%, #ffffff 0 1.2px, transparent 2.2px),
    radial-gradient(circle at 58% 20%, #dfe7ff 0 1.8px, transparent 2.8px),
    radial-gradient(circle at 72% 30%, #ffffff 0 1.3px, transparent 2.3px),
    radial-gradient(circle at 8% 44%, #ffffff 0 1.5px, transparent 2.5px),
    radial-gradient(circle at 45% 52%, #e8ecff 0 1.2px, transparent 2.2px),
    radial-gradient(circle at 92% 46%, #ffffff 0 1.7px, transparent 2.7px),
    radial-gradient(circle at 26% 68%, #ffffff 0 1.3px, transparent 2.3px),
    radial-gradient(circle at 66% 72%, #dfe7ff 0 1.5px, transparent 2.5px),
    radial-gradient(circle at 12% 84%, #ffffff 0 1.2px, transparent 2.2px),
    radial-gradient(circle at 84% 88%, #ffffff 0 1.6px, transparent 2.6px),
    radial-gradient(circle at 20% 26%, rgba(124, 108, 240, 0.26) 0 150px, transparent 151px),
    radial-gradient(circle at 80% 78%, rgba(80, 200, 220, 0.18) 0 170px, transparent 171px),
    linear-gradient(165deg, #0E1430 0%, #1A1F4E 42%, #2B1B4E 100%);
  background-attachment: fixed;
  color: #e6eaff;
}

body[data-theme="starry"] .title {
  color: #fff;
  text-shadow: 0 0 18px rgba(150, 175, 255, 0.8), 0 4px 10px rgba(0, 0, 0, 0.5);
}
body[data-theme="starry"] .subtitle {
  color: #c9d3ff;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.45);
}
body[data-theme="starry"] h2 {
  color: #e6eaff;
  text-shadow: 0 0 14px rgba(150, 175, 255, 0.55);
}

body[data-theme="starry"] .level-card,
body[data-theme="starry"] .seo-card,
body[data-theme="starry"] .result-card,
body[data-theme="starry"] .practice-area,
body[data-theme="starry"] .game-header,
body[data-theme="starry"] .game-area,
body[data-theme="starry"] .stat-item {
  border-radius: 34px;
  background-color: #232a55;
  background-image: var(--grain), var(--card-gloss), var(--card-base);
  background-blend-mode: soft-light, normal, normal;
  box-shadow: var(--card-shadow);
}
body[data-theme="starry"] .level-card {
  border: none;
  padding: 28px 18px;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}
body[data-theme="starry"] .level-card:hover {
  transform: translateY(-7px);
  box-shadow:
    0 34px 60px rgba(0, 0, 0, 0.55),
    0 0 38px rgba(130, 155, 255, 0.22),
    inset 0 7px 14px rgba(165, 190, 255, 0.18),
    inset 0 -12px 20px rgba(0, 0, 0, 0.38),
    inset 0 0 0 1px rgba(170, 195, 255, 0.32);
}
body[data-theme="starry"] .level-title { color: #e9edff; }
body[data-theme="starry"] .level-en { color: #9fa9d8; }
body[data-theme="starry"] .level-icon { filter: drop-shadow(0 6px 12px rgba(120, 150, 255, 0.45)); }

body[data-theme="starry"] .btn {
  border-radius: 30px;
  color: #fff;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.25);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
body[data-theme="starry"] .btn-primary {
  background-image: var(--btn-gloss), linear-gradient(168deg, #8B7CF6 0%, #6C57E8 46%, #533FD0 100%);
  box-shadow: var(--btn-violet);
}
body[data-theme="starry"] .btn-secondary {
  background-image: var(--btn-gloss), linear-gradient(168deg, #7FE0D8 0%, #46C4BB 46%, #2FA79F 100%);
  color: #06322e;
  text-shadow: none;
  box-shadow: var(--btn-teal);
}
body[data-theme="starry"] .btn-back {
  background-image: var(--btn-gloss), linear-gradient(168deg, #FFE0A0 0%, #F5B942 46%, #E0A62C 100%);
  color: #4a3305;
  text-shadow: none;
  box-shadow: var(--btn-gold);
}
body[data-theme="starry"] .btn-small {
  background-image: var(--btn-gloss), linear-gradient(168deg, #8B7CF6 0%, #6C57E8 100%);
  color: #fff;
  box-shadow: var(--btn-violet);
}
body[data-theme="starry"] .btn:hover { transform: translateY(-4px); }
body[data-theme="starry"] .btn:active { transform: translateY(2px); }
body[data-theme="starry"] #listen-btn {
  background-image: var(--btn-gloss), linear-gradient(168deg, #8B7CF6 0%, #6C57E8 100%);
  color: #fff;
  border-radius: 24px;
  box-shadow: var(--btn-violet);
}

body[data-theme="starry"] .stat-item {
  padding: 20px 30px;
  border-radius: 26px;
  box-shadow: var(--puff-shadow), 0 14px 26px rgba(0, 0, 0, 0.4);
}
body[data-theme="starry"] .stat-label { color: #9fa9d8; }
body[data-theme="starry"] .stat-value { color: #ffd98a; }
body[data-theme="starry"] .stat { color: #dfe6ff; }

body[data-theme="starry"] .task-text { color: #aab6ff; }
body[data-theme="starry"] .input-hint { color: #98a3d0; }
body[data-theme="starry"] .input-hint .highlight { color: #ffd98a; }
body[data-theme="starry"] .feedback-area { color: #dfe6ff; }
body[data-theme="starry"] .feedback { border-radius: 18px; }
body[data-theme="starry"] .feedback.correct {
  color: #8fe9b0;
  background: rgba(46, 160, 105, 0.28);
}
body[data-theme="starry"] .feedback.wrong {
  color: #ffa9b4;
  background: rgba(180, 60, 80, 0.28);
}
body[data-theme="starry"] .blank {
  border-bottom-color: #8b7cf6;
  color: #bcc6ff;
}
body[data-theme="starry"] .blank.filled {
  border-bottom-color: #8fe9b0;
  color: #8fe9b0;
}

body[data-theme="starry"] .chinese-prompt { color: #e9edff; }
body[data-theme="starry"] .chinese-pinyin { color: #aab6ff; }
body[data-theme="starry"] .chinese-input {
  background-color: #1e2448;
  background-image: var(--card-base);
  border-color: #4a5490;
  border-radius: 20px;
  color: #e9edff;
  box-shadow: inset 0 4px 8px rgba(0, 0, 0, 0.4);
}
body[data-theme="starry"] .chinese-input:focus { border-color: #8b7cf6; }

body[data-theme="starry"] .char-btn {
  border: none;
  border-radius: 18px;
  color: #dfe6ff;
  background-color: #262d5c;
  background-image: var(--card-gloss), var(--card-base);
  box-shadow: var(--puff-shadow);
}
body[data-theme="starry"] .char-btn:hover { transform: translateY(-4px); }
body[data-theme="starry"] .char-btn:active { transform: translateY(1px) scale(0.96); }
body[data-theme="starry"] .char-btn.used { opacity: 0.38; }
body[data-theme="starry"] .btn-char-back {
  background-image: var(--btn-gloss), linear-gradient(168deg, #FFE0A0 0%, #F5B942 100%);
  color: #4a3305;
  box-shadow: var(--btn-gold);
}

body[data-theme="starry"] .virtual-keyboard {
  background-color: #1c2249;
  background-image: var(--grain);
  background-blend-mode: soft-light;
  border-radius: 26px;
  box-shadow: inset 0 5px 12px rgba(0, 0, 0, 0.45), inset 0 -4px 10px rgba(150, 175, 255, 0.14);
}
body[data-theme="starry"] .key {
  border: none;
  border-radius: 16px;
  color: #dfe6ff;
  background-color: #262d5c;
  background-image: var(--card-gloss), var(--card-base);
  box-shadow: var(--puff-shadow);
}
body[data-theme="starry"] .key:hover { transform: translateY(-3px); }
body[data-theme="starry"] .key.active {
  background-image: var(--btn-gloss), linear-gradient(168deg, #8B7CF6 0%, #6C57E8 100%);
  color: #fff;
  transform: scale(1.08);
  box-shadow: var(--btn-violet);
}
body[data-theme="starry"] .key.highlight {
  background-image: var(--btn-gloss), linear-gradient(168deg, #FFE0A0 0%, #F5B942 100%);
  color: #4a3305;
  box-shadow: var(--btn-gold);
}
body[data-theme="starry"] .bubble { color: #6c57e8; }

body[data-theme="starry"] .result-overlay { background: rgba(6, 10, 30, 0.72); }
body[data-theme="starry"] .result-card h2 { color: #ffd98a; }
body[data-theme="starry"] .result-stats { color: #c6ccee; }
body[data-theme="starry"] .result-stats .time-big { color: #ffd98a; }

body[data-theme="starry"] .seo-card { color: #c6ccee; }
body[data-theme="starry"] .seo-card h2 { color: #aab6ff; border-bottom-color: rgba(150, 175, 255, 0.22); }
body[data-theme="starry"] .seo-card strong { color: #d6dcff; }
body[data-theme="starry"] .seo-meta { background: rgba(140, 165, 255, 0.12); color: #9fa9d8; }
body[data-theme="starry"] .seo-card summary { color: #bcc6ff; }
body[data-theme="starry"] .seo-card summary::before { color: #8b7cf6; }
body[data-theme="starry"] .seo-card details { border-bottom-color: rgba(150, 175, 255, 0.18); }
body[data-theme="starry"] .seo-card code { background: rgba(140, 165, 255, 0.16); color: #ffd98a; }

body[data-theme="starry"] .setting-item label { color: #c6ccee; }
body[data-theme="starry"] input[type="checkbox"] { accent-color: #8b7cf6; width: 20px; height: 20px; }
body[data-theme="starry"] select {
  background-color: #1e2448;
  background-image: var(--card-base);
  color: #e9edff;
  border-color: #4a5490;
  border-radius: 14px;
  padding: 6px 10px;
  box-shadow: inset 0 3px 6px rgba(0, 0, 0, 0.4);
}

body[data-theme="starry"] .site-footer { color: rgba(200, 210, 255, 0.85); }
body[data-theme="starry"] .site-footer a { color: #aab6ff; }

body[data-theme="starry"] .skin-hint {
  color: #dfe6ff;
  background: rgba(140, 165, 255, 0.16);
  border-color: rgba(150, 175, 255, 0.4);
}
body[data-theme="starry"] .skin-hint:hover { background: rgba(140, 165, 255, 0.26); }

/* ============================================================
   森林皮肤（theme-forest）—— 清新草木绿 + 光斑 + 奶油木质卡片
   ============================================================ */
body[data-theme="forest"] {
  --grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='g'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23g)' opacity='0.25'/%3E%3C/svg%3E");
  --card-base: linear-gradient(168deg, #FFFDF4 0%, #FFF8E8 46%, #FBF0DA 100%);
  --card-gloss: radial-gradient(circle at 24% 7%, rgba(255, 255, 255, 0.95) 0 11%, rgba(255, 255, 255, 0) 36%);
  --card-shadow:
    0 30px 54px rgba(52, 110, 66, 0.24),
    0 8px 16px rgba(52, 110, 66, 0.14),
    0 3px 0 rgba(255, 255, 255, 0.9),
    inset 0 7px 12px rgba(255, 255, 255, 0.95),
    inset 0 -11px 18px rgba(190, 214, 186, 0.5),
    inset 9px 0 15px rgba(255, 255, 255, 0.55),
    inset -9px 0 15px rgba(190, 214, 186, 0.22),
    inset 0 0 0 1px rgba(255, 255, 255, 0.65);
  --btn-gloss: radial-gradient(ellipse at 32% 12%, rgba(255, 255, 255, 0.95) 0 7%, rgba(255, 255, 255, 0.3) 18%, rgba(255, 255, 255, 0) 40%);
  --btn-green:
    0 20px 32px rgba(60, 140, 75, 0.4),
    0 5px 0 rgba(58, 130, 70, 0.6),
    inset 0 7px 11px rgba(235, 255, 235, 0.5),
    inset 0 -9px 14px rgba(30, 95, 45, 0.45),
    inset 0 0 0 1px rgba(235, 255, 235, 0.4);
  --btn-butter:
    0 20px 32px rgba(190, 150, 50, 0.32),
    0 5px 0 rgba(176, 138, 42, 0.55),
    inset 0 7px 11px rgba(255, 250, 225, 0.65),
    inset 0 -9px 14px rgba(150, 112, 22, 0.38),
    inset 0 0 0 1px rgba(255, 245, 215, 0.5);
  --btn-wood:
    0 20px 32px rgba(150, 110, 60, 0.34),
    0 5px 0 rgba(138, 100, 52, 0.55),
    inset 0 7px 11px rgba(255, 245, 225, 0.6),
    inset 0 -9px 14px rgba(110, 74, 30, 0.42),
    inset 0 0 0 1px rgba(255, 240, 210, 0.45);
  --puff-shadow:
    0 7px 12px rgba(52, 110, 66, 0.24),
    0 3px 0 rgba(198, 220, 196, 0.7),
    inset 0 4px 7px rgba(255, 255, 255, 0.92),
    inset 0 -5px 9px rgba(190, 214, 186, 0.45),
    inset 0 0 0 1px rgba(255, 255, 255, 0.75);

  background:
    radial-gradient(circle at 90% 10%, rgba(255, 248, 200, 0.75) 0 34px, rgba(255, 240, 170, 0.4) 34px 70px, transparent 71px),
    radial-gradient(circle at 14% 78%, rgba(255, 255, 255, 0.5) 0 48px, transparent 49px),
    radial-gradient(circle at 70% 84%, rgba(255, 252, 210, 0.45) 0 40px, transparent 41px),
    radial-gradient(circle at 26% 22%, rgba(255, 255, 255, 0.45) 0 30px, transparent 31px),
    radial-gradient(circle at 82% 46%, rgba(255, 250, 205, 0.4) 0 26px, transparent 27px),
    radial-gradient(circle at 46% 58%, rgba(255, 255, 255, 0.32) 0 60px, transparent 61px),
    radial-gradient(circle at 6% 40%, rgba(126, 196, 140, 0.4) 0 90px, transparent 91px),
    radial-gradient(circle at 94% 66%, rgba(96, 176, 118, 0.35) 0 110px, transparent 111px),
    linear-gradient(160deg, #EAF7E4 0%, #D2EDD6 45%, #BEE3CB 100%);
  background-attachment: fixed;
  color: #2f5d3a;
}

body[data-theme="forest"] .title {
  color: #fff;
  text-shadow: 0 4px 14px rgba(40, 100, 55, 0.5);
}
body[data-theme="forest"] .subtitle {
  color: #2f7a45;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.9);
}
body[data-theme="forest"] h2 {
  color: #fff;
  text-shadow: 0 3px 9px rgba(40, 100, 55, 0.55);
}

body[data-theme="forest"] .level-card,
body[data-theme="forest"] .seo-card,
body[data-theme="forest"] .result-card,
body[data-theme="forest"] .practice-area,
body[data-theme="forest"] .game-header,
body[data-theme="forest"] .game-area,
body[data-theme="forest"] .stat-item {
  border-radius: 34px;
  background-color: #FFFDF4;
  background-image: var(--grain), var(--card-gloss), var(--card-base);
  background-blend-mode: soft-light, normal, normal;
  box-shadow: var(--card-shadow);
}
body[data-theme="forest"] .level-card {
  border: none;
  padding: 28px 18px;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}
body[data-theme="forest"] .level-card:hover {
  transform: translateY(-7px);
  box-shadow:
    0 38px 64px rgba(52, 110, 66, 0.3),
    0 10px 18px rgba(52, 110, 66, 0.16),
    0 3px 0 rgba(255, 255, 255, 0.9),
    inset 0 7px 12px rgba(255, 255, 255, 0.95),
    inset 0 -11px 18px rgba(190, 214, 186, 0.5),
    inset 9px 0 15px rgba(255, 255, 255, 0.55),
    inset -9px 0 15px rgba(190, 214, 186, 0.22),
    inset 0 0 0 1px rgba(255, 255, 255, 0.65);
}
body[data-theme="forest"] .level-title { color: #2f5d3a; }
body[data-theme="forest"] .level-en { color: #6e8c74; }
body[data-theme="forest"] .level-icon { filter: drop-shadow(0 6px 9px rgba(52, 110, 66, 0.32)); }

body[data-theme="forest"] .btn {
  border-radius: 30px;
  color: #fff;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.18);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
body[data-theme="forest"] .btn-primary {
  background-image: var(--btn-gloss), linear-gradient(168deg, #B7E4A0 0%, #7FCB72 44%, #55AF5A 100%);
  box-shadow: var(--btn-green);
}
body[data-theme="forest"] .btn-secondary {
  background-image: var(--btn-gloss), linear-gradient(168deg, #FFF3CC 0%, #FFE09A 44%, #F7C75F 100%);
  color: #4a5a1c;
  text-shadow: none;
  box-shadow: var(--btn-butter);
}
body[data-theme="forest"] .btn-back {
  background-image: var(--btn-gloss), linear-gradient(168deg, #EBCFA6 0%, #D7AE79 44%, #C2955F 100%);
  color: #4a330f;
  text-shadow: none;
  box-shadow: var(--btn-wood);
}
body[data-theme="forest"] .btn-small {
  background-image: var(--btn-gloss), linear-gradient(168deg, #B7E4A0 0%, #7FCB72 100%);
  color: #fff;
  box-shadow: var(--btn-green);
}
body[data-theme="forest"] .btn:hover { transform: translateY(-4px); }
body[data-theme="forest"] .btn:active { transform: translateY(2px); }
body[data-theme="forest"] #listen-btn {
  background-image: var(--btn-gloss), linear-gradient(168deg, #B7E4A0 0%, #7FCB72 100%);
  color: #fff;
  border-radius: 24px;
  box-shadow: var(--btn-green);
}

body[data-theme="forest"] .stat-item {
  padding: 20px 30px;
  border-radius: 26px;
  box-shadow: var(--puff-shadow), 0 14px 26px rgba(52, 110, 66, 0.2);
}
body[data-theme="forest"] .stat-label { color: #6e8c74; }
body[data-theme="forest"] .stat-value { color: #e0832f; }
body[data-theme="forest"] .stat { color: #2f5d3a; }

body[data-theme="forest"] .task-text { color: #3e8e4f; }
body[data-theme="forest"] .input-hint { color: #6e8c74; }
body[data-theme="forest"] .input-hint .highlight { color: #e0832f; }
body[data-theme="forest"] .feedback-area { color: #2f5d3a; }
body[data-theme="forest"] .feedback { border-radius: 18px; }
body[data-theme="forest"] .feedback.correct { color: #2f7a45; background: #dff3e2; }
body[data-theme="forest"] .feedback.wrong { color: #b03a46; background: #fbe0e2; }
body[data-theme="forest"] .blank { border-bottom-color: #3e8e4f; color: #3e8e4f; }
body[data-theme="forest"] .blank.filled { border-bottom-color: #2f7a45; color: #2f7a45; }

body[data-theme="forest"] .chinese-prompt { color: #2f5d3a; }
body[data-theme="forest"] .chinese-pinyin { color: #3e8e4f; }
body[data-theme="forest"] .chinese-input {
  background-color: #FFFDF4;
  background-image: var(--card-base);
  border-color: #bfe3c4;
  border-radius: 20px;
  box-shadow: inset 0 4px 8px rgba(190, 214, 186, 0.45), inset 0 -3px 6px rgba(255, 255, 255, 0.9);
}
body[data-theme="forest"] .chinese-input:focus { border-color: #55af5a; }

body[data-theme="forest"] .char-btn {
  border: none;
  border-radius: 18px;
  color: #2f5d3a;
  background-color: #FFFDF4;
  background-image: var(--card-gloss), var(--card-base);
  box-shadow: var(--puff-shadow);
}
body[data-theme="forest"] .char-btn:hover { transform: translateY(-4px); }
body[data-theme="forest"] .char-btn:active { transform: translateY(1px) scale(0.96); }
body[data-theme="forest"] .char-btn.used { opacity: 0.38; }
body[data-theme="forest"] .btn-char-back {
  background-image: var(--btn-gloss), linear-gradient(168deg, #EBCFA6 0%, #D7AE79 100%);
  color: #4a330f;
  box-shadow: var(--btn-wood);
}

body[data-theme="forest"] .virtual-keyboard {
  background-color: #e5f4e6;
  background-image: var(--grain);
  background-blend-mode: soft-light;
  border-radius: 26px;
  box-shadow: inset 0 5px 12px rgba(52, 110, 66, 0.16), inset 0 -4px 10px rgba(255, 255, 255, 0.7);
}
body[data-theme="forest"] .key {
  border: none;
  border-radius: 16px;
  color: #2f5d3a;
  background-color: #FFFDF4;
  background-image: var(--card-gloss), var(--card-base);
  box-shadow: var(--puff-shadow);
}
body[data-theme="forest"] .key:hover { transform: translateY(-3px); }
body[data-theme="forest"] .key.active {
  background-image: var(--btn-gloss), linear-gradient(168deg, #B7E4A0 0%, #7FCB72 100%);
  color: #fff;
  transform: scale(1.08);
  box-shadow: var(--btn-green);
}
body[data-theme="forest"] .key.highlight {
  background-image: var(--btn-gloss), linear-gradient(168deg, #FFE9A0 0%, #F7C75F 100%);
  color: #4a5a1c;
  box-shadow: var(--btn-butter);
}
body[data-theme="forest"] .bubble { color: #3e8e4f; }

body[data-theme="forest"] .result-overlay { background: rgba(30, 60, 35, 0.5); }
body[data-theme="forest"] .result-card h2 { color: #3e8e4f; }
body[data-theme="forest"] .result-stats { color: #3b5540; }
body[data-theme="forest"] .result-stats .time-big { color: #e0832f; }

body[data-theme="forest"] .seo-card { color: #3b5540; }
body[data-theme="forest"] .seo-card h2 { color: #3e8e4f; border-bottom-color: #dff0e1; }
body[data-theme="forest"] .seo-card strong { color: #2f7a45; }
body[data-theme="forest"] .seo-meta { background: #f2f9ef; color: #5c7f66; }
body[data-theme="forest"] .seo-card summary { color: #2f7a45; }
body[data-theme="forest"] .seo-card summary::before { color: #7fcb72; }
body[data-theme="forest"] .seo-card details { border-bottom-color: #dff0e1; }
body[data-theme="forest"] .seo-card code { background: #eff8ec; color: #2f7a45; }

body[data-theme="forest"] .setting-item label { color: #2f5d3a; }
body[data-theme="forest"] input[type="checkbox"] { accent-color: #55af5a; width: 20px; height: 20px; }
body[data-theme="forest"] select {
  background-color: #FFFDF4;
  background-image: var(--card-base);
  color: #2f5d3a;
  border-color: #bfe3c4;
  border-radius: 14px;
  padding: 6px 10px;
  box-shadow: inset 0 3px 6px rgba(190, 214, 186, 0.4);
}

body[data-theme="forest"] .site-footer { color: rgba(47, 93, 58, 0.92); }
body[data-theme="forest"] .site-footer a { color: #2f7a45; }

body[data-theme="forest"] .skin-hint {
  color: #2f5d3a;
  background: rgba(255, 255, 255, 0.6);
  border-color: rgba(255, 255, 255, 0.85);
}
body[data-theme="forest"] .skin-hint:hover { background: rgba(255, 255, 255, 0.78); }

/* 糖果皮肤下的换肤提示 */
body[data-theme="candy"] .skin-hint {
  color: #a83f63;
  background: rgba(255, 255, 255, 0.55);
  border-color: rgba(255, 255, 255, 0.85);
}
body[data-theme="candy"] .skin-hint:hover { background: rgba(255, 255, 255, 0.75); }
