/* 阅读器样式文件 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Microsoft YaHei', 'PingFang SC', 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    min-height: 100vh;
    color: #2c3e50;
    line-height: 1.8;
}

.reading-container {
    max-width: 800px;
    margin: 0 auto;
    background: #ffffff;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    border-radius: 15px;
    overflow: hidden;
    min-height: 100vh;
}

.chapter-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 30px;
    text-align: center;
    position: relative;
}

.chapter-header h1 {
    font-size: 2.2em;
    margin-bottom: 10px;
    font-weight: 600;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.chapter-number {
    font-size: 1.1em;
    opacity: 0.9;
    font-weight: 300;
}

.chapter-content {
    padding: 40px 50px;
    font-size: 1.1em;
    line-height: 2.0;
    text-align: justify;
    background: #fafafa;
}

.chapter-content p {
    margin-bottom: 20px;
    text-indent: 2em;
    color: #34495e;
    font-weight: 400;
}

/* 移除第一段特殊样式，让所有段落保持一致 */

.chapter-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 25px 50px;
    background: #f8f9fa;
    border-top: 1px solid #e9ecef;
}

.nav-btn {
    padding: 12px 24px;
    border: none;
    border-radius: 25px;
    font-size: 1em;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.nav-btn.prev {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.nav-btn.next {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
}

.nav-btn.home {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    color: white;
}

.nav-btn:hover:not([disabled]) {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.nav-btn:disabled {
    background: #bdc3c7;
    cursor: not-allowed;
    opacity: 0.6;
}

.footer {
    text-align: center;
    padding: 20px;
    background: #2c3e50;
    color: #ecf0f1;
    font-size: 0.9em;
}

/* 阅读进度条 */
.progress-bar {
    position: fixed;
    top: 0;
    left: 0;
    width: 0%;
    height: 3px;
    background: linear-gradient(90deg, #667eea, #764ba2);
    z-index: 1000;
    transition: width 0.3s ease;
}

/* 阅读设置面板 */
.reading-settings {
    position: fixed;
    top: 20px;
    right: 20px;
    background: white;
    border-radius: 10px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
    padding: 20px;
    z-index: 1001;
    display: none;
}

.reading-settings.show {
    display: block;
}

.settings-btn {
    position: fixed;
    top: 20px;
    right: 20px;
    background: #34495e;
    color: white;
    border: none;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    font-size: 1.2em;
    cursor: pointer;
    z-index: 1002;
    transition: all 0.3s ease;
}

.settings-btn:hover {
    background: #2c3e50;
    transform: scale(1.1);
}

/* 字体大小调节 */
.font-size-controls {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
}

.font-size-controls button {
    background: #ecf0f1;
    border: none;
    border-radius: 5px;
    padding: 8px 12px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.font-size-controls button:hover {
    background: #bdc3c7;
}

/* 主题切换 */
.theme-toggle {
    display: flex;
    align-items: center;
    gap: 10px;
}

.theme-toggle button {
    background: #ecf0f1;
    border: none;
    border-radius: 5px;
    padding: 8px 12px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.theme-toggle button:hover {
    background: #bdc3c7;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .reading-container {
        margin: 0;
        border-radius: 0;
    }
    
    .chapter-header {
        padding: 20px;
    }
    
    .chapter-header h1 {
        font-size: 1.8em;
    }
    
    .chapter-content {
        padding: 25px 30px;
        font-size: 1em;
    }
    
    .chapter-nav {
        padding: 20px 30px;
        flex-direction: column;
        gap: 15px;
    }
    
    .nav-btn {
        width: 100%;
        justify-content: center;
    }
}

/* 夜间模式 */
body.dark-theme {
    background: #1a1a1a;
    color: #e0e0e0;
}

body.dark-theme .reading-container {
    background: #2d2d2d;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

body.dark-theme .chapter-content {
    background: #2d2d2d;
    color: #e0e0e0;
}

body.dark-theme .chapter-content p {
    color: #d0d0d0;
}

body.dark-theme .chapter-nav {
    background: #3d3d3d;
    border-top-color: #4d4d4d;
}

/* 加载动画 */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 提示信息 */
.toast {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: #2ecc71;
    color: white;
    padding: 12px 24px;
    border-radius: 25px;
    z-index: 1003;
    display: none;
    animation: slideDown 0.3s ease;
}

.toast.show {
    display: block;
}

@keyframes slideDown {
    from {
        transform: translateX(-50%) translateY(-100%);
        opacity: 0;
    }
    to {
        transform: translateX(-50%) translateY(0);
        opacity: 1;
    }
}
