/* 
 * 学习报告UI样式 v2.1
 * 精美、专业、现代化设计
 */

/* ==================== 顶部按钮样式 ==================== */
.report-toggle-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
  color: white;
  border: none;
  border-radius: 14px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 6px 16px rgba(79, 70, 229, 0.35);
  position: relative;
  overflow: hidden;
}

.report-toggle-btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: left 0.5s ease;
}

.report-toggle-btn:hover::before {
  left: 100%;
}

.report-toggle-btn:hover {
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 8px 24px rgba(79, 70, 229, 0.5);
  background: linear-gradient(135deg, #5b21b6 0%, #6366f1 100%);
}

.report-toggle-btn:active {
  transform: translateY(0);
}

.report-toggle-btn i {
  font-size: 16px;
}

.report-badge {
  background: linear-gradient(135deg, #f59e0b, #ef4444);
  color: white;
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  animation: pulse 2s infinite;
  box-shadow: 0 2px 8px rgba(239, 68, 68, 0.4);
}

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

/* ==================== 下拉菜单样式 ==================== */
.report-dropdown-container {
  position: relative;
  display: inline-block;
}

.report-dropdown-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 280px;
  background: white;
  border-radius: 12px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
  overflow: hidden;
  z-index: 1000;
  animation: dropdownSlide 0.3s ease;
}

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

.report-dropdown-menu.hidden {
  display: none;
}

.report-dropdown-item {
  width: 100%;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 16px;
  border: none;
  background: white;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: left;
  border-bottom: 1px solid #f3f4f6;
}

.report-dropdown-item:last-child {
  border-bottom: none;
}

.report-dropdown-item:hover {
  background: linear-gradient(135deg, #f9fafb 0%, #f3f4f6 100%);
  transform: translateX(4px);
}

.report-dropdown-item i {
  font-size: 20px;
  color: #667eea;
  margin-top: 2px;
  min-width: 24px;
}

.report-dropdown-item:hover i {
  transform: scale(1.1);
  transition: transform 0.2s ease;
}

.report-dropdown-text {
  flex: 1;
}

.report-dropdown-title {
  font-size: 14px;
  font-weight: 600;
  color: #1f2937;
  margin-bottom: 4px;
}

.report-dropdown-desc {
  font-size: 12px;
  color: #6b7280;
  line-height: 1.4;
}

/* 下拉箭头旋转动画 */
.report-dropdown-container.active #report-dropdown-btn i.fa-chevron-down {
  transform: rotate(180deg);
}

#report-dropdown-btn i.fa-chevron-down {
  transition: transform 0.3s ease;
}

/* ==================== 模态框基础 ==================== */
.report-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.3s ease;
}

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

.report-backdrop {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
}

.report-content {
  position: relative;
  width: 95%;
  max-width: 1400px;
  max-height: 90vh;
  background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 50%, #ec4899 100%);
  border-radius: 28px;
  box-shadow: 0 30px 60px -15px rgba(0, 0, 0, 0.6);
  overflow: hidden;
  animation: slideUp 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.report-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 32px 40px;
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(20px);
  border-bottom: 2px solid rgba(255, 255, 255, 0.25);
}

.report-header h2 {
  margin: 0;
  color: white;
  font-size: 32px;
  font-weight: 800;
  text-shadow: 0 3px 6px rgba(0, 0, 0, 0.3);
  letter-spacing: -0.02em;
  position: relative;
  display: inline-block;
}

.report-header h2::after {
  content: '';
  position: absolute;
  bottom: -8px;
  left: 0;
  width: 60%;
  height: 4px;
  background: linear-gradient(90deg, white, transparent);
  border-radius: 2px;
}

.close-btn {
  width: 48px;
  height: 48px;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.25);
  color: white;
  font-size: 28px;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 300;
  backdrop-filter: blur(10px);
  border: 2px solid rgba(255, 255, 255, 0.3);
}

