
/* 基础样式设置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* 设置网页背景颜色，采用渐变色增加层次感 */
body {
    font-family: 'Roboto', sans-serif; /* 使用Roboto字体，提升可读性 */
    background: linear-gradient(135deg, #e0f7fa 0%, #ffffff 100%); /* 主色调为蓝色与白色渐变 */
    color: #333333; /* 正文字体颜色 */
    line-height: 1.6;
    padding: 20px;
}

/* 导航栏样式 */
.navbar {
    position: fixed; /* 固定在顶部 */
    top: 0;
    left: 0;
    width: 100%;
    background-color: #003366; /* 主色调蓝色 */
    color: #ffffff;
    display: flex;
    justify-content: space-around;
    align-items: center;
    padding: 15px 0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1); /* 导航栏阴影 */
    z-index: 1000;
    transition: background-color 0.3s ease;
}

.navbar:hover {
    background-color: #002244; /* 悬停时颜色加深 */
}

/* 导航链接样式 */
.navbar a {
    color: #ffffff;
    text-decoration: none;
    font-size: 16px;
    transition: color 0.3s ease;
}

.navbar a:hover {
    color: #FFA500; /* 点缀色橙色 */
}

/* 侧边栏样式 */
.sidebar {
    position: fixed;
    left: 0;
    top: 60px; /* 导航栏下方 */
    width: 200px;
    background-color: #f4f4f4; /* 辅助色浅灰 */
    padding: 20px;
    box-shadow: 2px 0 5px rgba(0,0,0,0.1);
    transition: transform 0.3s ease;
}

.sidebar:hover {
    transform: translateX(10px); /* 悬停时轻微移动 */
}

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

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

/* 主要内容区 */
.main-content {
    margin-left: 220px; /* 侧边栏宽度 + 一些间隔 */
    padding: 80px 20px 20px 20px; /* 顶部留出导航栏空间 */
    max-width: 1200px;
    margin: auto;
}

/* 文章标题样式 */
.main-content h2, .main-content h3, .main-content h4 {
    color: #003366;
    margin-bottom: 15px;
}

.main-content h2 {
    font-size: 2em;
    border-bottom: 2px solid #FFA500;
    padding-bottom: 10px;
}

.main-content h3 {
    font-size: 1.5em;
    margin-top: 30px;
}

.main-content h4 {
    font-size: 1.2em;
    margin-top: 20px;
}

/* 段落样式 */
.main-content p {
    font-size: 16px;
    margin-bottom: 20px;
    text-align: justify;
}

/* 强调文本样式 */
.main-content span {
    font-weight: bold;
}

/* 代码块样式 */
.main-content pre {
    background: #f0f0f0;
    padding: 15px;
    border-radius: 8px;
    overflow-x: auto;
    margin-bottom: 20px;
    font-size: 14px;
    position: relative;
}

.main-content pre code {
    font-family: 'Courier New', Courier, monospace;
    color: #d63384;
}

/* 添加代码块的背景和阴影效果 */
.main-content pre {
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

/* 图片样式设置，添加圆角和阴影 */
.main-content img {
    max-width: 650px; /* 最大宽度限制 */
    width: 100%;
    height: auto;
    border-radius: 12px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    margin: 20px 0;
    display: block;
}

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

.main-content table, .main-content th, .main-content td {
    border: 1px solid #dddddd;
}

.main-content th, .main-content td {
    padding: 12px;
    text-align: left;
}

.main-content th {
    background-color: #003366;
    color: #ffffff;
}

.main-content tr:nth-child(even) {
    background-color: #f9f9f9;
}

/* 按钮样式 */
.button {
    background-color: #FFA500;
    color: #ffffff;
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.3s ease;
    font-size: 16px;
    margin: 10px 0;
}

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

/* 加载指示器样式 */
.loader {
    border: 8px solid #f3f3f3;
    border-top: 8px solid #003366;
    border-radius: 50%;
    width: 60px;
    height: 60px;
    animation: spin 2s linear infinite;
    margin: 40px auto;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* 动画效果：淡入 */
.fade-in {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 1s ease-out, transform 1s ease-out;
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

/* 响应式设计：调整导航栏和侧边栏 */
@media (max-width: 768px) {
    .navbar {
        flex-direction: column;
    }
    
    .sidebar {
        display: none;
    }
    
    .main-content {
        margin-left: 0;
        padding: 100px 10px 10px 10px;
    }
}

/* 提示信息样式 */
.reference-note {
    background-color: #FFF8E1;
    border-left: 6px solid #FFA500;
    padding: 10px 20px;
    margin: 20px 0;
    font-size: 16px;
}

/* 折叠区域样式 */
.collapsible {
    background-color: #e0f7fa;
    color: #003366;
    cursor: pointer;
    padding: 10px;
    width: 100%;
    border: none;
    text-align: left;
    outline: none;
    font-size: 16px;
    margin-top: 20px;
    border-radius: 4px;
    transition: background-color 0.3s ease;
}

.collapsible:hover {
    background-color: #b2ebf2;
}

.collapsible:after {
    content: '\002B'; /* 加号符号 */
    font-size: 13px;
    float: right;
}

.collapsible.active:after {
    content: "\2212"; /* 减号符号 */
}

.content {
    padding: 0 18px;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
    background-color: #f1f1f1;
    border-radius: 4px;
    margin-bottom: 20px;
}

/* 代码高亮样式 */
.highlight-code {
    background-color: #2d2d2d;
    color: #f8f8f2;
    padding: 15px;
    border-radius: 8px;
    font-family: 'Courier New', Courier, monospace;
    overflow-x: auto;
    margin-bottom: 20px;
}

/* 点缀色设置 */
.highlight-orange {
    color: #FFA500;
}

/* 图片悬停效果 */
.main-content img:hover {
    transform: scale(1.05);
    transition: transform 0.3s ease;
}

/* 页脚样式 */
.footer {
    text-align: center;
    padding: 20px 0;
    margin-top: 40px;
    border-top: 1px solid #dddddd;
    color: #666666;
    font-size: 14px;
}

