
/* 全局样式设置 */
body {
    margin: 0;
    padding: 0;
    font-family: 'Helvetica', 'Arial', sans-serif;
    background: linear-gradient(135deg, #032B44 70%, #6F2EBD 25%, #FF9800 5%);
    color: #333333;
    line-height: 1.6;
}

/* 容器样式 */
.container {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* 导航栏样式 */
nav {
    position: fixed;
    top: 0;
    width: 100%;
    background-color: rgba(3, 43, 68, 0.9);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    z-index: 1000;
}

nav ul {
    list-style: none;
    display: flex;
    justify-content: flex-end;
    padding: 10px 20px;
    margin: 0;
}

nav ul li {
    margin-left: 20px;
}

nav ul li a {
    color: #FFFFFF;
    text-decoration: none;
    font-size: 16px;
    transition: color 0.3s ease;
}

nav ul li a:hover {
    color: #FF9800;
}

/* 章节导航样式 */
.chapter-nav {
    position: fixed;
    top: 60px;
    left: 20px;
    background-color: rgba(255, 255, 255, 0.8);
    padding: 10px;
    border-radius: 8px;
}

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

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

.chapter-nav ul li a {
    text-decoration: none;
    color: #032B44;
    font-size: 14px;
    transition: color 0.3s ease;
}

.chapter-nav ul li a:hover {
    color: #6F2EBD;
}

/* 主内容样式 */
article {
    margin-top: 80px;
}

article h2 {
    font-size: 24px;
    color: #032B44;
    margin-top: 40px;
    position: relative;
}

article h2::after {
    content: '';
    display: block;
    width: 50px;
    height: 3px;
    background-color: #FF9800;
    margin-top: 10px;
    border-radius: 2px;
}

article section {
    margin-top: 20px;
    padding: 20px;
    background-color: rgba(255, 255, 255, 0.9);
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

article section:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 15px rgba(0,0,0,0.2);
}

article p {
    font-size: 16px;
    color: #333333;
}

article pre {
    background-color: #F0F0F0;
    padding: 15px;
    border-radius: 8px;
    overflow-x: auto;
    margin-top: 15px;
}

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

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

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

/* 返回顶部按钮样式 */
#back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background-color: #FF9800;
    color: #FFFFFF;
    padding: 10px 15px;
    border-radius: 50%;
    text-align: center;
    cursor: pointer;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    transition: background-color 0.3s ease, transform 0.3s ease;
    z-index: 1000;
}

#back-to-top:hover {
    background-color: #6F2EBD;
    transform: scale(1.1);
}

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

.fade-in-up {
    animation: fadeInUp 1s ease both;
}

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

    .chapter-nav {
        position: static;
        margin-top: 20px;
    }

    #back-to-top {
        right: 10px;
        bottom: 10px;
    }
}

/* 代码示例样式 */
.code-sample {
    background-color: #1E1E1E;
    color: #C5C5C5;
    padding: 20px;
    border-radius: 8px;
    font-family: 'Courier New', Courier, monospace;
    overflow-x: auto;
    margin-top: 20px;
}

.code-sample::-webkit-scrollbar {
    height: 8px;
}

.code-sample::-webkit-scrollbar-track {
    background: #2D2D2D;
}

.code-sample::-webkit-scrollbar-thumb {
    background: #555555;
    border-radius: 4px;
}

.code-sample pre {
    margin: 0;
}

