/* 模态窗Modal.js 基础样式 */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(2px);
    z-index: 9998;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.modal-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    padding: 0 15px;
}

/* 模态窗显示状态 */
.modal-overlay.active,
.modal-container.active {
    opacity: 1;
    visibility: visible;
}

/* 模态窗盒子通用样式 */
.modal-box {
    background-color: #fff;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.15);
    width: 100%;
    max-width: 500px;
    overflow: hidden;
    transition: transform 0.3s ease;
    transform: translateY(-20px);
}

.modal-container.active .modal-box {
    transform: translateY(0);
}

/* 模态窗头部 */
.modal-header {
    display: flex;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid #eee;
}

.modal-title {
    flex: 1;
    font-size: 1.1rem;
    font-weight: 600;
    color: #2c3e50;
}

/* 模态窗图标 */
.modal-icon {
    margin-right: 10px;
    font-size: 1.3rem;
}

.confirm-icon {
    color: #3498db;
}

.success-icon {
    color: #27ae60;
}

.error-icon {
    color: #e74c3c;
}

.info-icon {
    color: #3498db;
}

/* 模态窗关闭按钮 */
.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #95a5a6;
    cursor: pointer;
    padding: 5px;
    transition: color 0.2s ease;
}

.modal-close:hover {
    color: #e74c3c;
}

/* 模态窗内容区 */
.modal-body {
    padding: 20px;
    font-size: 1rem;
    color: #34495e;
    line-height: 1.6;
}

/* 模态窗底部按钮区 */
.modal-footer {
    display: flex;
    justify-content: space-around;
    gap: 10px;
    padding: 10px 15px;
    border-top: 1px solid #eee;
    background-color: #f8f9fa;
}

/* 模态窗按钮通用样式 */
.modal-btn {
    padding: 8px 10px;
    border-radius: 5px;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    flex: 1;
}

/* 按钮类型区分 */
.modal-btn-cancel {
    background-color: #e9ecef;
    color: #495057;
}

.modal-btn-cancel:hover {
    background-color: #dee2e6;
}

.modal-btn-confirm {
    background-color: #3498db;
    color: #fff;
}

.modal-btn-confirm:hover {
    background-color: #2980b9;
}

.modal-btn-ok {
    background-color: #3498db;
    color: #fff;
    width: 100%;
}

.modal-btn-ok:hover {
    background-color: #2980b9;
}

.success-box .modal-btn-ok {
    background-color: #27ae60;
}

.success-box .modal-btn-ok:hover {
    background-color: #218838;
}

.error-box .modal-btn-ok {
    background-color: #e74c3c;
}

.error-box .modal-btn-ok:hover {
    background-color: #c0392b;
}

/* 加载中模态窗样式 */
.loading-box {
    padding: 30px;
    text-align: center;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    margin: 0 auto 15px;
}

.spinner {
    width: 100%;
    height: 100%;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.loading-text {
    font-size: 1rem;
    color: #34495e;
}

/* 加载动画 */
@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* 响应式调整 */
@media (max-width: 576px) {
    .modal-box {
        max-width: 90%;
    }

    .modal-header {
        padding: 12px 16px;
    }

    .modal-body {
        padding: 16px;
        font-size: 0.95rem;
    }

}