/* 图书馆详情页样式 - 三栏布局 + 工具栏 + 内容区 + 评论区 */

/* ===== 全宽模式：覆盖骨架层 padding ===== */
.full-width-content {
    padding: 0 !important;
    margin: 0 !important;
    max-width: none !important;
    width: 100% !important;
}

/* ===== 图书馆内页：取消 Dock 左侧偏移，100%全宽铺满 ===== */
body.has-dock.page-library-detail main,
body.has-dock.page-library-detail .main-with-sidebar,
body.has-dock.page-library-detail .book-reader-wrapper {
    margin-left: 0 !important;
}
body.has-dock.dock-collapsed.page-library-detail main,
body.has-dock.dock-collapsed.page-library-detail .main-with-sidebar,
body.has-dock.dock-collapsed.page-library-detail .book-reader-wrapper {
    margin-left: 0 !important;
}

/* 图书馆内页：隐藏页脚 */
body.page-library-detail .site-footer {
    display: none !important;
}

/* ===== 全宽链路：逐级清除所有限制器 ===== */
/* 1) site-main — 最外层内容容器 */
body.page-library-detail .site-main {
    padding: 0 !important;
    max-width: none !important;
    width: 100% !important;
}

/* 2) page-layout-wrapper — 骨架层 flex 容器（限制器） */
body.page-library-detail .page-layout-wrapper {
    max-width: none !important;
    width: 100% !important;
    padding: 0 !important;
    margin: 0 !important;
    gap: 0 !important;
    display: block !important;   /* 从 flex 切 block，消除 flex 子项收缩 */
}

/* 3) main-with-sidebar —— 骨架层主内容区 */
body.page-library-detail .main-with-sidebar {
    max-width: none !important;
    width: 100% !important;
    padding: 0 !important;
    margin: 0 !important;
    flex: none !important;
}

/* 4) library-detail-section —— 覆盖 theme.css (max-width:1100px) + library.css (padding) */
body.page-library-detail .library-detail-section {
    max-width: none !important;
    width: 100% !important;
    padding: 0 !important;
    margin: 0 !important;
}

/* 5) 兜底：清除 section 内所有直接子元素的水平 padding */
body.page-library-detail .library-detail-section > * {
    padding-left: 0 !important;
    padding-right: 0 !important;
}

/* Layout */
.book-reader-wrapper {
    display: grid;
    grid-template-columns: 280px 1fr 320px;
    gap: 0;
    height: calc(100vh - 56px);
    overflow: hidden;
    background: #faf6ee;
    min-width: 0;
}

/* ==================== Sidebar ==================== */
.book-left-sidebar {
    background: #fff;
    border-right: 1px solid #e5dfd0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* .sidebar-tabs / .sidebar-tab / .sidebar-panel 已在 library.css 中定义（library详情页同时加载两文件） */

/* Detail page main content */


.book-toc-header {
    padding: 16px;
    border-bottom: 1px solid #e5dfd0;
}

.book-toc-back {
    display: inline-block;
    color: #913500;
    text-decoration: none;
    font-size: 13px;
    margin-bottom: 8px;
}

.book-toc-title {
    font-size: 16px;
    font-weight: 600;
    color: #2c2418;
    margin-bottom: 4px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.book-toc-author {
    font-size: 13px;
    color: #a89b87;
}

.book-toc-list {
    flex: 1;
    overflow-y: auto;
    padding: 8px 0;
}

.book-toc-item {
    display: block;
    padding: 10px 16px;
    color: #2c2418;
    text-decoration: none;
    font-size: 14px;
    transition: all 0.2s;
    border-left: 3px solid transparent;
}

.book-toc-item:hover {
    background: #faf6ee;
    color: #913500;
}

.book-toc-item.active {
    background: #faf6ee;
    color: #913500;
    border-left-color: #913500;
    font-weight: 600;
}

.book-toc-empty {
    text-align: center;
    padding: 40px 20px;
    color: #a89b87;
    font-size: 14px;
}

/* ==================== 中间主内容区 ==================== */
.book-content-main {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: #fff;
    min-height: 0;
    min-width: 0;
}

/* ==================== 工具栏 ==================== */
.book-content-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 16px;
    background: #faf6ee;
    border-bottom: 1px solid #e5dfd0;
    gap: 12px;
    flex-shrink: 0;
    min-height: 48px;
}

.toolbar-left {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.toolbar-chapter-title {
    font-size: 14px;
    font-weight: 600;
    color: #2c2418;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 300px;
}

.toolbar-right {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-wrap: wrap;
}

.toolbar-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 10px;
    background: none;
    border: 1px solid transparent;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    color: #6b6254;
    transition: all 0.2s;
    white-space: nowrap;
}

.toolbar-btn:hover {
    background: #fff;
    border-color: #e5dfd0;
    color: #913500;
}

.toolbar-btn.active {
    background: #913500;
    color: #fff;
    border-color: #913500;
}

.toolbar-btn svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.toolbar-divider {
    width: 1px;
    height: 20px;
    background: #e5dfd0;
    margin: 0 4px;
}

/* ==================== 内容区域 ==================== */
.book-content-body {
    flex: 1;
    overflow-y: auto;
    padding: 32px 48px;
    background: #fff;
    min-height: 0;
}

/* 章节正文（主显示区） */
#modeText {
    font-size: 17px;
    line-height: 2.2;
    color: #2c2418;
    writing-mode: horizontal-tb !important;
    direction: ltr !important;
    white-space: normal !important;
    word-break: normal !important;
    overflow-wrap: break-word !important;
}

