/* ===== 学习成长体系样式 ===== */

/* 页面头部 */
.learning-header {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: #fff;
  padding: 40px 0;
  text-align: center;
  margin-bottom: 30px;
}

.learning-header h1 {
  font-size: 2rem;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

/* 进度卡片 */
.progress-section {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.progress-card {
  background: #fff;
  border-radius: var(--radius);
  padding: 20px;
  text-align: center;
  box-shadow: var(--shadow);
  transition: all 0.3s;
}

.progress-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.progress-card .progress-icon {
  font-size: 2.5rem;
  margin-bottom: 12px;
}

.progress-card .progress-value {
  font-size: 2rem;
  font-weight: 700;
  color: #667eea;
  margin-bottom: 4px;
}

.progress-card .progress-label {
  color: var(--gray-600);
  font-size: 0.9rem;
}

.progress-card.highlight {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: #fff;
}

.progress-card.highlight .progress-value,
.progress-card.highlight .progress-label {
  color: #fff;
}

/* 成就卡片 */
.achievement-section {
  margin-bottom: 24px;
}

.level-badge {
  background: #fff;
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 16px;
}

.level-icon {
  font-size: 3rem;
}

.level-info {
  flex: 1;
}

.level-name {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--gray-900);
  margin-bottom: 4px;
}

.level-progress {
  width: 100%;
  height: 8px;
  background: var(--gray-200);
  border-radius: 4px;
  overflow: hidden;
  margin-top: 8px;
}

.level-progress-bar {
  height: 100%;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-radius: 4px;
  transition: width 0.5s;
}

.level-points {
  font-size: 0.9rem;
  color: var(--gray-600);
  margin-top: 4px;
}

.badges-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 12px;
}

.badge-item {
  background: #fff;
  border-radius: var(--radius);
  padding: 16px;
  text-align: center;
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: all 0.3s;
  border: 2px solid transparent;
}

.badge-item:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.badge-item.unlocked {
  border-color: #667eea;
}

.badge-item.locked {
  opacity: 0.6;
}

.badge-icon {
  font-size: 2.5rem;
  margin-bottom: 8px;
}

.badge-name {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--gray-800);
  margin-bottom: 4px;
}

.badge-desc {
  font-size: 0.75rem;
  color: var(--gray-500);
}

.badge-item.locked .badge-icon {
  filter: grayscale(100%);
}

/* 标签页 */
.filter-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.filter-tab {
  padding: 10px 20px;
  border: 2px solid var(--gray-200);
  border-radius: 25px;
  background: #fff;
  cursor: pointer;
  transition: all 0.3s;
  font-size: 0.9rem;
}

.filter-tab:hover {
  border-color: #667eea;
  color: #667eea;
}

.filter-tab.active {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: #fff;
  border-color: transparent;
}

/* 练习/考试模式 */
.practice-container {
  background: #fff;
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
}

.practice-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 16px;
}

.practice-info {
  display: flex;
  gap: 24px;
  align-items: center;
}

.practice-stat {
  display: flex;
  align-items: center;
  gap: 8px;
}

.practice-stat .stat-icon {
  font-size: 1.2rem;
}

.practice-stat .stat-value {
  font-weight: 600;
  color: #667eea;
}

.practice-timer {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: #fff;
  padding: 8px 16px;
  border-radius: 20px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
}

.practice-timer.warning {
  background: #f59e0b;
}

