
/* 设置全局字体与基础样式 */
body {
    margin: 0;
    padding: 0;
    font-family: 'Roboto', sans-serif; /* 使用现代无衬线字体 */
    background: linear-gradient(135deg, #0f2027, #203a43, #2c5364); /* 深蓝色渐变背景 */
    color: #ffffff; /* 白色文字 */
    line-height: 1.6;
    overflow-x: hidden; /* 避免出现左右滚动条 */
}

/* 固定顶部导航栏样式 */
.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    background: rgba(32, 58, 67, 0.8); /* 半透明背景 */
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 60px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
    z-index: 1000; /* 确保导航栏在最上层 */
}

.navbar a {
    color: #00ffff; /* 霓虹蓝色链接 */
    text-decoration: none;
    margin: 0 20px;
    font-size: 16px;
    transition: color 0.3s ease;
}

.navbar a:hover {
    color: #00ff00; /* 悬停时变为绿色 */
}

/* 主要内容区域样式 */
.container {
    padding: 100px 50px 50px 50px; /* 顶部留出导航栏空间 */
    max-width: 1200px;
    margin: 0 auto;
}

/* 章节导航系统样式 */
.chapter-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 40px;
}

.chapter-nav a {
    background: #203a43;
    padding: 10px 20px;
    border-radius: 5px;
    color: #00ffff;
    text-decoration: none;
    transition: background 0.3s ease, color 0.3s ease;
}

.chapter-nav a:hover {
    background: #00ffff;
    color: #0f2027;
}

/* 文章标题样式 */
article h2 {
    font-size: 32px;
    margin-bottom: 20px;
    position: relative;
    display: inline-block;
    animation: float 3s ease-in-out infinite; /* 标题浮动动画 */
}

@keyframes float {
    0% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-10px);
    }
    100% {
        transform: translateY(0px);
    }
}

/* 子标题样式 */
article h3 {
    font-size: 24px;
    margin-top: 40px;
    color: #00ffff;
    position: relative;
}

article h3::after {
    content: '';
    width: 50px;
    height: 4px;
    background: #00ffff;
    position: absolute;
    left: 0;
    bottom: -10px;
}

/* 段落样式 */
article p {
    font-size: 17px;
    margin-bottom: 20px;
}

/* 代码块样式，区分文章内容 */
article pre {
    background: rgba(255, 255, 255, 0.1);
    padding: 15px;
    border-radius: 8px;
    overflow-x: auto;
    position: relative;
    margin-bottom: 20px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

article code {
    font-family: 'Courier New', Courier, monospace;
    color: #00ff00;
    font-size: 16px;
}

/* 图片装饰样式 */
.decorative-image {
    width: 100%;
    max-width: 320px;
    border-radius: 15px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    margin: 20px 0;
}

.decorative-image:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.5);
}

/* 磨砂玻璃效果的内容区块 */
.glass-effect {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
    margin: 40px 0;
}

/* 响应式网格布局 */
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}

/* 按钮样式 */
.button {
    background: #00ffff;
    color: #0f2027;
    padding: 10px 25px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background 0.3s ease, transform 0.3s ease;
    font-size: 16px;
}

.button:hover {
    background: #00ff00;
    transform: translateY(-5px);
}

/* 加载动画样式 */
.loader {
    border: 8px solid rgba(255, 255, 255, 0.1);
    border-top: 8px solid #00ffff;
    border-radius: 50%;
    width: 60px;
    height: 60px;
    animation: spin 1s linear infinite;
    margin: 50px auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 页脚样式 */
.footer {
    background: rgba(32, 58, 67, 0.9);
    padding: 30px 60px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}

.footer a {
    color: #00ffff;
    text-decoration: none;
    margin: 0 15px;
    transition: color 0.3s ease;
}

.footer a:hover {
    color: #00ff00;
}

.footer .links {
    display: flex;
    align-items: center;
}

/* CSS 代码示例样式 */
.code-example {
    background: #1e1e1e;
    padding: 15px;
    border-radius: 8px;
    overflow-x: auto;
    margin: 30px 0;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.code-example code {
    color: #d4d4d4;
    font-family: 'Courier New', Courier, monospace;
    font-size: 16px;
}

/* 这是一个网页样式设计参考的提示样式 */
.reference-banner {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    color: #ffffff;
    text-align: center;
    padding: 20px;
    font-size: 18px;
    position: relative;
    z-index: 500;
    margin-bottom: 40px;
    border-radius: 10px;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
}

/* 响应式设计的媒体查询 */
@media (max-width: 1200px) {
    .navbar {
        padding: 15px 30px;
    }

    .chapter-nav a {
        margin: 5px;
        padding: 8px 15px;
        font-size: 14px;
    }

    .container {
        padding: 100px 30px 30px 30px;
    }
}

@media (max-width: 768px) {
    .navbar a {
        margin: 0 10px;
        font-size: 14px;
    }

    .chapter-nav {
        flex-direction: column;
        align-items: flex-start;
    }

    .chapter-nav a {
        width: 100%;
        text-align: center;
    }

    .decorative-image {
        max-width: 100%;
    }

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

    .footer .links {
        margin-top: 20px;
    }
}

/* 动态背景样式 */
.dynamic-background {
    position: relative;
    width: 100%;
    height: 100vh;
    overflow: hidden;
    background: linear-gradient(135deg, #0f2027, #2c5364);
}

.dynamic-background::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: url('data-flow.svg') repeat;
    animation: rotateBackground 60s linear infinite;
    opacity: 0.3;
}

@keyframes rotateBackground {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

