/* ==========================================
   支付模态框样式
   ========================================== */

/* 模态框遮罩层 */
#paymentModalOverlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    padding: 20px;
}

/* 模态框容器 */
.payment-modal {
    position: relative;
    background: var(--bg-primary);
    border-radius: 16px;
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.4);
    border: 3px solid rgba(255, 255, 255, 0.08);
    width: 750px;
    max-width: 95vw;
    animation: modalSlideIn 0.3s ease-out;
    overflow: hidden;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-30px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* 关闭按钮 */
.payment-modal .modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 10;
    font-size: 16px;
}

.payment-modal .modal-close:hover {
    background: rgba(255, 255, 255, 0.2);
    color: var(--text-primary);
    transform: rotate(90deg);
}

/* 内容布局 */
.payment-content {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 0;
}

/* 左侧：二维码区域 */
.payment-left {
    background: linear-gradient(165deg, rgba(15, 15, 15, 0.98), rgba(5, 5, 5, 0.96));
    border-radius: 16px 0 0 16px;
    padding: 35px 25px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.payment-qrcode-wrapper {
    width: 100%;
}

.qrcode-display {
    width: 200px;
    height: 200px;
    background: white;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    position: relative;
    overflow: hidden;
}

.qrcode-display i {
    font-size: 56px;
    color: #ddd;
    margin-bottom: 12px;
}

.qrcode-display p {
    font-size: 12px;
    color: #999;
    margin: 0;
    text-align: center;
    padding: 0 15px;
}

.qrcode-display img {
    width: 100%;
    height: 100%;
    border-radius: 12px;
    object-fit: contain;
    padding: 8px;
}

.qrcode-info {
    text-align: center;
    color: white;
}

.qrcode-amount {
    margin-bottom: 12px;
}

.qrcode-amount .amount-label {
    display: block;
    font-size: 12px;
    opacity: 0.9;
    margin-bottom: 6px;
}

.qrcode-amount .amount-value {
    display: block;
    font-size: 32px;
    font-weight: 700;
}

.qrcode-method {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-size: 13px;
    opacity: 0.95;
}

.qrcode-method i {
    font-size: 14px;
}

.qrcode-method span span {
    font-weight: 600;
    margin: 0 4px;
}

/* 右侧：选项区域 */
.payment-right {
    padding: 35px 30px;
}

.payment-header {
    margin-bottom: 24px;
}

.payment-header h2 {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 6px 0;
}

.payment-header p {
    font-size: 13px;
    color: var(--text-secondary);
    margin: 0;
}

/* 金额选择 */
.amount-selection {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-bottom: 20px;
}

.amount-card {
    position: relative;
    padding: 16px 12px;
    border: 2px solid var(--border-color);
    border-radius: 10px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: var(--card-bg);
}

.amount-card:hover {
    border-color: #4ade80;
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(102, 126, 234, 0.2);
}

.amount-card.active {
    border-color: #4ade80;
    background: rgba(74, 222, 128, 0.08);
    box-shadow: 0 4px 16px rgba(102, 126, 234, 0.15);
}

.amount-badge {
    position: absolute;
    top: -10px;
    right: -10px;
    background: linear-gradient(165deg, rgba(15, 15, 15, 0.98), rgba(5, 5, 5, 0.96));
    color: white;
    font-size: 11px;
    padding: 4px 12px;
    border-radius: 20px;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.4);
}

.amount-main {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.amount-sub {
    font-size: 12px;
    color: var(--text-secondary);
}

/* 支付方式 */
.payment-methods {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin-bottom: 20px;
}

.method-card {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 14px;
    border: 2px solid var(--border-color);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    background: var(--card-bg);
}

.method-card:hover {
    border-color: #4ade80;
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(102, 126, 234, 0.2);
}

.method-card.active {
    border-color: #4ade80;
    background: rgba(74, 222, 128, 0.08);
    box-shadow: 0 4px 16px rgba(102, 126, 234, 0.15);
}

.method-card i {
    font-size: 28px;
}

.method-card[data-method="wechat"] i {
    color: #09bb07;
}

.method-card[data-method="alipay"] i {
    color: #1677ff;
}

.method-card span {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

/* 温馨提示 */
.payment-tips {
    display: flex;
    gap: 10px;
    padding: 12px;
    background: rgba(102, 126, 234, 0.05);
    border-radius: 10px;
    border: 1px solid rgba(102, 126, 234, 0.1);
}

.payment-tips i {
    color: #4ade80;
    font-size: 16px;
    margin-top: 2px;
}

.tips-text {
    flex: 1;
}

.tips-text p {
    font-size: 12px;
    color: var(--text-secondary);
    margin: 0 0 4px 0;
    line-height: 1.5;
}

.tips-text p:last-child {
    margin-bottom: 0;
}

/* 倒计时 */
.qrcode-timer {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-size: 13px;
    color: white;
    margin-bottom: 10px;
    opacity: 0.95;
}

.qrcode-timer i {
    font-size: 13px;
}

/* 微信二维码容器 */
#wechatQrContainer {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    overflow: hidden;
}

#wechatQrContainer #qrcode {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
}

#wechatQrContainer #qrcode img,
#wechatQrContainer #qrcode canvas {
    display: block;
    max-width: 180px;
    max-height: 180px;
    border-radius: 8px;
}

/* 支付宝 iframe 容器 */
#alipayIframeContainer {
    width: 100%;
    height: 100%;
    border-radius: 12px;
    overflow: hidden;
}

#alipayIframe {
    width: 100%;
    height: 100%;
    border: none;
    border-radius: 12px;
}

/* 默认占位 */
#qrcodeDefault {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    gap: 8px;
}

/* qrLoader 加载蒙层 */
#qrLoader,
#alipayLoader {
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0.88);
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    z-index: 2;
}

/* 响应式 */
@media (max-width: 900px) {
    .payment-content {
        grid-template-columns: 1fr;
    }
    
    .payment-left {
        border-radius: 20px 20px 0 0;
        padding: 40px 30px;
    }
    
    .qrcode-display {
        width: 200px;
        height: 200px;
    }
    
    .payment-right {
        padding: 40px 30px;
    }
    
    .amount-selection {
        grid-template-columns: 1fr;
    }
}
