
/* 基础样式设置 */
body {
    margin: 0;
    padding: 0;
    font-family: 'Roboto', sans-serif; /* 使用现代无衬线字体 */
    background: linear-gradient(135deg, #0d47a1, #00e5ff); /* 主背景渐变色 */
    color: #ffffff;
    line-height: 1.6;
}

/* 导航栏样式 */
.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    background: rgba(13, 71, 161, 0.9);
    display: flex;
    justify-content: space-around;
    align-items: center;
    padding: 15px 0;
    z-index: 1000;
}

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

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

/* 回到顶部按钮样式 */
.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: #00c853; /* 辅色 */
    color: #ffffff;
    padding: 10px 15px;
    border-radius: 50%;
    display: none;
    cursor: pointer;
    transition: background 0.3s ease, transform 0.3s ease;
}

.back-to-top.show {
    display: block;
    animation: fadeIn 0.5s forwards;
}

.back-to-top:hover {
    background: #00e5ff; /* 点缀色悬停效果 */
    transform: scale(1.1);
}

/* 动画关键帧 */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* 主要内容容器 */
.container {
    max-width: 1200px;
    margin: 100px auto 50px; /* 顶部留出导航栏空间 */
    padding: 0 20px;
}

/* 文章标题样式 */
.container h2 {
    font-size: 2em;
    margin-bottom: 20px;
    text-align: center;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
}

/* 二级标题样式 */
.container h3 {
    font-size: 1.5em;
    margin-top: 40px;
    margin-bottom: 15px;
    border-bottom: 2px solid #00e5ff; /* 点缀色边线 */
    padding-bottom: 5px;
}

/* 正文段落样式 */
.container p {
    font-size: 16px;
    margin-bottom: 20px;
    text-align: justify;
}

/* 代码块样式 */
.container pre {
    background: rgba(255, 255, 255, 0.1);
    padding: 15px;
    border-radius: 8px;
    overflow-x: auto;
    margin-bottom: 20px;
}

.container code {
    font-family: 'Courier New', Courier, monospace;
    color: #00e5ff; /* 点缀色 */
}

/* 示例CSS代码高亮 */
.language-css {
    display: block;
    color: #ff6;
}

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

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

/* 渐变按钮样式 */
.button-gradient {
    background: linear-gradient(45deg, #00e5ff, #00c853);
    border: none;
    color: #ffffff;
    padding: 12px 25px;
    border-radius: 25px;
    cursor: pointer;
    transition: transform 0.3s ease;
    text-decoration: none;
}

.button-gradient:hover {
    transform: scale(1.05);
}

/* 章节导航系统 */
.chapter-nav {
    position: fixed;
    top: 50%;
    left: 0;
    transform: translateY(-50%);
    background: rgba(13, 71, 161, 0.8);
    padding: 10px;
    border-top-right-radius: 10px;
    border-bottom-right-radius: 10px;
}

.chapter-nav a {
    display: block;
    color: #ffffff;
    text-decoration: none;
    margin: 10px 0;
    font-size: 14px;
    transition: color 0.3s ease;
}

.chapter-nav a:hover {
    color: #00e5ff;
}

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

    .chapter-nav {
        display: none;
    }

    .container {
        margin: 80px auto 20px;
    }

    .container h2 {
        font-size: 1.8em;
    }

    .container h3 {
        font-size: 1.3em;
    }

    .container p {
        font-size: 14px;
    }

    .container img {
        max-width: 100%;
    }
}

