/* ===== 充值页 ===== */

.pay-page {
    background: #FFF0F5;
}

.pay-page nav a.active {
    color: #c2185b;
    text-decoration: underline;
    text-underline-offset: 4px;
}

.pay-user {
    flex-shrink: 0;
    padding: 8px 14px;
    border: 2px solid #4d22d5;
    background: rgba(255, 255, 255, 0.5);
    font-size: 13px;
    font-weight: bold;
}

.pay-main {
    max-width: 1120px;
    margin: 0 auto;
    padding: 48px 5% 72px;
}

.pay-head {
    margin-bottom: 24px;
}

.pay-head h1 {
    margin: 4px 0 8px;
    font-size: clamp(26px, 4vw, 36px);
    line-height: 1.25;
    color: #4d22d5;
}

.pay-sub {
    color: #7a5cd6;
    font-size: 14px;
}

.mode-banner {
    margin-bottom: 20px;
    padding: 12px 16px;
    border: 2px solid #4d22d5;
    background: #fff6d8;
    color: #6b4a00;
    font-size: 13px;
    font-weight: bold;
    box-shadow: 4px 4px 0 rgba(77, 34, 213, 0.25);
}

.mode-banner.is-local {
    background: #e9e4ff;
    color: #4d22d5;
}

.resume-order {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 20px;
    padding: 12px 16px;
    border: 2px dashed #4d22d5;
    background: #fff8fe;
    font-size: 13px;
    font-weight: bold;
}

.pay-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: 24px;
    align-items: start;
}

.pay-panel,
.pay-summary {
    border: 3px solid #4d22d5;
    background: #fff8fe;
    box-shadow: 6px 6px 0 #4d22d5;
    padding: 24px;
}

.wallet-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 18px 20px;
    border: 2px solid #4d22d5;
    background: #f1d3f2;
}

.wallet-label {
    font-size: 12px;
    color: #7a5cd6;
    letter-spacing: 0.08em;
}

.wallet-balance {
    font-size: 30px;
    font-weight: bold;
    line-height: 1.2;
    color: #4d22d5;
}

.wallet-balance small {
    margin-left: 6px;
    font-size: 12px;
    font-weight: normal;
    color: #7a5cd6;
}

.wallet-rate {
    flex-shrink: 0;
    font-size: 12px;
    color: #7a5cd6;
}

.panel-title {
    margin: 28px 0 14px;
    font-size: 18px;
    color: #4d22d5;
}

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

.tier {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 14px 8px 12px;
    border: 2px solid #4d22d5;
    background: #ffffff;
    color: #4d22d5;
    font-family: inherit;
    cursor: pointer;
    transition: background 0.15s, box-shadow 0.15s, transform 0.15s;
}

.tier:hover {
    background: #fff0fb;
    transform: translateY(-2px);
}

.tier.is-selected {
    background: #f1d3f2;
    box-shadow: inset 0 0 0 2px #4d22d5;
}

.tier-amount {
    font-size: 20px;
    font-weight: bold;
    line-height: 1.2;
}

.tier-coins {
    font-size: 12px;
    color: #7a5cd6;
}

.tier-bonus {
    position: absolute;
    top: -10px;
    right: -6px;
    padding: 1px 7px;
    border: 1px solid #c2185b;
    background: #ffe3ef;
    color: #c2185b;
    font-size: 10px;
    font-weight: bold;
}

.custom-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-top: 16px;
    padding: 14px 16px;
    border: 2px dashed #4d22d5;
    background: #ffffff;
}

.custom-row label {
    font-size: 14px;
    font-weight: bold;
}

.custom-input {
    display: flex;
    align-items: center;
    gap: 6px;
    width: 160px;
    padding: 6px 10px;
    border: 2px solid #4d22d5;
    background: #fff8fe;
}

.custom-input span {
    font-weight: bold;
}

.custom-input input {
    width: 100%;
    min-width: 0;
    border: none;
    outline: none;
    background: transparent;
    color: #4d22d5;
    font-family: inherit;
    font-size: 15px;
    font-weight: bold;
}

.custom-input input::placeholder {
    color: rgba(77, 34, 213, 0.4);
    font-weight: normal;
}

.method-list {
    display: grid;
    gap: 10px;
}

.method-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    border: 2px solid #4d22d5;
    background: #ffffff;
    cursor: pointer;
    transition: background 0.15s;
}

.method-card:hover {
    background: #fff0fb;
}

