.bookshelf-body {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 20px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
    align-content: start;
    grid-auto-rows: min-content;
}

/* 书架弹窗样式 */
.bookshelf-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 10000;
}

.bookshelf-modal.active {
    display: flex;
}

.bookshelf-content {
    width: 100%;
    max-width: 100%;
    height: 100%;
    background: var(--card-bg);
    border-radius: 0;
    display: flex;
    flex-direction: column;
    box-shadow: none;
}

.bookshelf-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}

.bookshelf-header-left {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.bookshelf-header-right {
    display: flex;
    align-items: center;
}

.bookshelf-action-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: var(--button-bg);
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: var(--transition);
}

.bookshelf-action-btn:hover {
    background: var(--button-hover);
}

.bookshelf-action-btn.bookshelf-delete-btn {
    background: var(--notification-error);
}

.bookshelf-action-btn.bookshelf-delete-btn:hover {
    background: #c0392b;
}

.bookshelf-close-btn {
    width: 36px;
    height: 36px;
    background: var(--border);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    color: var(--text);
    margin-left: 4px;
    margin-right: 4px;
}

.bookshelf-close-btn:hover {
    background: var(--notification-error);
    color: white;
}

.bookshelf-tag-filter {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 12px 20px;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}

.bookshelf-tag {
    padding: 6px 14px;
    background: var(--border);
    border-radius: 20px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: var(--transition);
    color: var(--text);
}

.bookshelf-tag:hover, .bookshelf-tag.active {
    background: var(--button-bg);
    color: white;
}

.bookshelf-loading {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--card-bg);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10;
}

.bookshelf-loading.hidden {
    display: none;
}

.bookshelf-item {
    background: var(--background);
    border-radius: var(--border-radius-lg);
    overflow: hidden;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: var(--shadow-md);
    flex-shrink: 0;
    height: fit-content;
}

.bookshelf-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.bookshelf-item-cover {
    width: 100%;
    height: 220px;
    object-fit: cover;
    background: linear-gradient(135deg, var(--button-hover), var(--button-bg));
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 3rem;
    flex-shrink: 0;
}

.bookshelf-item-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.bookshelf-item-info {
    padding: 12px;
    flex-shrink: 0;
    min-height: 48px;
}

.bookshelf-item-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 4px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.bookshelf-item-author {
    font-size: 0.8rem;
    color: var(--text-secondary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.bookshelf-item.group {
    background: linear-gradient(135deg, var(--button-hover), var(--button-bg));
}

.bookshelf-item.group .bookshelf-item-info {
    color: white;
}

.bookshelf-item.group .bookshelf-item-title {
    color: white;
}

.bookshelf-item.group .bookshelf-item-author {
    color: rgba(255, 255, 255, 0.8);
}

.bookshelf-footer {
    padding: 12px 20px;
    border-top: 1px solid var(--border);
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.85rem;
    flex-shrink: 0;
}

/* 空书架提示 */
.bookshelf-empty {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
    color: var(--text-secondary);
}

.bookshelf-empty i {
    font-size: 4rem;
    margin-bottom: 20px;
    color: var(--border);
}

.bookshelf-empty p {
    font-size: 1.1rem;
}

/* 书架标题样式 */
.bookshelf-title {
    margin: 0;
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text);
    text-align: right;
    flex: 1;
    padding-right: 15px;
}

.bookshelf-title i {
    margin-right: 8px;
}

/* 分组封面拼接样式 */
.group-covers {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    grid-template-rows: repeat(2, 1fr);
    width: 100%;
    height: 220px;
    overflow: hidden;
}

.group-cover-item {
    width: 100%;
    height: 100%;
    object-fit: cover;
    background: rgba(255, 255, 255, 0.2);
}

.group-cover-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

@media (max-width: 768px) {
    .bookshelf-header {
        flex-direction: column;
        gap: 10px;
    }
    
    .bookshelf-header-left {
        justify-content: center;
    }
    
    .bookshelf-header-right {
        justify-content: center;
    }
    
    .bookshelf-title {
        text-align: center;
        padding-right: 0;
    }
    
    .bookshelf-body {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
        gap: 15px;
        padding: 15px;
        grid-auto-rows: min-content;
    }
    
    .bookshelf-item-cover {
        height: 220px;
    }
    
    .bookshelf-tag-filter {
        flex-wrap: nowrap;
        overflow-x: auto;
        overflow-y: hidden;
        padding: 6px 10px;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: thin;
    }
    
    .bookshelf-tag-filter::-webkit-scrollbar {
        height: 4px;
    }
    
    .bookshelf-tag-filter::-webkit-scrollbar-track {
        background: var(--background-color);
    }
    
    .bookshelf-tag-filter::-webkit-scrollbar-thumb {
        background: var(--border-color);
        border-radius: 2px;
    }
    
    .bookshelf-tag {
        flex-shrink: 0;
    }
    
    /* 移动端：header 和 footer 更紧凑 */
    .bookshelf-header {
        padding: 5px 10px;
        gap: 4px;
    }
    
    .bookshelf-header-left {
        gap: 4px;
    }
    
    .bookshelf-title {
        font-size: 1.2rem;
    }
    
    .bookshelf-action-btn {
        padding: 6px 12px;
        font-size: 0.85rem;
    }
    
    .bookshelf-footer {
        padding: 2px 4px;
        font-size: 0.75rem;
    }
}

@media (max-width: 480px) {
    .bookshelf-body {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        gap: 12px;
        padding: 12px;
        grid-auto-rows: min-content;
    }

    .bookshelf-item-cover {
        height: 200px;
    }
}