/* 全局样式 */
:root {
    --primary-color: #1A365D;    /* 深蓝色 - 主色调 */
    --secondary-color: #D4AF37;  /* 金色 - 辅助色 */
    --background-color: #F5F5F5; /* 浅灰 - 背景色 */
    --accent-color: #4A90E2;     /* 淡蓝 - 强调色 */
    --text-color: #333333;       /* 深灰 - 文本色 */
    --light-text: #FFFFFF;       /* 白色 - 亮色文本 */
    --border-color: #E0E0E0;     /* 边框色 */
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Open Sans', 'Microsoft YaHei', sans-serif;
    color: var(--text-color);
    background-color: var(--background-color);
    line-height: 1.6;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.container {
    display: flex;
    flex: 1;
}

/* 侧边导航样式 */
.sidebar {
    width: 280px;
    background-color: var(--primary-color);
    color: var(--light-text);
    padding: 2rem 1rem;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
}

.logo {
    text-align: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.logo h2 {
    font-family: 'Montserrat', 'Microsoft YaHei', sans-serif;
    font-weight: 700;
    font-size: 1.8rem;
    margin-bottom: 0.5rem;
    color: var(--secondary-color);
}

.logo p {
    font-size: 1rem;
    opacity: 0.8;
}

.nav-links {
    list-style: none;
}

.nav-links li {
    margin-bottom: 0.5rem;
}

.nav-links a {
    display: block;
    padding: 0.8rem 1rem;
    color: var(--light-text);
    text-decoration: none;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.nav-links a:hover, .nav-links a.active {
    background-color: rgba(255, 255, 255, 0.1);
    transform: translateX(5px);
}

.nav-links a.active {
    border-left: 3px solid var(--secondary-color);
}

/* 主要内容样式 */
.content {
    flex: 1;
    margin-left: 280px;
    padding: 2rem 3rem;
    width: calc(100% - 280px);
}

header {
    margin-bottom: 3rem;
    padding-bottom: 1.5rem;
    border-bottom: 2px solid var(--secondary-color);
}

header h1 {
    font-family: 'Montserrat', 'Microsoft YaHei', sans-serif;
    font-weight: 700;
    font-size: 2.2rem;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

header h2 {
    font-family: 'Montserrat', 'Microsoft YaHei', sans-serif;
    font-weight: 500;
    font-size: 1.3rem;
    color: var(--secondary-color);
}

section {
    margin-bottom: 3rem;
}

section h2 {
    font-family: 'Montserrat', 'Microsoft YaHei', sans-serif;
    font-weight: 600;
    font-size: 1.8rem;
    color: var(--primary-color);
    margin-bottom: 1.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border-color);
}

.abstract-content p {
    margin-bottom: 1rem;
    font-size: 1.05rem;
    text-align: justify;
}

/* 章节导航 */
.chapter-navigation {
    margin-top: 3rem;
    display: flex;
    justify-content: flex-end;
}

.next-chapter, .prev-chapter {
    display: block;
    padding: 1rem 1.5rem;
    background-color: var(--primary-color);
    color: var(--light-text);
    text-decoration: none;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.next-chapter:hover, .prev-chapter:hover {
    background-color: var(--secondary-color);
    transform: translateY(-3px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.next-chapter span, .prev-chapter span {
    display: block;
    font-size: 0.9rem;
    opacity: 0.8;
}

.next-chapter h3, .prev-chapter h3 {
    font-family: 'Montserrat', 'Microsoft YaHei', sans-serif;
    font-weight: 600;
    font-size: 1.1rem;
}

/* 页脚样式 */
footer {
    background-color: var(--primary-color);
    color: var(--light-text);
    text-align: center;
    padding: 1.5rem;
    margin-top: auto;
    margin-left: 280px;
}

/* 响应式设计 */
@media (max-width: 992px) {
    .sidebar {
        width: 240px;
    }
    
    .content, footer {
        margin-left: 240px;
    }
    
    .content {
        padding: 2rem;
    }
}

@media (max-width: 768px) {
    .container {
        flex-direction: column;
    }
    
    .sidebar {
        width: 100%;
        height: auto;
        position: relative;
        padding: 1rem;
    }
    
    .logo {
        margin-bottom: 1rem;
        padding-bottom: 0.5rem;
    }
    
    .content, footer {
        margin-left: 0;
    }
    
    header h1 {
        font-size: 1.8rem;
    }
    
    header h2 {
        font-size: 1.1rem;
    }
}

/* 章节内容样式 */
.chapter-content h3 {
    font-family: 'Montserrat', 'Microsoft YaHei', sans-serif;
    font-weight: 600;
    font-size: 1.5rem;
    color: var(--primary-color);
    margin: 2rem 0 1rem;
}

.chapter-content h4 {
    font-family: 'Montserrat', 'Microsoft YaHei', sans-serif;
    font-weight: 500;
    font-size: 1.2rem;
    color: var(--primary-color);
    margin: 1.5rem 0 1rem;
}

.chapter-content p {
    margin-bottom: 1rem;
    text-align: justify;
}

.chapter-content ul, .chapter-content ol {
    margin-bottom: 1rem;
    padding-left: 2rem;
}

.chapter-content li {
    margin-bottom: 0.5rem;
}

/* 返回顶部按钮 */
.back-to-top {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background-color: var(--primary-color);
    color: var(--light-text);
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    text-decoration: none;
    opacity: 0;
    transition: all 0.3s ease;
    z-index: 1000;
}

.back-to-top.visible {
    opacity: 1;
}

.back-to-top:hover {
    background-color: var(--secondary-color);
    transform: translateY(-5px);
}