/* 侧边栏样式 */
.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    width: 250px;
    height: 100vh;
    background-color: #f8f9fa;
    border-right: 1px solid #ddd;
    overflow-y: auto;
    z-index: 1000;
    transition: transform 0.3s ease;
}

.sidebar.hidden {
    transform: translateX(-100%);
}

.sidebar-toggle {
    position: fixed;
    left: 250px;
    top: 10px;
    z-index: 1001;
    background: #fff;
    border: 1px solid #ddd;
    border-left: none;
    padding: 5px 10px;
    cursor: pointer;
    transition: left 0.3s ease;
}

.sidebar-toggle.collapsed {
    left: 0;
    border-left: 1px solid #ddd;
}

.sidebar-content {
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden;
    box-sizing: border-box;
}

.sidebar h3 {
    margin: 0;
    border-bottom: 1px solid #ddd;
    padding: 15px;
}

.sidebar h4 {
    margin: 0;
    font-size: 1.1em;
    padding: 15px;
}

#bakanSelector {
    width: calc(100% - 30px);
    padding: 5px;
    margin: 0 auto;
    border: 1px solid #ccc;
    border-radius: 3px;
}

#itemsPreviewList {
    flex-grow: 1;
    flex-shrink: 1;
    overflow: auto;
}

#itemsPreviewList .item-link {
    display: block;
    margin-bottom: 10px;
    padding: 8px;
    border: 1px solid #eee;
    border-radius: 3px;
    text-decoration: none;
    color: #333;
    font-size: 0.9em;
    background-color: #fff;
    transition: all 0.2s ease;
}

#itemsPreviewList .item-link:hover {
    background-color: #e9ecef;
    border-color: #ddd;
}

/* 缩略图预览样式 */
#itemsPreviewList .thumbnail-container {
    display: grid;
    grid-template-columns: 1fr;
    gap: 5px;
    margin-bottom: 15px;
}

#itemsPreviewList .thumbnail-link {
    display: block;
    border: 1px solid #ddd;
    border-radius: 3px;
    overflow: hidden;
    transition: all 0.2s ease;
    text-decoration: none;
    padding: 3px;
    aspect-ratio: 1 / 1;
    width: 70%;
    margin: 0 auto;
}

#itemsPreviewList .thumbnail-link:hover {
    border-color: #007bff;
    box-shadow: 0 0 5px rgba(0, 123, 255, 0.3);
}

#itemsPreviewList .thumbnail {
    width: 100%;
    aspect-ratio: 1 / 1;
    background-size: cover;
    background-position: center;
}

#itemsPreviewList .thumbnail-label {
    display: none;
}

/* 主内容区域不再需要偏移，因为侧边栏现在悬浮在上方 */
.main-content {
    margin-left: 0;
    transition: none;
}

.main-content.expanded {
    margin-left: 0;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .sidebar {
        width: 200px;
    }
    
    .sidebar-toggle {
        left: 200px;
    }
    
    .main-content {
        margin-left: 0;
    }
}