.card-container {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 30px;
  margin: 20px auto 10px;
  perspective: 1000px;
  max-width: 1200px;
}

.card {
  width: 420px;
  height: 500px;
  position: relative;
  transform-style: preserve-3d;
  transition: transform 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  cursor: pointer;
  margin-bottom: 5px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  border-radius: 8px;
  will-change: transform;
  perspective: 2000px;
}

.card.flipped {
  transform: rotateY(180deg);
}

.card-front, .card-back {
  position: absolute;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  padding: 20px;
  border-radius: 8px;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
  -webkit-transform-style: preserve-3d;
  transform-style: preserve-3d;
  will-change: transform;
}

.card-front {
  background: white;
  font-size: 2rem;
  font-weight: 700;
  color: #333;
  box-shadow: 0 0 1px rgba(0, 0, 0, 0.1);
}

.card-back {
  background: #4257b2;
  transform: rotateY(180deg);
  font-size: 1.6rem;
  color: white;
  text-align: center;
}

.card-img {
  max-width: 85%;
  max-height: 280px;
  object-fit: contain;
  margin-bottom: 30px;
  border-radius: 4px;
}

.card-img-back {
  max-width: 50%;
  max-height: 150px;
  object-fit: contain;
  margin-bottom: 10px;
  border-radius: 4px;
  opacity: 0.9;
}

.card-word {
  font-size: 3.0rem;
  font-weight: 700;
  margin-bottom: 5px;
  color: white;
}

.card-pronunciation {
  font-size: 1.8rem;
  color: rgba(255, 255, 255, 0.85);
  margin-top: 15px;
  font-style: italic;
}

.card-example {
  font-size: 1.6rem;
  color: rgba(255, 255, 255, 0.9);
  margin-top: 10px;
  text-align: center;
  font-style: italic;
  background: rgba(255, 255, 255, 0.08);
  padding: 15px;
  border-radius: 6px;
  line-height: 1.5;
}

.card-question {
  font-size: 2.8rem;
  font-weight: 600;
  color: #3a3a3a;
  margin-top: 10px;
}

.card-controls {
  display: flex;
  justify-content: center;
  margin: 5px 0;
  gap: 15px;
}

.card-btn {
  padding: 6px 20px;
  border: none;
  border-radius: 4px;
  background: linear-gradient(135deg, #FF5A5F, #FF8A65);
  color: white;
  font-size: 1.4rem;
  cursor: pointer;
  transition: all 0.3s;
  box-shadow: 0 3px 8px rgba(255, 90, 95, 0.3);
}

.card-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 12px rgba(255, 90, 95, 0.4);
  background: linear-gradient(135deg, #FF8A65, #FF5A5F);
}

.card-btn:active {
  transform: translateY(1px);
  box-shadow: 0 2px 5px rgba(255, 90, 95, 0.5);
}

.card-progress {
  display: flex;
  justify-content: center;
  margin: 8px 0;
  font-size: 1.5rem;
  color: #777;
}

.card-translation {
  font-size: 2.2rem;
  color: white;
  margin-top: 5px;
}

/* Wordwall风格的拼写游戏 */
.spelling-section {
  max-width: 650px;
  min-width: 350px;
  margin: 1.5rem auto;
  text-align: center;
  padding: 15px 25px;
  background: #f8f9fa;
  border-radius: 12px;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
  position: relative;
}

.spelling-section::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 6px;
  background: linear-gradient(90deg, #ff9a9e, #fad0c4, #fad0c4, #a18cd1, #fbc2eb);
  background-size: 200% 200%;
  animation: gradientBorder 3s ease infinite;
}

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

.spelling-title {
  font-size: 2.4rem;
  color: #444;
  font-weight: 600;
}

.scrambled-letters {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-bottom: 10px;
  margin-top: 15px;
  perspective: 1000px;
}

.user-input {
  min-height: 60px;
  padding: 10px 15px;
  background: #fff;
  border-radius: 8px;
  margin-bottom: 5px;
  font-size: 1.8rem;
  color: #333;
  letter-spacing: 2px;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.05);
  border: 2px dashed #ddd;
}

