/* ---------- 弹窗样式 (所有类名已添加 ._pay-modal- 前缀) ---------- */
._pay-modal-mask {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(3px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s!important;
    padding: 12px; /* 移动端留边距 */
}

._pay-modal-mask._pay-modal-show {
    opacity: 1;
    visibility: visible;
}

/* 弹窗主体 - 完全自适应，最大宽度400px，适合手机 */
._pay-modal-container {
    width: 100%;
    max-width: 400px;
    background-color: #ffffff;
    border-radius: 32px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
    overflow: hidden;
    transform: scale(0.95) translateY(10px);
    transition: transform 0.25s cubic-bezier(0.2, 0.9, 0.3, 1.1)!important;
    padding: 28px 20px 24px 20px;
}

._pay-modal-mask._pay-modal-show ._pay-modal-container {
    transform: scale(1) translateY(0);
}

/* 标题区域 */
._pay-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

._pay-modal-title {
    font-size: 1.5rem;
    font-weight: 650;
    color: #0f172a;
    letter-spacing: -0.3px;
    display: flex;
    align-items: center;
    gap: 6px;
}

._pay-modal-title span {
    background: #e6f0ff;
    font-size: 0.8rem;
    font-weight: 500;
    color: #2563eb;
    padding: 4px 10px;
    border-radius: 40px;
    margin-left: 8px;
}

/* 关闭按钮 (小而精致) */
._pay-modal-close {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #f1f5f9;
    border: none;
    font-size: 1.5rem;
    line-height: 1;
    color: #64748b;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.1s!important;
    padding: 0;
}

._pay-modal-close:active {
    background: #e2e8f0;
    color: #334155;
    transform: scale(0.92);
}

/* 订单信息卡片 */
._pay-modal-order-card {
    background: #f8fafc;
    border-radius: 24px;
    padding: 20px 16px;
    margin-bottom: 24px;
    border: 1px solid #e9eef3;
}

._pay-modal-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 14px;
    font-size: 1rem;
}

._pay-modal-row:last-child {
    margin-bottom: 0;
}

._pay-modal-label {
    color: #64748b;
    font-weight: 450;
}

._pay-modal-value {
    font-weight: 600;
    color: #0f172a;
}

._pay-modal-highlight {
    color: #b45309;
    background: #fffbeb;
    padding: 4px 12px;
    border-radius: 40px;
    font-size: 1.2rem;
}

._pay-modal-divider {
    height: 1px;
    background: #e2e8f0;
    margin: 16px 0;
}

/* 等待提示 */
._pay-modal-wait-tip {
    background: #fff9e6;
    border-radius: 18px;
    padding: 12px 16px;
    margin-top: 16px;
    display: flex;
    align-items: center;
    gap: 10px;
    color: #92400e;
    font-size: 0.95rem;
    border: 1px solid #fde68a;
    margin-bottom: 10px;
}

._pay-modal-wait-tip ._pay-modal-spinner {
    width: 22px;
    height: 22px;
    border: 3px solid #fbbf24;
    border-top-color: #b45309;
    border-radius: 50%;
    animation: _pay-modal-spin 1s linear infinite;
    flex-shrink: 0;
}

@keyframes _pay-modal-spin {
    to {
        transform: rotate(360deg);
    }
}

/* 双按钮布局 (移动端友好) */
._pay-modal-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 8px;
}

/* 主按钮: 前往支付 */
._pay-modal-btn-primary {
    /*background: #1677ff;*/
    border: none;
    /*color: white;*/
    background: var(--primary-btn-bg);
    color: var(--primary-btn-text-color);
    font-size: 1.2rem;
    font-weight: 600;
    padding: 18px 0;
    border-radius: 60px;
    width: 100%;
    cursor: pointer;
    transition: 0.1s!important;
    /*box-shadow: 0 4px 12px rgba(22, 119, 255, 0.25);*/
    /*border: 1px solid rgba(255, 255, 255, 0.2);*/
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

._pay-modal-btn-primary:active {
    /*background: #095ed9;*/
    /*transform: scale(0.98);*/
    /*box-shadow: 0 2px 6px rgba(22, 119, 255, 0.4);*/
}

/* 次级按钮: 取消订单 */
._pay-modal-btn-secondary {
    background: #ffffff;
    border: 1.5px solid #cbd5e1;
    color: #334155;
    font-size: 1.1rem;
    font-weight: 500;
    padding: 16px 0;
    border-radius: 60px;
    width: 100%;
    cursor: pointer;
    transition: 0.1s!important;
    display: flex;
    align-items: center;
    justify-content: center;
}

._pay-modal-btn-secondary:active {
    background: #f1f5f9;
    border-color: #94a3b8;
    transform: scale(0.98);
}

/* 移动端极窄适配 */
@media (max-width: 380px) {
    ._pay-modal-container {
        padding: 20px 16px;
    }

    ._pay-modal-title {
        font-size: 1.3rem;
    }
}