/* =============================================
   书库页面样式 - 简洁犀利风格
   ============================================= */

/* 全宽布局 */
.main-container.full-width {
    max-width: 1200px;
    margin: 0 auto;
}

.main-container.full-width .main-content {
    width: 100%;
    padding: calc(var(--navbar-height) + 24px) 24px 24px;
}

/* 筛选区域 - 简洁设计 */
.filter-section {
    background: var(--bg-card);
    border-radius: 16px;
    padding: 20px 24px;
    margin-bottom: 20px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
    border: 1px solid var(--border-color);
}

.filter-row {
    display: flex;
    align-items: center;
    margin-bottom: 12px;
    gap: 12px;
}

.filter-row:last-child {
    margin-bottom: 0;
}

.filter-label {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-secondary);
    min-width: 50px;
}

.filter-options {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.filter-option {
    padding: 6px 14px;
    border-radius: 20px;
    color: var(--text-secondary);
    background: var(--bg-primary);
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.85rem;
    border: 1px solid transparent;
    display: flex;
    align-items: center;
    gap: 4px;
}

.filter-option svg {
    width: 12px;
    height: 12px;
    opacity: 0;
    transition: opacity 0.2s;
}

.filter-option.active svg {
    opacity: 1;
}

.filter-option:hover {
    color: var(--primary-color);
    border-color: var(--primary-light);
}

.filter-option.active {
    background: var(--primary-color);
    color: white;
}

/* 排序区域 - 简洁 */
.sort-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    padding: 12px 16px;
    background: var(--bg-card);
    border-radius: 12px;
    border: 1px solid var(--border-color);
}

.sort-options {
    display: flex;
    gap: 4px;
}

.sort-item {
    padding: 6px 14px;
    color: var(--text-secondary);
    cursor: pointer;
    border-radius: 8px;
    font-size: 0.9rem;
    transition: all 0.2s;
}

.sort-item:hover {
    color: var(--primary-color);
    background: rgba(155, 126, 217, 0.08);
}

.sort-item.active {
    color: var(--primary-color);
    background: rgba(155, 126, 217, 0.12);
    font-weight: 500;
}

.view-toggle {
    display: flex;
    gap: 4px;
    padding: 3px;
    background: var(--bg-primary);
    border-radius: 8px;
}

.view-btn {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    color: var(--text-muted);
    transition: all 0.2s;
}

.view-btn:hover {
    color: var(--primary-color);
}

.view-btn.active {
    background: var(--bg-card);
    color: var(--primary-color);
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

/* 网格视图 - 参考搜索结果 */
.book-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 16px;
}

.book-grid .book-card {
    background: var(--bg-card);
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.25s;
    border: 1px solid var(--border-color);
}

.book-grid .book-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.1);
    border-color: var(--primary-light);
}

.book-grid .book-card .book-cover {
    position: relative;
    width: 100%;
    padding-top: 140%;
    background: var(--bg-primary);
    overflow: hidden;
}

.book-grid .book-card .book-cover img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

.book-grid .book-card:hover .book-cover img {
    transform: scale(1.05);
}

.book-grid .book-card .book-vip-tag {
    position: absolute;
    top: 6px;
    left: 6px;
    padding: 2px 8px;
    background: linear-gradient(135deg, #FFD700, #FFA500);
    color: white;
    font-size: 0.7rem;
    font-weight: 600;
    border-radius: 4px;
}

.book-grid .book-card .book-info {
    padding: 12px;
}

.book-grid .book-card .book-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.book-grid .book-card:hover .book-title {
    color: var(--primary-color);
}

.book-grid .book-card .book-author {
    font-size: 0.8rem;
    color: var(--text-muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* 列表视图 - 简洁设计 */
.book-list-view {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.book-list-card {
    display: flex;
    gap: 16px;
    padding: 16px;
    background: var(--bg-card);
    border-radius: 12px;
    border: 1px solid var(--border-color);
    cursor: pointer;
    transition: all 0.2s;
}

.book-list-card:hover {
    border-color: var(--primary-light);
    box-shadow: 0 4px 12px rgba(0,0,0,0.06);
}

.book-list-card .book-cover {
    width: 80px;
    height: 112px;
    min-width: 80px;
    max-width: 80px;
    min-height: 112px;
    max-height: 112px;
    border-radius: 8px;
    overflow: hidden;
    flex-shrink: 0;
    background: var(--bg-primary);
    position: relative;
}

.book-list-card .book-cover img {
    width: 80px;
    height: 112px;
    min-width: 80px;
    min-height: 112px;
    max-width: 80px;
    max-height: 112px;
    object-fit: cover;
    display: block;
}

.book-list-card .book-vip-tag {
    position: absolute;
    top: 4px;
    left: 4px;
    padding: 2px 6px;
    background: linear-gradient(135deg, #FFD700, #FFA500);
    color: white;
    font-size: 0.65rem;
    font-weight: 600;
    border-radius: 3px;
}

.book-list-card .book-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.book-list-card .book-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.book-list-card:hover .book-title {
    color: var(--primary-color);
}

.book-list-card .book-meta {
    display: flex;
    gap: 16px;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.book-list-card .book-meta .author {
    color: var(--text-secondary);
}

.book-list-card .book-desc {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.6;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.book-list-card .book-stats {
    display: flex;
    gap: 16px;
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* 分页 */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-top: 24px;
}

.pagination-item {
    min-width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    color: var(--text-secondary);
    background: var(--bg-card);
    cursor: pointer;
    font-size: 0.9rem;
    border: 1px solid var(--border-color);
    transition: all 0.2s;
}

.pagination-item:hover:not(.disabled):not(.active) {
    color: var(--primary-color);
    border-color: var(--primary-light);
}

.pagination-item.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.pagination-item.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* 空状态 */
.empty-state {
    padding: 60px 20px;
    text-align: center;
    background: var(--bg-card);
    border-radius: 12px;
    border: 1px dashed var(--border-color);
}

.empty-state h3 {
    font-size: 1.1rem;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.empty-state p {
    color: var(--text-muted);
}

/* 响应式 */
@media (max-width: 1200px) {
    .book-grid {
        grid-template-columns: repeat(5, 1fr);
    }
}

@media (max-width: 1024px) {
    .book-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (max-width: 768px) {
    .main-container.full-width .main-content {
        padding: calc(var(--navbar-height) + 16px) 16px 16px;
    }
    
    .filter-section {
        padding: 16px;
    }
    
    .filter-row {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .filter-label {
        margin-bottom: 8px;
    }
    
    .sort-bar {
        flex-direction: column;
        gap: 12px;
    }
    
    .sort-options {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .book-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 12px;
    }
    
    .book-list-card {
        flex-direction: column;
        padding: 12px;
    }
    
    .book-list-card .book-cover {
        width: 100%;
        height: 160px;
    }
}

@media (max-width: 480px) {
    .book-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    
    .book-grid .book-card .book-info {
        padding: 8px;
    }
    
    .book-grid .book-card .book-title {
        font-size: 0.85rem;
    }
    
    .book-grid .book-card .book-author {
        font-size: 0.75rem;
    }
}
