/* Filter */
.filter-section {
    padding: var(--spacing-md) 0;
    background-color: var(--color-bg);
    border-bottom: 1px solid var(--color-border);
    margin-bottom: var(--spacing-xl);
}

.filter-form {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    flex-wrap: wrap;
}

.filter-item {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
}

.filter-search {
    flex: 1;
    min-width: 200px;
    position: relative;
}

.filter-input {
    width: 100%;
    padding: 8px 12px;
    padding-right: 40px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    background-color: var(--color-bg);
    color: var(--color-text);
    font-size: var(--font-size-md);
}

.filter-input:focus {
    outline: none;
    border-color: var(--color-primary);
}

.filter-btn {
    position: absolute;
    right: 0;
    top: 0;
    width: 40px;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--color-primary);
    color: #ffffff;
    border: none;
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
    cursor: pointer;
    transition: background-color var(--transition-fast);
}

.filter-btn:hover {
    background-color: var(--color-primary-light);
}

.filter-select {
    padding: 8px 12px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    background-color: var(--color-bg);
    color: var(--color-text);
    font-size: var(--font-size-md);
    cursor: pointer;
}

.filter-select:focus {
    outline: none;
    border-color: var(--color-primary);
}

/* ======================================== - Page - ======================================== */
.library-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--spacing-md);
}

/* Card */
.library-card {
    position: relative;
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

.library-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.library-link {
    display: block;
    text-decoration: none;
    color: var(--color-text);
}

.library-cover {
    width: 100%;
    aspect-ratio: 3 / 4;
    overflow: hidden;
    background-color: var(--color-bg-secondary);
}

.library-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--transition-normal);
}

.library-card:hover .library-cover img {
    transform: scale(1.05);
}

.library-cover-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--color-bg-secondary);
    color: var(--color-text-muted);
}

.library-info {
    padding: var(--spacing-md);
}

.library-title {
    font-size: var(--font-size-md);
    font-weight: 600;
    margin-bottom: var(--spacing-xs);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.library-author {
    font-size: var(--font-size-sm);
    color: var(--color-text-secondary);
    margin-bottom: var(--spacing-xs);
}

.library-meta {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    font-size: var(--font-size-xs);
    color: var(--color-text-muted);
}

/* ======================================== - Page - ======================================== */
.library-detail-page {
    
}

/* Book */
.library-info-section {
    padding: var(--spacing-xl) 0;
}

.library-info-container {
    display: flex;
    gap: var(--spacing-xl);
    max-width: 1200px;
    margin: 0 auto;
}

.library-info-cover {
    width: 300px;
    flex-shrink: 0;
}

.library-info-cover img {
    width: 100%;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
}

.library-info-content {
    flex: 1;
}

.library-info-title {
    font-size: var(--font-size-xxl);
    font-weight: 700;
    color: var(--color-text);
    margin-bottom: var(--spacing-md);
    line-height: 1.4;
}

.library-info-meta {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-lg);
    font-size: var(--font-size-sm);
    color: var(--color-text-secondary);
}

.library-info-description {
    font-size: var(--font-size-md);
    color: var(--color-text);
    line-height: 1.8;
    margin-bottom: var(--spacing-lg);
}

.library-info-actions {
    display: flex;
    gap: var(--spacing-md);
}

/* Literature */
.library-content-section {
    padding: var(--spacing-xl) 0;
}

.library-content {
    max-width: 800px;
    margin: 0 auto;
    line-height: 1.8;
    font-size: var(--font-size-md);
}

.library-content h2 {
    font-size: var(--font-size-xl);
    font-weight: 600;
    margin: var(--spacing-xl) 0 var(--spacing-md);
    padding-bottom: var(--spacing-sm);
    border-bottom: 2px solid var(--color-primary);
}

.library-content h3 {
    font-size: var(--font-size-lg);
    font-weight: 600;
    margin: var(--spacing-lg) 0 var(--spacing-md);
}

.library-content p {
    margin-bottom: var(--spacing-md);
}

.library-content img {
    max-width: 100%;
    height: auto;
    border-radius: var(--radius-md);
    margin: var(--spacing-md) 0;
}

/* Literature */
.references-section {
    padding: var(--spacing-xl) 0;
    max-width: 800px;
    margin: 0 auto;
}

.references-title {
    font-size: var(--font-size-xl);
    font-weight: 600;
    color: var(--color-text);
    margin-bottom: var(--spacing-lg);
}

.reference-list {
    list-style: none;
}

