/* =========================================================
   page-home – 首页专属样式
   作用域限定 .page-home 内，不污染全局
   移动端优先，包含桌面断点
   ========================================================= */
.page-home {
  --home-gap: 3rem;
  --home-section-py: 5rem;
  --home-stat-size: 3.5rem;
  --home-card-radius: 1.25rem;
  --home-bar-height: 0.5rem;
  --home-rank-bar-h: 0.375rem;
  --home-img-radius: 0.75rem;
  background: var(--primary);
  color: var(--white);
  font-family: var(--font-body);
  line-height: 1.6;
}

/* ---- 容器通用 ---- */
.page-home .container {
  max-width: var(--max-width);
  margin-inline: auto;
  padding-inline: 1.25rem;
}

/* ---- 章节头部通用 ---- */
.page-home .section-header {
  text-align: center;
  margin-bottom: 2.5rem;
}
.page-home .section-headline {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: clamp(2rem, 5vw, 3.2rem);
  letter-spacing: -0.02em;
  color: var(--white);
  margin: 0 0 0.5rem;
}
.page-home .section-subline {
  font-size: 1rem;
  color: var(--gray-light);
  max-width: 640px;
  margin-inline: auto;
  line-height: 1.5;
}
.page-home .section-link {
  display: inline-block;
  margin-top: 0.75rem;
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--accent);
  text-decoration: none;
  position: relative;
  transition: color var(--transition);
}
.page-home .section-link::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 100%;
  height: 2px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform var(--transition);
}
.page-home .section-link:hover,
.page-home .section-link:focus-visible {
  color: var(--accent-hover);
}
.page-home .section-link:hover::after,
.page-home .section-link:focus-visible::after {
  transform: scaleX(1);
  transform-origin: left;
}

/* =========================================================
   1. 数据仪表盘 (dashboard-hero)
   ========================================================= */
.page-home .dashboard-hero {
  position: relative;
  padding: 4rem 0 3rem;
  overflow: hidden;
}
.page-home .dash-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
  align-items: center;
}
.page-home .dash-content {
  position: relative;
  z-index: 2;
}
.page-home .dash-context {
  font-family: var(--font-head);
  font-weight: 500;
  font-size: 0.85rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 0.5rem;
}
.page-home .dash-headline {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: clamp(2.8rem, 10vw, 5.5rem);
  line-height: 1.1;
  letter-spacing: -0.03em;
  color: var(--white);
  margin: 0 0 0.75rem;
}
.page-home .dash-sub {
  font-size: 1.05rem;
  color: var(--gray-light);
  max-width: 520px;
  margin: 0 0 2rem;
  line-height: 1.5;
}

/* 统计数字 */
.page-home .dash-stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.25rem;
  margin-bottom: 2rem;
}
.page-home .dash-stat-item {
  opacity: 0;
  animation: dashFadeUp 0.7s ease forwards;
}
@keyframes dashFadeUp {
  from { opacity: 0; transform: translateY(32px); }
  to   { opacity: 1; transform: translateY(0); }
}
.page-home .stat-num {
  display: block;
  font-family: var(--font-data);
  font-weight: 700;
  font-size: var(--home-stat-size);
  line-height: 1.1;
  color: var(--accent);
  letter-spacing: -0.02em;
}
.page-home .stat-num .plus {
  font-size: 0.6em;
  vertical-align: super;
  margin-left: 0.05em;
}
.page-home .stat-label {
  display: block;
  font-family: var(--font-head);
  font-weight: 500;
  font-size: 0.85rem;
  color: var(--gray-light);
  margin-top: 0.25rem;
  letter-spacing: 0.02em;
}

/* 按钮组 */
.page-home .dash-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}
.page-home .dash-btn,
.page-home .dash-btn-outline {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.8rem 2rem;
  border-radius: var(--radius-full);
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 0.95rem;
  text-decoration: none;
  transition: all var(--transition);
  cursor: default;
}
.page-home .dash-btn {
  background: var(--accent);
  color: var(--white);
  border: 2px solid var(--accent);
}
.page-home .dash-btn:hover,
.page-home .dash-btn:focus-visible {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
}
.page-home .dash-btn-outline {
  background: transparent;
  color: var(--white);
  border: 2px solid var(--gray-light);
}
.page-home .dash-btn-outline:hover,
.page-home .dash-btn-outline:focus-visible {
  border-color: var(--accent);
  color: var(--accent);
}

/* 右侧视觉区 */
.page-home .dash-visual {
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: center;
  align-items: center;
}
.page-home .dash-img {
  width: 100%;
  max-width: 600px;
  height: auto;
  aspect-ratio: 4/3;
  object-fit: cover;
  border-radius: var(--home-card-radius);
  box-shadow: var(--shadow-soft);
  display: block;
}
.page-home .dash-ring {
  display: none;
}

/* =========================================================
   2. 近期焦点战 (featured-matches)
   ========================================================= */
