/* 图书馆详情页样式 - 三栏布局 + 工具栏 + 内容区 + 评论区 */

/* Library detail page - override main-content padding */
.main-content {
    padding: 0 !important;
}

/* Layout */
.book-reader-wrapper {
    display: grid;
    grid-template-columns: 280px 1fr 320px;
    gap: 0;
    height: calc(100vh - 60px);
    overflow: hidden;
    background: #faf6ee;
}

/* ==================== Sidebar ==================== */
.book-left-sidebar {
    background: #fff;
    border-right: 1px solid #e5dfd0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.sidebar-tabs {
    display: flex;
    border-bottom: 1px solid #e5dfd0;
}

.sidebar-tab {
    flex: 1;
    padding: 12px 16px;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 14px;
    color: #6b6254;
    transition: all 0.3s;
}

.sidebar-tab.active {
    color: #913500;
    border-bottom: 2px solid #913500;
    font-weight: 600;
}

.sidebar-panel {
    display: flex;
    flex-direction: column;
    flex: 1;
    overflow: hidden;
}


.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-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;
}

/* Comments（新版样式见上方 .comments-header-bar 区域） */

/* 昵称行（旧兼容，保留） */
.comment-meta-row {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 6px;
}

.right-related {
    padding: 12px;
    border-bottom: 1px solid #e5dfd0;
}

.right-related h4 {
    font-size: 14px;
    font-weight: 600;
    color: #2c2418;
    margin-bottom: 12px;
}

.related-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.related-item {
    display: flex;
    gap: 12px;
    padding: 8px;
    border-radius: 6px;
    text-decoration: none;
    transition: background 0.2s;
}

.related-item:hover {
    background: #faf6ee;
}

.related-cover {
    width: 40px;
    height: 56px;
    border-radius: 4px;
    overflow: hidden;
    flex-shrink: 0;
}

.related-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.related-cover span {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #913500, #b45a1a);
    color: #fff;
    font-size: 18px;
    font-weight: 700;
}

.related-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 4px;
}

.related-title {
    font-size: 14px;
    font-weight: 600;
    color: #2c2418;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.related-author {
    font-size: 12px;
    color: #a89b87;
}


.dict-panel {
    display: none;
    position: fixed;
    bottom: 20px;
    right: 340px;
    width: 300px;
    background: #fff;
    border: 1px solid #e5dfd0;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    z-index: 1000;
}

.dict-panel.show {
    display: block;
}

.dict-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    border-bottom: 1px solid #e5dfd0;
}

.dict-header h4 {
    font-size: 14px;
    font-weight: 600;
    color: #2c2418;
    margin: 0;
}

.dict-header button {
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    color: #a89b87;
}

.dict-body {
    padding: 16px;
    max-height: 300px;
    overflow-y: auto;
}

.dict-empty {
    text-align: center;
    color: #a89b87;
    font-size: 14px;
}


.word-char {
    display: inline;
    cursor: pointer;
    transition: background 0.2s;
    white-space: normal;
    word-break: normal;
}

.word-char:hover {
    background: #fff3e0;
    border-radius: 2px;
}

.word-char.highlight {
    background: #ffe0b2;
    border-radius: 2px;
}


.ann-list {
    padding: 12px;
}

.ann-form {
    padding: 12px;
}

.ann-form textarea {
    width: 100%;
    height: 80px;
    padding: 8px 12px;
    border: 1px solid #e5dfd0;
    border-radius: 6px;
    outline: none;
    font-size: 14px;
    color: #2c2418;
    resize: vertical;
    margin-bottom: 8px;
}

.ann-form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

.ann-form-actions button {
    padding: 6px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s;
}

.ann-form-actions button:first-child {
    background: none;
    border: 1px solid #e5dfd0;
    color: #6b6254;
}

.ann-form-actions button.primary {
    background: #913500;
    border: 1px solid #913500;
    color: #fff;
}

.ann-form-actions button:hover {
    opacity: 0.9;
}

/* Search */
#autoSearchPanel {
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        transform: translateY(100%);
    }
    to {
        transform: translateY(0);
    }
}

