:root {
  color-scheme: light;
  --ink: #18212f;
  --muted: #647084;
  --paper: #f6f1e8;
  --panel: rgba(255, 255, 255, 0.84);
  --line: rgba(24, 33, 47, 0.13);
  --green: #1b7f6a;
  --red: #c04a3a;
  --gold: #b98b34;
  --shadow: 0 24px 80px rgba(24, 33, 47, 0.16);
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  overflow: hidden;
}

body {
  margin: 0;
  height: 100svh;
  overflow: hidden;
  font-family:
    "PingFang SC",
    "Microsoft YaHei",
    "Hiragino Sans GB",
    ui-sans-serif,
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  color: var(--ink);
  background:
    linear-gradient(115deg, rgba(27, 127, 106, 0.16), transparent 38%),
    linear-gradient(245deg, rgba(192, 74, 58, 0.13), transparent 34%),
    radial-gradient(circle at 50% 120%, rgba(185, 139, 52, 0.22), transparent 44%),
    var(--paper);
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -2;
  content: "";
  background-image:
    linear-gradient(rgba(24, 33, 47, 0.055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(24, 33, 47, 0.055) 1px, transparent 1px);
  background-size: 72px 72px;
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.7), transparent 78%);
}

body::after {
  position: fixed;
  inset: auto 0 0;
  z-index: -1;
  height: 28vh;
  min-height: 180px;
  content: "";
  background:
    linear-gradient(180deg, transparent, rgba(24, 33, 47, 0.1)),
    repeating-linear-gradient(
      90deg,
      rgba(24, 33, 47, 0.11) 0 1px,
      transparent 1px 46px
    );
  clip-path: polygon(0 60%, 13% 44%, 28% 58%, 42% 32%, 58% 52%, 74% 24%, 100% 50%, 100% 100%, 0 100%);
}

.page-shell {
  display: grid;
  width: 100%;
  height: 100svh;
  max-height: 100svh;
  overflow: hidden;
  padding: clamp(18px, 4vw, 48px);
  place-items: center;
}

.countdown-panel {
  width: 100%;
  max-width: 1040px;
  min-width: 0;
  max-height: calc(100svh - clamp(36px, 8vw, 96px));
  padding: clamp(24px, 5vw, 56px);
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(20px);
}

.eyebrow {
  margin: 0 0 14px;
  color: var(--green);
  font-size: clamp(0.84rem, 1.4vw, 1rem);
  font-weight: 700;
  letter-spacing: 0;
}

h1 {
  margin: 0;
  color: var(--ink);
  font-size: clamp(3.1rem, 11vw, 9.2rem);
  font-weight: 900;
  line-height: 0.92;
  letter-spacing: 0;
}

.subtitle {
  max-width: 720px;
  margin: clamp(18px, 3vw, 28px) 0 0;
  color: var(--muted);
  font-size: clamp(1.05rem, 2vw, 1.35rem);
  line-height: 1.7;
}

.countdown-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  min-width: 0;
  gap: clamp(10px, 2vw, 18px);
  margin-top: clamp(34px, 6vw, 64px);
}

.time-tile {
  display: grid;
  min-width: 0;
  min-height: clamp(124px, 18vw, 188px);
  padding: clamp(16px, 2.6vw, 28px);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.58);
  align-content: center;
  gap: 10px;
}

.time-tile strong {
  display: block;
  font-variant-numeric: tabular-nums;
  font-size: clamp(2.3rem, 6.6vw, 5.4rem);
  font-weight: 900;
  line-height: 1;
}

.time-tile span {
  color: var(--muted);
  font-size: clamp(0.9rem, 1.5vw, 1.06rem);
  font-weight: 700;
}

.progress-block {
  margin-top: clamp(28px, 4vw, 46px);
}

.progress-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 12px;
  color: var(--muted);
  font-size: 0.98rem;
}

.progress-meta strong {
  color: var(--ink);
  font-weight: 700;
  text-align: right;
}

.progress-track {
  width: 100%;
  height: 12px;
  overflow: hidden;
  border: 1px solid rgba(24, 33, 47, 0.1);
  border-radius: 999px;
  background: rgba(24, 33, 47, 0.08);
}

.progress-track span {
  display: block;
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--green), var(--gold), var(--red));
  transition: width 500ms ease;
}

@media (max-width: 720px) {
  .page-shell {
    padding: 16px;
    place-items: center;
  }

  .countdown-panel {
    display: grid;
    width: 100%;
    max-width: 560px;
    max-height: calc(100svh - 32px);
    padding: clamp(18px, 5vw, 28px);
    align-content: center;
  }

  h1 {
    font-size: clamp(2.45rem, 12vw, 3rem);
  }

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

  .time-tile {
    min-height: 116px;
  }

  .progress-meta {
    align-items: flex-start;
    flex-direction: column;
    gap: 6px;
  }

  .progress-meta strong {
    text-align: left;
  }
}

@media (max-width: 520px) {
  .countdown-panel {
    max-width: 390px;
  }

  .countdown-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin-top: 24px;
  }

  .time-tile {
    min-height: 92px;
    padding: 14px;
    gap: 6px;
  }

  .time-tile strong {
    font-size: clamp(2rem, 12vw, 2.9rem);
  }

  .progress-block {
    margin-top: 22px;
  }
}

@media (max-height: 680px) {
  .countdown-panel {
    padding: 18px;
  }

  .subtitle {
    margin-top: 12px;
    line-height: 1.45;
  }

  .countdown-grid {
    margin-top: 20px;
  }

  .time-tile {
    min-height: 76px;
    padding: 12px;
  }

  .time-tile strong {
    font-size: clamp(1.8rem, 8vh, 3.2rem);
  }

  .progress-block {
    margin-top: 18px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}
