:root {
  color-scheme: light;
  --bg: #f5f7f4;
  --paper: #fff;
  --ink: #1b2b24;
  --muted: #52645b;
  --line: #dce5dc;
  --strong-line: #7b8c80;
  --brand: #284e3c;
  --deep: #18392d;
  --focus: #286b49;
  --lime: #e0f8a9;
  --body-font: "Inter", "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", system-ui, sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 1rem/1.65 var(--body-font);
  -webkit-font-smoothing: antialiased;
}

h1, h2, p { margin: 0; }
a { color: inherit; }
button, input { font: inherit; }
button, summary { cursor: pointer; }
button:disabled { cursor: wait; }
fieldset:disabled button { cursor: default; }

:where(a, button, input, summary):focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 4px;
}

.container {
  width: min(100% - 3rem, 68rem);
  margin-inline: auto;
}

.skip-link {
  position: fixed;
  z-index: 5;
  inset: .75rem auto auto .75rem;
  padding: .6rem .9rem;
  border-radius: .5rem;
  background: var(--paper);
  transform: translateY(-180%);
}

.skip-link:focus { transform: none; }
.site-header { border-bottom: 1px solid var(--line); }

.header-inner,
.brand,
.site-header nav,
.footer-inner {
  display: flex;
  align-items: center;
}

.header-inner {
  min-height: 4.5rem;
  justify-content: space-between;
  gap: .75rem;
}

.brand {
  flex: none;
  gap: .7rem;
  text-decoration: none;
  font-weight: 750;
}

.brand-mark {
  display: grid;
  place-items: center;
  position: relative;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: .7rem;
  background: var(--brand);
}

.brand-mark::before,
.brand-mark::after {
  content: "";
  position: absolute;
  width: .74rem;
  height: .53rem;
  border: 1.5px solid var(--lime);
  border-radius: .16rem;
}

.brand-mark::before { transform: translate(-.14rem, -.15rem); }
.brand-mark::after { transform: translate(.14rem, .15rem); }
.site-header nav { gap: clamp(.75rem, 3vw, 1.75rem); }

.site-header nav a {
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
  text-decoration: none;
  color: var(--muted);
  font-size: .9rem;
  font-weight: 650;
  white-space: nowrap;
}

.site-header nav a:hover { color: var(--ink); }

.intro { padding-block: 3.75rem 2.25rem; }
.intro h1 {
  font-size: clamp(2.05rem, 6.2vw, 4.4rem);
  line-height: 1.11;
  letter-spacing: -.055em;
  font-weight: 780;
}

.intro h1 span { color: var(--brand); letter-spacing: -.04em; }
.intro p {
  margin-top: 1rem;
  max-width: 35rem;
  color: var(--muted);
  font-size: clamp(1rem, 2vw, 1.15rem);
}

.service-grid {
  display: grid;
  grid-template-columns: 1.55fr 1fr;
  align-items: stretch;
  gap: 1.25rem;
}

.card {
  min-width: 0;
  padding: clamp(1.25rem, 3.25vw, 2rem);
  border: 1px solid var(--line);
  border-radius: 1.25rem;
  background: var(--paper);
}

.lookup {
  scroll-margin-top: 1rem;
  box-shadow: 0 10px 34px #173a2110;
}

.card-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .5rem;
  margin-bottom: 1rem;
}

.card h2, .help h2 {
  font-size: clamp(1.2rem, 2.7vw, 1.55rem);
  line-height: 1.25;
  letter-spacing: -.028em;
}

.service-state {
  flex: none;
  border-radius: 1rem;
  padding: .25rem .65rem;
  background: #edf2ec;
  color: #43594b;
  font-size: .845rem;
  font-weight: 700;
}

