
/* 全局样式设置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* 设定主体字体和背景 */
body {
    font-family: 'Roboto', sans-serif; /* 使用现代无衬线字体 */
    font-size: 16px; /* 基础字体大小 */
    line-height: 1.6; /* 行高 */
    color: #333333; /* 文字颜色 */
    background: linear-gradient(135deg, #0d47a1, #1976d2, #42a5f5); /* 主背景渐变 */
    overflow-x: hidden; /* 禁止水平滚动 */
}

/* 导航栏样式 */
nav {
    position: fixed;
    top: 0;
    width: 100%;
    background: rgba(13, 71, 161, 0.9); /* 半透明深蓝背景 */
    padding: 20px;
    display: flex;
    justify-content: center;
    z-index: 1000;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1); /* 阴影效果 */
}

nav a {
    color: #ffffff;
    text-decoration: none;
    margin: 0 15px;
    position: relative;
    font-size: 18px;
    transition: color 0.3s ease;
}

nav a:hover {
    color: #00c853; /* 悬停颜色变化 */
}

nav a::after {
    content: '';
    display: block;
    width: 0;
    height: 2px;
    background: #00c853;
    transition: width 0.3s;
    position: absolute;
    bottom: -5px;
    left: 0;
}

nav a:hover::after {
    width: 100%;
}

/* 主内容容器样式 */
.container {
    max-width: 1200px;
    margin: 100px auto 50px auto; /* 顶部留出导航栏空间 */
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 40px;
}

/* 文章标题样式 */
article h2 {
    font-size: 24px;
    color: #0d47a1;
    margin-bottom: 20px;
}

/* 文章副标题样式 */
article h3 {
    font-size: 20px;
    color: #1976d2;
    margin: 15px 0;
}

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

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

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

/* 图片样式 */
img {
    width: 100%;
    max-width: 320px;
    border-radius: 12px; /* 圆角效果 */
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2); /* 阴影效果 */
    transition: transform 0.3s, box-shadow 0.3s;
}

img:hover {
    transform: scale(1.05); /* 悬停放大效果 */
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.3); /* 阴影增强 */
}

/* 模块化设计样式 */
.module {
    background: #ffffff;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.module.visible {
    opacity: 1;
    transform: translateY(0);
}

/* 背景动画样式 */
.svg-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
}

.svg-background svg {
    animation: move 20s linear infinite;
}

@keyframes move {
    0% { transform: translateX(0); }
    100% { transform: translateX(-100%); }
}

/* 卡片式布局样式 */
.card {
    background: #ffffff;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    padding: 20px;
    max-width: 400px;
    width: 100%;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
    transform: translateY(-10px);
    box-shadow: 0 8px 12px rgba(0, 0, 0, 0.2);
}

/* 响应式布局 */
@media (max-width: 768px) {
    nav {
        flex-direction: column;
        align-items: center;
    }

    nav a {
        margin: 10px 0;
    }

    .container {
        margin: 80px auto 20px auto;
    }

    .card {
        max-width: 100%;
        margin: 10px 0;
    }
}

/* 回到顶部按钮样式 */
.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: #0d47a1;
    color: #ffffff;
    padding: 10px 15px;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
    transition: background 0.3s ease, transform 0.3s ease;
    display: none;
}

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

/* 点缀色样式 */
.accent-gradient {
    background: linear-gradient(45deg, #00c853, #ff6d00);
    color: #ffffff;
    padding: 10px 20px;
    border-radius: 8px;
    display: inline-block;
    margin-bottom: 20px;
}

/* 高亮字体样式 */
.text-primary {
    color: #0d47a1;
}

.text-secondary {
    color: #42a5f5;
}

/* 折叠区域样式 */
.collapsible {
    background: #f5f5f5;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 20px;
    cursor: pointer;
    transition: background 0.3s ease;
}

.collapsible:hover {
    background: #e0e0e0;
}

.collapsible-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.collapsible.active .collapsible-content {
    max-height: 500px;
}

/* 提示信息样式 */
.prompt {
    text-align: center;
    font-size: 20px;
    color: #ffffff;
    margin-bottom: 40px;
    padding: 20px;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 8px;
}

/* 动态交互效果 */
@keyframes flow {
    0% { transform: translateY(0); }
    50% { transform: translateY(-20px); }
    100% { transform: translateY(0); }
}

.grid-item {
    width: 100%;
    padding-top: 100%;
    background: #42a5f5;
    animation: flow 5s linear infinite;
}

