
/* 
 * 全局样式设置
 * 设置页面的基本字体、背景渐变和响应式布局
 */
body {
    margin: 0;
    padding: 0;
    font-family: 'Roboto', sans-serif; /* 使用现代无衬线字体，提升科技感 */
    background: linear-gradient(135deg, #0f2027, #203a43, #2c5364); /* 主色调渐变，营造深邃的宇宙感 */
    color: #ffffff; /* 统一文本颜色，确保可读性 */
    line-height: 1.6;
    transition: background 0.5s ease; /* 平滑过渡效果 */
}

/* 
 * 导航栏样式
 * 固定在顶部，半透明背景，悬停链接颜色变化
 */
.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    background: rgba(0, 0, 0, 0.5); /* 半透明背景 */
    backdrop-filter: blur(10px); /* 模糊效果，提升层次感 */
    display: flex;
    justify-content: space-around;
    align-items: center;
    padding: 20px;
    z-index: 1000; /* 确保导航栏在最前 */
}

.navbar a {
    color: #ffffff;
    text-decoration: none;
    font-size: 1.2em;
    transition: color 0.3s ease;
}

.navbar a:hover {
    color: #00c9ff; /* 悬停时变换为点缀色，吸引注意 */
}

/* 
 * 主要内容容器
 * 使用网格布局，响应式设计，确保各设备适配良好
 */
.container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    padding: 100px 40px 40px 40px; /* 顶部留出导航栏空间 */
}

/* 
 * 卡片样式
 * 半透明背景，圆角，阴影效果，悬停放大与阴影增强
 */
.card {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    position: relative;
    overflow: hidden;
}

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

/* 
 * 卡片内部图片样式
 * 最大宽度限制，圆角，阴影，悬停效果
 */
.card img {
    max-width: 100%;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card img:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

/* 
 * 文章内容样式
 * 突出标题，段落独立成块，适当留白
 */
article {
    max-width: 800px;
    margin: 0 auto;
}

article h2, article h3 {
    color: #00c9ff; /* 使用点缀色突出标题 */
}

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

article code {
    font-family: 'Courier New', Courier, monospace;
    color: #92fe9d; /* 代码颜色区分于正文 */
}

/* 
 * 提示信息样式
 * 显著位置，鲜明颜色
 */
.reference {
    text-align: center;
    font-size: 1.5em;
    color: #ff5722; /* 点缀色用于吸引目光 */
    margin: 40px 0;
}

/* 
 * 响应式设计
 * 针对不同屏幕宽度调整布局
 */
@media (max-width: 768px) {
    .container {
        grid-template-columns: 1fr;
        padding: 100px 20px 20px 20px;
    }

    .navbar {
        flex-direction: column;
    }

    article {
        padding: 0 10px;
    }
}

/* 
 * 代码块样式
 * 明显区别于正文，增强可读性
 */
.code-block {
    background: rgba(0, 0, 0, 0.8);
    padding: 20px;
    border-radius: 8px;
    overflow-x: auto;
    margin: 20px 0;
}

.code-block code {
    color: #00c9ff;
    font-family: 'Courier New', Courier, monospace;
    font-size: 1em;
}

/* 
 * 返回顶部按钮样式
 * 固定位置，渐显效果
 */
.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: #00c9ff;
    color: #ffffff;
    padding: 10px 15px;
    border-radius: 50%;
    text-decoration: none;
    font-size: 1.2em;
    display: none;
    transition: background 0.3s ease, transform 0.3s ease;
}

.back-to-top:hover {
    background: #92fe9d;
    transform: scale(1.1);
}

/* 
 * 显示返回顶部按钮的JavaScript触发类
 */
.show {
    display: block;
}

/* 
 * 星河动态背景样式
 * 全屏覆盖，动画效果
 */
canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1; /* 背景层级 */
}

/* 
 * 关键帧动画 - 动态星河流动
 */
@keyframes moveGradient {
    0% { background-position: 0 0; }
    100% { background-position: 100% 100%; }
}

/* 
 * 页脚样式
 * 简洁，信息展示
 */
footer {
    text-align: center;
    padding: 20px;
    background: rgba(0, 0, 0, 0.5);
    color: #ffffff;
    position: relative;
    bottom: 0;
    width: 100%;
}

/* 
 * 折叠区域样式
 * 隐藏和显示次要信息
 */
.collapsible {
    background-color: rgba(255, 255, 255, 0.1);
    color: #ffffff;
    cursor: pointer;
    padding: 10px;
    width: 100%;
    border: none;
    text-align: left;
    outline: none;
    font-size: 1.2em;
    transition: background 0.3s ease;
}

.active, .collapsible:hover {
    background-color: rgba(0, 201, 255, 0.3);
}

.content {
    padding: 0 18px;
    display: none;
    overflow: hidden;
    background-color: rgba(255, 255, 255, 0.05);
    border-radius: 0 0 10px 10px;
}


