/* 充值中心页面样式 */
.recharge-container {
  min-height: calc(100vh - 140px);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 40px 20px;
  background: var(--surface-warm);
}

.recharge-wrapper {
  width: 100%;
  max-width: 600px;
  position: relative;
}

/* 充值卡片 */
.recharge-card {
  background: var(--surface);
  border-radius: var(--radius-xl);
  padding: 40px;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border-light);
}

.recharge-header {
  margin-bottom: 30px;
}

.recharge-title {
  font-size: 32px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 10px;
  text-align: center;
}

.recharge-subtitle {
  font-size: 16px;
  color: var(--text-secondary);
  text-align: center;
  line-height: 1.6;
}

/* 余额区域 */
.balance-section {
  background: linear-gradient(135deg, #C23A2B, #B8352B);
  border-radius: 8px;
  padding: 24px;
  margin-bottom: 28px;
}

.balance-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.balance-label {
  color: rgba(255, 255, 255, 0.85);
  font-size: 15px;
  font-weight: 500;
}

.balance-value {
  color: white;
  font-size: 24px;
  font-weight: 700;
}

.balance-amount {
  font-size: 32px;
}

.balance-tip {
  display: flex;
  align-items: center;
  gap: 6px;
  color: rgba(255, 255, 255, 0.7);
  font-size: 12px;
}

/* 金额选择区域 */
.amount-section {
  margin-bottom: 28px;
}

.section-label {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 14px;
}

.amount-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.amount-item {
  position: relative;
  background: var(--surface-ink);
  border: 2px solid var(--border);
  border-radius: var(--radius-md);
  padding: 18px 12px;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s var(--ease);
  overflow: hidden;
}

.amount-item:hover {
  border-color: var(--brand);
  background: var(--brand-glow);
}

.amount-item.selected {
  border-color: var(--brand);
  background: var(--brand-glow);
  box-shadow: var(--shadow-brand);
}

.amount-item.selected::after {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 0;
  height: 0;
  border-style: solid;
  border-width: 0 28px 28px 0;
  border-color: transparent var(--brand) transparent transparent;
}

.amount-item.selected::before {
  content: '✓';
  position: absolute;
  top: 2px;
  right: 3px;
  color: white;
  font-size: 11px;
  font-weight: 700;
  z-index: 1;
}

.popular-badge {
  position: absolute;
  top: -1px;
  left: -1px;
  background: linear-gradient(135deg, var(--brand), var(--brand-warm));
  color: white;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 10px;
  border-radius: 10px 0 10px 0;
  z-index: 1;
}

.amount-coins {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.amount-item.selected .amount-coins {
  color: var(--brand);
}

.amount-price {
  font-size: 14px;
  color: var(--text-secondary);
  font-weight: 500;
}

/* 充值按钮 */
.recharge-button {
  width: 100%;
  padding: 16px;
  background: linear-gradient(135deg, var(--brand), var(--brand-warm));
  color: white;
  border: none;
  border-radius: var(--radius-md);
  font-size: 17px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s var(--ease);
  margin-bottom: 24px;
}

.recharge-button:disabled {
  background: var(--text-faint);
  cursor: not-allowed;
  color: var(--text-muted);
}

.recharge-button:not(:disabled):hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-brand);
}

.recharge-button:not(:disabled):active {
  transform: translateY(0);
}

/* 温馨提示 */
.recharge-tips {
  background: var(--surface-rose);
  border-radius: var(--radius-md);
  padding: 16px 20px;
  border-left: 4px solid var(--brand-warm);
}

.recharge-tips h4 {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.recharge-tips ul {
  list-style: none;
  padding: 0;
}

.recharge-tips li {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.8;
  padding-left: 16px;
  position: relative;
}

.recharge-tips li::before {
  content: '•';
  position: absolute;
  left: 0;
  color: var(--brand-warm);
}

/* ===== 支付弹窗 ===== */
.payment-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 2000;
  align-items: center;
  justify-content: center;
}

.payment-modal.active {
  display: flex;
}

.modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
}

.modal-content {
  position: relative;
  background: var(--surface);
  border-radius: var(--radius-xl);
  padding: 30px;
  width: 90%;
  max-width: 420px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
  animation: modalSlideIn 0.3s var(--ease);
}

@keyframes modalSlideIn {
  from {
    opacity: 0;
    transform: translateY(-30px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}

.modal-header h3 {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-primary);
}

.modal-close {
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  border-radius: 50%;
  transition: background 0.3s var(--ease);
}

.modal-close:hover {
  background: var(--surface-ink);
}

/* 支付信息 */
.payment-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px;
  background: var(--surface-ink);
  border-radius: var(--radius-md);
  margin-bottom: 24px;
}

