
/* 全局样式设置 */
body {
    margin: 0;
    padding: 0;
    font-family: 'Roboto', sans-serif; /* 使用Roboto字体，保持现代感 */
    background-color: #F0F4F8; /* 背景色采用浅灰色，减少视觉疲劳 */
    color: #333333; /* 文字颜色为深灰色，确保良好可读性 */
}

/* 导航栏样式 */
.navbar {
    position: fixed; /* 固定在顶部 */
    top: 0;
    width: 100%;
    background: linear-gradient(90deg, #1E90FF 70%, #32CD32 25%, #FFA500 5%); /* 渐变色背景，70%主色，25%辅色，5%点缀色 */
    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 .logo {
    font-size: 1.8em;
    color: #ffffff; /* Logo颜色为白色，突出显示 */
    text-decoration: none;
}

.navbar .nav-links a {
    margin-left: 20px;
    color: #ffffff; /* 链接颜色为白色 */
    text-decoration: none;
    font-size: 1em;
    transition: color 0.3s ease, transform 0.3s ease; /* 过渡效果 */
}

.navbar .nav-links a:hover {
    color: #FFD700; /* 悬停时颜色变化为金色 */
    transform: scale(1.05); /* 微缩变大 */
}

/* 侧边菜单样式 */
.sidebar {
    position: fixed;
    top: 0;
    left: -250px; /* 初始隐藏 */
    width: 250px;
    height: 100%;
    background-color: #1E90FF; /* 主色调背景 */
    padding-top: 60px;
    transition: left 0.3s ease; /* 动画过渡 */
}

.sidebar.active {
    left: 0; /* 显示侧边菜单 */
}

.sidebar a {
    display: block;
    padding: 15px 25px;
    color: #ffffff;
    text-decoration: none;
    font-size: 1.1em;
    transition: background 0.3s ease;
}

.sidebar a:hover {
    background-color: #32CD32; /* 悬停变为辅色 */
}

/* 主内容区域样式 */
.main-content {
    margin-top: 80px; /* 避免导航栏遮挡 */
    padding: 20px 40px;
    display: grid;
    grid-template-columns: 1fr 3fr;
    gap: 20px;
}

.main-content .sidebar-content {
    display: none; /* 在移动设备隐藏侧边内容 */
}

.main-content .content {
    background-color: #ffffff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

/* 响应式设计 */
@media (max-width: 768px) {
    .main-content {
        grid-template-columns: 1fr;
    }
    .sidebar-content {
        display: block;
    }
    .navbar .nav-links {
        display: none; /* 移动设备隐藏导航链接 */
    }
    .navbar .menu-toggle {
        display: block;
        cursor: pointer;
        color: #ffffff;
        font-size: 1.5em;
    }
}

/* 章节导航样式 */
.chapter-nav {
    margin-bottom: 20px;
}

.chapter-nav a {
    margin-right: 15px;
    color: #1E90FF;
    text-decoration: none;
    font-weight: bold;
    transition: color 0.3s ease;
}

.chapter-nav a:hover {
    color: #32CD32;
}

/* 图像样式 */
.image-gallery {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin: 20px 0;
}

.image-gallery img {
    width: 100%;
    max-width: 320px;
    height: auto;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.image-gallery img:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 10px rgba(0,0,0,0.15);
}

/* 文章内容样式 */
article {
    line-height: 1.8;
    font-size: 16px;
    color: #333333;
}

article h2, article h3, article h4 {
    color: #1E90FF;
    margin-top: 20px;
}

article pre {
    background-color: #F5F5F5;
    padding: 15px;
    border-left: 5px solid #32CD32;
    overflow-x: auto;
    border-radius: 5px;
    margin: 10px 0;
}

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

/* 提示信息样式 */
.alert {
    background-color: #FFD700;
    color: #ffffff;
    padding: 10px 20px;
    text-align: center;
    font-size: 1.2em;
    border-radius: 5px;
    margin-bottom: 30px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* 更多样式 */
.footer {
    background-color: #1E90FF;
    color: #ffffff;
    text-align: center;
    padding: 20px 0;
    margin-top: 40px;
}

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

.footer a:hover {
    color: #32CD32;
}

/* 动画效果 */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.fade-in {
    animation: fadeIn 2s ease-in;
}

