/* ===== 首页专用样式 - 基于base.css规范 ===== */
/* Version: 1.0.1 - Updated: 2025-01-27 */

/* ===== 英雄区域 ===== */
.hero {
  background: linear-gradient(135deg, var(--bg-primary) 0%, var(--bg-secondary) 100%);
  padding: var(--space-2xl) 0;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: radial-gradient(circle at 30% 20%, rgba(16, 185, 129, 0.1) 0%, transparent 50%),
              radial-gradient(circle at 70% 80%, rgba(107, 114, 128, 0.1) 0%, transparent 50%);
  pointer-events: none;
}

.hero-title {
  font-size: 2.25rem; /* 36px */
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: var(--space-lg);
  line-height: 1.2;
  position: relative;
  z-index: 1;
}

.hero-subtitle {
  font-size: 1rem; /* 16px */
  color: var(--text-secondary);
  margin-bottom: var(--space-2xl);
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
  line-height: 1.6;
  position: relative;
  z-index: 1;
}

.hero-buttons {
  display: flex;
  gap: var(--space-md);
  justify-content: center;
  flex-wrap: wrap;
  position: relative;
  z-index: 1;
}

.hero-buttons .btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  padding: var(--space-md) var(--space-lg);
  font-size: 0.875rem; /* 14px */
  font-weight: 600;
  border-radius: var(--radius-md);
  transition: var(--transition-normal);
  text-decoration: none;
  box-shadow: var(--shadow-sm);
}

.hero-buttons .btn:first-child {
  background-color: var(--accent-color);
  color: white;
}

.hero-buttons .btn:first-child:hover {
  background-color: #059669; /* 更深的绿色 */
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.hero-buttons .btn:last-child {
  background-color: var(--bg-card);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
}

.hero-buttons .btn:last-child:hover {
  background-color: var(--bg-secondary);
  border-color: var(--primary-color);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

/* ===== 最新文章区域 ===== */
.latest-articles {
  padding: var(--space-xl) 0;
  background-color: var(--bg-primary);
}

.section-title {
  font-size: 2rem; /* 32px */
  font-weight: 700;
  color: var(--text-primary);
  text-align: center;
  margin-bottom: var(--space-md);
  line-height: 1.2;
}

.section-subtitle {
  font-size: 1rem; /* 16px */
  color: var(--text-secondary);
  text-align: center;
  margin-bottom: var(--space-2xl);
  line-height: 1.6;
}

.articles-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--space-lg);
}

/* 移动端响应式样式 */
@media (max-width: 768px) {
  .articles-container {
    padding: 0 var(--space-md);
  }
}

.articles-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
  gap: var(--space-xl);
  margin-bottom: var(--space-sm);
}

/* ===== 文章卡片样式 ===== */
.article-card {
  background-color: var(--bg-card);
  border-radius: var(--radius-md);
  padding: var(--space-lg);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-color);
  transition: var(--transition-normal);
  height: 100%;
  display: flex;
  flex-direction: column;
}

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

.article-content {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.article-title {
  margin-bottom: var(--space-md);
  line-height: 1.3;
}

.article-title a {
  color: var(--text-primary);
  text-decoration: none;
  font-size: 1.125rem; /* 18px */
  font-weight: 600;
  transition: var(--transition-fast);
}

.article-title a:hover {
  color: var(--accent-color);
}

.article-excerpt {
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: var(--space-lg);
  flex: 1;
  font-size: 0.875rem; /* 14px */
}

.article-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: var(--space-md);
  border-top: 1px solid var(--border-color);
  margin-top: auto;
}

.article-date {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  color: var(--text-muted);
  font-size: 0.75rem; /* 12px */
}

.article-date i {
  font-size: 0.75rem;
}

.read-more {
  color: var(--accent-color);
  text-decoration: none;
  font-size: 0.75rem; /* 12px */
  font-weight: 500;
  transition: var(--transition-fast);
}

.read-more:hover {
  color: var(--primary-color);
  /*text-decoration: underline;*/
}

/* ===== 动画效果 ===== */
.fade-in {
  opacity: 0;
  transform: translateY(20px);
  animation: fadeInUp 0.6s ease forwards;
}

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

@keyframes fadeInUp {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ===== 响应式设计 ===== */
@media (max-width: 768px) {
  .hero {
    padding: var(--space-xl) 0;
  }
  
  .hero-title {
    font-size: 1.875rem; /* 30px */
    margin-bottom: var(--space-md);
  }
  
  .hero-subtitle {
    font-size: 0.875rem; /* 14px */
    margin-bottom: var(--space-xl);
  }
  
  .hero-buttons {
    flex-direction: column;
    align-items: center;
  }
  
  .hero-buttons .btn {
    width: 100%;
    max-width: 280px;
    justify-content: center;
  }
  
  .section-title {
    font-size: 1.75rem; /* 28px */
  }
  
  .section-subtitle {
    font-size: 0.875rem; /* 14px */
  }
  
  .articles-grid {
    grid-template-columns: 1fr;
    gap: var(--space-lg);
  }
  
  .article-card {
    padding: var(--space-md);
  }
  
  .article-title a {
    font-size: 1rem; /* 16px */
  }
  
  .article-excerpt {
    font-size: 0.75rem; /* 12px */
  }
  
  .article-meta {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-sm);
  }
}

@media (max-width: 480px) {
  .hero {
    padding: var(--space-lg) 0;
  }
  
  .hero-title {
    font-size: 1.5rem; /* 24px */
  }
  
  .hero-subtitle {
    font-size: 0.75rem; /* 12px */
  }
  
  .section-title {
    font-size: 1.5rem; /* 24px */
  }
  
  .section-subtitle {
    font-size: 0.75rem; /* 12px */
  }
  
  .article-card {
    padding: var(--space-sm);
  }
  
  .article-title a {
    font-size: 0.875rem; /* 14px */
  }
  
  .article-excerpt {
    font-size: 0.625rem; /* 10px */
  }
  
  .article-date,
  .read-more {
    font-size: 0.625rem; /* 10px */
  }
}

/* ===== 性能优化 ===== */
.article-card,
.hero-buttons .btn {
  will-change: transform;
}

/* 减少重绘 */
.fade-in {
  will-change: opacity, transform;
}

/* 确保动画完成后移除will-change */
.fade-in.animation-complete {
  will-change: auto;
}
