
/* 全局样式设置 */
/* 使用box-sizing确保所有元素的padding和border不影响布局 */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* 基础字体与背景色设置 */
body {
    font-family: 'Montserrat', sans-serif; /* 使用Montserrat字体，保证阅读清晰 */
    color: #e0e1dd; /* 浅色字体，适应暗黑模式 */
    background: linear-gradient(135deg, #0d1b2a, #1b263b, #415a77, #778da9, #e0e1dd); /* 渐变背景，增强科技感 */
    background-size: 400% 400%;
    animation: gradientAnimation 15s ease infinite; /* 背景动画，提升动态效果 */
    line-height: 1.6;
    padding: 20px;
}

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

/* 标题样式 */
h1, h2, h3, h4, h5, h6 {
    font-family: 'Roboto', sans-serif; /* 使用Roboto字体，增强标题的厚重感 */
    color: #00aaff; /* 电光蓝色，突出科技感 */
    margin-bottom: 20px;
}

h2 {
    font-size: 2em;
    border-bottom: 2px solid #00ffcc; /* 边框装饰，增加视觉层次 */
    padding-bottom: 10px;
}

h3 {
    font-size: 1.5em;
    margin-top: 30px;
}

/* 段落样式 */
p {
    font-size: 16px; /* 适中的字体大小，保证可读性 */
    margin-bottom: 20px;
    color: #e0e1dd;
}

/* 链接样式 */
a {
    color: #00ffcc; /* 点缀色，吸引视线 */
    text-decoration: none;
    transition: color 0.3s ease;
}

a:hover {
    color: #00aaff;
}

/* 按钮样式 */
.btn {
    display: inline-block;
    padding: 12px 30px;
    background-color: #00aaff;
    color: #ffffff;
    border-radius: 25px;
    text-decoration: none;
    transition: background-color 0.3s ease, transform 0.3s ease;
}

.btn:hover {
    background-color: #00ffcc;
    transform: translateY(-5px); /* 悬浮时略微上移，增加互动感 */
}

/* 导航栏样式 */
.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    background-color: rgba(0, 0, 0, 0.8); /* 半透明黑色，突出内容 */
    padding: 20px 50px;
    transition: padding 0.3s ease, background-color 0.3s ease;
    z-index: 1000;
}

.navbar.shrink {
    padding: 10px 50px;
    background-color: rgba(0, 0, 0, 0.9);
}

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

.navbar li {
    margin: 0 15px;
}

.navbar a {
    color: #e0e1dd;
    font-size: 16px;
}

/* 主要内容区 */
.container {
    max-width: 1200px;
    margin: 100px auto 50px auto; /* 留出导航栏的空间 */
    display: grid;
    grid-template-columns: 1fr 3fr;
    gap: 20px;
}

/* 侧边导航样式 */
.sidebar {
    position: sticky;
    top: 100px; /* 与导航栏高度保持一致 */
    background-color: rgba(0, 0, 0, 0.7);
    padding: 20px;
    border-radius: 8px;
}

.sidebar ul {
    list-style: none;
}

.sidebar li {
    margin-bottom: 15px;
}

.sidebar a {
    color: #00ffcc;
    font-size: 14px;
}

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

article pre {
    background-color: #1b263b;
    padding: 15px;
    border-radius: 5px;
    overflow-x: auto;
    margin-bottom: 20px;
}

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

/* 图片样式 */
img.decorative {
    width: 100%;
    height: auto;
    border-radius: 10px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.5);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

img.decorative:hover {
    transform: scale(1.05); /* 悬停时放大 */
    box-shadow: 0 8px 20px rgba(0, 255, 204, 0.7);
}

/* 提示信息样式 */
.reference {
    background-color: #00aaff;
    color: #ffffff;
    padding: 15px;
    border-radius: 5px;
    text-align: center;
    margin-bottom: 30px;
    font-size: 18px;
    font-weight: bold;
}

/* 折叠区域样式 */
.collapsible {
    background-color: #415a77;
    color: #e0e1dd;
    cursor: pointer;
    padding: 10px;
    width: 100%;
    border: none;
    text-align: left;
    outline: none;
    font-size: 16px;
    border-radius: 5px;
    transition: background-color 0.3s ease;
}

.collapsible:hover {
    background-color: #778da9;
}

.content {
    padding: 0 15px;
    display: none;
    overflow: hidden;
    background-color: rgba(0, 0, 0, 0.6);
    border-radius: 5px;
    margin-bottom: 20px;
}

/* 底部区域样式 */
.footer {
    background-color: #1b263b;
    color: #e0e1dd;
    padding: 30px 50px;
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
}

.footer-section {
    flex: 1;
    margin: 10px;
}

.footer-section h4 {
    color: #00aaff;
    margin-bottom: 15px;
}

.footer-section ul {
    list-style: none;
}

.footer-section li {
    margin-bottom: 10px;
}

.footer-section a {
    color: #e0e1dd;
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-section a:hover {
    color: #00ffcc;
}

/* 响应式设计 */
/* 调整导航栏 */
@media (max-width: 768px) {
    .container {
        grid-template-columns: 1fr;
    }

    .sidebar {
        display: none; /* 移动设备隐藏侧边导航 */
    }

    .navbar ul {
        flex-direction: column;
        align-items: center;
    }

    .navbar li {
        margin: 10px 0;
    }
}

/* 调整字体大小 */
@media (max-width: 480px) {
    h1 {
        font-size: 1.8em;
    }

    h2 {
        font-size: 1.6em;
    }

    p {
        font-size: 15px;
    }
}

/* 代码块样式 */
.code-sample {
    background-color: #1b263b;
    padding: 15px;
    border-radius: 5px;
    overflow-x: auto;
    margin-bottom: 20px;
}

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