:root {
  color-scheme: light;
  --ink: #202522;
  --muted: #6f756f;
  --paper: #f6f3ec;
  --white: #fff;
  --red: #2f7968;
  --pink: #ded7cf;
  --yellow: #d8d1c8;
  --green: #2f7968;
  --line: #202522;
  --soft: #ebe7df;
  --spirit: #2f7968;
}
* { box-sizing: border-box; }
html, body { margin: 0; width: 100%; height: 100%; overflow: hidden; }
body {
  background: var(--paper);
  color: var(--ink);
  font-family: "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}
button { font: inherit; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.landing {
  position: relative;
  width: min(100%, 560px);
  height: 100svh;
  min-height: 560px;
  margin: 0 auto;
  padding: 0 max(16px, env(safe-area-inset-right)) max(8px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
  display: grid;
  grid-template-rows: 52px minmax(150px, 1.12fr) minmax(94px, .58fr) minmax(238px, 1.35fr) 66px;
  gap: 10px;
  overflow: hidden;
}
.topbar { display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid #eadfd8; }
.brand { display: flex; align-items: center; gap: 9px; }
.brand-mark { width: 38px; height: 38px; display: block; position: relative; flex: 0 0 auto; }
.brand-mark img { display: block; width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }
.brand strong { font-size: 16px; letter-spacing: .5px; }
.safe-pill { padding: 5px 9px; border-radius: 999px; background: #e0ebe6; color: #285f53; font-size: 10px; font-weight: 800; }
.hero {
  position: relative; display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(122px, .85fr);
  align-items: center; gap: 12px; min-height: 0;
}
.hero-copy { min-width: 0; }
.eyebrow {
  display: inline-block; padding: 4px 9px;
  border: 1px solid #c9c4bc; border-radius: 999px; background: #ece9e2;
  font-size: 10px; font-weight: 900;
}
.hero h1 { margin: 10px 0 6px; font-size: clamp(27px, 7.8vw, 40px); line-height: 1.02; letter-spacing: -1.5px; }
.hero h1 em { color: var(--red); font-style: normal; }
.hero p { margin: 0; max-width: 280px; color: var(--muted); font-size: 11px; line-height: 1.45; font-weight: 600; }
.gift-card {
  position: relative; min-height: 118px; padding: 14px 8px 11px; transform: rotate(2deg);
  border: 2px solid var(--line); border-radius: 14px; background: var(--pink);
  box-shadow: 5px 6px 0 rgba(32,37,34,.14); text-align: center;
}
.spirit-ears { position: absolute; z-index: -1; left: 37px; right: 37px; top: -19px; height: 30px; }
.spirit-ears i { position: absolute; width: 26px; height: 30px; background: var(--pink); border: 2px solid var(--line); transform: rotate(45deg); border-radius: 4px 12px 4px 12px; }
.spirit-ears i:first-child { left: 0; }.spirit-ears i:last-child { right: 0; transform: rotate(45deg) scale(-1, 1); }
.spirit-tail { position: absolute; right: -25px; bottom: 4px; width: 39px; height: 63px; border: 7px solid var(--spirit); border-left-color: transparent; border-radius: 50%; transform: rotate(17deg); }
.spirit-tail::after { content: ""; position: absolute; right: 1px; top: -9px; width: 10px; height: 10px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 4px rgba(47,121,104,.15); }
.gift-label {
  position: absolute; top: -10px; left: 50%; transform: translateX(-50%) rotate(-3deg);
  width: max-content; padding: 3px 8px; border: 1.5px solid var(--line); border-radius: 999px;
  background: var(--white); font-size: 9px; font-weight: 900;
}
.gift-card strong {
  display: block; margin-top: 7px; color: var(--red); font-family: Arial, sans-serif;
  font-size: clamp(24px, 7vw, 36px); line-height: 1; font-weight: 900; letter-spacing: -1px;
}
.gift-card b { display: block; margin-top: 5px; font-size: 12px; }
.gift-card i { display: inline-block; margin-top: 7px; padding: 3px 8px; border-radius: 999px; background: var(--red); color: #fff; font-size: 9px; font-style: normal; font-weight: 900; }
.spark { position: absolute; color: var(--red); font-size: 18px; }
.spark-one { right: 36%; top: 12%; transform: rotate(12deg); }
.spark-two { right: 2%; bottom: 2%; color: var(--green); transform: rotate(-12deg); }
.benefits { display: grid; grid-template-columns: repeat(2, 1fr); gap: 7px; min-height: 0; }
.benefits article {
  min-width: 0; display: flex; align-items: center; gap: 7px; padding: 8px 9px;
  border: 1.5px solid #d9cbd0; border-radius: 12px; background: #fff; box-shadow: 2px 3px 0 rgba(89,71,79,.13);
}
.benefits article:nth-child(2), .benefits article:nth-child(4) { background: #efede7; }
.benefits article:nth-child(3) { background: #e6eee9; }
.benefits article > span {
  flex: 0 0 auto; width: 27px; height: 27px; display: grid; place-items: center;
  border: 1px solid #c9c5bd; border-radius: 50%; background: #f8f6f1;
  color: var(--green); font-size: 11px; font-weight: 900;
}
.benefits article > div { min-width: 0; }
.benefits b, .benefits small { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.benefits b { font-size: 12px; }
.benefits small { margin-top: 2px; color: var(--muted); font-size: 7.5px; font-weight: 600; }
.bind-card {
  position: relative; min-height: 0; margin-top: 3px; border: 2px solid var(--line);
  border-radius: 17px; background: #fff; box-shadow: 5px 7px 0 rgba(89,71,79,.18); overflow: hidden;
}
.card-ribbon { height: 34px; display: flex; align-items: center; gap: 8px; padding: 0 12px; background: var(--green); color: #fff; }
.card-ribbon b { padding: 3px 7px; border-radius: 4px; background: #fff; color: var(--red); font-size: 9px; }
.card-ribbon span { font-size: 10px; font-weight: 800; }
.state { height: calc(100% - 65px); min-height: 0; padding: 13px 13px 8px; }
.state-idle { display: grid; grid-template-columns: 82px minmax(0, 1fr); grid-template-rows: minmax(82px, 1fr) 42px; align-items: center; column-gap: 12px; }
.state-copy h2, .qr-copy h2 { margin: 0; font-size: 18px; line-height: 1.15; }
.state-copy p, .qr-copy p { margin: 6px 0 0; color: var(--muted); font-size: 10px; line-height: 1.45; }
.state button {
  height: 40px; border: 2px solid var(--line); border-radius: 9px; background: var(--green);
  box-shadow: 3px 3px 0 var(--line); color: #fff; font-size: 12px; font-weight: 900;
}
.state button:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--line); }
.state button:disabled { opacity: .62; cursor: wait; }
.state-idle button { grid-column: 1/-1; width: 100%; margin-top: 4px; }
.scan-visual {
  width: 76px; height: 76px; position: relative; display: grid; place-items: center;
  border: 1px solid #d8d5ce; border-radius: 18px; background: #f7f5ef; color: var(--green);
}
.scan-corners { position: absolute; inset: 10px; }
.scan-corners i { position: absolute; width: 16px; height: 16px; border-color: var(--green); border-style: solid; }
.scan-corners i:nth-child(1) { left: 0; top: 0; border-width: 2px 0 0 2px; border-radius: 4px 0 0; }
.scan-corners i:nth-child(2) { right: 0; top: 0; border-width: 2px 2px 0 0; border-radius: 0 4px 0 0; }
.scan-corners i:nth-child(3) { left: 0; bottom: 0; border-width: 0 0 2px 2px; border-radius: 0 0 0 4px; }
.scan-corners i:nth-child(4) { right: 0; bottom: 0; border-width: 0 2px 2px 0; border-radius: 0 0 4px; }
.scan-cat { position: relative; z-index: 1; width: 56px; height: 56px; border-radius: 50%; object-fit: cover; }
.scan-visual em { position: absolute; bottom: 3px; font-size: 6.5px; font-style: normal; font-weight: 900; }
.state-qr { display: grid; grid-template-columns: minmax(132px, 48%) 1fr; align-items: center; gap: 14px; }
.state-qr img { width: min(100%, 175px); aspect-ratio: 1; object-fit: contain; border: 7px solid #edf2ee; border-radius: 8px; }
.scan-badge { display: inline-block; margin-bottom: 8px; padding: 4px 8px; border-radius: 999px; background: #dff8e9; color: #08733e; font-size: 9px; font-weight: 900; }
.qr-copy strong { display: block; margin-top: 10px; color: var(--red); font-size: 22px; font-variant-numeric: tabular-nums; }
.state-result { display: grid; grid-template-columns: 58px 1fr; grid-template-rows: 1fr 42px; align-items: center; gap: 8px 12px; }
.result-icon {
  width: 54px; height: 54px; display: grid; place-items: center; border: 2px solid var(--line);
  border-radius: 50%; background: var(--green); box-shadow: 3px 3px 0 var(--line); color: #fff; font-size: 27px; font-weight: 900;
}
.state-result.error .result-icon { background: var(--red); }
.state-result button { grid-column: 1/-1; width: 100%; }
.trust-row {
  position: absolute; left: 0; right: 0; bottom: 0; height: 31px; display: flex;
  align-items: center; justify-content: center; gap: 10px; border-top: 1px dashed #dbcfc7;
  background: #fffaf6; color: #716660; font-size: 7.5px; font-weight: 700;
}
footer { display: grid; grid-template-columns: auto 1fr auto 1fr auto; align-items: center; gap: 6px; padding-top: 3px; color: #716660; font-size: 9px; }
footer span { display: flex; align-items: center; gap: 4px; white-space: nowrap; }
footer b { width: 19px; height: 19px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 50%; background: #fff; color: var(--ink); font-size: 8px; }
footer i { height: 1px; background: #d8cbc3; }
footer small { grid-column: 1/-1; text-align: center; color: #a1948c; font-size: 7px; }
[hidden] { display: none !important; }
@media (max-width: 355px) {
  .landing { padding-left: 12px; padding-right: 12px; gap: 7px; }
  .hero h1 { font-size: 26px; }
  .gift-card strong { font-size: 24px; }
  .benefits article { padding: 7px 6px; }
  .benefits article > span { font-size: 18px; }
  .trust-row { gap: 6px; font-size: 7px; }
}
@media (max-height: 700px) {
  .landing { grid-template-rows: 46px minmax(130px, .9fr) 82px minmax(218px, 1.25fr) 55px; gap: 7px; }
  .topbar .brand-mark { width: 28px; height: 28px; }
  .hero h1 { margin: 7px 0 4px; }
  .hero p { font-size: 10px; }
  .gift-card { min-height: 104px; padding-top: 12px; }
  .benefits article { padding-top: 6px; padding-bottom: 6px; }
  .state { padding-top: 9px; }
  .state-idle { grid-template-rows: minmax(72px, 1fr) 38px; }
  .scan-visual { width: 68px; height: 68px; }
  .state button { height: 37px; }
  .trust-row { height: 27px; }
  .card-ribbon { height: 31px; }
  .state { height: calc(100% - 58px); }
  footer small { display: none; }
}
@media (min-width: 700px) {
  .landing { width: min(100%, 980px); grid-template-columns: 1fr 1fr; grid-template-rows: 58px minmax(190px, .9fr) minmax(126px, .55fr) 78px; column-gap: 38px; }
  .topbar { grid-column: 1/-1; }
  .hero { grid-column: 1; grid-row: 2; }
  .benefits { grid-column: 1; grid-row: 3; }
  .bind-card { grid-column: 2; grid-row: 2/4; margin: 0; }
  .landing footer { grid-column: 1/-1; grid-row: 4; }
  .hero h1 { font-size: 46px; }
  .gift-card { min-height: 145px; }
  .state-idle { grid-template-columns: 110px 1fr; grid-template-rows: minmax(120px, 1fr) 50px; }
  .scan-visual { width: 102px; height: 102px; }
  .state button { height: 46px; }
  .state-copy h2, .qr-copy h2 { font-size: 22px; }
  .state-qr img { width: 230px; }
  .state-qr { grid-template-columns: 230px 1fr; }
}
@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; } }