#autoSearchResults {
    font-size: 14px;
}

#autoSearchResults .search-result-item {
    transition: all 0.2s;
}

#autoSearchResults .search-result-item:hover {
    border-color: #913500 !important;
    box-shadow: 0 2px 8px rgba(145,53,0,0.1);
}

/* Layout */
@media (max-width: 1200px) {
    .book-reader-wrapper {
        grid-template-columns: 240px 1fr 280px;
    }
}

@media (max-width: 992px) {
    .book-reader-wrapper {
        grid-template-columns: 1fr;
        height: auto;
    }
    
    .book-left-sidebar,
    .book-right-sidebar {
        display: none;
    }
    
    .book-left-sidebar.show,
    .book-right-sidebar.show {
        display: flex;
        position: fixed;
        top: 0;
        left: 0;
        width: 280px;
        height: 100vh;
        z-index: 1000;
    }
    
    .book-right-sidebar.show {
        left: auto;
        right: 0;
    }
    
    .book-content-body {
        padding: 20px 16px;
    }
}

/* PDF Viewer */
.pdf-viewer {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    background: #f5f2ed;
}

.pdf-toolbar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    padding: 8px 16px;
    background: #faf6ee;
    border-bottom: 1px solid #e5dfd0;
    font-size: 13px;
    color: #666;
}

.pdf-toolbar button {
    padding: 4px 12px;
    background: none;
    border: 1px solid #e5dfd0;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    color: #6b6254;
    transition: all 0.15s;
}

.pdf-toolbar button:hover {
    background: #913500;
    color: #fff;
    border-color: #913500;
}

#pdfPageNum {
    min-width: 48px;
    text-align: center;
}

.pdf-canvas-container {
    flex: 1;
    overflow: auto;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 16px;
}

#pdfCanvas {
    max-width: 100%;
    height: auto;
    box-shadow: 0 2px 12px rgba(0,0,0,0.15);
}

/* ==================== Book（，）==================== */
.related-books-horizontal {
    margin-top: 24px;
    padding: 20px 24px;
    background: #fff;
    border-top: 1px solid #e5dfd0;
}

.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 .more-link {
    font-size: 13px;
    color: #913500;
    text-decoration: none;
}

.related-books-header .more-link:hover {
    text-decoration: underline;
}

.related-books-list {
    display: flex;
    gap: 16px;
    overflow-x: auto;
    padding-bottom: 8px;
    scrollbar-width: thin;
    scrollbar-color: #d4c9b8 transparent;
}

.related-books-list::-webkit-scrollbar {
    height: 6px;
}

.related-books-list::-webkit-scrollbar-track {
    background: transparent;
}

.related-books-list::-webkit-scrollbar-thumb {
    background: #d4c9b8;
    border-radius: 3px;
}

.related-book-card {
    flex: 0 0 140px;
    width: 140px;
    text-decoration: none;
    color: inherit;
    transition: transform 0.2s;
}

.related-book-card:hover {
    transform: translateY(-4px);
}

.related-book-cover {
    width: 140px;
    height: 180px;
    border-radius: 8px;
    overflow: hidden;
    background: #f5f0e6;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.related-book-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.related-book-cover-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 48px;
    font-weight: 700;
    color: #913500;
    background: linear-gradient(135deg, #f5f0e6, #e8dfd0);
}

.related-book-info {
    padding: 0 4px;
}

.related-book-title {
    font-size: 13px;
    font-weight: 600;
    color: #2c2418;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 4px;
}

.related-book-author {
    font-size: 12px;
    color: #a89b87;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ==================== 评论区美化（世典古籍风格）==================== */

/* 评论标题栏：标题 + 点赞/收藏图标 */
.comments-header-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 14px 10px;
    border-bottom: 1px solid #f0ece4;
}

.comments-title-row {
    display: flex;
    align-items: center;
    gap: 6px;
}

.comments-title-row h3 {
    font-size: 15px;
    font-weight: 600;
    color: #2c2418;
    margin: 0;
}

.comment-total-count {
    font-size: 12px;
    color: #913500;
    background: #fef3e8;
    padding: 1px 8px;
    border-radius: 10px;
    min-width: 18px;
    text-align: center;
}

.comments-header-actions {
    display: flex;
    align-items: center;
    gap: 4px;
}

.c-icon-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    background: none;
    border: 1px solid #eee;
    border-radius: 16px;
    cursor: pointer;
    font-size: 12px;
    color: #999;
    transition: all 0.2s;
}