.book-content-inner {
    max-width: 800px;
    margin: 0 auto;
}

.chapter-heading {
    font-size: 28px;
    font-weight: 700;
    color: #2c2418;
    margin-bottom: 32px;
    text-align: center;
    line-height: 1.4;
}


.chapter-body {
    font-size: 17px;
    line-height: 2;
    color: #2c2418;
    writing-mode: horizontal-tb;
    direction: ltr;
    white-space: normal;
    word-break: normal;
    overflow-wrap: break-word;
}

.chapter-body p {
    display: block;
    margin-bottom: 0.5em;
    text-indent: 2em;
    writing-mode: horizontal-tb;
    white-space: normal;
    word-break: normal;
}

.chapter-body p.no-indent {
    text-indent: 0;
}


.mode-scan {
    display: none;
}

.mode-scan.active {
    display: flex;
}

.scan-left {
    flex: 1;
    display: flex;
    flex-direction: column;
    border-right: 1px solid #e5dfd0;
}

.scan-toolbar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: #faf6ee;
    border-bottom: 1px solid #e5dfd0;
}

.scan-body {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    text-align: center;
}

.scan-body img {
    max-width: 100%;
    height: auto;
}

.scan-right {
    flex: 1;
    overflow-y: auto;
    padding: 32px 24px;
}


.no-content {
    text-align: center;
    padding: 60px 20px;
    color: #a89b87;
}

.no-content .icon {
    font-size: 48px;
    margin-bottom: 16px;
}

/* Book */
.book-intro {
    max-width: 800px;
    margin: 0 auto;
    text-align: center;
    padding: 40px 20px;
}

.book-intro-cover {
    width: 200px;
    height: 280px;
    margin: 0 auto 24px;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.book-intro-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.cover-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #913500, #b45a1a);
    color: #fff;
    font-size: 48px;
    font-weight: 700;
}

.cover-placeholder.large {
    font-size: 72px;
}

.book-intro-title {
    font-size: 28px;
    font-weight: 700;
    color: #2c2418;
    margin-bottom: 8px;
}

.book-intro-subtitle {
    font-size: 18px;
    color: #6b6254;
    margin-bottom: 24px;
}

.book-intro-summary {
    text-align: left;
    max-width: 600px;
    margin: 0 auto;
    padding: 24px;
    background: #faf6ee;
    border-radius: 8px;
}

.book-intro-summary h3 {
    font-size: 18px;
    font-weight: 600;
    color: #2c2418;
    margin-bottom: 12px;
}

.book-intro-summary p {
    font-size: 15px;
    line-height: 1.8;
    color: #6b6254;
}

/* Nav */
.reader-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 24px;
    background: #faf6ee;
    border-top: 1px solid #e5dfd0;
    min-height: 56px;
}

