
/* 整体页面样式设置 */
body {
    margin: 0;
    padding: 0;
    font-family: 'Roboto', sans-serif; /* 使用现代无衬线字体 */
    background: linear-gradient(135deg, #0f2027, #203a43, #2c5364); /* 渐变背景色 */
    color: #ffffff;
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* 导航栏样式 */
.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    background-color: rgba(20, 20, 20, 0.8); /* 半透明背景 */
    padding: 15px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 1000;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

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

.navbar a:hover {
    color: #3498db; /* 点缀色悬停效果 */
}

/* 侧边栏样式 */
.sidebar {
    position: fixed;
    left: 0;
    top: 60px; /* 导航栏高度 */
    width: 250px;
    height: 100%;
    background-color: rgba(20, 20, 20, 0.9);
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    overflow-y: auto;
    padding-top: 20px;
}

.sidebar.open {
    transform: translateX(0);
}

.sidebar ul {
    list-style: none;
    padding: 0;
}

.sidebar li {
    margin: 15px 0;
}

.sidebar a {
    color: #fff;
    text-decoration: none;
    font-size: 18px;
    padding: 10px 20px;
    display: block;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.sidebar a:hover {
    background-color: #3498db;
    color: #ffffff;
}

/* 主内容区域样式 */
main {
    margin-top: 80px; /* 导航栏高度 */
    padding: 20px;
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
}

/* 章节导航提示 */
.promotion-banner {
    text-align: center;
    font-size: 18px;
    margin-bottom: 40px;
    color: #ffeb3b; /* 点缀色 */
    font-weight: bold;
}

/* 文章样式 */
article {
    background: rgba(255, 255, 255, 0.1);
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

article h2 {
    font-size: 24px;
    margin-bottom: 20px;
    color: #e0e0e0;
}

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

article p {
    font-size: 16px;
    line-height: 1.6;
    margin-bottom: 20px;
}

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

article code {
    color: #ffeb3b; /* 点缀色 */
    font-family: 'Courier New', Courier, monospace;
}

/* 图片样式 */
.image-gallery {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin-top: 30px;
    margin-bottom: 30px;
}

.image-gallery img {
    width: 100%;
    max-width: 320px;
    border-radius: 10px;
    box-shadow: 0 4px 6px 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 6px 8px rgba(0, 0, 0, 0.5);
}

/* 响应式设计 */
@media (max-width: 768px) {
    .sidebar {
        width: 200px;
    }

    .navbar a {
        margin: 0 10px;
        font-size: 14px;
    }

    article h2 {
        font-size: 20px;
    }

    article h3 {
        font-size: 18px;
    }

    article p {
        font-size: 15px;
    }

    .promotion-banner {
        font-size: 16px;
    }
}

/* 按钮样式 */
.button {
    background-color: #3498db;
    color: #fff;
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.3s ease;
}

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

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

.page {
    opacity: 0;
    animation: fadeIn 1s forwards;
}

/* 代码示例样式 */
.code-example {
    background: rgba(0, 0, 0, 0.85);
    padding: 20px;
    border-radius: 8px;
    overflow-x: auto;
    margin-bottom: 20px;
}

.code-example code {
    color: #ffeb3b;
    font-family: 'Courier New', Courier, monospace;
    font-size: 14px;
}

/* 导航按钮 */
.nav-toggle {
    display: none;
    flex-direction: column;
    cursor: pointer;
}

.nav-toggle span {
    height: 3px;
    width: 25px;
    background: #fff;
    margin-bottom: 4px;
    border-radius: 3px;
}

/* 显示导航按钮 */
@media (max-width: 768px) {
    .nav-toggle {
        display: flex;
    }

    .sidebar {
        top: 50px;
    }
}