.reference-item {
    display: flex;
    gap: var(--spacing-md);
    padding: var(--spacing-md) 0;
    border-bottom: 1px solid var(--color-border);
}

.reference-index {
    font-weight: 600;
    color: var(--color-primary);
}

.reference-content {
    flex: 1;
}

.reference-title {
    font-weight: 500;
    margin-bottom: var(--spacing-xs);
}

.reference-meta {
    font-size: var(--font-size-sm);
    color: var(--color-text-secondary);
}

/* Citation */
.citation-formats {
    margin-top: var(--spacing-lg);
}

.citation-tabs {
    display: flex;
    gap: var(--spacing-sm);
    margin-bottom: var(--spacing-md);
}

.citation-tab {
    padding: 8px 16px;
    border-radius: var(--radius-md);
    background-color: var(--color-bg-secondary);
    color: var(--color-text);
    border: none;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.citation-tab.active {
    background-color: var(--color-primary);
    color: #ffffff;
}

.citation-content {
    padding: var(--spacing-md);
    background-color: var(--color-bg-secondary);
    border-radius: var(--radius-md);
    font-size: var(--font-size-sm);
    line-height: 1.6;
    white-space: pre-wrap;
}

/* /Nav */
.library-nav-section {
    padding: var(--spacing-xl) 0;
    border-top: 1px solid var(--color-border);
}

.library-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--spacing-md);
}

.library-nav-prev,
.library-nav-next {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-md);
    border-radius: var(--radius-md);
    background-color: var(--color-bg-secondary);
    color: var(--color-text);
    text-decoration: none;
    font-size: var(--font-size-sm);
    transition: all var(--transition-fast);
    max-width: 45%;
}

.library-nav-prev:hover,
.library-nav-next:hover {
    background-color: var(--color-primary);
    color: #ffffff;
}

.library-nav-back {
    padding: var(--spacing-sm) 16px;
    border-radius: var(--radius-md);
    background-color: var(--color-bg-secondary);
    color: var(--color-text);
    text-decoration: none;
    font-size: var(--font-size-sm);
    transition: all var(--transition-fast);
}

.library-nav-back:hover {
    background-color: var(--color-primary);
    color: #ffffff;
}

/* ======================================== - Page（） - ======================================== */
.library-detail-section {
    padding: var(--spacing-xl) 0;
}

.library-detail-layout {
    display: flex;
    gap: var(--spacing-xl);
    max-width: 1200px;
    margin: 0 auto;
}

.library-main {
    flex: 1;
    min-width: 0;
}

.library-detail {
    background-color: var(--color-bg);
    border-radius: var(--radius-lg);
    padding: var(--spacing-xl);
}

.library-header {
    margin-bottom: var(--spacing-lg);
    padding-bottom: var(--spacing-lg);
    border-bottom: 1px solid var(--color-border);
}

.library-header .library-title {
    font-size: var(--font-size-xxl);
    font-weight: 700;
    color: var(--color-text);
    margin-bottom: var(--spacing-md);
    line-height: 1.4;
}

.library-meta {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-md);
    font-size: var(--font-size-sm);
    color: var(--color-text-secondary);
}

.library-info-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-lg);
    padding: var(--spacing-md);
    background-color: var(--color-bg-secondary);
    border-radius: var(--radius-md);
}

.library-info-item {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    font-size: var(--font-size-sm);
}

.library-info-item .info-label {
    color: var(--color-text-secondary);
    font-weight: 500;
}

.library-info-item .info-value {
    color: var(--color-text);
}

.library-stats {
    display: flex;
    align-items: center;
    gap: var(--spacing-lg);
    padding: var(--spacing-md) 0;
    color: var(--color-text-muted);
    font-size: var(--font-size-sm);
    border-top: 1px solid var(--color-border);
    margin-top: var(--spacing-md);
}

.library-stats .stat-item {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.library-summary {
    margin: var(--spacing-lg) 0;
    padding: var(--spacing-md);
    background-color: var(--color-bg-secondary);
    border-radius: var(--radius-md);
    line-height: 1.8;
}

.library-summary .summary-title {
    font-size: var(--font-size-lg);
    font-weight: 600;
    color: var(--color-text);
    margin-bottom: var(--spacing-sm);
}

/* Button */
.library-actions {
    display: flex;
    gap: var(--spacing-md);
    margin-top: var(--spacing-lg);
    padding-top: var(--spacing-lg);
    border-top: 1px solid var(--color-border);
}


/* Sidebar */
.library-sidebar {
    width: 280px;
    flex-shrink: 0;
}

/* widget-title / sidebar-widget / widget-list 已统一到 page_layout.css，此处不再重复定义 */

/* Library-specific: tabs */
    padding: var(--spacing-md);
}

