:root {
  --ink: #122019;
  --muted: #5d6f63;
  --line: rgba(25, 67, 41, 0.14);
  --leaf: #58cc02;
  --leaf-dark: #2b8c10;
  --sky: #1cb0f6;
  --cream: #fff8de;
  --paper: rgba(255, 255, 255, 0.88);
  --danger: #d92d20;
  --warn: #b86e00;
  --success: #087443;
  font-family: "Microsoft YaHei", "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 10% 12%, rgba(88, 204, 2, 0.22), transparent 24%),
    radial-gradient(circle at 90% 8%, rgba(28, 176, 246, 0.2), transparent 26%),
    linear-gradient(135deg, #f7ffe8 0%, #eef9ff 52%, #fff3d5 100%);
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.58;
}

.hidden {
  display: none !important;
}

.redeem-shell {
  width: min(1120px, 100%);
  min-height: 100vh;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: clamp(24px, 5vw, 64px);
  align-items: center;
  padding: clamp(24px, 5vw, 72px);
}

.redeem-hero {
  position: relative;
  isolation: isolate;
  display: grid;
  gap: 20px;
}

.redeem-orb {
  position: absolute;
  z-index: -1;
  border-radius: 999px;
  filter: blur(2px);
  animation: floaty 6s ease-in-out infinite;
}

.redeem-orb.one {
  width: 170px;
  height: 170px;
  top: -44px;
  left: -26px;
  background: rgba(88, 204, 2, 0.22);
}

.redeem-orb.two {
  width: 110px;
  height: 110px;
  right: 34px;
  bottom: 44px;
  background: rgba(255, 199, 44, 0.32);
  animation-delay: -2s;
}

.brand-pill {
  width: fit-content;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px 10px 10px;
  border: 1px solid rgba(88, 204, 2, 0.28);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.68);
  box-shadow: 0 12px 30px rgba(42, 99, 63, 0.08);
  font-weight: 800;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 13px;
  background: var(--leaf);
  color: white;
  font-size: 22px;
  font-weight: 900;
  box-shadow: inset 0 -3px 0 rgba(0, 0, 0, 0.14);
}

.redeem-hero h1 {
  margin: 0;
  max-width: 560px;
  font-size: clamp(42px, 7vw, 76px);
  line-height: 0.96;
  letter-spacing: -0.06em;
}

.redeem-hero p {
  margin: 0;
  max-width: 480px;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.8;
}

.hero-code {
  width: fit-content;
  padding: 14px 18px;
  border: 1px dashed rgba(43, 140, 16, 0.38);
  border-radius: 18px;
  background: rgba(255, 248, 222, 0.85);
  color: var(--leaf-dark);
  font-weight: 900;
  letter-spacing: 0.08em;
}

.redeem-card {
  display: grid;
  gap: 22px;
  padding: clamp(22px, 4vw, 36px);
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 30px;
  background: var(--paper);
  box-shadow: 0 30px 80px rgba(21, 78, 45, 0.16);
  backdrop-filter: blur(18px);
}

.tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.62);
}

.tab {
  min-height: 44px;
  border: 0;
  border-radius: 13px;
  background: transparent;
  color: var(--muted);
  font-weight: 800;
}

.tab.active {
  background: var(--ink);
  color: white;
  box-shadow: 0 10px 24px rgba(18, 32, 25, 0.18);
}

.redeem-form {
  display: grid;
  gap: 16px;
}

.panel {
  display: none;
  gap: 16px;
}

.panel.active {
  display: grid;
}

label {
  display: grid;
  gap: 8px;
  color: var(--ink);
  font-weight: 800;
}

label span {
  font-size: 13px;
}

input,
select {
  width: 100%;
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.86);
  color: var(--ink);
  padding: 11px 14px;
  outline: none;
  transition: border-color 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
}

input:focus,
select:focus {
  border-color: rgba(88, 204, 2, 0.72);
  box-shadow: 0 0 0 4px rgba(88, 204, 2, 0.14);
  background: white;
}

.phone-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
}

.phone-prefix {
  display: grid;
  place-items: center;
  min-height: 48px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.72);
  font-weight: 900;
}

.ghost-btn,
.primary-btn {
  min-height: 48px;
  border: 0;
  border-radius: 16px;
  font-weight: 900;
}

.ghost-btn {
  padding: 0 16px;
  background: #eaf8ff;
  color: #096aa0;
}

