/*
 * 文件功能：学习资源页面样式文件
 * 创建日期：2025-01-01
 * 作者：AI炒股学习网开发团队
 * 说明：提供学习资源页面的专业视觉设计和交互效果
 */

/* ==================== 页面头部样式 ==================== */
.page-header {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 4rem 0 3rem;
  text-align: center;
}

.breadcrumb {
  font-size: 0.9rem;
  margin-bottom: 1rem;
  opacity: 0.9;
}

.breadcrumb a {
  color: white;
  text-decoration: none;
  transition: opacity 0.3s ease;
}

.breadcrumb a:hover {
  opacity: 0.8;
}

.page-header h1 {
  font-size: 2.5rem;
  font-weight: 700;
  margin: 0 0 1rem;
  text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.page-description {
  font-size: 1.1rem;
  max-width: 600px;
  margin: 0 auto;
  opacity: 0.95;
  line-height: 1.6;
}

/* ==================== 资源分类导航 ==================== */
.resource-nav {
  background: white;
  border-bottom: 1px solid #e1e8ed;
  padding: 2rem 0;
  position: sticky;
  top: 70px; /* 页头高度 */
  z-index: 100;
}

.nav-tabs {
  display: flex;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.tab-btn {
  background: #f8f9fa;
  border: 2px solid #e9ecef;
  color: #495057;
  padding: 0.8rem 1.5rem;
  border-radius: 25px;
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  white-space: nowrap;
}

.tab-btn:hover {
  background: #e9ecef;
  border-color: #dee2e6;
  transform: translateY(-2px);
}

.tab-btn.active {
  background: #3498db;
  border-color: #3498db;
  color: white;
  box-shadow: 0 4px 12px rgba(52, 152, 219, 0.3);
}

/* ==================== 资源内容区域 ==================== */
.resource-content {
  padding: 3rem 0;
  min-height: 500px;
}

.resource-content h2 {
  text-align: center;
  font-size: 2rem;
  color: #2c3e50;
  margin-bottom: 3rem;
  position: relative;
}

.resource-content h2::after {
  content: '';
  position: absolute;
  bottom: -10px;
  left: 50%;
  transform: translateX(-50%);
  width: 60px;
  height: 3px;
  background: linear-gradient(90deg, #3498db, #e74c3c);
  border-radius: 2px;
}

/* ==================== 资源网格布局 ==================== */
.resource-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 2rem;
  margin-bottom: 3rem;
}

.resource-card {
  background: white;
  border-radius: 12px;
  padding: 2rem;
  box-shadow: 0 4px 20px rgba(0,0,0,0.08);
  transition: all 0.3s ease;
  border: 1px solid #f1f3f4;
  position: relative;
  overflow: hidden;
}

.resource-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, #3498db, #e74c3c, #27ae60, #f39c12);
}

.resource-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 12px 40px rgba(0,0,0,0.15);
}

.card-icon {
  text-align: center;
  margin-bottom: 1.5rem;
}

.card-icon svg {
  width: 48px;
  height: 48px;
  transition: transform 0.3s ease;
}

.resource-card:hover .card-icon svg {
  transform: scale(1.1);
}

.resource-card h3 {
  font-size: 1.3rem;
  color: #2c3e50;
  margin-bottom: 1rem;
  font-weight: 600;
  line-height: 1.4;
}

.resource-card p {
  color: #5a6c7d;
  line-height: 1.6;
  margin-bottom: 1.5rem;
  font-size: 0.95rem;
}

.card-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  font-size: 0.85rem;
  color: #7f8c8d;
}

.file-size {
  background: #ecf0f1;
  padding: 0.3rem 0.8rem;
  border-radius: 15px;
  font-weight: 500;
}

.download-count {
  color: #27ae60;
  font-weight: 500;
}

