.read-container {
    position: relative;
    margin-bottom: 30px;
}

.read-main {
    background: #fff;
    border: 1px solid #e9ecef;
    padding: 25px;
    min-height: 600px;
    transition: margin-right 0.3s ease;
}

.read-main.sidebar-open {
    margin-right: 280px; /* 侧边栏宽度 */
}

/* 侧边栏样式 */
.read-sidebar {
    position: fixed;
    top: 50%;
    right: -250px; /* 默认隐藏 */
    width: 250px;
    height: 70vh;
    background: #fff;
    border: 1px solid #e9ecef;
    border-radius: 8px 0 0 8px;
    padding: 20px;
    transform: translateY(-50%);
    transition: right 0.3s ease;
    z-index: 1000;
    overflow-y: auto;
    box-shadow: -2px 0 10px rgba(0, 0, 0, 0.1);
}

.read-sidebar.open {
    right: 0;
}

/* 悬浮按钮 */
.sidebar-toggle {
    position: fixed;
    top: 50%;
    right: 20px;
    width: 50px;
    height: 50px;
    background: #2c3e50;
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    transform: translateY(-50%);
    z-index: 1001;
    font-size: 18px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.sidebar-toggle:hover {
    background: #34495e;
    transform: translateY(-50%) scale(1.1);
}

.sidebar-toggle.sidebar-open {
    right: 270px; /* 侧边栏宽度 + 间距 */
}

/* 章节导航 */
.chapter-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 0;
    border-bottom: 1px solid #e9ecef;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 10px;
}

/* 底部导航居中 */
.chapter-nav.bottom-nav {
    justify-content: center;
    border-bottom: none;
    border-top: 1px solid #e9ecef;
    margin-bottom: 0;
    margin-top: 30px;
}