.page-home .featured-matches {
  padding: var(--home-section-py) 0;
  background: linear-gradient(180deg, var(--primary) 0%, var(--primary-light) 100%);
}
.page-home .match-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
}
.page-home .match-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding: 1.5rem;
  border-radius: var(--home-card-radius);
  background: linear-gradient(135deg, var(--primary), var(--card-bg));
  box-shadow: 0 4px 24px rgba(0,0,0,0.25);
  transition: transform var(--transition), box-shadow var(--transition);
  border: 1px solid rgba(255,255,255,0.04);
}
.page-home .match-card:hover,
.page-home .match-card:focus-within {
  transform: translateY(-4px);
  box-shadow: 0 12px 40px rgba(0,0,0,0.35);
}
/* 背景渐进变化 */
.page-home .match-card:nth-child(1) { --card-bg-start: #0F1F35; --card-bg-end: #1A2A3A; }
.page-home .match-card:nth-child(2) { --card-bg-start: #142540; --card-bg-end: #2C3E50; }
.page-home .match-card:nth-child(3) { --card-bg-start: #1A2A3A; --card-bg-end: #3A4A5A; }
.page-home .match-card {
  background: linear-gradient(135deg, var(--card-bg-start), var(--card-bg-end));
}
.page-home .match-teams {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 1.4rem;
  color: var(--white);
}
.page-home .vs-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  flex-shrink: 0;
}
.page-home .match-stats {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.page-home .stat-pair {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}
.page-home .stat-pair .stat-label {
  font-size: 0.75rem;
  color: var(--gray);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.page-home .dual-bar {
  display: flex;
  height: var(--home-bar-height);
  border-radius: var(--radius-full);
  overflow: hidden;
  background: rgba(255,255,255,0.06);
}
.page-home .bar-left {
  height: 100%;
  background: var(--accent);
  border-radius: var(--radius-full) 0 0 var(--radius-full);
  transition: width 0.6s ease;
}
.page-home .bar-right {
  height: 100%;
  background: var(--gray);
  border-radius: 0 var(--radius-full) var(--radius-full) 0;
  transition: width 0.6s ease;
}
.page-home .stat-figures {
  display: flex;
  justify-content: space-between;
  font-family: var(--font-data);
  font-size: 0.8rem;
  color: var(--gray-light);
}
.page-home .home-fig { color: var(--accent); }
.page-home .away-fig { color: var(--gray); }
.page-home .match-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin-top: auto;
}
.page-home .tag {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius-full);
  background: rgba(255,255,255,0.06);
  font-family: var(--font-head);
  font-weight: 500;
  font-size: 0.7rem;
  color: var(--gray-light);
  letter-spacing: 0.03em;
}
.page-home .match-link {
  margin-left: auto;
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--accent);
  text-decoration: none;
  transition: color var(--transition);
}
.page-home .match-link:hover,
.page-home .match-link:focus-visible {
  color: var(--accent-hover);
  text-decoration: underline;
}
.page-home .match-img-wrap {
  display: none;
}

/* =========================================================
   3. 积分榜动态 (standings-area)
   ========================================================= */
.page-home .standings-area {
  padding: var(--home-section-py) 0;
  background: var(--primary);
}
.page-home .league-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.75rem;
}
.page-home .league-card {
  background: linear-gradient(145deg, var(--primary-light), var(--card-bg));
  border-radius: var(--home-card-radius);
  padding: 1.5rem;
  box-shadow: 0 4px 20px rgba(0,0,0,0.2);
  border: 1px solid rgba(255,255,255,0.04);
  transition: transform var(--transition), box-shadow var(--transition);
}
.page-home .league-card:hover,
.page-home .league-card:focus-within {
  transform: translateY(-3px);
  box-shadow: 0 10px 36px rgba(0,0,0,0.3);
}
.page-home .league-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.25rem;
}
.page-home .league-badge {
  width: 3rem;
  height: 3rem;
  object-fit: contain;
  border-radius: 50%;
  background: rgba(255,255,255,0.04);
  flex-shrink: 0;
}
.page-home .league-name {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 1.5rem;
  color: var(--white);
  margin: 0;
}
.page-home .league-standings {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.page-home .standing-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius-md);
  transition: background var(--transition);
  cursor: default;
}
.page-home .standing-row:hover {
  background: rgba(255,255,255,0.04);
}
.page-home .rank-num {
  font-family: var(--font-data);
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--accent);
  min-width: 1.8rem;
  text-align: center;
}
.page-home .team-label {
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--white);
  min-width: 6rem;
}
.page-home .rank-bar-wrap {
  flex: 1;
  height: var(--home-rank-bar-h);
  background: rgba(255,255,255,0.06);
  border-radius: var(--radius-full);
  overflow: hidden;
}
.page-home .rank-bar {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--accent), #ff8a5c);
  border-radius: var(--radius-full);
  transition: width 0.6s ease;
}
.page-home .rank-change {
  font-size: 0.8rem;
  min-width: 1.2rem;
  text-align: center;
}
.page-home .rank-change.up { color: var(--success); }
.page-home .rank-change.down { color: var(--danger); }
.page-home .rank-change.same { color: var(--gray); }
.page-home .league-link {
  display: inline-block;
  margin-top: 1rem;
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--accent);
  text-decoration: none;
  transition: color var(--transition);
}
.page-home .league-link:hover,
.page-home .league-link:focus-visible {
  color: var(--accent-hover);
  text-decoration: underline;
}