.c-icon-btn:hover {
    color: #e74c3c;
    border-color: rgba(231,76,60,0.25);
    background: rgba(231,76,60,0.04);
}

.c-icon-btn:hover svg {
    stroke: #e74c3c;
}

#headerFavBtn:hover {
    color: #913500;
    border-color: rgba(145,53,0,0.25);
    background: rgba(145,53,0,0.04);
}

#headerFavBtn:hover svg {
    stroke: #913500;
}

.c-icon-btn svg {
    width: 15px;
    height: 15px;
    flex-shrink: 0;
}

.c-icon-btn span {
    font-size: 11px;
    min-width: 12px;
    text-align: center;
}

/* 登录提示（简洁版） */
.comment-login-tip {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 16px 12px;
    font-size: 13px;
    color: #a89b87;
}

.comment-login-tip svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    opacity: 0.6;
}

.comment-login-tip a {
    color: #913500;
    text-decoration: none;
    font-weight: 500;
}

.comment-login-tip a:hover {
    text-decoration: underline;
}

/* 输入区 */
.comment-input-area {
    padding: 12px;
    border-bottom: 1px solid #f0ece4;
}

.comment-input-area textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #e5dfd0;
    border-radius: 8px;
    outline: none;
    font-size: 13px;
    color: #2c2418;
    resize: none;
    background: #fafaf6;
    box-sizing: border-box;
    transition: border-color 0.2s;
    font-family: inherit;
}

.comment-input-area textarea:focus {
    border-color: #913500;
}

.comment-submit-btn {
    width: 100%;
    margin-top: 8px;
    padding: 8px 16px;
    background: linear-gradient(135deg, #913500, #b45a1a);
    color: #fff;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    transition: opacity 0.2s;
}

.comment-submit-btn:hover { opacity: 0.9; }

/* 评论列表 */
.comments-list {
    flex: 1;
    overflow-y: auto;
    padding: 0 10px;
}

/* 单条评论 */
.comments-list .comment-item {
    display: flex;
    gap: 10px;
    padding: 12px 4px;
    border-bottom: 1px solid #f5f2ed;
    transition: background 0.15s;
}

.comments-list .comment-item:hover {
    background: #fafaf6;
}

.comments-list .comment-item:last-child {
    border-bottom: none;
}

/* 头像 */
.comments-list .comment-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid #f0ece4;
    flex-shrink: 0;
}

/* 评论内容区 */
.comments-list .comment-body {
    flex: 1;
    min-width: 0;
}

.comment-meta-row {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 4px;
    flex-wrap: wrap;
}

.comments-list .comment-author {
    font-size: 13px;
    font-weight: 600;
    color: #333;
}

.author-badge {
    background-color: #fef3e8;
    color: #c47a00;
    font-size: 10px;
    padding: 1px 6px;
    border-radius: 3px;
    font-weight: 500;
}

.comments-list .comment-date {
    font-size: 11px;
    color: #bbb;
}

/* 评论文字 */
.comments-list .comment-text {
    font-size: 13px;
    line-height: 1.65;
    color: #444;
    margin: 0 0 6px;
    word-break: break-word;
}

/* 点赞按钮行 */
.comment-actions-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.c-like-btn {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 3px 10px;
    background: none;
    border: 1px solid #eee;
    border-radius: 14px;
    cursor: pointer;
    font-size: 11px;
    color: #999;
    transition: all 0.2s;
}

.c-like-btn:hover {
    color: #e74c3c;
    border-color: rgba(231,76,60,0.25);
    background: rgba(231,76,60,0.04);
}

.c-like-btn svg {
    width: 14px;
    height: 14px;
}