.widget-list li {
    margin-bottom: var(--spacing-sm);
}

.widget-list a {
    display: block;
    padding: 8px 12px;
    border-radius: var(--radius-md);
    color: var(--color-text);
    text-decoration: none;
    font-size: var(--font-size-sm);
    transition: all var(--transition-fast);
}

.widget-list a:hover {
    background-color: var(--color-bg-secondary);
    color: var(--color-primary);
}

.widget-toc {
    padding: var(--spacing-md);
    font-size: var(--font-size-sm);
}

/* Tags */
.library-keywords,
.keyword-links {
    margin-top: var(--spacing-lg);
    padding-top: var(--spacing-lg);
    border-top: 1px solid var(--color-border);
}

.keywords-title,
.keyword-links-title {
    font-size: var(--font-size-md);
    font-weight: 600;
    color: var(--color-text);
    margin-bottom: var(--spacing-md);
}

.keywords-list,
.keyword-links-list {
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-sm);
}

.keyword-tag,
.keyword-link {
    display: inline-block;
    padding: 4px 12px;
    background-color: var(--color-bg-secondary);
    color: var(--color-primary);
    border-radius: var(--radius-xl);
    font-size: var(--font-size-sm);
    text-decoration: none;
    transition: all var(--transition-fast);
    border: 1px solid var(--color-border);
}

.keyword-tag:hover,
.keyword-link:hover {
    background-color: var(--color-primary);
    color: #ffffff;
    border-color: var(--color-primary);
}

/* Literature */
.library-related {
    margin-top: var(--spacing-lg);
    padding-top: var(--spacing-lg);
    border-top: 1px solid var(--color-border);
}

.related-title {
    font-size: var(--font-size-md);
    font-weight: 600;
    color: var(--color-text);
    margin-bottom: var(--spacing-md);
}

.related-list {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
}

.related-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--spacing-md);
    background-color: var(--color-bg-secondary);
    border-radius: var(--radius-md);
    border: 1px solid var(--color-border);
    transition: all var(--transition-fast);
}

.related-item:hover {
    border-color: var(--color-primary);
    box-shadow: var(--shadow-sm);
}

.related-info {
    flex: 1;
}

.related-info a {
    font-weight: 600;
    color: var(--color-primary);
    text-decoration: none;
    display: block;
    margin-bottom: 4px;
}

.related-info a:hover {
    text-decoration: underline;
}

.related-info span {
    font-size: var(--font-size-sm);
    color: var(--color-text-secondary);
}

.related-actions {
    display: flex;
    gap: var(--spacing-sm);
}

/* Image */
.library-images {
    margin-top: var(--spacing-lg);
}

.images-title {
    font-size: var(--font-size-md);
    font-weight: 600;
    color: var(--color-text);
    margin-bottom: var(--spacing-md);
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.image-standards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: var(--spacing-md);
}

.image-standard-item {
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    background-color: var(--color-bg);
    transition: all var(--transition-fast);
}

.image-standard-item:hover {
    box-shadow: var(--shadow-md);
}

.image-standard-preview {
    width: 100%;
    height: 200px;
    overflow: hidden;
    cursor: pointer;
}

.image-standard-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--transition-normal);
}

.image-standard-preview img:hover {
    transform: scale(1.05);
}

.image-standard-info {
    padding: var(--spacing-md);
}

.image-standard-caption {
    font-weight: 600;
    margin-bottom: var(--spacing-sm);
    color: var(--color-text);
}

.image-standard-source,
.image-standard-author,
.image-standard-license,
.image-standard-resolution,
.image-standard-format {
    font-size: var(--font-size-sm);
    color: var(--color-text-secondary);
    margin: 4px 0;
}

/* Literature */
.library-citations {
    margin-top: var(--spacing-lg);
}

