:root {
  --primary: #ed1846;
  --primary-dark: #a80f2f;
  --canvas: #181818;
  --canvas-deep: #101010;
  --surface: #262626;
  --surface-strong: #303030;
  --ink: #ffffff;
  --body: #c9c9c9;
  --muted: #8f8f8f;
  --light: #ffffff;
  --light-soft: #f4f4f4;
  --line: #343434;
  --line-light: #d8d8d8;
  --max: 1280px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--canvas);
  color: var(--ink);
  font-family: Inter, "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  line-height: 1.5;
}

body::selection {
  background: var(--primary);
  color: var(--ink);
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  display: block;
  max-width: 100%;
}

.site-header {
  position: fixed;
  z-index: 20;
  top: 0;
  left: 0;
  width: 100%;
  height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 48px;
  background: rgba(24, 24, 24, 0.9);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(12px);
}

.brand {
  width: 152px;
  height: 42px;
  overflow: hidden;
  display: flex;
  align-items: center;
}

.brand img {
  width: 152px;
  height: 82px;
  object-fit: cover;
  object-position: center;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 32px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 700;
}

.site-nav a {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  opacity: 0.86;
}

.site-nav a:hover,
.site-nav a:focus-visible {
  color: var(--primary);
  opacity: 1;
}

.nav-toggle,
.nav-button {
  display: none;
}

.hero {
  position: relative;
  min-height: 92vh;
  display: flex;
  align-items: flex-end;
  overflow: hidden;
  background: var(--canvas-deep);
}

.hero > img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.home-hero > img {
  object-position: center;
  filter: saturate(1.05) contrast(1.04);
}

.schedule-hero > img {
  object-position: center;
  filter: saturate(0.96) contrast(1.08);
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(16, 16, 16, 0.1) 10%, rgba(16, 16, 16, 0.9) 92%),
    linear-gradient(90deg, rgba(16, 16, 16, 0.92), rgba(16, 16, 16, 0.32) 52%, rgba(16, 16, 16, 0.78));
}

.hero-content {
  position: relative;
  z-index: 2;
  width: min(100%, var(--max));
  margin: 0 auto;
  padding: 160px 48px 96px;
}

.eyebrow {
  margin: 0 0 16px;
  color: var(--ink);
  font-size: 12px;
  font-weight: 800;
}

.accent {
  color: var(--primary);
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  max-width: 860px;
  margin-bottom: 24px;
  font-size: 80px;
  line-height: 1.02;
  font-weight: 600;
}

h2 {
  margin-bottom: 0;
  font-size: 48px;
  line-height: 1.12;
  font-weight: 560;
}

h3 {
  font-size: 20px;
  line-height: 1.25;
  font-weight: 700;
}

.hero-copy {
  max-width: 640px;
  margin-bottom: 32px;
  color: var(--body);
  font-size: 18px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
}