.method-card input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.method-card:has(input:checked) {
    background: #f1d3f2;
    box-shadow: inset 0 0 0 2px #4d22d5;
}

.method-card.is-disabled {
    opacity: 0.55;
    cursor: not-allowed;
    background: #f6f2ff;
}

.method-card.is-disabled:hover {
    background: #f6f2ff;
}

.method-icon {
    display: grid;
    place-items: center;
    flex-shrink: 0;
    width: 38px;
    height: 38px;
    border: 2px solid #4d22d5;
    background: #fff8fe;
    font-size: 17px;
    font-weight: bold;
}

.method-info {
    display: flex;
    flex: 1;
    min-width: 0;
    flex-direction: column;
    gap: 1px;
}

.method-info strong {
    font-size: 14px;
}

.method-info small {
    font-size: 11px;
    color: #7a5cd6;
}

.method-badge {
    flex-shrink: 0;
    padding: 2px 8px;
    border: 1px solid #4d22d5;
    font-size: 10px;
    font-weight: bold;
}

.method-badge.ok {
    background: #d9f7e3;
    border-color: #1f7a45;
    color: #1f7a45;
}

.method-badge.off {
    background: #efeaf8;
    border-color: #a99bd0;
    color: #7a5cd6;
}

.pay-summary {
    position: sticky;
    top: 88px;
}

.pay-summary h2 {
    margin-bottom: 18px;
    font-size: 18px;
}

.summary-row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    padding: 7px 0;
    border-bottom: 1px dashed rgba(77, 34, 213, 0.25);
    font-size: 13px;
}

.summary-row strong {
    font-size: 14px;
}

.summary-total {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    margin-top: 14px;
    padding: 12px;
    background: #f1d3f2;
    border: 2px solid #4d22d5;
    font-size: 13px;
    font-weight: bold;
}

.summary-total strong {
    font-size: 17px;
}

.summary-note {
    margin-top: 16px;
    font-size: 11px;
    line-height: 1.7;
    color: #7a5cd6;
}

.pay-submit {
    width: 100%;
    margin-top: 18px;
}

.pay-submit:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
    box-shadow: 4px 4px 0 #4d22d5;
}

.summary-foot {
    margin-top: 12px;
    font-size: 10px;
    color: #a99bd0;
    text-align: center;
}

/* ===== 支付弹窗 ===== */

.pay-overlay {
    position: fixed;
    inset: 0;
    z-index: 500;
    display: grid;
    place-items: center;
    padding: 20px;
    background: rgba(77, 34, 213, 0.35);
}

.pay-modal {
    width: min(460px, 100%);
    max-height: 92vh;
    overflow-y: auto;
    padding: 22px 24px 26px;
    border: 3px solid #4d22d5;
    background: #fff8fe;
    box-shadow: 8px 8px 0 #4d22d5;
}

.pay-modal-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

.pay-modal-head h2 {
    font-size: 19px;
}

.pay-close {
    width: 32px;
    height: 32px;
    border: 2px solid #4d22d5;
    background: transparent;
    color: #4d22d5;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
}

.pay-close:hover {
    background: #f1d3f2;
}

.order-no {
    font-size: 11px;
    color: #7a5cd6;
    word-break: break-all;
}

.order-amount {
    margin: 8px 0 2px;
    font-size: 34px;
    font-weight: bold;
    line-height: 1.2;
}

.order-coins {
    font-size: 13px;
    color: #7a5cd6;
}

.qr-box {
    display: grid;
    place-items: center;
    width: 168px;
    height: 168px;
    margin: 18px auto 16px;
    border: 2px dashed #4d22d5;
    background: #ffffff;
}

.qr-placeholder {
    text-align: center;
    font-size: 12px;
    font-weight: bold;
    color: #7a5cd6;
    line-height: 1.7;
}

.qr-placeholder small {
    font-size: 10px;
    font-weight: normal;
    color: #a99bd0;
}

.address-label {
    margin-bottom: 4px;
    font-size: 11px;
    color: #7a5cd6;
}

.address-row {
    display: flex;
    align-items: stretch;
    gap: 8px;
}

.address-row code {
    flex: 1;
    min-width: 0;
    padding: 8px 10px;
    border: 2px solid #4d22d5;
    background: #ffffff;
    font-size: 11px;
    line-height: 1.5;
    word-break: break-all;
}

.ghost-button {
    flex-shrink: 0;
    padding: 6px 12px;
    border: 2px solid #4d22d5;
    background: #f1d3f2;
    color: #4d22d5;
    font-family: inherit;
    font-size: 12px;
    font-weight: bold;
    cursor: pointer;
}

