/* 全局样式重置 */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
  background-color: #f5f7fa;
  color: #333;
  line-height: 1.6;
}

/* 练习系统容器 */
.practice-system {
  max-width: 800px;
  margin: 0 auto;
  padding: 2rem;
}

/* 系统标题 */
.system-title {
  font-size: 2rem;
  font-weight: bold;
  text-align: center;
  color: #1f2937;
  margin-bottom: 2rem;
}

/* 控制按钮区域 */
.controls {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin-bottom: 2rem;
}

/* 按钮样式 */
.btn {
  padding: 0.75rem 1.5rem;
  font-size: 1rem;
  font-weight: 500;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.btn:hover {
  transform: translateY(-2px);
}

.btn:active {
  transform: translateY(0);
}

.btn-primary {
  background-color: #4f46e5;
  color: white;
}

.btn-primary:hover {
  background-color: #4338ca;
}

.btn-secondary {
  background-color: white;
  color: #4b5563;
  border: 1px solid #d1d5db;
}

.btn-secondary:hover {
  background-color: #f9fafb;
  border-color: #9ca3af;
}

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

/* 进度条 */
.progress {
  margin-bottom: 2rem;
}

.progress-bar {
  height: 8px;
  background-color: #4f46e5;
  border-radius: 4px;
  transition: width 0.3s ease;
}

.progress-info {
  display: flex;
  justify-content: space-between;
  margin-top: 0.5rem;
  font-size: 0.875rem;
  color: #6b7280;
}

/* 卡片样式 */
.card {
  background-color: white;
  border-radius: 12px;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  overflow: hidden;
  margin-bottom: 2rem;
}

.card-content {
  padding: 2rem;
}

/* 初始状态 */
.initial-state {
  text-align: center;
  padding: 3rem 0;
}

.initial-title {
  font-size: 1.25rem;
  color: #6b7280;
  margin-bottom: 0.5rem;
}

.initial-subtitle {
  font-size: 0.875rem;
  color: #9ca3af;
}

/* 加载状态 */
.loading-state {
  text-align: center;
  padding: 3rem 0;
}

.loading-text {
  font-size: 1.125rem;
  color: #6b7280;
}

/* 错误状态 */
.error-state {
  text-align: center;
  padding: 3rem 0;
}

.error-title {
  font-size: 1.25rem;
  color: #ef4444;
  font-weight: 500;
  margin-bottom: 0.5rem;
}

.error-subtitle {
  font-size: 0.875rem;
  color: #6b7280;
}

/* 题目样式 */
.question-progress {
  font-size: 0.875rem;
  color: #6b7280;
  margin-bottom: 1.5rem;
}

.question-category {
  display: inline-block;
  background-color: #eef2ff;
  color: #4f46e5;
  padding: 0.25rem 1rem;
  border-radius: 9999px;
  font-size: 0.875rem;
  font-weight: 500;
  margin-bottom: 1rem;
}

.question-title {
  font-size: 1.5rem;
  font-weight: 600;
  color: #1f2937;
  margin-bottom: 1.5rem;
  line-height: 1.4;
}

/* 选项容器 */
.options-container {
  margin-bottom: 2rem;
}

.option-item {
  display: flex;
  align-items: flex-start;
  padding: 1rem;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  margin-bottom: 0.75rem;
  transition: all 0.2s ease;
  cursor: pointer;
}

.option-item:hover {
  border-color: #d1d5db;
  box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}

.option-item.option-selected {
  border-color: #4f46e5;
  background-color: #f5f3ff;
}

.option-item.option-correct {
  border-color: #10b981;
  background-color: #d1fae5;
}

.option-item.option-incorrect {
  border-color: #ef4444;
  background-color: #fee2e2;
}

.option-input {
  margin-right: 0.75rem;
  margin-top: 0.25rem;
  accent-color: #4f46e5;
}

.option-label {
  flex: 1;
  display: flex;
  align-items: flex-start;
  cursor: pointer;
}

.option-letter {
  font-weight: 600;
  color: #4f46e5;
  margin-right: 0.5rem;
}

.option-text {
  color: #1f2937;
  line-height: 1.5;
}

.option-icon {
  font-size: 1.25rem;
  font-weight: bold;
}

.correct-icon {
  color: #10b981;
}

.incorrect-icon {
  color: #ef4444;
}

/* 反馈容器 */
.feedback-container {
  margin-top: 2rem;
  padding-top: 2rem;
  border-top: 1px solid #e5e7eb;
}

.feedback {
  padding: 1.5rem;
  border-radius: 8px;
  margin-bottom: 1rem;
}

.feedback-correct {
  background-color: #d1fae5;
  border: 1px solid #a7f3d0;
}

.feedback-incorrect {
  background-color: #fee2e2;
  border: 1px solid #fecaca;
}

.feedback-header {
  display: flex;
  align-items: center;
  margin-bottom: 0.75rem;
}

.feedback-icon {
  font-size: 1.25rem;
  font-weight: bold;
  margin-right: 0.5rem;
}

.feedback-correct .feedback-icon {
  color: #059669;
}

.feedback-incorrect .feedback-icon {
  color: #dc2626;
}

.feedback-title {
  font-weight: 600;
  font-size: 1.125rem;
}

.feedback-correct .feedback-title {
  color: #065f46;
}

.feedback-incorrect .feedback-title {
  color: #991b1b;
}

.feedback-content {
  color: #374151;
  line-height: 1.5;
}

.feedback-answer {
  font-weight: 600;
  color: #4f46e5;
}

/* 题目操作按钮 */
.question-actions {
  display: flex;
  gap: 1rem;
  margin-top: 2rem;
}

.question-actions .btn {
  flex: 1;
}

/* 提交页面 */
.submit-page {
  text-align: center;
  padding: 3rem 0;
}

.submit-title {
  font-size: 1.5rem;
  font-weight: 600;
  color: #1f2937;
  margin-bottom: 1rem;
}

.submit-subtitle {
  color: #6b7280;
  margin-bottom: 2rem;
}

.submit-btn {
  font-size: 1.125rem;
  padding: 0.75rem 2rem;
}

/* 结果页面 */
.result {
  text-align: center;
}

.result-header {
  margin-bottom: 2rem;
}

.result-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 4rem;
  height: 4rem;
  background-color: #d1fae5;
  color: #059669;
  border-radius: 50%;
  margin-bottom: 1rem;
}

.check-icon {
  width: 2rem;
  height: 2rem;
}

.result-title {
  font-size: 1.5rem;
  font-weight: 600;
  color: #1f2937;
  margin-bottom: 0.5rem;
}

.result-score {
  font-size: 1.25rem;
  font-weight: 600;
  color: #4f46e5;
  margin-bottom: 0.5rem;
}

.result-accuracy {
  color: #6b7280;
  margin-bottom: 2rem;
}

.result-actions {
  display: flex;
  gap: 1rem;
  justify-content: center;
}

.result-actions .btn {
  flex: 1;
  max-width: 200px;
}

/* 动画效果 */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.fade-in {
  animation: fadeIn 0.5s ease-out;
}

/* 响应式设计 */
@media (max-width: 768px) {
  .practice-system {
    padding: 1rem;
  }
  
  .system-title {
    font-size: 1.5rem;
  }
  
  .card-content {
    padding: 1.5rem;
  }
  
  .question-actions {
    flex-direction: column;
  }
  
  .result-actions {
    flex-direction: column;
  }
  
  .result-actions .btn {
    max-width: none;
  }
}
