.recharge-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(15, 23, 42, .48);
  backdrop-filter: blur(6px);
}

.recharge-dialog {
  display: flex;
  flex-direction: column;
  width: 600px;
  max-width: 100%;
  max-height: calc(100dvh - 48px);
  overflow: hidden;
  border: 1px solid var(--ui-border);
  border-radius: 24px;
  background: var(--ui-surface);
  color: var(--ui-text);
  box-shadow: 0 24px 100px rgba(15, 23, 42, .24);
  font-family: var(--font-body), "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 14px;
  line-height: 1.45;
  outline: none;
  animation: recharge-enter .2s ease-out;
}

.recharge-dialog [hidden] { display: none !important; }
.recharge-dialog button { font: inherit; cursor: pointer; }
.recharge-dialog button:disabled { cursor: not-allowed; }
.recharge-dialog svg { width: 18px; height: 18px; flex-shrink: 0; }
.recharge-dialog button:focus-visible { outline: 3px solid #7593e4; outline-offset: 4px; }
.recharge-header { display: flex; flex-shrink: 0; align-items: center; gap: 14px; padding: 24px 28px 20px; }
.recharge-heading-icon { display: grid; place-items: center; width: 44px; height: 44px; border: 1px solid var(--ui-border); border-radius: 14px; background: var(--ui-surface-muted); color: var(--ui-primary); }
.recharge-heading-icon svg { width: 22px; height: 22px; }
.recharge-header h3 { margin: 0; font-size: 22px; line-height: 1.35; font-weight: 700; letter-spacing: -.5px; }
.recharge-header p { margin: 5px 0 0; font-size: 12px; color: var(--ui-text-muted); }
.recharge-close { display: grid; place-items: center; width: 32px; height: 32px; margin: 0 0 auto auto; padding: 0; border: 0; border-radius: 50%; background: var(--ui-surface-soft); color: var(--ui-text-muted); }
.recharge-close:hover { color: var(--ui-text); background: var(--ui-border); }
.recharge-content { min-height: 0; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; padding: 0 28px 16px; }
.recharge-section-label { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 14px; font-size: 12px; font-weight: 600; }
.recharge-rate { margin: -6px 0 19px; color: var(--ui-text-muted); font-size: 11px; }
.recharge-balance { font-size: 11px; color: var(--ui-text-muted); font-weight: 400; }
.recharge-balance strong { margin: 0 3px; color: var(--ui-text); font-variant-numeric: tabular-nums; font-weight: 600; }
.recharge-options { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px 12px; }
.recharge-loading { grid-column: 1 / -1; display: grid; place-items: center; min-height: 260px; border: 1px dashed var(--ui-border); border-radius: 16px; color: var(--ui-text-muted); font-size: 13px; }
.recharge-option { position: relative; display: flex; flex-direction: column; gap: 12px; min-width: 0; padding: 24px 18px 20px; border: 1px solid var(--ui-border); border-radius: 14px; background: var(--ui-surface); color: var(--ui-text); text-align: left; }
.recharge-option:hover { border-color: var(--ui-primary); background: var(--ui-surface-muted); }
.recharge-option[aria-pressed="true"] { border-color: #315f9c; background: #182d4b; color: #fff; box-shadow: inset 0 0 0 1px #7ba2dc; }
.recharge-option-points { display: flex; align-items: baseline; gap: 5px; }
.recharge-option-points strong { font-size: 12px; font-weight: 600; line-height: 1.4; font-variant-numeric: tabular-nums; color: var(--ui-text-muted); }
.recharge-option-points > span { font-size: 11px; color: var(--ui-text-muted); }
.recharge-option-price { display: flex; align-items: baseline; gap: 4px; color: var(--ui-text); white-space: nowrap; }
.recharge-option-price > span { font-size: 16px; }
.recharge-option-price strong { font-weight: 650; font-size: 32px; line-height: 1.1; letter-spacing: -1px; font-variant-numeric: tabular-nums; }
.recharge-option[aria-pressed="true"] .recharge-option-price { color: #fff; }
.recharge-option[aria-pressed="true"] .recharge-option-points strong,
.recharge-option[aria-pressed="true"] .recharge-option-points > span { color: #c1ccdc; }
.recharge-option-bonus { color: var(--ui-primary); font-size: 10px; line-height: 1.5; white-space: nowrap; }
.recharge-option[aria-pressed="true"] .recharge-option-bonus { color: #b8d2ff; }
.recharge-option:disabled { opacity: .55; }
.recharge-special.recharge-option { display: flex; flex-direction: row; align-items: center; justify-content: space-between; width: 100%; margin-bottom: 24px; padding: 18px 20px; border-color: #c8a66b; background: var(--ui-surface-muted); }
.recharge-special[aria-pressed="true"] { background: #182d4b; color: #fff; }
.recharge-special-copy, .recharge-special-price { display: flex; flex-direction: column; gap: 6px; }
.recharge-special-label { color: #997035; font-size: 11px; font-weight: 600; }
.recharge-special-copy strong { font-size: 25px; line-height: 1.3; letter-spacing: -.5px; }
.recharge-special-copy small { font-size: 12px; font-weight: 400; }
.recharge-special-copy > span:last-child { color: var(--ui-text-muted); font-size: 10px; }
.recharge-special-price { flex-shrink: 0; align-items: flex-end; }
.recharge-special-price strong { font-size: 26px; letter-spacing: -1px; }
.recharge-special-price > span { color: var(--ui-text-muted); font-size: 10px; }
.recharge-special[aria-pressed="true"] .recharge-special-label { color: #f4dfb3; }
.recharge-special[aria-pressed="true"] .recharge-special-copy > span:last-child,
.recharge-special[aria-pressed="true"] .recharge-special-price > span { color: #c1ccdc; }
.recharge-option-check { position: absolute; display: grid; place-items: center; width: 20px; height: 20px; right: 12px; bottom: 16px; border: 1px solid var(--ui-border-strong); border-radius: 50%; color: transparent; }
.recharge-option-check svg { width: 12px; height: 12px; stroke-width: 3; }
.recharge-option[aria-pressed="true"] .recharge-option-check { border-color: #d8e6ff; background: #d8e6ff; color: #182d4b; }
.recharge-recommended-label { position: absolute; top: -10px; right: 12px; padding: 3px 8px; border: 1px solid #e5cb93; border-radius: 6px; background: #f4dfb3; color: #654716; font-size: 10px; line-height: 1.3; font-weight: 600; }
.recharge-custom-toggle { display: flex; align-items: center; justify-content: center; gap: 6px; width: 100%; margin-top: 8px; padding: 7px; border: 0; border-radius: 8px; background: transparent; color: var(--ui-text-muted); font-size: 12px !important; }
.recharge-custom-toggle:hover { background: var(--ui-surface-muted); color: var(--ui-primary); }
.recharge-custom-toggle svg { width: 14px; height: 14px; }
.recharge-custom-toggle[aria-expanded="true"] svg { transform: rotate(180deg); }
.recharge-custom { margin-top: 6px; padding: 14px 16px; border: 1px solid var(--ui-border); border-radius: 12px; background: var(--ui-surface-muted); }
.recharge-custom label { display: block; margin-bottom: 7px; font-size: 12px; font-weight: 600; }
.recharge-input-wrap { position: relative; }
.recharge-input-wrap input { width: 100%; min-height: 42px; padding: 10px 54px 10px 12px; border: 1px solid var(--ui-border); border-radius: 8px; font-size: 15px; font-variant-numeric: tabular-nums; }
.recharge-input-wrap > span { position: absolute; right: 14px; top: 12px; color: var(--ui-text-muted); font-size: 12px; pointer-events: none; }
.recharge-custom p { margin: 8px 0 0; color: var(--ui-text-muted); font-size: 11px; line-height: 1.6; }
.recharge-input-wrap input[aria-invalid="true"] { outline: 2px solid var(--ui-danger); outline-offset: 1px; }
.recharge-payment-method { display: flex; align-items: center; gap: 10px; margin-top: 10px; padding: 11px 15px; border: 1px solid var(--ui-border); border-radius: 12px; }
.recharge-alipay-mark { display: grid; place-items: center; width: 31px; height: 31px; border-radius: 8px; background: #1677ff; color: #fff; font-size: 21px; font-weight: 700; }
.recharge-payment-method > div { display: flex; flex-direction: column; gap: 3px; }
.recharge-payment-method strong { font-size: 12px; font-weight: 600; }
.recharge-payment-method div > span { color: var(--ui-text-muted); font-size: 10px; }
.recharge-payment-method > svg { margin-left: auto; color: var(--ui-primary); width: 17px; height: 17px; }
.recharge-status { margin-top: 12px; color: var(--ui-text-muted); font-size: 11px; line-height: 1.6; }
.recharge-status[data-state="error"] { color: var(--ui-danger); }
.recharge-retry { margin-top: 6px; padding: 0; border: 0; background: transparent; color: var(--ui-primary); font-size: 12px !important; text-decoration: underline; text-underline-offset: 3px; }
.recharge-footer { display: grid; flex-shrink: 0; grid-template-columns: 1fr auto; gap: 10px; padding: 18px 28px 16px; border-top: 1px solid var(--ui-border); background: var(--ui-surface-muted); }
.recharge-total > div { display: flex; align-items: baseline; flex-wrap: wrap; gap: 8px; }
.recharge-total > div > span:first-child { font-size: 11px; color: var(--ui-text-muted); }
.recharge-total strong { color: var(--ui-text); font-size: 29px; letter-spacing: -1px; line-height: 1.2; font-weight: 700; font-variant-numeric: tabular-nums; }
.recharge-total p { margin: 5px 0 0; color: var(--ui-text-muted); font-size: 11px; }
.recharge-pay { display: flex; align-items: center; justify-content: center; align-self: center; gap: 14px; min-width: 174px; min-height: 46px; padding: 12px 18px; border: 1px solid #2346b6; border-radius: 10px; background: #3157d5; color: #fff; font-size: 13px !important; font-weight: 600 !important; box-shadow: 0 3px 8px rgba(49, 87, 213, .16); }
.recharge-pay:hover:not(:disabled) { background: #2446b8; transform: translateY(-1px); }
.recharge-pay:disabled { background: var(--ui-surface-soft); border-color: var(--ui-border); color: var(--ui-text-muted); box-shadow: none; }
.recharge-footer-note { grid-column: 1 / -1; display: flex; align-items: center; justify-content: center; gap: 5px; margin: 0; color: var(--ui-text-muted); font-size: 10px; }
.recharge-footer-note svg { width: 12px; height: 12px; }
.recharge-spinner { width: 14px; height: 14px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: recharge-spin .7s linear infinite; }
:is(.recharge-option-bonus, .recharge-special-copy > span:last-child, .recharge-special-price > span, .recharge-payment-method div > span, .recharge-status, .recharge-footer-note, .recharge-rate, .recharge-balance, .recharge-total p) { font-size: 13px; }
.recharge-special-label { color: var(--ui-warning); font-size: 13px; }
.recharge-recommended-label { font-size: 12px; }
html[data-theme="dark"] .recharge-special:not([aria-pressed="true"]) .recharge-special-label { color: var(--ui-warning); }
html[data-theme="dark"] .recharge-recommended-label { color: var(--ui-warning); border-color: #6c5939; background: var(--ui-warning-soft); }
html[data-theme="dark"] .recharge-pay:not(:disabled) { background: var(--ui-primary); border-color: var(--ui-primary); color: var(--ui-on-primary); box-shadow: none; }

@keyframes recharge-enter { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
@keyframes recharge-spin { to { transform: rotate(360deg); } }

@media (max-width: 560px) {
  .recharge-overlay { padding: 12px; }
  .recharge-dialog { max-height: calc(100dvh - 24px); border-radius: 18px; }
  .recharge-header { padding: 20px 18px; gap: 10px; }
  .recharge-header h3 { font-size: 20px; }
  .recharge-heading-icon { width: 38px; height: 38px; border-radius: 12px; }
  .recharge-header p { font-size: 10px; }
  .recharge-content { padding: 0 18px 16px; }
  .recharge-options { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 10px; }
  .recharge-option { padding: 20px 14px 16px; }
  .recharge-option-points { flex-wrap: wrap; gap: 3px; }
  .recharge-option-points strong { font-size: 12px; }
  .recharge-option-points > span { font-size: 10px; }
  .recharge-option-check { width: 15px; height: 15px; right: 9px; bottom: 17px; }
  .recharge-option-check svg { width: 10px; height: 10px; }
  .recharge-option-price strong { font-size: 29px; }
  .recharge-special.recharge-option { padding: 14px; gap: 10px; }
  .recharge-special-copy strong { font-size: 23px; }
  .recharge-special-price strong { font-size: 24px; }
  .recharge-footer { padding: 18px; grid-template-columns: 1fr; gap: 12px; }
  .recharge-pay { width: 100%; }
  .recharge-total { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 6px 10px; }
  .recharge-total p { margin: 0; font-size: 10px; }
  .recharge-total strong { font-size: 26px; }
  .recharge-total > div { gap: 6px; }
}

@media (prefers-reduced-motion: reduce) {
  .recharge-dialog, .recharge-spinner { animation: none; }
  .recharge-dialog button { transition: none; }
}