.countdown {
  margin-top: 40px;
  padding: 28px 32px;
  background: rgba(16, 16, 16, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  display: inline-flex;
  flex-direction: column;
  gap: 8px;
}

.countdown-label {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.countdown-race {
  color: var(--ink);
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 4px;
}

.countdown-timer {
  display: flex;
  align-items: center;
  gap: 4px;
}

.countdown-unit {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 52px;
}

.countdown-unit span {
  font-size: 36px;
  line-height: 1;
  font-weight: 900;
  color: var(--primary);
  font-variant-numeric: tabular-nums;
}

.countdown-unit em {
  margin-top: 6px;
  font-style: normal;
  font-size: 10px;
  font-weight: 800;
  color: var(--muted);
  letter-spacing: 0.06em;
}

.countdown-sep {
  font-size: 32px;
  font-weight: 900;
  color: rgba(255, 255, 255, 0.3);
  line-height: 1;
  padding-bottom: 18px;
}

.countdown.done .countdown-timer {
  display: none;
}

.countdown.done .countdown-race::after {
  content: " — 比赛已开始";
  color: var(--muted);
  font-weight: 400;
}

.button {
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 14px 28px;
  border: 1px solid transparent;
  font-size: 14px;
  font-weight: 800;
  text-align: center;
}

.button.primary {
  background: var(--primary);
  color: var(--ink);
}

.button.primary:hover,
.button.primary:focus-visible {
  background: var(--primary-dark);
}

.button.ghost {
  border-color: rgba(255, 255, 255, 0.82);
  color: var(--ink);
}

.button.ghost:hover,
.button.ghost:focus-visible {
  border-color: var(--primary);
  color: var(--primary);
}

.button.outline-dark {
  border-color: var(--canvas);
  color: var(--canvas);
}

.button.outline-dark:hover,
.button.outline-dark:focus-visible {
  border-color: var(--primary);
  color: var(--primary);
}

.light-on-red {
  background: var(--canvas);
}

.section {
  padding: 96px 48px;
}

.section.dark {
  background: var(--canvas);
}

.section.light {
  background: var(--light);
  color: var(--canvas);
}

.section-grid {
  width: min(100%, var(--max));
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 0.85fr) minmax(320px, 1fr);
  gap: 64px;
  align-items: start;
}

.section-grid.compact {
  align-items: end;
  grid-template-columns: minmax(0, 1fr) auto;
}

.intro-copy {
  color: var(--body);
  font-size: 17px;
}

.section.light .intro-copy {
  color: #4a4a4a;
}

.intro-copy p:last-child {
  margin-bottom: 0;
}

.metric-band {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  background: var(--primary);
  color: var(--ink);
}

.metric {
  min-height: 176px;
  padding: 40px 32px;
  border-right: 1px solid rgba(255, 255, 255, 0.24);
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.metric:last-child {
  border-right: 0;
}

.metric strong {
  display: block;
  font-size: 64px;
  line-height: 1;
}

.metric span {
  margin-top: 12px;
  font-size: 14px;
  font-weight: 700;
}

.section-heading {
  width: min(100%, var(--max));
  margin: 0 auto 48px;
}

.series-grid,
.standards-grid,
.timeline {
  width: min(100%, var(--max));
  margin: 0 auto;
}

.series-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.feature-card {
  background: var(--surface);
  border: 1px solid var(--line);
}

.feature-card h3,
.feature-card p {
  padding-left: 24px;
  padding-right: 24px;
}

.feature-card h3 {
  margin: 24px 0 12px;
}

.feature-card p {
  margin-bottom: 28px;
  color: var(--body);
}

.card-image {
  height: 240px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: var(--canvas-deep);
}

.card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.red-plate {
  background: var(--primary);
}

.red-plate span,
.outline-plate span {
  font-size: 64px;
  font-weight: 900;
}

.outline-plate {
  border-bottom: 1px solid var(--primary);
}

.photo-plate img {
  filter: contrast(1.05);
}

.schedule-preview .section-grid {
  margin-bottom: 40px;
}

.race-list {
  width: min(100%, var(--max));
  margin: 0 auto;
  border-top: 1px solid var(--line-light);
}

.race-row {
  display: grid;
  grid-template-columns: 140px minmax(0, 1fr) 120px;
  gap: 24px;
  align-items: center;
  padding: 24px 0;
  border-bottom: 1px solid var(--line-light);
}

.race-row time {
  color: var(--primary);
  font-size: 34px;
  line-height: 1;
  font-weight: 800;
}

.race-row h3 {
  margin-bottom: 6px;
}

.race-row p {
  margin-bottom: 0;
  color: #5b5b5b;
}

.race-row span {
  font-size: 13px;
  font-weight: 800;
  text-align: right;
}

.standards-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: var(--line);
}

.standards-grid article {
  min-height: 260px;
  padding: 32px;
  background: var(--surface);
}

.standards-grid span {
  color: var(--primary);
  font-size: 13px;
  font-weight: 900;
}

.standards-grid h3 {
  margin: 42px 0 16px;
}

.standards-grid p {
  color: var(--body);
}

.cta-band {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 48px;
  align-items: center;
  padding: 80px 48px;
  background: var(--primary);
  color: var(--ink);
}

.cta-band > div {
  width: min(100%, 920px);
}

.cta-band h2 {
  margin-bottom: 16px;
}

.cta-band p:last-child {
  margin-bottom: 0;
  color: rgba(255, 255, 255, 0.84);
  font-size: 17px;
}

.site-footer {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) auto minmax(180px, 0.8fr);
  gap: 32px;
  align-items: center;
  padding: 48px;
  background: var(--canvas-deep);
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
}

