/* ============================================================
   书籍模块专属样式 - 参考识典古籍(https://www.shidianguji.com)风格
   特点：温暖宣纸色背景、传统书卷气、清晰的信息层级
   ============================================================ */

/* ============================================================
   1. 书籍模块专用变量
   ============================================================ */
:root {
    --book-bg: #f7f4ed;           /* 宣纸色背景 */
    --book-bg-card: #ffffff;       /* 卡片背景 */
    --book-bg-warm: #faf6ee;       /* 温暖米色 */
    --book-border: #e5dfd0;        /* 古朴边框色 */
    --book-text: #2c2418;           /* 墨色文字 */
    --book-text-2: #6b6254;         /* 次要文字 */
    --book-text-3: #a89b87;         /* 辅助文字 */
    --book-primary: #913500;        /* 主色（与全站一致） */
    --book-primary-light: #b44a1a;
    --book-accent: #c0392b;         /* 朱砂红强调色 */
    --book-cover-shadow: 0 4px 16px rgba(0,0,0,0.12);
    --book-radius: 8px;
    --book-radius-lg: 12px;
}

[data-theme="dark"] {
    --book-bg: #1a1712;
    --book-bg-card: #25201a;
    --book-bg-warm: #1f1b15;
    --book-border: #3a342a;
    --book-text: #e8e0d0;
    --book-text-2: #a89b87;
    --book-text-3: #6b6254;
    --book-cover-shadow: 0 4px 16px rgba(0,0,0,0.3);
}

/* ============================================================
   2. 书籍列表页 - 页面横幅
   ============================================================ */
.book-banner {
    background: linear-gradient(135deg, #2c2418 0%, #4a3c28 50%, #2c2418 100%);
    color: #faf6ee;
    text-align: center;
    padding: 56px 20px 48px;
    position: relative;
    overflow: hidden;
}

.book-banner::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.03'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    pointer-events: none;
}

.book-banner h1 {
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 10px;
    letter-spacing: 4px;
    position: relative;
}

.book-banner p {
    font-size: 15px;
    opacity: 0.8;
    position: relative;
}

/* ============================================================
   3. 书籍列表页 - 筛选栏
   ============================================================ */
.book-filter-bar {
    background: var(--book-bg-card);
    border: 1px solid var(--book-border);
    border-radius: var(--book-radius-lg);
    padding: 20px 24px;
    margin-bottom: 24px;
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
    box-shadow: 0 1px 4px rgba(0,0,0,0.04);
}

.book-filter-bar .filter-search {
    flex: 1;
    min-width: 220px;
    position: relative;
}

.book-filter-bar .filter-search input {
    width: 100%;
    padding: 9px 16px 9px 38px;
    border: 1px solid var(--book-border);
    border-radius: var(--book-radius);
    font-size: 14px;
    color: var(--book-text);
    background: var(--book-bg);
    transition: var(--transition);
    outline: none;
}

.book-filter-bar .filter-search input:focus {
    border-color: var(--book-primary);
    box-shadow: 0 0 0 3px rgba(var(--c-primary-rgb), 0.1);
}

.book-filter-bar .filter-search::before {
    content: '🔍';
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 14px;
    pointer-events: none;
}

.book-filter-bar select {
    padding: 9px 32px 9px 14px;
    border: 1px solid var(--book-border);
    border-radius: var(--book-radius);
    font-size: 14px;
    color: var(--book-text);
    background: var(--book-bg);
    cursor: pointer;
    outline: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%236b6254' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    transition: var(--transition);
}

.book-filter-bar select:focus {
    border-color: var(--book-primary);
}

.book-filter-bar .filter-btn {
    padding: 9px 20px;
    border: none;
    border-radius: var(--book-radius);
    background: var(--book-primary);
    color: #fff;
    font-size: 14px;
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
}

.book-filter-bar .filter-btn:hover {
    background: var(--book-primary-light);
}

