/* 书架页面样式 */

/* 书架标签页 */
.bookshelf-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
    padding: 16px 24px;
    background: var(--bg-primary);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-sm);
}

.tab-btn {
    padding: 14px 28px;
    border-radius: 24px;
    font-size: 15px;
    font-weight: 500;
    color: var(--text-secondary);
    background: var(--bg-secondary);
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 8px;
}

.tab-btn i {
    font-size: 16px;
}

.tab-btn:hover {
    background: var(--bg-hover);
    color: var(--primary-color);
}

.tab-btn.active {
    background: var(--primary-gradient);
    color: white;
}

/* 操作栏 */
.bookshelf-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    padding: 16px 24px;
    background: var(--bg-primary);
    border-radius: var(--border-radius);
}

.toolbar-left {
    display: flex;
    gap: 16px;
    align-items: center;
}

.toolbar-right select {
    padding: 10px 16px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 14px;
    outline: none;
    cursor: pointer;
}

.toolbar-right select:focus {
    border-color: var(--primary-color);
}

.checkbox-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    cursor: pointer;
}

.checkbox-btn input {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.toolbar-btn {
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 14px;
    color: var(--text-secondary);
    background: var(--bg-secondary);
    display: flex;
    align-items: center;
    gap: 6px;
    transition: var(--transition);
}

.toolbar-btn:hover {
    background: var(--bg-hover);
    color: var(--primary-color);
}

/* 书架网格 */
.bookshelf-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 24px;
    min-height: 400px;
}

/* 书架卡片 */
.bookshelf-card {
    background: var(--bg-primary);
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    position: relative;
}

.bookshelf-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.bookshelf-card.selected {
    box-shadow: 0 0 0 3px var(--primary-color);
}

.bookshelf-select {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 24px;
    height: 24px;
    background: var(--bg-primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 2;
    opacity: 0;
    transition: var(--transition);
}

.bookshelf-card:hover .bookshelf-select,
.bookshelf-card.selected .bookshelf-select {
    opacity: 1;
}

.bookshelf-select input {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.bookshelf-cover {
    position: relative;
    padding-top: 133%;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-light) 100%);
    overflow: hidden;
}

.bookshelf-cover img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.bookshelf-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: rgba(0,0,0,0.2);
}

.bookshelf-progress-bar {
    height: 100%;
    background: var(--primary-color);
}

.bookshelf-info {
    padding: 16px;
}

.bookshelf-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.bookshelf-meta {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.bookshelf-chapter {
    font-size: 12px;
    color: var(--text-light);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.bookshelf-actions {
    display: flex;
    gap: 8px;
    margin-top: 12px;
}

.bookshelf-actions button {
    flex: 1;
    padding: 8px;
    border-radius: 6px;
    font-size: 13px;
    transition: var(--transition);
}

.btn-continue {
    background: var(--primary-color);
    color: white;
}

.btn-continue:hover {
    background: var(--primary-dark);
}

.btn-remove {
    background: var(--bg-secondary);
    color: var(--text-secondary);
}

.btn-remove:hover {
    background: #ffeaea;
    color: var(--accent-red);
}

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

@media (max-width: 992px) {
    .bookshelf-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    .bookshelf-tabs {
        flex-wrap: wrap;
    }
}

@media (max-width: 768px) {
    .bookshelf-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
    }
    .bookshelf-toolbar {
        flex-direction: column;
        gap: 16px;
        align-items: flex-start;
    }
    .toolbar-left {
        flex-wrap: wrap;
    }
}

/* 分类页面侧边栏 */
.category-layout {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 32px;
}

.category-sidebar {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.sidebar-panel {
    background: var(--bg-primary);
    border-radius: var(--border-radius);
    padding: 24px;
    box-shadow: var(--shadow-sm);
}

.sidebar-panel h3 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.sidebar-panel h3 i {
    color: var(--primary-color);
}

.category-nav li {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    border-radius: 10px;
    cursor: pointer;
    transition: var(--transition);
}

.category-nav li:hover {
    background: var(--bg-hover);
}

.category-nav li.active {
    background: var(--primary-gradient);
    color: white;
}

.category-nav li .cat-icon {
    font-size: 20px;
}

.category-nav li .cat-name {
    flex: 1;
    font-size: 14px;
    font-weight: 500;
}

.category-nav li .cat-count {
    font-size: 12px;
    padding: 2px 8px;
    background: var(--bg-secondary);
    border-radius: 10px;
    color: var(--text-muted);
}

.category-nav li.active .cat-count {
    background: rgba(255,255,255,0.3);
    color: white;
}

.filter-section {
    margin-bottom: 20px;
}

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

.filter-section > label {
    display: block;
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 12px;
}

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

.radio-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: var(--bg-secondary);
    border-radius: 20px;
    font-size: 13px;
    cursor: pointer;
    transition: var(--transition);
}

.radio-btn:hover {
    background: var(--bg-hover);
}

.radio-btn input {
    display: none;
}

.radio-btn:has(input:checked) {
    background: var(--primary-color);
    color: white;
}

.sort-select {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 14px;
    outline: none;
    cursor: pointer;
}

.sort-select:focus {
    border-color: var(--primary-color);
}

/* 分类主内容 */
.category-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.category-header h1 {
    font-size: 24px;
    font-weight: 700;
}

.category-header .novel-count {
    font-size: 14px;
    color: var(--text-muted);
}

.view-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.view-toggle {
    display: flex;
    gap: 4px;
}

.view-btn {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    color: var(--text-muted);
    transition: var(--transition);
}

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

.view-btn.active {
    background: var(--primary-color);
    color: white;
}

.display-options {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: var(--text-muted);
}

.display-options select {
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
}

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

.pagination button {
    min-width: 40px;
    height: 40px;
    padding: 0 16px;
    border-radius: 8px;
    font-size: 14px;
    background: var(--bg-primary);
    color: var(--text-secondary);
    transition: var(--transition);
}

.pagination button:hover:not(:disabled) {
    background: var(--bg-hover);
    color: var(--primary-color);
}

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

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

@media (max-width: 768px) {
    .category-layout {
        grid-template-columns: 1fr;
    }
    .category-sidebar {
        flex-direction: row;
        overflow-x: auto;
    }
    .sidebar-panel {
        min-width: 280px;
    }
}