/* 统一回顾分析组件样式 */

/* 通用容器样式 */
.review-analysis-container {
  width: 100%;
  height: 100%;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.review-analysis-main {
  flex: 1;
  padding: 20px;
  overflow-y: auto;
  background-color: #f8fafc;
}

/* 头部样式 */
.review-analysis-header {
  background: white;
  border-bottom: 1px solid #e2e8f0;
  padding: 16px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.review-analysis-title {
  font-size: 20px;
  font-weight: 600;
  color: #1f2937;
  margin: 0;
}

.review-analysis-back-btn {
  padding: 8px 12px;
  background: #f3f4f6;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  color: #374151;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: background-color 0.2s;
}

.review-analysis-back-btn:hover {
  background: #e5e7eb;
}

/* 创建新分析按钮 */
.review-analysis-create-btn {
  padding: 12px 24px;
  background: #3b82f6;
  color: white;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 500;
  transition: background-color 0.2s;
}

.review-analysis-create-btn:hover {
  background: #2563eb;
}

/* 步骤指示器 */
.review-analysis-steps {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 24px;
  padding: 0 20px;
}

.review-step {
  display: flex;
  align-items: center;
  gap: 8px;
}

.review-step-circle {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 500;
}

.review-step-circle.active {
  background: #3b82f6;
  color: white;
}

.review-step-circle.completed {
  background: #10b981;
  color: white;
}

.review-step-circle.pending {
  background: #e5e7eb;
  color: #6b7280;
}

.review-step-label {
  font-size: 14px;
  color: #374151;
}

.review-step-divider {
  width: 32px;
  height: 1px;
  background: #d1d5db;
}

/* 表单容器 */
.review-form-container {
  background: white;
  border-radius: 12px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  border: 1px solid #e5e7eb;
  padding: 24px;
  margin: 0 20px;
  min-height: 400px;
}

/* 表单组 */
.review-form-group {
  margin-bottom: 20px;
}

.review-form-label {
  display: block;
  font-size: 14px;
  font-weight: 500;
  color: #374151;
  margin-bottom: 8px;
}

.review-form-input,
.review-form-select,
.review-form-textarea {
  width: 100%;
  padding: 12px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  font-size: 14px;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.review-form-input:focus,
.review-form-select:focus,
.review-form-textarea:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.review-form-textarea {
  resize: vertical;
  min-height: 120px;
}

/* 错题选择区域 */
.review-mistakes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
  max-height: 400px;
  overflow-y: auto;
  padding-right: 8px;
}

.review-mistake-card {
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 16px;
  cursor: pointer;
  transition: all 0.2s;
  background: white;
}

.review-mistake-card:hover {
  border-color: #d1d5db;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.review-mistake-card.selected {
  border-color: #3b82f6;
  background: #eff6ff;
  box-shadow: 0 0 0 1px #3b82f6;
}

.review-mistake-header {
  display: flex;
  align-items: center;
  margin-bottom: 8px;
  gap: 12px;
}

.review-mistake-checkbox {
  width: 16px;
  height: 16px;
}

.review-mistake-subject {
  font-size: 12px;
  color: #3b82f6;
  font-weight: 500;
  background: #eff6ff;
  padding: 2px 8px;
  border-radius: 12px;
}

.review-mistake-date {
  font-size: 12px;
  color: #6b7280;
  margin-left: auto;
}

.review-mistake-question {
  font-weight: 500;
  color: #1f2937;
  margin-bottom: 8px;
  line-height: 1.4;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.review-mistake-content {
  color: #6b7280;
  font-size: 14px;
  line-height: 1.4;
  margin-bottom: 12px;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
}

.review-mistake-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.review-mistake-tag {
  background: #f3f4f6;
  color: #374151;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 12px;
}

/* 筛选控件 */
.review-filters {
  display: grid;
  grid-template-columns: 1fr 1fr 2fr;
  gap: 20px;
  margin-bottom: 24px;
  background: white;
  padding: 20px;
  border-radius: 12px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  border: 1px solid #e5e7eb;
}

/* 加载状态 */
.review-loading {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 200px;
  gap: 12px;
}

.review-loading-spinner {
  width: 24px;
  height: 24px;
  border: 2px solid #e5e7eb;
  border-top: 2px solid #3b82f6;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.review-loading-text {
  color: #6b7280;
  font-size: 14px;
}

/* 空状态 */
.review-empty {
  text-align: center;
  padding: 48px 24px;
  color: #6b7280;
}

/* 底部操作按钮 */
.review-actions {
  display: flex;
  justify-content: space-between;
  padding: 20px;
  background: white;
  border-top: 1px solid #e5e7eb;
}

.review-action-group {
  display: flex;
  gap: 12px;
}

.review-btn {
  padding: 12px 24px;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.2s;
}

.review-btn-primary {
  background: #3b82f6;
  color: white;
}

.review-btn-primary:hover {
  background: #2563eb;
}

.review-btn-primary:disabled {
  background: #d1d5db;
  cursor: not-allowed;
}

.review-btn-secondary {
  background: #6b7280;
  color: white;
}

.review-btn-secondary:hover {
  background: #4b5563;
}

.review-btn-ghost {
  background: #f3f4f6;
  color: #374151;
}

.review-btn-ghost:hover {
  background: #e5e7eb;
}

/* 模板按钮 */
.review-templates {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 8px;
  margin-bottom: 16px;
}

.review-template-btn {
  text-align: left;
  padding: 12px;
  font-size: 14px;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  background: white;
  cursor: pointer;
  transition: all 0.2s;
}

.review-template-btn:hover {
  border-color: #3b82f6;
  background: #eff6ff;
}

/* 选中错题预览 */
.review-selected-preview {
  background: #f9fafb;
  padding: 12px;
  border-radius: 6px;
  max-height: 120px;
  overflow-y: auto;
  margin-top: 8px;
}

.review-selected-item {
  font-size: 14px;
  color: #374151;
  margin-bottom: 4px;
  line-height: 1.4;
}

/* 响应式设计 */
@media (max-width: 1024px) {
  .review-filters {
    grid-template-columns: 1fr 1fr;
    gap: 16px;
  }
  
  .search-group {
    grid-column: 1 / -1;
  }
}

@media (max-width: 768px) {
  .review-filters {
    grid-template-columns: 1fr;
    padding: 16px;
    gap: 12px;
  }
  
  .search-group {
    grid-column: 1;
  }
  
  .review-mistakes-grid {
    grid-template-columns: 1fr;
  }
  
  .review-templates {
    grid-template-columns: 1fr;
  }
  
  .review-actions {
    flex-direction: column;
    gap: 12px;
  }
  
  .review-analysis-header {
    padding: 12px 16px;
    flex-direction: column;
    gap: 12px;
    align-items: flex-start;
  }
  
  .library-stats {
    width: 100%;
    align-items: flex-start;
  }
}

/* 分析库专用样式 */
.library-stats {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
}

.stats-text {
  font-size: 16px;
  font-weight: 500;
  color: #1f2937;
}

.stats-filter {
  font-size: 14px;
  color: #6b7280;
}

.search-group {
  grid-column: 1 / -1;
}

.search-input {
  background: white;
}

.search-input:focus {
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* 空状态样式 */
.empty-icon {
  font-size: 48px;
  margin-bottom: 16px;
}

.empty-title {
  font-size: 18px;
  font-weight: 600;
  color: #374151;
  margin-bottom: 8px;
}

.empty-description {
  font-size: 14px;
  color: #6b7280;
  margin-bottom: 4px;
}

.empty-hint {
  font-size: 14px;
  color: #9ca3af;
}

/* 分析库网格 */
.analysis-library-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(400px, 1fr));
  gap: 20px;
  padding: 20px;
}

/* 分析库卡片样式 */
.analysis-library-card {
  background: white;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  border: 1px solid #e5e7eb;
  padding: 20px;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.analysis-library-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  border-color: #d1d5db;
}

.analysis-library-card:active {
  transform: translateY(0);
}

/* 卡片头部 */
.analysis-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid #f3f4f6;
}

.analysis-card-info {
  flex: 1;
  min-width: 0;
}

.analysis-card-title {
  font-size: 16px;
  font-weight: 600;
  color: #1f2937;
  margin: 0 0 4px 0;
  line-height: 1.4;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.analysis-card-id {
  font-size: 12px;
  color: #9ca3af;
  font-family: monospace;
  background: #f9fafb;
  padding: 2px 6px;
  border-radius: 4px;
}

.analysis-card-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.analysis-status-badge {
  font-size: 12px;
  font-weight: 500;
  padding: 4px 8px;
  border-radius: 12px;
  white-space: nowrap;
}

.analysis-delete-btn {
  background: #f3f4f6;
  border: none;
  border-radius: 6px;
  padding: 6px 8px;
  cursor: pointer;
  font-size: 14px;
  transition: all 0.2s;
  color: #6b7280;
}

.analysis-delete-btn:hover {
  background: #fee2e2;
  color: #dc2626;
}

/* 卡片内容 */
.analysis-card-content {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.analysis-meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.meta-item {
  font-size: 12px;
  padding: 4px 8px;
  border-radius: 12px;
  white-space: nowrap;
  flex-shrink: 0;
}

.subject-tag {
  background: #eff6ff;
  color: #1d4ed8;
  font-weight: 500;
}

.mistake-count {
  background: #f0fdf4;
  color: #166534;
}

.chat-count {
  background: #fef3c7;
  color: #92400e;
}

.analysis-target-section,
.analysis-preview-section {
  background: #f9fafb;
  padding: 12px;
  border-radius: 8px;
  border-left: 3px solid #3b82f6;
}

.target-label,
.preview-label {
  font-size: 12px;
  font-weight: 600;
  color: #374151;
  margin-bottom: 4px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.target-content,
.preview-content {
  font-size: 14px;
  color: #6b7280;
  line-height: 1.5;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.analysis-date-section {
  display: flex;
  align-items: center;
  gap: 6px;
  padding-top: 8px;
  border-top: 1px solid #f3f4f6;
}

.date-icon {
  font-size: 14px;
  color: #9ca3af;
}

.date-text {
  font-size: 12px;
  color: #6b7280;
  font-weight: 500;
}

/* 响应式设计 */
@media (max-width: 768px) {
  .analysis-library-grid {
    grid-template-columns: 1fr;
    gap: 16px;
    padding: 16px;
  }
  
  .analysis-library-card {
    padding: 16px;
  }
  
  .analysis-card-header {
    flex-direction: column;
    gap: 8px;
    align-items: flex-start;
  }
  
  .analysis-card-actions {
    align-self: flex-end;
  }
  
  .library-stats {
    align-items: flex-start;
  }
}

@media (max-width: 480px) {
  .analysis-meta-row {
    flex-direction: column;
    gap: 6px;
  }
  
  .meta-item {
    align-self: flex-start;
  }
}

/* 动画效果 */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.analysis-library-card {
  animation: fadeInUp 0.3s ease-out;
}

.analysis-library-card:nth-child(odd) {
  animation-delay: 0.1s;
}

.analysis-library-card:nth-child(even) {
  animation-delay: 0.2s;
}

/* 添加筛选项的悬停效果 */
.review-form-select:hover,
.review-form-input:hover {
  border-color: #9ca3af;
}

/* 改进状态徽章样式 */
.analysis-status-badge {
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

/* 卡片内容区域的微妙动画 */
.analysis-target-section,
.analysis-preview-section {
  transition: all 0.2s ease;
}

.analysis-library-card:hover .analysis-target-section,
.analysis-library-card:hover .analysis-preview-section {
  background: #f3f4f6;
}

/* 改进元信息标签的悬停效果 */
.meta-item {
  transition: all 0.2s ease;
}

.analysis-library-card:hover .meta-item {
  transform: scale(1.05);
}

/* 添加加载动画的平滑过渡 */
.review-loading {
  opacity: 0;
  animation: fadeIn 0.3s ease-in-out forwards;
}

@keyframes fadeIn {
  to {
    opacity: 1;
  }
}

/* 滚动条样式 */
.review-mistakes-grid::-webkit-scrollbar,
.review-selected-preview::-webkit-scrollbar,
.analysis-library-grid::-webkit-scrollbar {
  width: 6px;
}

.review-mistakes-grid::-webkit-scrollbar-track,
.review-selected-preview::-webkit-scrollbar-track,
.analysis-library-grid::-webkit-scrollbar-track {
  background: #f1f5f9;
  border-radius: 3px;
}

.review-mistakes-grid::-webkit-scrollbar-thumb,
.review-selected-preview::-webkit-scrollbar-thumb,
.analysis-library-grid::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 3px;
}

.review-mistakes-grid::-webkit-scrollbar-thumb:hover,
.review-selected-preview::-webkit-scrollbar-thumb:hover,
.analysis-library-grid::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}