.service-state[data-ready="true"] { background: #e5f5e6; color: #205738; }

.mode {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .25rem;
  padding: .25rem;
  border-radius: .7rem;
  background: #edf2ec;
}

.mode button {
  min-height: 2.75rem;
  padding: .5rem .6rem;
  border: 1px solid transparent;
  border-radius: .5rem;
  background: transparent;
  color: var(--muted);
  font-weight: 670;
}

.mode button[aria-pressed="true"] {
  border-color: var(--line);
  background: var(--paper);
  color: var(--ink);
  box-shadow: 0 2px 5px #17271909;
}

.mode button:hover:not(:disabled) { color: var(--ink); }

fieldset { min-width: 0; margin: 1.1rem 0 0; padding: 0; border: 0; }
label { display: block; margin-bottom: .45rem; font-weight: 700; }

.input-wrap {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  min-height: 3.2rem;
  border: 1px solid var(--strong-line);
  border-radius: .7rem;
  background: var(--paper);
}

.input-wrap:focus-within { border-color: var(--focus); }
.input-wrap:has([aria-invalid="true"]) { border-color: #a64231; }
fieldset:disabled .input-wrap { border-color: var(--line); background: #f8faf7; }

.input-wrap input {
  width: 100%;
  min-height: 3.125rem;
  padding: .55rem .25rem .55rem .8rem;
  border: 0;
  border-radius: .65rem 0 0 .65rem;
  background: transparent;
  color: var(--ink);
}

.input-wrap input::placeholder { color: #65766d; opacity: 1; }
.reveal {
  min-width: 3.25rem;
  min-height: 2.75rem;
  margin-inline: .3rem;
  padding: .35rem .5rem;
  border: 0;
  border-radius: .45rem;
  color: var(--brand);
  background: transparent;
  font-size: .9rem;
  font-weight: 650;
}

.reveal:hover:not(:disabled) { background: #edf2ec; }
.reveal:disabled { color: var(--muted); }
.hint { margin-top: .4rem; color: var(--muted); font-size: .9rem; }

.submit,
.official-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 3.05rem;
  border: 1px solid transparent;
  border-radius: .7rem;
  padding: .65rem 1.15rem;
  font-weight: 730;
  text-decoration: none;
  transition: background-color 160ms ease, border-color 160ms ease;
}

.submit {
  width: 100%;
  margin-top: 1.1rem;
  color: var(--paper);
  background: var(--brand);
}

.submit:hover:not(:disabled) { background: var(--deep); }
.submit:disabled { color: #4f6357; background: #e7ede6; }

.feedback:not(:empty) { margin-top: 1rem; }
.feedback {
  border-radius: .65rem;
  color: #345142;
  background: #eef4ef;
}

.feedback:not(:empty) { padding: .75rem .85rem; }
.feedback[data-tone="success"] { color: #205738; background: #e9f6e8; }
.feedback[data-tone="error"] { color: #913129; background: #fff1ec; }
.feedback p { margin-top: .15rem; font-size: .9rem; }

.tracking {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .6rem 1rem;
  flex-wrap: wrap;
  margin-top: .8rem;
  color: var(--muted);
  font-size: .9rem;
}

.lookup-action {
  min-height: 2.75rem;
  padding: .45rem .72rem;
  border: 1px solid var(--strong-line);
  border-radius: .55rem;
  color: var(--brand);
  background: var(--paper);
  font-size: .9rem;
  font-weight: 680;
}

#check-used { margin-top: .8rem; }
.lookup-action:hover { background: #edf2ec; }

.lookup-mode { margin-top: 1rem; }
.redeem-input, #session-json {
  display: block;
  width: 100%;
  min-height: 3.1rem;
  padding: .65rem .8rem;
  border: 1px solid var(--strong-line);
  border-radius: .65rem;
  background: var(--paper);
  color: var(--ink);
  font: inherit;
}
#session-json { resize: vertical; font: .9rem/1.6 Consolas, monospace; }
.session-label { display: flex; flex-wrap: wrap; gap: .25rem .8rem; justify-content: space-between; align-items: center; margin-top: 1rem; }
.session-label label { margin-bottom: .4rem; }
.session-label a { min-height: 2.75rem; display: inline-flex; align-items: center; font-size: .9rem; color: var(--brand); }
.account-preview { margin-top: .6rem; padding: .6rem .75rem; border-radius: .5rem; background: #eef4ef; overflow-wrap: anywhere; }
.account-preview strong { display: block; margin-top: .15rem; font-size: 1.08rem; color: var(--ink); }
.account-preview[data-error="true"], .redeem-error { color: #913129; background: #fff1ec; }
.session-notice { margin-top: .8rem; color: var(--muted); font-size: .9rem; }
.redeem-steps { display: grid; grid-template-columns: 1fr 1fr; list-style: none; padding: 0; margin: 1.2rem 0 0; gap: .7rem; color: var(--muted); font-size: .9rem; }
.redeem-steps li { padding-bottom: .45rem; border-bottom: 2px solid var(--line); }
.redeem-steps [aria-current="step"] { color: var(--brand); border-color: var(--brand); font-weight: 750; }
.verified-card-summary { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .6rem; margin-top: 1rem; color: var(--muted); font-size: .9rem; }
#recover-order { margin-top: .65rem; width: 100%; }
.redeem-error { margin-top: 1rem; padding: .7rem .8rem; border-radius: .6rem; }
.redemption-result { margin-top: 1rem; padding: 1rem; border: 1px solid var(--line); border-radius: .7rem; background: #f0f6ef; }
.redemption-result h3 { font-size: 1.1rem; margin: 0 0 .35rem; }
.redemption-result[data-tone="error"] { background: #fff1ec; }
.redemption-result p { overflow-wrap: anywhere; }
.redemption-actions { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .65rem; }
.redemption-actions button { flex-grow: 1; }

.official {
  align-self: start;
  min-height: 22rem;
  position: relative;
  isolation: isolate;
  overflow: hidden;
  border-color: transparent;
  background: var(--deep);
  color: #f6f9f2;
}

.official-content { position: relative; z-index: 1; }
.official h2 { font-size: clamp(1.3rem, 2.8vw, 1.65rem); }
.official p { max-width: 17.75rem; margin-top: .7rem; color: #d8e8db; }

.official-link {
  margin-top: 1.25rem;
  background: var(--lime);
  color: #193b27;
}

.official-link:hover { background: #eefbcf; }
.official-link:focus-visible { outline-color: var(--lime); }

.official-art {
  position: absolute;
  width: 13rem;
  height: 13rem;
  right: -3.25rem;
  bottom: -5.2rem;
  rotate: -19deg;
  border: 1px solid #aacabb45;
  border-radius: 2.2rem;
  background-color: #284e3c;
  background-image: radial-gradient(circle at center, #c1e8a94a 1px, transparent 1.2px);
  background-size: 11px 11px;
}

.official-art::before,
.official-art::after {
  content: "";
  position: absolute;
  border: 1px solid #aacabb4a;
  border-radius: 2rem;
}

.official-art::before { inset: .85rem; }
.official-art::after { inset: 1.6rem; }

.help {
  margin-block: 3.25rem 3rem;
  scroll-margin-top: 1rem;
}

.questions {
  margin-top: .85rem;
  border-block: 1px solid var(--line);
}

.questions details + details { border-top: 1px solid var(--line); }

summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 3.5rem;
  gap: 1rem;
  padding: .7rem .3rem;
  list-style: none;
  font-weight: 670;
}

summary::-webkit-details-marker { display: none; }
summary::after {
  content: "";
  flex: none;
  width: .6rem;
  height: .6rem;
  margin-right: .28rem;
  border: solid var(--brand);
  border-width: 0 1.5px 1.5px 0;
  transform: rotate(45deg) translate(-.1rem, -.1rem);
}

details[open] summary::after { transform: rotate(225deg); }
details p { padding: 0 1.75rem .9rem .3rem; color: var(--muted); }

.site-footer { border-top: 1px solid var(--line); color: var(--muted); }
.footer-inner {
  min-height: 4rem;
  gap: .8rem 1.25rem;
  justify-content: space-between;
  flex-wrap: wrap;
  padding-block: .6rem;
  font-size: .9rem;
}

@media (max-width: 46rem) {
  .container { width: min(100% - 2rem, 34rem); }
  .header-inner { min-height: 3.75rem; }
  .intro { padding-block: 2.5rem 1.65rem; }
  .service-grid { grid-template-columns: 1fr; gap: .95rem; }
  .official p { max-width: min(18rem, 90%); }
  .official-art { right: -6rem; bottom: -8rem; }
  .help { margin-block: 2.45rem 2rem; }
}

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