
/* 全局样式设置 */
/* 设置盒模型为边框盒模型，确保padding和border包含在元素总宽度和高度内 */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* 设置页面的背景色为深蓝色渐变，符合未来感与科技感主题 */
body {
    background: linear-gradient(135deg, #1B2430, #3F95FF);
    font-family: 'Lato', sans-serif;
    color: #D3D3D3;
    line-height: 1.6;
    overflow-x: hidden; /* 防止出现水平滚动条 */
}

/* 定义容器的网格布局，确保响应式设计 */
.container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    padding: 40px;
}

/* 信息模块的样式，独立设计，带有阴影和圆角 */
.info-module {
    background: rgba(27, 36, 48, 0.9);
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.4);
    transition: transform 0.3s, box-shadow 0.3s;
}

.info-module:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.5);
}

/* 设置标题的字体和颜色，使用现代无衬线字体，提高可读性 */
h1, h2, h3, h4 {
    font-family: 'Roboto', sans-serif;
    color: #6A28B8;
    margin-bottom: 20px;
}

h1 {
    font-size: 48px;
}

h2 {
    font-size: 32px;
    letter-spacing: 1px;
}

h3 {
    font-size: 24px;
}

p {
    font-size: 16px;
    color: #D3D3D3;
    margin-bottom: 15px;
    letter-spacing: 0.5px;
}

/* 设置按钮的样式，使用电光蓝和亮银色，带有阴影和过渡效果 */
.button {
    background-color: #3F95FF;
    color: #FFFFFF;
    padding: 15px 30px;
    border: none;
    border-radius: 5px;
    box-shadow: 0 4px 6px rgba(63, 149, 255, 0.3);
    transition: background-color 0.3s, transform 0.3s;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
}

.button:hover {
    background-color: #6A28B8;
    transform: scale(1.05);
}

/* 图标的统一样式，使用SVG格式，带有悬停效果 */
.icon {
    width: 24px;
    height: 24px;
    fill: #D3D3D3;
    transition: fill 0.3s;
}

.icon:hover {
    fill: #3F95FF;
}

/* 设置导航栏的样式，固定在顶部，包含Logo和导航链接 */
.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    background: rgba(27, 36, 48, 0.9);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 40px;
    z-index: 1000;
}

.navbar .logo {
    font-family: 'Roboto', sans-serif;
    font-size: 24px;
    color: #6A28B8;
}

/* 导航链接的列表样式，水平排列 */
.navbar ul {
    list-style: none;
    display: flex;
    gap: 20px;
}

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

.navbar ul li a:hover {
    color: #3F95FF;
}

/* 响应式设计，适配移动设备 */
@media (max-width: 768px) {
    .navbar {
        flex-direction: column;
        align-items: center;
    }

    .navbar ul {
        flex-direction: column;
        gap: 10px;
    }

    .navbar .logo {
        margin-bottom: 10px;
    }

    .container {
        grid-template-columns: 1fr;
        padding: 20px;
    }

    .button {
        padding: 10px 20px;
        font-size: 14px;
    }

    .back-to-top {
        bottom: 20px;
        right: 20px;
        padding: 10px;
    }
}

/* 设置固定的回到顶部按钮样式 */
.back-to-top {
    position: fixed;
    bottom: 40px;
    right: 40px;
    background-color: #3F95FF;
    color: #FFFFFF;
    padding: 15px;
    border-radius: 50%;
    box-shadow: 0 4px 6px rgba(63, 149, 255, 0.3);
    cursor: pointer;
    transition: background-color 0.3s, transform 0.3s;
    display: none;
}

.back-to-top.show {
    display: block;
}

.back-to-top:hover {
    background-color: #6A28B8;
    transform: scale(1.1);
}

/* 设置代码块的样式，与正文内容区分 */
pre {
    background: rgba(27, 36, 48, 0.8);
    padding: 20px;
    border-radius: 10px;
    overflow-x: auto;
    margin-bottom: 20px;
}

code {
    color: #3F95FF;
    font-family: 'Courier New', Courier, monospace;
}

/* 设置图片的样式，带有圆角、阴影和悬停效果 */
img.decorative {
    width: 100%;
    max-width: 320px;
    border-radius: 15px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
    transition: transform 0.3s, box-shadow 0.3s;
}

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

/* 设置章节导航栏，固定在侧边，帮助用户快速定位内容 */
.chapter-nav {
    position: fixed;
    top: 100px;
    left: 20px;
    background: rgba(27, 36, 48, 0.8);
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
}

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

.chapter-nav ul li {
    margin-bottom: 10px;
}

.chapter-nav ul li a {
    color: #3F95FF;
    text-decoration: none;
    font-size: 16px;
    transition: color 0.3s;
}

.chapter-nav ul li a:hover {
    color: #6A28B8;
}

/* 设置折叠区域的样式，次要信息可自行展开 */
.collapsible {
    background-color: rgba(27, 36, 48, 0.7);
    color: #D3D3D3;
    cursor: pointer;
    padding: 10px;
    width: 100%;
    border: none;
    text-align: left;
    outline: none;
    font-size: 16px;
    border-radius: 5px;
    transition: background-color 0.3s;
}

.collapsible:hover {
    background-color: #3F95FF;
}

.content {
    padding: 0 18px;
    display: none;
    overflow: hidden;
    background-color: rgba(27, 36, 48, 0.5);
    border-radius: 5px;
    margin-bottom: 20px;
}

/* 星空粒子动画 */
.starfield::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: transparent;
    pointer-events: none;
    overflow: hidden;
}

.star {
    position: absolute;
    width: 2px;
    height: 2px;
    background: #FFFFFF;
    border-radius: 50%;
    animation: twinkle 2s infinite ease-in-out;
    opacity: 0;
}

@keyframes twinkle {
    0%, 100% { opacity: 0; }
    50% { opacity: 1; }
}

/* 设置模块化设计的动画效果 */
.grid-item {
    background: rgba(27, 36, 48, 0.8);
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
    transition: transform 0.3s ease;
}

.grid-item:hover {
    transform: translateY(-10px);
}

/* 设置星空背景的动画效果 */
@keyframes moveClouds {
    0% { background-position: 0 0; }
    100% { background-position: -1000px 0; }
}

.clouds {
    background: url('https://images.gptkong.com/demo/sample1.png') repeat-x;
    position: absolute;
    top: 0;
    left: 0;
    width: 200%;
    height: 100%;
    animation: moveClouds 60s linear infinite;
    opacity: 0.5;
}

/* 设置回到顶部按钮的显示逻辑 */
.show-top-button {
    display: block;
}

