:root {
  --bg: #060913;
  --surface: rgba(255, 255, 255, 0.055);
  --surface-strong: rgba(255, 255, 255, 0.09);
  --border: rgba(255, 255, 255, 0.12);
  --text: #eef2ff;
  --muted: #97a3c2;
  --accent: #6d5efc;
  --accent-2: #22d3ee;
  --danger: #ff8fa0;
  --ok: #5eead4;
  --radius-lg: 24px;
  --radius-md: 16px;
  --mono: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }

html, body { min-height: 100%; }

body {
  margin: 0;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: radial-gradient(1200px 700px at 50% -10%, #131a35 0%, #060913 55%, #04060d 100%);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "PingFang SC", "Hiragino Sans GB",
    "Microsoft YaHei", "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}

.aurora {
  position: fixed;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 0;
}

.aurora::before,
.aurora::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.5;
  animation: drift 20s ease-in-out infinite alternate;
}

.aurora::before {
  width: 520px;
  height: 520px;
  top: -180px;
  left: -140px;
  background: radial-gradient(circle, rgba(109, 94, 252, 0.95), transparent 68%);
}

.aurora::after {
  width: 620px;
  height: 620px;
  right: -180px;
  bottom: -260px;
  background: radial-gradient(circle, rgba(14, 165, 233, 0.8), transparent 68%);
  animation-delay: -7s;
}

@keyframes drift {
  from { transform: translate3d(0, 0, 0) scale(1); }
  to { transform: translate3d(40px, 30px, 0) scale(1.12); }
}

.page {
  position: relative;
  z-index: 1;
  flex: 1;
  width: 100%;
  max-width: 760px;
  margin: 0 auto;
  padding: 56px 20px 28px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 26px;
}

.hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  text-align: center;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: 999px;
  border: 1px solid rgba(109, 94, 252, 0.45);
  background: rgba(109, 94, 252, 0.14);
  color: #c7c1ff;
  font-size: 12px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.badge::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent-2);
  box-shadow: 0 0 12px var(--accent-2);
}

.hero h1 {
  margin: 0;
  font-size: clamp(26px, 4.4vw, 38px);
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.hero p {
  margin: 0;
  max-width: 540px;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.75;
}

.card {
  position: relative;
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.075), rgba(255, 255, 255, 0.025));
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: 0 24px 70px -30px rgba(3, 7, 20, 0.95), inset 0 1px 0 rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(18px);
}

