
/* 基础样式设置 */
body {
    margin: 0;
    padding: 0;
    font-family: 'Roboto', sans-serif;
    background: linear-gradient(135deg, #1E3C72, #2A5298); /* 主色调渐变背景 */
    color: #FFFFFF;
    line-height: 1.6;
}

/* 导航栏样式 */
.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    background: rgba(30, 60, 114, 0.9); /* 半透明背景 */
    padding: 15px 0;
    z-index: 1000;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.navbar .container {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.navbar a {
    color: #FFFFFF;
    text-decoration: none;
    margin: 0 15px;
    font-size: 16px;
    transition: color 0.3s ease;
}

.navbar a:hover {
    color: #FF9800; /* 点缀色悬停效果 */
}

/* 章节导航系统 */
.chapter-nav {
    position: absolute;
    top: 70px;
    right: 20px;
    background: rgba(255, 255, 255, 0.1);
    padding: 10px 20px;
    border-radius: 8px;
}

.chapter-nav a {
    display: block;
    color: #FFFFFF;
    margin: 5px 0;
    font-size: 14px;
    transition: background 0.3s ease, color 0.3s ease;
}

.chapter-nav a:hover {
    background: rgba(255, 152, 0, 0.2);
    color: #FF9800;
}

/* 主要内容区 */
.container {
    width: 90%;
    max-width: 1200px;
    margin: 100px auto 50px auto; /* 顶部留白以避开固定导航栏 */
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}

/* 文章样式 */
article {
    background: rgba(255, 255, 255, 0.1);
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
    color: #FFFFFF;
}

article h2, article h3, article h4 {
    font-family: 'Montserrat', sans-serif;
    color: #FF9800; /* 辅色用于标题 */
    margin-top: 20px;
    margin-bottom: 10px;
}

article p {
    font-size: 16px;
    margin-bottom: 15px;
}

article pre {
    background: rgba(0, 0, 0, 0.7);
    padding: 15px;
    border-radius: 8px;
    overflow-x: auto;
}

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

/* 图片样式 */
img.decorative {
    width: 100%;
    max-width: 320px;
    border-radius: 15px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.3);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

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

/* 提示语样式 */
.reference-note {
    background: rgba(255, 152, 0, 0.2);
    padding: 20px;
    border-left: 5px solid #FF9800;
    margin-bottom: 30px;
    font-size: 18px;
    border-radius: 5px;
}

/* 按钮样式 */
.button {
    background-color: #42A5F5;
    border: none;
    color: white;
    padding: 15px 32px;
    text-align: center;
    text-decoration: none;
    display: inline-block;
    font-size: 16px;
    border-radius: 4px;
    transition: background-color 0.3s ease, transform 0.3s ease;
    cursor: pointer;
}

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

/* 过渡与动画 */
.fade-in {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 1s ease-out, transform 1s ease-out;
}

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

@keyframes draw {
    from {
        stroke-dashoffset: 1000;
    }
    to {
        stroke-dashoffset: 0;
    }
}

@media (max-width: 768px) {
    .chapter-nav {
        position: static;
        background: rgba(255, 255, 255, 0.2);
        padding: 10px;
        margin-top: 20px;
    }
    
    .navbar .container {
        flex-direction: column;
    }
    
    .navbar a {
        margin: 10px 0;
    }
}