.c-like-btn.liked {
    color: #e74c3c;
    border-color: rgba(231,76,60,0.3);
    background: rgba(231,76,60,0.05);
}

/* 空评论状态 */
.comments-empty-state {
    text-align: center;
    padding: 36px 16px;
    color: #ccc;
}

.comments-empty-state svg {
    width: 36px;
    height: 36px;
    margin-bottom: 8px;
    display: block;
    margin-left: auto;
    margin-right: auto;
    opacity: 0.5;
}

.comments-empty-state p {
    font-size: 13px;
    color: #bbb;
    margin: 0;
}

/* ==================== 工具栏基础样式 ==================== */
/* 使用 flex 布局实现左右分布，关键：不使用 float（float 会导致 inline-flex 失效使按钮竖排） */

.book-content-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 16px;
    background: #fff;
    border-bottom: 1px solid #e5dfd0;
    flex-shrink: 0;
    min-height: 44px;
    gap: 12px;
}

.toolbar-left {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
    min-width: 0;
}

.toolbar-left .toolbar-btn {
    flex-shrink: 0;
}

.toolbar-chapter-title {
    font-size: 14px;
    font-weight: 600;
    color: #2c2418;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.toolbar-right {
    display: flex;
    align-items: center;
    gap: 2px;
    flex-wrap: nowrap;
    flex-shrink: 0;
    min-width: 0;
    overflow-x: auto;
    overflow-y: hidden;
}

.toolbar-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 3px;
    padding: 5px 8px;
    background: none;
    border: 1px solid transparent;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
    color: #6b6254;
    transition: all 0.2s;
    white-space: nowrap;
    flex-shrink: 0;
    min-width: 0;
    line-height: 1;
}

.toolbar-btn:hover {
    background: #faf6ee;
    border-color: #e5dfd0;
    color: #2c2418;
}

.toolbar-btn svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.toolbar-btn .toolbar-label {
    font-size: 12px;
    color: #888;
    white-space: nowrap;
}

/* ==================== 增强工具栏样式 ==================== */

.toolbar-divider {
    width: 1px;
    height: 18px;
    background: #e5dfd0;
    margin: 0 4px;
    flex-shrink: 0;
}

.toolbar-label {
    font-size: 11px;
    margin-left: 2px;
    color: #888;
    white-space: nowrap;
}

/* 工具栏按钮激活态 */
.book-content-toolbar .toolbar-btn.active {
    background: rgba(145,53,0,0.08);
    border-color: rgba(145,53,0,0.3);
    color: #913500;
}

.book-content-toolbar .toolbar-btn.active svg {
    stroke: #913500;
}

/* 标点隐藏模式 */
.no-punct-mode .chapter-body .word-char {
    /* 隐藏标点字符（通过JS处理） */
}

.no-punct-mode .chapter-body p::after,
.no-punct-mode .chapter-body p::before {
    content: '';
}

/* 注梳高亮 */
.annotatable-highlight {
    cursor: pointer !important;
    border-bottom: 1px dashed transparent;
    transition: border-color 0.15s, background 0.15s, border-radius 0.15s;
    padding: 0 1px;
    border-radius: 2px;
}

.annotatable-highlight:hover {
    background: rgba(145,53,0,0.08);
    border-bottom-color: #913500;
}

.notes-overlay-mode .annotatable-highlight:hover {
    background: #fef3e8;
    border-bottom-color: #c47a00;
}

/* 注梳面板 */
.right-notes-section {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border-bottom: 1px solid #e5dfd0;
}

/* 翻译对照层 */
.chapter-translation {
    font-size: 17px !important;
    line-height: 2.4 !important;
    color: #2c2418;
}

.translation-line {
    display: flex;
    gap: 20px;
    align-items: flex-start;
    margin-bottom: 0.5em;
    text-indent: 0 !important;
    padding: 6px 12px;
    border-radius: 4px;
    transition: background 0.15s;
}

.translation-line:hover {
    background: rgba(145,53,0,0.03);
}

.translation-line .orig-text {
    flex: 0 0 50%;
    font-weight: 600;
    color: #2c2418;
}