.close-btn:hover {
  background: rgba(255, 255, 255, 0.35);
  transform: rotate(90deg) scale(1.1);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.report-body {
  max-height: calc(90vh - 100px);
  overflow-y: auto;
  overflow-x: hidden;
  padding: 40px;
  background: linear-gradient(to bottom, #f9fafb 0%, #ffffff 50%, #f9fafb 100%);
}

/* PDF导出时使用的样式 */
body.exporting-pdf .report-body {
  max-height: none !important;
  overflow: visible !important;
  height: auto !important;
  padding: 40px 60px !important;
  background: #ffffff !important;
  width: 1000px !important;
  margin: 0 auto !important;
  box-sizing: border-box;
}

body.exporting-pdf .report-content {
  max-height: none !important;
  height: auto !important;
  width: 100%;
  margin: 0 auto;
}

/* PDF分页控制 - 防止内容重复 */
body.exporting-pdf * {
  -webkit-print-color-adjust: exact !important;
  print-color-adjust: exact !important;
}

body.exporting-pdf .report-section,
body.exporting-pdf .summary-cards,
body.exporting-pdf .charts-section,
body.exporting-pdf .pattern-section,
body.exporting-pdf .weak-section,
body.exporting-pdf .recommendations-section,
body.exporting-pdf .topics-section {
  page-break-inside: avoid !important;
  break-inside: avoid !important;
  margin-bottom: 20px !important;
}

body.exporting-pdf .section-title {
  page-break-after: avoid !important;
  break-after: avoid !important;
}

/* PDF导出时优化卡片布局 */
body.exporting-pdf .summary-cards {
  grid-template-columns: repeat(5, 1fr) !important;
  gap: 18px !important;
  margin-bottom: 35px !important;
  page-break-inside: avoid;
}

body.exporting-pdf .summary-card {
  transform: none !important;
  box-shadow: 0 2px 8px rgba(79, 70, 229, 0.12) !important;
  page-break-inside: avoid !important;
  break-inside: avoid !important;
  padding: 20px 16px !important;
  border: 1px solid #e0e7ff !important;
  background: #ffffff !important;
  flex-direction: column !important;
  align-items: center !important;
  text-align: center !important;
  gap: 8px !important;
  border-radius: 12px !important;
  min-height: 140px !important;
}

body.exporting-pdf .summary-card::before {
  display: none !important;
}

body.exporting-pdf .card-icon {
  font-size: 38px !important;
  margin-bottom: 4px !important;
  filter: none !important;
}

body.exporting-pdf .card-content {
  width: 100%;
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
}

body.exporting-pdf .card-value-wrapper {
  justify-content: center !important;
  margin-bottom: 6px !important;
  align-items: baseline !important;
}

body.exporting-pdf .card-value {
  font-size: 32px !important;
  font-weight: 700 !important;
  color: #4f46e5 !important;
  background: none !important;
  -webkit-text-fill-color: #4f46e5 !important;
  line-height: 1 !important;
}

body.exporting-pdf .card-unit {
  font-size: 14px !important;
  color: #6b7280 !important;
  font-weight: 500 !important;
}

body.exporting-pdf .card-label {
  font-size: 13px !important;
  color: #4b5563 !important;
  font-weight: 500 !important;
  margin-top: 2px !important;
}

/* PDF导出时优化section布局 */
body.exporting-pdf .report-section {
  page-break-inside: avoid;
  margin-bottom: 30px !important;
}

body.exporting-pdf .section-title {
  page-break-after: avoid;
  margin-bottom: 20px !important;
  font-size: 20px !important;
  padding-bottom: 10px !important;
  display: block !important;
  border-bottom: 2px solid #4f46e5 !important;
  border-image: none !important;
  color: #1f2937 !important;
  background: none !important;
  -webkit-text-fill-color: #1f2937 !important;
  font-weight: 700 !important;
  position: relative;
  padding-left: 0 !important;
}

body.exporting-pdf .section-title::before {
  display: none !important;
}

body.exporting-pdf .weak-section .section-title {
  color: #991b1b !important;
  -webkit-text-fill-color: #991b1b !important;
  border-bottom-color: #dc2626 !important;
}

/* PDF导出时移除section背景 */
body.exporting-pdf .charts-section,
body.exporting-pdf .pattern-section,
body.exporting-pdf .weak-section,
body.exporting-pdf .recommendations-section,
body.exporting-pdf .topics-section {
  background: transparent !important;
  border: none !important;
  padding: 0 !important;
  margin-bottom: 32px !important;
}

body.exporting-pdf .report-section {
  background: transparent !important;
  border: none !important;
  padding: 0 !important;
  margin-bottom: 32px !important;
}

/* 优化热门和冷门知识点的排版 */
body.exporting-pdf .knowledge-grid,
body.exporting-pdf .topics-grid {
  grid-template-columns: repeat(3, 1fr) !important;
  gap: 16px !important;
  margin-bottom: 24px !important;
}

body.exporting-pdf .knowledge-card,
body.exporting-pdf .topic-card {
  padding: 16px !important;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08) !important;
  page-break-inside: avoid !important;
  break-inside: avoid !important;
  border: 1px solid #e5e7eb !important;
  border-radius: 10px !important;
  background: #ffffff !important;
}

body.exporting-pdf .cold-topics-list {
  gap: 14px !important;
  margin-bottom: 24px !important;
}

body.exporting-pdf .cold-topic-item,
body.exporting-pdf .weak-item {
  padding: 14px !important;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08) !important;
  border: 1px solid #e5e7eb !important;
  border-radius: 8px !important;
  background: #ffffff !important;
  page-break-inside: avoid !important;
  break-inside: avoid !important;
}

