*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  background-color: #0d0d0f;
  color: #ffffff;
  min-height: 100vh;
  line-height: 1.5;
}

.icon {
  width: 1em;
  height: 1em;
  display: block;
  flex-shrink: 0;
}

.page {
  max-width: 430px;
  margin: 0 auto;
  min-height: 100vh;
  background: linear-gradient(180deg, #16161a 0%, #121214 120px, #121214 100%);
  position: relative;
}

.status-bar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: 12px 0 10px;
  position: relative;
  min-height: 44px;
}

.promo-banner {
  position: relative;
  right: 0;
  top: 0;
  display: flex;
  align-items: center;
  gap: 6px;
  background: linear-gradient(90deg, #ff6b35, #ff4757);
  padding: 7px 14px 7px 14px;
  border-radius: 20px 0 0 20px;
  max-width: 68%;
  box-shadow: 0 4px 12px rgba(255, 71, 87, 0.35);
}

.promo-icon {
  width: 16px;
  height: 16px;
  color: #ffffff;
  flex-shrink: 0;
}

.promo-text {
  font-size: 12px;
  font-weight: 600;
  color: #ffffff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.content {
  padding: 4px 16px 36px;
}

.brand-title {
  font-size: 22px;
  font-weight: 700;
  color: #f5c518;
  text-align: center;
  margin-bottom: 16px;
  letter-spacing: 0.05em;
}

.balance-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  background: linear-gradient(135deg, #1e1e22 0%, #252528 100%);
  border: 1.5px solid #2a2a30;
  border-radius: 12px;
  padding: 20px 16px;
  margin-bottom: 18px;
}

.balance-label {
  font-size: 14px;
  color: #9999a5;
  letter-spacing: 0.04em;
}

.balance-amount {
  font-size: 36px;
  font-weight: 700;
  color: #f5c518;
  line-height: 1.2;
}

.balance-unit {
  font-size: 22px;
  margin-right: 4px;
}

.balance-wan {
  font-size: 24px;
  margin-left: 2px;
}

.reserve-recharge-btn {
  width: 100%;
  margin-top: 6px;
  background: linear-gradient(180deg, #f8d030 0%, #f5c518 100%);
  border: none;
  border-radius: 22px;
  color: #000000;
  font-size: 15px;
  font-weight: 600;
  padding: 12px 16px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: opacity 0.2s, transform 0.15s;
  box-shadow: 0 4px 14px rgba(245, 197, 24, 0.3);
}

.reserve-recharge-btn:active {
  opacity: 0.9;
  transform: scale(0.98);
}

.hidden {
  display: none;
}

.title-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 22px;
}

.title-icon {
  width: 22px;
  height: 22px;
  color: #f5c518;
  margin-top: 2px;
}

.page-title {
  font-size: 18px;
  font-weight: 600;
  color: #ffffff;
  line-height: 1.45;
  flex: 1;
}

.payment-section {
  margin-bottom: 26px;
}

.section-title {
  font-size: 15px;
  font-weight: 600;
  color: #ffffff;
  margin-bottom: 14px;
  padding-left: 2px;
}

.payment-grid {
  display: flex;
  gap: 10px;
}

.payment-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 44px;
  background-color: #2c2c2c;
  border: 1px solid #444444;
  border-radius: 8px;
  color: #ffffff;
  font-size: 14px;
  font-weight: 400;
  padding: 0 8px;
  cursor: pointer;
  transition: border-color 0.2s;
  -webkit-tap-highlight-color: transparent;
}

.payment-btn.active {
  border: 1.5px solid #d4b16a;
  color: #ffffff;
}

.form-section {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 22px;
}

.purpose-btn {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  background-color: #1e1e22;
  border: 1.5px solid #2a2a30;
  border-radius: 10px;
  color: #ffffff;
  font-size: 15px;
  padding: 14px 16px;
  cursor: pointer;
  transition: border-color 0.2s;
  -webkit-tap-highlight-color: transparent;
  text-align: left;
}

.purpose-btn:active {
  border-color: #f5c518;
}

.purpose-label {
  font-weight: 500;
  color: #ffffff;
  flex-shrink: 0;
}

.purpose-preview {
  flex: 1;
  color: #666670;
  font-size: 14px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: right;
}

.purpose-preview.filled {
  color: #f5c518;
}

.purpose-arrow {
  font-size: 18px;
  color: #666670;
  line-height: 1;
  flex-shrink: 0;
}

.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s, visibility 0.25s;
}

.modal-overlay.show {
  opacity: 1;
  visibility: visible;
}

.modal-overlay::before {
  display: none;
}

.modal-mask {
  position: absolute;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.65);
}

