
/* 
整体页面样式设计
采用深蓝色和绿色为主色调，结合中性色调，营造科技与自然相融合的高级感页面。
*/

/* 通用样式重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* 设置页面背景，使用线性渐变，从深蓝色到绿色 */
body {
    font-family: 'Open Sans', sans-serif; /* 设置全局字体 */
    background: linear-gradient(135deg, #0A74DA, #34A853); /* 渐变背景 */
    color: #333333; /* 全局文字颜色 */
    line-height: 1.6;
}

/* 固定导航栏样式 */
nav {
    position: fixed;
    top: 0;
    width: 100%;
    background-color: rgba(10, 116, 218, 0.9); /* 半透明深蓝色背景 */
    display: flex;
    justify-content: space-around; /* 导航项均匀分布 */
    align-items: center;
    padding: 15px 0;
    z-index: 1000; /* 确保导航栏在最上层 */
    box-shadow: 0 2px 4px rgba(0,0,0,0.1); /* 导航栏阴影 */
}

/* 导航链接样式 */
nav a {
    color: #ffffff; /* 白色文字 */
    text-decoration: none; /* 去除下划线 */
    font-size: 16px; /* 文字大小 */
    transition: color 0.3s ease; /* 颜色过渡效果 */
}

/* 导航链接悬停效果 */
nav a:hover {
    color: #34A853; /* 辅色绿色 */
}

/* 页面的主要容器，考虑顶部导航栏的高度 */
.container {
    padding-top: 80px; /* 与导航栏高度相匹配 */
    max-width: 1200px;
    margin: 0 auto;
    padding-left: 20px;
    padding-right: 20px;
}

/* 章节导航系统样式 */
.chapter-nav {
    position: fixed;
    top: 100px;
    right: 20px;
    background-color: rgba(255, 255, 255, 0.8); /* 半透明白色背景 */
    padding: 10px;
    border-radius: 8px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}

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

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

.chapter-nav ul li a {
    color: #0A74DA;
    text-decoration: none;
    font-size: 14px;
    transition: color 0.3s ease;
}

.chapter-nav ul li a:hover {
    color: #34A853;
}

/* 主要文章内容样式 */
article {
    background-color: rgba(255, 255, 255, 0.9); /* 半透明白色背景 */
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    margin-bottom: 40px;
}

/* 文章标题样式 */
article h2 {
    font-family: 'Montserrat', sans-serif; /* 标题字体 */
    color: #0A74DA; /* 主色调 */
    font-size: 28px;
    margin-bottom: 20px;
    text-align: center;
}

/* 章节标题样式 */
article h3 {
    font-family: 'Montserrat', sans-serif;
    color: #34A853; /* 辅色 */
    font-size: 22px;
    margin-top: 30px;
    margin-bottom: 15px;
}

/* 文章段落样式 */
article p {
    font-size: 16px;
    color: #333333;
    margin-bottom: 15px;
    line-height: 1.8;
}

/* 代码块样式 */
article pre {
    background-color: #F1F3F5; /* 浅灰背景 */
    padding: 15px;
    border-radius: 8px;
    overflow-x: auto;
    margin-bottom: 20px;
}

article code {
    font-family: 'Courier New', Courier, monospace; /* 等宽字体 */
    color: #D6336C; /* 代码颜色 */
}

/* 图片样式 */
img.decorative {
    width: 100%;
    max-width: 320px;
    height: auto;
    border-radius: 12px; /* 圆角 */
    box-shadow: 0 4px 6px rgba(0,0,0,0.1); /* 阴影效果 */
    transition: transform 0.3s ease, box-shadow 0.3s ease; /* 过渡效果 */
    margin: 20px auto;
    display: block;
}

img.decorative:hover {
    transform: scale(1.05); /* 悬停放大 */
    box-shadow: 0 6px 10px rgba(0,0,0,0.15); /* 阴影加强 */
}

/* 按钮样式 */
.btn {
    background-color: #34A853;
    color: #ffffff;
    padding: 12px 24px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
    transition: background-color 0.3s ease, transform 0.3s ease;
}

.btn:hover {
    background-color: #0A74DA;
    transform: translateY(-2px); /* 微动效 */
}

/* 响应式网格布局 */
.grid-container {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-top: 30px;
}

@media (max-width: 992px) {
    .grid-container {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .grid-container {
        grid-template-columns: 1fr;
    }
}

/* 过渡与动画效果 */
.fade-in {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

/* 按需加载元素的过渡效果 */
.lazy-load {
    opacity: 0;
    transition: opacity 1s ease-in;
}

.lazy-load.loaded {
    opacity: 1;
}

/* 按钮与图标的悬停微动效 */
.icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px;
    border-radius: 50%;
    background-color: #34A853;
    transition: background-color 0.3s ease, transform 0.3s ease;
}

.icon-btn:hover {
    background-color: #0A74DA;
    transform: scale(1.1);
}

/* 底部信息区样式 */
.footer {
    background-color: rgba(10, 116, 218, 0.9); /* 半透明深蓝背景 */
    color: #ffffff;
    padding: 30px 20px;
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    border-top: 2px solid #34A853; /* 辅助色边框 */
}

.footer a {
    color: #34A853;
    text-decoration: none;
    margin: 5px 0;
    transition: color 0.3s;
}

.footer a:hover {
    color: #ffffff;
}

/* 提示信息样式 */
.promo-banner {
    background-color: rgba(52, 168, 83, 0.8); /* 半透明绿色 */
    color: #ffffff;
    text-align: center;
    padding: 20px;
    margin: 20px 0;
    border-radius: 8px;
    font-size: 18px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* 关键帧动画示例 */
@keyframes drawChart {
    from { stroke-dashoffset: 1000; }
    to { stroke-dashoffset: 0; }
}

/* 图表线条动画 */
.chart-line {
    stroke-dasharray: 1000;
    animation: drawChart 2s ease-in-out forwards;
}

/* 懒加载图片样式 */
img.lazy {
    opacity: 0;
    transition: opacity 1s ease-in;
}

img.lazy.loaded {
    opacity: 1;
}

/* 自定义样式区分代码示例部分 */
.code-example {
    background-color: #f9f9f9;
    border-left: 4px solid #0A74DA;
    padding: 15px;
    margin: 20px 0;
    font-family: 'Courier New', Courier, monospace;
    overflow-x: auto;
}

.code-example code {
    color: #D6336C;
}

/* 折叠内容样式 */
.collapsible {
    background-color: #34A853;
    color: white;
    cursor: pointer;
    padding: 10px;
    width: 100%;
    border: none;
    text-align: left;
    outline: none;
    font-size: 16px;
    border-radius: 5px;
    margin-top: 20px;
    transition: background-color 0.3s ease;
}

.collapsible:hover {
    background-color: #0A74DA;
}

.content {
    padding: 0 15px;
    display: none;
    overflow: hidden;
    background-color: #f1f1f1;
    border-radius: 5px;
    margin-bottom: 20px;
}

.content p {
    color: #333333;
    font-size: 15px;
    line-height: 1.6;
}