/* 优化推荐卡片 */
body.exporting-pdf .recommendations-grid,
body.exporting-pdf .recommendations-list {
  gap: 14px !important;
  margin-bottom: 24px !important;
}

body.exporting-pdf .recommendation-card {
  padding: 16px 20px !important;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08) !important;
  page-break-inside: avoid !important;
  break-inside: avoid !important;
  border: 1px solid #e5e7eb !important;
  border-left: 3px solid #3b82f6 !important;
  border-radius: 10px !important;
  background: #ffffff !important;
  gap: 14px !important;
}

body.exporting-pdf .recommendation-card::before {
  display: none !important;
}

body.exporting-pdf .recommendation-card.priority-high {
  border-left-color: #ef4444 !important;
}

body.exporting-pdf .recommendation-card.priority-medium {
  border-left-color: #f59e0b !important;
}

body.exporting-pdf .recommendation-number,
body.exporting-pdf .rec-number {
  font-size: 14px !important;
  width: 28px !important;
  height: 28px !important;
  font-weight: 700 !important;
  box-shadow: 0 2px 6px rgba(79, 70, 229, 0.25) !important;
}

body.exporting-pdf .recommendation-content h4,
body.exporting-pdf .rec-content h4 {
  font-size: 15px !important;
  margin-bottom: 6px !important;
  font-weight: 700 !important;
  color: #1f2937 !important;
}

body.exporting-pdf .recommendation-content p,
body.exporting-pdf .rec-content p {
  font-size: 13px !important;
  line-height: 1.6 !important;
  color: #4b5563 !important;
}

/* 隐藏不必要的交互元素 */
body.exporting-pdf .export-section,
body.exporting-pdf .close-btn {
  display: none !important;
}

/* PDF导出时优化标题 */
body.exporting-pdf .report-header {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
  padding: 28px 40px !important;
  border-bottom: none !important;
  page-break-after: avoid;
  margin-bottom: 30px !important;
  border-radius: 0 !important;
}

body.exporting-pdf .report-header h2 {
  font-size: 26px !important;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2) !important;
  font-weight: 700 !important;
}

body.exporting-pdf .report-header h2::after {
  display: none !important;
}

/* PDF导出时优化图表区域 */
body.exporting-pdf .charts-container {
  page-break-inside: avoid;
  margin-bottom: 30px !important;
}

body.exporting-pdf .charts-grid {
  grid-template-columns: repeat(2, 1fr) !important;
  gap: 20px !important;
  margin-bottom: 24px !important;
}

body.exporting-pdf .chart-card {
  page-break-inside: avoid !important;
  break-inside: avoid !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08) !important;
  padding: 20px !important;
  transform: none !important;
  border: 1px solid #e5e7eb !important;
  border-radius: 12px !important;
  background: #ffffff !important;
}

body.exporting-pdf .chart-card::after {
  display: none !important;
}

body.exporting-pdf .chart-title {
  margin-bottom: 16px !important;
  font-size: 16px !important;
  font-weight: 600 !important;
  color: #1f2937 !important;
}

