/* 图片详情弹窗 */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.9);
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.modal-content {
    position: relative;
    background-color: #fefefe;
    margin: 5% auto;
    border-radius: 10px;
    width: 90%;
    max-width: 1000px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }

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

/* 弹窗头部 */
.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background-color: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
    flex-wrap: wrap;
    gap: 10px;
}

.close {
    color: #6c757d;
    font-size: 24px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.3s ease;
    line-height: 1;
}

.close:hover,
.close:focus {
    color: #000;
    text-decoration: none;
}

/* 下载按钮容器 */
.download-buttons {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

/* 下载按钮 */
.download-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    color: white;
    border: none;
    border-radius: 50px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

/* 原图下载按钮 */
.original-btn {
    background-color: #28a745;
    box-shadow: 0 2px 8px rgba(40, 167, 69, 0.3);
}

.original-btn:hover {
    background-color: #218838;
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.4);
}

/* 压缩图下载按钮 */
.compressed-btn {
    background-color: #ffc107;
    box-shadow: 0 2px 8px rgba(255, 193, 7, 0.3);
}

.compressed-btn:hover {
    background-color: #e0a800;
    box-shadow: 0 4px 12px rgba(255, 193, 7, 0.4);
}

.download-btn i {
    font-size: 16px;
}

.modal-body {
    padding: 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

/* 图片比较容器 */
.image-comparison {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

/* 图片容器 */
.image-container {
    position: relative;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    background-color: #f8f9fa;
}

/* 图片加载动画 */
.image-loading {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background-color: rgba(255, 255, 255, 0.9);
    z-index: 10;
}

/* 加载动画 */
.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* 原图加载动画 */
#original-loading .loading-spinner {
    border-top: 4px solid #28a745;
}

/* 压缩图加载动画 */
#compressed-loading .loading-spinner {
    border-top: 4px solid #ffc107;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

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

.image-loading p {
    margin-top: 10px;
    color: #6c757d;
    font-size: 14px;
}

/* 隐藏加载动画 */
.image-loading.hidden {
    display: none;
}

/* 图片样式 */
.image-container img {
    width: 100%;
    height: auto;
    max-height: 40vh;
    object-fit: contain;
    display: block;
}

/* 图片标签 */
.image-label {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.7));
    color: white;
    padding: 10px 15px;
    font-size: 14px;
    font-weight: 500;
    text-align: center;
}

/* 查看图片按钮 */
.view-image-btn {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.7);
    color: white;
    border: none;
    border-radius: 50%;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 15;
    opacity: 0;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.image-container:hover .view-image-btn {
    opacity: 1;
}

.view-image-btn:hover {
    background: rgba(0, 0, 0, 0.8);
    transform: translate(-50%, -50%) scale(1.1);
}

.view-image-btn i {
    font-size: 24px;
}

/* 响应式调整 */
@media (max-width: 768px) {
    .view-image-btn {
        width: 50px;
        height: 50px;
    }
    
    .view-image-btn i {
        font-size: 20px;
    }
}

@media (max-width: 480px) {
    .view-image-btn {
        width: 40px;
        height: 40px;
    }
    
    .view-image-btn i {
        font-size: 16px;
    }
}

.modal-info {
    text-align: center;
}

.modal-info h3 {
    font-size: 20px;
    margin-bottom: 10px;
    color: #333;
}

.modal-info p {
    color: #666;
    line-height: 1.6;
}

/* 文件名样式 */
.file-name {
    margin-top: 15px;
    font-size: 13px;
    color: #7f8c8d;
    background-color: #f8f9fa;
    padding: 8px 15px;
    border-radius: 6px;
    display: inline-block;
    word-break: break-all;
    font-family: 'Consolas', 'Monaco', monospace;
    border: 1px solid #e9ecef;
    position: relative;
}

.file-name::before {
    content: '📁 ';
    margin-right: 5px;
}

.file-name:hover {
    background-color: #e9ecef;
    color: #2c3e50;
    transition: all 0.3s ease;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .modal-content {
        margin: 10% auto;
        width: 95%;
        padding: 15px;
    }

    .image-comparison {
        grid-template-columns: 1fr;
    }

    .image-container img {
        max-height: 30vh;
    }

    .download-buttons {
        flex-direction: column;
        width: 100%;
    }

    .download-btn {
        justify-content: center;
    }

    .modal-info h3 {
        font-size: 18px;
    }
}

@media (max-width: 480px) {
    .modal-content {
        margin: 15% auto;
        width: 98%;
        padding: 10px;
    }

    .image-container img {
        max-height: 25vh;
    }
}