.book-filter-bar .filter-reset {
    padding: 9px 16px;
    border: 1px solid var(--book-border);
    border-radius: var(--book-radius);
    background: transparent;
    color: var(--book-text-2);
    font-size: 14px;
    text-decoration: none;
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
}

.book-filter-bar .filter-reset:hover {
    border-color: var(--book-primary);
    color: var(--book-primary);
}

/* 结果统计 */
.book-result-info {
    font-size: 14px;
    color: var(--book-text-3);
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.book-result-info strong {
    color: var(--book-primary);
    font-weight: 600;
}

/* 视图切换 */
.book-view-toggle {
    display: flex;
    gap: 4px;
    background: var(--book-bg);
    border: 1px solid var(--book-border);
    border-radius: var(--book-radius);
    padding: 3px;
}

.book-view-toggle button {
    padding: 5px 10px;
    border: none;
    border-radius: 5px;
    background: transparent;
    color: var(--book-text-3);
    font-size: 14px;
    cursor: pointer;
    transition: var(--transition);
}

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

/* ============================================================
   4. 书籍网格/列表
   ============================================================ */
.book-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
}

.book-grid.list-view {
    grid-template-columns: 1fr;
    gap: 12px;
}

/* 书籍卡片 */
.book-card {
    display: block;
    text-decoration: none;
    color: inherit;
    background: var(--book-bg-card);
    border: 1px solid var(--book-border);
    border-radius: var(--book-radius-lg);
    overflow: hidden;
    transition: all 0.25s ease;
    position: relative;
}

.book-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--book-cover-shadow);
    border-color: var(--book-primary);
}

/* 封面 */
.book-card-cover {
    position: relative;
    aspect-ratio: 3/4;
    overflow: hidden;
    background: var(--book-bg);
}

.book-card-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

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

/* 无封面时的占位 */
.book-card-cover .cover-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 56px;
    color: var(--book-text-3);
    background: linear-gradient(135deg, var(--book-bg-warm) 0%, #efe8d8 100%);
}

/* 卡片标签 */
.book-card-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    z-index: 1;
}

.book-card-badge.vip {
    background: linear-gradient(135deg, #f5d080, #e6a23c);
    color: #5a3e1b;
}

.book-card-badge.download {
    background: var(--book-primary);
    color: #fff;
    left: 10px;
    right: auto;
}

/* 卡片信息区 */
.book-card-body {
    padding: 14px 16px 16px;
}

.book-card-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--book-text);
    line-height: 1.5;
    margin-bottom: 6px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.book-card-author {
    font-size: 13px;
    color: var(--book-text-2);
    margin-bottom: 8px;
}

.book-card-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: var(--book-text-3);
}

.book-card-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 8px;
}

.book-card-tags .tag {
    padding: 1px 6px;
    border-radius: 3px;
    font-size: 11px;
    background: var(--book-bg);
    color: var(--book-text-2);
    border: 1px solid var(--book-border);
}

/* 列表视图样式 */
.book-grid.list-view .book-card {
    display: flex;
    flex-direction: row;
    border-radius: var(--book-radius);
}

.book-grid.list-view .book-card-cover {
    width: 120px;
    min-height: 160px;
    aspect-ratio: auto;
    flex-shrink: 0;
}

.book-grid.list-view .book-card-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

/* ============================================================
   5. 分页
   ============================================================ */
.book-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-top: 40px;
    padding-bottom: 40px;
}

.book-pagination a,
.book-pagination span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 12px;
    border: 1px solid var(--book-border);
    border-radius: var(--book-radius);
    font-size: 14px;
    color: var(--book-text-2);
    text-decoration: none;
    background: var(--book-bg-card);
    transition: var(--transition);
}

.book-pagination a:hover {
    border-color: var(--book-primary);
    color: var(--book-primary);
    background: var(--book-bg-warm);
}

.book-pagination span.current {
    background: var(--book-primary);
    border-color: var(--book-primary);
    color: #fff;
    font-weight: 600;
}

/* ============================================================
   6. 书籍详情页 - 三栏阅读布局（参考识典古籍）
   ============================================================ */