/* 自定义滚动条 */
.report-body::-webkit-scrollbar {
  width: 8px;
}

.report-body::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.05);
}

.report-body::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.2);
  border-radius: 4px;
}

.report-body::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 0, 0, 0.3);
}

/* ==================== 摘要卡片 ==================== */
.summary-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 24px;
  margin-bottom: 40px;
}

.summary-card {
  background: linear-gradient(135deg, #ffffff 0%, #f9fafb 100%);
  border-radius: 18px;
  padding: 28px;
  display: flex;
  align-items: center;
  gap: 18px;
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.08);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
  border: 2px solid transparent;
  position: relative;
  overflow: hidden;
}

.summary-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, #4f46e5, #7c3aed, #ec4899);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.summary-card:hover {
  transform: translateY(-6px) scale(1.02);
  box-shadow: 0 16px 32px rgba(0, 0, 0, 0.18);
  border-color: #e0e7ff;
}

.summary-card:hover::before {
  opacity: 1;
}

.card-icon {
  font-size: 52px;
  line-height: 1;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
  transition: transform 0.3s ease;
}

.summary-card:hover .card-icon {
  transform: scale(1.1) rotate(5deg);
}

.card-content {
  flex: 1;
}

.card-value-wrapper {
  display: flex;
  align-items: baseline;
  gap: 6px;
}

.card-value {
  font-size: 40px;
  font-weight: 800;
  background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1.1;
  letter-spacing: -0.02em;
}

.card-unit {
  font-size: 18px;
  font-weight: 500;
  color: #9ca3af;
}

.card-label {
  font-size: 15px;
  color: #6b7280;
  margin-top: 8px;
  font-weight: 500;
}

/* ==================== 图表区域 ==================== */
.charts-section {
  margin-bottom: 40px;
  padding: 32px;
  background: linear-gradient(135deg, rgba(245, 243, 255, 0.5) 0%, rgba(237, 233, 254, 0.5) 100%);
  border-radius: 24px;
  border: 2px solid rgba(124, 58, 237, 0.1);
}

.section-title {
  font-size: 24px;
  font-weight: 700;
  color: #1f2937;
  margin: 0 0 24px 0;
  padding-bottom: 14px;
  background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  border-bottom: 4px solid transparent;
  border-image: linear-gradient(90deg, #4f46e5, #7c3aed, #ec4899) 1;
  display: inline-block;
  position: relative;
}

.section-title::before {
  content: '';
  position: absolute;
  left: 0;
  bottom: -4px;
  width: 0;
  height: 4px;
  background: linear-gradient(90deg, #4f46e5, #7c3aed);
  transition: width 0.4s ease;
}

.section-title:hover::before {
  width: 100%;
}

.charts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(420px, 1fr));
  gap: 28px;
  margin-bottom: 32px;
}

.chart-card {
  background: white;
  border-radius: 20px;
  padding: 28px;
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.08);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  border: 1px solid #f3f4f6;
  position: relative;
  overflow: hidden;
}

.chart-card::after {
  content: '';
  position: absolute;
  top: -50%;
  right: -50%;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle, rgba(79, 70, 229, 0.05) 0%, transparent 70%);
  transition: all 0.5s ease;
  opacity: 0;
}

.chart-card:hover {
  box-shadow: 0 16px 32px rgba(0, 0, 0, 0.16);
  transform: translateY(-4px);
}

.chart-card:hover::after {
  opacity: 1;
  top: 0;
  right: 0;
}

.chart-title {
  font-size: 20px;
  font-weight: 700;
  color: #1f2937;
  margin: 0 0 20px 0;
  padding-bottom: 16px;
  border-bottom: 3px solid transparent;
  border-image: linear-gradient(90deg, #4f46e5, #7c3aed, transparent) 1;
  position: relative;
  letter-spacing: -0.01em;
}

.chart-title::before {
  content: '📊';
  margin-right: 8px;
  font-size: 18px;
}

.chart-wrapper {
  position: relative;
  height: 300px;
}

.chart-wrapper canvas {
  max-height: 100%;
}

/* ==================== 学习模式 ==================== */
.pattern-section {
  margin-bottom: 40px;
  padding: 32px;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.08) 0%, rgba(168, 85, 247, 0.08) 100%);
  border-radius: 24px;
  border: 2px solid rgba(124, 58, 237, 0.15);
}

