
/* 全局样式设置 */
body {
    margin: 0;
    padding: 0;
    font-family: 'Roboto', sans-serif; /* 使用现代无衬线字体，确保易读性 */
    background: linear-gradient(135deg, #1e3c72, #2a5298, #5a3f37, #915f6d); /* 渐变极光背景 */
    color: #ffffff;
    overflow-x: hidden; /* 防止出现水平滚动条 */
}

/* 导航栏样式 */
.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    background: rgba(30, 60, 114, 0.8); /* 半透明背景 */
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 40px;
    z-index: 1000;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1); /* 细微阴影增加层次感 */
}

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

.navbar a:hover {
    color: #30cfd0; /* 悬停时颜色变化 */
}

/* 侧边导航样式 */
.sidebar {
    position: fixed;
    top: 80px;
    left: 0;
    width: 200px;
    background: rgba(41, 82, 152, 0.9);
    height: 100%;
    padding: 20px;
    box-shadow: 2px 0 5px rgba(0,0,0,0.1);
}

.sidebar a {
    display: block;
    color: #ffffff;
    text-decoration: none;
    margin: 20px 0;
    font-size: 16px;
    transition: color 0.3s ease;
}

.sidebar a:hover {
    color: #30cfd0;
}

/* 主内容区样式 */
.container {
    margin-left: 220px; /* 预留侧边导航空间 */
    padding: 100px 40px 40px 40px;
    max-width: 1200px;
    margin-right: auto;
}

h1, h2, h3, h4 {
    color: #ffffff;
    margin-bottom: 20px;
}

h2 {
    font-size: 24px;
    border-bottom: 2px solid #30cfd0;
    padding-bottom: 10px;
}

p {
    font-size: 16px;
    line-height: 1.6;
    margin-bottom: 20px;
}

/* 图片样式 */
img {
    width: 100%;
    max-width: 320px;
    border-radius: 15px; /* 圆角效果 */
    box-shadow: 0 4px 8px rgba(0,0,0,0.2); /* 阴影效果 */
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

img:hover {
    transform: scale(1.05); /* 悬停时放大 */
    box-shadow: 0 8px 16px rgba(0,0,0,0.3);
}

/* 渐变按钮样式 */
.btn-gradient {
    background: linear-gradient(45deg, #1e3c72, #2a5298);
    border: none;
    border-radius: 25px;
    color: #ffffff;
    padding: 15px 30px;
    font-size: 16px;
    cursor: pointer;
    transition: background 0.5s ease;
    text-decoration: none;
    display: inline-block;
}

.btn-gradient:hover {
    background: linear-gradient(45deg, #2a5298, #1e3c72);
}

/* 代码块样式 */
code {
    background: rgba(255, 255, 255, 0.1);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'Courier New', Courier, monospace;
}

pre code {
    display: block;
    padding: 20px;
    background: rgba(0, 0, 0, 0.7);
    border-radius: 10px;
    overflow-x: auto;
    position: relative;
    margin-bottom: 20px;
}

/* 折叠区域样式 */
.collapsible {
    background-color: rgba(30, 60, 114, 0.8);
    color: #ffffff;
    cursor: pointer;
    padding: 18px;
    width: 100%;
    border: none;
    text-align: left;
    outline: none;
    font-size: 16px;
    margin-bottom: 10px;
    border-radius: 5px;
    transition: background 0.3s ease;
}

.collapsible:hover {
    background-color: rgba(41, 82, 152, 0.9);
}

.content {
    padding: 0 18px;
    display: none;
    overflow: hidden;
    background-color: rgba(30, 60, 114, 0.5);
    border-radius: 0 0 5px 5px;
}

.content p {
    margin: 15px 0;
}

/* 章节导航样式 */
.chapter-nav {
    position: fixed;
    top: 120px;
    right: 40px;
    background: rgba(41, 82, 152, 0.9);
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

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

.chapter-nav a:hover {
    color: #30cfd0;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .sidebar {
        display: none; /* 移动设备隐藏侧边导航 */
    }
    .container {
        margin-left: 0;
        padding: 80px 20px 20px 20px;
    }
    .chapter-nav {
        position: static;
        width: 100%;
        margin-bottom: 20px;
    }
    .navbar {
        flex-direction: column;
        align-items: flex-start;
    }
    .navbar a {
        margin: 10px 0;
    }
}