.modal-panel {
  z-index: 1;
  position: absolute;
  left: 50%;
  top: 50%;
  width: calc(100% - 40px);
  max-width: 380px;
  background-color: #1e1e22;
  border: 1.5px solid #2a2a30;
  border-radius: 14px;
  overflow: hidden;
  transform: translate(-50%, -50%) scale(0.92);
  transition: transform 0.25s ease, opacity 0.25s ease;
  opacity: 0;
}

.modal-overlay.show .modal-panel {
  transform: translate(-50%, -50%) scale(1);
  opacity: 1;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 18px 0;
}

.modal-title {
  font-size: 17px;
  font-weight: 600;
  color: #ffffff;
}

.modal-close {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  color: #9999a5;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.modal-body {
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.modal-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.modal-label {
  font-size: 14px;
  font-weight: 500;
  color: #9999a5;
}

.modal-input {
  width: 100%;
  background-color: #121214;
  border: 1.5px solid #2a2a30;
  border-radius: 8px;
  color: #ffffff;
  font-size: 15px;
  padding: 12px 14px;
  outline: none;
  -webkit-appearance: none;
  appearance: none;
  transition: border-color 0.2s;
}

.modal-input:focus {
  border-color: #f5c518;
}

.modal-input::placeholder {
  color: #666670;
}

.amount-input-row {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.amount-value-input {
  width: 100%;
}

.unit-grid {
  display: flex;
  gap: 8px;
}

.unit-btn {
  flex: 1;
  height: 36px;
  background-color: #121214;
  border: 1px solid #444444;
  border-radius: 8px;
  color: #ffffff;
  font-size: 14px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: border-color 0.2s, color 0.2s;
}

.unit-btn.active {
  border: 1.5px solid #d4b16a;
  color: #f5c518;
}

.picker-trigger {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background-color: #121214;
  border: 1.5px solid #2a2a30;
  border-radius: 8px;
  color: #ffffff;
  font-size: 15px;
  padding: 12px 14px;
  cursor: pointer;
  text-align: left;
  -webkit-tap-highlight-color: transparent;
  transition: border-color 0.2s;
}

.picker-trigger:active {
  border-color: #f5c518;
}

.picker-trigger-text {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #666670;
}

.picker-trigger-text.selected {
  color: #ffffff;
}

.picker-trigger-arrow {
  font-size: 18px;
  color: #666670;
  line-height: 1;
  flex-shrink: 0;
}

.sheet-overlay {
  position: fixed;
  inset: 0;
  z-index: 1100;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s, visibility 0.25s;
}

.sheet-overlay.show {
  opacity: 1;
  visibility: visible;
}

.sheet-mask {
  position: absolute;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.55);
}

.sheet-panel {
  position: absolute;
  z-index: 1;
  left: 50%;
  top: 50%;
  width: calc(100% - 40px);
  max-width: 380px;
  max-height: 60vh;
  background-color: #1e1e22;
  border: 1.5px solid #2a2a30;
  border-radius: 14px;
  display: flex;
  flex-direction: column;
  transform: translate(-50%, -50%) scale(0.92);
  transition: transform 0.25s ease, opacity 0.25s ease;
  opacity: 0;
}

.sheet-overlay.show .sheet-panel {
  transform: translate(-50%, -50%) scale(1);
  opacity: 1;
}

.sheet-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 18px;
  border-bottom: 1px solid #2a2a30;
  flex-shrink: 0;
}

.sheet-title {
  font-size: 17px;
  font-weight: 600;
  color: #ffffff;
}

.sheet-close {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  color: #9999a5;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.sheet-body {
  overflow-y: auto;
  padding: 8px 0 20px;
  -webkit-overflow-scrolling: touch;
}

.picker-group {
  padding: 0;
}

.picker-group-title {
  display: none;
}

.picker-option {
  width: 100%;
  display: block;
  background: none;
  border: none;
  color: #ffffff;
  font-size: 15px;
  text-align: left;
  padding: 14px 18px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background-color 0.15s;
  position: relative;
}

.picker-option:active {
  background-color: #2a2a30;
}

.picker-option.active {
  color: #f5c518;
  background-color: rgba(245, 197, 24, 0.08);
}

.picker-option.active::after {
  content: "✓";
  position: absolute;
  right: 18px;
  top: 50%;
  transform: translateY(-50%);
  color: #f5c518;
  font-size: 16px;
  font-weight: 700;
}

.modal-footer {
  display: flex;
  gap: 12px;
  padding: 0 18px 18px;
}

.modal-btn {
  flex: 1;
  height: 44px;
  border-radius: 22px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  -webkit-tap-highlight-color: transparent;
  transition: opacity 0.2s;
}

.modal-btn-cancel {
  background-color: #2c2c2c;
  color: #ffffff;
  border: 1px solid #444444;
}

