/* =========================================================
   首页 · 赛季总览
   全部选择器限定在 .page-home 作用域内
   ========================================================= */

.page-home {
  --home-band-pre: color-mix(in srgb, var(--color-primary) 42%, var(--color-surface));
  --home-band-mid: var(--color-primary);
  --home-band-late: var(--color-accent);
  display: block;
  background: var(--color-surface);
  color: var(--color-ink);
  font-family: var(--font-body);
  line-height: var(--leading-body);
}

.page-home * ,
.page-home *::before,
.page-home *::after {
  box-sizing: border-box;
}

.page-home img {
  max-width: 100%;
  height: auto;
}

.page-home h1,
.page-home h2,
.page-home h3 {
  margin: 0;
  font-family: var(--font-heading);
  font-weight: var(--weight-heading);
  letter-spacing: var(--tracking-heading);
  line-height: var(--leading-heading);
}

.page-home h2 {
  font-size: var(--text-2xl);
}

.page-home a:focus-visible,
.page-home button:focus-visible {
  outline: var(--border-thick) solid var(--color-focus);
  outline-offset: 3px;
}

.page-home .section-head {
  max-width: 62ch;
  margin: 0 0 var(--space-6);
}

.page-home .section-head .eyebrow {
  margin: 0 0 var(--space-3);
}

.page-home .section-head h2 {
  margin: 0 0 var(--space-3);
}

.page-home .section-head .prose {
  margin: 0;
  color: var(--color-ink-soft);
  font-size: var(--text-base);
  max-width: var(--measure);
}

/* =========================================================
   首屏
   ========================================================= */

.page-home .home-hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: var(--space-6);
  min-height: clamp(580px, 88vh, 880px);
  padding-bottom: var(--space-8);
  background: var(--color-contrast-surface);
  color: var(--color-contrast-ink);
}

.page-home .home-hero__img {
  position: absolute;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 26% 50%;
}

.page-home .home-hero__scrim {
  position: absolute;
  inset: 0;
  z-index: 1;
  background: var(--overlay-scrim);
}

.page-home .home-hero__top {
  position: relative;
  z-index: 3;
  display: flex;
  justify-content: flex-start;
  padding-top: calc(var(--space-8) + var(--space-6));
}

.page-home .home-hero__switch {
  display: flex;
}

.page-home .home-hero__switch .round-toggle {
  background: color-mix(in srgb, var(--color-contrast-surface) 76%, transparent);
  color: var(--color-contrast-ink);
  border-radius: var(--radius-sm);
}

.page-home .home-hero__switch .round-key {
  color: var(--color-contrast-accent);
}

.page-home .home-hero__switch .round-caret {
  color: var(--color-contrast-accent);
}

.page-home .home-hero__switch .round-menu {
  background: var(--color-contrast-surface);
  border-radius: var(--radius-sm);
}

.page-home .home-hero__switch .round-menu .round-menu-num {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: var(--space-3);
  padding: var(--space-2) var(--space-3);
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  color: var(--color-contrast-ink);
  text-decoration: none;
}

.page-home .home-hero__switch .round-menu .round-menu-num:hover,
.page-home .home-hero__switch .round-menu .round-menu-num:focus-visible {
  background: color-mix(in srgb, var(--color-contrast-ink) 12%, transparent);
}

.page-home .home-hero__switch .round-menu-note {
  font-family: var(--font-body);
  font-size: var(--text-xs);
  color: var(--color-contrast-accent);
}

.page-home .home-hero__inner {
  position: relative;
  z-index: 2;
  width: 100%;
}

.page-home .home-hero__kicker {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin: 0 0 var(--space-4);
  font-size: var(--text-xs);
  letter-spacing: 0.14em;
  color: var(--color-contrast-accent);
}

.page-home .home-hero__kicker-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--color-contrast-accent);
  flex: none;
}

.page-home .home-hero__title {
  font-size: var(--text-display);
  line-height: 0.95;
  letter-spacing: var(--tracking-heading);
  color: var(--color-contrast-ink);
  margin: 0 0 var(--space-4);
  max-width: 12ch;
}

.page-home .home-hero__lede {
  margin: 0 0 var(--space-8);
  max-width: 48ch;
  font-size: var(--text-lg);
  line-height: var(--leading-body);
  color: color-mix(in srgb, var(--color-contrast-ink) 88%, transparent);
}

.page-home .home-hero__figures {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-4);
  margin: 0;
  padding: 0;
}

.page-home .home-hero__figure dt {
  margin: 0 0 var(--space-1);
  font-size: var(--text-xs);
  letter-spacing: 0.16em;
  color: var(--color-contrast-accent);
}

.page-home .home-hero__figure dd {
  display: flex;
  align-items: baseline;
  gap: var(--space-1);
  margin: 0;
  color: var(--color-contrast-ink);
}