.citations-title {
    font-size: var(--font-size-md);
    font-weight: 600;
    color: var(--color-text);
    margin-bottom: var(--spacing-md);
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.citation-list {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
}

.citation-item {
    display: flex;
    align-items: flex-start;
    gap: var(--spacing-md);
    padding: var(--spacing-md);
    background-color: var(--color-bg-secondary);
    border-radius: var(--radius-md);
    border-left: 3px solid var(--color-primary);
}

.citation-label {
    min-width: 80px;
    font-weight: 600;
    color: var(--color-primary);
    font-size: var(--font-size-sm);
}

.citation-content {
    flex: 1;
    font-size: var(--font-size-sm);
    line-height: 1.6;
    color: var(--color-text);
}

/* Search */
.library-auto-search {
    margin-top: var(--spacing-lg);
}

.auto-search-title {
    font-size: var(--font-size-md);
    font-weight: 600;
    color: var(--color-text);
    margin-bottom: var(--spacing-md);
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.auto-search-box {
    display: flex;
    gap: var(--spacing-sm);
    margin-bottom: var(--spacing-md);
}

.auto-search-box input {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    font-size: var(--font-size-md);
    background-color: var(--color-bg);
    color: var(--color-text);
}

.auto-search-box input:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(145, 53, 0, 0.1);
}

.search-results-list {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
}

.search-result-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--spacing-md);
    background-color: var(--color-bg-secondary);
    border-radius: var(--radius-md);
    border: 1px solid var(--color-border);
    transition: all var(--transition-fast);
}

.search-result-item:hover {
    border-color: var(--color-primary);
    box-shadow: var(--shadow-sm);
}

.result-info {
    flex: 1;
}

.result-info a {
    font-weight: 600;
    color: var(--color-primary);
    text-decoration: none;
    display: block;
    margin-bottom: 4px;
}

.result-info a:hover {
    text-decoration: underline;
}

.result-info span {
    font-size: var(--font-size-sm);
    color: var(--color-text-secondary);
}

.result-actions {
    display: flex;
    gap: var(--spacing-sm);
}


@media (max-width: 992px) {
    .library-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .library-info-container {
        flex-direction: column;
    }

    .library-info-cover {
        width: 100%;
        max-width: 300px;
        margin: 0 auto;
    }
}

@media (max-width: 768px) {
    .library-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .library-info-title {
        font-size: var(--font-size-xl);
    }

    .library-nav {
        flex-direction: column;
    }

    .library-nav-prev,
    .library-nav-next {
        max-width: 100%;
    }
}

@media (max-width: 480px) {
    .library-grid {
        grid-template-columns: 1fr;
    }

    .library-info-title {
        font-size: var(--font-size-lg);
    }
}
/* CardStats */
.library-stats {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    padding: var(--spacing-sm) 0;
    color: var(--color-text-muted);
    font-size: var(--font-size-xs);
    border-top: 1px solid var(--color-border);
    margin-top: var(--spacing-sm);
}

.library-stats .stat-item {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.library-stats .icon {
    opacity: 0.6;
}

/* CardTags */
.library-category {
    display: inline-block;
    padding: 2px 8px;
    background-color: var(--color-bg-secondary);
    color: var(--color-text-secondary);
    border-radius: var(--radius-sm);
    font-size: var(--font-size-xs);
}

.library-dynasty {
    display: inline-block;
    padding: 2px 8px;
    background-color: rgba(145, 53, 0, 0.08);
    color: var(--color-primary);
    border-radius: var(--radius-sm);
    font-size: var(--font-size-xs);
}

.library-type {
    display: inline-block;
    padding: 2px 8px;
    background-color: rgba(24, 144, 255, 0.1);
    color: var(--color-secondary);
    border-radius: var(--radius-sm);
    font-size: var(--font-size-xs);
}

/* Card */
.library-summary {
    font-size: var(--font-size-sm);
    color: var(--color-text-secondary);
    line-height: 1.5;
    margin-top: var(--spacing-sm);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* CardButton */
.library-card .library-actions {
    position: absolute;
    top: var(--spacing-md);
    right: var(--spacing-md);
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xs);
    opacity: 0;
    transform: translateX(8px);
    transition: all var(--transition-fast);
    pointer-events: none;
}

.library-card:hover .library-actions {
    opacity: 1;
    transform: translateX(0);
    pointer-events: auto;
}


/* AutoSearch */
#autoSearchResults {
    margin-top: var(--spacing-md);
}


/* ======================================== - Animation - ======================================== */
@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ======================================== 图书馆列表页（library.php） ======================================== */

/* 页面主体包裹 */
.library-list-page {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 60px;
}

/* 筛选栏卡片 */
.library-filter-card {
    background: #fff;
    border-radius: 12px;
    padding: 16px 20px;
    margin-bottom: 24px;
    border: 1px solid #eee;
}

