
/* 主要色彩变量定义 */
:root {
    --primary-color: #1E90FF; /* 主色调，象征科技与信任 */
    --accent-color: #FFD700; /* 点缀色，体现灵感与活力 */
    --background-color: #F5F5F5; /* 背景色，提升页面层次感 */
    --text-color: #333333; /* 文字颜色，确保可读性 */
    --secondary-color: #FFFFFF; /* 辅助色，增强模块分隔 */
}

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

body {
    font-family: 'Open Sans', sans-serif; /* 正文字体 */
    background: var(--background-color);
    color: var(--text-color);
    line-height: 1.6;
    overflow-x: hidden; /* 避免横向滚动条出现 */
}

/* 固定导航栏样式 */
.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    background-color: var(--secondary-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 40px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    z-index: 1000;
}

.navbar a {
    text-decoration: none;
    color: var(--primary-color);
    margin: 0 15px;
    font-size: 16px;
    transition: color 0.3s ease;
}

.navbar a:hover {
    color: var(--accent-color);
}

.toggle-button {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 18px;
    color: var(--primary-color);
}

/* 横幅大图样式 */
.banner {
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    height: 60vh;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    text-align: center;
    padding: 0 20px;
}

.banner h1 {
    font-family: 'Roboto', sans-serif;
    font-size: 48px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

/* 容器模块化布局 */
.container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    padding: 60px 40px;
    background-color: var(--background-color);
}

/* 单个模块样式 */
.module {
    background-color: var(--secondary-color);
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.module:hover {
    transform: translateY(-10px);
    box-shadow: 0 8px 12px rgba(0,0,0,0.2);
}

/* 图像样式设置 */
.module img {
    width: 100%;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: transform 0.3s ease;
}

.module img:hover {
    transform: scale(1.05);
}

/* 标题样式 */
h2, h3, h4 {
    font-family: 'Roboto', sans-serif;
    color: var(--primary-color);
    margin-bottom: 15px;
}

h2 {
    font-size: 28px;
}

h3 {
    font-size: 24px;
}

h4 {
    font-size: 20px;
}

/* 段落样式 */
p {
    font-size: 16px;
    margin-bottom: 15px;
    color: var(--text-color);
}

/* 代码块样式 */
pre {
    background-color: #2D2D2D;
    color: #CCCCCC;
    padding: 15px;
    border-radius: 5px;
    overflow-x: auto;
    font-family: 'Courier New', Courier, monospace;
    margin-bottom: 20px;
}

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

/* 按钮样式 */
.button {
    background-color: var(--primary-color);
    color: white;
    padding: 12px 24px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s ease, box-shadow 0.3s ease;
    font-size: 16px;
}

.button:hover {
    background-color: var(--accent-color);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

/* 响应式设计 */
@media (max-width: 768px) {
    .navbar {
        flex-direction: column;
        align-items: flex-start;
        padding: 20px;
    }

    .banner h1 {
        font-size: 32px;
    }

    .container {
        padding: 40px 20px;
    }

    .button {
        width: 100%;
        text-align: center;
    }
}

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

.module {
    opacity: 0;
    animation: fadeInUp 0.6s forwards;
}

.module:nth-child(1) {
    animation-delay: 0.2s;
}

.module:nth-child(2) {
    animation-delay: 0.4s;
}

.module:nth-child(3) {
    animation-delay: 0.6s;
}

/* 提示信息样式 */
.alert {
    background-color: var(--accent-color);
    color: white;
    padding: 15px;
    text-align: center;
    font-size: 18px;
    margin: 20px 40px;
    border-radius: 5px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* 折叠区域样式 */
.collapsible {
    background-color: var(--secondary-color);
    color: var(--primary-color);
    cursor: pointer;
    padding: 18px;
    width: 100%;
    border: none;
    text-align: left;
    outline: none;
    font-size: 18px;
    transition: background-color 0.3s ease;
    margin-bottom: 10px;
}

.active, .collapsible:hover {
    background-color: var(--primary-color);
    color: white;
}

.content {
    padding: 0 18px;
    display: none;
    overflow: hidden;
    background-color: var(--secondary-color);
    border-left: 4px solid var(--accent-color);
    margin-bottom: 10px;
}

.content p {
    margin: 10px 0;
    font-size: 16px;
    color: var(--text-color);
}