.site-footer img {
  width: 180px;
  height: 56px;
  object-fit: cover;
  object-position: center;
  margin-bottom: 12px;
}

.site-footer p {
  margin-bottom: 0;
}

.site-footer nav {
  display: flex;
  gap: 24px;
}

.site-footer a:hover,
.site-footer a:focus-visible {
  color: var(--primary);
}

.footer-note {
  text-align: right;
}

.table-wrap {
  width: min(100%, var(--max));
  margin: 56px auto 0;
  overflow-x: auto;
  border: 1px solid var(--line-light);
}

.schedule-table {
  width: 100%;
  min-width: 860px;
  border-collapse: collapse;
  background: var(--light);
}

.schedule-table th,
.schedule-table td {
  padding: 20px 18px;
  border-bottom: 1px solid var(--line-light);
  text-align: left;
  white-space: nowrap;
}

.schedule-table th {
  background: var(--light-soft);
  color: #505050;
  font-size: 12px;
}

.schedule-table td {
  color: var(--canvas);
  font-size: 15px;
}

.schedule-table tbody tr:last-child td {
  border-bottom: 0;
}

.status {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 4px 10px;
  border: 1px solid currentColor;
  font-size: 12px;
  font-weight: 800;
}

.status.open {
  color: var(--primary);
}

.status.pending {
  color: #111111;
}

.status.soon {
  color: #606060;
}

.status.final {
  color: #8b8b8b;
}

.timeline {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-top: 1px solid var(--line);
}

.timeline article {
  padding: 32px 28px 0 0;
  border-right: 1px solid var(--line);
}

.timeline article:last-child {
  border-right: 0;
}

.timeline time {
  color: var(--primary);
  font-size: 42px;
  line-height: 1;
  font-weight: 900;
}

.timeline h3 {
  margin: 28px 0 12px;
}

.timeline p {
  color: var(--body);
}

.admin-page {
  min-height: 100vh;
  background: var(--canvas);
}

.admin-hero {
  width: min(100%, var(--max));
  margin: 0 auto;
  padding: 160px 48px 64px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 48px;
  align-items: end;
}

.admin-hero h1 {
  margin-bottom: 20px;
}

.admin-hero p:last-child {
  max-width: 720px;
  margin-bottom: 0;
  color: var(--body);
  font-size: 17px;
}

.admin-layout {
  width: min(100%, var(--max));
  margin: 0 auto;
  padding: 0 48px 96px;
  display: grid;
  grid-template-columns: 380px minmax(0, 1fr);
  gap: 32px;
  align-items: start;
}

.admin-form,
.admin-panel {
  border: 1px solid var(--line);
  background: var(--surface);
}

.admin-form {
  position: sticky;
  top: 96px;
  padding: 28px;
  display: grid;
  gap: 18px;
}

.admin-form-head,
.admin-panel-head {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: flex-start;
}

.admin-form h2,
.admin-panel h2 {
  font-size: 30px;
}

.admin-form label {
  display: grid;
  gap: 8px;
  color: var(--body);
  font-size: 13px;
  font-weight: 700;
}

.admin-form input,
.admin-form select {
  width: 100%;
  height: 46px;
  border: 1px solid var(--line);
  background: var(--canvas);
  color: var(--ink);
  padding: 0 14px;
  font: inherit;
}