/* 筛选表单 */
.library-filter-form {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

/* 筛选分组 */
.library-filter-group {
    display: flex;
    align-items: center;
    gap: 6px;
}

/* 筛选标签文字 */
.library-filter-label {
    font-size: 13px;
    color: #888;
    white-space: nowrap;
}

/* 筛选下拉框（修复 outline 拼写） */
.library-filter-select {
    padding: 8px 12px;
    border: 1.5px solid #e0d8cc;
    border-radius: 8px;
    font-size: 14px;
    background: #fafaf6;
    color: #555;
    outline: none;
}

/* 筛选输入框（修复 outline 拼写） */
.library-filter-input {
    padding: 8px 12px;
    border: 1.5px solid #e0d8cc;
    border-radius: 8px;
    font-size: 14px;
    background: #fafaf6;
    color: #555;
    outline: none;
    min-width: 180px;
}

/* 筛选搜索按钮 */
.library-filter-submit {
    padding: 8px 20px;
    background: linear-gradient(135deg, #913500, #b45a1a);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    cursor: pointer;
}

/* 筛选清除链接 */
.library-filter-clear {
    color: #999;
    font-size: 13px;
    text-decoration: none;
}

/* 结果计数文字 */
.library-count-text {
    font-size: 13px;
    color: #999;
    margin: 0 0 16px;
}
.library-count-text strong {
    color: #913500;
}

/* 书籍网格 */
.book-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 20px;
}

/* 书籍卡片链接 */
.book-card-link {
    display: block;
    text-decoration: none;
    color: inherit;
}

/* 书籍卡片 */
.book-card {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid #eee;
    transition: all 0.25s;
}
.book-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.1);
}

/* 书籍封面容器 */
.book-cover-wrapper {
    width: 100%;
    height: 220px;
    overflow: hidden;
}

/* 书籍封面图片 */
.book-cover-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* 默认封面（无封面时）：古籍善本样式 */
.book-default-cover {
    width: 100%;
    /* 4:3 比例，由父容器 aspect-ratio 控制高度 */
    aspect-ratio: 4/3;
    position: relative;
    background: #c8b99a;
    /* 宣纸质感渐变 */
    background-image:
        radial-gradient(ellipse at 30% 20%, rgba(255,248,235,0.5) 0%, transparent 60%),
        radial-gradient(ellipse at 70% 80%, rgba(180,160,130,0.3) 0%, transparent 60%),
        linear-gradient(135deg, #c8b99a 0%, #b8a88a 100%);
    overflow: hidden;
}

/* 内边框（印章/古籍线装风格） */
.book-default-cover-border {
    position: absolute;
    top: 10%;
    left: 6%;
    right: 6%;
    bottom: 10%;
    border: 1.5px solid rgba(80,60,40,0.45);
    pointer-events: none;
}

/* 内边框四角装饰（线装书特征） */
.book-default-cover-border::before,
.book-default-cover-border::after {
    content: '';
    position: absolute;
    width: 18px;
    height: 18px;
    border-color: rgba(80,60,40,0.55);
    border-style: solid;
}
.book-default-cover-border::before {
    top: -2px; left: -2px;
    border-width: 2px 0 0 2px;
}
.book-default-cover-border::after {
    bottom: -2px; right: -2px;
    border-width: 0 2px 2px 0;
}

/* 右上角竖排书名 */
.book-default-cover-title {
    position: absolute;
    top: 14%;
    right: 12%;
    writing-mode: vertical-rl;
    text-orientation: upright;
    font-size: clamp(13px, 1.8vw, 18px);
    font-weight: 700;
    color: #3d2e1e;
    letter-spacing: 6px;
    line-height: 1.7;
    text-shadow: 0 1px 2px rgba(255,248,230,0.6);
    max-height: 72%;
    overflow: hidden;
}

/* 左下角小印（装饰性方块，模拟古籍藏书印） */
.book-default-cover-seal {
    position: absolute;
    bottom: 14%;
    left: 10%;
    width: 28px;
    height: 28px;
    border: 1.5px solid rgba(145,53,0,0.35);
    border-radius: 3px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 9px;
    color: rgba(145,53,0,0.5);
    font-weight: 700;
    transform: rotate(-3deg);
}

/* 书籍信息区 */
.book-info {
    padding: 12px 14px 14px;
}

/* 书籍标题 */
.book-title {
    font-size: 14px;
    font-weight: 700;
    color: #222;
    line-height: 1.4;
    margin-bottom: 4px;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

/* 书籍作者 */
.book-author {
    font-size: 12px;
    color: #aaa;
}

/* 书籍统计元信息 */
.book-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    font-size: 11px;
    color: #aaa;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid #f5f0eb;
}

/* 统计项（浏览/喜欢/收藏/评论） */
.book-meta-item {
    display: inline-flex;
    align-items: center;
    gap: 3px;
}

/* 分页容器 */
.library-pagination {
    display: flex;
    align-items: center;
    gap: 6px;
    justify-content: center;
    margin-top: 32px;
}

/* 分页链接 */
.library-pagination-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 12px;
    border-radius: 8px;
    font-size: 14px;
    text-decoration: none;
    background: #fff;
    color: #555;
    border: 1px solid #eee;
}
.library-pagination-link:hover {
    background: #f5f5f5;
}

