
/* 整体页面样式 */
body {
    margin: 0;
    font-family: 'Roboto', 'Arial', sans-serif;
    background: linear-gradient(135deg, #1e3c72, #2a5298);
    background-size: 400% 400%;
    animation: GradientAnimation 15s ease infinite;
    color: #ffffff;
    transition: background 0.5s ease;
}

/* 渐变动画 */
@keyframes GradientAnimation {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* 导航栏样式 */
.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    background: rgba(31, 38, 135, 0.8);
    backdrop-filter: blur(10px);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 30px;
    z-index: 1000;
}

.navbar a {
    color: #ffffff;
    text-decoration: none;
    margin: 0 15px;
    font-size: 16px;
    transition: color 0.3s ease;
}

.navbar a:hover {
    color: #ff9900;
}

.toggle-dark-mode {
    cursor: pointer;
    background: none;
    border: none;
    color: #fff;
    font-size: 1.2em;
    transition: color 0.3s ease;
}

/* 主要内容区域 */
.container {
    padding: 100px 20px 50px 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* 章节导航样式 */
.chapter-nav {
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    padding: 20px;
    margin-bottom: 40px;
    width: 80%;
    max-width: 1200px;
}

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

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

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

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

/* 文章内容样式 */
article {
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    padding: 30px;
    box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.37);
    width: 80%;
    max-width: 1200px;
    margin-bottom: 40px;
}

article h2, article h3, article h4 {
    color: #ffffff;
}

article p {
    font-size: 16px;
    line-height: 1.6;
    color: #f0f0f0;
}

article pre {
    background: rgba(0, 0, 0, 0.5);
    padding: 15px;
    border-radius: 10px;
    overflow-x: auto;
    margin: 20px 0;
}

article code {
    color: #ff9900;
    font-family: 'Courier New', Courier, monospace;
}

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

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

/* CSS3代码示例部分样式 */
.css-example {
    background: rgba(0, 0, 0, 0.6);
    padding: 20px;
    border-radius: 10px;
    margin: 30px 0;
}

.css-example code {
    display: block;
    background: #1e1e1e;
    padding: 15px;
    border-radius: 5px;
    color: #dcdcdc;
    font-family: 'Courier New', Courier, monospace;
    overflow-x: auto;
}

/* 响应式布局 */
@media (max-width: 1024px) {
    .chapter-nav ul {
        flex-direction: column;
        align-items: center;
    }

    .navbar {
        flex-direction: column;
        align-items: flex-start;
    }

    .toggle-dark-mode {
        margin-top: 10px;
    }
}

@media (max-width: 768px) {
    .container {
        padding: 100px 10px 50px 10px;
    }

    article {
        width: 95%;
    }
}

/* 夜间模式样式 */
body.dark-mode {
    background: linear-gradient(135deg, #2c3e50, #4ca1af);
}

body.dark-mode .navbar {
    background: rgba(44, 62, 80, 0.8);
}

body.dark-mode article {
    background: rgba(44, 62, 80, 0.6);
}

body.dark-mode .chapter-nav {
    background: rgba(255, 255, 255, 0.1);
}

body.dark-mode img {
    box-shadow: 0 4px 15px rgba(255, 255, 255, 0.2);
}

body.dark-mode .chapter-nav a {
    color: #ffffff;
}

body.dark-mode .chapter-nav a:hover {
    color: #ff9900;
}

