:root {
  --bg-1: #0b3d3a; --bg-2: #0f766e; --bg-3: #10b981;
  --accent: #f59e0b; --accent-soft: #fbbf24;
  --ink: #0f172a; --ink-2: #475569; --ink-3: #94a3b8;
  --line: #e6ebf0; --card: #ffffff;
  --ok: #10b981; --err: #ef4444; --warn: #f59e0b;
  --radius: 22px;
  --shadow-card: 0 24px 60px -20px rgba(4, 60, 55, .45);
  --shadow-soft: 0 8px 24px -12px rgba(15, 23, 42, .18);
  --font: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font); color: var(--ink);
  min-height: 100vh; min-height: 100dvh;
  background:
    radial-gradient(120% 80% at 15% 0%, #14b8a6 0%, transparent 55%),
    radial-gradient(140% 90% at 100% 8%, #0891b2 0%, transparent 50%),
    linear-gradient(160deg, var(--bg-1) 0%, var(--bg-2) 48%, #064e46 100%);
  background-attachment: fixed;
  display: flex; justify-content: center;
  -webkit-font-smoothing: antialiased;
}
.orbs { position: fixed; inset: 0; overflow: hidden; pointer-events: none; z-index: 0; }
.orb { position: absolute; border-radius: 50%; filter: blur(46px); opacity: .35; }
.orb.a { width: 260px; height: 260px; background: #34d399; top: -60px; right: -40px; animation: float1 14s ease-in-out infinite; }
.orb.b { width: 220px; height: 220px; background: #22d3ee; bottom: 80px; left: -70px; animation: float2 17s ease-in-out infinite; }
.orb.c { width: 180px; height: 180px; background: #fbbf24; bottom: -50px; right: 30px; opacity: .18; animation: float1 20s ease-in-out infinite; }
@keyframes float1 { 0%,100%{transform:translateY(0)} 50%{transform:translateY(28px)} }
@keyframes float2 { 0%,100%{transform:translateY(0)} 50%{transform:translateY(-32px)} }

.app {
  position: relative; z-index: 1; width: 100%; max-width: 440px;
  padding: calc(env(safe-area-inset-top) + 18px) 18px calc(env(safe-area-inset-bottom) + 22px);
  display: flex; flex-direction: column; gap: 14px;
}
.topbar { display: flex; align-items: center; justify-content: space-between; color: #fff; }
.brand { display: flex; align-items: center; gap: 10px; }
.brand .logo { width: 38px; height: 38px; border-radius: 12px; background: linear-gradient(140deg, #fde68a, var(--accent)); display: grid; place-items: center; box-shadow: 0 6px 16px -4px rgba(245, 158, 11, .6); }
.brand .logo svg { width: 22px; height: 22px; }
.brand .name { font-size: 16px; font-weight: 700; letter-spacing: .3px; }
.brand .sub { font-size: 11px; opacity: .8; margin-top: 1px; }
.pill { font-size: 11.5px; font-weight: 600; color: #064e46; background: rgba(255,255,255,.92); padding: 6px 11px; border-radius: 999px; display: flex; align-items: center; gap: 5px; box-shadow: var(--shadow-soft); }
.pill svg { width: 13px; height: 13px; }

.hero { color: #fff; text-align: center; padding: 4px 4px 0; }
.hero .kicker { font-size: 13px; opacity: .85; letter-spacing: 3px; font-weight: 500; }
.hero .amount { font-size: 56px; font-weight: 800; line-height: 1.05; margin: 6px 0 2px; letter-spacing: -1px; font-variant-numeric: tabular-nums; text-shadow: 0 6px 30px rgba(0,0,0,.25); }
.hero .amount span { font-size: 20px; font-weight: 600; opacity: .9; margin-left: 4px; }
.hero .desc { font-size: 13.5px; opacity: .88; }
.hero .desc b { color: var(--accent-soft); font-weight: 700; }

.stat { margin-top: 14px; padding: 13px 18px; background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.16); border-radius: 16px; backdrop-filter: blur(8px); display: flex; align-items: center; justify-content: center; gap: 12px; }
.stat .dot-live { width: 8px; height: 8px; border-radius: 50%; background: #4ade80; box-shadow: 0 0 0 0 rgba(74,222,128,.7); animation: pulse 2s infinite; flex-shrink: 0; }
@keyframes pulse { 0%{box-shadow:0 0 0 0 rgba(74,222,128,.6)} 70%{box-shadow:0 0 0 8px rgba(74,222,128,0)} 100%{box-shadow:0 0 0 0 rgba(74,222,128,0)} }
.stat .stat-num { font-size: 27px; font-weight: 800; color: #fde68a; font-variant-numeric: tabular-nums; letter-spacing: .5px; line-height: 1; text-shadow: 0 0 14px rgba(253,224,138,.35); }
.stat .stat-label { font-size: 12px; color: rgba(255,255,255,.82); text-align: left; line-height: 1.35; }

/* 丝滑滚动数字（odometer） */
.odometer { display: inline-flex; align-items: flex-end; height: 1em; line-height: 1; overflow: hidden; }
.od-digit { display: inline-block; height: 1em; overflow: hidden; }
.od-ribbon { display: flex; flex-direction: column; will-change: transform; transition: transform .8s cubic-bezier(.22, 1, .36, 1); }
.od-ribbon > span { height: 1em; line-height: 1em; display: flex; align-items: center; justify-content: center; }
.od-sep { display: inline-block; padding: 0 .01em; }

/* 名额告急进度 */
.scarcity { margin-top: 10px; padding: 0 4px; }
.scarcity-top { display: flex; justify-content: space-between; align-items: center; font-size: 11.5px; color: rgba(255,255,255,.85); margin-bottom: 6px; }
.scarcity-top span:last-child { color: #fca5a5; font-weight: 700; font-variant-numeric: tabular-nums; }
.scarcity-bar { height: 6px; border-radius: 999px; background: rgba(255,255,255,.16); overflow: hidden; }
.scarcity-fill { height: 100%; border-radius: 999px; background: linear-gradient(90deg, #f59e0b, #ef4444); width: 18%; transition: width 1.2s cubic-bezier(.16, 1, .3, 1); }

.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow-card); padding: 20px 18px 18px; }
.label { font-size: 13px; font-weight: 600; color: var(--ink-2); margin-bottom: 9px; display: flex; align-items: center; gap: 6px; }
.label svg { width: 15px; height: 15px; color: var(--bg-2); }
.field { display: flex; align-items: center; gap: 8px; border: 1.5px solid var(--line); background: #f8fafb; border-radius: 14px; padding: 0 8px 0 12px; transition: border-color .2s, box-shadow .2s, background .2s; }
.field:focus-within { border-color: var(--bg-3); background: #fff; box-shadow: 0 0 0 4px rgba(16,185,129,.12); }
.field.invalid { border-color: var(--err); box-shadow: 0 0 0 4px rgba(239,68,68,.1); }
.field input { flex: 1; border: 0; outline: 0; background: transparent; font-size: 15px; color: var(--ink); padding: 14px 0; font-family: var(--font); letter-spacing: .2px; }
.field input::placeholder { color: var(--ink-3); letter-spacing: 0; }
.icon-btn { border: 0; background: #eef2f4; color: var(--ink-2); width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; cursor: pointer; transition: background .15s, transform .1s; }
.icon-btn:active { transform: scale(.92); }
.icon-btn svg { width: 17px; height: 17px; }
.hint { font-size: 12px; margin: 8px 2px 0; min-height: 16px; color: var(--ink-3); display: flex; align-items: center; gap: 5px; }
.hint.err { color: var(--err); } .hint.ok { color: var(--ok); }
.hint svg { width: 13px; height: 13px; flex-shrink: 0; }

.slider { position: relative; height: 56px; margin-top: 16px; border-radius: 15px; background: #eef2f4; overflow: hidden; user-select: none; touch-action: none; transition: opacity .2s; }
.slider.disabled { opacity: .5; pointer-events: none; }
.slider .fill { position: absolute; left: 0; top: 0; bottom: 0; width: 56px; background: linear-gradient(135deg, var(--accent-soft), var(--accent)); transition: width .05s linear; }
.slider .track-text { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; gap: 8px; font-size: 15px; font-weight: 700; color: #64748b; pointer-events: none; }
.slider .track-text svg { width: 18px; height: 18px; }
.slider .thumb { position: absolute; left: 4px; top: 4px; width: 48px; height: 48px; border-radius: 12px; background: #fff; box-shadow: 0 4px 12px -3px rgba(15,23,42,.35); display: grid; place-items: center; cursor: grab; z-index: 2; }
.slider .thumb:active { cursor: grabbing; }
.slider .thumb svg { width: 22px; height: 22px; color: var(--accent); }
.slider.done .track-text { color: #05312c; }

.cta-spinner-wrap { margin-top: 16px; height: 56px; border-radius: 15px; background: linear-gradient(135deg, var(--accent-soft), var(--accent)); display: flex; align-items: center; justify-content: center; gap: 10px; color: #05312c; font-weight: 700; font-size: 14px; }
.cta-spinner { width: 22px; height: 22px; border: 2.5px solid rgba(5,49,44,.25); border-top-color: #05312c; border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.rules { margin-top: 15px; display: flex; flex-direction: column; gap: 9px; }
.rule { display: flex; align-items: flex-start; gap: 9px; font-size: 12.5px; color: var(--ink-2); line-height: 1.5; }
.rule .ri { width: 20px; height: 20px; border-radius: 7px; background: #ecfdf5; color: var(--ok); display: grid; place-items: center; flex-shrink: 0; margin-top: 1px; }
.rule .ri svg { width: 12px; height: 12px; }
.rule b { color: var(--ink); font-weight: 600; }
.quota-link { margin-top: 14px; text-align: center; }
.quota-link button { border: 0; background: none; color: var(--bg-2); font-size: 12.5px; font-weight: 600; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }

.result { text-align: center; padding: 6px 4px; }
.result .ricon { width: 76px; height: 76px; border-radius: 50%; margin: 4px auto 14px; display: grid; place-items: center; }
.result .ricon svg { width: 40px; height: 40px; }
.result.success .ricon { background: radial-gradient(circle, #d1fae5, #a7f3d0); color: var(--ok); animation: pop .4s cubic-bezier(.2,1.3,.5,1); }
.result.fail .ricon { background: #fef2f2; color: var(--err); }
.result.warn .ricon { background: #fffbeb; color: var(--warn); }
@keyframes pop { 0%{transform:scale(.4);opacity:0} 100%{transform:scale(1);opacity:1} }
.result h2 { font-size: 21px; margin: 0 0 6px; }
.result p { font-size: 13.5px; color: var(--ink-2); margin: 0 auto; max-width: 300px; line-height: 1.55; }

.receipt { margin: 18px 0 4px; background: #f8fafb; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; text-align: left; }
.receipt .row { display: flex; justify-content: space-between; align-items: center; padding: 13px 14px; font-size: 13px; }
.receipt .row + .row { border-top: 1px dashed var(--line); }
.receipt .row .k { color: var(--ink-3); }
.receipt .row .v { color: var(--ink); font-weight: 600; font-variant-numeric: tabular-nums; max-width: 62%; text-align: right; word-break: break-all; }
.receipt .row .v.energy { color: var(--ok); font-size: 15px; }

.countdown { margin-top: 12px; font-size: 12.5px; color: var(--ink-2); display: flex; align-items: center; justify-content: center; gap: 6px; }
.countdown svg { width: 14px; height: 14px; color: var(--bg-2); }
.countdown b { color: var(--bg-2); font-variant-numeric: tabular-nums; }

.invite { margin-top: 18px; text-align: left; background: linear-gradient(150deg, #fff9 ,#fffbeb); border: 1.5px solid #fde68a; border-radius: 16px; padding: 16px; }
.invite .ih { display: flex; align-items: center; gap: 8px; font-size: 15px; font-weight: 700; color: #92400e; }
.invite .ih svg { width: 20px; height: 20px; color: var(--accent); }
.invite .ip { font-size: 12.5px; color: #b45309; margin: 6px 0 12px; line-height: 1.5; }
.invite .prog { display: flex; gap: 8px; margin-bottom: 12px; }
.invite .prog .pbox { flex: 1; background: #fff; border: 1px solid #fde68a; border-radius: 11px; padding: 9px; text-align: center; }
.invite .prog .pbox .pn { font-size: 19px; font-weight: 800; color: #b45309; font-variant-numeric: tabular-nums; }
.invite .prog .pbox .pl { font-size: 11px; color: #a16207; margin-top: 2px; }
.invite .linkbox { display: flex; align-items: center; gap: 8px; background: #fff; border: 1px dashed #fbbf24; border-radius: 11px; padding: 4px 4px 4px 12px; }
.invite .linkbox span { flex: 1; font-size: 12.5px; color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.invite .linkbox button { border: 0; background: #fef3c7; color: #92400e; font-weight: 600; font-size: 12.5px; padding: 8px 12px; border-radius: 9px; cursor: pointer; }
.invite .share-btn { margin-top: 12px; width: 100%; border: 0; cursor: pointer; padding: 14px; border-radius: 13px; font-size: 15.5px; font-weight: 700; color: #05312c; background: linear-gradient(135deg, var(--accent-soft), var(--accent)); box-shadow: 0 10px 22px -10px rgba(245,158,11,.7); display: flex; align-items: center; justify-content: center; gap: 8px; }
.invite .share-btn svg { width: 18px; height: 18px; }

.ghost-btn { margin-top: 14px; width: 100%; border: 1.5px solid var(--line); background: #fff; color: var(--ink-2); padding: 14px; border-radius: 14px; font-size: 15px; font-weight: 600; cursor: pointer; transition: background .15s; }
.ghost-btn:active { background: #f1f5f9; }
.cta-invite { margin-top: 16px; width: 100%; border: 0; cursor: pointer; padding: 15px; border-radius: 14px; font-size: 15.5px; font-weight: 700; color: #05312c; background: linear-gradient(135deg, var(--accent-soft), var(--accent)); box-shadow: 0 10px 22px -10px rgba(245,158,11,.7); }
.cta-invite:active { transform: translateY(1px); }
.footer { text-align: center; color: rgba(255,255,255,.7); font-size: 11.5px; line-height: 1.7; padding: 4px 10px 0; }
.hidden { display: none !important; }

.sheet-mask { position: fixed; inset: 0; background: rgba(4,30,28,.5); backdrop-filter: blur(2px); z-index: 40; opacity: 0; pointer-events: none; transition: opacity .25s; }
.sheet-mask.show { opacity: 1; pointer-events: auto; }
.sheet { position: fixed; left: 0; right: 0; bottom: 0; z-index: 41; background: #fff; border-radius: 24px 24px 0 0; padding: 8px 20px calc(env(safe-area-inset-bottom) + 22px); transform: translateY(100%); transition: transform .3s cubic-bezier(.2,.8,.3,1); max-width: 440px; margin: 0 auto; box-shadow: 0 -10px 40px -10px rgba(0,0,0,.3); }
.sheet.show { transform: translateY(0); }
.sheet .grip { width: 40px; height: 4px; border-radius: 999px; background: #e2e8f0; margin: 8px auto 14px; }
.sheet h3 { margin: 0 0 4px; font-size: 17px; }
.sheet .sheet-sub { font-size: 12.5px; color: var(--ink-3); margin: 0 0 16px; }
.quota-item { display: flex; align-items: center; justify-content: space-between; padding: 14px 0; border-bottom: 1px solid var(--line); }
.quota-item:last-child { border-bottom: 0; }
.quota-item .qi-l { display: flex; align-items: center; gap: 11px; }
.quota-item .qi-ic { width: 36px; height: 36px; border-radius: 11px; background: #ecfdf5; color: var(--ok); display: grid; place-items: center; }
.quota-item .qi-ic svg { width: 18px; height: 18px; }
.quota-item .qi-t { font-size: 14px; font-weight: 600; }
.quota-item .qi-d { font-size: 12px; color: var(--ink-3); margin-top: 2px; }
.quota-item .qi-v { font-size: 15px; font-weight: 700; font-variant-numeric: tabular-nums; }
