
/* 全局样式设置 */
body {
    margin: 0;
    padding: 0;
    font-family: 'Roboto', sans-serif; /* 使用Roboto字体 */
    background: linear-gradient(135deg, #0A2C4D, #6BB3E8); /* 背景渐变从深蓝到浅蓝 */
    color: #0A2C4D; /* 主文本颜色为深蓝 */
    transition: background 0.5s ease-in-out; /* 背景过渡效果 */
}

/* 顶部导航栏样式 */
.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    background-color: rgba(10, 44, 77, 0.9); /* 半透明深蓝背景 */
    display: flex;
    justify-content: space-around;
    align-items: center;
    padding: 15px 0;
    z-index: 1000;
}

.navbar a {
    color: #FFFFFF;
    text-decoration: none;
    font-size: 16px;
    padding: 10px 20px;
    border-radius: 4px;
    transition: background-color 0.3s, transform 0.3s;
}

.navbar a:hover {
    background-color: #FF9800; /* 悬停时使用亮橙色 */
    transform: scale(1.05);
}

/* 主内容区样式 */
.main-content {
    padding: 100px 20px 20px 20px; /* 顶部留白避免被导航栏遮挡 */
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr 3fr 1fr;
    grid-gap: 20px;
}

/* 侧边栏样式 */
.sidebar {
    background-color: #FFFFFF;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    padding: 20px;
    transition: transform 0.3s, box-shadow 0.3s;
}

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

.sidebar img {
    width: 100%;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    transition: transform 0.3s, box-shadow 0.3s;
}

.sidebar img:hover {
    transform: scale(1.05);
    box-shadow: 0 8px 16px rgba(0,0,0,0.2);
}

/* 文章内容样式 */
.article {
    background-color: #FFFFFF;
    border-radius: 8px;
    padding: 30px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    transition: transform 0.3s, box-shadow 0.3s;
}

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

.article h2 {
    font-size: 24px;
    color: #0A2C4D;
    margin-bottom: 20px;
    font-weight: 700;
}

.article h3 {
    font-size: 20px;
    color: #0A2C4D;
    margin-top: 30px;
    margin-bottom: 15px;
    font-weight: 700;
}

.article p {
    font-size: 16px;
    line-height: 1.6;
    color: #333333;
    margin-bottom: 15px;
}

/* 代码块样式 */
code {
    background-color: #F5F5F5;
    padding: 2px 4px;
    border-radius: 4px;
    font-family: 'Courier New', Courier, monospace;
}

pre {
    background-color: #F5F5F5;
    padding: 15px;
    border-radius: 8px;
    overflow-x: auto;
    font-family: 'Courier New', Courier, monospace;
    margin-bottom: 20px;
}

pre code {
    color: #0A2C4D;
}

/* 图片展示区样式 */
.image-gallery {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 30px;
}

.image-gallery img {
    width: 320px;
    height: 320px;
    object-fit: cover;
    border-radius: 16px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    transition: transform 0.3s, box-shadow 0.3s;
}

.image-gallery img:hover {
    transform: scale(1.05);
    box-shadow: 0 8px 16px rgba(0,0,0,0.2);
}

/* 强调文本样式 */
.highlight {
    color: #FF9800; /* 亮橙色用于强调 */
    font-weight: 700;
}

/* 章节导航样式 */
.chapter-nav {
    position: fixed;
    right: 20px;
    top: 100px;
    background-color: rgba(255, 152, 0, 0.9); /* 半透明亮橙背景 */
    padding: 10px 15px;
    border-radius: 8px;
}

.chapter-nav a {
    display: block;
    color: #FFFFFF;
    text-decoration: none;
    margin-bottom: 10px;
    font-size: 14px;
    transition: background-color 0.3s;
}

.chapter-nav a:hover {
    background-color: rgba(255, 152, 0, 1);
    border-radius: 4px;
}

/* 响应式设计 */
@media (max-width: 1200px) {
    .main-content {
        grid-template-columns: 1fr 2fr;
    }
    .chapter-nav {
        display: none; /* 小屏幕隐藏章节导航 */
    }
}

@media (max-width: 768px) {
    .main-content {
        grid-template-columns: 1fr;
    }
    .sidebar {
        display: none; /* 小屏幕隐藏侧边栏 */
    }
}