.ghost-button:hover {
    background: #e8c0e9;
}

.pay-timer {
    margin-top: 14px;
    font-size: 12px;
    color: #7a5cd6;
}

.pay-timer strong {
    color: #c2185b;
}

.pay-hint {
    min-height: 18px;
    margin-top: 6px;
    font-size: 11px;
    color: #c2185b;
}

.pay-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 14px;
}

.pay-actions .primary-button,
.pay-state > .primary-button {
    margin-top: 0;
}

.sandbox-button {
    padding: 12px 18px;
    border: 2px dashed #c2185b;
    background: #ffe3ef;
    color: #c2185b;
    font-family: inherit;
    font-size: 12px;
    font-weight: bold;
    cursor: pointer;
}

.sandbox-button:hover {
    background: #ffd0e4;
}

.state-icon {
    margin-top: 6px;
    font-size: 44px;
    text-align: center;
}

.pay-state h3 {
    margin: 6px 0 10px;
    font-size: 20px;
    text-align: center;
}

#state-success > .order-no,
#state-success > .order-coins {
    text-align: center;
}

.state-desc {
    margin-bottom: 18px;
    font-size: 12px;
    color: #7a5cd6;
    text-align: center;
}

.pay-state > .primary-button {
    display: block;
    width: 100%;
    margin-top: 18px;
    text-align: center;
}

.pay-toast {
    position: fixed;
    left: 50%;
    bottom: 28px;
    z-index: 600;
    max-width: 90vw;
    padding: 10px 18px;
    transform: translateX(-50%);
    border: 2px solid #4d22d5;
    background: #4d22d5;
    color: #fff8fe;
    font-size: 12px;
    font-weight: bold;
    box-shadow: 4px 4px 0 rgba(77, 34, 213, 0.35);
}

.order-link {
    display: block;
    margin-top: 12px;
    text-align: center;
    font-size: 12px;
    font-weight: bold;
    color: #c2185b;
    text-decoration: none;
}

.order-link:hover {
    text-decoration: underline;
}

.voucher-box {
    margin-top: 24px;
    padding: 18px;
    border: 2px dashed #4d22d5;
    background: #ffffff;
}

.voucher-box .panel-title {
    margin-top: 0;
    margin-bottom: 6px;
}

.voucher-desc {
    margin-bottom: 10px;
    font-size: 12px;
    color: #7a5cd6;
}

.voucher-form {
    display: flex;
    gap: 8px;
}

.voucher-form input {
    flex: 1;
    min-width: 0;
    padding: 9px 10px;
    border: 2px solid #4d22d5;
    background: #fff8fe;
    color: #4d22d5;
    font-family: inherit;
    font-size: 12px;
    outline: none;
}

.voucher-form input::placeholder {
    color: rgba(77, 34, 213, 0.4);
}

.voucher-form button {
    flex-shrink: 0;
    padding: 9px 16px;
    border: 2px solid #4d22d5;
    background: #f1d3f2;
    color: #4d22d5;
    font-family: inherit;
    font-size: 12px;
    font-weight: bold;
    cursor: pointer;
}

.voucher-form button:hover {
    background: #e8c0e9;
}

@media (max-width: 520px) {
    .voucher-form {
        flex-direction: column;
    }
}

.qr-box img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.payment-note {
    margin-top: 10px;
    font-size: 12px;
    line-height: 1.7;
    color: #7a5cd6;
    text-align: center;
}

#state-submitted > .order-no,
#state-submitted > .order-coins,
#state-rejected > .order-no {
    text-align: center;
}

#state-submitted .primary-button,
#state-rejected .primary-button {
    display: block;
    width: 100%;
    margin-top: 18px;
    text-align: center;
}

@media (max-width: 860px) {
    .pay-layout {
        grid-template-columns: 1fr;
    }

    .pay-summary {
        position: static;
    }
}

@media (max-width: 520px) {
    .pay-main {
        padding: 32px 4% 56px;
    }

    .pay-panel,
    .pay-summary {
        padding: 18px;
        box-shadow: 4px 4px 0 #4d22d5;
    }

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

    .wallet-card {
        align-items: flex-start;
        flex-direction: column;
        gap: 6px;
    }

    .custom-row {
        align-items: flex-start;
        flex-direction: column;
    }

    .custom-input {
        width: 100%;
    }

    .pay-page .navbar nav {
        gap: 12px;
    }

    .pay-user {
        display: none;
    }
}
