
/* 
 * 全局样式定义
 * 设置整个网页的基础字体、颜色和背景
 */
body {
    margin: 0;
    padding: 0;
    font-family: 'Open Sans', sans-serif; /* 使用Open Sans作为正文字体 */
    color: #FFFFFF; /* 文字颜色为白色 */
    background: linear-gradient(135deg, #0D47A1 70%, #2196F3 25%, #00E676 5%); /* 使用线性渐变作为背景 */
    overflow-x: hidden; /* 禁止横向滚动 */
}

/* 
 * 顶部导航栏样式
 * 固定在页面顶部，包含主要导航链接
 */
.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    background-color: rgba(13, 71, 161, 0.9); /* 半透明深蓝色背景 */
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 30px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1); /* 添加阴影效果 */
    z-index: 1000;
}

/* 
 * 导航链接样式
 * 使用无下划线，白色文字，悬停时变色
 */
.navbar a {
    color: #FFFFFF;
    text-decoration: none;
    margin: 0 15px;
    font-size: 16px;
    transition: color 0.3s ease;
}

.navbar a:hover {
    color: #29B6F6; /* 悬停时变为电蓝色 */
}

/* 
 * 主内容区域样式
 * 为内容留出顶部导航栏的空间
 */
.main-content {
    padding-top: 80px; /* 留出导航栏的高度 */
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* 
 * 章节导航系统样式
 * 固定在左侧或顶部，帮助用户快速定位内容
 */
.chapter-nav {
    margin-bottom: 40px;
}

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

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

.chapter-nav a {
    color: #29B6F6;
    text-decoration: none;
    font-size: 18px;
    transition: color 0.3s ease;
}

.chapter-nav a:hover {
    color: #00E676; /* 悬停时变为青绿色 */
}

/* 
 * 文章内容样式
 * 使用不同的标题层级，增加视觉层次
 */
article h2 {
    font-family: 'Montserrat', sans-serif;
    font-size: 24px;
    color: #FFFFFF;
    margin-bottom: 20px;
    border-bottom: 2px solid #2196F3; /* 下边框装饰 */
    padding-bottom: 10px;
}

article h3 {
    font-family: 'Montserrat', sans-serif;
    font-size: 20px;
    color: #29B6F6;
    margin-top: 30px;
    margin-bottom: 15px;
}

article p {
    font-size: 16px;
    line-height: 1.6;
    margin-bottom: 20px;
}

/* 
 * 代码块样式
 * 区分于正文，采用深色背景和高亮字体
 */
article pre {
    background-color: #1E3A5F;
    padding: 15px;
    border-radius: 5px;
    overflow-x: auto;
    margin-bottom: 20px;
}

article code {
    color: #FFD700; /* 代码文字颜色为金色 */
    font-family: 'Courier New', Courier, monospace;
    font-size: 15px;
}

/* 
 * 图片样式
 * 圆角、阴影、悬停效果
 */
.image-container {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    justify-content: center;
    margin: 40px 0;
}

.image-container img {
    width: 320px;
    height: 320px;
    object-fit: cover;
    border-radius: 15px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.image-container img:hover {
    transform: scale(1.05); /* 放大效果 */
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.3);
}

/* 
 * 提示信息样式
 * 显著位置显示提示文字
 */
.alert {
    background-color: rgba(255, 165, 0, 0.8); /* 橙色背景 */
    color: #FFFFFF;
    text-align: center;
    padding: 20px;
    font-size: 18px;
    margin-bottom: 40px;
    border-radius: 5px;
}

/* 
 * 卡片式布局样式
 * 展示不同功能或案例
 */
.card-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

.card {
    background: linear-gradient(135deg, #2196F3, #29B6F6);
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    padding: 20px;
    transition: background 0.3s ease, transform 0.3s ease;
}

.card:hover {
    background: linear-gradient(135deg, #29B6F6, #00E676);
    transform: translateY(-10px);
}

/* 
 * 表单样式
 * 订阅和联系表单的设计
 */
.footer {
    background: rgba(13, 71, 161, 0.9);
    padding: 40px 20px;
    text-align: center;
}

.footer input[type="text"],
.footer input[type="email"],
.footer textarea {
    width: 80%;
    max-width: 500px;
    padding: 10px;
    margin: 10px 0;
    border: none;
    border-radius: 5px;
}

.footer button {
    background-color: #2196F3;
    color: #FFFFFF;
    padding: 10px 30px;
    border: none;
    border-radius: 5px;
    font-size: 16px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.footer button:hover {
    background-color: #29B6F6;
}

/* 
 * 响应式设计
 * 针对不同屏幕宽度调整布局
 */
@media (max-width: 768px) {
    .navbar {
        flex-direction: column;
        align-items: flex-start;
    }

    .chapter-nav a {
        font-size: 16px;
    }

    .image-container img {
        width: 100%;
        height: auto;
    }

    .card-container {
        grid-template-columns: 1fr;
    }
}

/* 
 * 动态粒子背景样式
 * 利用动画实现粒子移动
 */
.background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #0D47A1;
    overflow: hidden;
    z-index: -1;
}

.particle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: #29B6F6;
    border-radius: 50%;
    animation: move 10s linear infinite;
}

@keyframes move {
    from {
        transform: translate(0, 0);
    }
    to {
        transform: translate(100px, 100px);
    }
}

/* 
 * CSS3代码示例块样式
 * 与文章内容区分开，突出显示
 */
.css-example {
    background-color: #1E3A5F;
    padding: 20px;
    border-radius: 5px;
    margin: 20px 0;
}

.css-example code {
    color: #FFD700;
    font-family: 'Courier New', Courier, monospace;
    font-size: 14px;
}

/* 
 * 按钮样式
 * 用于页面中的各种按钮
 */
.button {
    background-color: #2196F3;
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    color: #FFFFFF;
    font-size: 16px;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.2s ease;
}

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

/* 
 * 总体布局样式
 * 确保页面结构清晰、有序
 */
.container {
    display: flex;
    flex-direction: column;
}

.section {
    margin-bottom: 50px;
}

.section h2 {
    font-size: 24px;
    margin-bottom: 20px;
}

.section p {
    font-size: 16px;
    line-height: 1.6;
}

/* 
 * 结束语样式
 * 页面底部的总结内容
 */
.summary {
    background-color: rgba(0, 0, 0, 0.7);
    padding: 30px;
    border-radius: 10px;
    font-size: 18px;
}

