
/* 全局样式设置，应用基础字体、颜色和盒模型 */
body {
    margin: 0;
    padding: 0;
    font-family: 'Roboto', sans-serif; /* 使用现代无衬线字体，确保可读性 */
    background: linear-gradient(135deg, #0d1b2a, #1b263b); /* 主色调为深蓝渐变，营造未来感 */
    color: #ffffff; /* 主文字颜色为白色，确保与深色背景对比 */
    line-height: 1.6;
    overflow-x: hidden; /* 防止出现水平滚动条 */
}

/* 导航栏样式 */
.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    height: 60px;
    background: rgba(13, 27, 42, 0.7); /* 半透明背景 */
    backdrop-filter: blur(10px); /* 背景模糊效果 */
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
    z-index: 1000;
    transition: background 0.5s ease;
}

.navbar.scrolled {
    background: rgba(13, 27, 42, 1); /* 滚动后背景变为不透明 */
}

.navbar .logo {
    font-size: 1.5em;
    font-weight: bold;
    color: #00c6ff; /* 主要色系点缀色 */
}

.navbar .nav-menu {
    display: flex;
    gap: 20px;
}

.navbar .nav-menu a {
    color: #ffffff;
    text-decoration: none;
    font-size: 1em;
    position: relative;
    transition: color 0.3s ease;
}

.navbar .nav-menu a:hover {
    color: #00c6ff; /* 点缀色作为悬停颜色 */
}

.navbar .nav-menu a::after {
    content: '';
    display: block;
    width: 0;
    height: 2px;
    background: #00c6ff;
    transition: width 0.3s;
    position: absolute;
    bottom: -5px;
    left: 0;
}

.navbar .nav-menu a:hover::after {
    width: 100%; /* 悬停时下划线渐变效果 */
}

/* 章节导航样式 */
.chapter-nav {
    position: fixed;
    top: 70px;
    right: 20px;
    background: rgba(27, 38, 59, 0.8);
    padding: 10px;
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 999;
}

.chapter-nav a {
    color: #ffffff;
    text-decoration: none;
    font-size: 0.9em;
    transition: color 0.3s ease;
}

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

/* 主内容区样式 */
.main-content {
    padding: 100px 20px 50px 20px; /* 留出导航栏空间 */
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
}

.article {
    grid-column: 1 / 3;
}

.article h2, .article h3, .article h4 {
    color: #00c6ff; /* 标题使用点缀色 */
}

.article pre {
    background: rgba(27, 38, 59, 0.9);
    padding: 15px;
    border-radius: 5px;
    overflow-x: auto;
    font-family: monospace;
    margin: 20px 0;
}

.article code {
    color: #00c6ff;
}

.article a {
    color: #00c6ff;
    text-decoration: underline;
}

.article a:hover {
    color: #0072ff;
}

/* 图片样式 */
.image-gallery {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    justify-content: center;
}

.image-gallery img {
    width: 100%;
    max-width: 320px;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.image-gallery img:hover {
    transform: scale(1.05); /* 悬停放大效果 */
    box-shadow: 0 8px 25px rgba(0,0,0,0.5);
}

/* 按钮样式 */
.button {
    background: linear-gradient(45deg, #00c6ff, #0072ff);
    border: none;
    padding: 15px 30px;
    color: #fff;
    font-size: 1.2em;
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s;
    border-radius: 5px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

.button:hover {
    transform: rotate(10deg) scale(1.1);
    box-shadow: 0 6px 20px rgba(0,0,0,0.3);
}

/* 折叠区域样式 */
.collapsible {
    background-color: rgba(27, 38, 59, 0.9);
    color: #ffffff;
    cursor: pointer;
    padding: 18px;
    width: 100%;
    border: none;
    text-align: left;
    outline: none;
    font-size: 1em;
    transition: background-color 0.3s ease;
    border-radius: 5px;
    margin: 10px 0;
}

.collapsible:hover {
    background-color: rgba(27, 38, 59, 1);
}

.content {
    padding: 0 18px;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.2s ease-out;
    background-color: rgba(27, 38, 59, 0.8);
    border-radius: 5px;
}

/* 代码示例块样式 */
.code-example {
    background: rgba(27, 38, 59, 0.9);
    padding: 15px;
    border-radius: 5px;
    overflow-x: auto;
    font-family: monospace;
    margin: 20px 0;
    color: #00c6ff;
}

/* 响应式设计 */
@media (max-width: 1200px) {
    .main-content {
        grid-template-columns: 1fr;
    }

    .chapter-nav {
        display: none; /* 小屏幕隐藏章节导航 */
    }
}

@media (max-width: 768px) {
    .navbar {
        flex-direction: column;
        height: auto;
        padding: 10px;
    }

    .navbar .nav-menu {
        flex-direction: column;
        gap: 10px;
    }

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