.practice-timer.danger {
  background: #ef4444;
  animation: pulse 1s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

/* 题目卡片 */
.question-card {
  margin-bottom: 24px;
}

.question-meta {
  display: flex;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.question-tag {
  padding: 4px 12px;
  background: var(--gray-100);
  border-radius: 20px;
  font-size: 0.85rem;
  color: var(--gray-600);
}

.question-tag.difficulty-easy {
  background: #dcfce7;
  color: #16a34a;
}

.question-tag.difficulty-medium {
  background: #fef3c7;
  color: #d97706;
}

.question-tag.difficulty-hard {
  background: #fee2e2;
  color: #dc2626;
}

.question-content {
  font-size: 1.1rem;
  line-height: 1.7;
  color: var(--gray-800);
  margin-bottom: 20px;
}

.options-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.option-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 16px;
  border: 2px solid var(--gray-200);
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.3s;
}

.option-item:hover {
  border-color: #667eea;
  background: #f9f9ff;
}

.option-item.selected {
  border-color: #667eea;
  background: #f0f0ff;
}

.option-item.correct {
  border-color: #10b981;
  background: #dcfce7;
}

.option-item.incorrect {
  border-color: #ef4444;
  background: #fee2e2;
}

.option-item .option-letter {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--gray-100);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  flex-shrink: 0;
}

.option-item.selected .option-letter {
  background: #667eea;
  color: #fff;
}

.option-item.correct .option-letter {
  background: #10b981;
  color: #fff;
}

.option-item.incorrect .option-letter {
  background: #ef4444;
  color: #fff;
}

.option-item .option-text {
  flex: 1;
  line-height: 1.6;
}

/* 判断题 */
.judge-options {
  display: flex;
  gap: 16px;
}

.judge-option {
  flex: 1;
  padding: 16px;
  border: 2px solid var(--gray-200);
  border-radius: 12px;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s;
}

.judge-option:hover {
  border-color: #667eea;
}

.judge-option.selected {
  border-color: #667eea;
  background: #f0f0ff;
}

/* 答案解析 */
.explanation {
  background: #f0f9ff;
  border-left: 4px solid #667eea;
  padding: 16px;
  border-radius: 0 8px 8px 0;
  margin-top: 20px;
}

.explanation h4 {
  color: #667eea;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.explanation p {
  color: var(--gray-700);
  line-height: 1.6;
}

.explanation.correct {
  background: #dcfce7;
  border-color: #10b981;
}

.explanation.correct h4 {
  color: #10b981;
}

.explanation.incorrect {
  background: #fee2e2;
  border-color: #ef4444;
}

.explanation.incorrect h4 {
  color: #ef4444;
}

/* 答题导航 */
.question-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 24px;
  padding-top: 24px;
  border-top: 1px solid var(--gray-200);
}

.nav-dot {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--gray-100);
  cursor: pointer;
  font-size: 0.9rem;
  transition: all 0.3s;
}

.nav-dot:hover {
  background: var(--gray-200);
}

.nav-dot.current {
  background: #667eea;
  color: #fff;
}

.nav-dot.answered {
  background: #10b981;
  color: #fff;
}

.nav-dot.wrong {
  background: #ef4444;
  color: #fff;
}

.nav-dot.favorite {
  background: #f59e0b;
  color: #fff;
}

/* 练习/考试设置 */
.settings-panel {
  background: #fff;
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
}

.settings-panel h3 {
  margin-bottom: 20px;
  color: var(--gray-800);
}

.setting-group {
  margin-bottom: 20px;
}

.setting-group label {
  display: block;
  margin-bottom: 8px;
  font-weight: 500;
}

.setting-options {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.setting-option {
  padding: 8px 16px;
  border: 2px solid var(--gray-200);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s;
}

.setting-option:hover {
  border-color: #667eea;
}

.setting-option.selected {
  border-color: #667eea;
  background: #f0f0ff;
  color: #667eea;
}

/* 考试结果 */
.exam-result {
  background: #fff;
  border-radius: var(--radius);
  padding: 32px;
  box-shadow: var(--shadow);
  text-align: center;
}

.result-score {
  font-size: 4rem;
  font-weight: 700;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 8px;
}

.result-status {
  font-size: 1.5rem;
  margin-bottom: 24px;
}

.result-status.pass {
  color: #10b981;
}

.result-status.fail {
  color: #ef4444;
}

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

.result-stat {
  padding: 16px;
  background: var(--gray-50);
  border-radius: 8px;
}

.result-stat .stat-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: #667eea;
}