.book-reader-wrapper {
    display: grid;
    grid-template-columns: 220px 1fr 280px;
    min-height: calc(100vh - var(--header-h));
    background: var(--book-bg);
}

/* 左侧目录栏 */
.book-toc-sidebar {
    background: var(--book-bg-card);
    border-right: 1px solid var(--book-border);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.book-toc-header {
    padding: 20px 16px;
    border-bottom: 1px solid var(--book-border);
    flex-shrink: 0;
}

.book-toc-back {
    font-size: 13px;
    color: var(--book-text-3);
    text-decoration: none;
    display: inline-block;
    margin-bottom: 10px;
    transition: color 0.2s;
}

.book-toc-back:hover {
    color: var(--book-primary);
}

.book-toc-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--book-text);
    line-height: 1.4;
    margin-bottom: 4px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.book-toc-author {
    font-size: 12px;
    color: var(--book-text-3);
}

.book-toc-list {
    flex: 1;
    overflow-y: auto;
    padding: 8px 0;
}

.book-toc-item {
    display: block;
    padding: 10px 20px;
    font-size: 14px;
    color: var(--book-text-2);
    text-decoration: none;
    border-left: 3px solid transparent;
    transition: all 0.2s;
    line-height: 1.5;
}

.book-toc-item:hover {
    background: var(--c-primary-bg);
    color: var(--book-primary);
}

.book-toc-item.active {
    background: var(--c-primary-bg);
    color: var(--book-primary);
    border-left-color: var(--book-primary);
    font-weight: 600;
}

.book-toc-empty {
    padding: 40px 20px;
    text-align: center;
    color: var(--book-text-3);
    font-size: 13px;
}

/* 中间内容区 */
.book-content-main {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: var(--book-bg);
}

.book-content-toolbar {
    height: 48px;
    background: var(--book-bg-card);
    border-bottom: 1px solid var(--book-border);
    display: flex;
    align-items: center;
    padding: 0 16px;
    gap: 8px;
    flex-shrink: 0;
}

.toolbar-btn {
    padding: 5px 10px;
    border: 1px solid var(--book-border);
    border-radius: 6px;
    background: transparent;
    color: var(--book-text-2);
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
}

.toolbar-btn:hover {
    border-color: var(--book-primary);
    color: var(--book-primary);
}

.toolbar-chapter-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--book-text);
    margin-left: 8px;
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.toolbar-right {
    display: flex;
    gap: 6px;
}

.book-content-body {
    flex: 1;
    overflow-y: auto;
    padding: 32px 48px;
}

/* 章节文字 */
.book-chapter-text {
    max-width: 720px;
    margin: 0 auto;
    font-size: 18px;
    line-height: 2.2;
    color: var(--book-text);
    transition: font-size 0.2s;
}

.book-chapter-text .chapter-heading {
    font-size: 24px;
    font-weight: 700;
    text-align: center;
    margin-bottom: 32px;
    color: var(--book-text);
    letter-spacing: 2px;
}

.book-chapter-text .chapter-body {
    text-indent: 2em;
}

/* 章节导航 */
.chapter-nav {
    max-width: 720px;
    margin: 48px auto 0;
    display: flex;
    justify-content: space-between;
    gap: 16px;
    padding-top: 24px;
    border-top: 1px solid var(--book-border);
}

.chapter-nav-btn {
    display: flex;
    flex-direction: column;
    padding: 12px 20px;
    border: 1px solid var(--book-border);
    border-radius: var(--book-radius);
    background: var(--book-bg-card);
    color: var(--book-text);
    text-decoration: none;
    transition: all 0.2s;
    min-width: 140px;
}

.chapter-nav-btn:hover {
    border-color: var(--book-primary);
    color: var(--book-primary);
}

.chapter-nav-btn.next {
    text-align: right;
    margin-left: auto;
}

.chapter-nav-btn span {
    font-size: 14px;
    font-weight: 600;
}