.admin-form input:focus,
.admin-form select:focus {
  outline: 2px solid var(--primary);
  outline-offset: 0;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.text-button {
  border: 0;
  background: transparent;
  color: var(--primary);
  font: inherit;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
}

.admin-panel {
  padding: 28px;
  overflow: hidden;
}

.admin-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.compact-button {
  min-height: 40px;
  padding: 10px 14px;
  font-size: 12px;
  cursor: pointer;
}

.file-button {
  position: relative;
  overflow: hidden;
}

.file-button input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.admin-table-wrap {
  width: 100%;
  margin-top: 28px;
}

.admin-table {
  min-width: 980px;
}

.admin-table th:last-child,
.admin-table td:last-child {
  width: 132px;
}

.row-actions {
  display: flex;
  gap: 8px;
}

.row-actions button {
  min-height: 32px;
  padding: 6px 10px;
  border: 1px solid var(--line-light);
  background: var(--light);
  color: var(--canvas);
  font: inherit;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

.row-actions button:hover,
.row-actions button:focus-visible {
  border-color: var(--primary);
  color: var(--primary);
}

.admin-help {
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 13px;
}

@media (max-width: 980px) {
  .site-header {
    padding: 0 24px;
  }

  .nav-button {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
  }

  .nav-button span,
  .nav-button span::before,
  .nav-button span::after {
    width: 24px;
    height: 2px;
    display: block;
    background: var(--ink);
    content: "";
  }

  .nav-button span {
    position: relative;
  }

  .nav-button span::before,
  .nav-button span::after {
    position: absolute;
    left: 0;
  }

  .nav-button span::before {
    top: -8px;
  }

  .nav-button span::after {
    top: 8px;
  }

  .site-nav {
    position: fixed;
    top: 72px;
    left: 0;
    width: 100%;
    display: none;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 16px 24px 24px;
    background: var(--canvas);
    border-bottom: 1px solid var(--line);
  }

  .site-nav a {
    border-bottom: 1px solid var(--line);
  }

  .nav-toggle:checked ~ .site-nav {
    display: flex;
  }

  h1 {
    font-size: 64px;
  }

  h2 {
    font-size: 38px;
  }

  .section-grid,
  .section-grid.compact {
    grid-template-columns: 1fr;
    gap: 32px;
  }

  .series-grid,
  .standards-grid,
  .timeline {
    grid-template-columns: repeat(2, 1fr);
  }

  .metric-band {
    grid-template-columns: repeat(2, 1fr);
  }

  .race-row {
    grid-template-columns: 112px minmax(0, 1fr);
  }

  .race-row span {
    grid-column: 2;
    text-align: left;
  }

  .cta-band,
  .site-footer,
  .admin-hero,
  .admin-layout {
    grid-template-columns: 1fr;
  }

  .admin-layout {
    gap: 24px;
  }

  .admin-form {
    position: static;
  }

  .site-footer nav {
    flex-wrap: wrap;
  }

  .footer-note {
    text-align: left;
  }
}

@media (max-width: 640px) {
  .site-header,
  .section,
  .hero-content,
  .admin-hero,
  .admin-layout,
  .cta-band,
  .site-footer {
    padding-left: 20px;
    padding-right: 20px;
  }

  .brand {
    width: 118px;
  }

  .brand img {
    width: 118px;
  }

  .hero {
    min-height: 86vh;
  }

  .hero-content {
    padding-top: 128px;
    padding-bottom: 64px;
  }

  h1 {
    font-size: 44px;
  }

  h2 {
    font-size: 30px;
  }

  .hero-copy {
    font-size: 16px;
  }

  .button {
    width: 100%;
  }

  .metric-band,
  .series-grid,
  .standards-grid,
  .timeline {
    grid-template-columns: 1fr;
  }

  .metric {
    min-height: 140px;
    border-right: 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.24);
  }

  .race-row {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .race-row span {
    grid-column: auto;
  }

  .timeline article {
    padding: 28px 0;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .admin-hero {
    padding-top: 128px;
    padding-bottom: 40px;
  }

  .admin-layout {
    padding-bottom: 64px;
  }

  .admin-form,
  .admin-panel {
    padding: 20px;
  }

  .admin-form-head,
  .admin-panel-head,
  .admin-actions,
  .form-grid {
    display: grid;
    grid-template-columns: 1fr;
  }

  .admin-actions {
    justify-content: stretch;
  }
}
