:root {
  --bg: #070b18;
  --card: rgba(15, 23, 42, 0.74);
  --card-2: rgba(2, 6, 23, 0.62);
  --text: #f8fafc;
  --sub: #9aa7bd;
  --muted: #64748b;
  --line: rgba(148, 163, 184, 0.22);
  --primary: #8b5cf6;
  --cyan: #22d3ee;
  --green: #22c55e;
  --red: #fb7185;
  --shadow: 0 30px 90px rgba(0, 0, 0, 0.48);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
  background:
    radial-gradient(circle at 18% 8%, rgba(139, 92, 246, .28), transparent 34%),
    radial-gradient(circle at 82% 20%, rgba(34, 211, 238, .18), transparent 28%),
    linear-gradient(135deg, #050816 0%, #0f172a 54%, #111827 100%);
  -webkit-font-smoothing: antialiased;
}

.bg-layer {
  position: fixed;
  inset: 0;
  z-index: -3;
  background-image:
    linear-gradient(rgba(255, 255, 255, .035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, .035) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: linear-gradient(to bottom, rgba(0,0,0,.9), transparent 86%);
}

.orb {
  position: fixed;
  z-index: -2;
  border-radius: 999px;
  filter: blur(24px);
  pointer-events: none;
}

.orb-a {
  width: 280px;
  height: 280px;
  left: 7vw;
  bottom: 8vh;
  background: rgba(139, 92, 246, .22);
}

.orb-b {
  width: 220px;
  height: 220px;
  right: 9vw;
  top: 11vh;
  background: rgba(34, 211, 238, .18);
}

.app {
  width: min(1080px, 100%);
  min-height: 100vh;
  margin: 0 auto;
  padding: 56px 24px;
  display: grid;
  align-content: center;
  gap: 28px;
}

.header {
  display: grid;
  gap: 22px;
  justify-items: center;
  text-align: center;
}

.kicker {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  margin: 0 0 14px;
  padding: 8px 14px;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 999px;
  color: #ddd6fe;
  background: rgba(255,255,255,.06);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.kicker::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 18px var(--green);
}

.header h1 {
  margin: 0;
  font-size: clamp(42px, 7vw, 76px);
  line-height: .94;
  letter-spacing: -.07em;
  background: linear-gradient(135deg, #fff 16%, #ddd6fe 50%, #67e8f9 88%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.subtitle {
  margin: 18px auto 0;
  max-width: 600px;
  color: var(--sub);
  font-size: 16px;
  line-height: 1.7;
}

.steps {
  display: inline-grid;
  grid-template-columns: repeat(3, auto);
  gap: 8px;
  padding: 8px;
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 999px;
  background: rgba(255,255,255,.055);
  backdrop-filter: blur(14px);
}

.steps span {
  padding: 8px 14px;
  border-radius: 999px;
  color: #cbd5e1;
  font-size: 13px;
  font-weight: 800;
}

.steps span:first-child {
  color: #fff;
  background: linear-gradient(135deg, rgba(139,92,246,.75), rgba(34,211,238,.52));
}

.content-grid {
  display: grid;
  grid-template-columns: minmax(320px, 430px) minmax(340px, 1fr);
  gap: 22px;
  align-items: stretch;
}

.qr-panel,
.upload-panel {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.13);
  border-radius: 32px;
  background: linear-gradient(145deg, var(--card), var(--card-2));
  box-shadow: var(--shadow);
  backdrop-filter: blur(24px);
}

.qr-panel::before,
.upload-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(135deg, rgba(255,255,255,.17), transparent 28%, transparent 72%, rgba(34,211,238,.08));
}

.qr-panel {
  min-height: 450px;
  padding: 32px;
  display: grid;
  place-items: center;
  text-align: center;
}

.upload-panel {
  padding: 30px;
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.panel-head {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 10px;
  color: #e0f2fe;
  font-size: 15px;
  font-weight: 900;
}

.panel-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--cyan));
  box-shadow: 0 0 20px rgba(34, 211, 238, .75);
}

.pay-layer {
  position: relative;
  z-index: 1;
  display: none;
  width: 100%;
  min-height: 330px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  animation: fadeUp .28s ease-out;
}

.pay-layer.active { display: flex; }

.layer-icon {
  width: 82px;
  height: 82px;
  display: grid;
  place-items: center;
  border-radius: 28px;
  color: #fff;
  font-size: 32px;
  font-weight: 950;
  background: linear-gradient(135deg, var(--primary), var(--cyan));
  box-shadow: 0 22px 50px rgba(139,92,246,.32);
}

.qr-title {
  margin: 0;
  color: #f8fafc;
  font-size: 25px;
  font-weight: 950;
  letter-spacing: -.04em;
}

.qr-hint,
.qr-amount {
  margin: 0;
  max-width: 320px;
  color: var(--sub);
  line-height: 1.65;
}

.qr-amount {
  padding: 10px 15px;
  border: 1px solid rgba(103,232,249,.24);
  border-radius: 999px;
  color: #67e8f9;
  background: rgba(6,182,212,.1);
  font-weight: 950;
}