.chapter-nav-btn small {
    font-size: 12px;
    color: var(--book-text-3);
    margin-top: 4px;
}

/* 书籍简介（无章节时） */
.book-intro {
    max-width: 600px;
    margin: 0 auto;
    text-align: center;
    padding: 40px 0;
}

.book-intro-cover {
    width: 200px;
    margin: 0 auto 24px;
    aspect-ratio: 3/4;
    border-radius: var(--book-radius-lg);
    overflow: hidden;
    box-shadow: var(--book-cover-shadow);
}

.book-intro-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.book-intro-cover .cover-placeholder.large {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 80px;
    color: var(--book-text-3);
    background: linear-gradient(135deg, var(--book-bg-warm), #efe8d8);
}

.book-intro-title {
    font-size: 26px;
    font-weight: 700;
    color: var(--book-text);
    margin-bottom: 8px;
}

.book-intro-subtitle {
    font-size: 15px;
    color: var(--book-text-2);
    margin-bottom: 24px;
}

.book-intro-summary {
    text-align: left;
    background: var(--book-bg-card);
    border: 1px solid var(--book-border);
    border-radius: var(--book-radius-lg);
    padding: 24px;
}

.book-intro-summary h3 {
    font-size: 16px;
    font-weight: 600;
    color: var(--book-text);
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--book-primary);
    display: inline-block;
}

.book-intro-summary p {
    font-size: 15px;
    line-height: 2;
    color: var(--book-text-2);
    text-indent: 2em;
}

/* 右侧信息面板 */
.book-info-panel {
    background: var(--book-bg-card);
    border-left: 1px solid var(--book-border);
    overflow-y: auto;
    padding: 20px;
}

.info-panel-section {
    margin-bottom: 24px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--book-border);
}

.info-panel-section:last-child {
    border-bottom: none;
}

.info-panel-section h3 {
    font-size: 14px;
    font-weight: 700;
    color: var(--book-text);
    margin-bottom: 14px;
    letter-spacing: 1px;
}

.info-panel-item {
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin-bottom: 12px;
}

.info-panel-item .info-label {
    font-size: 12px;
    color: var(--book-text-3);
}

.info-panel-item .info-value {
    font-size: 14px;
    color: var(--book-text);
    line-height: 1.5;
}

/* 操作按钮 */
.info-panel-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.btn-read-full {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 16px;
    border: none;
    border-radius: var(--book-radius);
    background: var(--book-primary);
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-read-full:hover {
    background: var(--book-primary-light);
}

.btn-action-panel {
    padding: 8px 12px;
    border: 1px solid var(--book-border);
    border-radius: var(--book-radius);
    background: var(--book-bg);
    color: var(--book-text-2);
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
}

.btn-action-panel:hover,
.btn-action-panel.active {
    border-color: var(--book-primary);
    color: var(--book-primary);
    background: var(--c-primary-bg);
}

/* 相关书籍 */
.related-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.related-item {
    display: flex;
    gap: 10px;
    padding: 8px;
    border-radius: var(--book-radius);
    text-decoration: none;
    color: inherit;
    transition: all 0.2s;
}

.related-item:hover {
    background: var(--book-bg);
}

.related-cover {
    width: 40px;
    height: 54px;
    border-radius: 4px;
    overflow: hidden;
    background: var(--book-bg);
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    color: var(--book-text-3);
}

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

.related-info {
    flex: 1;
    min-width: 0;
}

.related-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--book-text);
    line-height: 1.4;
    margin-bottom: 2px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.related-author {
    font-size: 12px;
    color: var(--book-text-3);
}

/* ============================================================
   7. 阅读页（book_reader.php）
   ============================================================ */
.reader-body {
    background: var(--book-bg);
}

.reader-layout {
    display: grid;
    grid-template-columns: 300px 1fr;
    height: 100vh;
    overflow: hidden;
}

/* 左侧目录侧边栏 */
.reader-sidebar {
    background: var(--book-bg-card);
    border-right: 1px solid var(--book-border);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: width 0.3s ease;
}

