*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: 'PingFang SC', 'Helvetica Neue', 'Microsoft YaHei', sans-serif;
  background: #050a12;
  color: #e2e8f0;
  -webkit-font-smoothing: antialiased;
}

.up-root {
  position: relative;
  min-height: 100vh;
  padding: 0 0 calc(32px + env(safe-area-inset-bottom));
  overflow-x: hidden;
}

.up-glow {
  position: absolute;
  width: 140%;
  left: -20%;
  top: -10%;
  height: 55vh;
  background:
    radial-gradient(ellipse 70% 60% at 50% 0%, rgba(59, 130, 246, 0.35), transparent 62%),
    radial-gradient(ellipse 42% 50% at 92% 25%, rgba(168, 85, 247, 0.18), transparent 50%);
  pointer-events: none;
}

.up-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(148, 163, 184, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(148, 163, 184, 0.06) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: linear-gradient(180deg, black 0%, transparent 85%);
  pointer-events: none;
}

.up-head {
  position: relative;
  z-index: 1;
  padding: calc(12px + env(safe-area-inset-top)) 22px 8px;
  max-width: 440px;
  margin: 0 auto;
}

.up-back {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  margin-bottom: 8px;
  border-radius: 12px;
  color: #cbd5e1;
  text-decoration: none;
  font-size: 26px;
  line-height: 1;
  border: 1px solid rgba(148, 163, 184, 0.25);
  background: rgba(255, 255, 255, 0.04);
}

.up-badge {
  margin: 0 0 14px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.38em;
  color: rgba(56, 189, 248, 0.8);
}

.up-title {
  margin: 0;
  font-size: clamp(24px, 6.5vw, 30px);
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: 0.04em;
  background: linear-gradient(120deg, #f8fafc 0%, #93c5fd 45%, #e9d5ff 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.up-sub {
  margin: 16px 0 0;
  font-size: 14px;
  line-height: 1.7;
  color: rgba(148, 163, 184, 0.92);
}

.up-logged-hint {
  margin: 0 0 20px;
  font-size: 15px;
  line-height: 1.55;
  color: rgba(226, 232, 240, 0.95);
}

.up-logged-hint strong {
  color: #93c5fd;
  font-weight: 700;
}

.up-btn-redeem-only {
  margin-top: 22px;
}

.up-card {
  position: relative;
  z-index: 1;
  max-width: 440px;
  margin: 28px auto 0;
  padding: 28px 24px 30px;
  border-radius: 22px;
  background: linear-gradient(165deg, rgba(255, 255, 255, 0.09) 0%, rgba(15, 23, 42, 0.65) 100%);
  border: 1px solid rgba(148, 163, 184, 0.22);
  box-shadow: 0 28px 70px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  margin-left: 20px;
  margin-right: 20px;
}

.up-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.14em;
  color: rgba(203, 213, 225, 0.85);
  text-transform: uppercase;
}

.up-label-mt {
  margin-top: 20px;
}

.up-input {
  margin-top: 10px;
  width: 100%;
  height: 52px;
  padding: 0 18px;
  border-radius: 14px;
  border: 1px solid rgba(148, 163, 184, 0.25);
  background: rgba(15, 23, 42, 0.5);
  color: #f1f5f9;
  font-size: 16px;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.up-input::placeholder {
  color: rgba(148, 163, 184, 0.55);
}

.up-input:focus {
  border-color: rgba(96, 165, 250, 0.65);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.2);
}

.up-input-code {
  letter-spacing: 0.12em;
  font-weight: 600;
  text-transform: uppercase;
}

.up-btn-redeem {
  margin-top: 26px;
  width: 100%;
  height: 54px;
  border: none;
  border-radius: 14px;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: #fff;
  cursor: pointer;
  background: linear-gradient(135deg, #1d4ed8, #2563eb 50%, #3b82f6);
  box-shadow: 0 14px 36px rgba(37, 99, 235, 0.35);
}

.up-btn-redeem:active:not(:disabled) {
  transform: scale(0.99);
}

.up-or {
  margin: 22px 0;
  height: 1px;
  background: rgba(148, 163, 184, 0.2);
  position: relative;
}

.up-or span {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  padding: 0 14px;
  font-size: 12px;
  color: rgba(148, 163, 184, 0.75);
  background: linear-gradient(165deg, rgba(30, 41, 59, 0.95), rgba(15, 23, 42, 0.95));
}

.up-btn-pay {
  width: 100%;
  padding: 16px 20px;
  border-radius: 14px;
  border: 1px solid rgba(251, 191, 36, 0.45);
  cursor: pointer;
  background: linear-gradient(135deg, rgba(251, 191, 36, 0.15), rgba(245, 158, 11, 0.08));
  box-shadow: 0 10px 30px rgba(245, 158, 11, 0.12);
}

.up-btn-pay-label {
  display: block;
  font-size: 16px;
  font-weight: 700;
  color: #fde68a;
  letter-spacing: 0.06em;
}

.up-btn-pay-hint {
  display: block;
  margin-top: 6px;
  font-size: 12px;
  color: rgba(253, 230, 138, 0.65);
}

.up-footnote {
  margin: 22px 0 0;
  font-size: 12px;
  line-height: 1.6;
  color: rgba(148, 163, 184, 0.65);
}

/* 成功弹窗 */
.up-modal {
  position: fixed;
  inset: 0;
  z-index: 20000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.up-modal.hidden {
  display: none;
}

.up-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(2, 6, 23, 0.72);
  backdrop-filter: blur(6px);
}

.up-modal-sheet {
  position: relative;
  width: 100%;
  max-width: 360px;
  padding: 32px 26px 28px;
  border-radius: 22px;
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
  border: 1px solid rgba(226, 232, 240, 0.8);
  box-shadow: 0 28px 80px rgba(15, 23, 42, 0.35);
  color: #0f172a;
  text-align: center;
}

.up-modal-icon {
  width: 56px;
  height: 56px;
  margin: 0 auto 16px;
  border-radius: 50%;
  background: linear-gradient(135deg, #22c55e, #16a34a);
  color: #fff;
  font-size: 28px;
  line-height: 56px;
  font-weight: 700;
  box-shadow: 0 10px 28px rgba(22, 163, 74, 0.35);
}

.up-modal-title {
  margin: 0 0 14px;
  font-size: 22px;
  font-weight: 800;
  letter-spacing: 0.06em;
}

.up-modal-text {
  margin: 0;
  font-size: 15px;
  line-height: 1.7;
  color: #475569;
  text-align: left;
}

.up-modal-text strong {
  color: #1d4ed8;
}

.up-modal-btn {
  margin-top: 24px;
  width: 100%;
  height: 50px;
  border: none;
  border-radius: 14px;
  font-size: 16px;
  font-weight: 700;
  color: #fff;
  cursor: pointer;
  background: linear-gradient(135deg, #1d4ed8, #2563eb);
  box-shadow: 0 10px 26px rgba(37, 99, 235, 0.3);
}
