/* ============================================================
   Immersive Learning Mode - 全屏沉浸式学习模式
   适用于学习、复习、快速过词等场景
   ============================================================ */

/* ============================================================
   全屏容器
   ============================================================ */

.immersive-container {
  position: fixed;
  inset: 0;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
  z-index: 10;
}

/* 主题变体 - 统一的现代配色方案 */
.immersive-container.theme-calm {
  background: linear-gradient(135deg, #e0f2fe 0%, #dbeafe 100%);
}

.immersive-container.theme-focus {
  background: linear-gradient(135deg, #1e293b 0%, #334155 100%);
}

.immersive-container.theme-energy {
  background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
}

.immersive-container.theme-minimal {
  background: #f8fafc;
}

/* ============================================================
   学习卡片
   ============================================================ */

.immersive-card {
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(20px);
  border-radius: 32px;
  padding: 60px;
  max-width: 900px;
  width: 100%;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 500px;
  position: relative;
  animation: cardEnter 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes cardEnter {
  from {
    opacity: 0;
    transform: scale(0.95) translateY(20px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

/* ============================================================
   单词展示区（类似QWERTY Learner）
   ============================================================ */

.word-display {
  text-align: center;
  margin-bottom: 40px;
  width: 100%;
}

.word-main {
  font-size: 72px;
  font-weight: 800;
  color: #1a2332;
  letter-spacing: -2px;
  margin-bottom: 16px;
  line-height: 1;
  animation: wordFadeIn 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

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

.word-phonetic {
  font-size: 24px;
  color: #7a8fa6;
  font-style: italic;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

.word-play-btn {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--blue);
  border: none;
  color: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  font-size: 20px;
}

.word-play-btn:hover {
  background: var(--blue-mid);
  transform: scale(1.1);
}

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

.word-meaning {
  font-size: 28px;
  color: #3d5166;
  font-weight: 500;
  margin-bottom: 12px;
  animation: wordFadeIn 0.5s cubic-bezier(0.4, 0, 0.2, 1) 0.1s both;
}

.word-pos-tag {
  display: inline-block;
  padding: 6px 16px;
  background: var(--blue-light);
  color: #0c447c;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 24px;
  animation: wordFadeIn 0.5s cubic-bezier(0.4, 0, 0.2, 1) 0.2s both;
}

/* ============================================================
   快速过词模式 - 逐个展示
   ============================================================ */

.blitz-mode {
  text-align: center;
  width: 100%;
}

.blitz-word {
  font-size: 96px;
  font-weight: 900;
  color: #042c53;
  letter-spacing: -3px;
  margin-bottom: 32px;
  line-height: 1;
  animation: blitzPulse 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes blitzPulse {
  0% {
    opacity: 0;
    transform: scale(0.8);
  }
  50% {
    opacity: 1;
    transform: scale(1.05);
  }
  100% {
    opacity: 1;
    transform: scale(1);
  }
}

.blitz-info {
  display: flex;
  flex-direction: column;
  gap: 16px;
  align-items: center;
  animation: wordFadeIn 0.5s cubic-bezier(0.4, 0, 0.2, 1) 0.3s both;
}

.blitz-phonetic {
  font-size: 32px;
  color: #7a8fa6;
  font-style: italic;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
}

.blitz-meaning {
  font-size: 36px;
  color: #1a2332;
  font-weight: 600;
}

.blitz-example {
  max-width: 600px;
  margin-top: 24px;
  padding: 24px;
  background: rgba(26, 111, 196, 0.08);
  border-radius: 16px;
  animation: wordFadeIn 0.5s cubic-bezier(0.4, 0, 0.2, 1) 0.4s both;
}

.blitz-example-text {
  font-size: 18px;
  color: #3d5166;
  line-height: 1.8;
  margin-bottom: 8px;
}

.blitz-example-trans {
  font-size: 15px;
  color: #7a8fa6;
}

/* ============================================================
   进度指示器
   ============================================================ */

.immersive-progress {
  position: absolute;
  top: 30px;
  left: 30px;
  right: 30px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.progress-bar-wrap {
  flex: 1;
  height: 8px;
  background: rgba(0, 0, 0, 0.08);
  border-radius: 99px;
  overflow: hidden;
  margin: 0 20px;
}

.progress-bar-fill {
  height: 100%;
  background: var(--blue);
  border-radius: 99px;
  transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.progress-text {
  font-size: 14px;
  color: #3d5166;
  font-weight: 600;
  white-space: nowrap;
}

/* ============================================================
   操作按钮区
   ============================================================ */

.immersive-actions {
  display: flex;
  gap: 16px;
  margin-top: 40px;
  width: 100%;
  max-width: 600px;
}

.immersive-btn {
  flex: 1;
  padding: 20px;
  border: none;
  border-radius: 16px;
  font-family: var(--font);
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.immersive-btn:active {
  transform: scale(0.97);
}

.immersive-btn-primary {
  background: var(--green);
  color: white;
  flex: 2;
}

.immersive-btn-primary:hover {
  background: #15633a;
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(26, 122, 67, 0.3);
}

.immersive-btn-secondary {
  background: var(--amber);
  color: white;
}

.immersive-btn-secondary:hover {
  background: #9d6b0c;
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(183, 119, 13, 0.3);
}

.immersive-btn-danger {
  background: var(--red);
  color: white;
}

.immersive-btn-danger:hover {
  background: #a02f23;
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(192, 57, 43, 0.3);
}

.immersive-btn-label {
  font-size: 18px;
}

.immersive-btn-hint {
  font-size: 12px;
  opacity: 0.8;
  font-weight: 400;
}

/* ============================================================
   快捷键提示（底部居中）
   ============================================================ */

.immersive-shortcuts {
  position: absolute;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 24px;
  align-items: center;
}

.shortcut-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: #7a8fa6;
}

.shortcut-key {
  background: rgba(0, 0, 0, 0.06);
  padding: 4px 10px;
  border-radius: 6px;
  font-family: monospace;
  font-size: 12px;
  font-weight: 600;
  border: 1px solid rgba(0, 0, 0, 0.1);
}

/* ============================================================
   退出按钮
   ============================================================ */

.immersive-exit {
  position: absolute;
  top: 30px;
  right: 30px;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.05);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  color: #3d5166;
  transition: all 0.2s;
  z-index: 100;
}

.immersive-exit:hover {
  background: rgba(192, 57, 43, 0.1);
  color: var(--red);
  transform: scale(1.1);
}

/* ============================================================
   统计信息面板（可选展开）
   ============================================================ */

.immersive-stats {
  position: absolute;
  bottom: 30px;
  right: 30px;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(10px);
  padding: 16px 20px;
  border-radius: 16px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  display: flex;
  gap: 20px;
}

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

.stat-value {
  font-size: 24px;
  font-weight: 700;
  color: var(--blue);
}

.stat-label {
  font-size: 11px;
  color: #7a8fa6;
  margin-top: 2px;
}

/* ============================================================
   响应式设计
   ============================================================ */

@media (max-width: 900px) {
  .immersive-card {
    padding: 40px 30px;
    min-height: 400px;
  }
  
  .word-main {
    font-size: 56px;
  }
  
  .blitz-word {
    font-size: 72px;
  }
  
  .blitz-phonetic {
    font-size: 24px;
  }
  
  .blitz-meaning {
    font-size: 28px;
  }
  
  .immersive-actions {
    flex-direction: column;
  }
  
  .immersive-btn-primary {
    flex: 1;
  }
  
  .immersive-shortcuts {
    display: none;
  }
  
  .immersive-stats {
    display: none;
  }
}

@media (max-width: 600px) {
  .immersive-container {
    padding: 20px;
  }
  
  .immersive-card {
    padding: 30px 20px;
    border-radius: 24px;
  }
  
  .word-main {
    font-size: 48px;
  }
  
  .word-meaning {
    font-size: 22px;
  }
  
  .blitz-word {
    font-size: 56px;
  }
  
  .blitz-phonetic {
    font-size: 20px;
  }
  
  .blitz-meaning {
    font-size: 24px;
  }
  
  .immersive-progress {
    top: 20px;
    left: 20px;
    right: 20px;
  }
  
  .immersive-exit {
    top: 20px;
    right: 20px;
  }
}

/* ============================================================
   键盘导航视觉反馈
   ============================================================ */

.immersive-btn.keyboard-focus {
  outline: 3px solid rgba(26, 111, 196, 0.5);
  outline-offset: 4px;
}

/* 空格键按下动画 */
@keyframes spacePress {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(0.98);
  }
}

.immersive-card.space-pressed {
  animation: spacePress 0.2s ease;
}
