
/* 全局样式设置 */
body {
    margin: 0;
    padding: 0;
    font-family: 'Helvetica Neue', sans-serif; /* 使用现代无衬线字体 */
    font-size: 16px; /* 正文字号 */
    color: #FFFFFF; /* 文字颜色为白色 */
    background: linear-gradient(to bottom, #1E2740, #2E3A5F); /* 主背景色采用深蓝色渐变 */
    line-height: 1.6;
}

/* 顶部导航栏样式 */
.header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background-color: rgba(30, 39, 64, 0.9); /* 半透明背景 */
    padding: 20px;
    z-index: 1000;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header .logo {
    font-size: 24px;
    font-weight: bold;
}

.header nav a {
    color: #FFA726; /* 辅助色应用于导航链接 */
    text-decoration: none;
    margin: 0 15px;
    transition: color 0.3s ease;
}

.header nav a:hover {
    color: #4CAF50; /* 点缀色在悬停时变化 */
}

/* 主容器样式 */
.container {
    display: flex;
    margin-top: 80px; /* 为固定顶部导航留出空间 */
}

/* 侧边导航栏样式 */
.sidebar {
    width: 250px;
    background-color: #1E2740;
    padding: 20px;
    position: fixed;
    height: 100%;
    overflow-y: auto;
}

.sidebar a {
    display: block;
    color: #FFFFFF;
    text-decoration: none;
    margin: 10px 0;
    padding: 10px;
    border-left: 4px solid transparent;
    transition: border-left 0.3s ease, background-color 0.3s ease;
}

.sidebar a:hover {
    border-left: 4px solid #FFA726;
    background-color: rgba(255, 167, 38, 0.1);
}

/* 内容区域样式 */
.content {
    margin-left: 270px; /* 侧边导航宽度 + padding */
    padding: 20px;
    flex: 1;
    background-color: rgba(46, 58, 95, 0.8); /* 半透明背景 */
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
}

/* 章节标题样式 */
.content h2, .content h3, .content h4 {
    color: #FFA726;
    margin-top: 40px;
    margin-bottom: 20px;
}

.content h2 {
    font-size: 24px;
}

.content h3 {
    font-size: 20px;
}

.content h4 {
    font-size: 18px;
}

/* 段落和图片样式 */
.content p {
    margin-bottom: 20px;
    font-size: 16px;
}

.content img {
    width: 100%;
    max-width: 320px;
    height: auto;
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    margin: 20px 0;
}

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

/* 提示信息样式 */
.alert {
    background-color: #FFA726;
    color: #1E2740;
    padding: 15px;
    border-radius: 5px;
    text-align: center;
    font-size: 18px;
    margin-bottom: 30px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

/* 卡片模块样式 */
.card {
    background-color: #2E3A5F;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.2);
    margin-bottom: 20px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
    transform: translateY(-10px);
    box-shadow: 0 10px 15px rgba(0,0,0,0.3);
}

/* 渐变分隔线样式 */
.separator {
    height: 2px;
    background: linear-gradient(to right, #FFA726, #4CAF50);
    margin: 40px 0;
    border: none;
}

/* 按钮样式 */
.button-primary {
    background-color: #FFA726;
    color: #FFFFFF;
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: transform 0.2s ease, background-color 0.3s ease;
}

.button-primary:hover {
    transform: scale(1.05);
    background-color: #FF9800;
}

/* 代码示例样式 */
.code-sample {
    background-color: #1E2740;
    padding: 15px;
    border-radius: 5px;
    overflow-x: auto;
    margin: 20px 0;
    font-family: 'Courier New', monospace;
}

.code-sample code {
    color: #4CAF50;
}

/* 媒体查询实现响应式设计 */
@media (max-width: 768px) {
    .sidebar {
        width: 200px;
    }

    .content {
        margin-left: 220px;
    }

    .header {
        flex-direction: column;
        align-items: flex-start;
    }

    .header nav a {
        margin: 5px 0;
    }

    .content h2 {
        font-size: 22px;
    }

    .content h3 {
        font-size: 18px;
    }

    .content h4 {
        font-size: 16px;
    }
}

@media (max-width: 480px) {
    .sidebar {
        display: none;
    }

    .content {
        margin-left: 0;
        padding: 10px;
    }

    .content img {
        max-width: 100%;
    }

    .header {
        padding: 10px;
    }

    .alert {
        font-size: 16px;
    }
}

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

.content {
    animation: fadeIn 1s ease-in;
}

/* 导航链接悬停效果 */
.sidebar a:hover {
    background-color: rgba(255, 167, 38, 0.2);
    color: #FFFFFF;
}

