/* 弹窗容器样式 - 固定在右下角或中心 */
.popup-box-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1000;
    display: flex;
    flex-direction: column-reverse;
    /* 新的在最下面 */
    gap: 10px;
    max-width: 350px;
}

/* 通用弹窗样式 */
.popup {
    position: relative;
    color: white;
    padding: 16px 20px;
    border-radius: 12px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
    animation: slideInUp 0.3s ease-out;
    pointer-events: auto;
    max-width: 100%;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    transform: translateY(0);
    transition: transform 0.3s ease;
}

/* 错误弹窗样式 */
.error-popup {
    background: linear-gradient(135deg, #ff6b6b, #ee5a52);
}

/* 警告弹窗样式 */
.warning-popup {
    background: linear-gradient(135deg, #ffa726, #f57c00);
}

/* 成功弹窗样式 */
.success-popup {
    background: linear-gradient(135deg, #66bb6a, #43a047);
}

.popup.fade-out {
    animation: slideOutDown 0.3s ease-in forwards;
}

/* 顶部装饰条 */
.popup::before {
    content: '';
    position: absolute;
    top: 0;
    left: 8px;
    right: 8px;
    height: 4px;
    border-radius: 12px 12px 0 0;
}

.error-popup::before {
    background: linear-gradient(90deg, #ff9a9e, #fad0c4);
}

.warning-popup::before {
    background: linear-gradient(90deg, #ffb74d, #ff9800);
}

.success-popup::before {
    background: linear-gradient(90deg, #81c784, #4caf50);
}

.popup-content {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.popup-icon {
    font-size: 20px;
    margin-top: 2px;
    flex-shrink: 0;
}

.popup-message {
    flex: 1;
    font-size: 14px;
    line-height: 1.4;
    margin: 0;
    word-wrap: break-word;
}

.popup-close {
    background: none;
    border: none;
    color: white;
    font-size: 16px;
    cursor: pointer;
    padding: 4px;
    border-radius: 50%;
    transition: background-color 0.2s;
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.popup-close:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

/* 动画效果 */
@keyframes slideInUp {
    from {
        transform: translateY(100%);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes slideOutDown {
    from {
        transform: translateY(0);
        opacity: 1;
    }

    to {
        transform: translateY(100%);
        opacity: 0;
    }
}

/* 响应式调整 */
@media (max-width: 768px) {
    .popup-box-container {
        bottom: 15px;
        right: 15px;
        left: 15px;
        max-width: none;
    }

    .popup {
        padding: 14px 16px;
        border-radius: 10px;
    }

    .popup-message {
        font-size: 13px;
    }
}

@media (max-width: 480px) {
    .popup-box-container {
        bottom: 10px;
        right: 10px;
        left: 10px;
        gap: 8px;
    }

    .popup {
        padding: 12px 14px;
        border-radius: 8px;
    }

    .popup-content {
        gap: 8px;
    }

    .popup-message {
        font-size: 12px;
    }
}

/* 中心弹窗样式 */
.popup-centre-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.popup-centre-container.show {
    opacity: 1;
    visibility: visible;
}

.popup-centre {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.9);
    background-color: white;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    width: 90%;
    max-width: 400px;
    max-height: 80vh;
    overflow-y: auto;
    opacity: 0;
    transition: all 0.3s ease;
    z-index: 2001; /* 确保弹窗在遮罩层之上 */
}

.popup-centre.show {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
}

.popup-centre-content {
    padding: 24px;
    
}

.popup-centre-message {
    font-size: 16px;
    line-height: 1.5;
    margin-bottom: 24px;
    color: #333;
    text-align: center;
}

.popup-centre-buttons {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

.popup-centre-btn {
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.popup-centre-btn.cancel {
    background-color: #f0f0f0;
    color: #333;
}

.popup-centre-btn.cancel:hover {
    background-color: #e0e0e0;
}

.popup-centre-btn.confirm {
    background-color: #4CAF50;
    color: white;
}

.popup-centre-btn.confirm:hover {
    background-color: #45a049;
}

/* 响应式调整 */
@media (max-width: 768px) {
    .popup-centre {
        width: 95%;
        max-width: 350px;
    }

    .popup-centre-content {
        padding: 20px;
    }

    .popup-centre-message {
        font-size: 15px;
        margin-bottom: 20px;
    }
}

@media (max-width: 480px) {
    .popup-centre {
        width: 98%;
        max-width: 300px;
    }

    .popup-centre-content {
        padding: 16px;
    }

    .popup-centre-message {
        font-size: 14px;
        margin-bottom: 16px;
    }

    .popup-centre-buttons {
        gap: 8px;
    }

    .popup-centre-btn {
        padding: 6px 12px;
        font-size: 13px;
    }
}