/* 侧边栏样式 */
.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    width: 320px;
    height: 100vh;
    background: white;
    border-right: 1px solid #dee2e6;
    box-shadow: 2px 0 8px rgba(0,0,0,0.1);
    z-index: 1000;
    transition: transform 0.3s ease;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.sidebar.collapsed {
    transform: translateX(-280px);
}

.sidebar.collapsed .sidebar-header h5,
.sidebar.collapsed .sidebar-images,
.sidebar.collapsed .sidebar-footer {
    opacity: 0;
}

.sidebar-header {
    padding: 20px;
    border-bottom: 1px solid #dee2e6;
    background-color: #f8f9fa;
}

.sidebar-header h5 {
    margin: 0 0 5px 0;
    color: #343a40;
}

.sidebar-header small {
    font-size: 0.85rem;
}

.sidebar-images {
    flex: 1;
    padding: 15px;
    overflow-y: auto;
}

.sidebar-image-item {
    margin-bottom: 15px;
    border: 2px solid transparent;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.2s ease;
    background: white;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.sidebar-image-item:hover {
    border-color: #0d6efd;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.sidebar-image-item.active {
    border-color: #0d6efd;
    background-color: #f0f7ff;
}

.sidebar-image-item img {
    width: 100%;
    height: 150px;
    object-fit: cover;
    border-bottom: 1px solid #dee2e6;
}

.image-info {
    padding: 10px;
    background: white;
}

.image-title {
    font-weight: 600;
    font-size: 0.9rem;
    color: #495057;
    margin-bottom: 5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.image-url {
    font-size: 0.75rem;
    color: #6c757d;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-family: 'Courier New', monospace;
}

.sidebar-footer {
    padding: 15px;
    border-top: 1px solid #dee2e6;
    background-color: #f8f9fa;
    display: flex;
    gap: 10px;
}

.sidebar-footer .btn {
    flex: 1;
}

/* 调整主内容区域，为侧边栏留出空间 */
body {
    padding-left: 320px;
    transition: padding-left 0.3s ease;
}

body.sidebar-collapsed {
    padding-left: 40px;
}

.header {
    margin-left: -320px;
    padding-left: 320px;
    transition: all 0.3s ease;
}

body.sidebar-collapsed .header {
    margin-left: -40px;
    padding-left: 40px;
}

/* 响应式设计 */
@media (max-width: 1200px) {
    .sidebar {
        width: 280px;
    }
    
    body {
        padding-left: 280px;
    }
    
    .header {
        margin-left: -280px;
        padding-left: 280px;
    }
}

@media (max-width: 992px) {
    .sidebar {
        transform: translateX(-100%);
    }
    
    .sidebar.show {
        transform: translateX(0);
    }
    
    body {
        padding-left: 0 !important;
    }
    
    .header {
        margin-left: 0 !important;
        padding-left: 0 !important;
    }
    
    .sidebar-toggle-mobile {
        display: block !important;
    }
}

/* 移动端侧边栏切换按钮 */
.sidebar-toggle-mobile {
    position: fixed;
    top: 20px;
    left: 20px;
    z-index: 1001;
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    padding: 8px 12px;
    display: none;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* 侧边栏加载动画 */
.sidebar-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 200px;
    color: #6c757d;
}

.sidebar-loading .spinner-border {
    margin-right: 10px;
}