.result-stat .stat-label {
  font-size: 0.9rem;
  color: var(--gray-600);
}

/* 错题本 */
.wrong-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.wrong-item {
  background: #fff;
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
  border-left: 4px solid #ef4444;
}

.wrong-item-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 12px;
}

.wrong-item-info {
  display: flex;
  gap: 12px;
  align-items: center;
}

.wrong-item-actions {
  display: flex;
  gap: 8px;
}

/* 知识库 */
.knowledge-section {
  background: #fff;
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
}

.knowledge-section h3 {
  margin-bottom: 16px;
  color: var(--gray-800);
  display: flex;
  align-items: center;
  gap: 8px;
}

.knowledge-item {
  padding: 16px;
  background: var(--gray-50);
  border-radius: 8px;
  margin-bottom: 12px;
}

.knowledge-item h4 {
  color: #667eea;
  margin-bottom: 8px;
}

.knowledge-item p {
  color: var(--gray-700);
  line-height: 1.6;
}

/* 收藏按钮 */
.favorite-btn {
  background: none;
  border: 2px solid var(--gray-300);
  padding: 8px 16px;
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.3s;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.9rem;
}

.favorite-btn:hover {
  border-color: #f59e0b;
}

.favorite-btn.active {
  background: #fef3c7;
  border-color: #f59e0b;
  color: #d97706;
}

/* 收藏列表 */
.favorite-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.favorite-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px;
  background: #fff;
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.favorite-item-info {
  flex: 1;
}

.favorite-item-question {
  font-weight: 500;
  margin-bottom: 4px;
}

.favorite-item-meta {
  font-size: 0.85rem;
  color: var(--gray-500);
}

/* 按钮 */
.btn {
  padding: 12px 24px;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.3s;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

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

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

.btn-secondary {
  background: var(--gray-100);
  color: var(--gray-800);
}

.btn-secondary:hover {
  background: var(--gray-200);
}

.btn-success {
  background: #10b981;
  color: #fff;
}

.btn-success:hover {
  background: #059669;
}

.btn-danger {
  background: #fee2e2;
  color: #ef4444;
}

.btn-danger:hover {
  background: #fecaca;
}

.btn-sm {
  padding: 8px 16px;
  font-size: 0.9rem;
}

/* Toast */
.toast {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%) translateY(-100px);
  background: #333;
  color: #fff;
  padding: 12px 24px;
  border-radius: 8px;
  z-index: 9999;
  transition: transform 0.3s;
}

.toast.show {
  transform: translateX(-50%) translateY(0);
}

.toast.success {
  background: #10b981;
}

.toast.error {
  background: #ef4444;
}

.toast.info {
  background: #667eea;
}

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

.modal.open {
  display: flex;
}

.modal-content {
  background: #fff;
  border-radius: var(--radius);
  max-width: 600px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid var(--gray-200);
}

.modal-header h3 {
  margin: 0;
}

.modal-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--gray-600);
}

.modal-body {
  padding: 20px;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  padding: 16px 20px;
  border-top: 1px solid var(--gray-200);
}

/* 学习历史 */
.history-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.history-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px;
  background: #fff;
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.history-item-info {
  flex: 1;
}

.history-item-title {
  font-weight: 600;
  margin-bottom: 4px;
}

.history-item-meta {
  font-size: 0.85rem;
  color: var(--gray-500);
}

.history-item-score {
  font-weight: 700;
  font-size: 1.2rem;
  color: #667eea;
}

/* 图表 */
.chart-container {
  background: #fff;
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
  margin-bottom: 24px;
}

.chart-container h3 {
  margin-bottom: 20px;
  color: var(--gray-800);
}

/* 响应式 */
@media (max-width: 768px) {
  .progress-section {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .practice-header {
    flex-direction: column;
    align-items: flex-start;
  }
  
  .result-stats {
    grid-template-columns: 1fr;
  }
  
  .badges-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .level-badge {
    flex-direction: column;
    text-align: center;
  }
}
