:root {
  color-scheme: light;
  --paper: #faf9f7;
  --ink: #24201d;
  --muted: #625b54;
  --line: #e9e4de;
  --accent: #af4315;
  --soft: #fff2e7;
  font-family: system-ui, -apple-system, "Microsoft YaHei", "PingFang SC", sans-serif;
}

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

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background: radial-gradient(ellipse at 50% 55px, #fff4e9 0, transparent 390px), var(--paper);
}

button, input, select, textarea { font: inherit; }
button:not(:disabled), summary { cursor: pointer; }
button:disabled { opacity: .58; }

.wrap {
  width: min(1040px, calc(100% - 48px));
  margin-inline: auto;
}

.top { border-bottom: 1px solid var(--line); background: #fff; }

.nav, .bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.nav { min-height: 63px; }
.brand { color: var(--ink); text-decoration: none; font-size: 18px; font-weight: 700; }

.tag, .eyebrow {
  display: inline-block;
  padding: 5px 11px;
  border-radius: 999px;
  background: var(--soft);
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
}

.intro { padding: 42px 0 31px; text-align: center; }
.eyebrow { margin: 0; letter-spacing: .1em; }

.intro h1 {
  margin: 10px 0 8px;
  font-size: clamp(32px, 5vw, 50px);
  line-height: 1.18;
  letter-spacing: -.055em;
}

.lead { margin: 0; color: var(--muted); line-height: 1.65; }

.mode-choice {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  margin-top: 23px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  box-shadow: 0 3px 10px #34200f06;
}

.mode-choice button {
  padding: 10px 24px;
  min-height: 42px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

.mode-choice button[aria-pressed="true"] { background: #282421; color: #fff; }
.mode-choice button[aria-pressed="false"]:hover:not(:disabled) { background: var(--soft); color: var(--accent); }

.layout {
  display: grid;
  grid-template-columns: minmax(0, 1.12fr) minmax(0, 1fr);
  align-items: start;
  gap: 22px;
}

.panel {
  border: 1px solid var(--line);
  border-radius: 20px;
  background: #fff;
  box-shadow: 0 12px 32px #36211108;
  overflow: hidden;
}

.panel-inner { padding: clamp(22px, 3.4vw, 36px); }

.panel h2, .faq h2 {
  margin: 0;
  font-size: 25px;
  line-height: 1.3;
  letter-spacing: -.025em;
}

.panel-lead { margin: 8px 0 24px; color: var(--muted); font-size: 14px; line-height: 1.65; }

label:not(.checkbox) { display: block; margin-bottom: 8px; font-size: 14px; font-weight: 700; }

.field-label span {
  margin-left: 4px;
  padding: 2px 6px;
  border-radius: 4px;
  background: #f5f1ed;
  color: var(--muted);
  font: 700 11px ui-monospace, monospace;
}

input:not([type="checkbox"]), textarea, select {
  width: 100%;
  min-height: 48px;
  padding: 12px 14px;
  border: 1px solid #dcd5ce;
  border-radius: 11px;
  background: #fffdfb;
  color: var(--ink);
  font-size: 16px;
}

textarea { resize: vertical; min-height: 82px; }
::placeholder { color: #777069; opacity: 1; font-size: 14px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.hint { margin: 8px 0 17px; color: var(--muted); font-size: 13px; line-height: 1.55; }

.button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  min-height: 48px;
  padding: 9px 16px;
  border: 1px solid transparent;
  border-radius: 11px;
  font-weight: 700;
}

.button span[aria-hidden="true"] { font-size: 19px; line-height: 1; }
.primary { background: linear-gradient(100deg, #b63e0f, #bf5114); color: #fff; }
.primary:hover:not(:disabled) { background: #a43c11; }
.secondary { border-color: var(--line); background: #fff; color: var(--accent); }
.secondary:hover:not(:disabled) { background: var(--soft); }
#refresh { margin-top: 14px; }

.panel-foot {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px clamp(22px, 3.4vw, 36px);
  border-top: 1px solid var(--line);
  background: #fcfaf7;
  color: var(--muted);
  font-size: 12px;
}

.panel-foot svg { flex: 0 0 auto; color: var(--accent); }
.guide h2 { color: var(--accent); }
.guide h3 { margin: 21px 0 7px; font-size: 15px; }
.guide p { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.65; }

.steps { list-style: none; display: grid; gap: 12px; padding: 0; margin: 16px 0 0; }
.steps li { display: flex; align-items: flex-start; gap: 11px; }
.steps p { min-width: 0; overflow-wrap: anywhere; }
.steps .num { border-color: #c45e2b; background: #fff; }
.guide-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 23px; }
.guide-actions .button { width: auto; min-height: 42px; padding: 8px 11px; font-size: 13px; text-decoration: none; }
.section-head p { margin: 4px 0 0; color: var(--muted); font-size: 13px; line-height: 1.6; }
.session-account { color: #205437; font-weight: 700; overflow-wrap: anywhere; }

.num {
  display: grid;
  place-items: center;
  width: 27px;
  height: 27px;
  flex: 0 0 27px;
  border: 1px solid #f0cfb8;
  border-radius: 50%;
  background: var(--soft);
  color: var(--accent);
  font: 700 13px ui-monospace, monospace;
}

.status {
  display: grid;
  gap: 4px;
  margin-top: 16px;
  padding: 13px 15px;
  border: 1px solid #d7e8db;
  border-radius: 11px;
  background: #eff8f0;
  color: #205437;
  font-size: 14px;
  line-height: 1.6;
  overflow-wrap: anywhere;
}

.status[data-type="waiting"] { border-color: #f0e0bb; background: #fff8e6; color: #73521c; }
.status[data-type="error"] { border-color: #f0d6cd; background: #fff1ed; color: #8a3021; }
.status[data-type="receipt"] { gap: 6px; border-color: var(--line); background: #fff; color: var(--muted); }
.receipt-heading { display: flex; align-items: center; justify-content: space-between; gap: 8px; color: var(--ink); }
.receipt-heading code { min-width: 0; }
.receipt-state { flex: 0 0 auto; border: 1px solid #f5d9b3; border-radius: 999px; padding: 2px 10px; background: var(--soft); color: var(--accent); }
.status[data-type="receipt"] p { margin: 0; }
.receipt-product { display: inline-block; margin-right: 8px; padding: 0 7px; border-radius: 5px; background: #e7f1dd; color: #315420; font-weight: 700; }

#redeem-form { margin-top: 21px; padding-top: 19px; border-top: 1px solid var(--line); }
.section-head { display: flex; gap: 10px; align-items: flex-start; margin-bottom: 16px; }
.section-head h3 { margin: 0; font-size: 16px; line-height: 1.55; }
#details { margin-top: 16px; }

.checkbox {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 14px 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
  cursor: pointer;
}

.checkbox input { margin: 2px 0 0; width: 16px; height: 16px; flex: 0 0 16px; accent-color: var(--accent); }
#session-consent { color: var(--ink); }

.faq { margin-top: 31px; }
.faq h2 { font-size: 21px; margin-bottom: 12px; }
.faq details { border-top: 1px solid var(--line); }
.faq details:last-child { border-bottom: 1px solid var(--line); }
.faq summary { padding: 13px 1px; font-size: 14px; font-weight: 600; }
.faq summary::marker { color: var(--accent); }
.faq p { margin: 0 0 15px 18px; color: var(--muted); font-size: 14px; line-height: 1.7; }

.demo {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 22px;
  padding: 14px 18px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: #fff;
}

.demo p { margin: 4px 0 0; color: var(--muted); font-size: 13px; }
.demo .button { width: auto; }
.bottom { flex-wrap: wrap; padding-block: 23px 28px; color: var(--muted); font-size: 12px; }

@media (max-width: 720px) {
  .wrap { width: min(540px, calc(100% - 32px)); }
  .nav { min-height: 57px; }
  .intro { padding: 32px 0 22px; }
  .lead { font-size: 14px; }
  .mode-choice { margin-top: 19px; }
  .layout { grid-template-columns: minmax(0, 1fr); gap: 15px; }
  .panel h2 { font-size: 22px; }
  .faq { margin-top: 25px; }
}
