:root {
  color-scheme: light;
  font-family: Arial, "Microsoft YaHei", sans-serif;
  color: #102c3a;
  background: #f4f8f5;
  font-synthesis: none;
  letter-spacing: 0;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { min-width: 320px; background: #f4f8f5; }
body { margin: 0; min-height: 100vh; background: #f4f8f5; }
button, textarea, input, select { font: inherit; letter-spacing: 0; }
button, a { -webkit-tap-highlight-color: transparent; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

.redeem-page {
  width: min(100%, 720px);
  margin: 0 auto;
  padding: 32px 24px 40px;
}

.front-status {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: stretch;
  margin-bottom: 12px;
  overflow: hidden;
  border: 1px solid #b9c8c2;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 2px 4px rgba(18, 45, 37, .12);
}
.stock-status,
.announcement { display: flex; min-width: 0; align-items: center; gap: 8px; padding: 12px 14px; }
.stock-status { border-right: 1px solid #d3ddd9; color: #0d5f54; white-space: nowrap; }
.stock-status svg,
.announcement svg { width: 18px; height: 18px; flex: 0 0 auto; stroke-width: 2; }
.stock-status span { font-size: 14px; font-weight: 700; }
.stock-status strong { min-width: 2ch; color: #102c3a; font-size: 22px; line-height: 1; text-align: right; }
.announcement { color: #374f48; font-size: 14px; line-height: 1.5; }
.announcement svg { color: #225f9f; }
.announcement strong { color: #102c3a; }

.redeem-shell {
  padding: 16px;
  border: 1px solid #c9d3cf;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 2px 4px rgba(18, 45, 37, .16);
}

.redeem-form { display: grid; gap: 12px; }
.title-row { position: relative; min-height: 38px; display: flex; align-items: center; justify-content: center; }
.title-row h1 { margin: 0; color: #111; font-size: 30px; line-height: 1.2; font-weight: 800; }
.query-button { position: absolute; right: 0; top: 50%; transform: translateY(-50%); }

textarea {
  width: 100%;
  min-height: 96px;
  resize: vertical;
  border: 1px solid #aabbb5;
  border-radius: 8px;
  padding: 16px;
  outline: none;
  color: #0f2934;
  background: #fff;
  line-height: 1.5;
}
textarea:focus, input:focus, select:focus { border-color: #0f8f7a; box-shadow: 0 0 0 3px rgba(15, 143, 122, .13); }
.input-hint { margin: -4px 0 0; color: #667570; font-size: 12px; line-height: 1.45; font-weight: 600; }
.input-hint.invalid { color: #9b2c20; }

.button {
  display: inline-flex;
  min-height: 40px;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 8px 16px;
  cursor: pointer;
  text-decoration: none;
  font-weight: 700;
  transition: background-color .16s ease, border-color .16s ease, color .16s ease, transform .16s ease;
}
.button:hover { transform: translateY(-1px); }
.button:disabled { cursor: not-allowed; opacity: .58; transform: none; }
.button-primary { border-color: #0f6f62; background: #0f6f62; color: #fff; }
.button-primary:hover { background: #0b5d53; }
.button-blue { border-color: #225f9f; background: #225f9f; color: #fff; }
.button-blue:hover { background: #1b4f86; }
.button-outline { border-color: #b9c8c2; background: #fff; color: #0f6f62; }
.button-outline:hover { border-color: #0f6f62; background: #f2faf7; }
.button-soft { border-color: #89cdf1; background: #edf8ff; color: #17668e; }
.button-small { min-height: 36px; padding: 6px 13px; font-size: 14px; }
.button-icon svg { width: 17px; height: 17px; stroke-width: 2; }
.redeem-button { min-height: 48px; width: 100%; font-size: 16px; }

.notice { margin-top: 16px; border: 1px solid #9fd6bf; border-radius: 8px; padding: 12px; background: #f0fbf5; color: #164b36; text-align: center; font-size: 14px; font-weight: 700; }
.notice.error { border-color: #efb2a8; background: #fff5f3; color: #8b2618; }
.results { margin-top: 16px; display: grid; gap: 12px; border: 1px solid #b4d8e9; border-radius: 8px; padding: 16px; background: #f1f9fd; }
.results-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.results-head p { margin: 0; color: #225f9f; font-size: 14px; font-weight: 700; }
.results-head h2 { margin: 4px 0 0; color: #102c3a; font-size: 24px; line-height: 1.2; }
.result-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.result-list { display: grid; gap: 12px; }

.result-record { display: grid; gap: 12px; border: 1px solid #cfe3ed; border-radius: 8px; padding: 12px; background: #fff; }
.record-title { display: grid; grid-template-columns: 1fr auto 1fr; align-items: start; gap: 10px; }
.record-title-center { grid-column: 2; min-width: 0; text-align: center; }
.record-title-center p { margin: 0; color: #225f9f; font-size: 14px; font-weight: 700; }
.record-title-center h3 { margin: 5px 0 0; overflow-wrap: anywhere; color: #102c3a; font-family: Consolas, monospace; font-size: 19px; }
.record-title > .button { grid-column: 3; justify-self: end; }
.record-meta { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; color: #365149; font-size: 13px; }

.product-box { display: grid; gap: 12px; border: 1px solid #cfe3ed; border-radius: 8px; padding: 12px; background: #fbfdfe; }
.product-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 9px; }
.product-head h4 { margin: 0; font-size: 16px; }
.product-links { display: flex; flex-wrap: wrap; gap: 8px; }
.format-note { margin: 0; text-align: center; color: #365149; font-size: 13px; font-weight: 700; }
.credential-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.credential {
  min-width: 0;
  border: 1px solid #cfe3ed;
  border-radius: 16px;
  padding: 14px 16px;
  background: #fbfdff;
  box-shadow: 0 2px 3px rgba(17, 51, 68, .12);
}
.credential.wide { grid-column: 1 / -1; }
.credential-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.credential-label { margin: 0; color: #455d69; font-size: 12px; font-weight: 700; }
.credential-value { margin: 10px 0 0; overflow-wrap: anywhere; color: #061d2c; font-size: 15px; line-height: 1.45; font-weight: 800; }
.credential-value.account { font-size: 18px; }
.otp-card { box-shadow: none; }
.otp-value { font-family: Consolas, monospace; font-size: 26px; letter-spacing: 7px; }
.otp-remaining { color: #07803e; font-size: 12px; font-weight: 800; white-space: nowrap; }
.otp-copy { width: 100%; margin-top: 8px; }
.payload { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; color: #17352d; font: 600 14px/1.6 Consolas, monospace; }
.failed-list { border: 1px solid #efb2a8; border-radius: 8px; padding: 12px; background: #fff5f3; color: #8b2618; font-size: 14px; }
.failed-list p { margin: 5px 0; overflow-wrap: anywhere; }

.brand-poster { display: block; width: 100%; height: auto; margin-top: 22px; border: 1px solid #c9d3cf; border-radius: 8px; background: #fff; box-shadow: 0 2px 3px rgba(18, 45, 37, .16); }
.live-clock { display: block; margin-top: 25px; color: #10202b; text-align: center; font-family: Georgia, serif; font-size: 22px; font-weight: 800; }
.tutorial-link { display: flex; width: max-content; margin: 18px auto 0; }

@media (max-width: 640px) {
  .redeem-page { padding: 14px 10px 28px; }
  .front-status { grid-template-columns: 1fr; }
  .stock-status { justify-content: center; border-right: 0; border-bottom: 1px solid #d3ddd9; }
  .announcement { align-items: flex-start; }
  .redeem-shell { padding: 12px; }
  .title-row { justify-content: center; }
  .title-row h1 { font-size: 26px; }
  .query-button { font-size: 13px; padding-inline: 12px; }
  .results { padding: 12px; }
  .results-head { display: grid; }
  .result-actions { justify-content: flex-start; }
  .record-title { grid-template-columns: 1fr auto; }
  .record-title-center { grid-column: 1; text-align: left; }
  .record-title > .button { grid-column: 2; }
  .record-meta { grid-template-columns: 1fr; }
  .credential-grid { grid-template-columns: 1fr; }
  .credential.wide { grid-column: auto; }
  .product-head { align-items: flex-start; }
  .product-links { width: 100%; }
  .product-links .button { flex: 1; }
  .credential-value.account { font-size: 16px; }
}