.input-letter {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  width: 45px;
  height: 45px;
  line-height: 45px;
  text-align: center;
  background: #fff;
  border-radius: 5px;
  cursor: pointer;
  transition: all 0.25s;
  box-shadow: 0 3px 6px rgba(0, 0, 0, 0.1);
  border: 1px solid #e0e0e0;
  font-weight: 600;
}

.input-letter:hover {
  transform: translateY(-3px) rotate(2deg);
  box-shadow: 0 5px 10px rgba(0, 0, 0, 0.15);
}

.letter-btn {
  width: 55px;
  height: 55px;
  border: none;
  border-radius: 8px;
  color: white;
  font-size: 2.0rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.25s;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
  position: relative;
  overflow: hidden;
  transform-style: preserve-3d;
  animation: letterBounce 0.5s ease-out;
}

@keyframes letterBounce {
  0% { transform: translateY(20px); opacity: 0; }
  60% { transform: translateY(-5px); }
  100% { transform: translateY(0); opacity: 1; }
}

.letter-btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(255, 255, 255, 0.1);
  transform: translateY(100%);
  transition: transform 0.3s;
}

.letter-btn:hover {
  transform: translateY(-5px) scale(1.05);
  box-shadow: 0 8px 15px rgba(0, 0, 0, 0.2);
}

.letter-btn:hover::before {
  transform: translateY(0);
}