.reader-nav a {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #913500;
    text-decoration: none;
    font-size: 14px;
    padding: 8px 12px;
    border-radius: 6px;
    transition: all 0.2s;
}

.reader-nav a:hover {
    background: #fff;
}

.reader-nav a.disabled {
    color: #a89b87;
    cursor: not-allowed;
}

.reader-nav a.disabled:hover {
    background: none;
}

.nav-info {
    font-size: 14px;
    color: #a89b87;
}

/* ==================== Sidebar ==================== */
.book-right-sidebar {
    background: #fff;
    border-left: 1px solid #e5dfd0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Tab */
.right-sidebar-tabs {
    display: flex;
    border-bottom: 1px solid #e5dfd0;
}

.right-sidebar-tab {
    flex: 1;
    padding: 10px 8px;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 12px;
    color: #6b6254;
    transition: all 0.3s;
    text-align: center;
}

.right-sidebar-tab.active {
    color: #913500;
    border-bottom: 2px solid #913500;
    font-weight: 600;
}

/* Search */
.right-panel {
    display: flex;
    flex-direction: column;
    flex: 1;
    overflow: hidden;
    min-height: 0;
}

.search-box {
    padding: 12px;
    border-bottom: 1px solid #e5dfd0;
}

.search-box input[type="text"] {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #e5dfd0;
    border-radius: 6px;
    outline: none;
    font-size: 14px;
    color: #2c2418;
    box-sizing: border-box;
    transition: border-color 0.2s;
}

.search-box input[type="text"]:focus {
    border-color: #913500;
}

.search-box button {
    width: 100%;
    margin-top: 8px;
    padding: 7px;
    background: #913500;
    color: #fff;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    transition: opacity 0.2s;
}

.search-box button:hover {
    opacity: 0.9;
}

.search-results {
    flex: 1;
    overflow-y: auto;
    padding: 12px;
}

.search-empty {
    text-align: center;
    padding: 40px 20px;
    color: #a89b87;
    font-size: 14px;
}

.right-search-box {
    padding: 12px;
    border-bottom: 1px solid #e5dfd0;
}

.right-search-input-wrap {
    display: flex;
    align-items: center;
    border: 1px solid #e5dfd0;
    border-radius: 6px;
    overflow: hidden;
    margin-bottom: 8px;
}

.right-search-input-wrap input {
    flex: 1;
    padding: 8px 12px;
    border: none;
    outline: none;
    font-size: 14px;
    color: #2c2418;
}

.search-clear,
.search-submit {
    padding: 8px 12px;
    background: none;
    border: none;
    cursor: pointer;
    color: #a89b87;
    transition: color 0.2s;
}

.search-clear:hover,
.search-submit:hover {
    color: #913500;
}

.search-fuzzy {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: #6b6254;
    cursor: pointer;
}

.right-search-count {
    font-size: 12px;
    color: #a89b87;
    margin-top: 8px;
    display: none;
}

.right-search-nav {
    display: none;
    gap: 8px;
    margin-top: 8px;
}

.right-search-nav button {
    flex: 1;
    padding: 6px 12px;
    background: #faf6ee;
    border: 1px solid #e5dfd0;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    color: #6b6254;
    transition: all 0.2s;
}

.right-search-nav button:hover {
    background: #913500;
    color: #fff;
    border-color: #913500;
}

/* 快捷搜索标签 */
.quick-search-tags {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    border-bottom: 1px solid #e5dfd0;
}

.quick-label {
    font-size: 12px;
    color: #a89b87;
    white-space: nowrap;
    flex-shrink: 0;
}

.quick-tag {
    display: inline-block;
    padding: 3px 10px;
    background: #faf6ee;
    border: 1px solid #e5dfd0;
    border-radius: 12px;
    font-size: 11px;
    color: #6b6254;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    max-width: 100px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.quick-tag:hover {
    background: #913500;
    border-color: #913500;
    color: #fff;
}

.right-search-results {
    flex: 1;
    overflow-y: auto;
    padding: 12px;
}

.search-result-empty {
    text-align: center;
    padding: 40px 20px;
    color: #a89b87;
    font-size: 14px;
}

/* 增强搜索结果样式 */
.search-result-count {
    font-size: 12px;
    color: #a89b87;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid #e5dfd0;
}

.search-result-item {
    padding: 10px 0;
    border-bottom: 1px solid #f0ebe0;
    cursor: pointer;
    transition: background 0.2s;
    margin-bottom: 4px;
}

.search-result-item:hover {
    background: #faf6ee;
    margin: 0 -8px;
    padding: 10px 8px;
    border-radius: 6px;
}

.search-result-title {
    font-size: 13px;
    font-weight: 600;
    color: #2c2418;
    margin-bottom: 3px;
    line-height: 1.5;
}

.search-result-title mark,
.search-result-preview mark {
    background: #fff3cd;
    color: #856404;
    padding: 0 2px;
    border-radius: 2px;
}

.search-result-meta {
    font-size: 11px;
    color: #a89b87;
    margin-bottom: 3px;
}

.search-result-preview {
    font-size: 12px;
    color: #6b6254;
    line-height: 1.6;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

/* Button */
.right-actions-bar {
    display: flex;
    justify-content: space-around;
    padding: 12px;
    border-top: 1px solid #e5dfd0;
    border-bottom: 1px solid #e5dfd0;
}

.action-icon-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 8px 12px;
    background: none;
    border: 1px solid transparent;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
    color: #6b6254;
    transition: all 0.2s;
}

.action-icon-btn:hover {
    background: #faf6ee;
    border-color: #e5dfd0;
    color: #2c2418;
}

.action-icon-btn.active {
    color: #913500;
    border-color: #913500;
}

.action-icon-btn svg {
    width: 20px;
    height: 20px;
}

/* ==================== 隐藏类 ==================== */
.hidden { display: none !important; }

/* ==================== 评论面板（右侧边栏内）==================== */
.comments-header-bar {
    padding: 12px 16px 8px;
    border-bottom: 1px solid #e5dfd0;
}
.comments-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}
.comments-title-row h3 {
    font-size: 15px;
    font-weight: 600;
    color: #2c2418;
    margin: 0;
}
.comment-total-count {
    font-size: 12px;
    color: #a89b87;
    background: #faf6ee;
    padding: 2px 8px;
    border-radius: 10px;
}
.comments-header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}
.c-icon-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 10px;
    background: none;
    border: 1px solid #e5dfd0;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    color: #6b6254;
    transition: all 0.2s;
}
.c-icon-btn:hover { background: #faf6ee; color: #913500; }
.c-icon-btn.active { color: #e53e3e; }
.c-icon-btn svg { width: 16px; height: 16px; }
.c-icon-btn .like-count,
.c-icon-btn .fav-count { font-size: 12px; }

.comment-input-area {
    padding: 12px 16px;
    border-bottom: 1px solid #e5dfd0;
}
.comment-input-area textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #e5dfd0;
    border-radius: 6px;
    resize: vertical;
    font-size: 13px;
    font-family: inherit;
    box-sizing: border-box;
    outline: none;
}
.comment-input-area textarea:focus { border-color: #913500; }
.comment-submit-btn {
    width: 100%;
    margin-top: 8px;
    padding: 8px;
    background: #913500;
    color: #fff;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    transition: opacity 0.2s;
}
.comment-submit-btn:hover { opacity: 0.9; }

.comment-login-tip {
    padding: 24px 16px;
    text-align: center;
    color: #a89b87;
    font-size: 13px;
}

.comments-list {
    flex: 1;
    overflow-y: auto;
    padding: 8px 0;
}

/* ==================== 相关书籍（中间内容区底部）==================== */
.related-books-section {
    padding: 20px 48px;
    border-top: 1px solid #e5dfd0;
    background: #faf6ee;
}
.related-books-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}
.related-books-header h3 {
    font-size: 16px;
    font-weight: 600;
    color: #2c2418;
    margin: 0;
}
.related-books-header a {
    font-size: 13px;
    color: #913500;
    text-decoration: none;
}
.related-books-list {
    display: flex;
    gap: 12px;
    overflow-x: auto;
}
.related-book-card {
    display: flex;
    gap: 10px;
    min-width: 200px;
    max-width: 260px;
    padding: 10px;
    background: #fff;
    border-radius: 8px;
    text-decoration: none;
    border: 1px solid #e5dfd0;
    transition: all 0.2s;
    flex-shrink: 0;
}
.related-book-card:hover {
    border-color: #913500;
    box-shadow: 0 2px 8px rgba(145,53,0,0.1);
}
.related-book-cover {
    width: 48px;
    height: 64px;
    flex-shrink: 0;
    border-radius: 4px;
    overflow: hidden;
    background: #f0ebe0;
}
.related-book-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.cover-placeholder-small {
    width: 100%;
    height: 100%;
    background: #e8dcc8;
    border: 1px solid #c9b896;
    display: flex;
    align-items: flex-end;
    justify-content: flex-end;
    padding: 4px;
    box-sizing: border-box;
    position: relative;
    overflow: hidden;
}
/* 古籍善本小封面：竖排书名 */
.cover-placeholder-small::before {
    content: attr(data-title);
    writing-mode: vertical-rl;
    text-orientation: upright;
    font-size: 10px;
    color: #6b5d4a;
    letter-spacing: 2px;
    font-weight: 600;
    line-height: 1.2;
    max-height: 90%;
    overflow: hidden;
}
/* 右下角印章 */
.cover-placeholder-small::after {
    content: '藏';
    position: absolute;
    bottom: 3px;
    right: 3px;
    width: 12px;
    height: 12px;
    border: 1px solid #913500;
    color: #913500;
    font-size: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.related-book-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}
.related-book-title {
    font-size: 14px;
    font-weight: 600;
    color: #2c2418;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.related-book-author {
    font-size: 12px;
    color: #a89b87;
}

/* ==================== 引用格式 ==================== */
.library-detail-section + .citations-section,
.citations-section {
    padding: 20px 48px;
    background: #fff;
    border-top: 1px solid #e5dfd0;
}
.citations-section h3 {
    font-size: 15px;
    font-weight: 600;
    color: #2c2418;
    margin-bottom: 12px;
}
.citation-row {
    display: flex;
    gap: 10px;
    padding: 8px 0;
    font-size: 13px;
}
.cite-label {
    font-weight: 700;
    color: #913500;
    flex-shrink: 0;
    min-width: 36px;
}
.citation-row code {
    font-family: 'Courier New', monospace;
    font-size: 12px;
    color: #6b6254;
    background: #faf6ee;
    padding: 4px 8px;
    border-radius: 4px;
    word-break: break-all;
}

/* ==================== 字典浮动面板 ==================== */
.dict-panel {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 10000;
    width: 360px;
    max-height: 480px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.2);
    overflow: hidden;
}
.dict-panel .dict-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: #913500;
    color: #fff;
}
.dict-panel .dict-header h4 { margin: 0; font-size: 15px; }
.dict-panel .dict-header button {
    background: none;
    border: none;
    color: #fff;
    font-size: 22px;
    cursor: pointer;
    line-height: 1;
}
.dict-body {
    padding: 16px;
    max-height: 420px;
    overflow-y: auto;
    font-size: 14px;
    line-height: 1.8;
    color: #2c2418;
}

