
/* 全局样式设置 */
body {
    margin: 0;
    padding: 0;
    background-color: #1E273D; /* 主背景色 */
    color: #FFFFFF; /* 文字颜色 */
    font-family: 'Roboto', sans-serif; /* 字体设置 */
    line-height: 1.6;
    overflow-x: hidden; /* 防止出现水平滚动条 */
}

/* 导航栏样式 */
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    background-color: #1E273D; /* 导航栏背景色 */
    border-bottom: 2px solid #FF9F0A; /* 边界线 */
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1000;
}

.navbar .logo {
    font-size: 1.5em;
    color: #FFFFFF;
    text-decoration: none;
}

.navbar .menu {
    display: flex;
    gap: 20px;
}

.navbar .menu a {
    color: #FFFFFF;
    text-decoration: none;
    transition: color 0.3s ease;
}

.navbar .menu a:hover {
    color: #FF9F0A; /* 悬停颜色变化 */
}

.navbar .toggle {
    display: none;
    cursor: pointer;
    color: #FFFFFF;
    font-size: 1.5em;
}

@media (max-width: 768px) {
    .navbar .menu {
        flex-direction: column;
        display: none;
        background-color: #1E273D;
        position: absolute;
        top: 60px;
        right: 20px;
        padding: 10px;
        border-radius: 5px;
    }
    .navbar .menu.active {
        display: flex;
    }
    .navbar .toggle {
        display: block;
    }
}

/* 主要内容区样式 */
.main {
    padding: 100px 20px 40px 20px; /* 上边距预留导航栏 */
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 40px;
}

/* 版块样式 */
.section {
    background-color: #F5F5F5;
    padding: 40px;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
}

.section:nth-child(even) {
    background-color: #1E273D; /* 交替背景色 */
}

.section h2, .section h3, .section h4 {
    color: #FF9F0A; /* 标题颜色 */
}

.section p {
    color: #FFFFFF;
    font-size: 16px;
}

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

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

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

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

/* 代码块样式 */
pre {
    background-color: #2E3B55;
    padding: 20px;
    border-radius: 10px;
    overflow: auto;
}

pre code {
    color: #FFD700;
    font-family: 'Courier New', Courier, monospace;
    font-size: 14px;
}

/* 增加代码块的before样式 */
pre code::before {
    content: "代码示例：";
    color: #FF9F0A;
    display: block;
    margin-bottom: 10px;
    font-weight: bold;
}

/* 动画效果 */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animated-section {
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInUp 0.6s forwards;
}

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

/* 数据可视化图表样式 */
.bar-chart {
    display: flex;
    justify-content: space-around;
    align-items: flex-end;
    height: 300px;
    padding: 20px;
    background-color: #FFFFFF;
    border-radius: 10px;
}

.bar {
    width: 50px;
    background: linear-gradient(to top, #FF9F0A, #e68a00);
    border-radius: 5px 5px 0 0;
    height: var(--bar-height);
    position: relative;
    transition: height 0.5s ease;
}

.bar span {
    position: absolute;
    top: -25px;
    left: 50%;
    transform: translateX(-50%);
    color: #1E273D;
    font-weight: bold;
}

.bar:hover {
    background: linear-gradient(to top, #e68a00, #CC7A00);
}

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

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

.content {
    padding: 0 18px;
    display: none;
    background-color: #1E273D;
    overflow: hidden;
    border-radius: 5px;
}

.content p {
    color: #FFFFFF;
}

/* 图片容器样式 */
.image-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 20px;
}

.image-gallery img {
    width: 100%;
    height: auto;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.3);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

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