.download-btn {
  width: 100%;
  background: linear-gradient(135deg, #3498db, #2980b9);
  color: white;
  border: none;
  padding: 0.8rem 1.5rem;
  border-radius: 8px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.download-btn:hover {
  background: linear-gradient(135deg, #2980b9, #1f5f8b);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(52, 152, 219, 0.4);
}

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

/* ==================== 资源统计区域 ==================== */
.resource-stats {
  background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
  padding: 4rem 0;
  text-align: center;
}

.resource-stats h2 {
  font-size: 2rem;
  color: #2c3e50;
  margin-bottom: 3rem;
  position: relative;
}

.resource-stats h2::after {
  content: '';
  position: absolute;
  bottom: -10px;
  left: 50%;
  transform: translateX(-50%);
  width: 60px;
  height: 3px;
  background: linear-gradient(90deg, #3498db, #e74c3c);
  border-radius: 2px;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 2rem;
  max-width: 1000px;
  margin: 0 auto;
}

.stat-item {
  background: white;
  padding: 2rem 1rem;
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.08);
  transition: transform 0.3s ease;
}

.stat-item:hover {
  transform: translateY(-5px);
}

.stat-number {
  font-size: 3rem;
  font-weight: 700;
  color: #3498db;
  margin-bottom: 0.5rem;
  background: linear-gradient(135deg, #3498db, #e74c3c);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.stat-label {
  font-size: 1rem;
  color: #5a6c7d;
  font-weight: 500;
}

/* ==================== 响应式设计 ==================== */
/* 平板设备 */
@media (max-width: 768px) {
  .page-header {
    padding: 3rem 0 2rem;
  }
  
  .page-header h1 {
    font-size: 2rem;
  }
  
  .page-description {
    font-size: 1rem;
  }
  
  .resource-nav {
    padding: 1.5rem 0;
    position: static; /* 移动端不固定 */
  }
  
  .nav-tabs {
    gap: 0.5rem;
  }
  
  .tab-btn {
    padding: 0.6rem 1rem;
    font-size: 0.85rem;
  }
  
  .resource-content {
    padding: 2rem 0;
  }
  
  .resource-content h2 {
    font-size: 1.6rem;
    margin-bottom: 2rem;
  }
  
  .resource-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
  
  .resource-card {
    padding: 1.5rem;
  }
  
  .card-meta {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }
  
  .resource-stats {
    padding: 3rem 0;
  }
  
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
  }
  
  .stat-item {
    padding: 1.5rem 1rem;
  }
  
  .stat-number {
    font-size: 2.5rem;
  }
}

/* 手机设备 */
@media (max-width: 480px) {
  .page-header {
    padding: 2rem 0 1.5rem;
  }
  
  .page-header h1 {
    font-size: 1.8rem;
  }
  
  .nav-tabs {
    flex-direction: column;
    align-items: center;
  }
  
  .tab-btn {
    width: 200px;
    text-align: center;
  }
  
  .resource-content h2 {
    font-size: 1.4rem;
  }
  
  .resource-card h3 {
    font-size: 1.1rem;
  }
  
  .stats-grid {
    grid-template-columns: 1fr;
  }
  
  .stat-number {
    font-size: 2rem;
  }
}

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

.resource-card {
  animation: fadeInUp 0.6s ease-out;
}

.resource-card:nth-child(1) { animation-delay: 0.1s; }
.resource-card:nth-child(2) { animation-delay: 0.2s; }
.resource-card:nth-child(3) { animation-delay: 0.3s; }
.resource-card:nth-child(4) { animation-delay: 0.4s; }
.resource-card:nth-child(5) { animation-delay: 0.5s; }
.resource-card:nth-child(6) { animation-delay: 0.6s; }

/* ==================== 加载状态 ==================== */
.loading {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 200px;
  font-size: 1.1rem;
  color: #7f8c8d;
}

.loading::after {
  content: '';
  width: 20px;
  height: 20px;
  border: 2px solid #3498db;
  border-top: 2px solid transparent;
  border-radius: 50%;
  margin-left: 10px;
  animation: spin 1s linear infinite;
}

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