* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Roboto', sans-serif;
}

:root {
  --primary-color: #4a6fa5;
  --secondary-color: #6bb39b;
  --dark-color: #333;
  --light-color: #f8f9fa;
  --background-color: #ffffff;
  --text-color: #4a4a4a;
  --correct-color: #6bb39b;
  --wrong-color: #e57373;
}

body {
  background-color: var(--background-color);
  color: var(--text-color);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  line-height: 1.6;
  padding-top: 0 !important
}

.app-container {
  max-width: 3000px;
  margin: 0 auto;
  padding: 1.5rem 1rem;
  width: 100%;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  border: none;
  box-shadow: none;
}

header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  padding: 0.5rem 0;
  position: relative;
}

.logo-container {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  margin-bottom: 0;
  z-index: 2;
  padding: 0.5rem 0;
}

.logo {
  width: 150px;
  height: 150px;
  margin-right: 1.5rem;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

h1 {
  font-size: 2.2rem;
  color: var(--primary-color);
  margin: 0;
  font-weight: 500;
  letter-spacing: 0.5px;
}

.typing-container {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  flex: 1;
}

.typing-header {
  display: flex;
  justify-content: center;
}

.header-controls {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  z-index: 2;
}

/* 调整用户信息样式为居中且单行显示 */
.user-info {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1;
  gap: 1.5rem;
}

.user-level, .user-points {
  font-size: 1.2rem;
  color: var(--primary-color);
  font-weight: 600;
  margin: 0;
  white-space: nowrap;
  letter-spacing: 0.5px;
}

.prompt-container {
  padding: 1.5rem 1rem;
  background-color: transparent;
  border-radius: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  box-shadow: none;
  position: relative;
  margin-top: 30px;
}

.text-prompt {
  font-size: 1.3rem;
  line-height: 1.7;
  color: var(--dark-color);
  max-width: 600px;
  margin: 0 auto;
}

.input-container {
  margin-bottom: 1rem;
}

textarea {
  width: 100%;
  padding: 1.2rem;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  font-size: 1.1rem;
  resize: none;
  height: 140px;
  outline: none;
  transition: border-color 0.3s;
}

textarea:focus {
  border-color: var(--primary-color);
}

.typing-footer {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.stats-container {
  display: flex;
  justify-content: center;
  gap: 3rem;
}

.stat {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.stat-label {
  font-size: 0.85rem;
  color: #777;
  margin-bottom: 0.25rem;
}

.stat-value {
  font-size: 1.1rem;
  font-weight: 500;
  color: var(--primary-color);
}

.controls {
  display: flex;
  justify-content: center;
  gap: 1rem;
}

.control-btn {
  background-color: var(--primary-color);
  color: white;
  border: none;
  padding: 0.7rem 1.5rem;
  font-size: 0.95rem;
  border-radius: 4px;
  cursor: pointer;
  transition: background-color 0.3s;
  min-width: 100px;
  box-shadow: none;
}

.control-btn:hover {
  background-color: #3d5d8a;
}

/* 单词容器样式 */
.word-container {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.8rem;
  max-width: 600px;
  margin: 0 auto;
}

.word-item {
  display: flex;
  flex-direction: column;
  background-color: #f5f8fc;
  border-radius: 6px;
  padding: 0.6rem 0.8rem;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
  min-width: 70px;
  text-align: center;
}

.word {
  font-size: 1.1rem;
  margin-bottom: 0.3rem;
  color: var(--dark-color);
}

.word-type {
  font-size: 0.75rem;
  color: #777;
  font-style: italic;
  border-top: 1px dashed #e0e0e0;
  padding-top: 0.3rem;
  line-height: 1.2;
}

/* 增强提示文本样式 */
.prompt {
  font-size: 1.5rem;
  margin-bottom: 1.5rem;
  color: var(--primary-color);
  text-align: center;
  font-weight: 500;
  padding: 1.2rem;
  background-color: rgba(74, 111, 165, 0.08);
  border-radius: 8px;
  max-width: 90%;
  margin: 0 auto 1.5rem;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

/* 字符样式 */
.char {
  position: relative;
  transition: all 0.1s ease;
  display: inline-block;
}

.char.correct {
  color: var(--correct-color);
}

.char.wrong {
  color: var(--wrong-color);
  text-decoration: underline;
}

.char.current {
  background-color: rgba(74, 111, 165, 0.15);
  border-radius: 2px;
}

/* 消息通知样式 */
.notification {
  position: fixed;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%) scale(0.9);
  background-color: rgba(255, 255, 255, 0.95);
  color: #333;
  padding: 1.5rem 2rem;
  border-radius: 12px;
  text-align: center;
  z-index: 1000;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
  opacity: 0;
  transition: all 0.4s ease-in-out;
  min-width: 280px;
  max-width: 80%;
}

.notification.show {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

.notification.level-up {
  background-color: #F7F0FF;
  color: #6200EA;
  font-size: 1.4rem;
  font-weight: 600;
  padding: 2rem;
  box-shadow: 0 15px 40px rgba(98, 0, 234, 0.25);
}

.notification.completion {
  top: 20%;
  background-color: #E8F5E9;
  color: #1B5E20;
  font-size: 1.2rem;
  font-weight: 500;
}

/* 移除footer样式 */
footer {
  display: none;
}

/* 响应式调整 */
@media (max-width: 768px) {
  .app-container {
      padding: 0.5rem;
      position: relative;
      overflow-x: hidden;
  }
  
  .prompt-container {
      padding: 1.5rem 1rem;
  }
  
  .text-prompt {
      font-size: 1.1rem;
  }
  
  textarea {
      padding: 1rem;
      height: 100px;
      font-size: 1rem;
  }
  
  .stats-container {
      flex-wrap: wrap;
      gap: 1rem;
  }
  
  .controls {
      flex-direction: column;
  }
  
  .control-btn {
      width: 100%;
  }
  
  .word-container {
      gap: 0.5rem;
  }
  
  header {
      flex-direction: column;
      text-align: center;
      margin-top: 40px;
  }
  
  .logo-container {
      justify-content: center;
      margin-bottom: 10px;
  }
  
  h1 {
      font-size: 1.8rem;
      text-align: center;
  }
  
  .user-info {
      position: static;
      transform: none;
      margin-bottom: 15px;
      flex-wrap: wrap;
  }
  
  .header-controls {
      flex-direction: column;
      gap: 10px;
      align-items: center;
  }
  
  .mobile-menu-toggle {
      display: block;
      position: fixed;
      top: 10px;
      left: 10px;
      z-index: 1000;
      width: 40px;
      height: 40px;
      background-color: var(--primary-color);
      color: white;
      border-radius: 4px;
      display: flex;
      align-items: center;
      justify-content: center;
      cursor: pointer;
      box-shadow: 0 2px 5px rgba(0,0,0,0.2);
  }
  
  .mobile-menu-toggle:before {
      content: "☰";
      font-size: 24px;
  }
  
  .mode-select-container .mode-cards {
      display: none;
  }
  
  .mobile-nav {
      position: fixed;
      top: 0;
      left: -80%;
      width: 80%;
      height: 100vh;
      background-color: white;
      z-index: 999;
      transition: left 0.3s ease;
      box-shadow: 2px 0 10px rgba(0,0,0,0.2);
      padding: 60px 20px 20px;
      overflow-y: auto;
  }
  
  .mobile-nav.active {
      left: 0;
  }
  
  .mobile-overlay {
      position: fixed;
      top: 0;
      left: 0;
      width: 100%;
      height: 100%;
      background-color: rgba(0,0,0,0.5);
      z-index: 998;
      display: none;
  }
  
  .mobile-overlay.active {
      display: block;
  }
  
  .mobile-hide {
      display: none !important;
  }
  
  .card-container {
      gap: 15px;
  }
  
  .card {
      width: 100%;
      max-width: 350px;
      height: 450px;
  }
  
  /* 隐藏logo */
  .logo-container .logo {
      display: none;
  }
}

@media (max-width: 480px) {
  .card {
      height: 360px;
  }
  
  .card-front, .card-back {
      padding: 10px;
  }
  
  .card-img {
      max-height: 200px;
      margin-bottom: 20px;
  }
  
  .card-word {
      font-size: 1.8rem;
  }
  
  .card-translation {
      font-size: 1.4rem;
  }
  
  .card-pronunciation {
      font-size: 1.4rem;
  }
  
  .card-example {
      font-size: 1.2rem;
      margin-top: 20px;
      padding: 10px;
  }
  
  .app-container {
      padding: 0.5rem;
  }
  
  .prompt-container {
      padding: 1rem 0.5rem;
  }
  
  .text-prompt {
      font-size: 1.1rem;
  }
}

/* 规则信息样式 */
.rules-info {
  text-align: center;
  margin: 0.5rem 0 1rem;
  color: #666;
  font-size: 0.9rem;
}

.rules-info p {
  margin: 0;
  padding: 0.5rem;
  background-color: transparent;
  border-radius: 0;
  display: inline-block;
}

/* 下划线输入样式 */
.underline-input-container {
  padding: 2rem;
  margin-bottom: 1.5rem;
  width: 100%;
  max-width: 100%;
  background-color: transparent;
  border-radius: 0;
  box-shadow: none;
}

.underline-words {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1.8rem;
  margin-bottom: 2.5rem;
  padding: 0.5rem 0;
  width: 100%;
  min-width: 100%;
}

.underline-words::-webkit-scrollbar {
  height: 8px;
}

.underline-words::-webkit-scrollbar-track {
  background: #f0f0f0;
  border-radius: 4px;
}

.underline-words::-webkit-scrollbar-thumb {
  background-color: var(--primary-color);
  border-radius: 4px;
}

.word-input-wrapper {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  margin: 0 8px 5px;
  position: relative;
  width: auto;
  min-width: fit-content;
}

.word-underline {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 0 5px 15px;
  border-bottom: 2px solid #4285F4; /* 默认边框颜色，将被JS覆盖 */
  width: auto; /* 允许根据内容自动调整宽度 */
}

.word-underline input {
  min-width: 120px;
  width: auto;
  font-size: 1.8rem;
  padding: 0.7rem 0.5rem;
  text-align: center;
  border: none;
  border-bottom: 2px solid #ddd;
  background-color: transparent;
  transition: all 0.3s ease;
  outline: none;
  font-weight: 500;
  color: var(--dark-color);
}

.word-underline input:focus {
  border-bottom-color: var(--primary-color);
  box-shadow: 0 2px 0 rgba(74, 111, 165, 0.2);
}

.word-underline input.correct {
  border-bottom-color: var(--correct-color);
  color: var(--correct-color);
  font-weight: 600;
}

.word-underline input.wrong {
  border-bottom-color: var(--wrong-color);
  color: var(--wrong-color);
  font-weight: 600;
}

.word-type-label {
  background-color: #4285F4; /* 默认背景颜色，将被JS覆盖 */
  color: white;
  font-size: 0.8rem;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* 虚拟键盘样式（可选） */
.virtual-keyboard {
  display: none; /* 默认隐藏，如需使用可以改为flex */
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 1rem;
}

.key {
  padding: 0.5rem 0.8rem;
  background-color: #f5f5f5;
  border-radius: 4px;
  border: 1px solid #ddd;
  cursor: pointer;
  transition: all 0.2s ease;
}

.key:hover {
  background-color: #e0e0e0;
}

/* 参考文本样式 */
.reference-text {
  font-size: 1.4rem;
  font-weight: 500;
  text-align: center;
  color: var(--primary-color);
  margin-bottom: 2rem;
  padding: 1rem;
  background-color: rgba(74, 111, 165, 0.08);
  border-radius: 8px;
  max-width: 90%;
  margin-left: auto;
  margin-right: auto;
  line-height: 1.5;
}

.words-container {
  display: flex;
  flex-wrap: nowrap;
  justify-content: flex-start;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
  overflow-x: auto;
  padding: 1rem 0.5rem;
  white-space: nowrap;
  scrollbar-width: thin;
  scrollbar-color: var(--primary-color) #f0f0f0;
}

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

.words-container::-webkit-scrollbar-track {
  background: #f0f0f0;
  border-radius: 4px;
}

.words-container::-webkit-scrollbar-thumb {
  background-color: var(--primary-color);
  border-radius: 4px;
}

.word-reference {
  font-size: 1.1rem;
  color: var(--primary-color);
  margin-bottom: 0.4rem;
  text-align: center;
  font-weight: 500;
}

/* 移除缩放控制按钮样式 */
.zoom-controls {
  display: none;
}

.zoom-btn {
  display: none;
}

/* 移除缩放类 */
.app-container.zoom-125,
.app-container.zoom-150,
.app-container.zoom-175,
.app-container.zoom-200 {
  font-size: inherit;
}

/* 组合提示样式 - 调整大小和填充 */
.combined-prompt {
  background-color: transparent;
  border-radius: 0;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  width: 100%;
  max-width: 3000px;
  margin-left: auto;
  margin-right: auto;
  box-shadow: none;
  position: relative;
}

.prompt-row {
  margin-bottom: 1rem;
  display: flex;
  align-items: baseline;
  justify-content: center;
  max-width: 2800px;
  width: 100%;
  margin-left: auto;
  margin-right: auto;
}

.prompt-row:last-child {
  margin-bottom: 0;
}

.prompt-label {
  font-weight: 600;
  color: var(--primary-color);
  margin-right: 1rem;
  font-size: 1.1rem;
  flex-shrink: 0;
  min-width: 3.5rem;
}

/* 提示文本调整，确保不换行且完全显示 */
.prompt-text {
  font-size: 1.6rem;
  line-height: 1.4;
  color: var(--dark-color);
  flex-grow: 1;
  padding: 0.4rem 0;
  font-weight: 500;
  max-width: 85%;
  text-align: left;
  white-space: nowrap;
  overflow: visible;
}

/* 翻译模式下的样式强调 */
.prompt-row:nth-child(1) .prompt-text {
  color: var(--primary-color);
  font-weight: 500;
}

.prompt-row:nth-child(2) .prompt-text {
  color: var(--secondary-color);
  font-weight: 500;
}

/* 单行模式下的文本显示修改 - 移除滚动效果，允许自动换行 */
.prompt-text.nowrap {
  white-space: normal;
  overflow-x: visible;
  display: block;
  padding: 0.5rem 0;
  overflow-y: visible;
}

/* 不再需要滚动条样式 */
.prompt-text.nowrap::-webkit-scrollbar {
  display: none;
}

/* 单语模式特殊处理加强 */
.prompt-row.single-lang {
  display: flex;
  align-items: center;
  width: 100%;
  max-width: 100%;
  justify-content: flex-start;
}

.prompt-row.single-lang .prompt-label {
  color: var(--secondary-color);
  font-weight: 600;
  padding-top: 0.5rem;
  width: auto;
  min-width: 3.5rem;
  margin-right: 1rem;
  flex-shrink: 0;
}

/* 单语模式下文本强化显示 */
.prompt-row.single-lang .prompt-text {
  font-size: 1.8rem;
  max-width: 90%;
  width: 100%;
  word-wrap: normal;
  text-align: left;
  white-space: nowrap;
  overflow: visible;
}

/* 单行模式下的文本显示修改 - 确保完整显示 */
.prompt-text.nowrap {
  white-space: nowrap;
  overflow-x: visible;
  display: inline-block;
  padding: 0.5rem 0;
  width: auto;
  max-width: none;
}

/* 响应式调整 */
@media (max-width: 768px) {
  .combined-prompt {
      padding: 1.2rem;
      margin-bottom: 1.2rem;
  }

  .prompt-label {
      font-size: 1rem;
      margin-right: 0.7rem;
      min-width: 3rem;
  }

  .prompt-text {
      font-size: 1.4rem;
  }

  .prompt-row.single-lang .prompt-text {
      font-size: 1.6rem;
  }
  
  .word-underline input {
      min-width: 100px;
      font-size: 1.6rem;
      padding: 0.6rem 0.4rem;
  }
}

@media (max-width: 480px) {
  .prompt-text {
      font-size: 1.3rem;
  }

  .prompt-row.single-lang .prompt-text {
      font-size: 1.4rem;
  }

  .word-underline input {
      min-width: 90px;
      font-size: 1.4rem;
      padding: 0.5rem 0.3rem;
  }
}

/* 模式选择页面样式 */
.mode-select-container {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  background-color: var(--background-color);
}

.mode-select-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem 0 2rem;
  position: relative;
  margin-bottom: 1rem;
}

.logo-container.centered {
  justify-content: center;
  margin-bottom: 1.5rem;
}

.logo-container.centered .logo {
  width: 200px;
  height: 200px;
  margin-right: 0;
  margin-bottom: 0;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.logo-container.centered h1 {
  font-size: 2.5rem;
  text-align: center;
  margin-top: 0.5rem;
  font-weight: 600;
  color: var(--primary-color);
  letter-spacing: 0.5px;
}

.mode-select-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;
}

.mode-select-title {
  font-size: 2rem;
  color: var(--primary-color);
  margin-bottom: 3rem;
  text-align: center;
  font-weight: 500;
}

.mode-cards {
  display: flex;
  justify-content: center;
  gap: 3rem;
  flex-wrap: wrap;
  max-width: 1200px;
  margin: 0 auto;
}

.mode-card {
  background-color: white;
  border-radius: 12px;
  padding: 2.5rem;
  width: 300px;
  text-align: center;
  text-decoration: none;
  color: var(--text-color);
  transition: all 0.3s ease;
  box-shadow: 0 5px 15px rgba(0,0,0,0.05);
  display: flex;
  flex-direction: column;
  align-items: center;
}

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

.mode-card-icon {
  background-color: rgba(74, 111, 165, 0.1);
  width: 80px;
  height: 80px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.5rem;
}

.mode-card-icon .material-icon {
  font-size: 2.5rem;
  color: var(--primary-color);
  font-weight: bold;
}

.mode-card h3 {
  font-size: 1.6rem;
  margin-bottom: 1rem;
  color: var(--primary-color);
}

.mode-card p {
  font-size: 1rem;
  color: #666;
  line-height: 1.5;
}

.mode-select-footer {
  text-align: center;
  padding: 2rem 0;
  color: #777;
  font-size: 0.9rem;
}

/* 为返回按钮添加样式 */
.controls .control-btn {
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* 响应式样式调整 */
@media (max-width: 768px) {
  .mode-cards {
      flex-direction: column;
      gap: 2rem;
  }
  
  .mode-card {
      width: 100%;
      max-width: 320px;
      padding: 2rem;
  }
  
  .mode-select-title {
      font-size: 1.8rem;
      margin-bottom: 2rem;
  }
}

/* 彩色单词样式 */
.colored-words {
  display: inline-block;
  line-height: 1.7;
}

/* 默认隐藏英文区域 */
.prompt-row.english-prompt {
  opacity: 0;
  height: 0;
  overflow: hidden;
  transition: all 0.3s ease;
}

.prompt-row.english-prompt.show {
  opacity: 1;
  height: auto;
  overflow: visible;
  margin-top: 0.5rem;
}

/* 显示英文按钮 */
.toggle-english-btn {
  background-color: var(--primary-color);
  color: white;
  border: none;
  padding: 0.7rem 1.5rem;
  font-size: 0.95rem;
  border-radius: 4px;
  cursor: pointer;
  transition: background-color 0.3s;
  min-width: 100px;
  box-shadow: none;
}

.toggle-english-btn:hover {
  background-color: #3d5d8a;
}

.toggle-english-btn:active {
  transform: translateY(0);
}

/* 提示区域需要相对定位以便放置按钮 */
.combined-prompt {
  position: relative;
}

.colored-word {
  display: inline-block;
  font-weight: 500;
  margin-right: 4px;
  transition: all 0.2s ease;
}

.colored-word:hover {
  transform: translateY(-2px);
  text-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* 句子编号显示样式 */
.sentence-number {
  position: absolute;
  top: -15px;
  left: 50%;
  transform: translateX(-50%);
  background-color: var(--primary-color);
  color: white;
  font-size: 0.85rem;
  font-weight: 500;
  padding: 0.2rem 0.7rem;
  border-radius: 20px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
  z-index: 2;
}

.word-number {
  position: absolute;
  top: -15px;
  left: 50%;
  transform: translateX(-50%);
  background-color: var(--primary-color);
  color: white;
  font-size: 0.85rem;
  font-weight: 500;
  padding: 0.2rem 0.7rem;
  border-radius: 20px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
  z-index: 2;
}

/* 句子模式提示样式 */
.sentence-mode-hint {
  padding: 8px 0;
  margin-bottom: 10px;
}

.sentence-mode-hint p {
  margin: 0;
  color: #333;
  font-weight: 500;
  font-size: 14px;
} 