.letter-btn:active {
  transform: translateY(2px);
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.letter-btn.used {
  opacity: 0.5;
  transform: translateY(5px) scale(0.95);
  cursor: not-allowed;
  box-shadow: none;
}

/* Wordwall彩色字母按钮 */
.letter-btn:nth-child(5n+1) { background: #FF5A5F; } /* 红色 */
.letter-btn:nth-child(5n+2) { background: #40A4F4; } /* 蓝色 */
.letter-btn:nth-child(5n+3) { background: #8D65C5; } /* 紫色 */
.letter-btn:nth-child(5n+4) { background: #FFC857; } /* 黄色 */
.letter-btn:nth-child(5n+5) { background: #1FA363; } /* 绿色 */

.spelling-result {
  font-size: 1.8rem;
  font-weight: 600;
  margin-top: 15px;
  min-height: 20px;
}

.correct {
  color: #1FA363;
}

.incorrect {
  color: #FF5A5F;
}

/* 成功动画增强版 */
@keyframes success-animation {
  0% { transform: scale(1); }
  40% { transform: scale(1.15); }
  60% { transform: scale(0.95); }
  80% { transform: scale(1.05); }
  100% { transform: scale(1); }
}

.success-animation {
  animation: success-animation 0.8s ease;
}

.game-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.score-display {
  font-size: 1.5rem;
  font-weight: 600;
  color: #555;
  background: rgba(255, 255, 255, 0.8);
  padding: 5px 12px;
  border-radius: 20px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.time-display {
  font-size: 1.5rem;
  font-weight: 600;
  color: #555;
  background: rgba(255, 255, 255, 0.8);
  padding: 5px 12px;
  border-radius: 20px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.spelling-buttons {
  display: flex;
  justify-content: center;
  gap: 15px;
  margin-top: 5px;
}

.action-btn {
  padding: 8px 18px;
  border: none;
  border-radius: 6px;
  font-size: 1.5rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.1);
  position: relative;
  overflow: hidden;
}

.action-btn::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(255, 255, 255, 0.2);
  transform: translateY(100%);
  transition: transform 0.2s;
}

.action-btn:hover::after {
  transform: translateY(0);
}

.action-btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 5px 12px rgba(0, 0, 0, 0.15);
}

.action-btn:active {
  transform: translateY(1px);
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.15);
}

.delete-btn {
  background: #FF5A5F;
  color: white;
}

.reset-btn {
  background: #40A4F4;
  color: white;
}

header {
  display: none;
}

.page-title {
  position: absolute;
  left: 20px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 2rem;
  font-weight: 700;
  color: #4257b2;
  writing-mode: vertical-lr;
  text-orientation: upright;
  letter-spacing: 0.5rem;
  z-index: 10;
}

main {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  margin-top: 60px;
}

.spelling-section {
  margin-top: 1rem;
}

.mode-switcher {
  position: absolute;
  top: 20px;
  right: 20px;
  display: flex;
  gap: 10px;
  z-index: 10;
}

.mode-btn {
  padding: 8px 15px;
  border: none;
  border-radius: 6px;
  background: linear-gradient(135deg, #00BCD4, #1E88E5);
  color: white;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s;
  box-shadow: 0 3px 8px rgba(0, 188, 212, 0.3);
}

.mode-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 12px rgba(0, 188, 212, 0.4);
  background: linear-gradient(135deg, #1E88E5, #00BCD4);
}

/* Logo样式 */
.logo-container {
  position: fixed;
  top: 60px;
  left: 20px;
  z-index: 10;
}

.logo {
  width: 180px;
  height: auto;
  transition: transform 0.3s;
  box-shadow: none !important; /* 强制移除阴影 */
  border: none !important; /* 强制确保没有边框 */
  border-radius: 0 !important; /* 强制移除圆角 */
  background-color: transparent !important; /* 强制背景透明 */
}

.logo:hover {
  transform: scale(1.05);
}

/* 分类按钮样式 */
.category-switcher {
  position: fixed;
  left: 20px;
  top: 220px;
  display: flex;
  flex-direction: column;
  gap: 15px;
  z-index: 10;
  bottom: 20px;
  padding-bottom: 5px;
  padding-left: 2px;
  padding-right: 8px;
  overflow-y: auto;
}

.category-switcher a {
  text-decoration: none;
}

/* 游戏模式按钮样式 */
.game-mode-switcher {
  position: fixed;
  right: 20px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  gap: 15px;
  z-index: 10;
}

.game-mode-switcher a {
  text-decoration: none;
}

.game-btn {
  display: flex;
  align-items: center;
  padding: 10px 28px;
  width: 165px;
  border: none;
  border-radius: 8px;
  background: white;
  color: #333;
  font-size: 1.5rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
  justify-content: center; 
}

.game-btn i {
  margin-right: 8px;
  font-size: 1.2rem;
}

.game-btn:hover {
  transform: translateX(-5px);
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.15);
}

.game-btn.active {
  background: #EA4335;
  color: white;
}

.category-btn {
  display: flex;
  align-items: center;
  padding: 8px 5px;  /* 减小水平方向的内边距 */
  width: 165px;  /* 增加固定宽度 */
  border: none;
  border-radius: 8px;
  background: white;
  color: #333;
  font-size: 1.6rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.1);
  justify-content: center; 
  text-align: center;
  white-space: nowrap; /* 防止文字换行 */
}

.category-btn i {
  margin-right: 8px;
  font-size: 1.2rem;
  flex-shrink: 0; /* 防止图标缩小 */
  font-style: normal; /* 防止图标倾斜显示 */
}

.category-btn:hover {
  transform: translateX(5px);
  box-shadow: 0 5px 12px rgba(0, 0, 0, 0.15);
  font-size: 1.5rem; /* 放大字体 */
}

.category-btn.active {
  background: linear-gradient(135deg, #1FA363, #4CAF50);
  color: white;
}

.category-btn.disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.category-btn.disabled:hover {
  transform: none;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.1);
}

/* 全屏庆祝动画效果 */
.celebration {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 1000;
  display: none;
  justify-content: center;
  align-items: center;
  overflow: hidden;
  pointer-events: none;
}

.confetti {
  position: absolute;
  width: 10px;
  height: 10px;
  background-color: #f44336;
  border-radius: 2px;
  transform: rotate(45deg);
  opacity: 0.8;
  animation: fall 3s linear forwards;
}

@keyframes fall {
  0% {
      transform: translateY(-100px) rotate(0deg);
      opacity: 1;
  }
  100% {
      transform: translateY(100vh) rotate(360deg);
      opacity: 0;
  }
}

.success-message {
  background-color: white;
  color: #1FA363;
  font-size: 2rem;
  font-weight: bold;
  padding: 20px 40px;
  border-radius: 10px;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
  text-align: center;
  z-index: 1001;
  animation: pop 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes pop {
  0% {
      transform: scale(0);
      opacity: 0;
  }
  80% {
      transform: scale(1.1);
  }
  100% {
      transform: scale(1);
      opacity: 1;
  }
}

/* 语音播放按钮样式 */
.audio-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: white;
  border: none;
  color: black;
  font-size: 16px;
  cursor: pointer;
  margin: 10px auto 0;
  transition: all 0.3s ease;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.audio-btn:hover {
  transform: scale(1.1);
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.2);
}

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

.audio-btn i {
  display: inline-block;
  width: 18px;
  height: 18px;
  background: black;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M3,9v6h4l5,5V4L7,9H3z M16.5,12c0-1.77-1.02-3.29-2.5-4.03v8.05C15.48,15.29,16.5,13.77,16.5,12z M14,3.23v2.06c2.89,0.86,5,3.54,5,6.71s-2.11,5.85-5,6.71v2.06c4.01-0.91,7-4.49,7-8.77S18.01,4.14,14,3.23z'/%3E%3C/svg%3E");
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M3,9v6h4l5,5V4L7,9H3z M16.5,12c0-1.77-1.02-3.29-2.5-4.03v8.05C15.48,15.29,16.5,13.77,16.5,12z M14,3.23v2.06c2.89,0.86,5,3.54,5,6.71s-2.11,5.85-5,6.71v2.06c4.01-0.91,7-4.49,7-8.77S18.01,4.14,14,3.23z'/%3E%3C/svg%3E");
  mask-size: cover;
  -webkit-mask-size: cover;
}

.audio-btn i:before, .audio-btn i:after {
  display: none;
}

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

.audio-btn.playing {
  animation: pulse 1s infinite;
  background: #f5f5f5;
}

/* 移动端适配样式 */
.mobile-menu-btn {
  display: none;
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 100;
  background: #4257b2;
  color: white;
  border: none;
  border-radius: 5px;
  padding: 8px 12px;
  font-size: 1rem;
  cursor: pointer;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

/* 分类按钮和游戏按钮样式 */
.nav-btn, .game-btn-mobile {
  position: fixed;
  z-index: 100;
  background: white;
  color: #333;
  border: none;
  border-radius: 50%;
  width: 45px;
  height: 45px;
  font-size: 1.2rem;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  transition: all 0.3s ease;
  align-items: center;
  justify-content: center;
  display: none; /* 默认隐藏，在媒体查询中显示 */
}

.nav-btn {
  top: 60px;
  left: 20px;
}

.game-btn-mobile {
  top: 20px;
  right: 20px;
}

.nav-btn:hover, .game-btn-mobile:hover {
  transform: scale(1.1);
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.2);
}

.nav-btn:active, .game-btn-mobile:active {
  transform: scale(0.95);
}

/* 修改游戏按钮样式，确保文字和图标居中 */
.game-btn-mobile i, .nav-btn i {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  font-style: normal;
  margin: 0;
  padding: 0;
}

/* 游戏模式菜单中的按钮样式 */
.game-mode-switcher .game-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  margin: 0 auto;
}

.game-mode-switcher .game-btn i {
  margin-right: 8px;
  text-align: center;
}

.no-words {
  text-align: center;
  font-size: 14px;
  color: #666666;
  width: 350px;
  height: 150px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  margin-top: 200px;
}

@media (max-width: 768px) {
  /* 游戏模式菜单中的按钮居中样式 */
  .game-mode-switcher .game-btn {
      flex-direction: row;
      justify-content: center;
      width: 100%;
      padding: 12px 15px;
  }
  
  .game-mode-switcher .game-btn i {
      margin-right: 10px;
  }
}

/* 媒体查询 - 移动设备 */
@media (max-width: 768px) {
  /* 隐藏Logo */
  .logo-container {
      display: none;
  }
  
  /* 隐藏模式切换按钮 */
  .mode-switcher {
      display: none;
  }
  
  /* 隐藏左右导航栏并调整其位置和样式 */
  .category-switcher, .game-mode-switcher {
      transform: translateX(-100%);
      transition: transform 0.3s ease;
      background: rgba(255, 255, 255, 0.95);
      box-shadow: 0 0 10px rgba(0, 0, 0, 0.2);
      border-radius: 0;
      padding: 15px;
      left: 0;
      top: 0;
      bottom: 0;
      width: 80%;
      max-width: 200px;
      z-index: 90;
      position: fixed;
  }
  
  .game-mode-switcher {
      transform: translateX(100%);
      left: auto;
      right: 0;
      border-radius: 0;
  }
  
  /* 内部按钮样式调整 */
  .category-switcher .category-btn,
  .category-switcher .game-btn,
  .game-mode-switcher .game-btn {
      margin-bottom: 10px;
      width: 100%;
      border-radius: 6px;
  }
  
  .category-switcher .category-btn:last-child {
      margin-bottom: 0;
  }
  
  /* 顶部添加标题和关闭按钮 */
  .category-switcher:before,
  .game-mode-switcher:before {
      content: attr(data-title);
      display: block;
      font-size: 1.2rem;
      font-weight: 600;
      margin-bottom: 15px;
      padding-bottom: 10px;
      border-bottom: 1px solid rgba(0,0,0,0.1);
      color: #333;
  }
  
  .category-switcher {
      padding-top: 60px; /* 为顶部按钮留出空间 */
  }
  
  .game-mode-switcher {
      padding-top: 60px; /* 为顶部按钮留出空间 */
  }
  
  .category-switcher.show, .game-mode-switcher.show {
      transform: translateX(0);
  }
  
  /* 展示移动端按钮 */
  .nav-btn, .game-btn-mobile {
      display: flex !important; /* 强制显示 */
  }
  
  /* 隐藏原菜单按钮 */
  .mobile-menu-btn {
      display: none;
  }
  
  /* 改进卡片容器 */
  .card-container {
      width: 100%;
      padding: 0 10px;
      margin: 0 auto;
      gap: 20px;
  }
  
  /* 调整卡片大小和翻转效果 */
  .card {
      width: 85vw;
      height: 300px;
      max-width: 350px;
      perspective: 1200px;
      margin: 0 auto 20px;
  }
  
  /* 确保卡片正反面在移动设备正常显示 */
  .card-front, .card-back {
      position: absolute;
      width: 100%;
      height: 100%;
      -webkit-backface-visibility: hidden;
      backface-visibility: hidden;
      overflow: hidden;
      border-radius: 8px;
      padding: 15px;
  }
  
  /* 修复Safari浏览器卡片翻转问题 */
  .card-back {
      transform: rotateY(180deg) translateZ(1px);
  }
  
  /* 调整卡片内容 */
  .card-img {
      max-width: 80%;
      max-height: 180px;
      margin-bottom: 15px;
  }
  
  .card-img-back {
      max-width: 45%;
      max-height: 120px;
      margin-bottom: 15px;
  }
  
  .card-word {
      font-size: 1.8rem;
      margin-bottom: 10px;
  }
  
  .card-translation {
      font-size: 1.5rem;
      margin-top: 0;
  }
  
  .card-pronunciation {
      font-size: 1.4rem;
      margin-top: 10px;
  }
  
  .card-example {
      font-size: 0.9rem;
      margin-top: 15px;
      padding: 10px;
      max-height: 100px;
      overflow-y: auto;
      -webkit-overflow-scrolling: touch;
  }
  
  .card-question {
      font-size: 1.5rem;
      margin-top: 5px;
  }
  
  /* 调整拼写游戏区域 */
  .spelling-section {
      width: 90%;
      padding: 15px;
      margin-top: 10px;
  }
  
  /* 调整字母按钮大小 */
  .letter-btn {
      width: 45px;
      height: 45px;
      font-size: 1.4rem;
  }
  
  /* 调整用户输入区域 */
  .user-input {
      min-height: 50px;
  }
  
  /* 调整输入字母大小 */
  .input-letter {
      width: 40px;
      height: 40px;
      line-height: 40px;
  }

  .no-words {
    width: 95%;
    margin-top: 20px;
  }
}

/* 适配更小的屏幕 */
@media (max-width: 480px) {
  .card {
      max-width: 280px;
      height: 320px;
      margin: 0 auto 5px;
  }
  
  .card-img {
      max-height: 160px;
      max-width: 85%;
      margin-bottom: 12px;
  }
  
  .card-img-back {
      max-height: 100px;
      max-width: 50%;
      margin-bottom: 10px;
  }
  
  .card-word {
      font-size: 1.6rem;
      margin-bottom: 8px;
  }
  
  .card-translation {
      font-size: 1.3rem;
  }
  
  .card-pronunciation {
      font-size: 0.9rem;
      margin-top: 8px;
  }
  
  .card-example {
      font-size: 0.85rem;
      margin-top: 12px;
      padding: 8px;
      max-height: 80px;
  }
  
  .card-question {
      font-size: 2.0rem;
  }
  
  .letter-btn {
      width: 40px;
      height: 40px;
      font-size: 1.6rem;
  }
  
  .input-letter {
      width: 35px;
      height: 35px;
      line-height: 35px;
      font-size: 1.2rem;
  }
  
  .spelling-section {
      width: 95%;
      padding: 12px;
  }
  
  .spelling-title {
      font-size: 1.8rem; 
  }
  
  .action-btn {
      padding: 6px 12px;
      font-size: 1.2rem;
  }

  .no-words {
    width: 95%;
    margin-top: 20px;
  }
}

/* 特殊处理Safari和Android浏览器的翻转问题 */
@media screen and (max-width: 768px) and (-webkit-min-device-pixel-ratio: 0) {
  .card-front, .card-back {
      -webkit-transform-style: preserve-3d;
      transform-style: preserve-3d;
      -webkit-backface-visibility: hidden;
      backface-visibility: hidden;
      -webkit-perspective: 1000;
      perspective: 1000;
  }
  
  .card-back {
      -webkit-transform: rotateY(180deg) translateZ(0.01px);
      transform: rotateY(180deg) translateZ(0.01px);
  }
  
  .card.flipped {
      -webkit-transform: rotateY(179.9deg);
      transform: rotateY(179.9deg);
  }

  .no-words {
    width: 95%;
    margin-top: 20px;
  }
}
.category-switcher-line {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  color: #666;
  padding: 5px 0;
}

.card-body {
  width: 100%;
  margin: 0 auto;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
}

.card-body-left {
  flex: 1;
  max-width: 80%;
  margin-left: 15%;
}

.card-body-right {
  min-width: 320px;
  padding-right: 20px;
}

/* 移动端上下布局 */
@media (max-width: 1024px) {
  .card-body {
    flex-direction: column;
  }
  
  .card-body-left, 
  .card-body-right {
    width: 100%;
    max-width: 100%;
    padding-right: 0;
    margin-left: 0;
  }

}