
/* 全局样式设置 */
body {
    margin: 0;
    padding: 0;
    background: linear-gradient(135deg, #0d1b2a, #1b263b); /* 主色调渐变背景 */
    color: #ffffff;
    font-family: 'Roboto', sans-serif; /* 使用现代无衬线字体 */
    line-height: 1.6;
    font-size: 16px;
}

/* 响应式布局 */
.container {
    display: flex;
    flex-direction: column;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* 导航栏样式 */
header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: rgba(27, 38, 59, 0.9);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 30px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    z-index: 1000;
}

nav a {
    color: #ffffff;
    text-decoration: none;
    margin: 0 15px;
    position: relative;
    transition: color 0.3s ease;
}

nav a::after {
    content: '';
    display: block;
    width: 0;
    height: 2px;
    background: #00ffff; /* 辅助色 */
    transition: width 0.3s;
    position: absolute;
    bottom: -5px;
    left: 0;
}

nav a:hover::after {
    width: 100%;
}

.logo {
    font-size: 20px;
    font-weight: bold;
    color: #32cd32; /* 辅助色 */
}

/* 主内容区域 */
main {
    margin-top: 80px; /* 避免被固定导航遮挡 */
    display: grid;
    grid-template-columns: 1fr;
    gap: 40px;
}

/* 章节导航系统 */
.chapter-nav {
    background: #1b263b;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.5);
}

.chapter-nav ul {
    list-style: none;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    justify-content: center;
}

.chapter-nav li a {
    color: #00ffff; /* 辅助色 */
    text-decoration: none;
    padding: 10px 15px;
    border: 1px solid #32cd32; /* 辅助色 */
    border-radius: 5px;
    transition: background 0.3s, color 0.3s;
}

.chapter-nav li a:hover {
    background: #32cd32; /* 辅助色 */
    color: #000000; /* 点缀色 */
}

/* 文章内容样式 */
article {
    background: rgba(27, 38, 59, 0.8);
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 4px 15px rgba(0, 255, 255, 0.3); /* 辅助色阴影 */
}

article h2, article h3, article h4 {
    color: #00ffff; /* 辅助色 */
}

article h2 {
    font-size: 24px;
    margin-bottom: 20px;
    text-align: center;
}

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

article h4 {
    font-size: 18px;
    margin-top: 20px;
    margin-bottom: 10px;
}

article p {
    margin-bottom: 15px;
    font-size: 16px;
}

article pre {
    background: #1b263b;
    padding: 15px;
    border-radius: 10px;
    overflow-x: auto;
    margin: 20px 0;
    box-shadow: 0 2px 5px rgba(0, 255, 255, 0.3);
}

article code {
    color: #32cd32; /* 辅助色 */
    font-family: 'Courier New', Courier, monospace;
}

/* 图片样式 */
.article-image {
    width: 100%;
    max-width: 320px;
    border-radius: 15px;
    box-shadow: 0 4px 10px rgba(0, 255, 255, 0.5);
    transition: transform 0.3s, box-shadow 0.3s;
}

.article-image:hover {
    transform: scale(1.05);
    box-shadow: 0 8px 20px rgba(0, 255, 255, 0.7);
}

/* 提示文本样式 */
.prompt-text {
    text-align: center;
    font-size: 18px;
    color: #ff4500; /* 点缀色 */
    margin: 40px 0;
    font-weight: bold;
    animation: fadeIn 2s ease-in-out;
}

/* CSS代码示例样式 */
.code-example {
    background: #0d1b2a;
    padding: 20px;
    border-radius: 10px;
    border-left: 5px solid #32cd32; /* 辅助色 */
    margin: 20px 0;
}

.code-example pre {
    background: #1b263b;
    padding: 15px;
    border-radius: 8px;
    overflow-x: auto;
}

/* 3D效果动画 */
@keyframes rotate {
    from {
        transform: rotateY(0deg);
    }
    to {
        transform: rotateY(360deg);
    }
}

/* 可展开区域样式 */
.collapsible {
    background: #0d1b2a;
    color: #ffffff;
    cursor: pointer;
    padding: 15px;
    width: 100%;
    border: none;
    text-align: left;
    outline: none;
    font-size: 18px;
    border-radius: 5px;
    transition: background 0.3s;
}

.collapsible:hover {
    background: #32cd32; /* 辅助色 */
}

.content {
    padding: 0 15px;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
    background: #1b263b;
    border-radius: 0 0 10px 10px;
}

.content p {
    padding: 15px 0;
}

/* 响应式设计 */
@media (min-width: 768px) {
    .chapter-nav ul {
        justify-content: flex-start;
    }

    article {
        display: flex;
        flex-direction: column;
        gap: 20px;
    }

    .article-section {
        display: flex;
        flex-direction: row;
        gap: 20px;
    }

    .article-section img {
        flex: 1;
    }

    .article-section div {
        flex: 2;
    }
}

@media (max-width: 480px) {
    nav a {
        margin: 0 10px;
        font-size: 14px;
    }

    .chapter-nav ul {
        flex-direction: column;
        align-items: center;
    }

    .chapter-nav li a {
        width: 100%;
        text-align: center;
    }

    .prompt-text {
        font-size: 16px;
    }
}

/* 平滑过渡动画 */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}