.redeem-card {
  width: 100%;
  padding: 28px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.field-label {
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
}

.code-form {
  display: flex;
  gap: 12px;
}

input[type="text"],
input[type="password"],
input[type="number"],
textarea {
  width: 100%;
  border-radius: var(--radius-md);
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(6, 10, 22, 0.75);
  color: var(--text);
  padding: 12px 16px;
  font-size: 15px;
  font-family: inherit;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

input::placeholder { color: rgba(151, 163, 194, 0.65); }

input:focus,
textarea:focus {
  outline: none;
  border-color: rgba(109, 94, 252, 0.9);
  box-shadow: 0 0 0 4px rgba(109, 94, 252, 0.2);
  background: rgba(9, 14, 30, 0.92);
}

#activationCode {
  flex: 1;
  height: 56px;
  font-family: var(--mono);
  font-size: 17px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

button {
  font-family: inherit;
  font-size: 15px;
  cursor: pointer;
  border: 0;
}

#redeemBtn {
  min-width: 136px;
  height: 56px;
  padding: 0 24px;
  border-radius: var(--radius-md);
  color: #fff;
  font-weight: 600;
  letter-spacing: 0.02em;
  background: linear-gradient(135deg, #7c6cff, #4f46e5 45%, #0ea5e9);
  box-shadow: 0 16px 34px -16px rgba(79, 70, 229, 0.95);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: transform 0.16s ease, box-shadow 0.16s ease, opacity 0.16s ease;
}

#redeemBtn:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 20px 40px -16px rgba(79, 70, 229, 1);
}

#redeemBtn:active:not(:disabled) { transform: translateY(0) scale(0.99); }

#redeemBtn:disabled { opacity: 0.65; cursor: progress; }

.spinner {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  animation: spin 0.75s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

.message {
  min-height: 20px;
  margin: 0;
  font-size: 14px;
  line-height: 1.5;
  color: var(--muted);
  word-break: break-word;
}

.message.is-error { color: var(--danger); }
.message.is-success { color: var(--ok); }

.steps {
  list-style: none;
  counter-reset: step;
  margin: 4px 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.steps li {
  counter-increment: step;
  position: relative;
  padding: 14px 14px 14px 42px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.03);
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.steps li::before {
  content: counter(step);
  position: absolute;
  left: 13px;
  top: 13px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 11px;
  font-weight: 700;
  color: #d7d2ff;
  background: rgba(109, 94, 252, 0.28);
  border: 1px solid rgba(109, 94, 252, 0.55);
}

/* ------------------------------ 结果弹窗 ------------------------------ */

.modal {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal[hidden] { display: none; }

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(3, 6, 15, 0.74);
  backdrop-filter: blur(8px);
  opacity: 0;
  transition: opacity 0.22s ease;
}

.modal.is-open .modal-backdrop { opacity: 1; }

.modal-card {
  position: relative;
  width: 100%;
  max-width: 560px;
  max-height: 92dvh;
  overflow-y: auto;
  padding: 30px;
  border-radius: 26px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: linear-gradient(165deg, #151b33 0%, #0a0f1f 62%);
  box-shadow: 0 40px 100px -30px rgba(0, 0, 0, 0.95);
  opacity: 0;
  transform: translateY(18px) scale(0.97);
  transition: opacity 0.22s ease, transform 0.22s ease;
}

.modal.is-open .modal-card {
  opacity: 1;
  transform: none;
}

.modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.07);
  color: var(--muted);
  font-size: 20px;
  line-height: 1;
  display: grid;
  place-items: center;
  transition: background 0.16s ease, color 0.16s ease;
}

.modal-close:hover { background: rgba(255, 255, 255, 0.14); color: #fff; }

.modal-icon {
  width: 46px;
  height: 46px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  margin-bottom: 14px;
  background: linear-gradient(135deg, rgba(94, 234, 212, 0.25), rgba(109, 94, 252, 0.3));
  border: 1px solid rgba(94, 234, 212, 0.35);
  color: var(--ok);
  font-size: 22px;
}

.modal-card h2 {
  margin: 0 0 6px;
  font-size: 21px;
  letter-spacing: -0.01em;
}

.modal-sub {
  margin: 0 0 18px;
  color: var(--muted);
  font-size: 13.5px;
  line-height: 1.6;
  word-break: break-word;
}

.result-block {
  margin-bottom: 14px;
  padding: 16px;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(9, 13, 26, 0.72);
}

.result-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

.result-head .hint {
  letter-spacing: 0;
  text-transform: none;
  font-size: 11.5px;
  color: #fbbf24;
}

.result-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.code-value {
  flex: 1;
  min-width: 0;
  font-family: var(--mono);
  font-size: clamp(22px, 6vw, 30px);
  font-weight: 700;
  letter-spacing: 0.18em;
  color: #fff;
  text-shadow: 0 0 26px rgba(109, 94, 252, 0.6);
  word-break: break-all;
  user-select: all;
}

.link-value {
  flex: 1;
  min-width: 0;
  font-family: var(--mono);
  font-size: 12.5px;
  line-height: 1.6;
  color: #b9c4e4;
  word-break: break-all;
  user-select: all;
}

.btn-ghost {
  flex: none;
  padding: 9px 14px;
  border-radius: 11px;
  border: 1px solid rgba(109, 94, 252, 0.5);
  background: rgba(109, 94, 252, 0.14);
  color: #cfc9ff;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  transition: background 0.16s ease, color 0.16s ease, transform 0.16s ease;
}

.btn-ghost:hover { background: rgba(109, 94, 252, 0.26); color: #fff; }
.btn-ghost:active { transform: scale(0.97); }
.btn-ghost.is-copied { border-color: rgba(94, 234, 212, 0.6); background: rgba(94, 234, 212, 0.16); color: var(--ok); }

.open-link {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 18px;
  height: 48px;
  border-radius: 14px;
  background: linear-gradient(135deg, #7c6cff, #4f46e5 50%, #0ea5e9);
  color: #fff;
  font-size: 14.5px;
  font-weight: 600;
  text-decoration: none;
  box-shadow: 0 16px 34px -18px rgba(79, 70, 229, 1);
}

.quota {
  margin: 4px 0 0;
  font-size: 12.5px;
  color: var(--muted);
  text-align: center;
}

.modal-tip {
  margin: 12px 0 0;
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px dashed rgba(255, 255, 255, 0.12);
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.65;
}

/* ------------------------------ 其它 ------------------------------ */

.toast {
  position: fixed;
  left: 50%;
  bottom: 34px;
  z-index: 80;
  transform: translate(-50%, 20px);
  padding: 11px 20px;
  border-radius: 999px;
  background: rgba(16, 22, 40, 0.95);
  border: 1px solid rgba(94, 234, 212, 0.4);
  color: #d9fff7;
  font-size: 13.5px;
  box-shadow: 0 18px 40px -20px rgba(0, 0, 0, 0.9);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

.site-footer {
  position: relative;
  z-index: 1;
  padding: 20px 20px 30px;
  text-align: center;
  color: rgba(151, 163, 194, 0.72);
  font-size: 12.5px;
  line-height: 1.7;
}

.site-footer a { color: rgba(199, 193, 255, 0.9); }

@media (max-width: 640px) {
  .page { padding: 34px 16px 18px; gap: 20px; }
  .redeem-card { padding: 20px; }
  .code-form { flex-direction: column; }
  #redeemBtn { width: 100%; }
  .steps { grid-template-columns: 1fr; }
  .modal { padding: 12px; align-items: flex-end; }
  .modal-card { padding: 24px 20px; border-radius: 22px; max-height: 94dvh; }
  .result-row { flex-wrap: wrap; }
  .code-value { letter-spacing: 0.12em; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}

