
/* 基本样式初始化 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* 设置全局字体和背景 */
body {
    font-family: 'Roboto', sans-serif; /* 采用现代无衬线字体 */
    background: linear-gradient(135deg, #1e3c72, #2a5298); /* 主背景渐变色 */
    color: #ffffff; /* 全局文字颜色为白色 */
    line-height: 1.6;
    padding: 20px;
}

/* 导航栏样式 */
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: rgba(42, 82, 152, 0.9); /* 半透明导航栏背景 */
    padding: 15px 30px;
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1000;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1); /* 导航栏阴影效果 */
}

.navbar-logo {
    font-size: 1.8em;
    font-weight: bold;
    color: #ff7e5f; /* 点缀色用于品牌标志 */
    text-decoration: none;
}

.navbar-menu {
    display: flex;
    gap: 25px;
}

.navbar-menu a {
    color: #ffffff;
    text-decoration: none;
    font-size: 1em;
    transition: color 0.3s ease, transform 0.3s ease; /* 过渡效果 */
}

.navbar-menu a:hover {
    color: #feb47b; /* 悬停时颜色变换 */
    transform: scale(1.05); /* 放大效果 */
}

/* 主内容区样式 */
.main-content {
    margin-top: 80px; /* 留出固定导航栏的空间 */
    display: grid;
    grid-template-columns: 1fr 3fr;
    gap: 40px;
}

/* 侧边栏导航样式 */
.sidebar {
    position: sticky;
    top: 100px;
    background-color: rgba(42, 82, 152, 0.8);
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

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

.sidebar a:hover {
    color: #feb47b;
}

/* 文章内容区样式 */
.article-content {
    background-color: rgba(255, 255, 255, 0.1); /* 半透明背景 */
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.article-content h2 {
    font-size: 2em;
    margin-bottom: 20px;
    color: #ff7e5f; /* 点缀色用于标题 */
}

.article-content h3 {
    font-size: 1.6em;
    margin-top: 25px;
    margin-bottom: 15px;
    color: #feb47b;
}

.article-content p {
    font-size: 1.05em;
    margin-bottom: 20px;
    text-align: justify;
}

.article-content pre {
    background-color: rgba(0,0,0,0.2);
    padding: 15px;
    border-radius: 5px;
    overflow-x: auto;
    margin-bottom: 20px;
}

.article-content code {
    color: #ff7e5f; /* 代码颜色点缀 */
    font-family: 'Courier New', Courier, monospace;
}

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

.article-content img:hover {
    transform: scale(1.05);
    box-shadow: 0 8px 12px rgba(0,0,0,0.4);
}

/* 表格样式 */
.article-content table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
}

.article-content th, .article-content td {
    border: 1px solid #ffffff;
    padding: 10px;
    text-align: left;
}

.article-content th {
    background-color: rgba(255, 126, 95, 0.8);
    color: #ffffff;
}

.article-content tr:nth-child(even) {
    background-color: rgba(42, 82, 152, 0.5);
}

/* 代码示例区 */
.code-example {
    background-color: rgba(0,0,0,0.2);
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 30px;
}

.code-example pre {
    background-color: transparent;
    padding: 0;
    border: none;
    overflow: visible;
}

.code-example code {
    background-color: #2a5298;
    color: #ffffff;
    padding: 10px;
    display: block;
    border-radius: 5px;
    font-size: 0.95em;
}

/* 提示信息样式 */
.alert {
    background-color: rgba(255, 126, 95, 0.9);
    color: #ffffff;
    padding: 15px;
    border-radius: 10px;
    text-align: center;
    margin-bottom: 40px;
    font-size: 1.2em;
}

/* 图片容器样式 */
.image-gallery {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    justify-content: center;
}

/* 分隔线样式 */
.section-divider {
    border-top: 2px solid #feb47b;
    margin: 40px 0;
}

/* 响应式设计 */
@media (max-width: 1200px) {
    .main-content {
        grid-template-columns: 1fr 2fr;
    }
}

@media (max-width: 992px) {
    .main-content {
        grid-template-columns: 1fr;
    }

    .navbar-menu {
        display: none; /* 移动端隐藏菜单 */
    }

    .sidebar {
        position: static;
        box-shadow: none;
        background-color: transparent;
    }
}

@media (max-width: 768px) {
    body {
        padding: 10px;
    }

    .article-content h2 {
        font-size: 1.75em;
    }

    .article-content h3 {
        font-size: 1.4em;
    }

    .navbar {
        padding: 10px 20px;
    }
}