.modal-btn-confirm {
  background: linear-gradient(180deg, #f8d030 0%, #f5c518 100%);
  color: #000000;
}

.modal-btn:active {
  opacity: 0.85;
}

.form-tip {
  min-height: 20px;
  font-size: 13px;
  color: #ff6b6b;
  text-align: center;
  margin-bottom: 12px;
  line-height: 1.5;
}

#successModal {
  z-index: 1200;
}

#reserveRechargeModal {
  z-index: 1050;
}

.toast-overlay {
  position: fixed;
  inset: 0;
  z-index: 1300;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s, visibility 0.2s;
}

.toast-overlay.show {
  opacity: 1;
  visibility: visible;
}

.toast-panel {
  background-color: #1e1e22;
  border: 1.5px solid #2a2a30;
  border-radius: 14px;
  padding: 24px 28px;
  text-align: center;
  min-width: 260px;
  max-width: 320px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.45);
  transform: scale(0.92);
  transition: transform 0.2s;
}

.toast-overlay.show .toast-panel {
  transform: scale(1);
}

.toast-icon {
  width: 48px;
  height: 48px;
  margin: 0 auto 12px;
  border-radius: 50%;
  background: linear-gradient(180deg, #f8d030 0%, #f5c518 100%);
  color: #000000;
  font-size: 24px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

.toast-text {
  font-size: 15px;
  color: #ffffff;
  line-height: 1.6;
  white-space: pre-line;
}

.reserve-payment-grid {
  margin-top: 0;
}

.modal-tip {
  min-height: 0;
  font-size: 13px;
  color: #ff6b6b;
  line-height: 1.5;
  margin-bottom: 4px;
}

.modal-tip:not(:empty) {
  margin-bottom: 10px;
}

.success-panel {
  text-align: center;
  padding: 28px 24px 24px;
}

.success-icon {
  width: 56px;
  height: 56px;
  margin: 0 auto 16px;
  border-radius: 50%;
  background: linear-gradient(180deg, #f8d030 0%, #f5c518 100%);
  color: #000000;
  font-size: 28px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

.success-title {
  font-size: 20px;
  font-weight: 600;
  color: #ffffff;
  margin-bottom: 12px;
}

.success-message {
  font-size: 14px;
  color: #9999a5;
  line-height: 1.6;
  margin-bottom: 24px;
  white-space: pre-line;
}

.success-btn {
  width: 100%;
}

.success-panel .modal-header,
.success-panel .modal-footer {
  display: none;
}

.input-group {
  position: relative;
  display: flex;
  align-items: center;
}

.field-icon {
  position: absolute;
  left: 14px;
  width: 20px;
  height: 20px;
  color: #666670;
  pointer-events: none;
  z-index: 1;
  transition: color 0.2s;
}

.form-input {
  width: 100%;
  background-color: #1e1e22;
  border: 1.5px solid #2a2a30;
  border-radius: 10px;
  color: #ffffff;
  font-size: 15px;
  padding: 14px 16px 14px 44px;
  outline: none;
  -webkit-appearance: none;
  appearance: none;
  transition: border-color 0.2s;
}

.form-input:focus {
  border-color: #f5c518;
}

.input-group:focus-within .field-icon {
  color: #f5c518;
}

.form-input::placeholder {
  color: #666670;
}

.agreement {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 26px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.agreement-checkbox {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.checkbox-custom {
  width: 18px;
  height: 18px;
  min-width: 18px;
  border: 1.5px solid #555560;
  border-radius: 4px;
  background-color: transparent;
  position: relative;
  transition: border-color 0.2s, background-color 0.2s;
}

.agreement-checkbox:checked + .checkbox-custom {
  background-color: #f5c518;
  border-color: #f5c518;
}

.agreement-checkbox:checked + .checkbox-custom::after {
  content: "";
  position: absolute;
  left: 5px;
  top: 2px;
  width: 5px;
  height: 9px;
  border: solid #000000;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.agreement-text {
  font-size: 13px;
  color: #9999a5;
  line-height: 1.4;
}

.agreement-link {
  color: #f5c518;
  text-decoration: none;
}

.submit-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: linear-gradient(180deg, #f8d030 0%, #f5c518 100%);
  border: none;
  border-radius: 26px;
  color: #000000;
  font-size: 17px;
  font-weight: 600;
  padding: 15px;
  cursor: pointer;
  transition: opacity 0.2s, transform 0.15s;
  -webkit-tap-highlight-color: transparent;
  box-shadow: 0 6px 20px rgba(245, 197, 24, 0.35);
}

.submit-icon {
  width: 20px;
  height: 20px;
  color: #000000;
}

.submit-btn:active {
  opacity: 0.9;
  transform: scale(0.98);
}

@media (max-width: 360px) {
  .promo-text {
    font-size: 11px;
  }

  .page-title {
    font-size: 16px;
  }

  .brand-title {
    font-size: 20px;
  }

  .balance-amount {
    font-size: 32px;
  }
}
