
/* 全局样式设置 */
body {
    margin: 0;
    padding: 0;
    font-family: 'Roboto', sans-serif; /* 使用现代无衬线字体 */
    background: linear-gradient(135deg, #121212, #1e1e1e); /* 主色调渐变背景 */
    color: #FFFFFF; /* 正文字体颜色 */
    transition: background 0.5s ease, color 0.5s ease; /* 平滑过渡效果 */
}

/* 固定导航栏样式 */
.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    background-color: rgba(18, 18, 18, 0.9); /* 半透明背景 */
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 30px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
    z-index: 1000;
}

/* 导航链接样式 */
.navbar a {
    color: #FFFFFF;
    text-decoration: none;
    margin: 0 15px;
    position: relative;
    transition: color 0.3s ease;
}

.navbar a::after {
    content: '';
    position: absolute;
    width: 0%;
    height: 2px;
    background: #FFA500; /* 点缀色 */
    left: 0;
    bottom: -5px;
    transition: width 0.3s ease;
}

.navbar a:hover::after {
    width: 100%;
}

.navbar .logo {
    font-size: 20px;
    font-weight: bold;
    color: #32CD32; /* 点缀色 */
}

/* 主内容区样式 */
.main-content {
    padding: 80px 40px 40px 40px; /* 顶部留白以避开固定导航栏 */
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}

/* 文章样式 */
article {
    background-color: #1e1e1e;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

article:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.5);
}

/* 标题样式 */
h2, h3, h4 {
    color: #32CD32; /* 辅色 */
}

h2 {
    font-size: 24px;
    margin-bottom: 15px;
}

h3 {
    font-size: 20px;
    margin-bottom: 10px;
}

h4 {
    font-size: 18px;
    margin-bottom: 8px;
}

/* 段落样式 */
p {
    line-height: 1.6;
    margin-bottom: 15px;
    font-size: 16px;
}

/* 代码块样式 */
pre {
    background-color: #2c2c2c;
    padding: 15px;
    border-radius: 5px;
    overflow-x: auto;
}

code {
    color: #FFD700; /* 点缀色 */
    font-family: 'Courier New', Courier, monospace;
    font-size: 14px;
}

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

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

/* 提示信息样式 */
.notice {
    background-color: #32CD32;
    color: #121212;
    padding: 10px 20px;
    border-radius: 5px;
    font-weight: bold;
    text-align: center;
    margin-bottom: 20px;
}

/* 导航系统样式 */
.chapter-nav {
    position: sticky;
    top: 80px;
    background-color: #1e1e1e;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
}

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

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

.chapter-nav a {
    color: #FFA500;
    text-decoration: none;
    transition: color 0.3s ease;
}

.chapter-nav a:hover {
    color: #32CD32;
}

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

    .main-content {
        grid-template-columns: 1fr;
        padding: 80px 20px 20px 20px;
    }

    .chapter-nav {
        display: none;
    }
}

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

.fade-in {
    opacity: 0;
    animation: fadeInUp 0.6s forwards;
}

/* 按钮样式 */
.button {
    background-color: #0074D9;
    border: none;
    padding: 10px 20px;
    color: #FFFFFF;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.2s ease;
    text-decoration: none;
    display: inline-block;
}

.button:hover {
    background: linear-gradient(45deg, #0074D9, #32CD32);
    transform: translateY(-2px);
}

.button:active {
    transform: scale(0.95);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

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

.collapsible:hover {
    background-color: #3a3a3a;
}

.content {
    padding: 0 18px;
    display: none;
    background-color: #1e1e1e;
    overflow: hidden;
    border-radius: 5px;
}

/* 点缀色强调 */
.highlight {
    color: #FFA500;
}

/* CSS3 示例代码块样式 */
.css-example {
    background-color: #2c2c2c;
    padding: 15px;
    border-radius: 5px;
    overflow-x: auto;
    margin-bottom: 20px;
}

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

/* 使用Flexbox进行布局 */
.flex-container {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
}

.flex-item {
    flex: 1 1 300px;
    background-color: #2c2c2c;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.flex-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 12px rgba(0, 0, 0, 0.5);
}