.page-home .home-hero__figure .figure {
  font-family: var(--font-mono);
  font-size: var(--text-figure);
  font-weight: var(--weight-heading);
  line-height: 0.92;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}

.page-home .home-hero__figure .figure-unit {
  font-family: var(--font-body);
  font-size: var(--text-sm);
  color: var(--color-contrast-accent);
  letter-spacing: 0.06em;
}

/* =========================================================
   名额总览
   ========================================================= */

.page-home .home-overview {
  padding-block: var(--section-y);
  background: var(--color-surface);
}

.page-home .home-overview__grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--space-6);
}

.page-home .home-rail {
  min-width: 0;
}

.page-home .home-rail__mark {
  display: none;
  margin: 0 0 var(--space-3);
  font-size: var(--text-xs);
  letter-spacing: 0.3em;
  color: var(--color-ink-muted);
  writing-mode: vertical-rl;
  text-orientation: mixed;
}

.page-home .home-rail__list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-2) var(--space-3);
  margin: 0;
  padding: 0;
  list-style: none;
}

.page-home .home-rail__list .tick {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  min-width: 0;
}

.page-home .home-rail__num {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  font-weight: var(--weight-heading);
  color: var(--color-ink-muted);
  font-variant-numeric: tabular-nums;
}

.page-home .home-rail__label {
  font-size: var(--text-xs);
  color: var(--color-ink-soft);
  white-space: nowrap;
}

.page-home .home-rail__list .tick.is-lit .home-rail__num {
  color: var(--color-primary);
}

.page-home .home-rail__list .tick.is-lit .tick__dot {
  background: var(--color-primary);
}

.page-home .home-band {
  display: flex;
  gap: var(--space-1);
  height: clamp(64px, 11vw, 92px);
  margin-bottom: var(--space-6);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.page-home .home-band__seg {
  display: block;
}

.page-home .home-band__seg--pre {
  flex: 42;
  background: var(--home-band-pre);
}

.page-home .home-band__seg--mid {
  flex: 96;
  background: var(--home-band-mid);
}

.page-home .home-band__seg--late {
  flex: 76;
  background: var(--home-band-late);
}

.page-home .home-band__list {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--space-6);
  margin: 0;
  padding: 0;
  list-style: none;
}

.page-home .home-band__item {
  border-top: var(--border-thick) solid var(--home-band-mid);
  padding-top: var(--space-3);
}

.page-home .home-band__item--pre {
  border-top-color: var(--home-band-pre);
}

.page-home .home-band__item--late {
  border-top-color: var(--home-band-late);
}

.page-home .home-band__name {
  margin: 0 0 var(--space-1);
  font-size: var(--text-sm);
  color: var(--color-ink-soft);
}

.page-home .home-band__figure {
  margin: 0 0 var(--space-2);
  font-family: var(--font-mono);
  font-size: var(--text-2xl);
  font-weight: var(--weight-heading);
  line-height: 1;
  color: var(--color-accent);
  font-variant-numeric: tabular-nums;
}

.page-home .home-band__figure .figure-unit {
  margin-left: var(--space-1);
  font-family: var(--font-body);
  font-size: var(--text-sm);
  color: var(--color-ink-muted);
}

.page-home .home-band__note {
  margin: 0;
  font-size: var(--text-sm);
  line-height: 1.75;
  color: var(--color-ink-soft);
}

/* =========================================================
   两条数据线
   ========================================================= */

.page-home .home-lines {
  padding-block: var(--section-y);
  background: var(--color-surface-alt);
}

.page-home .home-lines__grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--space-4);
}

