/* 通用弹窗样式 */
.modal {
    position: fixed;  /* 固定定位，相对于浏览器窗口 */
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9999;   /* 确保在最上层 */
    
    /* flex布局实现居中 */
    display: none;
    justify-content: center;
    align-items: center;
}

.modal-content {
    background: #fff;
    border-radius: 8px;
    width: 400px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.1);
}

.modal-header {
    padding: 12px 20px;  /* 减小上下内边距 */
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: center;  /* 标题居中 */
    position: relative;  /* 为关闭按钮定位 */
}

.modal-header h2 {
    margin: 0;
    font-size: 18px;
    font-weight: 500;
    color: #333;
}

.modal-header .close-btn {
    position: absolute;  /* 绝对定位 */
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    border: none;
    background: none;
    font-size: 22px;
    color: #999;
    cursor: pointer;
    padding: 0;
}

.modal-body {
    padding: 16px 20px;  /* 减小上下内边距 */
    text-align: center;
    color: #666;
    font-size: 14px;
    line-height: 1.6;
}

.modal-footer {
    padding: 16px 20px;
    border-top: 1px solid #eee;
    display: flex;
    justify-content: center;  /* 按钮居中 */
    gap: 12px;
}

.modal-footer .cancel-btn {
    padding: 8px 20px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: #fff;
    color: #666;
    cursor: pointer;
    min-width: 80px;  /* 统一按钮宽度 */
}

.modal-footer .confirm-btn {
    padding: 8px 20px;
    border: none;
    border-radius: 4px;
    background: #2196f3;
    color: #fff;
    cursor: pointer;
    min-width: 80px;  /* 统一按钮宽度 */
}

/* 二维码样式 */
.qr-code-modal .modal-content {
    width: 360px;
    text-align: center;
}

.qr-code-container {
    text-align: center;
    padding: 20px 0;
}

.qr-code-container img {
    width: 200px;
    height: 200px;
    margin-bottom: 15px;
}

.qr-code-container p {
    color: #666;
    font-size: 14px;
    margin: 0;
}

/* 动画效果 */
@keyframes modalFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes modalSlideIn {
    from {
        transform: translateY(-20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* 响应式调整 */
@media screen and (max-width: 768px) {
    .modal-content {
        width: 90%;
        max-width: 360px;
        padding: 20px;
    }
    
    .qr-code-modal .modal-content {
        width: 90%;
    }
}