/* 首页特定样式 */

/* 主视觉区域 */
.hero-section {
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
  color: white;
  padding: 3rem 0;
  text-align: center;
  margin-bottom: 0;
  border-radius: 0 0 20px 20px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.hero-title {
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: 1rem;
}

.hero-subtitle {
  font-size: 1.2rem;
  margin-bottom: 1.5rem; /* 减小margin */
  opacity: 0.9;
}

.hero-search {
  max-width: 600px;
  margin: 0 auto;
}

.search-form {
  display: flex;
  gap: 10px;
}

.search-input {
  flex: 1;
  padding: 0.375rem 0.75rem;
  border: 1px solid #ced4da;
  border-radius: var(--border-radius-normal);
  font-size: var(--font-size-normal);
  line-height: 1.5;
  color: #495057;
  background-color: var(--white-color);
  height: 38px;
}

.search-input:focus {
  color: #495057;
  background-color: var(--white-color);
  border-color: #80bdff;
  outline: 0;
  box-shadow: 0 0 0 0.2rem rgba(0,123,255,.25);
}

.search-btn {
  color: var(--search-btn-color);
  background-color: var(--search-btn-bg);
  border: 1px solid var(--search-btn-color);
  border-radius: var(--border-radius-normal);
  padding: 0.375rem 0.75rem;
  font-size: var(--font-size-normal);
  line-height: 1.5;
  cursor: pointer;
  transition: all 0.15s ease-in-out;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.search-btn:hover {
  background-color: #f0f8ff;
  transform: translateY(-2px);
  box-shadow: var(--box-shadow-hover);
}

/* 特色功能区域 */
.features-section {
  padding: 2rem 0; /* 减小padding */
}

.section-title {
  text-align: center;
  margin-bottom: 1.5rem; /* 减小margin */
  color: var(--primary-color);
  position: relative;
}

.section-title::after {
  content: "";
  display: block;
  width: 50px;
  height: 3px;
  background-color: var(--primary-color);
  margin: 10px auto;
  border-radius: 3px;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5rem; /* 减小gap */
}

.feature-card {
  background: linear-gradient(to bottom, white 0%, #f9fbfd 100%);
  border-radius: 10px;
  padding: 1.5rem;
  text-align: center;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.feature-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 15px 30px rgba(5, 114, 240, 0.15);
}

.feature-icon {
  font-size: 2.5rem; /* 减小图标大小 */
  color: var(--primary-color);
  margin-bottom: 1rem;
}

.feature-title {
  font-size: 1.2rem; /* 减小字体大小 */
  margin-bottom: 0.8rem; /* 减小margin */
  color: #333;
}

.feature-desc {
  color: #666;
  line-height: 1.5; /* 减小行高 */
  font-size: 0.95rem; /* 减小字体大小 */
}

/* 热门题库区域 */
.popular-section {
  padding: 2rem 0; /* 减小padding */
  background-color: var(--data-bg);
  border-radius: 10px;
  margin: 1.5rem 0; /* 减小margin */
}

.subject-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr); /* PC端一行6列 */
  gap: 1rem; /* 减小gap */
}

/* 移动端适配：一行2列 */
@media (max-width: 768px) {
  .subject-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.subject-card {
  background: linear-gradient(to bottom, white 0%, #f9fbfd 100%);
  border-radius: 10px;
  padding: 1.2rem;
  text-align: center;
  box-shadow: 0 3px 15px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
  text-decoration: none;
  color: #333;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 150px;
  overflow: hidden;
}

.subject-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 25px rgba(0, 124, 186, 0.25);
  color: var(--primary-color);
}

.subject-icon {
  font-size: 2rem; /* 减小图标大小 */
  margin-bottom: 0.8rem; /* 减小margin */
  color: var(--primary-color);
}

.subject-name {
  font-size: 1rem; /* 减小字体大小 */
  font-weight: 500;
  margin-bottom: 0.3rem; /* 减小margin */
}

.subject-count {
  font-size: 0.85rem; /* 减小字体大小 */
  color: #666;
}

/* 统计数据区域 */
.stats-section {
  padding: 3rem 0;
  background: linear-gradient(to bottom, rgba(0,0,0,0.02) 0%, transparent 100%);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr);
  gap: 2rem;
  text-align: center;
}

.stat-item {
  padding: 1.5rem;
  background: linear-gradient(to bottom, white 0%, #f9fbfd 100%);
  border-radius: 10px;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
}

.stat-number {
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--primary-color);
  margin-bottom: 0.5rem;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.stat-label {
  font-size: 1.1rem;
  color: #666;
}

/* 友情链接区域 */
.friend-links-section {
  padding: 2rem 0; /* 减小padding */
  background-color: var(--data-bg);
  border-radius: 10px;
  margin: 1.5rem 0; /* 减小margin */
}

.friend-links-grid {
  display: grid;
  grid-template-columns: repeat(10, 1fr); /* 一行10列 */
  gap: 0.8rem; /* 减小gap */
}

.friend-link {
  text-align: center;
}

.friend-link a {
  color: #000000; /* 黑色文字颜色 */
  text-decoration: none;
  font-size: 0.9rem; /* 减小字体大小 */
  transition: color 0.2s ease;
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis; /* 超出部分隐藏并显示省略号 */
  padding: 0 3px; /* 减小padding */
}

.friend-link a:hover {
  color: var(--primary-color);
  text-decoration: underline;
}

/* 响应式设计 */
@media (max-width: 1200px) {
  .friend-links-grid {
    grid-template-columns: repeat(5, 1fr); /* 中等屏幕5列 */
  }
}

@media (max-width: 768px) {
  .hero-section {
    padding: 1.5rem 0;
  }
  
  .hero-title {
    font-size: 2rem;
  }
  
  .hero-subtitle {
    font-size: 1rem;
  }
  
  .search-form {
    flex-direction: column;
  }
  
  .search-btn {
    padding: 0.375rem 0.75rem;
  }
  
  .features-section,
  .popular-section,
  .stats-section,
  .friend-links-section {
    padding: 1.5rem 0; /* 减小padding */
  }
  
  .features-grid,
  .subject-grid,
  .stats-grid {
    gap: 1rem; /* 减小gap */
  }
  
  .feature-card {
    padding: 1.2rem;
  }
  
  .subject-card {
    padding: 1rem;
    min-height: 130px;
  }
  
  .stat-number {
    font-size: 1.8rem;
  }
  
  .friend-links-grid {
    grid-template-columns: repeat(3, 1fr); /* 小屏幕3列 */
  }
}

@media (max-width: 576px) {
  .hero-title {
    font-size: 1.8rem;
  }
  
  .feature-card,
  .subject-card {
    padding: 1rem 0.8rem;
  }
  
  .friend-links-grid {
    grid-template-columns: repeat(2, 1fr); /* 超小屏幕2列 */
  }
  
  .section-title {
    margin-bottom: 1rem;
  }
}