/* 模态框样式 */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.4);
    opacity: 0;
    transition: opacity 0.3s ease;
    /* 添加 visibility 过渡 */
    visibility: hidden;
}

.modal.show {
    display: flex;
    justify-content: center;
    align-items: center;
    animation: modalFadeIn 0.3s ease;
    opacity: 1;
    visibility: visible;
}

/* 修改模态框内容样式，添加毛玻璃效果 */
.modal-content {
    background: rgba(255, 255, 255, 0.7);  /* 降低不透明度 */
    backdrop-filter: blur(10px);  /* 增加模糊效果 */
    -webkit-backdrop-filter: blur(10px);  /* Safari 支持 */
    padding: 30px;
    border: 1px solid rgba(255, 255, 255, 0.5);  /* 边框稍微透明 */
    border-radius: 20px;  /* 增加圆角 */
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);  /* 优化阴影 */
    width: 90%;
    max-width: 400px;
    position: relative;
    transform: scale(0.9);
    opacity: 0;
    animation: modalContentShow 0.3s ease forwards;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.modal.show .modal-content {
    transform: scale(1);
    opacity: 1;
}

/* 修改淡出动画 */
.modal.hide {
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modal.hide .modal-content {
    transform: scale(0.9);
    opacity: 0;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.close {
    position: absolute;
    right: 20px;
    top: 15px;
    color: #aaa;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.3s ease;
}

.close:hover {
    color: #333;
}

.modal-content h2 {
    color: #333;
    font-size: 24px;
    margin-bottom: 25px;
    text-align: center;
}

/* 优化模态框内部元素样式 */
.modal-content p {
    background: rgba(255, 255, 255, 0.5);  /* 更轻的背景色 */
    border-radius: 10px;
    padding: 15px;
    margin: 10px 0;
    backdrop-filter: blur(5px);  /* 内部元素也添加轻微模糊 */
    -webkit-backdrop-filter: blur(5px);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.modal-content span {
    color: #333;
    font-weight: bold;
}

.modal-buttons {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 30px;
}

.modal-buttons button {
    padding: 12px 30px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.3s ease;
}

.modal-buttons button:first-child {
    background: rgba(40, 167, 69, 0.8);
    color: white;
}

.modal-buttons button:first-child:hover {
    background: rgba(33, 136, 56, 0.9);
    transform: translateY(-2px);
}

.modal-buttons button:last-child {
    background: rgba(108, 117, 125, 0.8);
    color: white;
}

.modal-buttons button:last-child:hover {
    background: rgba(90, 98, 104, 0.9);
    transform: translateY(-2px);
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes modalContentShow {
    from {
        transform: scale(0.9);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

/* 结果模态框样式 */
.modal-content.success {
    text-align: center;
    max-width: 360px;
    padding: 40px 30px;
}

.result-icon {
    font-size: 48px;
    margin-bottom: 20px;
    width: 80px;
    height: 80px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
}

.result-icon.success {
    background: rgba(40, 167, 69, 0.2);
    color: #28a745;
}

.modal-content.success h2 {
    color: #28a745;
}

.result-message {
    font-size: 16px;
    margin: 20px 0;
    color: #666;
}

.modal-content.success button {
    min-width: 120px;
    background: #fff;
    border: 1px solid #ddd;
    color: #333;
    font-weight: 500;
}

.modal-content.success button:hover {
    background: rgba(40, 167, 69, 0.1);
    border-color: #28a745;
    color: #28a745;
}

/* 添加弹出动画 */
.modal-content.success {
    animation: modalBounce 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

@keyframes modalBounce {
    0% {
        transform: scale(0.3);
        opacity: 0;
    }
    50% {
        transform: scale(1.1);
    }
    70% {
        transform: scale(0.9);
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.modal:not(.show) .modal-content {
    transform: scale(0.9);
    opacity: 0;
}

/* 添加固定位置的提示框样式 */
.alert-box {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    padding: 15px 30px;
    border-radius: 8px;
    background: rgba(220, 53, 69, 0.9);
    color: white;
    font-size: 16px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    z-index: 1001;
}

.alert-box.success {
    background: rgba(40, 167, 69, 0.9);
}

.alert-box.show {
    opacity: 1;
    visibility: visible;
}

/* ... 其他模态框相关样式 ... */
