:root {
  color-scheme: light;
  --ink: #2b160e;
  --red: #eb2c08;
  --red-dark: #841d09;
  --green: #04c96a;
  --green-dark: #083b2a;
  --harvest: #ffd43e;
  --signal: #f04f2f;
  --paper: #fff9e9;
  --field: #f7edd4;
  --line: #e3cfaa;
  --muted: #735f50;
  --shadow: 0 26px 80px rgba(91, 20, 7, 0.32);
  font-family: "PingFang SC", "Microsoft YaHei", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(circle at 15% 8%, rgba(255, 212, 62, 0.45), transparent 24%),
    radial-gradient(circle at 88% 92%, rgba(4, 201, 106, 0.42), transparent 30%),
    var(--red);
}

button,
input {
  font: inherit;
}

[hidden] {
  display: none !important;
}

.page-shell {
  width: min(100% - 32px, 720px);
  margin: 0 auto;
  padding: 28px 0 36px;
}

.lookup-card {
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.6);
  border-radius: 26px;
  background: var(--paper);
  box-shadow: var(--shadow);
}

.event-banner {
  position: relative;
  aspect-ratio: 1890 / 543;
  margin: 0;
  overflow: hidden;
  background: var(--red);
}

.event-banner::after {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 8px;
  background: linear-gradient(90deg, var(--green) 0 28%, var(--harvest) 28% 68%, #ff7c33 68%);
  content: "";
}

.event-banner img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.intro {
  padding: clamp(28px, 7vw, 52px) clamp(24px, 7vw, 56px) 28px;
  border-bottom: 1px solid var(--line);
  background:
    linear-gradient(90deg, var(--green) 0 12px, transparent 12px),
    var(--paper);
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--red);
  font-size: 0.95rem;
  font-weight: 800;
  letter-spacing: 0.18em;
}

h1 {
  margin: 0;
  font-family: "STKaiti", "KaiTi", "PingFang SC", serif;
  font-size: clamp(2rem, 7vw, 3.5rem);
  line-height: 1.08;
  letter-spacing: -0.04em;
}

.intro__copy {
  margin: 16px 0 0;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.7;
}

.staff-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px clamp(24px, 7vw, 56px);
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  background: #fff4d8;
  font-size: 0.85rem;
  font-weight: 750;
}

.staff-bar > div {
  display: flex;
  align-items: center;
  gap: 12px;
}

