
/* 
整体页面样式设计
以下样式通过CSS3实现响应式布局、动态动画和视觉美学，确保页面在不同设备上均有良好的表现。
*/

/* 设置全局字体和背景 */
body {
    margin: 0;
    padding: 0;
    background: linear-gradient(135deg, #0A0A0A, #1E1E1E); /* 渐变背景色，深蓝到深灰 */
    color: #B0B0B0; /* 浅灰色文字 */
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; /* 无衬线字体，现代感强 */
    line-height: 1.6;
    font-size: 16px; /* 正文字号 */
    overflow-x: hidden; /* 防止横向滚动条 */
}

/* 统一链接样式，并添加悬停效果 */
a {
    color: #00C1D4; /* 电光蓝 */
    text-decoration: none;
    transition: color 0.3s ease;
}

a:hover {
    color: #FF6F61; /* 橙红色 */
}

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

/* 导航项样式 */
.nav-item {
    margin: 0 15px;
    color: #B0B0B0;
    font-size: 18px;
    transition: color 0.3s ease;
}

.nav-item:hover {
    color: #00C1D4;
}

/* 主内容区样式 */
.main-content {
    padding: 100px 20px 50px 20px; /* 上部留出导航栏空间 */
    max-width: 1200px;
    margin: 0 auto;
}

/* 章节导航样式 */
.chapter-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 40px;
    background: rgba(26, 26, 26, 0.8);
    padding: 15px;
    border-radius: 10px;
}

.chapter-link {
    background-color: #00C1D4;
    color: #0A0A0A;
    padding: 10px 20px;
    border-radius: 5px;
    font-size: 16px;
    transition: background-color 0.3s ease;
}

.chapter-link:hover {
    background-color: #FF6F61;
}

/* 文章内容样式 */
article {
    background-color: rgba(10, 10, 10, 0.8);
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.5);
    margin-bottom: 40px;
}

article h2, article h3, article h4 {
    color: #FFFFFF; /* 白色标题 */
}

article h2 {
    font-size: 24px;
    margin-bottom: 20px;
    border-bottom: 2px solid #00C1D4;
    padding-bottom: 10px;
}

article h3 {
    font-size: 20px;
    margin-top: 30px;
    margin-bottom: 15px;
}

article pre {
    background-color: #1E1E1E;
    padding: 15px;
    border-radius: 5px;
    overflow-x: auto;
    margin: 20px 0;
}

article code {
    color: #00C1D4;
    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.5); /* 阴影效果 */
    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.7);
}

/* 分隔线样式 */
.separator {
    height: 2px;
    background: linear-gradient(90deg, #00C1D4, #FF6F61);
    margin: 40px 0;
    border: none;
    border-radius: 1px;
}

/* 按钮样式 */
.button {
    display: inline-block;
    padding: 15px 30px;
    background-color: #00C1D4;
    color: #FFFFFF;
    border: none;
    border-radius: 5px;
    font-size: 16px;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.3s ease;
}

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

/* 折叠内容样式 */
.collapsible {
    background-color: #1E1E1E;
    color: #FFFFFF;
    cursor: pointer;
    padding: 15px;
    width: 100%;
    border: none;
    text-align: left;
    outline: none;
    font-size: 18px;
    transition: background-color 0.3s ease;
    border-radius: 5px;
    margin-top: 20px;
}

.collapsible:hover {
    background-color: #00C1D4;
    color: #0A0A0A;
}

.content {
    padding: 0 15px;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.5s ease;
    background-color: rgba(26, 26, 26, 0.8);
    border-radius: 0 0 5px 5px;
}

/* 图片网格布局 */
.image-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 20px;
    margin-top: 30px;
}

.image-grid img {
    width: 100%;
    height: auto;
    border-radius: 10px;
    transition: transform 0.3s ease;
}

.image-grid img:hover {
    transform: scale(1.05);
}

/* Footer样式 */
.footer {
    background-color: rgba(10, 10, 10, 0.9);
    color: #B0B0B0;
    padding: 30px 20px;
    text-align: center;
    font-size: 16px;
    position: relative;
}

.footer .cta-button {
    margin-top: 20px;
}

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

    .chapter-nav {
        flex-direction: column;
    }

    .main-content {
        padding: 120px 10px 30px 10px;
    }

    article {
        padding: 20px;
    }

    .chapter-link {
        width: 100%;
        text-align: center;
    }
}

/* 动画效果 */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.fade-in {
    animation: fadeIn 2s ease-in-out;
}

/* 代码示例样式 */
.code-example {
    background-color: #1E1E1E;
    padding: 20px;
    border-radius: 10px;
    overflow-x: auto;
    margin: 20px 0;
}

.code-example pre {
    margin: 0;
    font-family: 'Courier New', Courier, monospace;
    font-size: 14px;
}

