:root {
  color-scheme: dark;
  --bg: #16222f;
  --card: #1f2d3b;
  --input: #263341;
  --text-main: #f1f7ff;
  --text-sub: #9eb0c2;
  --primary: #3ba9ff;
  --primary-2: #5ac0ff;
  --danger: #ff7272;
  --success: #8ef8b5;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Microsoft YaHei", "PingFang SC", sans-serif;
  background: radial-gradient(circle at top, #1f3348, #131c27 70%);
  color: var(--text-main);
  min-height: 100vh;
}

.page {
  width: min(480px, 92vw);
  margin: 20px auto;
  padding-bottom: 20px;
}

.balance-card,
.form-card {
  background: linear-gradient(180deg, #1f2f40, #192633);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 18px;
  box-shadow: inset 0 0 0 1px rgba(136, 189, 237, 0.08);
}

.balance-card {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 16px;
  margin-bottom: 18px;
}

.divider {
  width: 1px;
  height: 52px;
  background: rgba(255, 255, 255, 0.14);
}

.label {
  margin: 0;
  color: var(--text-sub);
  font-size: 14px;
}

.value {
  margin: 6px 0 0;
  color: #53c3ff;
  font-size: 33px;
  font-weight: 700;
}

.balance-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.balance-item:last-child {
  align-items: flex-end;
}

.recharge-btn {
  margin-top: 8px;
  border: 0;
  border-radius: 999px;
  padding: 5px 12px;
  color: #fff;
  background: linear-gradient(180deg, #4fc0ff, #2f8de7);
  cursor: pointer;
}

.recharge-link {
  text-decoration: none;
  display: inline-block;
}

.form-card {
  padding: 20px 16px 22px;
}

.title {
  margin: 0 0 16px;
  font-size: 38px;
  color: #eaf6ff;
  letter-spacing: 1px;
}

.field-label {
  display: block;
  margin: 14px 4px 9px;
  color: #c8d5e4;
  font-size: 16px;
}

.input-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--input);
  border-radius: 12px;
  padding: 0 12px;
}

input {
  flex: 1;
  border: 0;
  background: transparent;
  color: #dbeeff;
  font-size: 18px;
  padding: 17px 4px;
  outline: none;
}

input::placeholder {
  color: #7f91a4;
}

input:disabled {
  color: #6c7f92;
  cursor: not-allowed;
}

.icon-btn {
  border: 0;
  background: transparent;
  color: #98a9bc;
  font-size: 14px;
  cursor: pointer;
}

.payment-grid {
  margin-top: 10px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.payment-option {
  border: 1px solid rgba(132, 160, 188, 0.45);
  border-radius: 16px;
  background: #223242;
  color: #9fb1c4;
  min-height: 120px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  transition: 0.2s ease;
}

.payment-option.active {
  border-color: #58bcff;
  color: #ecf8ff;
  background: linear-gradient(180deg, #41637f, #27435b);
  box-shadow: 0 0 18px rgba(56, 155, 235, 0.2);
}

.option-title {
  font-size: 31px;
  margin-bottom: 6px;
  font-weight: 600;
}

.option-sub {
  font-size: 16px;
}

.tip {
  text-align: center;
  color: #aebed0;
  margin: 20px 0 12px;
}

.submit-btn {
  width: 100%;
  border: 0;
  border-radius: 999px;
  padding: 16px;
  color: #fff;
  font-size: 43px;
  font-weight: 700;
  background: linear-gradient(180deg, var(--primary-2), #2f88d9);
  cursor: pointer;
}

.submit-btn:disabled {
  opacity: 0.72;
  cursor: wait;
}

.message {
  text-align: center;
  min-height: 24px;
  margin: 10px 0 0;
  color: #c8d8e7;
}

.message.error {
  color: var(--danger);
}

.message.success {
  color: var(--success);
}

.modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.62);
  display: grid;
  place-items: center;
  z-index: 1000;
  padding: 16px;
}

.modal.hidden {
  display: none;
}

.modal-panel {
  width: min(420px, 94vw);
  background: #1f2f40;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  padding: 18px 16px 16px;
}

.modal-title {
  margin: 0;
  font-size: 24px;
}

.modal-subtitle {
  margin: 8px 0 12px;
  color: #a9bacd;
}

.qrcode-box {
  width: 180px;
  min-height: 180px;
  margin: 0 auto;
  background: #fff;
  border-radius: 12px;
  display: grid;
  place-items: center;
  overflow: hidden;
}

.recharge-address {
  margin: 12px 0;
  padding: 10px 8px;
  border-radius: 10px;
  background: #263646;
  color: #eaf5ff;
  font-size: 13px;
  text-align: center;
  word-break: break-all;
}

.modal-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.modal-btn {
  border: 0;
  border-radius: 10px;
  padding: 10px 12px;
  color: #fff;
  background: linear-gradient(180deg, #4ebdfb, #2d8fe6);
  cursor: pointer;
}

.modal-btn.ghost {
  background: #334353;
}

.amount-row {
  margin-top: 10px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
}

.amount-row input {
  background: #2a3a4b;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  padding: 10px 12px;
  color: #e8f4ff;
  font-size: 16px;
}

.modal-btn.confirm {
  min-width: 108px;
}

.modal-tip {
  margin: 10px 0 0;
  color: #9ab0c4;
  font-size: 12px;
}

.recharge-page-card {
  padding-bottom: 28px;
}

.recharge-top-tip {
  margin: 0 0 14px;
}

.recharge-qrcode {
  margin-bottom: 12px;
}

.recharge-inline {
  margin-top: 8px;
}

.small-btn {
  font-size: 20px;
  padding: 12px;
}

@media (max-width: 520px) {
  .title {
    font-size: 30px;
  }

  .value {
    font-size: 25px;
  }

  input {
    font-size: 16px;
  }

  .option-title {
    font-size: 24px;
  }

  .submit-btn {
    font-size: 34px;
  }
}

.result-page {
  margin-top: 14px;
}

.success-card {
  position: relative;
  overflow: hidden;
  border-radius: 20px;
  padding: 84px 24px 28px;
  background: linear-gradient(180deg, #2fa75f, #249750);
  border: 1px solid rgba(165, 255, 198, 0.28);
}

.success-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 20% 8%, rgba(166, 255, 215, 0.3), transparent 42%);
  pointer-events: none;
}

.bubble {
  position: absolute;
  border-radius: 50%;
  background: rgba(173, 255, 198, 0.16);
}

.bubble-lg {
  width: 200px;
  height: 200px;
  top: -58px;
  left: 50%;
  transform: translateX(-50%);
}

.bubble-md {
  width: 122px;
  height: 122px;
  top: 138px;
  left: 50%;
  transform: translateX(-65%);
}

.bubble-sm {
  width: 74px;
  height: 74px;
  top: 206px;
  left: 50%;
  transform: translateX(-50%);
}

.check {
  width: 74px;
  height: 74px;
  border-radius: 50%;
  margin: 0 auto 18px;
  background: rgba(177, 255, 206, 0.35);
  display: grid;
  place-items: center;
  font-size: 44px;
  font-weight: 700;
  color: #eafff0;
  position: relative;
  z-index: 2;
}

.success-title {
  margin: 0;
  text-align: center;
  font-size: 52px;
  font-weight: 700;
  position: relative;
  z-index: 2;
}

.energy-line {
  margin: 6px 0 0;
  text-align: center;
  position: relative;
  z-index: 2;
}

.energy-line strong {
  font-size: 68px;
  letter-spacing: 1px;
}

.energy-line span {
  font-size: 40px;
  font-weight: 600;
  margin-left: 8px;
}

.success-tip {
  text-align: center;
  margin: 10px 0 0;
  font-size: 33px;
  color: #ebfff2;
  position: relative;
  z-index: 2;
}

.detail-card {
  margin-top: 18px;
  border-radius: 18px;
  padding: 10px 20px;
  background: #27323f;
  border: 1px solid rgba(255, 255, 255, 0.09);
}

.detail-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  padding: 15px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.28);
  font-size: 40px;
  color: #b2bfce;
}

.detail-row:last-child {
  border-bottom: 0;
}

.detail-row span:last-child {
  color: #f6fbff;
  max-width: 62%;
  text-align: right;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.detail-row .highlight {
  color: #3cabff;
  font-weight: 700;
}

.link-btn {
  margin-top: 22px;
  display: block;
  text-align: center;
  text-decoration: none;
}

@media (max-width: 520px) {
  .success-card {
    padding-top: 70px;
  }

  .success-title {
    font-size: 42px;
  }

  .energy-line strong {
    font-size: 52px;
  }

  .energy-line span {
    font-size: 30px;
  }

  .success-tip {
    font-size: 24px;
  }

  .detail-row {
    font-size: 30px;
  }
}