.text-button {
  padding: 0;
  border: 0;
  color: var(--red-dark);
  background: none;
  font: inherit;
  font-weight: 850;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

.lookup-form {
  display: grid;
  gap: 22px;
  padding: 28px clamp(24px, 7vw, 56px) 34px;
}

fieldset {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

legend,
.query-field > span {
  display: block;
  margin-bottom: 10px;
  font-size: 0.95rem;
  font-weight: 750;
}

.segmented-control {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  padding: 6px;
  border-radius: 16px;
  background: var(--field);
}

.segmented-control label {
  cursor: pointer;
}

.segmented-control input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.segmented-control span {
  display: grid;
  min-height: 52px;
  place-items: center;
  border: 2px solid transparent;
  border-radius: 12px;
  color: var(--muted);
  font-size: 1.05rem;
  font-weight: 800;
  transition: 160ms ease;
}

.segmented-control input:checked + span {
  color: #fff;
  background: var(--green-dark);
  box-shadow: 0 7px 18px rgba(26, 60, 45, 0.18);
}

.segmented-control input:focus-visible + span {
  outline: 3px solid rgba(240, 79, 47, 0.35);
  outline-offset: 2px;
}

.query-field input {
  width: 100%;
  min-height: 58px;
  padding: 0 17px;
  border: 2px solid var(--line);
  border-radius: 14px;
  color: var(--ink);
  background: #fff;
  font-size: 1.08rem;
  outline: none;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

.query-field input:focus {
  border-color: var(--signal);
  box-shadow: 0 0 0 4px rgba(240, 79, 47, 0.12);
}

.lookup-form button {
  min-height: 60px;
  border: 0;
  border-radius: 14px;
  color: var(--red-dark);
  background: var(--harvest);
  font-size: 1.15rem;
  font-weight: 900;
  letter-spacing: 0.04em;
  cursor: pointer;
  box-shadow: 0 9px 0 #d88800;
  transform: translateY(0);
  transition: transform 120ms ease, box-shadow 120ms ease, background 120ms ease;
}

.lookup-form button:hover {
  background: #ffc943;
}

.lookup-form button:active {
  box-shadow: 0 3px 0 #d88800;
  transform: translateY(6px);
}

.lookup-form button:focus-visible {
  outline: 3px solid var(--signal);
  outline-offset: 4px;
}

.result {
  min-height: 150px;
  padding: 30px clamp(24px, 7vw, 56px) 42px;
  color: #fff;
  background:
    linear-gradient(135deg, rgba(4, 201, 106, 0.14), transparent 36%),
    var(--green-dark);
}

.result-empty {
  display: flex;
  align-items: center;
  gap: 18px;
  min-height: 76px;
  color: rgba(255, 255, 255, 0.78);
}

.result-empty p {
  margin: 0;
  font-size: 1rem;
}

.result-empty__number {
  color: var(--harvest);
  font-size: 2.8rem;
  font-weight: 950;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.result-heading {
  margin: 0 0 18px;
  color: rgba(255, 255, 255, 0.8);
  font-size: 1rem;
  font-weight: 650;
}

.result-list {
  display: grid;
  gap: 14px;
}

.bib-card {
  display: grid;
  grid-template-columns: minmax(128px, 0.75fr) minmax(0, 1.25fr);
  overflow: hidden;
  border-radius: 18px;
  background: #fff;
  color: var(--ink);
}

.bib-number {
  display: flex;
  min-height: 184px;
  flex-direction: column;
  justify-content: center;
  padding: 22px;
  background: var(--harvest);
}

.bib-number span {
  font-size: 0.82rem;
  font-weight: 900;
  letter-spacing: 0.18em;
}

.bib-number strong {
  display: block;
  margin-top: 4px;
  color: var(--red-dark);
  font-size: clamp(3.4rem, 12vw, 5.6rem);
  font-weight: 950;
  line-height: 0.95;
  letter-spacing: -0.07em;
  font-variant-numeric: tabular-nums;
}

.bib-details {
  display: grid;
  align-content: center;
  gap: 14px;
  padding: 22px 24px;
}

.bib-content {
  display: grid;
  min-width: 0;
}

.claim-state,
.claim-control {
  margin: 0 24px 22px;
}

.claim-state {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 13px 15px;
  border-radius: 12px;
  font-size: 0.84rem;
}

.claim-state--done {
  color: #fff;
  background: var(--green-dark);
}

.claim-state span {
  color: rgba(255, 255, 255, 0.72);
  font-variant-numeric: tabular-nums;
}

.claim-control {
  position: relative;
  height: 54px;
  overflow: hidden;
  border-radius: 27px;
  background: #ebeadf;
}

.claim-track {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: var(--green-dark);
  font-size: 0.9rem;
  font-weight: 900;
  letter-spacing: 0.04em;
  pointer-events: none;
}

.claim-track span::after {
  margin-left: 8px;
  content: "››";
  color: var(--red);
  font-size: 1.2rem;
}

.claim-slider {
  --slide: 0%;
  position: absolute;
  inset: 0;
  width: 100%;
  height: 54px;
  margin: 0;
  appearance: none;
  background: linear-gradient(90deg, rgba(4, 201, 106, 0.35) var(--slide), transparent var(--slide));
  cursor: grab;
}

.claim-slider::-webkit-slider-thumb {
  width: 48px;
  height: 48px;
  border: 4px solid #fff;
  border-radius: 50%;
  appearance: none;
  background: var(--green-dark);
  box-shadow: 0 3px 12px rgba(8, 59, 42, 0.35);
}

.claim-slider::-moz-range-thumb {
  width: 40px;
  height: 40px;
  border: 4px solid #fff;
  border-radius: 50%;
  background: var(--green-dark);
  box-shadow: 0 3px 12px rgba(8, 59, 42, 0.35);
}

.claim-control.is-saving::after {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: #fff;
  background: var(--green-dark);
  content: "正在核销…";
  font-weight: 850;
}

.result-notice {
  margin-bottom: 14px;
  padding: 12px 14px;
  border-radius: 10px;
  color: var(--red-dark);
  background: var(--harvest);
  font-weight: 800;
}

.spinner {
  width: 34px;
  height: 34px;
  border: 4px solid rgba(255, 255, 255, 0.24);
  border-top-color: var(--harvest);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.detail-row {
  display: grid;
  gap: 3px;
}

.detail-row span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
}

.detail-row strong {
  overflow-wrap: anywhere;
  font-size: 1.08rem;
}

.not-found {
  padding: 22px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.07);
}

.not-found strong {
  display: block;
  color: var(--harvest);
  font-size: 1.15rem;
}

.not-found p {
  margin: 8px 0 0;
  color: rgba(255, 255, 255, 0.78);
  line-height: 1.6;
}

footer {
  margin-top: 16px;
  color: rgba(255, 255, 255, 0.72);
  font-size: 0.86rem;
  line-height: 1.6;
  text-align: center;
}

@media (max-width: 560px) {
  .page-shell {
    width: min(100% - 20px, 720px);
    padding-top: 18px;
  }

  .lookup-card {
    border-radius: 20px;
  }

  .event-banner {
    aspect-ratio: 1.75 / 1;
  }

  .bib-card {
    grid-template-columns: 1fr;
  }

  .bib-number {
    min-height: 132px;
  }

  .bib-number strong {
    font-size: 4.8rem;
  }

  .staff-bar {
    align-items: flex-start;
  }

  .staff-bar > div {
    flex-direction: column;
    align-items: flex-end;
    gap: 6px;
  }

  .claim-state {
    align-items: flex-start;
    flex-direction: column;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition: none !important;
  }
}