.translation-line .trans-text {
    flex: 1;
    color: #888;
    font-size: 0.92em;
    font-weight: 400;
}

/* ==================== 分栏对照模式（文本左 + 影印右）==================== */
.split-compare-view {
    display: flex;
    height: 100%;
    overflow: hidden;
    position: relative;
}

.split-left-panel,
.split-right-panel {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-width: 0;
}

.split-left-panel {
    flex: 1;
    border-right: 1px solid #e5dfd0;
}

.split-right-panel {
    width: 50%;
    max-width: 600px;
    background: #f5f2ed;
}

.split-panel-label {
    padding: 6px 14px;
    font-size: 12px;
    font-weight: 600;
    color: #913500;
    background: #faf6ee;
    border-bottom: 1px solid #e5dfd0;
    text-align: center;
    letter-spacing: 2px;
}

.split-text-content,
.split-image-content {
    flex: 1;
    overflow-y: auto;
    padding: 20px 28px;
}

.split-text-content {
    font-size: 15px;
    line-height: 2;
    color: #2c2418;
}

.split-text-content p {
    text-indent: 2em;
    margin-bottom: 0.4em;
}

/* 分栏拖拽分隔条 */
.split-divider {
    width: 4px;
    cursor: col-resize;
    background: #e5dfd0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
    flex-shrink: 0;
    z-index: 10;
}

.split-divider:hover {
    background: #913500;
}

.split-divider-bar {
    width: 2px;
    height: 40px;
    background: #bbb;
    border-radius: 1px;
}

.split-divider:hover .split-divider-bar {
    background: #fff;
}

/* 分栏右侧图片 */
.split-image-content {
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.split-image-content img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    transition: transform 0.15s;
}

.no-scan-hint {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    color: #bbb;
}

.no-scan-hint svg {
    width: 48px;
    height: 48px;
    opacity: 0.3;
}

.no-scan-hint p {
    font-size: 13px;
    margin: 0;
}

/* 分栏缩放控制 */
.split-zoom-controls {
    position: absolute;
    bottom: 16px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: rgba(255,255,255,0.9);
    border-radius: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    font-size: 12px;
}

.split-zoom-controls button {
    width: 26px;
    height: 26px;
    border: none;
    background: none;
    cursor: pointer;
    font-size: 14px;
    color: #666;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
}

.split-zoom-controls button:hover {
    background: #eee;
    color: #333;
}

#splitZoomLevel {
    min-width: 36px;
    text-align: center;
    font-size: 11px;
    color: #888;
}

/* 百科搜索浮层 */
.encyclopedia-search-panel {
    background: #fff;
    border-bottom: 1px solid #e5dfd0;
    flex-shrink: 0;
}

/* 字典面板增强 */
.dict-panel {
    bottom: auto;
    top: 48px;
    right: 340px;
    left: auto;
    width: 280px;
    max-height: 400px;
}

@media (max-width: 1200px) {
    .dict-panel {
        right: 10px;
        width: 260px;
    }
}

/* 工具栏按钮SVG统一大小 */
.book-content-toolbar .toolbar-btn svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

/* 字体大小指示器 */
#fontSizeIndicator {
    font-size: 11px;
    color: #913500;
    min-width: 36px;
    text-align: center;
    display: inline-block;
}

/* 设置下拉菜单增强（保留在右侧） */
.settings-dropdown {
    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);
    min-width: 180px;
    z-index: 1000;
    display: none;
    padding: 6px 0;
}

.settings-dropdown.show {
    display: block;
}

.settings-item {
    display: flex;
    align-items: center;
    padding: 8px 14px;
    font-size: 13px;
    color: #444;
    cursor: default;
    transition: background 0.15s;
    gap: 8px;
}

.settings-item:hover {
    background: #faf6ee;
}

.settings-item input[type="checkbox"] {
    accent-color: #913500;
}

.check-icon {
    display: inline-block;
    width: 16px;
    text-align: center;
    color: #913500;
    font-size: 12px;
    visibility: hidden;
}

.settings-item input[type="checkbox"]:checked ~ .check-icon {
    visibility: visible;
}
