/**
 * 自制弹框系统样式
 * 包含：Toast、Confirm、Alert
 */

/* ==================== 通用模态框背景 ==================== */

.custom-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.custom-modal.show {
    opacity: 1;
}

.custom-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
}

/* ==================== Toast 提示框 ==================== */

.custom-toast {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(-100px);
    z-index: 10000;
    
    display: flex;
    align-items: center;
    gap: 12px;
    
    padding: 14px 24px;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    
    font-size: 14px;
    font-weight: 500;
    
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.custom-toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.custom-toast.hide {
    opacity: 0;
    transform: translateX(-50%) translateY(-20px);
}

/* Toast 类型样式 */
.custom-toast-success {
    background-color: #f0f9ff;
    border: 1px solid #b3d8ff;
    color: #409eff;
}

.custom-toast-warning {
    background-color: #fdf6ec;
    border: 1px solid #f5dab1;
    color: #e6a23c;
}

.custom-toast-error {
    background-color: #fef0f0;
    border: 1px solid #fde2e2;
    color: #f56c6c;
}

.custom-toast-info {
    background-color: #f4f4f5;
    border: 1px solid #e4e7ed;
    color: #606266;
}

.custom-toast .toast-icon {
    font-size: 20px;
    line-height: 1;
}

.custom-toast .toast-text {
    line-height: 1.5;
}

/* ==================== Confirm 确认框 ==================== */

.custom-confirm {
    position: relative;
    z-index: 10000;
    background-color: #ffffff;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    width: 90%;
    max-width: 420px;
    overflow: hidden;
    
    animation: modalSlideUp 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes modalSlideUp {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.custom-confirm .confirm-content {
    padding: 32px 24px 24px;
    text-align: center;
}

.custom-confirm .confirm-icon {
    font-size: 48px;
    margin-bottom: 16px;
}

.custom-confirm .confirm-title {
    font-size: 18px;
    font-weight: 600;
    color: #303133;
    margin-bottom: 12px;
}

.custom-confirm .confirm-text {
    font-size: 14px;
    color: #606266;
    line-height: 1.6;
}

.custom-confirm .confirm-actions {
    display: flex;
    gap: 12px;
    padding: 0 24px 24px;
}

.custom-confirm .btn-modal {
    flex: 1;
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
}

.custom-confirm .btn-cancel {
    background-color: #f5f7fa;
    color: #606266;
}

.custom-confirm .btn-cancel:hover {
    background-color: #e4e7ed;
}

.custom-confirm .btn-confirm {
    color: #ffffff;
}

.custom-confirm .btn-confirm.btn-danger {
    background-color: #f56c6c;
}

.custom-confirm .btn-confirm.btn-danger:hover {
    background-color: #f78989;
}

.custom-confirm .btn-confirm.btn-primary {
    background-color: #409eff;
}

.custom-confirm .btn-confirm.btn-primary:hover {
    background-color: #66b1ff;
}

/* ==================== Alert 警告框 ==================== */

.custom-alert {
    position: relative;
    z-index: 10000;
    background-color: #ffffff;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    width: 90%;
    max-width: 400px;
    padding: 32px 24px 24px;
    text-align: center;
    
    animation: modalSlideUp 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.custom-alert .alert-icon {
    font-size: 56px;
    margin-bottom: 16px;
}

.custom-alert .alert-title {
    font-size: 18px;
    font-weight: 600;
    color: #303133;
    margin-bottom: 12px;
}

.custom-alert .alert-text {
    font-size: 14px;
    color: #606266;
    line-height: 1.6;
    margin-bottom: 24px;
}

.custom-alert .btn-ok {
    width: 100%;
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
    background-color: #409eff;
    color: #ffffff;
}

.custom-alert .btn-ok:hover {
    background-color: #66b1ff;
}

/* Alert 类型样式 */
.custom-alert-error .alert-icon {
    color: #f56c6c;
}

.custom-alert-error .btn-ok {
    background-color: #f56c6c;
}

.custom-alert-error .btn-ok:hover {
    background-color: #f78989;
}

.custom-alert-warning .alert-icon {
    color: #e6a23c;
}

.custom-alert-warning .btn-ok {
    background-color: #e6a23c;
}

.custom-alert-warning .btn-ok:hover {
    background-color: #ebb563;
}

.custom-alert-success .alert-icon {
    color: #67c23a;
}

.custom-alert-success .btn-ok {
    background-color: #67c23a;
}

.custom-alert-success .btn-ok:hover {
    background-color: #85ce61;
}

/* ==================== 响应式优化 ==================== */

@media (max-width: 768px) {
    .custom-toast {
        left: 10px;
        right: 10px;
        transform: translateY(-100px);
        max-width: calc(100% - 20px);
    }
    
    .custom-toast.show {
        transform: translateY(0);
    }
    
    .custom-confirm,
    .custom-alert {
        width: 95%;
    }
}

