.billing-grid {
  grid-template-columns: minmax(0, 2fr) minmax(200px, 1fr);
  gap: 40px;
}
.billing-grid .form-panel {
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}
#redeem-form {
  padding-left: 32px;
  border-left: 1px solid #e5e7e7;
}
#recharge-form {
  gap: 12px;
}
#recharge-form fieldset {
  min-width: 0;
  padding: 0;
  margin: 0 0 8px;
  border: 0;
}
#recharge-form legend {
  padding: 0;
  margin-bottom: 12px;
  font-weight: 550;
}
.payment-methods {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.payment-method {
  position: relative;
  cursor: pointer;
}
.payment-method-face {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
  min-height: 64px;
  padding: 12px 8px;
  border: 1px solid #d8dddd;
  border-radius: 6px;
  font-weight: 550;
}
.payment-method img {
  object-fit: contain;
  flex-shrink: 0;
}
.payment-method input:checked + .payment-method-face {
  border-color: #0287cc;
  background: #f0f8ff;
}
.payment-method[data-method='wxpay'] input:checked + .payment-method-face {
  border-color: #159447;
  background: #f0faf3;
}
.payment-method input:focus-visible + .payment-method-face,
#recharge-form button:focus-visible {
  outline: 2px solid #117d68;
  outline-offset: 3px;
}
.payment-method input:disabled + .payment-method-face {
  color: #73797c;
  opacity: 0.6;
  cursor: not-allowed;
}
.payment-unavailable {
  font-size: 11px;
  font-weight: 400;
}
.recharge-amounts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}
.recharge-amounts button {
  min-width: 0;
  height: 48px;
  padding: 6px;
  font-variant-numeric: tabular-nums;
}
.recharge-amounts button[aria-pressed='true'] {
  border-color: #117d68;
  background: #edf7f3;
  color: #08644f;
  font-weight: 650;
}
.currency-input {
  position: relative;
}
.currency-input > span {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: #73797c;
}
.currency-input input {
  padding-left: 32px;
  min-height: 44px;
  font-variant-numeric: tabular-nums;
}
#payment-message {
  margin: 0;
  font-size: 12px;
}
.payment-summary {
  display: grid;
  gap: 8px;
  margin: 8px 0;
  padding-top: 16px;
  border-top: 1px solid #e5e7e7;
}
.payment-summary > div {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
}
.payment-summary dt {
  color: #73797c;
}
.payment-summary dd {
  margin: 0;
  font-variant-numeric: tabular-nums;
}
.payment-total dd {
  font-size: 20px;
  font-weight: 650;
}
#recharge-submit {
  min-height: 44px;
}
#recharge-form button:disabled {
  cursor: not-allowed;
}
.payment-note {
  margin: -2px 0 0;
  color: #5c6965;
  font-size: 12px;
  line-height: 1.5;
}
/* A compact reminder that pending orders live in 账单; it never competes with the forms. */
.pending-notice {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 6px 16px;
  margin: 0 0 22px;
  padding: 10px 14px;
  border: 1px solid #ecd9a6;
  border-radius: 6px;
  background: #fff8e6;
  color: #6b4d0e;
  font-size: 13px;
}
.pending-notice a {
  color: #8a5a00;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
}
/* The order panel replaces the recharge forms while an order waits for payment. */
.payment-result {
  display: grid;
  justify-items: start;
  gap: 12px;
  padding: 20px 22px;
  margin: 0 0 24px;
  border: 1px solid #c8e4db;
  border-left: 4px solid #117d68;
  border-radius: 8px;
  background: #f4faf7;
  overflow-wrap: anywhere;
}
.payment-result[data-status='qr'] {
  justify-items: center;
  max-width: 460px;
  margin-inline: auto;
  padding: 28px 24px 24px;
  border-left: 1px solid #c8e4db;
  text-align: center;
  background: #fff;
}
.payment-result[data-status='done'] {
  border-color: #b6dfc8;
  border-left-color: #21864a;
  background: #f2fbf5;
}
.payment-result[data-status='closed'] {
  border-color: #dfe3e3;
  border-left-color: #8d9498;
  background: #f7f8f8;
}
.payment-result h3 {
  margin: 0;
  font-size: 16px;
}
.payment-result p {
  margin: 0;
  line-height: 1.5;
}
.payment-result button {
  min-height: 40px;
}
.payment-amount {
  font-size: 28px;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
}
.payment-qr {
  width: 224px;
  max-width: 100%;
  height: auto;
  aspect-ratio: 1;
  border: 1px solid #e5e7e7;
  border-radius: 8px;
  background: #fff;
}
.payment-expiry {
  font-variant-numeric: tabular-nums;
}
.payment-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: inherit;
  gap: 10px;
}
.payment-hint {
  color: #73797c;
  font-size: 12px;
}
.payment-link {
  display: inline-flex;
  min-height: 40px;
  align-items: center;
  padding: 8px 14px;
  border-radius: 6px;
  color: #fff;
  background: #117d68;
  font-weight: 600;
  text-decoration: none;
}
.payment-link:hover {
  color: #fff;
  background: #0c6756;
}
/* 账单 order list */
.order-number {
  font:
    12px/1.5 ui-monospace,
    SFMono-Regular,
    Consolas,
    monospace;
}
.order-status {
  color: #6c7377;
  font-size: 12px;
}
.order-status::before {
  content: '';
  display: inline-block;
  width: 6px;
  height: 6px;
  margin-right: 6px;
  border-radius: 50%;
  background: currentColor;
}
.order-status[data-status='pending'] {
  color: #a06a00;
}
.order-status[data-status='paid'],
.order-status[data-status='recharging'] {
  color: #1f6fb2;
}
.order-status[data-status='completed'] {
  color: #117d68;
}
.order-status[data-status='failed'],
.order-status[data-status='refund_failed'] {
  color: #ba3f46;
}
.order-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}
.order-action {
  min-height: 30px;
  padding: 4px 10px;
  font-size: 12px;
}
@media (max-width: 700px) {
  .billing-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 32px;
  }
  #redeem-form {
    padding: 24px 0 0;
    border-left: 0;
    border-top: 1px solid #e5e7e7;
  }
  .payment-result[data-status='qr'] {
    padding: 22px 16px 20px;
  }
  .payment-actions {
    width: 100%;
  }
  .payment-actions > * {
    flex: 1 1 auto;
    justify-content: center;
  }
}
