
/* 基础样式重置，确保不同浏览器显示一致 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* 设定全局字体和背景色，使用CSS变量便于主题切换 */
:root {
    --primary-color: #7F00FF; /* 主色调紫色 */
    --secondary-color: #E100FF; /* 辅助色调粉色 */
    --accent-color: #FF9800; /* 点缀色橙色 */
    --background-color: #1e1e1e; /* 页面背景色，避免使用白色 */
    --text-color: #ffffff; /* 文字颜色 */
    --font-family: 'Roboto', sans-serif; /* 无衬线现代字体 */
}

body {
    font-family: var(--font-family);
    color: var(--text-color);
    background-color: var(--background-color);
    line-height: 1.6;
    overflow-x: hidden; /* 防止横向滚动条 */
}

/* 动态渐变背景，融合科技感 */
.dynamic-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(-45deg, #7F00FF, #E100FF, #00C9FF, #92FE9D);
    background-size: 400% 400%;
    animation: gradientAnimation 15s ease infinite; /* 背景动画 */
    z-index: -1;
    opacity: 0.8;
}

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

/* 顶部固定导航栏样式 */
.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    background-color: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px); /* 毛玻璃效果 */
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    z-index: 1000;
}

.navbar ul {
    display: flex;
    justify-content: space-around;
    padding: 15px 0;
    list-style: none;
}

.navbar a {
    text-decoration: none;
    color: var(--text-color);
    font-weight: 500;
    transition: color 0.3s ease;
}

.navbar a:hover {
    color: var(--accent-color);
}

/* 页面主要内容区域 */
.main-content {
    padding: 100px 20px 20px 20px; /* 留出导航栏空间 */
    max-width: 1200px;
    margin: 0 auto;
}

/* 章节导航系统样式 */
.chapter-nav {
    position: fixed;
    top: 100px;
    right: 20px;
    background-color: rgba(0, 0, 0, 0.5);
    padding: 10px;
    border-radius: 8px;
}

.chapter-nav a {
    display: block;
    color: var(--text-color);
    margin: 5px 0;
    text-decoration: none;
    transition: color 0.3s ease;
}

.chapter-nav a:hover {
    color: var(--accent-color);
}

/* 文章内容样式 */
article {
    background-color: rgba(255, 255, 255, 0.1);
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

article h2, article h3 {
    color: var(--accent-color);
    margin-bottom: 10px;
}

article p {
    margin-bottom: 15px;
    font-size: 16px;
}

article pre {
    background-color: rgba(0, 0, 0, 0.7);
    padding: 10px;
    border-radius: 5px;
    overflow-x: auto;
    margin-bottom: 15px;
}

article code {
    color: #00C9FF;
}

/* 图片样式，包含圆角、阴影和悬停效果 */
img.decorative {
    width: 320px;
    height: 320px;
    object-fit: cover;
    border-radius: 15px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    margin: 10px;
}

img.decorative:hover {
    transform: scale(1.05);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.3);
}

/* 按钮样式，使用渐变和过渡效果 */
.button {
    background: linear-gradient(45deg, var(--primary-color), var(--secondary-color));
    color: #ffffff;
    padding: 10px 20px;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    transition: transform 0.3s ease, background 0.3s ease;
    font-size: 16px;
}

.button:hover {
    transform: scale(1.1);
    background: linear-gradient(45deg, var(--secondary-color), var(--primary-color));
}

/* 折叠区域样式 */
.collapsible {
    background-color: rgba(0, 0, 0, 0.3);
    color: var(--text-color);
    cursor: pointer;
    padding: 10px;
    width: 100%;
    border: none;
    text-align: left;
    outline: none;
    font-size: 16px;
    border-radius: 5px;
    margin-bottom: 10px;
    transition: background-color 0.3s ease;
}

.collapsible:hover {
    background-color: rgba(0, 0, 0, 0.5);
}

.collapsible:after {
    content: '\002B'; /* 加号符号 */
    font-size: 13px;
    float: right;
}

.collapsible.active:after {
    content: "\2212"; /* 减号符号 */
}

.content {
    padding: 0 18px;
    display: none;
    overflow: hidden;
    background-color: rgba(255, 255, 255, 0.05);
    border-radius: 5px;
    margin-bottom: 15px;
    transition: max-height 0.2s ease-out;
}

.content p {
    margin: 10px 0;
}

/* 响应式设计，适配不同设备 */
@media (max-width: 768px) {
    .navbar ul {
        flex-direction: column;
        align-items: center;
    }
    
    .chapter-nav {
        display: none; /* 移动端隐藏章节导航 */
    }
    
    img.decorative {
        width: 100%;
        height: auto;
    }
    
    .main-content {
        padding: 120px 10px 10px 10px;
    }
}

