/* 客舱英语题库样式 */
* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", sans-serif;
  background: #f5f7fa;
  color: #333;
  line-height: 1.6;
}

.app-container {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* 顶部导航 */
.header {
  background: white;
  padding: 15px 30px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.05);
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 20px;
}

.back-btn {
  color: #666;
  text-decoration: none;
  font-size: 14px;
  transition: color 0.3s;
}

.back-btn:hover {
  color: #667eea;
}

.header h1 {
  font-size: 1.5em;
  color: #333;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 20px;
}

.progress-info {
  font-size: 14px;
  color: #666;
}

.progress-info strong {
  color: #667eea;
  font-size: 16px;
}

.btn-icon {
  background: #f5f7fa;
  border: none;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 18px;
  transition: all 0.3s;
}

.btn-icon:hover {
  background: #667eea;
  transform: scale(1.1);
}

/* 主容器 */
.main-container {
  display: flex;
  flex: 1;
  max-width: 1400px;
  width: 100%;
  margin: 0 auto;
  padding: 20px;
  gap: 20px;
}

/* 侧边栏 */
.sidebar {
  width: 280px;
  background: white;
  border-radius: 15px;
  padding: 20px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.05);
  height: fit-content;
  position: sticky;
  top: 90px;
}

.menu-section {
  margin-bottom: 25px;
}

.menu-section h3 {
  font-size: 14px;
  color: #999;
  margin-bottom: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.menu-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 15px;
  border: none;
  background: white;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.3s;
  font-size: 15px;
  color: #333;
  margin-bottom: 8px;
}

.menu-item:hover {
  background: #f5f7fa;
  transform: translateX(5px);
}

.menu-item.active {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  box-shadow: 0 4px 15px rgba(102,126,234,0.3);
}

.menu-item .icon {
  font-size: 20px;
}

.menu-item span:nth-child(2) {
  flex: 1;
  text-align: left;
}

.badge {
  background: #e3f2fd;
  color: #1976d2;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
}

.menu-item.active .badge {
  background: rgba(255,255,255,0.3);
  color: white;
}

.badge-hot {
  background: #ffebee;
  color: #c62828;
  animation: pulse 2s infinite;
}

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

/* 内容区 */
.content {
  flex: 1;
  min-width: 0;
}

/* 欢迎页 */
.welcome-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 500px;
}

.welcome-card {
  background: white;
  border-radius: 20px;
  padding: 60px;
  text-align: center;
  box-shadow: 0 10px 30px rgba(0,0,0,0.1);
  max-width: 600px;
}

.welcome-card h2 {
  font-size: 2em;
  margin-bottom: 15px;
  color: #333;
}

.welcome-card p {
  color: #666;
  margin-bottom: 40px;
  font-size: 1.1em;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 30px;
  margin-bottom: 40px;
}

.stat-item {
  text-align: center;
}

.stat-number {
  font-size: 2.5em;
  font-weight: bold;
  color: #667eea;
  margin-bottom: 8px;
}

.stat-label {
  font-size: 14px;
  color: #999;
}

.btn-primary {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border: none;
  padding: 15px 40px;
  border-radius: 25px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s;
  box-shadow: 0 4px 15px rgba(102,126,234,0.3);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(102,126,234,0.4);
}

.btn-large {
  padding: 18px 50px;
  font-size: 18px;
}

/* 练习页 */
.practice-page {
  background: white;
  border-radius: 20px;
  padding: 30px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.question-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 25px;
  padding-bottom: 15px;
  border-bottom: 2px solid #f5f7fa;
}

.question-meta {
  display: flex;
  gap: 15px;
  align-items: center;
}

.question-number {
  font-size: 16px;
  color: #666;
}

.question-number strong {
  color: #667eea;
  font-size: 18px;
}

.question-type-badge {
  background: #e3f2fd;
  color: #1976d2;
  padding: 6px 15px;
  border-radius: 15px;
  font-size: 14px;
  font-weight: 500;
}

.high-freq-badge {
  background: #ffebee;
  color: #c62828;
  padding: 6px 15px;
  border-radius: 15px;
  font-size: 14px;
  font-weight: 600;
  animation: pulse 2s infinite;
}

.question-actions {
  display: flex;
  gap: 10px;
}

.question-card {
  margin-bottom: 30px;
}

.question-content {
  margin-bottom: 30px;
}

.question-content h3 {
  font-size: 1.3em;
  line-height: 1.8;
  color: #333;
  margin-bottom: 20px;
}

.btn-audio {
  background: #667eea;
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: 20px;
  cursor: pointer;
  font-size: 14px;
  transition: all 0.3s;
}

.btn-audio:hover {
  background: #5568d3;
  transform: scale(1.05);
}

/* 选项 */
.options-container {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 25px;
}

.option-item {
  background: #f8f9fa;
  border: 2px solid #e9ecef;
  padding: 15px 20px;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.3s;
  font-size: 15px;
}

.option-item:hover {
  background: #e3f2fd;
  border-color: #90caf9;
  transform: translateX(5px);
}

.option-item.selected {
  background: #667eea;
  border-color: #667eea;
  color: white;
  font-weight: 500;
}

.option-item.correct {
  background: #c8e6c9;
  border-color: #4caf50;
  color: #2e7d32;
}

.option-item.wrong {
  background: #ffcdd2;
  border-color: #f44336;
  color: #c62828;
}

.option-item.disabled {
  pointer-events: none;
  opacity: 0.7;
}

/* 翻译输入 */
.translation-input {
  margin-bottom: 25px;
}

