/* styles/home.css — 新主页三模块样式（home-dev-spec.md v2.0）
   模块1 游戏分类矩阵 Game Hub；模块2 最新发布 Latest Videos；模块3 电竞风云 Esports Radar。
   固定宽高比（aspect-ratio）防 CLS；卡片 hover 微交互。 */
.home-module { margin-block: 34px; }

/* ============ 模块1 Game Hub ============ */
.hub-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}
.hub-tab {
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--muted);
  border-radius: 999px;
  padding: 6px 14px;
  font-size: 13px;
  cursor: pointer;
  transition: background .15s ease, color .15s ease, border-color .15s ease;
}
.hub-tab:hover { border-color: var(--primary); color: var(--primary); }
.hub-tab.is-active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
  font-weight: 700;
}
.hub-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}
@media (max-width: 1100px) { .hub-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 820px)  { .hub-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 520px)  { .hub-grid { grid-template-columns: 1fr; } }

.game-card {
  position: relative;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--card);
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.game-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: var(--primary); }
.game-card.is-disabled { opacity: .62; }
.game-card.is-disabled:hover { transform: none; box-shadow: none; border-color: var(--border); }
.game-card__link { display: block; color: inherit; text-decoration: none; }

.game-card__cover {
  position: relative;
  aspect-ratio: 16 / 9;
  background: var(--bg-alt);
}
.game-card__cover img { width: 100%; height: 100%; object-fit: contain; display: block; }

.game-card__body { padding: 12px 14px 14px; }
.game-card__title { margin: 0; font-size: 16px; font-weight: 700; line-height: 1.4; }
.game-card__en { margin: 2px 0 0; font-size: 12px; color: var(--muted); }
.game-card__stats { margin: 6px 0 0; font-size: 12px; color: var(--primary); font-weight: 600; }
.game-card__chip {
  display: inline-block;
  margin-top: 8px;
  font-size: 11px;
  color: var(--muted);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 2px 10px;
}
.game-card__preparing {
  display: inline-block;
  margin-top: 8px;
  font-size: 11px;
  color: var(--muted);
  background: var(--bg-alt);
  border-radius: 999px;
  padding: 2px 10px;
}

/* ============ 模块2 Latest Videos ============ */
.latest-track {
  display: flex;
  gap: 14px;
  overflow-x: auto;
  padding-bottom: 6px;
  scroll-snap-type: x proximity;
}
.latest-card {
  flex: 0 0 calc(25% - 11px);
  min-width: 220px;
  text-decoration: none;
  color: inherit;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--card);
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
  scroll-snap-align: start;
}
.latest-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: var(--primary); }
@media (max-width: 1100px) { .latest-card { flex-basis: calc(33.333% - 10px); } }
@media (max-width: 820px)  { .latest-card { flex-basis: calc(50% - 7px); } }
@media (max-width: 520px)  { .latest-card { flex-basis: 85%; } }

.latest-thumb {
  position: relative;
  aspect-ratio: 16 / 9;
  background: var(--bg-alt);
}
.latest-thumb img { width: 100%; height: 100%; object-fit: contain; display: block; }
.latest-duration {
  position: absolute;
  right: 6px;
  bottom: 6px;
  background: rgba(0, 0, 0, .78);
  color: #fff;
  font-size: 11px;
  border-radius: 6px;
  padding: 1px 6px;
}
.latest-body { padding: 10px 12px 12px; }
.latest-tag { font-size: 11px; color: var(--primary); font-weight: 600; }
.latest-title {
  margin: 4px 0 0;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.latest-meta { margin: 6px 0 0; font-size: 12px; color: var(--muted); }

/* ============ 模块3 Esports Radar ============ */
.esports-layout {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 20px;
  align-items: start;
}
@media (max-width: 900px) { .esports-layout { grid-template-columns: 1fr; } }

.spotlight {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--card);
}
.spotlight__img {
  position: relative;
  aspect-ratio: 16 / 9;
  background: var(--bg-alt);
}
.spotlight__img img { width: 100%; height: 100%; object-fit: contain; display: block; }
.spotlight__body { padding: 14px 16px 16px; }
.spotlight__name { margin: 0; font-size: 18px; font-weight: 700; }
.spotlight__meta { margin: 4px 0 0; font-size: 12px; color: var(--muted); }
.spotlight__latest { margin: 8px 0 0; font-size: 12px; color: var(--text); line-height: 1.5; }
.spotlight__desc { margin: 8px 0 0; font-size: 13px; color: var(--muted); line-height: 1.6; }
.spotlight__link {
  display: inline-block;
  margin-top: 12px;
  padding: 8px 16px;
  border-radius: 999px;
  background: var(--primary);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
}
.spotlight__link:hover { opacity: .88; }

.esports-filter { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.esports-tab {
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--muted);
  border-radius: 999px;
  padding: 5px 12px;
  font-size: 13px;
  cursor: pointer;
  transition: background .15s ease, color .15s ease, border-color .15s ease;
}
.esports-tab:hover { border-color: var(--primary); color: var(--primary); }
.esports-tab.is-active { background: var(--primary); border-color: var(--primary); color: #fff; font-weight: 700; }

.news-list { display: flex; flex-direction: column; gap: 12px; }
.news-item {
  display: flex;
  gap: 12px;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--card);
  padding: 10px;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.news-item:hover { border-color: var(--primary); box-shadow: var(--shadow); }
.news-thumb {
  position: relative;
  width: 112px;
  height: 66px;
  flex: none;
  border-radius: 8px;
  overflow: hidden;
  background: var(--bg-alt);
}
.news-thumb img { width: 100%; height: 100%; object-fit: contain; display: block; }
@media (max-width: 520px) { .news-thumb { width: 88px; height: 58px; } }
.news-body { min-width: 0; }
.news-tag {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  border-radius: 999px;
  padding: 2px 8px;
}
.news-tag--news   { background: #EEF4FF; color: var(--info); }
.news-tag--gossip { background: #FFF0E6; color: #E8590C; }
.news-tag--match  { background: #E9F7EF; color: var(--success); }
.news-title {
  margin: 5px 0 0;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.news-title a { text-decoration: none; }
.news-title a:hover { color: var(--primary); }
.news-meta { margin: 5px 0 0; font-size: 12px; color: var(--muted); }

/* 封面缺失占位（固定宽高比内居中首字） */
.cover-fallback {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  font-weight: 800;
  color: rgba(15, 15, 15, .18);
  background: var(--bg-alt);
  user-select: none;
}