/* ==================== 批注面板 ==================== */
.ann-panel-header {
    padding: 12px 16px;
    font-weight: 600;
    font-size: 14px;
    color: #2c2418;
    border-bottom: 1px solid #e5dfd0;
}
.ann-panel-body {
    flex: 1;
    overflow-y: auto;
    padding: 12px;
}
.ann-list { min-height: 60px; }
.ann-empty {
    text-align: center;
    padding: 30px 16px;
    color: #a89b87;
    font-size: 13px;
}
.ann-form {
    border-top: 1px solid #e5dfd0;
    padding-top: 12px;
}
.ann-selected-text {
    font-size: 13px;
    color: #913500;
    background: #faf6ee;
    padding: 8px;
    border-radius: 6px;
    margin-bottom: 8px;
}
.ann-form textarea {
    width: 100%;
    padding: 8px;
    border: 1px solid #e5dfd0;
    border-radius: 6px;
    font-size: 13px;
    resize: vertical;
    box-sizing: border-box;
    outline: none;
    margin-bottom: 8px;
}
.ann-form-actions {
    display: flex;
    gap: 8px;
}
.ann-form-actions button {
    flex: 1;
    padding: 7px;
    border: 1px solid #e5dfd0;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    background: #fff;
    color: #6b6254;
}
.ann-form-actions button.primary {
    background: #913500;
    color: #fff;
    border-color: #913500;
}

