/* ===== 首页特有样式 ===== */

/* Hero区域 */
.home-hero {
  background: linear-gradient(135deg, #e53935 0%, #c62828 100%);
  color: #fff;
  text-align: center;
  padding: 60px 20px;
}
.home-hero h1 { font-size: 36px; font-weight: 700; margin-bottom: 12px; }
.home-hero p { font-size: 16px; opacity: .9; margin-bottom: 24px; }
.home-hero .hero-btns { display: flex; gap: 12px; justify-content: center; }
.home-hero .btn { padding: 12px 28px; border-radius: 24px; font-size: 15px; text-decoration: none; transition: all .2s; }
.home-hero .btn-primary { background: #fff; color: #e53935; }
.home-hero .btn-primary:hover { background: #f5f5f5; }
.home-hero .btn-secondary { background: rgba(255,255,255,.2); color: #fff; border: 1.5px solid rgba(255,255,255,.4); }
.home-hero .btn-secondary:hover { background: rgba(255,255,255,.3); }

/* 赛事区域 */
.events-section { background: #f5f6fa; }
.news-section { background: #fff; }

/* 修复赛事卡片布局 - 关键修复 */
.events-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-top: 20px;
  /* 确保网格对齐 */
  align-items: start;
}

/* 修复赛事卡片 - 确保高度一致 */
.event-card {
  background: #fff;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0,0,0,.06);
  transition: transform .2s, box-shadow .2s;
  /* 使用flexbox确保内容对齐 */
  display: flex;
  flex-direction: column;
  /* 固定最小高度 */
  min-height: 320px;
}

/* 封面图区域 - 固定比例 */
.event-cover { 
  position: relative; 
  width: 100%; 
  /* 16:9 比例 */
  padding-top: 56.25%; 
  overflow: hidden; 
  background: #f0f0f0;
  /* 确保封面图区域不会被内容撑开 */
  flex-shrink: 0;
}

.event-cover img { 
  position: absolute; 
  top: 0; 
  left: 0; 
  width: 100%; 
  height: 100%; 
  object-fit: cover;
}

.cover-default {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: linear-gradient(135deg, #e53935 0%, #c62828 100%);
  display: flex; 
  align-items: center; 
  justify-content: center;
}

.cover-default span { font-size: 48px; opacity: .5; }

/* 赛事信息区域 - 固定高度确保对齐 */
.event-info { 
  padding: 14px 16px; 
  flex: 1;
  /* 固定最小高度 */
  min-height: 140px;
  display: flex;
  flex-direction: column;
}

.event-title {
  font-size: 15px;
  font-weight: 600;
  color: #222;
  margin-bottom: 8px;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  /* 固定标题区域高度 */
  min-height: 44px;
  line-height: 1.4;
}

.event-meta { 
  font-size: 13px; 
  color: #888; 
  margin-bottom: 4px;
  /* 固定高度 */
  height: 20px;
  line-height: 20px;
  overflow: hidden;
}

.event-footer { 
  display: flex; 
  align-items: center; 
  justify-content: space-between; 
  margin-top: auto;
  padding-top: 8px;
}

.participants { font-size: 12px; color: #999; }

/* 标签位置 - 修复重叠 */
.event-cover .tag-top {
  position: absolute;
  top: 8px;
  left: 8px;
  background: #e53935;
  color: #fff;
  font-size: 12px;
  padding: 2px 8px;
  border-radius: 4px;
  z-index: 2;
}

.event-cover .tag-top.has-status {
  top: 30px;
}

.event-cover .tag-fee {
  position: absolute;
  bottom: 8px;
  right: 8px;
  background: rgba(0,0,0,.6);
  color: #fff;
  font-size: 13px;
  padding: 3px 10px;
  border-radius: 4px;
  z-index: 2;
}

.event-cover .tag-status {
  position: absolute;
  top: 8px;
  right: 8px;
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 4px;
  z-index: 2;
}

.status-1 { background: #e8f5e9; color: #2e7d32; }
.status-2 { background: #f5f5f5; color: #9e9e9e; }
.status-3 { background: #ffebee; color: #c62828; }

/* 分类徽章 */
.cat-badge {
  display: inline-block;
  background: #fff0f0;
  color: #e53935;
  font-size: 12px;
  padding: 2px 8px;
  border-radius: 10px;
  border: 1px solid #ffd0d0;
  /* 固定高度 */
  height: 22px;
  line-height: 18px;
}

/* 响应式布局修复 */
@media (max-width: 768px) {
  .events-grid { 
    grid-template-columns: repeat(2, 1fr); 
    gap: 12px; 
  }
  .home-hero { padding: 40px 20px; }
  .home-hero h1 { font-size: 28px; }
}

@media (max-width: 480px) {
  .events-grid { 
    grid-template-columns: 1fr; 
    gap: 16px;
  }
  .home-hero .hero-btns { flex-direction: column; align-items: center; }
}

/* 空状态样式 */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  background: #fff;
  border-radius: 12px;
}
.empty-icon { font-size: 56px; margin-bottom: 12px; opacity: .5; }
.empty-state p { font-size: 15px; color: #999; margin-bottom: 16px; }
.empty-action {
  display: inline-block;
  background: #e53935;
  color: #fff;
  padding: 10px 24px;
  border-radius: 20px;
  font-size: 14px;
  text-decoration: none;
  transition: background .2s;
}
.empty-action:hover { background: #c62828; }

/* ===== 广告位样式 ===== */
.ads-section {
  background: #f5f6fa;
  padding: 30px 0;
}

.ads-grid {
  display: grid;
  gap: 16px;
}

.ads-grid-2 {
  grid-template-columns: repeat(2, 1fr);
}

.ads-grid-4 {
  grid-template-columns: repeat(4, 1fr);
}

.ads-item {
  display: block;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0,0,0,.08);
  transition: transform .2s, box-shadow .2s;
}

.ads-item:hover {
  transform: translateY(-3px);
  box-shadow: 0 4px 16px rgba(0,0,0,.12);
}

.ads-item img {
  width: 100%;
  height: auto;
  display: block;
}

.ads-placeholder {
  background: linear-gradient(135deg, #e53935 0%, #c62828 100%);
  color: #fff;
  padding: 40px 20px;
  text-align: center;
  font-size: 16px;
}

/* 移动端广告 */
@media (max-width: 768px) {
  .ads-grid-2,
  .ads-grid-4 {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 480px) {
  .ads-grid-2,
  .ads-grid-4 {
    grid-template-columns: 1fr;
  }
}