/* 分页当前页 */
.library-pagination-current {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 12px;
    border-radius: 8px;
    font-size: 14px;
    background: #913500;
    color: #fff;
    font-weight: 600;
}

/* 空状态 */
.library-empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #ccc;
}
.library-empty-state p {
    font-size: 16px;
    color: #999;
}









/* Album list page styles - Waterfall layout (7 columns) */

/* ===== 瀑布流布局由 list.css 统一控制（body.page-album-list .items-grid） ===== */
/* 本文件只负责相册卡片样式和兼容性 */

/* 相册卡片在瀑布流中的微调 */
body.page-album-list .grid-card {
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid #e8e0d8;
    transition: transform 0.25s, box-shadow 0.25s;
}
body.page-album-list .grid-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 16px rgba(0,0,0,0.1);
}
body.page-album-list .grid-card .gc-cover img {
    width: 100%;
    height: auto;
    display: block;
    transition: transform 0.3s;
}
body.page-album-list .grid-card:hover .gc-cover img {
    transform: scale(1.03);
}

/* 原有 .waterfall 类保留兼容（如有直接调用） */
.waterfall {
    max-width: 100%;
    margin: 0 auto;
    padding: 0 60px;
    columns: 7;
    column-gap: 20px;
}

@media (max-width: 1600px) { .waterfall { columns: 6; } }
@media (max-width: 1400px) { .waterfall { columns: 5; } }
@media (max-width: 1100px) { .waterfall { columns: 4; } }
@media (max-width: 900px)  { .waterfall { columns: 3; } }
@media (max-width: 600px)  { .waterfall { columns: 2; } }
@media (max-width: 400px)  { .waterfall { columns: 1; } }

/* Album card（老站模板兼容） */
.album-card {
    break-inside: avoid;
    margin-bottom: 20px;
    border-radius: 8px;
    overflow: hidden;
    background: #fff;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: transform 0.3s, box-shadow 0.3s;
    cursor: pointer;
}
.album-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.15);
}
.album-cover {
    position: relative;
    width: 100%;
    overflow: hidden;
}
.album-cover img {
    width: 100%;
    display: block;
    transition: transform 0.3s;
}
.album-card:hover .album-cover img {
    transform: scale(1.05);
}
.album-image-count {
    position: absolute;
    bottom: 10px;
    right: 10px;
    background: rgba(0,0,0,0.7);
    color: #fff;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    display: flex;
    align-items: center;
    gap: 4px;
}
.album-info {
    padding: 15px;
}
.album-title {
    font-size: 16px;
    font-weight: 600;
    color: #333;
    margin-bottom: 8px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.album-meta {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
    font-size: 13px;
    color: #999;
}
.album-stats {
    display: flex;
    gap: 15px;
    font-size: 13px;
    color: #999;
}
.stat-item {
    display: flex;
    align-items: center;
    gap: 4px;
}

/* Loading state */
.loading {
    text-align: center;
    padding: 30px;
    color: #999;
    font-size: 14px;
}
.loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid #ddd;
    border-top-color: #1565c0;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-right: 8px;
    vertical-align: middle;
}
@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Empty state */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #999;
}
.empty-state svg {
    width: 80px;
    height: 80px;
    margin-bottom: 20px;
    opacity: 0.5;
}








/* 图书馆详情页样式 - 三栏布局 + 工具栏 + 内容区 + 评论区 */

/* 全宽模式：覆盖骨架层 padding */
.full-width-content {
    padding: 0 !important;
    margin: 0 !important;
    max-width: none !important;
    width: 100% !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 {
    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-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;
    }
}