:root {
  color-scheme: light;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  color: #39201a;
  background: #fbede5;
  font-synthesis: none;
}
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0 auto; max-width: 480px; min-height: 100vh; min-height: 100dvh; background: linear-gradient(#fff5ec 0%, #ffe2d5 42%, #fff7ef 80%, #fff8f2 100%); }
button, input { font: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid #a0372a; outline-offset: 3px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.site-header { position: relative; display: grid; place-items: center; min-height: 58px; padding: 8px 64px; padding-top: max(8px, env(safe-area-inset-top)); }
.site-header h1 { font-size: 1.19rem; letter-spacing: .04em; margin: 0; }
.rule-button { position: absolute; right: 13px; top: 8px; background: transparent; border: 0; color: #79463a; padding: 10px; min-height: 42px; font-size: .9rem; }
.stage { padding: 0 22px max(22px, env(safe-area-inset-bottom)); }
.hero { position: relative; isolation: isolate; display: grid; place-items: center; min-height: 205px; height: clamp(230px, 46svh, 393px); }
.hero::before { content: ""; position: absolute; z-index: -1; inset: 0 -16px; background: radial-gradient(ellipse at center, #ffbba287, transparent 69%); }
.envelope { position: relative; isolation: isolate; overflow: hidden; width: min(79vw, 33svh, 330px); height: 91%; border-radius: clamp(20px, 6vw, 29px); border: 1px solid #b93126; background: linear-gradient(153deg, #f3624c 0%, #dc4235 40%, #bd2b27 100%); box-shadow: 0 24px 44px #9c322647, inset 0 0 0 1px #ffb18732; }
.envelope::before, .envelope::after { content: ""; position: absolute; z-index: -1; width: 156%; aspect-ratio: 1; border: 1px solid #ffc29466; border-radius: 50%; transform: rotate(-22deg) scaleY(.57); right: -85%; bottom: -51%; }
.envelope::after { right: -112%; bottom: -36%; }
.envelope:disabled { cursor: default; opacity: 1; }
.envelope-flap { position: absolute; inset: 0 -5% auto; height: 48%; background: linear-gradient(155deg, #ff7658, #dc3b31 75%); border-radius: 0 0 49% 49% / 0 0 60% 60%; border-bottom: 1px solid #ffb486ba; box-shadow: 0 10px 20px #a024234d; }
.envelope-seal { position: absolute; top: 48%; left: 50%; transform: translate(-50%, -53%); width: clamp(56px, 17vw, 76px); aspect-ratio: 1; display: grid; place-items: center; border-radius: 50%; background: linear-gradient(145deg, #ffe6a4, #e9ad54); border: 2px solid #f8ce82; box-shadow: 0 5px 12px #8b251f60, inset 0 0 0 2px #a96928a6; color: #8c3c1b; font-family: "Songti SC", SimSun, serif; font-size: clamp(29px, 8vw, 37px); font-weight: 700; }
.packet-title { position: absolute; inset: 7% 0 auto; max-width: min(63vw, 27svh, 275px); margin: 0 auto; text-align: center; text-wrap: balance; overflow-wrap: anywhere; color: #fff0ce; text-shadow: 0 1px 5px #7b1c15; font-size: clamp(1rem, 5vw, 1.28rem); font-weight: 730; line-height: 1.23; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; overflow: hidden; }
.claim { position: relative; max-width: 365px; margin: 13px auto 0; }
.field + .field { margin-top: 10px; }
.field input { width: 100%; min-height: 52px; padding: 0 16px; background: #fffdf9; border: 1px solid #e9c5b7; border-radius: 13px; color: inherit; font-size: 1rem; }
.field input::placeholder { color: #805e54; opacity: 1; }
.field input:focus { outline: 2px solid #c94231; outline-offset: 1px; background: white; }
.claim-button { margin-top: 14px; border: 0; border-radius: 14px; min-height: 54px; width: 100%; padding: 10px 20px; background: linear-gradient(105deg, #cf3a29, #b72b22); box-shadow: 0 7px 16px #b4383040; color: white; font-weight: 750; font-size: 1.12rem; letter-spacing: .08em; }
.claim-button:hover { background: #ad2821; }
.claim-button:disabled { opacity: .75; cursor: wait; }
.form-note { text-align: center; color: #76564d; margin: 15px 0 0; font-size: .82rem; line-height: 1.55; }
.message { margin: 12px 0 0; padding: 10px 12px; border-radius: 10px; background: #fce3d9; color: #8f2f25; line-height: 1.5; font-size: .9rem; }
.result { background: #fffaf3; border: 1px solid #efd6c2; border-radius: 19px; padding: 19px 20px; text-align: center; overflow-wrap: anywhere; }
.result p { color: #6c5048; margin: 8px 0 0; }
.result .result-title { font-weight: 750; color: #973425; margin: 0; }
.amount { display: flex; align-items: baseline; justify-content: center; gap: 7px; color: #b83125; line-height: 1.05; padding: 7px 0 2px; font-variant-numeric: tabular-nums; }
.amount strong { font-size: 3.25rem; letter-spacing: -.055em; }
dialog { width: min(420px, calc(100% - 28px)); border: 1px solid #eed5c6; border-radius: 22px; color: #30211e; padding: 22px; background: #fffdfb; box-shadow: 0 30px 70px #49241643; }
dialog::backdrop { background: #2f15136b; }
.dialog-heading { display: flex; justify-content: space-between; align-items: center; }
.dialog-heading h2 { margin: 0; font-size: 1.25rem; }
.close-dialog { border: 0; border-radius: 50%; width: 40px; height: 40px; font-size: 1.4rem; background: #f7e7df; color: #6d3931; }
dialog ul { padding-left: 1.22em; margin-bottom: 0; line-height: 1.7; }
dialog li + li { margin-top: 8px; }
.details-link { display: block; min-height: 42px; margin: 0 auto; border: 0; background: transparent; color: #942e24; font-size: .9rem; font-weight: 700; padding: 7px 10px; }
.packet-progress { margin: 14px 0; padding: 13px 12px; border: 1px solid #efd6c2; border-radius: 14px; background: #fff2e8; }
.result .packet-progress { margin: 12px 0 4px; }
.packet-progress h3 { margin: 0 0 8px; font-size: .92rem; color: #663a2e; overflow-wrap: anywhere; }
.packet-counts { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 5px 10px; color: #6d4d43; font-size: .85rem; }
.packet-counts strong { color: #982e23; font-variant-numeric: tabular-nums; }
.packet-progress progress { display: block; width: 100%; height: 8px; margin-top: 9px; border: none; border-radius: 9px; overflow: hidden; background: #edd4c9; color: #bb3227; accent-color: #bb3227; }
.packet-progress progress::-webkit-progress-bar { background: #edd4c9; }
.packet-progress progress::-webkit-progress-value { background: #bb3227; border-radius: 9px; }
.packet-progress progress::-moz-progress-bar { background: #bb3227; border-radius: 9px; }
#details table { width: 100%; border-collapse: collapse; margin: 12px 0 5px; }
#details th, #details td { border-bottom: 1px solid #ecdbd1; padding: 8px 0; text-align: left; overflow-wrap: anywhere; }
#details th:nth-child(2), #details td:nth-child(2) { padding-left: 10px; }
#details td:nth-child(2) { color: #6d4d43; font-size: .85rem; font-variant-numeric: tabular-nums; }
#details th:last-child, #details td:last-child { text-align: right; padding-left: 10px; white-space: nowrap; }
#details td:last-child { color: #952d23; font-weight: 700; }
