
/* 全局样式设置，应用字体、背景颜色和基本布局 */
body {
    margin: 0;
    padding: 0;
    font-family: 'Roboto', sans-serif;
    background: linear-gradient(135deg, #0f2027, #203a43, #2c5364);
    color: #ffffff;
    line-height: 1.6;
    font-size: 16px;
    transition: background 0.3s ease, color 0.3s ease;
}

/* 设置容器的宽度和内边距，确保响应式设计 */
.container {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* 固定导航栏样式，包含导航链接 */
.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    background: rgba(32, 58, 67, 0.9);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    z-index: 1000;
}

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

.navbar ul li a {
    color: #ffffff;
    text-decoration: none;
    font-size: 18px;
    transition: color 0.3s ease;
}

.navbar ul li a:hover {
    color: #1E90FF;
}

/* 主要内容区域的样式，包含页眉、内容和页脚 */
.main {
    padding-top: 80px; /* 预留导航栏空间 */
}

header {
    text-align: center;
    padding: 50px 0;
}

header h1 {
    font-size: 36px;
    margin-bottom: 10px;
    color: #1E90FF;
}

header p {
    font-size: 18px;
    color: #a0c4ff;
}

/* 章节导航系统样式，固定在页面侧边 */
.chapter-nav {
    position: fixed;
    top: 100px;
    left: 10px;
    background: rgba(32, 58, 67, 0.8);
    padding: 15px;
    border-radius: 8px;
}

.chapter-nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.chapter-nav ul li a {
    display: block;
    color: #ffffff;
    text-decoration: none;
    margin-bottom: 10px;
    font-size: 16px;
    transition: color 0.3s ease;
}

.chapter-nav ul li a:hover {
    color: #1E90FF;
}

/* 文章内容样式，包括标题、段落和代码块 */
article {
    margin: 20px 0;
}

article h2 {
    font-size: 28px;
    color: #1E90FF;
    margin-bottom: 20px;
}

article h3 {
    font-size: 24px;
    color: #a0c4ff;
    margin-top: 30px;
    margin-bottom: 15px;
}

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

article pre {
    background: rgba(44, 83, 100, 0.8);
    padding: 15px;
    border-radius: 5px;
    overflow-x: auto;
    margin-bottom: 20px;
}

article pre code {
    color: #66d9ef;
    font-family: 'Courier New', Courier, monospace;
    font-size: 14px;
}

/* 图片样式，包括圆角、阴影和悬停效果 */
img.decorative {
    width: 100%;
    max-width: 320px;
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    margin: 20px 0;
}

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

/* 按钮样式，带有悬停动画效果 */
.button {
    display: inline-block;
    padding: 10px 20px;
    background: #2c5364;
    color: #ffffff;
    text-decoration: none;
    border-radius: 5px;
    transition: background 0.3s ease, transform 0.3s ease;
}

.button:hover {
    background: #1E90FF;
    transform: translateY(-2px);
}

/* 折叠区域样式，隐藏内容并可通过点击展开 */
.collapsible {
    background: rgba(32, 58, 67, 0.7);
    color: #ffffff;
    cursor: pointer;
    padding: 10px;
    width: 100%;
    border: none;
    text-align: left;
    outline: none;
    font-size: 18px;
    margin-top: 20px;
    border-radius: 5px;
}

.active, .collapsible:hover {
    background: #1E90FF;
}

.content {
    padding: 0 15px;
    display: none;
    background: rgba(32, 58, 67, 0.5);
    overflow: hidden;
    border-radius: 5px;
}

.content p {
    margin: 10px 0;
    color: #ffffff;
}

/* 背景幻化线条与装饰元素 */
.background-lines {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    background: url('https://images.gptkong.com/demo/sample3.png') repeat;
    opacity: 0.1;
}

/* 响应式设计，适配不同屏幕尺寸 */
@media (max-width: 768px) {
    .navbar ul {
        flex-direction: column;
    }
    .chapter-nav {
        display: none;
    }
}

@media (max-width: 480px) {
    header h1 {
        font-size: 28px;
    }
    header p {
        font-size: 16px;
    }
    .navbar ul li a {
        font-size: 16px;
    }
    .chapter-nav ul li a {
        font-size: 14px;
    }
    article h2 {
        font-size: 24px;
    }
    article h3 {
        font-size: 20px;
    }
}