.pattern-section .section-title {
  margin-bottom: 28px;
}

.pattern-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 16px;
}

.pattern-card {
  background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 50%, #a855f7 100%);
  color: white;
  border-radius: 16px;
  padding: 24px;
  font-size: 16px;
  box-shadow: 0 8px 16px rgba(79, 70, 229, 0.3);
  border: 2px solid rgba(255, 255, 255, 0.2);
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.pattern-card::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.15) 0%, transparent 70%);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.pattern-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 24px rgba(79, 70, 229, 0.4);
}

.pattern-card:hover::before {
  opacity: 1;
}

.pattern-card strong {
  display: block;
  margin-bottom: 10px;
  font-size: 17px;
  font-weight: 700;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

/* ==================== 薄弱点 ==================== */
.weak-section {
  margin-bottom: 40px;
  padding: 32px;
  background: linear-gradient(135deg, rgba(254, 242, 242, 0.8) 0%, rgba(254, 226, 226, 0.6) 100%);
  border-radius: 24px;
  border: 2px solid rgba(239, 68, 68, 0.2);
}

.weak-section .section-title {
  color: #991b1b;
  margin-bottom: 28px;
}

.weak-list {
  display: grid;
  gap: 16px;
}

.weak-item {
  background: linear-gradient(135deg, #ffffff 0%, #fef2f2 100%);
  border-radius: 16px;
  padding: 24px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.06);
  border-left: 5px solid #ef4444;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.weak-item::after {
  content: '⚠️';
  position: absolute;
  right: 20px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 48px;
  opacity: 0.1;
  transition: all 0.3s ease;
}

.weak-item:hover {
  transform: translateX(4px);
  box-shadow: 0 8px 16px rgba(239, 68, 68, 0.15);
}

.weak-item:hover::after {
  opacity: 0.2;
  transform: translateY(-50%) scale(1.1);
}

.weak-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.weak-name {
  font-size: 20px;
  font-weight: 700;
  color: #1f2937;
  letter-spacing: -0.01em;
}

.weak-score {
  padding: 6px 16px;
  border-radius: 14px;
  color: white;
  font-size: 16px;
  font-weight: 700;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  position: relative;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1.2;
  padding-top: 7px;
  padding-bottom: 5px;
}

.weak-score::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: linear-gradient(45deg, transparent, rgba(255, 255, 255, 0.3), transparent);
  transform: rotate(45deg);
  animation: shine 3s infinite;
}

@keyframes shine {
  0% { transform: translateX(-100%) translateY(-100%) rotate(45deg); }
  100% { transform: translateX(100%) translateY(100%) rotate(45deg); }
}

.weak-reason {
  font-size: 15px;
  color: #6b7280;
  margin-bottom: 16px;
  line-height: 1.6;
  font-weight: 400;
}

.weak-progress {
  height: 12px;
  background: linear-gradient(90deg, #f3f4f6 0%, #e5e7eb 100%);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.06);
  position: relative;
}

.weak-progress::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.5), transparent);
  animation: shimmer 2s infinite;
}

.progress-bar {
  height: 100%;
  transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
  border-radius: 8px;
  position: relative;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.progress-bar::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 50%;
  background: linear-gradient(to bottom, rgba(255, 255, 255, 0.3), transparent);
  border-radius: 8px 8px 0 0;
}

/* ==================== 建议区域 ==================== */
.recommendations-section {
  margin-bottom: 40px;
  padding: 32px;
  background: linear-gradient(135deg, rgba(219, 234, 254, 0.5) 0%, rgba(191, 219, 254, 0.5) 100%);
  border-radius: 24px;
  border: 2px solid rgba(59, 130, 246, 0.2);
}

.recommendations-section .section-title {
  margin-bottom: 28px;
}

.recommendations-list {
  display: grid;
  gap: 16px;
}

.recommendation-card {
  background: white;
  border-radius: 14px;
  padding: 20px 24px;
  display: flex;
  gap: 18px;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.08);
  border-left: 4px solid #3b82f6;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), 
              box-shadow 0.3s cubic-bezier(0.4, 0, 0.2, 1),
              border-left-width 0.3s ease;
  position: relative;
  overflow: hidden;
  align-items: flex-start;
}