.reader-sidebar.collapsed {
    width: 0;
    min-width: 0;
    border-right: none;
}

.reader-sidebar-header {
    padding: 20px;
    border-bottom: 1px solid var(--book-border);
    flex-shrink: 0;
}

.reader-sidebar-header h3 {
    font-size: 16px;
    font-weight: 700;
    color: var(--book-text);
    margin: 0 0 10px;
}

.reader-sidebar-book {
    display: flex;
    gap: 10px;
    align-items: flex-start;
}

.reader-sidebar-book-cover {
    width: 40px;
    height: 54px;
    border-radius: 4px;
    overflow: hidden;
    background: var(--book-bg);
    flex-shrink: 0;
}

.reader-sidebar-book-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.reader-sidebar-book-info {
    font-size: 13px;
    color: var(--book-text-2);
    line-height: 1.5;
}

.reader-sidebar-book-info .book-name {
    font-weight: 600;
    color: var(--book-text);
}

/* 目录树 */
.reader-toc {
    flex: 1;
    overflow-y: auto;
    padding: 12px 0;
}

.reader-toc-item {
    display: block;
    padding: 9px 20px;
    font-size: 14px;
    color: var(--book-text);
    text-decoration: none;
    cursor: pointer;
    transition: var(--transition);
    border-left: 3px solid transparent;
}

.reader-toc-item:hover {
    background: var(--c-primary-bg);
    color: var(--book-primary);
}

.reader-toc-item.active {
    background: var(--c-primary-bg);
    color: var(--book-primary);
    border-left-color: var(--book-primary);
    font-weight: 600;
}

.reader-toc-item.level-1 {
    padding-left: 36px;
    font-size: 13px;
    color: var(--book-text-2);
}

.reader-toc-item.level-2 {
    padding-left: 52px;
    font-size: 13px;
    color: var(--book-text-3);
}

/* 阅读页主内容区 */
.reader-main {
    overflow-y: auto;
    padding: 48px 60px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.reader-content {
    max-width: 760px;
    width: 100%;
    font-size: 17px;
    line-height: 2.2;
    color: var(--book-text);
    word-break: break-ideographic;
}

.reader-content h1 {
    font-size: 28px;
    font-weight: 700;
    text-align: center;
    margin-bottom: 12px;
    color: var(--book-text);
    line-height: 1.5;
}

.reader-content h2 {
    font-size: 20px;
    font-weight: 600;
    margin: 32px 0 16px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--book-border);
    color: var(--book-text);
}

.reader-content p {
    margin-bottom: 1.2em;
    text-indent: 2em;
}

/* 阅读页顶部工具栏 */
.reader-toolbar {
    position: fixed;
    top: 0;
    left: 300px;
    right: 0;
    height: 48px;
    background: var(--book-bg-card);
    border-bottom: 1px solid var(--book-border);
    display: flex;
    align-items: center;
    padding: 0 20px;
    gap: 8px;
    z-index: 100;
    transition: left 0.3s ease;
}

.reader-toolbar.sidebar-collapsed {
    left: 0;
}

.reader-toolbar button {
    padding: 6px 12px;
    border: 1px solid var(--book-border);
    border-radius: 6px;
    background: transparent;
    color: var(--book-text-2);
    font-size: 13px;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 4px;
}

.reader-toolbar button:hover {
    border-color: var(--book-primary);
    color: var(--book-primary);
}

.reader-toolbar button.active {
    background: var(--c-primary-bg);
    border-color: var(--book-primary);
    color: var(--book-primary);
}

.reader-toolbar .toolbar-right {
    margin-left: auto;
    display: flex;
    gap: 8px;
}

/* 设置面板 */
.reader-settings-panel {
    position: fixed;
    top: 48px;
    right: 20px;
    width: 280px;
    background: var(--book-bg-card);
    border: 1px solid var(--book-border);
    border-radius: var(--book-radius-lg);
    box-shadow: var(--shadow-lg);
    padding: 20px;
    z-index: 200;
    display: none;
}

