* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: "Microsoft YaHei", sans-serif;
    height: 100vh;
    display: flex;
    flex-direction: column;
    background-color: #f5f5f5;
}

.header {
    background-color: #2c3e50;
    color: white;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

.header h1 {
    font-size: 20px;
}

.book-selector {
    display: flex;
    gap: 10px;
}

.book-btn {
    padding: 5px 15px;
    border: none;
    border-radius: 4px;
    background-color: #34495e;
    color: white;
    cursor: pointer;
    font-size: 14px;
}

.book-btn.active {
    background-color: #1abc9c;
}

.container {
    display: flex;
    flex: 1;
    overflow: hidden;
}

.sidebar {
    width: 250px;
    background-color: white;
    border-right: 1px solid #ddd;
    overflow-y: auto;
    padding: 15px;
}

.content {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background-color: white;
}

.chapter {
    margin-bottom: 15px;
}

.chapter-title {
    font-weight: bold;
    font-size: 16px;
    color: #333;
    margin-bottom: 8px;
    cursor: pointer;
    padding: 5px;
    border-radius: 4px;
    display: flex;
    align-items: center;
}

.chapter-title:before {
    content: "▶";
    font-size: 10px;
    margin-right: 5px;
    transition: transform 0.2s;
}

.chapter-title.collapsed:before {
    content: "▼";
}

.chapter-title:hover {
    background-color: #f0f0f0;
}

.section {
    margin-left: 15px;
    margin-bottom: 5px;
}

.section-title {
    font-size: 14px;
    color: #555;
    cursor: pointer;
    padding: 3px 5px;
    border-radius: 4px;
    display: block;
}

.section-title:hover {
    background-color: #f0f0f0;
}

.active {
    background-color: #e1f5fe;
    color: #0288d1;
}

.img-wrapper {
    margin-bottom: 20px;
    background-color: #fafafa;
    border-radius: 4px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.page-image {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    display: block;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.loading {
    text-align: center;
    padding: 50px;
    color: #666;
}

.no-content {
    text-align: center;
    padding: 50px;
    color: #999;
    font-size: 16px;
}

@media (max-width: 768px) {
    .container {
        flex-direction: column;
    }
    
    .sidebar {
        width: 100%;
        height: 200px;
    }
    
    .content {
        height: calc(100vh - 250px);
    }
}