/* 图片预览组件样式 */
.image-preview-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    z-index: 9999;
    display: none;
    opacity: 0;
    transition: opacity 0.3s ease;
    touch-action: none;
    -webkit-tap-highlight-color: transparent;
}

.image-preview-overlay.active {
    display: block;
    opacity: 1;
}

.preview-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.preview-image-wrapper {
    position: relative;
    display: inline-block;
    max-width: 90%;
    max-height: 90%;
    transition: transform 0.1s linear;
    will-change: transform;
}

.preview-image {
    display: block;
    max-width: 100%;
    max-height: 100%;
    user-select: none;
    -webkit-user-drag: none;
    pointer-events: none;
}

.preview-controls {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 15px;
    background: rgba(0, 0, 0, 0.7);
    padding: 10px 20px;
    border-radius: 30px;
    backdrop-filter: blur(10px);
    z-index: 10001;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.control-btn {
    width: 44px;
    height: 44px;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    color: white;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.control-btn:hover {
    background: rgba(255, 255, 255, 0.22);
    transform: scale(1.1);
}

.control-btn:active {
    transform: scale(0.95);
}

.zoom-display {
    color: white;
    font-size: 15px;
    font-weight: 500;
    min-width: 70px;
    text-align: center;
    padding: 0 10px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.preview-close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 50px;
    height: 50px;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    color: white;
    font-size: 22px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 10001;
    backdrop-filter: blur(5px);
}

.preview-close:hover {
    background: rgba(255, 255, 255, 0.22);
    transform: scale(1.1);
}

.loading-indicator {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 16px;
    text-align: center;
    z-index: 10000;
    background: rgba(0, 0, 0, 0.7);
    padding: 20px 30px;
    border-radius: 10px;
    display: none;
}

.loading-indicator.active {
    display: block;
}

.loading-spinner {
    display: inline-block;
    width: 30px;
    height: 30px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s linear infinite;
    margin-bottom: 10px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.error-message {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #ff6b6b;
    font-size: 16px;
    text-align: center;
    z-index: 10000;
    background: rgba(0, 0, 0, 0.7);
    padding: 20px 30px;
    border-radius: 10px;
    display: none;
}

.error-message.active {
    display: block;
}

.retry-btn {
    margin-top: 15px;
    padding: 10px 20px;
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    color: white;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.retry-btn:hover {
    background: rgba(255, 255, 255, 0.25);
}

/* 为图片添加预览效果 */
.previewable-image {
    cursor: pointer;
    transition: transform 0.3s ease;
}

.previewable-image:hover {
    transform: scale(1.02);
}

/* 响应式调整 */
@media (max-width: 768px) {
    .preview-controls {
        bottom: 15px;
        padding: 8px 15px;
        gap: 10px;
    }
    
    .control-btn {
        width: 40px;
        height: 40px;
        font-size: 16px;
    }
    
    .zoom-display {
        font-size: 14px;
        min-width: 60px;
    }
    
    .preview-close {
        width: 44px;
        height: 44px;
        top: 15px;
        right: 15px;
        font-size: 20px;
    }
}

@media (max-width: 480px) {
    .preview-controls {
        bottom: 10px;
        padding: 6px 12px;
        gap: 8px;
    }
    
    .control-btn {
        width: 36px;
        height: 36px;
        font-size: 15px;
    }
    
    .zoom-display {
        font-size: 13px;
        min-width: 50px;
        padding: 0 8px;
    }
    
    .preview-close {
        width: 40px;
        height: 40px;
        top: 10px;
        right: 10px;
        font-size: 18px;
    }
}