/* ==================== 分栏对照模式 ==================== */
.split-compare-view {
    display: flex;
    height: 100%;
    overflow: hidden;
}
.split-left-panel,
.split-right-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-width: 0;
}
.split-left-panel { border-right: 1px solid #e5dfd0; }
.split-panel-label {
    padding: 8px 16px;
    font-size: 12px;
    font-weight: 600;
    color: #a89b87;
    background: #faf6ee;
    border-bottom: 1px solid #e5dfd0;
    text-align: center;
}
.split-text-content {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
    font-size: 17px;
    line-height: 2.2;
    color: #2c2418;
}
.split-divider {
    width: 4px;
    background: #e5dfd0;
    cursor: col-resize;
    display: flex;
    align-items: center;
    justify-content: center;
}
.split-divider-bar {
    width: 2px;
    height: 40px;
    background: #913500;
    border-radius: 1px;
}
.split-image-content {
    flex: 1;
    overflow-y: auto;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 16px;
}
.split-image-content img {
    max-width: 100%;
    height: auto;
}
.split-zoom-controls {
    position: sticky;
    top: 0;
    display: flex;
    justify-content: center;
    gap: 8px;
    padding: 8px;
    background: rgba(250,246,238,0.9);
}
.no-scan-hint {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: #a89b87;
    font-size: 13px;
    gap: 12px;
}
.no-scan-hint svg { width: 48px; height: 48px; opacity: 0.4; }

/* 翻译对照模式 */
.chapter-body-translation {
    padding: 24px 48px;
    font-size: 15px;
    line-height: 2;
}
.chapter-body-translation p {
    margin-bottom: 0.5em;
}
.chapter-body-translation .orig-text {
    color: #2c2418;
}
.chapter-body-translation .trans-text {
    color: #a89b87;
    font-size: 13px;
}

/* 影印全屏模式 */
.chapter-body-scan {
    height: 100%;
    display: flex;
    flex-direction: column;
}
.scan-image-wrapper {
    flex: 1;
    overflow: auto;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 16px;
}
.scan-image-wrapper img {
    max-width: 100%;
    height: auto;
    transition: transform 0.2s;
}

/* PDF 模式 */
.pdf-viewer {
    height: 100%;
    display: flex;
    flex-direction: column;
}
.pdf-toolbar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    padding: 8px 16px;
    background: #faf6ee;
    border-bottom: 1px solid #e5dfd0;
}
.pdf-toolbar button {
    padding: 6px 14px;
    background: #fff;
    border: 1px solid #e5dfd0;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
}
.pdf-canvas-container {
    flex: 1;
    overflow: auto;
    display: flex;
    justify-content: center;
    padding: 16px;
    background: #555;
}
.pdf-canvas-container canvas {
    background: #fff;
    box-shadow: 0 2px 12px rgba(0,0,0,0.3);
}