.page-home .home-line {
  position: relative;
  isolation: isolate;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: var(--space-4);
  min-height: 320px;
  padding: var(--space-6);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.page-home .home-line--pass {
  background: var(--color-contrast-surface);
  color: var(--color-contrast-ink);
}

.page-home .home-line__img {
  position: absolute;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.page-home .home-line__scrim {
  position: absolute;
  inset: 0;
  z-index: 1;
  background: var(--overlay-scrim);
}

.page-home .home-line__body {
  position: relative;
  z-index: 2;
}

.page-home .home-line--goal {
  background: var(--color-surface-deep);
  color: var(--color-ink);
  justify-content: space-between;
}

.page-home .home-line__key {
  margin: 0 0 var(--space-2);
  font-size: var(--text-xs);
  letter-spacing: 0.16em;
}

.page-home .home-line--pass .home-line__key {
  color: var(--color-contrast-accent);
}

.page-home .home-line--goal .home-line__key {
  color: var(--color-accent);
}

.page-home .home-line__figure {
  margin: 0 0 var(--space-3);
  font-family: var(--font-mono);
  font-size: var(--text-3xl);
  font-weight: var(--weight-heading);
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.page-home .home-line--pass .home-line__figure {
  color: var(--color-contrast-ink);
}

.page-home .home-line--goal .home-line__figure {
  color: var(--color-accent);
}

.page-home .home-line__figure .figure-unit {
  margin-left: var(--space-1);
  font-family: var(--font-body);
  font-size: var(--text-sm);
  letter-spacing: 0.04em;
  color: var(--color-ink-muted);
}

.page-home .home-line--pass .home-line__figure .figure-unit {
  color: var(--color-contrast-accent);
}

.page-home .home-line__note {
  margin: 0;
  max-width: 46ch;
  font-size: var(--text-sm);
  line-height: 1.75;
}

.page-home .home-line--pass .home-line__note {
  color: color-mix(in srgb, var(--color-contrast-ink) 82%, transparent);
}

.page-home .home-line--goal .home-line__note {
  color: var(--color-ink-soft);
}

.page-home .home-line__note a {
  color: var(--color-accent);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.page-home .home-line__bars {
  display: flex;
  align-items: flex-end;
  gap: var(--space-1);
  height: 104px;
}

.page-home .home-line__bars span {
  flex: 1 1 0;
  display: block;
  background: var(--color-primary);
  opacity: 0.5;
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
}

.page-home .home-line__bars span:nth-child(1) { height: 42%; }
.page-home .home-line__bars span:nth-child(2) { height: 58%; }
.page-home .home-line__bars span:nth-child(3) { height: 36%; opacity: 0.78; }
.page-home .home-line__bars span:nth-child(4) { height: 71%; }
.page-home .home-line__bars span:nth-child(5) { height: 54%; }
.page-home .home-line__bars span:nth-child(6) { height: 83%; background: var(--color-accent); opacity: 0.85; }
.page-home .home-line__bars span:nth-child(7) { height: 62%; }
.page-home .home-line__bars span:nth-child(8) { height: 47%; opacity: 0.78; }
.page-home .home-line__bars span:nth-child(9) { height: 76%; }
.page-home .home-line__bars span:nth-child(10) { height: 90%; background: var(--color-accent); opacity: 0.85; }

/* =========================================================
   联赛分区
   ========================================================= */

.page-home .home-leagues {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  padding-block: var(--section-y);
  background: var(--color-contrast-surface);
  color: var(--color-contrast-ink);
}

.page-home .home-leagues__img {
  position: absolute;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 62% 45%;
}

.page-home .home-leagues__scrim {
  position: absolute;
  inset: 0;
  z-index: 1;
  background: var(--overlay-scrim);
}

.page-home .home-leagues__inner {
  position: relative;
  z-index: 2;
}

.page-home .home-leagues .section-head h2 {
  color: var(--color-contrast-ink);
}

.page-home .home-leagues .section-head .prose {
  color: color-mix(in srgb, var(--color-contrast-ink) 80%, transparent);
}

.page-home .home-leagues__list {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--space-3);
  margin: 0 0 var(--space-6);
  padding: 0;
  list-style: none;
}

.page-home .home-league {
  padding: var(--space-4);
  background: color-mix(in srgb, var(--color-contrast-surface) 72%, transparent);
  border-radius: var(--radius-sm);
  clip-path: polygon(
    0 0,
    100% 0,
    100% calc(100% - var(--space-2)),
    calc(100% - var(--space-2)) 100%,
    0 100%
  );
}

.page-home .home-league__nation {
  margin: 0 0 var(--space-2);
  font-family: var(--font-heading);
  font-weight: var(--weight-heading);
  font-size: var(--text-lg);
  line-height: var(--leading-heading);
  color: var(--color-contrast-ink);
}

.page-home .home-league__names {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1);
  margin: 0 0 var(--space-3);
}

.page-home .home-league .tag--dark {
  background: color-mix(in srgb, var(--color-primary) 55%, transparent);
  color: var(--color-contrast-ink);
  border-radius: var(--radius-sm);
}

.page-home .home-league__note {
  margin: 0;
  font-size: var(--text-sm);
  line-height: 1.7;
  color: color-mix(in srgb, var(--color-contrast-ink) 76%, transparent);
}

.page-home .home-leagues__exit {
  margin: 0;
  max-width: 62ch;
  font-size: var(--text-sm);
  color: color-mix(in srgb, var(--color-contrast-ink) 80%, transparent);
}

.page-home .home-leagues__exit a {
  color: var(--color-contrast-accent);
  text-decoration: underline;
  text-underline-offset: 4px;
}

/* =========================================================
   更新节奏
   ========================================================= */

.page-home .home-rhythm {
  padding-block: var(--section-y);
  background: var(--color-surface);
}

.page-home .home-rhythm__grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--space-6);
}