.qr-container {
  width: 232px;
  height: 232px;
  display: grid;
  place-items: center;
  padding: 18px;
  border-radius: 30px;
  background: #f8fafc;
  box-shadow: 0 30px 70px rgba(0,0,0,.38), 0 0 0 10px rgba(255,255,255,.06);
}

.qr-container svg {
  width: 100%;
  height: 100%;
}

.qr-info {
  display: grid;
  gap: 10px;
  justify-items: center;
}

.sponsor-form {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 18px;
}

.form-group {
  display: grid;
  gap: 10px;
}

.form-group.hidden { display: none; }

.form-group label {
  color: #dbeafe;
  font-size: 14px;
  font-weight: 900;
}

.form-group input[type="text"],
.form-group input[type="number"] {
  width: 100%;
  height: 56px;
  border: 1px solid rgba(148,163,184,.25);
  border-radius: 18px;
  padding: 0 17px;
  outline: none;
  color: var(--text);
  background: rgba(2,6,23,.48);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.05);
  font: inherit;
  transition: border-color .2s ease, box-shadow .2s ease, background .2s ease;
}

.form-group input::placeholder { color: #64748b; }

.form-group input:focus {
  border-color: rgba(103,232,249,.68);
  background: rgba(2,6,23,.68);
  box-shadow: 0 0 0 4px rgba(6,182,212,.13);
}

.upload-hint {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.account-hint {
  min-height: 32px;
  width: fit-content;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 12px;
  border-radius: 999px;
  color: var(--sub);
  background: rgba(255,255,255,.06);
  font-size: 13px;
  font-weight: 800;
}

.account-hint:empty { display: none; }
.account-hint.loading { color: #bae6fd; }
.account-hint.success { color: #86efac; background: rgba(34,197,94,.11); }
.account-hint.error { color: #fecdd3; background: rgba(251,113,133,.11); }

.submit-btn {
  margin-top: 6px;
  height: 58px;
  border: 0;
  border-radius: 18px;
  color: #fff;
  background: linear-gradient(135deg, var(--primary), var(--cyan));
  font-size: 16px;
  font-weight: 950;
  cursor: pointer;
  box-shadow: 0 20px 42px rgba(34,211,238,.22);
  transition: transform .18s ease, filter .18s ease, box-shadow .18s ease;
}

.submit-btn:hover:not(:disabled) {
  transform: translateY(-2px);
  filter: brightness(1.07);
  box-shadow: 0 24px 50px rgba(139,92,246,.3);
}

.submit-btn:active:not(:disabled) { transform: translateY(0); }
.submit-btn:disabled { opacity: .58; cursor: not-allowed; }

.result {
  position: relative;
  z-index: 1;
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  border-radius: 18px;
  color: var(--sub);
  font-weight: 850;
  line-height: 1.55;
  transition: .22s ease;
}

.result:not(:empty) {
  max-height: 140px;
  margin-top: 18px;
  opacity: 1;
  padding: 14px 16px;
  border: 1px solid rgba(255,255,255,.1);
  background: rgba(255,255,255,.06);
}

.result.success { color: #86efac; border-color: rgba(34,197,94,.24); background: rgba(34,197,94,.1); }
.result.error { color: #fecdd3; border-color: rgba(251,113,133,.25); background: rgba(251,113,133,.1); }
.result.loading { color: #bae6fd; border-color: rgba(6,182,212,.25); background: rgba(6,182,212,.1); }

.modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(2, 6, 23, .68);
  backdrop-filter: blur(14px);
}

.modal.hidden { display: none; }

.modal-card {
  width: min(420px, 100%);
  padding: 34px;
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 30px;
  text-align: center;
  background: linear-gradient(145deg, rgba(15,23,42,.96), rgba(2,6,23,.92));
  box-shadow: var(--shadow);
  animation: modalPop .26s ease-out;
}

.modal-check {
  width: 76px;
  height: 76px;
  margin: 0 auto 18px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #052e16;
  background: linear-gradient(135deg, #86efac, #22c55e);
  font-size: 42px;
  font-weight: 950;
  box-shadow: 0 18px 42px rgba(34,197,94,.28);
}

.modal-card h2 {
  margin: 0 0 10px;
  font-size: 28px;
}

.modal-card p {
  margin: 0 0 24px;
  color: var(--sub);
  line-height: 1.65;
}

.modal-btn {
  width: 100%;
  height: 52px;
  border: 0;
  border-radius: 16px;
  color: #fff;
  background: linear-gradient(135deg, var(--primary), var(--cyan));
  font-weight: 950;
  cursor: pointer;
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes modalPop {
  from { opacity: 0; transform: scale(.95) translateY(10px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

@media (max-width: 840px) {
  .app { padding: 34px 16px; }
  .content-grid { grid-template-columns: 1fr; }
  .qr-panel { min-height: 300px; }
  .pay-layer { min-height: 230px; }
}

@media (max-width: 520px) {
  .steps { grid-template-columns: 1fr; border-radius: 22px; width: 100%; }
  .steps span { text-align: center; }
  .upload-panel, .qr-panel { border-radius: 24px; padding: 22px; }
  .qr-container { width: 190px; height: 190px; }
  .header h1 { font-size: 44px; }
}
