
/* 全局样式设置 */
body {
    margin: 0;
    padding: 0;
    font-family: 'Roboto', sans-serif; /* 使用现代无衬线字体，确保可读性 */
    background-color: #000000; /* 主背景色为黑色，营造深邃科技感 */
    color: #FFFFFF; /* 文字颜色设为白色，突出显示内容 */
    line-height: 1.6; /* 设置合理的行高，提升阅读体验 */
}

/* 定义CSS变量，便于统一管理颜色和字体 */
:root {
    --main-color: #0D47A1; /* 深蓝色，作为主色调 */
    --secondary-color: #1A237E; /* 深紫色，作为辅助色 */
    --accent-color: #FF5722; /* 橙色，作为点缀色 */
    --highlight-color: #00BCD4; /* 霓虹蓝，增强视觉效果 */
    --text-color: #FFFFFF; /* 文字主色 */
}

/* 固定导航栏样式 */
.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: 10px 20px;
    z-index: 1000; /* 确保导航栏在最上层 */
    box-shadow: 0 2px 4px rgba(0,0,0,0.5); /* 添加阴影，提升层次感 */
}

.navbar a {
    color: var(--text-color);
    text-decoration: none;
    margin: 0 15px;
    font-size: 16px;
    transition: color 0.3s ease;
}

.navbar a:hover {
    color: var(--highlight-color); /* 悬停时变为霓虹蓝，增强互动反馈 */
}

/* 菜单切换按钮样式，适用于移动设备 */
.menu-toggle {
    display: none;
    flex-direction: column;
    cursor: pointer;
}

.menu-toggle div {
    width: 25px;
    height: 3px;
    background-color: var(--text-color);
    margin: 4px 0;
    transition: all 0.3s ease;
}

/* 侧边菜单样式 */
.side-menu {
    position: fixed;
    top: 0;
    right: -250px; /* 初始时隐藏在视窗外 */
    width: 250px;
    height: 100%;
    background-color: var(--secondary-color);
    transition: right 0.3s ease;
    z-index: 1001; /* 高于导航栏 */
    display: flex;
    flex-direction: column;
}

.side-menu.open {
    right: 0; /* 当添加open类时，菜单滑入视窗 */
}

.side-menu a {
    color: var(--text-color);
    padding: 15px 20px;
    text-decoration: none;
    transition: background-color 0.3s ease;
}

.side-menu a:hover {
    background-color: var(--main-color); /* 悬停时变为主色调 */
}

/* 主内容区域样式 */
.main-content {
    margin-top: 60px; /* 留出导航栏空间 */
    padding: 20px;
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
}

/* 显示“这是一个网页样式设计参考”提示 */
.reference-note {
    text-align: center;
    font-size: 18px;
    color: var(--highlight-color);
    margin-bottom: 30px;
    font-weight: bold;
}

/* 文章样式 */
article {
    background-color: #1E1E1E; /* 深色背景，突出内容 */
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.5); /* 添加阴影，提升层次感 */
}

h2 {
    font-size: 2em;
    color: var(--highlight-color);
    margin-bottom: 20px;
}

h3 {
    font-size: 1.5em;
    color: #8E24AA; /* 紫罗兰色，作为辅助色 */
    margin-bottom: 15px;
}

p {
    font-size: 1em;
    margin-bottom: 15px;
}

/* 代码块样式，增强可读性 */
pre {
    background-color: #212121;
    padding: 15px;
    border-radius: 5px;
    overflow-x: auto;
    margin-bottom: 15px;
}

code {
    color: #FFEB3B; /* 黄色，突出代码内容 */
    font-family: 'Courier New', Courier, monospace;
    font-size: 15px;
}

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

img.decorative:hover {
    transform: scale(1.05); /* 悬停时微微放大 */
    box-shadow: 0 8px 12px rgba(0,0,0,0.7); /* 增强阴影效果 */
}

/* 按钮样式 */
.button {
    background-color: var(--accent-color);
    color: var(--text-color);
    padding: 15px 30px;
    border: none;
    border-radius: 5px;
    transition: background-color 0.3s ease, transform 0.3s ease;
    cursor: pointer;
    font-size: 16px;
}

.button:hover {
    background-color: #E64A19; /* 橙色加深 */
    transform: scale(1.05); /* 放大效果 */
}

/* 动画效果 */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    opacity: 0;
    animation: fadeInUp 1s forwards;
}

.fade-in.visible {
    opacity:1;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .navbar a {
        display: none; /* 隐藏导航链接 */
    }
    .menu-toggle {
        display: flex; /* 显示菜单切换按钮 */
    }
}

@media (max-width: 480px) {
    h2 {
        font-size: 1.8em;
    }
    h3 {
        font-size: 1.3em;
    }
    p {
        font-size: 0.9em;
    }
    .button {
        padding: 10px 20px;
        font-size: 14px;
    }
}