.primary-btn {
  margin-top: 6px;
  background: linear-gradient(135deg, var(--leaf) 0%, #7ee33a 100%);
  color: white;
  box-shadow: 0 16px 34px rgba(43, 140, 16, 0.25), inset 0 -4px 0 rgba(0, 0, 0, 0.12);
}

.result-box {
  display: grid;
  gap: 8px;
  padding: 18px;
  border-radius: 20px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.65);
}

.result-box strong {
  font-size: 18px;
}

.result-box p {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.result-box.success {
  border-color: rgba(8, 116, 67, 0.28);
  background: rgba(232, 249, 239, 0.86);
  color: var(--success);
}

.result-box.warning {
  border-color: rgba(184, 110, 0, 0.28);
  background: rgba(255, 246, 224, 0.88);
  color: var(--warn);
}

.result-box.error {
  border-color: rgba(217, 45, 32, 0.22);
  background: rgba(255, 235, 232, 0.86);
  color: var(--danger);
}

.result-box.loading {
  border-color: rgba(28, 176, 246, 0.3);
  background: rgba(234, 248, 255, 0.9);
  color: #096aa0;
}

.result-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 8px;
}

.result-pill {
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.68);
  color: var(--ink);
  font-size: 12px;
}

.result-pill b {
  display: block;
  margin-bottom: 4px;
}

.completed-view {
  display: grid;
  justify-items: center;
  gap: 12px;
  padding: 26px 18px 22px;
  border: 1px solid rgba(8, 116, 67, 0.18);
  border-radius: 24px;
  background:
    radial-gradient(circle at 50% 0%, rgba(126, 227, 58, 0.2), transparent 42%),
    rgba(255, 255, 255, 0.7);
  text-align: center;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.completed-view.hidden {
  display: none;
}

.completed-badge {
  display: grid;
  place-items: center;
  width: 74px;
  height: 74px;
  border-radius: 26px;
  background: linear-gradient(135deg, var(--leaf), #7ee33a);
  color: white;
  font-size: 42px;
  font-weight: 900;
  box-shadow: 0 18px 35px rgba(43, 140, 16, 0.24), inset 0 -5px 0 rgba(0, 0, 0, 0.12);
}

.completed-view h2 {
  margin: 4px 0 0;
  color: var(--success);
  font-size: clamp(28px, 5vw, 42px);
  letter-spacing: -0.04em;
}

.completed-view p {
  margin: 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.7;
}

.completed-info {
  width: min(360px, 100%);
  margin-top: 10px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.completed-info span,
.completed-info small {
  display: block;
  color: var(--muted);
}

.completed-info span {
  margin-bottom: 8px;
  font-size: 12px;
  font-weight: 900;
}

.completed-info strong {
  display: block;
  color: var(--ink);
  font-size: clamp(20px, 4vw, 28px);
  line-height: 1.25;
  word-break: break-all;
}

.completed-info small {
  margin-top: 8px;
  line-height: 1.6;
}

.redeem-modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(13, 22, 34, 0.46);
  backdrop-filter: blur(10px);
}

.redeem-modal.hidden {
  display: none;
}

.redeem-modal-card {
  width: min(420px, 100%);
  padding: 28px;
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 28px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 28px 70px rgba(31, 44, 59, 0.26);
  text-align: center;
}

.redeem-modal-card h2 {
  margin: 0;
  color: var(--danger);
  font-size: 28px;
}

.redeem-modal-card p {
  margin: 14px 0 24px;
  color: var(--ink);
  font-size: 17px;
  font-weight: 800;
}

.redeem-modal-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.secondary-modal-btn,
.primary-modal-btn {
  min-height: 46px;
  border: 0;
  border-radius: 15px;
  font-weight: 900;
  cursor: pointer;
}

.secondary-modal-btn {
  background: #eef3f7;
  color: var(--muted);
}

.primary-modal-btn {
  background: linear-gradient(135deg, var(--leaf), #7ee33a);
  color: white;
}

@keyframes floaty {
  0%,
  100% {
    transform: translate3d(0, 0, 0);
  }
  50% {
    transform: translate3d(0, -14px, 0);
  }
}

@media (max-width: 860px) {
  .redeem-shell {
    grid-template-columns: 1fr;
    padding: 24px;
  }

  .redeem-hero {
    text-align: left;
  }
}

@media (max-width: 560px) {
  .phone-row {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .ghost-btn {
    grid-column: 1 / -1;
  }

  .result-grid {
    grid-template-columns: 1fr;
  }
}