/* =========================================================
   4. 平台特色 (platform-features)
   ========================================================= */
.page-home .platform-features {
  padding: var(--home-section-py) 0;
  background: linear-gradient(0deg, var(--primary-light) 0%, var(--primary) 100%);
}
.page-home .feature-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
}
.page-home .feature-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 2rem 1.5rem;
  border-radius: var(--home-card-radius);
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.04);
  transition: transform var(--transition), background var(--transition);
}
.page-home .feature-card:hover,
.page-home .feature-card:focus-within {
  transform: translateY(-3px);
  background: rgba(255,255,255,0.06);
}
.page-home .feature-icon-wrap {
  width: 4rem;
  height: 4rem;
  border-radius: 50%;
  background: var(--accent-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1rem;
  overflow: hidden;
}
.page-home .feature-icon {
  width: 2.4rem;
  height: 2.4rem;
  object-fit: contain;
  filter: brightness(0) saturate(100%) invert(48%) sepia(95%) saturate(747%) hue-rotate(346deg) brightness(104%) contrast(101%);
}
.page-home .feature-title {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--white);
  margin: 0 0 0.5rem;
}
.page-home .feature-desc {
  font-size: 0.95rem;
  color: var(--gray-light);
  line-height: 1.5;
  margin: 0 0 1rem;
  max-width: 300px;
}
.page-home .feature-link {
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--accent);
  text-decoration: none;
  margin-top: auto;
  transition: color var(--transition);
}
.page-home .feature-link:hover,
.page-home .feature-link:focus-visible {
  color: var(--accent-hover);
  text-decoration: underline;
}

/* =========================================================
   交互细节：data-card 悬停提示
   ========================================================= */
.page-home [data-card] {
  position: relative;
}
.page-home [data-card]::after {
  content: attr(data-card);
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius-sm);
  background: var(--accent-soft);
  color: var(--accent);
  font-family: var(--font-data);
  font-size: 0.65rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition);
}
.page-home [data-card]:hover::after,
.page-home [data-card]:focus-within::after {
  opacity: 1;
}

/* =========================================================
   响应式 - 桌面 (≥768px)
   ========================================================= */
@media (min-width: 768px) {
  .page-home {
    --home-gap: 4rem;
    --home-section-py: 6rem;
    --home-stat-size: 4.2rem;
  }
  .page-home .container {
    padding-inline: 2rem;
  }
  /* 仪表盘双列 */
  .page-home .dash-grid {
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
  }
  .page-home .dash-headline {
    font-size: clamp(3.2rem, 7vw, 5.5rem);
  }
  .page-home .dash-stats {
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
  }
  .page-home .dash-img {
    max-width: 100%;
  }
  .page-home .dash-ring {
    display: block;
    position: absolute;
    top: 50%;
    left: 50%;
    width: 120%;
    padding-bottom: 120%;
    border-radius: 50%;
    border: 1px solid rgba(255,107,53,0.08);
    transform: translate(-50%, -50%);
    pointer-events: none;
  }

  /* 焦点战三列 */
  .page-home .match-grid {
    grid-template-columns: repeat(3, 1fr);
  }
  .page-home .match-card {
    padding: 1.75rem;
  }
  .page-home .match-img-wrap {
    display: block;
    margin-top: 0.5rem;
    border-radius: var(--radius-sm);
    overflow: hidden;
  }
  .page-home .match-img {
    width: 100%;
    height: auto;
    aspect-ratio: 4/3;
    object-fit: cover;
    display: block;
    border-radius: var(--radius-sm);
  }

  /* 积分榜三列 */
  .page-home .league-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
  }

  /* 特色四列 */
  .page-home .feature-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 2rem;
  }
}

/* =========================================================
   响应式 - 大桌面 (≥1024px)
   ========================================================= */
@media (min-width: 1024px) {
  .page-home {
    --home-section-py: 7rem;
    --home-stat-size: 4.8rem;
  }
  .page-home .container {
    padding-inline: 3rem;
  }
  .page-home .dash-headline {
    font-size: clamp(4rem, 6vw, 5.5rem);
  }
  .page-home .dash-stats {
    gap: 2rem;
  }
  .page-home .match-card {
    padding: 2rem;
  }
}

/* =========================================================
   辅助：确保图片响应且不溢出
   ========================================================= */
.page-home img {
  max-width: 100%;
  height: auto;
}
.page-home .btn,
.page-home .btn-outline {
  cursor: default;
}
.page-home a {
  cursor: default;
}
.page-home a[href]:not([href="#"]) {
  cursor: pointer;
}