.recommendation-number {
  width: 36px;
  height: 36px;
  min-width: 36px;
  min-height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, #4f46e5, #7c3aed);
  color: white;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 16px;
  flex-shrink: 0;
  box-shadow: 0 3px 10px rgba(79, 70, 229, 0.35);
  transition: transform 0.3s ease;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
  text-align: center;
  vertical-align: middle;
}

/* rec-number 别名（兼容旧代码） */
.rec-number {
  width: 36px;
  height: 36px;
  min-width: 36px;
  min-height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, #4f46e5, #7c3aed);
  color: white;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 16px;
  flex-shrink: 0;
  box-shadow: 0 3px 10px rgba(79, 70, 229, 0.35);
  transition: transform 0.3s ease;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
  text-align: center;
  vertical-align: middle;
}

.recommendation-card::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: linear-gradient(to bottom, #3b82f6, #8b5cf6);
  transition: none;
}

.recommendation-card:hover {
  transform: translateX(4px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
  border-left-width: 6px;
}

.recommendation-card:hover .recommendation-number,
.recommendation-card:hover .rec-number {
  transform: scale(1.1);
}

.recommendation-card:hover::before {
  width: 100%;
  opacity: 0.04;
  transition: all 0.3s ease;
}

.recommendation-card.priority-high {
  border-left-color: #ef4444;
}

.recommendation-card.priority-high .recommendation-number,
.recommendation-card.priority-high .rec-number {
  background: linear-gradient(135deg, #ef4444, #dc2626);
  box-shadow: 0 3px 10px rgba(239, 68, 68, 0.35);
}

.recommendation-card.priority-high::before {
  background: linear-gradient(to bottom, #ef4444, #dc2626);
}

.recommendation-card.priority-medium {
  border-left-color: #f59e0b;
}

.recommendation-card.priority-medium .recommendation-number,
.recommendation-card.priority-medium .rec-number {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  box-shadow: 0 3px 10px rgba(245, 158, 11, 0.35);
}

.recommendation-card.priority-medium::before {
  background: linear-gradient(to bottom, #f59e0b, #d97706);
}

.recommendation-content h4 {
  margin: 0 0 10px 0;
  font-size: 18px;
  color: #1f2937;
  font-weight: 700;
  letter-spacing: -0.01em;
  display: flex;
  align-items: center;
  gap: 8px;
}

.recommendation-content p {
  margin: 0;
  font-size: 14px;
  color: #6b7280;
  line-height: 1.7;
  font-weight: 400;
}

/* rec-content 别名（兼容旧代码） */
.rec-content h4 {
  margin: 0 0 10px 0;
  font-size: 18px;
  color: #1f2937;
  font-weight: 700;
  letter-spacing: -0.01em;
  display: flex;
  align-items: center;
  gap: 8px;
}

.rec-content p {
  margin: 0;
  font-size: 14px;
  color: #6b7280;
  line-height: 1.7;
  font-weight: 400;
}

/* ==================== 话题区域 ==================== */
.topics-section {
  margin-bottom: 40px;
  padding: 32px;
  background: linear-gradient(135deg, rgba(243, 244, 246, 0.8) 0%, rgba(229, 231, 235, 0.6) 100%);
  border-radius: 24px;
  border: 2px solid rgba(156, 163, 175, 0.2);
}

.topics-section .section-title {
  margin-bottom: 28px;
}

.topics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 20px;
  margin-bottom: 24px;
}

@media (max-width: 768px) {
  .topics-grid {
    grid-template-columns: 1fr;
  }
}

.topic-card {
  background: white;
  border-radius: 16px;
  padding: 20px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.06);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
  border: 2px solid transparent;
}

.topic-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 5px;
  height: 100%;
  transition: width 0.3s ease;
}

.topic-card.hot::before {
  background: linear-gradient(to bottom, #f59e0b, #ef4444);
}

.topic-card.cold::before {
  background: linear-gradient(to bottom, #3b82f6, #8b5cf6);
}

.topic-card:hover {
  transform: translateY(-4px) scale(1.02);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.12);
  border-color: #f3f4f6;
}

.topic-card:hover::before {
  width: 100%;
  opacity: 0.08;
}

.topic-rank {
  position: absolute;
  top: 10px;
  right: 10px;
  background: linear-gradient(135deg, #f59e0b 0%, #ef4444 100%);
  color: white;
  width: 40px;
  height: 40px;
  min-width: 40px;
  min-height: 40px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 800;
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.4);
  border: 3px solid white;
  transition: all 0.3s ease;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
  text-align: center;
  vertical-align: middle;
}

.topic-card:hover .topic-rank {
  transform: rotate(360deg) scale(1.1);
}

.topic-name {
  font-size: 18px;
  font-weight: 700;
  color: #1f2937;
  margin-bottom: 10px;
  letter-spacing: -0.01em;
}

.topic-stats {
  font-size: 14px;
  color: #6b7280;
  font-weight: 500;
}

/* 冷门知识点列表样式 */
.cold-topics-list {
  display: grid;
  gap: 16px;
}

.cold-topic-header {
  display: flex;
  align-items: center;
  gap: 16px;
}

.cold-topic-icon {
  font-size: 36px;
  line-height: 1;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
}

.cold-topic-info {
  flex: 1;
}

.topic-progress {
  margin-top: 8px;
  height: 6px;
  background: rgba(0, 0, 0, 0.05);
  border-radius: 3px;
  overflow: hidden;
}

.topic-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, #f59e0b, #ef4444);
  border-radius: 3px;
  transition: width 0.6s ease;
}

/* ==================== 导出区域 ==================== */
.export-section {
  margin-top: 48px;
  padding: 40px;
  background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
  border-radius: 24px;
  border: 3px solid #fbbf24;
  box-shadow: 0 8px 24px rgba(251, 191, 36, 0.3);
}

.export-section .section-title {
  color: #92400e;
  margin-bottom: 28px;
}

.export-buttons {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
}

.export-btn {
  padding: 16px 28px;
  border: none;
  border-radius: 14px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.12);
  position: relative;
  overflow: hidden;
}