/* ==================== 可点击汉字 ==================== */
.word-char {
    cursor: pointer;
    padding: 0 1px;
    border-radius: 2px;
    transition: background 0.15s, color 0.15s;
}
.word-char:hover {
    background: #fff3cd;
    color: #913500;
}

/* ==================== 书籍完整元数据（无章节时）==================== */
.book-meta-full {
    display: flex;
    gap: 32px;
    max-width: 800px;
    margin: 0 auto;
    padding: 40px 20px;
}
.book-cover-large {
    width: 180px;
    height: 240px;
    flex-shrink: 0;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0,0,0,0.12);
}
.book-cover-large img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.book-meta-info { flex: 1; }
.book-meta-info h1 {
    font-size: 26px;
    font-weight: 700;
    color: #2c2418;
    margin: 0 0 16px;
}
.meta-row {
    display: flex;
    gap: 8px;
    margin-bottom: 8px;
    font-size: 14px;
    color: #6b6254;
}
.meta-label {
    font-weight: 600;
    color: #2c2418;
    min-width: 70px;
    flex-shrink: 0;
}
.book-intro-summary {
    margin-top: 20px;
    padding: 16px 20px;
    background: #faf6ee;
    border-radius: 8px;
    font-size: 14px;
    line-height: 1.8;
    color: #6b6254;
}

