/* 书籍式布局样式 */

/* 整体布局 */
.book-layout {
    display: flex;
    min-height: 100vh;
    max-width: 1360px;
    margin: 0 auto;
    background: #fff;
    /* 去除阴影效果 */
    box-shadow: none;
}

/* 左侧导航 */
.book-sidebar {
    width: 280px;
    background: #f8f9fa;
    border-right: 1px solid #e9ecef;
    padding: 30px 20px;
    position: fixed;
    left: 0;
    top: 0;
    height: 100vh;
    overflow-y: auto;
    z-index: 100;
}

.book-title {
    font-size: 32px;
    font-weight: bold;
    color: #2c3e50;
    margin-bottom: 20px;
    line-height: 1.3;
    text-align: center;
}

.book-divider {
    border: none;
    height: 2px;
    background: #3498db;
    margin: 20px 0;
}

.book-toc {
    font-size: 14px;
}

.chapter {
    margin-bottom: 25px;
}

.chapter-title {
    font-size: 16px;
    font-weight: bold;
    color: #34495e;
    margin-bottom: 10px;
    padding-bottom: 5px;
    border-bottom: 1px solid #bdc3c7;
}

.chapter-sections {
    list-style: none;
    padding: 0;
    margin: 0;
}

.section {
    margin: 8px 0;
}

.section a {
    display: block;
    padding: 8px 12px;
    color: #7f8c8d;
    text-decoration: none;
    border-radius: 4px;
    transition: all 0.3s ease;
    border-left: 3px solid transparent;
}

.section a:hover {
    background: #ecf0f1;
    color: #2c3e50;
    border-left-color: #3498db;
}

.section.current a {
    background: #3498db;
    color: white;
    border-left-color: #2980b9;
}

/* 中间内容区 */
.book-content {
    flex: 1;
    margin-left: 280px;
    margin-right: 280px;
    padding: 40px 50px;
    max-width: 800px;
}

.book-card {
    background: white;
    border-radius: 10px;
    /* 去除书籍卡片阴影 */
    box-shadow: none;
    padding: 30px;
    transition: transform 0.3s ease;
}

.book-article {
    background: white;
    border-radius: 8px;
    /* 去除文章卡片阴影 */
    box-shadow: none;
}

.book-article-header {
    padding: 40px 0 30px;
    border-bottom: 1px solid #eee;
    margin-bottom: 30px;
}

.book-article-title {
    font-size: 32px;
    font-weight: bold;
    color: #2c3e50;
    margin-bottom: 10px;
    line-height: 1.4;
}

.book-article-subtitle {
    font-size: 18px;
    color: #7f8c8d;
    font-style: italic;
    margin-bottom: 20px;
}

.book-article-meta {
    display: flex;
    gap: 20px;
    font-size: 14px;
    color: #95a5a6;
}

.book-chapter, .book-section {
    padding: 4px 8px;
    background: #f8f9fa;
    border-radius: 12px;
}

.book-article-body {
    line-height: 1.8;
    font-size: 16px;
    color: #2c3e50;
}

.book-article-body h1,
.book-article-body h2,
.book-article-body h3,
.book-article-body h4 {
    color: #2c3e50;
    margin: 30px 0 15px;
}

.book-article-body p {
    margin-bottom: 15px;
}

.book-article-body code {
    background: #f8f9fa;
    padding: 2px 6px;
    border-radius: 3px;
    font-family: 'Consolas', 'Monaco', monospace;
}

.book-article-body pre {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 5px;
    overflow-x: auto;
    border-left: 4px solid #3498db;
}

/* 图片显示优化 */
.book-article-body img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 20px auto;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

/* 确保图片在小屏幕上也能正常显示 */
@media (max-width: 768px) {
    .book-article-body img {
        max-width: 100%;
        margin: 15px 0;
    }
}

/* 右侧目录 */
.book-right-toc {
    width: 280px;
    background: #f8f9fa;
    border-left: 1px solid #e9ecef;
    padding: 30px 20px;
    position: fixed;
    right: 0;
    top: 0;
    height: 100vh;
    overflow-y: auto;
    z-index: 100;
}

.article-toc {
    position: sticky;
    top: 30px;
}

.book-right-toc h4 {
    font-size: 16px;
    font-weight: bold;
    color: #2c3e50;
    margin-bottom: 20px;
    text-align: center;
}

.article-toc {
    font-size: 14px;
}

.article-toc ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.article-toc a {
    display: block;
    padding: 8px 12px;
    color: #7f8c8d;
    text-decoration: none;
    border-radius: 4px;
    transition: all 0.3s ease;
    border-left: 3px solid transparent;
    font-size: 13px;
    line-height: 1.4;
}

.article-toc a:hover {
    background: #ecf0f1;
    color: #2c3e50;
    border-left-color: #3498db;
}

.article-toc a.active {
    background: #3498db;
    color: white;
    border-left-color: #2980b9;
}

/* 响应式设计 */
@media (max-width: 1200px) {
    .book-sidebar {
        width: 250px;
    }
    
    .book-content {
        margin-left: 250px;
        margin-right: 220px;
    }
    
    .book-right-toc {
        width: 220px;
    }
}

@media (max-width: 992px) {
    .book-sidebar {
        width: 220px;
    }
    
    .book-content {
        margin-left: 220px;
        margin-right: 0;
    }
    
    .book-right-toc {
        display: none;
    }
}

@media (max-width: 768px) {
    .book-layout {
        flex-direction: column;
    }
    
    .book-sidebar {
        position: relative;
        width: 100%;
        height: auto;
        order: 2;
    }
    
    .book-content {
        margin-left: 0;
        margin-right: 0;
        padding: 20px;
        order: 1;
    }
    
    .book-right-toc {
        display: none;
    }
}

/* 去除背景图 */
.book-layout {
    background: white !important;
    background-image: none !important;
}

.book-content {
    background: white !important;
    background-image: none !important;
}

body {
    background: white !important;
    background-image: none !important;
}