.reader-settings-panel.show {
    display: block;
}

.reader-settings-panel h4 {
    font-size: 15px;
    font-weight: 600;
    color: var(--book-text);
    margin: 0 0 16px;
}

.setting-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
}

.setting-row label {
    font-size: 13px;
    color: var(--book-text-2);
}

.setting-row select,
.setting-row input[type="range"] {
    padding: 4px 8px;
    border: 1px solid var(--book-border);
    border-radius: 4px;
    font-size: 13px;
    color: var(--book-text);
    background: var(--book-bg);
}

/* 背景色选项 */
.reader-bg-options {
    display: flex;
    gap: 8px;
}

.reader-bg-option {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 2px solid var(--book-border);
    cursor: pointer;
    transition: var(--transition);
}

.reader-bg-option.active {
    border-color: var(--book-primary);
    box-shadow: 0 0 0 2px rgba(var(--c-primary-rgb), 0.3);
}

.reader-bg-option.bg-default { background: #f7f4ed; }
.reader-bg-option.bg-white   { background: #ffffff; border: 2px solid #ccc; }
.reader-bg-option.bg-sepia   { background: #f0e6d0; }
.reader-bg-option.bg-dark    { background: #1a1712; }

/* ============================================================
   8. 专题/专辑页
   ============================================================ */
.book-topic-banner {
    background: linear-gradient(135deg, #2c2418 0%, #5a3e28 100%);
    color: #faf6ee;
    padding: 64px 20px 56px;
    text-align: center;
}

.book-topic-banner h1 {
    font-size: 30px;
    font-weight: 700;
    margin-bottom: 10px;
    letter-spacing: 3px;
}

.book-topic-banner p {
    font-size: 15px;
    opacity: 0.8;
    max-width: 640px;
    margin: 0 auto;
    line-height: 1.8;
}

.book-topic-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 24px;
    padding: 32px 16px;
    max-width: var(--max-w);
    margin: 0 auto;
}

.book-topic-card {
    display: block;
    text-decoration: none;
    color: inherit;
    background: var(--book-bg-card);
    border: 1px solid var(--book-border);
    border-radius: var(--book-radius-lg);
    overflow: hidden;
    transition: all 0.25s ease;
}

.book-topic-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--book-cover-shadow);
}

.book-topic-card-cover {
    width: 100%;
    height: 180px;
    overflow: hidden;
    background: var(--book-bg);
}

.book-topic-card-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.book-topic-card-body {
    padding: 16px 20px;
}

.book-topic-card-title {
    font-size: 17px;
    font-weight: 600;
    color: var(--book-text);
    margin-bottom: 8px;
}

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

/* ============================================================
   9. 响应式
   ============================================================ */
@media (max-width: 1024px) {
    .book-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    .book-reader-wrapper {
        grid-template-columns: 200px 1fr 240px;
    }
    .book-content-body {
        padding: 24px 32px;
    }
    .reader-layout {
        grid-template-columns: 260px 1fr;
    }
    .reader-main {
        padding: 40px 32px;
    }
}

@media (max-width: 768px) {
    .book-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
    }
    .book-reader-wrapper {
        grid-template-columns: 1fr;
    }
    .book-toc-sidebar {
        display: none;
        position: fixed;
        top: var(--header-h);
        left: 0;
        bottom: 0;
        width: 260px;
        z-index: 200;
        box-shadow: 4px 0 16px rgba(0,0,0,0.15);
    }
    .book-toc-sidebar.show {
        display: flex;
    }
    .book-info-panel {
        display: none;
    }
    .book-content-body {
        padding: 20px 16px;
    }
    .reader-layout {
        grid-template-columns: 1fr;
    }
    .reader-sidebar {
        display: none;
    }
    .reader-toolbar {
        left: 0;
    }
    .reader-main {
        padding: 60px 16px 32px;
    }
    .book-banner h1 {
        font-size: 24px;
    }
    .book-filter-bar {
        flex-direction: column;
        align-items: stretch;
    }
}

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