/* ==================== 设置下拉菜单 ==================== */
.settings-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 4px;
    background: #fff;
    border: 1px solid #e5dfd0;
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.12);
    padding: 8px 0;
    min-width: 180px;
    z-index: 100;
}
.settings-dropdown.show { display: block; }
.settings-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    font-size: 13px;
    color: #2c2418;
    cursor: pointer;
}
.settings-item:hover { background: #faf6ee; }
.settings-item input[type="checkbox"] { accent-color: #913500; }
.check-icon { color: #913500; font-weight: bold; }
.font-size-controls {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
}
.font-size-controls button {
    padding: 2px 8px;
    border: 1px solid #e5dfd0;
    border-radius: 4px;
    background: #fff;
    cursor: pointer;
    font-size: 12px;
}

/* ==================== 响应式适配 ==================== */
@media (max-width: 1024px) {
    .book-reader-wrapper {
        grid-template-columns: 220px 1fr 280px;
    }
    .book-content-body,
    .related-books-section,
    .citations-section { padding-left: 24px; padding-right: 24px; }
}
@media (max-width: 768px) {
    .book-reader-wrapper {
        grid-template-columns: 1fr;
        height: auto;
        overflow: visible;
    }
    .book-left-sidebar,
    .book-right-sidebar {
        display: none;
    }
    .book-left-sidebar.mobile-show,
    .book-right-sidebar.mobile-show {
        display: flex;
        position: fixed;
        top: 60px;
        bottom: 0;
        left: 0;
        width: 280px;
        z-index: 9999;
        box-shadow: 4px 0 16px rgba(0,0,0,0.15);
    }
    .book-right-sidebar.mobile-show {
        left: auto;
        right: 0;
        width: 300px;
    }
}

/* ===== 批注功能样式 (annotation.js) ===== */
.annotation-popup {
    position: fixed;
    z-index: 10000;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0,0,0,.15);
    padding: 4px;
    display: flex;
    gap: 2px;
}
.annotation-popup .ann-pop-btn {
    border: none;
    background: none;
    padding: 6px 12px;
    cursor: pointer;
    font-size: 13px;
    border-radius: 4px;
    color: #555;
}
.annotation-popup .ann-pop-btn:hover { background: #f5f5f5; }
.annotation-popup .ann-pop-close { margin-left: auto; color: #999; }
.annotation-editor {
    background: #fefce8;
    border: 1px solid #e8e3c5;
    border-radius: 6px;
    padding: 10px;
    margin-bottom: 8px;
}
.annotation-editor textarea.ann-editor-text {
    width: 100%;
    box-sizing: border-box;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 8px;
    font-size: 13px;
    resize: vertical;
    min-height: 60px;
    margin-bottom: 6px;
}
.annotation-editor .ann-editor-actions { text-align: right; }
.annotation-editor .ann-save-btn,
.annotation-editor .ann-cancel-btn {
    padding: 4px 14px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
}
.annotation-editor .ann-save-btn { background: #913500; color: #fff; }
.annotation-editor .ann-cancel-btn { background: #eee; color: #666; margin-left: 4px; }

.annotation-item {
    background: #fff;
    border: 1px solid #eee;
    border-radius: 6px;
    padding: 8px 10px;
    margin-bottom: 6px;
}
.annotation-item .ann-quote {
    color: #913500;
    font-size: 12px;
    line-height: 1.4;
    margin-bottom: 4px;
}
.annotation-item .ann-content {
    font-size: 13px;
    line-height: 1.5;
    color: #333;
    margin-bottom: 4px;
}
.annotation-item .ann-time {
    font-size: 11px;
    color: #aaa;
}

#annList .ann-empty {
    text-align: center;
    color: #bbb;
    padding: 20px 0;
    font-size: 13px;
}
}