.translation-input textarea {
  width: 100%;
  padding: 15px;
  border: 2px solid #e9ecef;
  border-radius: 12px;
  font-size: 15px;
  font-family: inherit;
  resize: vertical;
  transition: border-color 0.3s;
}

.translation-input textarea:focus {
  outline: none;
  border-color: #667eea;
}

/* 答案操作按钮 */
.answer-actions {
  display: flex;
  gap: 15px;
  margin-bottom: 30px;
}

.btn-secondary {
  background: white;
  color: #667eea;
  border: 2px solid #667eea;
  padding: 12px 30px;
  border-radius: 20px;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s;
}

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

/* 结果卡片 */
.result-card {
  background: #f8f9fa;
  border-radius: 15px;
  padding: 25px;
  margin-bottom: 25px;
}

.result-header {
  display: flex;
  align-items: center;
  gap: 15px;
  margin-bottom: 20px;
}

.result-icon {
  font-size: 3em;
}

.result-text h4 {
  font-size: 1.3em;
  margin-bottom: 5px;
}

.result-correct {
  border-left: 5px solid #4caf50;
}

.result-correct .result-icon {
  color: #4caf50;
}

.result-correct h4 {
  color: #2e7d32;
}

.result-wrong {
  border-left: 5px solid #f44336;
}

.result-wrong .result-icon {
  color: #f44336;
}

.result-wrong h4 {
  color: #c62828;
}

.answer-section {
  background: white;
  padding: 15px;
  border-radius: 10px;
  margin-bottom: 15px;
}

.answer-section h5 {
  font-size: 14px;
  color: #999;
  margin-bottom: 8px;
  text-transform: uppercase;
}

.answer-section p {
  font-size: 15px;
  line-height: 1.6;
  color: #333;
}

.explanation-section {
  background: #e3f2fd;
  padding: 15px;
  border-radius: 10px;
  border-left: 4px solid #1976d2;
}

.explanation-section h5 {
  color: #1565c0;
  margin-bottom: 10px;
}

.memory-tip {
  background: #fff3e0;
  padding: 15px;
  border-radius: 10px;
  border-left: 4px solid #f57c00;
  margin-top: 15px;
}

.memory-tip h5 {
  color: #e65100;
  margin-bottom: 10px;
}

/* 导航按钮 */
.navigation-btns {
  display: flex;
  justify-content: space-between;
  gap: 15px;
}

.btn-nav {
  flex: 1;
  background: white;
  color: #667eea;
  border: 2px solid #667eea;
  padding: 15px 30px;
  border-radius: 25px;
  font-size: 16px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s;
}

.btn-nav:hover {
  background: #f5f7fa;
  transform: translateY(-2px);
}

.btn-nav.btn-primary {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border: none;
}

.btn-nav.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(102,126,234,0.4);
}

/* 模态框 */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.modal-content {
  background: white;
  border-radius: 20px;
  padding: 40px;
  max-width: 500px;
  width: 90%;
  position: relative;
  box-shadow: 0 10px 40px rgba(0,0,0,0.3);
}

.modal-close {
  position: absolute;
  top: 15px;
  right: 20px;
  font-size: 30px;
  cursor: pointer;
  color: #999;
  transition: color 0.3s;
}

.modal-close:hover {
  color: #333;
}

.modal-content h2 {
  margin-bottom: 25px;
  color: #333;
}

#userInfo p {
  margin-bottom: 15px;
  font-size: 15px;
  color: #666;
}

#userInfo strong {
  color: #667eea;
}

.question-meta { flex-wrap: wrap; }
.practice-jump { display: inline-flex; align-items: center; gap: 7px; flex-wrap: wrap; font-size: 14px; color: #667085; }
.practice-jump input { width: 78px; min-height: 36px; padding: 6px 9px; border: 1px solid #d7def0; border-radius: 8px; color: #344054; font: inherit; background: #fff; }
.practice-jump input:focus { outline: 2px solid #667eea; outline-offset: 1px; }
.practice-jump input[aria-invalid="true"] { border-color: #d92d20; }
.practice-jump-button { border: 0; border-radius: 8px; background: #667eea; color: white; padding: 8px 15px; min-height: 36px; cursor: pointer; font: inherit; }
.practice-jump-button:hover { background: #535fc7; }
.practice-jump-error { color: #b42318; font-size: 13px; line-height: 1.6; }
.practice-jump-error:not(:empty) { margin: 0 0 14px; }
.mobile-menu-btn { display:none; }
.content { min-width:0; }
/* 响应式 */
@media (max-width: 1024px) {
  .main-container { display:block; }
  .mobile-menu-btn { display:block;width:100%;padding:12px;border:1px solid #d7def0;border-radius:10px;background:white;color:#5664ce;font-size:16px;text-align:left;margin-bottom:12px; }
  .main-container.menu-open .sidebar { display:block;width:100%;margin-bottom:16px; }
  .sidebar {
    display: none;
  }

  .main-container {
    padding: 15px;
  }
}

@media (max-width: 768px) {
  .header,.header-left,.header-right,.question-meta { flex-wrap:wrap;gap:10px; }
  input,select,textarea { font-size:16px; }
  .question-content h3,.option-item,.result-card { overflow-wrap:anywhere; }
  .header {
    padding: 12px 15px;
  }

  .header h1 {
    font-size: 1.2em;
  }

  .stats-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .welcome-card {
    padding: 30px 20px;
  }

  .practice-page {
    padding: 20px 15px;
  }

  .question-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  .navigation-btns {
    flex-direction: column;
  }
}
