
/* 全局样式设置 */
body {
    margin: 0;
    padding: 0;
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    font-size: 16px;
    line-height: 1.6;
    color: #333333;
    background-color: #1e1e1e; /* 主背景色，深色模式 */
    transition: background-color 0.5s ease, color 0.5s ease;
}

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

/* 导航栏样式 */
nav {
    position: fixed;
    top: 0;
    width: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    color: #ffffff;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 30px;
    z-index: 1000;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

nav .logo {
    font-size: 1.5em;
    font-weight: bold;
}

nav ul {
    list-style: none;
    display: flex;
    gap: 20px;
}

nav ul li a {
    color: #ffffff;
    text-decoration: none;
    font-size: 1em;
    transition: color 0.3s ease;
}

nav ul li a:hover {
    color: #1E90FF; /* 点缀色 */
}

/* 章节导航样式 */
.chapter-nav {
    position: fixed;
    top: 70px;
    right: 20px;
    background-color: rgba(30, 144, 255, 0.9);
    padding: 10px;
    border-radius: 8px;
}

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

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

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

.chapter-nav ul li a:hover {
    color: #32CD32; /* 另一种点缀色 */
}

/* 主体内容区 */
.article-content {
    margin-top: 100px; /* 为固定导航栏留出空间 */
    padding: 20px;
    background: linear-gradient(135deg, #2c3e50, #4ca1af); /* 渐变背景 */
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
}

.article-content h2, .article-content h3, .article-content h4 {
    color: #ffffff;
    margin-bottom: 15px;
}

.article-content p {
    color: #dddddd;
    margin-bottom: 15px;
    line-height: 1.8;
}

.article-content a {
    color: #32CD32;
    text-decoration: none;
    transition: color 0.3s ease;
}

.article-content a:hover {
    color: #1E90FF;
}

.article-content pre {
    background-color: #2c3e50;
    padding: 15px;
    border-radius: 8px;
    overflow-x: auto;
    margin-bottom: 20px;
}

.article-content code {
    color: #1E90FF;
    font-family: 'Courier New', Courier, monospace;
}

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

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

/* 按钮样式 */
.button {
    background-color: #1E90FF;
    color: #ffffff;
    padding: 12px 24px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.2s ease;
}

.button:hover {
    background-color: #32CD32;
}

.button:active {
    transform: scale(0.95);
}

/* 折叠区域样式 */
.collapsible {
    background-color: #34495e;
    color: #ffffff;
    cursor: pointer;
    padding: 10px;
    width: 100%;
    border: none;
    text-align: left;
    outline: none;
    font-size: 1em;
    border-radius: 5px;
    margin-bottom: 10px;
}

.active, .collapsible:hover {
    background-color: #1E90FF;
}

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

.content p {
    color: #ecf0f1;
}

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

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

/* 动态几何图形 */
.dynamic-geometry {
    width: 150px;
    height: 150px;
    background: linear-gradient(45deg, #1E90FF, #32CD32);
    border-radius: 50%;
    animation: rotate 20s linear infinite;
    margin: 20px auto;
}

@keyframes rotate {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/* 深色模式支持 */
@media (prefers-color-scheme: dark) {
    body {
        background-color: #121212;
        color: #ffffff;
    }
    
    .article-content {
        background: linear-gradient(135deg, #1e1e1e, #2c3e50);
    }
    
    nav {
        background-color: rgba(0, 0, 0, 0.9);
    }
}

/* 响应式调整 */
@media (max-width: 768px) {
    nav ul {
        flex-direction: column;
        gap: 10px;
    }
    
    .chapter-nav {
        position: static;
        background-color: transparent;
    }
    
    .chapter-nav ul li {
        margin: 5px 0;
    }
}

