
/* 全局样式设置 */
body {
    margin: 0;
    padding: 0;
    font-family: 'Open Sans', sans-serif; /* 使用易读的字体 */
    font-size: 16px; /* 正文字号 */
    color: #FFFFFF; /* 文字颜色为白色 */
    background: linear-gradient(135deg, #0d1b2a, #1b263b, #415a77, #778da9); /* 渐变背景 */
    background-size: 400% 400%;
    animation: gradientBackground 15s ease infinite; /* 背景动画 */
}

/* 渐变背景动画关键帧 */
@keyframes gradientBackground {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* 导航栏样式 */
.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
    z-index: 1000;
}

.navbar a {
    color: #FFFFFF;
    text-decoration: none;
    font-family: 'Roboto', sans-serif;
    margin: 0 1rem;
    transition: color 0.3s;
}

.navbar a:hover {
    color: #40E0D0; /* 鼠标悬停颜色变化 */
}

/* 主内容容器 */
.container {
    display: flex;
    flex-wrap: wrap;
    padding: 6rem 2rem 2rem 2rem; /* 顶部留出导航栏空间 */
}

/* 章节导航系统 */
.chapter-nav {
    position: fixed;
    top: 80px;
    left: 20px;
    background: rgba(255, 255, 255, 0.1);
    padding: 1rem;
    border-radius: 10px;
}

.chapter-nav a {
    display: block;
    color: #FFFFFF;
    text-decoration: none;
    margin: 0.5rem 0;
    transition: color 0.3s;
}

.chapter-nav a:hover {
    color: #FFD700;
}

/* 文章内容样式 */
article {
    flex: 1;
    max-width: 800px;
    margin: 0 auto;
    background: rgba(0, 0, 0, 0.5);
    padding: 2rem;
    border-radius: 15px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

article h2, article h3, article h4 {
    color: #FFD700; /* 章节标题颜色 */
}

article p {
    line-height: 1.8;
    margin-bottom: 1.5rem;
}

article pre {
    background: #1e1e1e;
    padding: 1rem;
    border-radius: 10px;
    overflow-x: auto;
}

article code {
    color: #00CED1;
    font-family: 'Courier New', Courier, monospace;
}

/* 图片样式 */
.image-gallery {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin: 2rem 0;
}

.image-gallery img {
    width: 160px;
    height: 160px;
    object-fit: cover;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
    transition: transform 0.3s, box-shadow 0.3s;
}

.image-gallery img:hover {
    transform: scale(1.05);
    box-shadow: 0 8px 12px rgba(0, 0, 0, 0.5);
}

/* 按钮样式 */
.btn {
    background-color: #40E0D0;
    color: #FFFFFF;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 25px;
    font-family: 'Roboto', sans-serif;
    font-size: 1rem;
    cursor: pointer;
    transition: background-color 0.3s, transform 0.3s;
}

.btn:hover {
    background-color: #20B2AA;
    transform: translateY(-5px);
}

/* 折叠区域样式 */
.collapsible {
    background-color: #333333;
    color: #FFFFFF;
    cursor: pointer;
    padding: 1rem;
    width: 100%;
    border: none;
    text-align: left;
    outline: none;
    font-size: 1.1rem;
    border-radius: 10px;
    margin-top: 1rem;
    transition: background-color 0.3s;
}

.collapsible:hover {
    background-color: #444444;
}

.content {
    padding: 0 1rem;
    display: none;
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    margin-bottom: 1rem;
}

/* 代码块样式 */
.code-block {
    background: #1e1e1e;
    padding: 1rem;
    border-radius: 10px;
    overflow-x: auto;
    margin: 1rem 0;
}

.code-block code {
    color: #00CED1;
    font-family: 'Courier New', Courier, monospace;
}

/* 提示信息样式 */
.reference-note {
    background: rgba(255, 215, 0, 0.2);
    padding: 1rem;
    border-left: 5px solid #FFD700;
    margin: 2rem 0;
    border-radius: 5px;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .chapter-nav {
        position: static;
        margin-bottom: 1rem;
        display: flex;
        overflow-x: auto;
    }
    
    .chapter-nav a {
        margin: 0 0.5rem;
    }
    
    .image-gallery {
        justify-content: center;
    }
}