.payment-amount-label {
  font-size: 14px;
  color: var(--text-secondary);
}

.payment-amount-value {
  font-size: 28px;
  font-weight: 700;
  color: var(--brand);
}

.payment-coins-info {
  text-align: right;
}

.payment-coins-label {
  font-size: 14px;
  color: var(--text-secondary);
  display: block;
}

.payment-coins-value {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-primary);
}

/* 联系客服提示 */
.pay-qr-notice {
  text-align: center;
  padding: 28px 20px;
  margin-bottom: 20px;
}

.qr-notice-icon {
  margin-bottom: 16px;
}

.qr-notice-text {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.qr-notice-sub {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.7;
}

.pay-contact-box {
  background: var(--brand-glow);
  border-radius: var(--radius-md);
  padding: 16px 20px;
  margin-bottom: 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.pay-contact-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 14px;
}

.contact-label {
  color: var(--text-secondary);
}

.contact-value {
  font-weight: 600;
  color: var(--text-primary);
}

/* 已完成支付按钮 */
.payment-complete-btn {
  width: 100%;
  padding: 14px;
  background: linear-gradient(135deg, var(--brand), var(--brand-warm));
  color: white;
  border: none;
  border-radius: var(--radius-md);
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s var(--ease);
}

.payment-complete-btn:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-brand);
}

.payment-complete-btn:active {
  transform: translateY(0);
}

/* ===== 支付结果弹窗 ===== */
.result-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 3000;
  align-items: center;
  justify-content: center;
}

.result-modal.active {
  display: flex;
}

.result-content {
  position: relative;
  background: var(--surface);
  border-radius: var(--radius-xl);
  padding: 40px 30px;
  width: 90%;
  max-width: 400px;
  text-align: center;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
  animation: modalSlideIn 0.3s var(--ease);
}

.result-icon {
  margin-bottom: 20px;
}

.result-icon.failed svg circle {
  animation: resultCircle 0.5s var(--ease) 0.2s both;
}

.result-icon.failed svg path {
  animation: resultCross 0.3s var(--ease) 0.5s both;
}

@keyframes resultCircle {
  from { stroke-dasharray: 0 999; }
  to { stroke-dasharray: 999 0; }
}

@keyframes resultCross {
  from { opacity: 0; }
  to { opacity: 1; }
}

.result-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 12px;
}

.result-message {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.8;
  margin-bottom: 20px;
}

.result-contact {
  background: var(--brand-glow);
  border-radius: var(--radius-md);
  padding: 14px 20px;
  margin-bottom: 24px;
}

.contact-item {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 14px;
  color: var(--text-primary);
}

.contact-item strong {
  color: var(--brand);
  font-size: 16px;
}

.result-actions {
  display: flex;
  gap: 12px;
}

.result-btn {
  flex: 1;
  padding: 12px;
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s var(--ease);
  border: none;
}

.result-btn.retry {
  background: linear-gradient(135deg, var(--brand), var(--brand-warm));
  color: white;
}

.result-btn.retry:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-brand);
}

.result-btn.close {
  background: var(--surface-ink);
  color: var(--text-secondary);
}

.result-btn.close:hover {
  background: var(--border);
}

/* ===== 加载遮罩 ===== */
.loading-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 4000;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(4px);
  align-items: center;
  justify-content: center;
}

.loading-overlay.active {
  display: flex;
}

.loading-spinner {
  text-align: center;
}

.spinner {
  width: 48px;
  height: 48px;
  border: 4px solid var(--brand-glow);
  border-top-color: var(--brand);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto 16px;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.loading-text {
  font-size: 15px;
  color: var(--text-primary);
  font-weight: 500;
}

/* ===== 响应式 ===== */
@media (max-width: 768px) {
  .recharge-card {
    padding: 30px 24px;
  }

  .recharge-title {
    font-size: 28px;
  }

  .amount-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .modal-content {
    padding: 24px;
    margin: 0 16px;
  }
}

@media (max-width: 480px) {
  .recharge-container {
    padding: 20px 12px;
  }

  .recharge-card {
    padding: 24px 18px;
  }

  .recharge-title {
    font-size: 24px;
  }

  .amount-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }

  .amount-item {
    padding: 14px 8px;
  }

  .amount-coins {
    font-size: 18px;
  }

  .balance-value {
    font-size: 20px;
  }

  .balance-amount {
    font-size: 26px;
  }

  .result-content {
    padding: 30px 20px;
  }

  .result-actions {
    flex-direction: column;
  }
}