/* 全局样式 */
html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  height: 100%;
}

.page-wrapper {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.main-content {
  flex: 1 0 auto;
  width: 100%;
}

/* 首页特定样式 */

/* 英雄区域 - 包含banner轮播 */
.hero {
  padding: 40px 0;
  background: #f8fafc;
  margin-bottom: 0;
}

/* Banner 容器 */
.banner-container {
  position: relative;
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.08);
  aspect-ratio: 16/6; /* 保持16:6的宽高比 */
  background: #f1f5f9;
}

.banner-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: opacity 0.5s ease;
}

/* 特色区域 - 为什么选择我们 */
.section {
  padding: 60px 0;
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
}

/* 竞赛推荐区域特殊样式 */
.section.card-section {
  background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
  border-radius: 32px;
  margin: 20px auto;
  padding: 10px 0;
  box-shadow: 
    0 20px 40px rgba(0, 0, 0, 0.06),
    0 8px 16px rgba(0, 0, 0, 0.04),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.3);
  position: relative;
  overflow: hidden;
}

.section.card-section::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: radial-gradient(circle at 20% 30%, rgba(99, 102, 241, 0.02) 0%, transparent 50%),
              radial-gradient(circle at 80% 70%, rgba(236, 72, 153, 0.02) 0%, transparent 50%);
  pointer-events: none;
}

.section h2 {
  font-size: 2.4rem;
  color: #1e293b;
  margin-bottom: 20px;
  text-align: center;
  font-weight: 800;
  position: relative;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.section h2:after {
  content: '';
  position: absolute;
  bottom: -15px;
  left: 50%;
  transform: translateX(-50%);
  width: 100px;
  height: 4px;
  background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
  border-radius: 2px;
  box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
}

/* 特性网格 - 专家级三列布局 */
.features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 32px;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

.feature {
  background: linear-gradient(145deg, #ffffff 0%, #f8fafc 100%);
  border-radius: 24px;
  padding: 40px 32px;
  text-align: center;
  box-shadow: 
    0 8px 32px rgba(0, 0, 0, 0.06),
    0 1px 4px rgba(0, 0, 0, 0.04),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  border: 1px solid rgba(226, 232, 240, 0.8);
  position: relative;
  overflow: hidden;
}

/* 添加微妙的背景装饰 */
.feature::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -50%;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle, rgba(59, 130, 246, 0.03) 0%, transparent 70%);
  transform: scale(0);
  transition: transform 0.6s ease;
  z-index: 0;
}

.feature:hover::before {
  transform: scale(1.5);
}

.feature:hover {
  transform: translateY(-8px) scale(1.02);
  box-shadow: 
    0 20px 48px rgba(0, 0, 0, 0.12),
    0 8px 16px rgba(0, 0, 0, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 1);
}

.feature i {
  font-size: 3.2rem;
  color: #ffffff;
  margin-bottom: 24px;
  background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
  width: 88px;
  height: 88px;
  border-radius: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 
    0 8px 24px rgba(59, 130, 246, 0.3),
    0 2px 8px rgba(59, 130, 246, 0.2);
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  z-index: 1;
}

.feature:hover i {
  transform: translateY(-2px) scale(1.05);
  box-shadow: 
    0 12px 32px rgba(59, 130, 246, 0.4),
    0 4px 12px rgba(59, 130, 246, 0.3);
}

.feature h3 {
  font-size: 1.6rem;
  margin-bottom: 18px;
  color: #1e293b;
  font-weight: 700;
  letter-spacing: -0.025em;
  position: relative;
  z-index: 1;
}

.feature p {
  color: #64748b;
  line-height: 1.75;
  margin: 0;
  font-size: 1rem;
  font-weight: 500;
  position: relative;
  z-index: 1;
}

/* 热门竞赛推荐区域 */
.card-section {
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.08);
  max-width: 1200px;
  margin: 0 auto 60px;
  padding: 50px 40px;
  border: 1px solid #e2e8f0;
}

/* 响应式调整 - 专家级适配 */
@media (max-width: 1280px) {
  .features {
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 28px;
    padding: 0 32px;
  }
}

@media (max-width: 1024px) {
  .features {
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 24px;
    padding: 0 28px;
  }
  
  .banner-container {
    aspect-ratio: 16/7;
  }
}

@media (max-width: 768px) {
  .features {
    grid-template-columns: 1fr;
    gap: 20px;
    padding: 0 20px;
    max-width: 100%;
  }
  
  .feature {
    padding: 32px 24px;
  }
  
  .feature h3 {
    font-size: 1.4rem;
  }
  
  .feature p {
    font-size: 0.95rem;
  }
  
  .feature i {
    font-size: 2.8rem;
    width: 72px;
    height: 72px;
    border-radius: 18px;
  }
  
  .section {
    padding: 48px 0;
  }
  
  .section h2 {
    font-size: 2rem;
    margin-bottom: 32px;
  }
  
  .card-section {
    padding: 40px 24px;
    margin: 0 16px 48px;
    width: calc(100% - 32px);
    border-radius: 24px;
  }
  
  .banner-container {
    aspect-ratio: 16/9;
    border-radius: 16px;
  }
}

@media (max-width: 480px) {
  .features {
    padding: 0 16px;
  }
  
  .feature {
    padding: 28px 20px;
  }
  
  .feature h3 {
    font-size: 1.3rem;
  }
  
  .feature i {
    font-size: 2.5rem;
    width: 64px;
    height: 64px;
    border-radius: 16px;
  }
  
  .section h2 {
    font-size: 1.8rem;
  }
}

/* 修复导航栏和内容的间距 */
body {
  padding-top: 0;
}

/* 确保内容区域有足够的底部间距 */
.main-content {
  /* min-height: calc(100vh - 400px); */
  padding-bottom: 10px;
}

/* 首页热门竞赛展示区域样式 - 现代化网格布局 */
.homepage .competition-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 28px;
  max-width: 1200px;
  margin: 0 auto;
  padding: 40px 24px 60px;
}

/* 竞赛展示区域背景 */
.competition-grid-wrapper.homepage-featured {
  background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
  position: relative;
  overflow: hidden;
}

.competition-grid-wrapper.homepage-featured::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: radial-gradient(circle at 30% 20%, rgba(99, 102, 241, 0.03) 0%, transparent 50%),
              radial-gradient(circle at 70% 80%, rgba(139, 92, 246, 0.03) 0%, transparent 50%);
  pointer-events: none;
}

/* 确保首页竞赛卡片样式一致 */
.homepage .competition-item {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  box-shadow: 
    0 8px 32px rgba(0, 0, 0, 0.06),
    0 2px 8px rgba(0, 0, 0, 0.04);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
  position: relative;
}

.homepage .competition-item:hover {
  transform: translateY(-6px);
  box-shadow: 
    0 20px 40px rgba(0, 0, 0, 0.12),
    0 8px 16px rgba(0, 0, 0, 0.08);
  border-color: rgba(99, 102, 241, 0.2);
}

/* 响应式设计 */
@media (max-width: 1024px) {
  .homepage .competition-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
    padding: 32px 20px 48px;
  }
}

@media (max-width: 768px) {
  .homepage .competition-grid {
    grid-template-columns: 1fr;
    gap: 20px;
    padding: 24px 16px 40px;
  }
}

@media (max-width: 480px) {
  .homepage .competition-grid {
    padding: 20px 12px 32px;
    gap: 16px;
  }
}