.export-btn::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.3);
  transform: translate(-50%, -50%);
  transition: width 0.5s ease, height 0.5s ease;
}

.export-btn:hover::before {
  width: 300px;
  height: 300px;
}

.export-btn:hover {
  transform: translateY(-3px) scale(1.03);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
}

.export-btn.pdf {
  background: linear-gradient(135deg, #dc2626 0%, #b91c1c 50%, #991b1b 100%);
  color: white;
  font-size: 18px;
  padding: 20px 32px;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.export-btn.pdf::before {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.4), transparent);
}

.export-btn.pdf:hover {
  background: linear-gradient(135deg, #b91c1c 0%, #991b1b 50%, #7f1d1d 100%);
  transform: translateY(-4px) scale(1.05);
  box-shadow: 0 12px 28px rgba(220, 38, 38, 0.4);
}

.export-btn.excel {
  background: linear-gradient(135deg, #059669 0%, #047857 50%, #065f46 100%);
  color: white;
}

.export-btn.image {
  background: linear-gradient(135deg, #7c3aed 0%, #6d28d9 50%, #5b21b6 100%);
  color: white;
}

.export-btn.json {
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 50%, #1e40af 100%);
  color: white;
}

/* ==================== 响应式设计 ==================== */
@media (max-width: 768px) {
  .report-content {
    width: 100%;
    max-width: 100%;
    border-radius: 0;
    max-height: 100vh;
    margin: 0;
  }
  
  .report-body {
    padding: 16px;
    max-height: calc(100vh - 60px);
  }

  /* 标题 */
  .report-header h2 {
    font-size: 1.5rem;
  }

  .section-title {
    font-size: 1.1rem;
    padding: 12px 16px;
  }
  
  /* 摘要卡片：单列显示 */
  .summary-cards {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .summary-card {
    padding: 16px;
  }

  .card-icon {
    width: 40px;
    height: 40px;
    font-size: 18px;
  }

  .card-value {
    font-size: 1.75rem;
  }

  .card-label {
    font-size: 0.85rem;
  }
  
  /* 图表网格：单列 */
  .charts-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .chart-card {
    padding: 16px;
  }

  .chart-wrapper {
    height: 220px;
  }
  
  /* 学习模式卡片：单列 */
  .pattern-cards {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .pattern-card {
    padding: 16px;
  }
  
  /* 知识点网格：单列 */
  .topics-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .topic-card {
    padding: 14px;
  }

  .topic-rank {
    width: 36px;
    height: 36px;
    font-size: 1rem;
  }
  
  /* 推荐建议卡片 */
  .recommendations-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .recommendation-card {
    padding: 16px;
  }

  .recommendation-number,
  .rec-number {
    min-width: 32px;
    min-height: 32px;
    font-size: 1rem;
  }

  /* 薄弱点列表 */
  .weak-topics-list {
    gap: 10px;
  }

  .weak-item {
    padding: 12px;
  }

  /* 冷门知识点列表 */
  .cold-topics-list {
    gap: 8px;
  }

  .cold-topic-item {
    padding: 10px 12px;
    font-size: 0.9rem;
  }
  
  /* 导出按钮 */
  .export-buttons {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .export-btn {
    padding: 14px 20px;
    font-size: 0.95rem;
  }

  /* 关闭按钮 */
  .close-btn {
    top: 12px;
    right: 12px;
    width: 36px;
    height: 36px;
    font-size: 18px;
  }

  /* 学习洞察文字 */
  .insight-content p {
    font-size: 0.9rem;
  }

  /* 建议文字 */
  .recommendation-text,
  .teaching-text {
    font-size: 0.9rem;
  }
}

/* 超小屏幕优化 (< 480px) */
@media (max-width: 480px) {
  .report-body {
    padding: 12px;
  }

  .report-header h2 {
    font-size: 1.25rem;
  }

  .section-title {
    font-size: 1rem;
    padding: 10px 12px;
  }

  .summary-card {
    padding: 12px;
  }

  .card-value {
    font-size: 1.5rem;
  }

  .chart-wrapper {
    height: 200px;
  }

  .pattern-card,
  .recommendation-card,
  .topic-card {
    padding: 12px;
  }

  .export-btn {
    padding: 12px 16px;
    font-size: 0.9rem;
  }

  /* 进一步缩小图标 */
  .card-icon {
    width: 36px;
    height: 36px;
    font-size: 16px;
  }

  .topic-rank {
    width: 32px;
    height: 32px;
    font-size: 0.9rem;
  }

  .recommendation-number,
  .rec-number {
    min-width: 28px;
    min-height: 28px;
    font-size: 0.9rem;
  }
}

/* ==================== 打印样式 ==================== */
@media print {
  .report-backdrop,
  .close-btn,
  .export-section {
    display: none !important;
  }
  
  .report-content {
    max-height: none !important;
    box-shadow: none;
    border-radius: 0;
  }
  
  .report-body {
    max-height: none !important;
    overflow: visible !important;
    padding: 20px;
  }
  
  .summary-card,
  .chart-card,
  .recommendation-card,
  .weak-item,
  .topic-card {
    page-break-inside: avoid;
    break-inside: avoid;
  }
  
  .section-title {
    page-break-after: avoid;
  }
  
  /* 确保所有内容可见 */
  * {
    overflow: visible !important;
  }
}

/* ==================== 动画效果 ==================== */
@keyframes pulse {
  0%, 100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.85;
    transform: scale(1.08);
  }
}

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

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(40px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateX(50px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes slideOut {
  from {
    opacity: 1;
    transform: translateX(0);
  }
  to {
    opacity: 0;
    transform: translateX(50px);
  }
}

@keyframes shimmer {
  0% {
    background-position: -1000px 0;
  }
  100% {
    background-position: 1000px 0;
  }
}

.loading {
  animation: pulse 1.5s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* 添加光泽效果 */
.shimmer {
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
  background-size: 200% 100%;
  animation: shimmer 2s infinite;
}

/* ==================== 辅助类 ==================== */
.text-gradient {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
}

.badge-success {
  background: #d1fae5;
  color: #065f46;
}

.badge-warning {
  background: #fef3c7;
  color: #92400e;
}

.badge-danger {
  background: #fee2e2;
  color: #991b1b;
}

.badge-info {
  background: #dbeafe;
  color: #1e40af;
}