.nav-buttons {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.nav-btn {
    padding: 8px 16px;
    background: #f8f9fa;
    color: #333;
    text-decoration: none;
    border: 1px solid #e9ecef;
    border-radius: 4px;
    font-size: 14px;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.nav-btn:hover {
    background: #2c3e50;
    color: white;
    border-color: #2c3e50;
}

.nav-btn.disabled {
    background: #e9ecef;
    color: #999;
    cursor: not-allowed;
}

.nav-btn.disabled:hover {
    background: #e9ecef;
    color: #999;
    border-color: #e9ecef;
}

/* 阅读设置 */
.read-settings {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

.setting-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.setting-label {
    font-size: 13px;
    color: #666;
    white-space: nowrap;
}

.theme-toggle {
    display: flex;
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 4px;
    overflow: hidden;
}

.theme-btn {
    padding: 6px 12px;
    font-size: 12px;
    background: none;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    color: #666;
}

.theme-btn.active {
    background: #2c3e50;
    color: white;
}

.size-controls {
    display: flex;
    align-items: center;
    gap: 5px;
}

.size-btn {
    width: 24px;
    height: 24px;
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 3px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    color: #666;
    transition: all 0.3s ease;
}

.size-btn:hover {
    background: #2c3e50;
    color: white;
    border-color: #2c3e50;
}

.size-display {
    min-width: 30px;
    text-align: center;
    font-size: 12px;
    color: #666;
}

/* 章节内容 */
.chapter-header {
    text-align: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid #f0f0f0;
}

.chapter-title {
    font-size: 24px;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 10px;
}

.chapter-info {
    font-size: 14px;
    color: #666;
}

.chapter-content {
    line-height: 2;
    font-size: 16px;
    color: #333;
    letter-spacing: 0.5px;
    margin-bottom: 30px;
    transition: all 0.3s ease;
}

.chapter-content p {
    margin-bottom: 1.5em;
    text-indent: 2em;
}

/* 推荐列表样式 */
.recommend-section {
    margin-bottom: 25px;
}

.sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #e9ecef;
}

.sidebar-close {
    background: none;
    border: none;
    font-size: 18px;
    color: #666;
    cursor: pointer;
    padding: 5px;
    border-radius: 3px;
    transition: all 0.3s ease;
}

.sidebar-close:hover {
    background: #f0f0f0;
    color: #333;
}

.recommend-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 12px;
    border: 1px solid #e9ecef;
    margin-bottom: 8px;
    transition: all 0.3s ease;
    text-decoration: none;
    color: inherit;
    border-radius: 4px;
}

.recommend-item:hover {
    background: #f8f9fa;
    border-color: #2c3e50;
}

.recommend-title {
    font-size: 14px;
    font-weight: 500;
    color: #2c3e50;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
    margin-right: 10px;
}

.recommend-author {
    font-size: 12px;
    color: #666;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex-shrink: 0;
    max-width: 60px;
}

/* 主题样式 */
body.dark-theme {
    background: #1a1a1a;
    color: #e0e0e0;
}

.dark-theme header {
    background: #2d2d2d;
    border-color: #404040;
    color: #e0e0e0;
}

.dark-theme .read-main {
    background: #2d2d2d;
    border-color: #404040;
    color: #e0e0e0;
}

.dark-theme .read-sidebar {
    background: #2d2d2d;
    border-color: #404040;
    color: #e0e0e0;
}

.dark-theme .sidebar-header {
    border-color: #404040;
}

.dark-theme .sidebar-close {
    color: #e0e0e0;
}

.dark-theme .sidebar-close:hover {
    background: #404040;
}

.dark-theme .chapter-nav {
    border-color: #404040;
}

.dark-theme .chapter-header {
    border-color: #404040;
}

.dark-theme .chapter-title {
    color: #fff;
}

.dark-theme .chapter-content {
    color: #e0e0e0;
}

.dark-theme .nav-btn {
    background: #404040;
    color: #e0e0e0;
    border-color: #555;
}

.dark-theme .nav-btn:hover {
    background: #555;
    border-color: #666;
}

.dark-theme .recommend-item {
    background: #3a3a3a;
    border-color: #555;
}

.dark-theme .recommend-item:hover {
    background: #404040;
    border-color: #666;
}

.dark-theme .recommend-title {
    color: #fff;
}

.dark-theme .theme-btn.active {
    background: #555;
}

.dark-theme .size-btn {
    background: #404040;
    border-color: #555;
    color: #e0e0e0;
}

.dark-theme .size-btn:hover {
    background: #555;
    border-color: #666;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .read-main {
        padding: 15px;
    }
    
    .read-main.sidebar-open {
        margin-right: 0; /* 移动端不调整主内容边距 */
    }
    
    .read-sidebar {
        width: 280px;
        right: -280px;
    }
    
    .read-sidebar.open {
        right: 0;
    }
    
    .sidebar-toggle.sidebar-open {
        right: 300px;
    }
    
    .chapter-nav {
        flex-direction: column;
        align-items: stretch;
        gap: 15px;
    }
    
    .chapter-nav.bottom-nav {
        flex-direction: row;
        justify-content: center;
    }
    
    .nav-buttons {
        justify-content: center;
    }
    
    .read-settings {
        justify-content: center;
        flex-wrap: wrap;
    }
    
    .chapter-title {
        font-size: 20px;
    }
    
    .chapter-content {
        font-size: 15px;
        line-height: 1.8;
    }
}

@media (max-width: 480px) {
    .nav-buttons {
        width: 100%;
        justify-content: space-between;
    }
    
    .nav-btn {
        flex: 1;
        text-align: center;
        padding: 10px 5px;
        font-size: 13px;
    }
    
    .read-settings {
        gap: 10px;
    }
    
    .setting-group {
        flex-direction: column;
        gap: 5px;
        text-align: center;
    }
    
    .read-sidebar {
        width: 90vw;
        right: -90vw;
    }
    
    .sidebar-toggle {
        right: 10px;
    }
    
    .sidebar-toggle.sidebar-open {
        right: calc(90vw + 20px);
    }
}