
/* 全局字体与背景设置 */
body {
    margin: 0;
    padding: 0;
    font-family: 'Roboto', sans-serif; /* 使用现代无衬线字体 */
    background: linear-gradient(135deg, #1e3c72, #2a5298, #5b247a); /* 渐变极光背景 */
    animation: auroraAnimation 15s ease infinite; /* 背景渐变动画 */
    color: #333333; /* 主文本颜色 */
}

/* 渐变极光动画关键帧 */
@keyframes auroraAnimation {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* 导航栏样式 */
.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    background: rgba(30, 60, 114, 0.8); /* 半透明背景 */
    color: #ffffff;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 30px;
    z-index: 1000;
    transition: background 0.3s ease;
}

.navbar.scrolled {
    background: rgba(30, 60, 114, 1); /* 滚动时背景不透明 */
}

.navbar .logo {
    font-size: 1.5em;
    font-weight: bold;
}

.navbar .menu a {
    margin-left: 20px;
    text-decoration: none;
    color: #ffffff;
    font-size: 1em;
    transition: color 0.3s ease;
}

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

/* 章节导航栏样式 */
.chapter-nav {
    position: fixed;
    top: 60px;
    right: 20px;
    width: 200px;
    background: rgba(255, 255, 255, 0.9);
    padding: 20px;
    box-shadow: -2px 0 5px rgba(0,0,0,0.1);
    border-radius: 10px;
    z-index: 999;
}

.chapter-nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.chapter-nav li {
    margin-bottom: 10px;
}

.chapter-nav a {
    text-decoration: none;
    color: #2a5298;
    font-size: 0.95em;
    transition: color 0.3s ease;
}

.chapter-nav a:hover {
    color: #5b247a; /* 悬停颜色变化 */
}

/* 主要内容容器 */
.container {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    padding: 100px 40px 40px 40px; /* 顶部留出导航栏空间 */
    justify-content: center;
}

/* 卡片样式 */
.card {
    background: #ffffff;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    flex: 1 1 300px;
    padding: 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.2);
}

/* 按钮样式 */
.button-primary {
    background-color: #5b247a;
    color: #ffffff;
    border: none;
    padding: 12px 25px;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.2s ease;
    font-size: 1em;
}

.button-primary:hover {
    background-color: #2a5298; /* 悬停颜色变化 */
    transform: scale(1.05); /* 微放大效果 */
}

.button-primary:active {
    background-color: #1e3c72; /* 点击时颜色变化 */
    transform: scale(1); /* 还原尺寸 */
}

/* 图片样式 */
.image-style {
    width: 100%;
    height: auto;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.image-style:hover {
    transform: scale(1.05); /* 悬停放大效果 */
    box-shadow: 0 10px 15px rgba(0,0,0,0.2);
}

/* 渐变线条装饰 */
.gradient-line {
    height: 4px;
    background: linear-gradient(90deg, #1e3c72, #2a5298, #5b247a);
    margin: 20px 0;
    border: none;
}

/* 文章样式 */
article {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

article h2, 
article h3, 
article h4 {
    font-family: 'Montserrat', sans-serif;
    color: #1e3c72;
    margin-top: 20px;
    margin-bottom: 10px;
}

article p {
    font-size: 1em;
    line-height: 1.6;
    margin-bottom: 15px;
}

article pre {
    background: #f5f5f5;
    padding: 15px;
    border-radius: 5px;
    overflow: auto;
    margin-bottom: 15px;
}

article code {
    font-family: 'Courier New', Courier, monospace;
    color: #2a5298;
}

.article-code {
    background: #f0f0f0;
    padding: 10px;
    border-radius: 5px;
    font-family: 'Courier New', Courier, monospace;
    overflow-x: auto;
}

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

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

.content {
    padding: 0 18px;
    display: none;
    overflow: hidden;
    background-color: #f9f9f9;
    border-left: 3px solid #2a5298;
    margin-bottom: 10px;
}

/* 媒体查询实现响应式设计 */
@media (max-width: 768px) {
    .navbar .menu {
        display: none; /* 移动端隐藏菜单 */
    }

    .chapter-nav {
        display: none; /* 移动端隐藏章节导航 */
    }

    .container {
        padding: 100px 20px 20px 20px;
    }

    .card {
        flex: 1 1 100%;
    }
}