.page-home .home-rhythm__list {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--space-6);
  margin: 0;
  padding: 0;
  list-style: none;
}

.page-home .home-rhythm__when {
  margin: 0 0 var(--space-1);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  letter-spacing: 0.1em;
  color: var(--color-primary);
}

.page-home .home-rhythm__what {
  margin: 0 0 var(--space-2);
  font-family: var(--font-heading);
  font-weight: var(--weight-heading);
  font-size: var(--text-lg);
  line-height: var(--leading-heading);
  color: var(--color-ink);
}

.page-home .home-rhythm__why {
  margin: 0;
  font-size: var(--text-sm);
  line-height: 1.75;
  color: var(--color-ink-soft);
}

.page-home .home-rhythm__figure {
  position: relative;
  margin: 0;
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.page-home .home-rhythm__figure img {
  display: block;
  width: 100%;
  height: auto;
  object-fit: cover;
}

.page-home .home-rhythm__caption {
  position: absolute;
  top: var(--space-3);
  right: var(--space-3);
  padding: var(--space-2) var(--space-1);
  border-radius: var(--radius-sm);
  background: color-mix(in srgb, var(--color-contrast-surface) 74%, transparent);
  color: var(--color-contrast-ink);
  font-size: var(--text-xs);
  letter-spacing: 0.2em;
  writing-mode: vertical-rl;
  text-orientation: mixed;
}

/* =========================================================
   下一步
   ========================================================= */

.page-home .home-next {
  padding-block: var(--section-y) var(--section-y-lg);
  background: var(--color-surface);
}

.page-home .home-next__list {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--space-3);
  margin: 0;
  padding: 0;
  list-style: none;
}

.page-home .home-next__item {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  padding: var(--space-4);
  background: var(--color-surface-alt);
  border-radius: var(--radius-sm);
}

.page-home .home-next__item:nth-child(3n) {
  background: var(--color-primary-soft);
}

.page-home .home-next__item:nth-child(4n) {
  background: var(--color-highlight);
}

.page-home .home-next__title {
  margin: 0;
  font-family: var(--font-heading);
  font-weight: var(--weight-heading);
  font-size: var(--text-lg);
  line-height: var(--leading-heading);
}

.page-home .home-next__title a {
  color: var(--color-primary);
  text-decoration: none;
}

.page-home .home-next__title a:hover,
.page-home .home-next__title a:focus-visible {
  color: var(--color-focus);
  text-decoration: underline;
  text-underline-offset: 4px;
}

.page-home .home-next__desc {
  margin: 0;
  font-size: var(--text-sm);
  line-height: 1.75;
  color: var(--color-ink-soft);
}

.page-home .home-next__desc a {
  color: var(--color-accent);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.page-home .home-next__tail {
  margin: var(--space-6) 0 0;
  font-size: var(--text-sm);
  color: var(--color-ink-soft);
}

.page-home .home-next__tail a {
  color: var(--color-accent);
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* =========================================================
   窄屏 → 桌面
   ========================================================= */

@media (min-width: 700px) {
  .page-home .home-hero__figures {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: var(--space-6);
  }

  .page-home .home-band__list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: var(--space-4);
  }

  .page-home .home-rhythm__list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .page-home .home-leagues__list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .page-home .home-next__list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 900px) {
  .page-home .home-hero__top {
    justify-content: flex-end;
    padding-top: calc(var(--space-8) + var(--space-8));
  }

  .page-home .home-hero__title {
    max-width: 16ch;
  }

  .page-home .home-overview__grid {
    grid-template-columns: minmax(180px, 3fr) minmax(0, 9fr);
    gap: var(--space-8);
    align-items: start;
  }

  .page-home .home-rail {
    position: sticky;
    top: calc(var(--space-8) + var(--space-4));
  }

  .page-home .home-rail__mark {
    display: block;
  }

  .page-home .home-rail__list {
    grid-template-columns: minmax(0, 1fr);
    gap: 0;
  }

  .page-home .home-rail__list .tick {
    padding: var(--space-2) 0 var(--space-2) var(--space-3);
    border-left: var(--border-thin) solid var(--color-line);
  }

  .page-home .home-rail__list .tick.is-lit {
    border-left-color: var(--color-primary);
  }

  .page-home .home-lines__grid {
    grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
    gap: var(--space-6);
    align-items: stretch;
  }

  .page-home .home-rhythm__grid {
    grid-template-columns: minmax(0, 8fr) minmax(0, 4fr);
    gap: var(--space-8);
    align-items: start;
  }

  .page-home h2 {
    font-size: var(--text-3xl);
  }
}

@media (min-width: 1020px) {
  .page-home .home-leagues__list {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .page-home .home-next__list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (prefers-reduced-motion: reduce) {
  .page-home * ,
  .page-home *::before,
  .page-home *::after {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
  }
}
