
/* 全局样式设置 */
body {
    margin: 0;
    padding: 0;
    font-family: 'Roboto', sans-serif; /* 使用现代无衬线字体 */
    background: linear-gradient(135deg, #1A1A2E, #16213E, #0F3460); /* 采用冷色系渐变背景 */
    color: #FFFFFF;
    line-height: 1.6;
}

/* 导航栏样式 */
.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    background: rgba(3, 169, 244, 0.9); /* 主色电光蓝 */
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 40px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    z-index: 1000;
    transition: background 0.5s ease;
}

.navbar:hover {
    background: rgba(103, 58, 183, 0.9); /* 辅色暗紫色 */
}

.navbar .logo {
    font-size: 24px;
    font-weight: bold;
    color: #FFFFFF;
}

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

.navbar ul li a {
    text-decoration: none;
    color: #FFFFFF;
    font-size: 16px;
    transition: color 0.3s ease;
}

.navbar ul li a:hover {
    color: #FFC107; /* 点缀色 */
}

/* 侧边栏样式 */
.sidebar {
    position: fixed;
    left: -250px;
    top: 0;
    width: 250px;
    height: 100%;
    background: #0F3460;
    padding: 60px 20px;
    box-shadow: 2px 0 5px rgba(0,0,0,0.5);
    transition: transform 0.3s ease;
}

.sidebar.open {
    transform: translateX(250px);
}

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

.sidebar ul li {
    margin: 20px 0;
}

.sidebar ul li a {
    text-decoration: none;
    color: #FFFFFF;
    font-size: 18px;
    transition: color 0.3s ease;
}

.sidebar ul li a:hover {
    color: #FFC107;
}

/* 主内容区 */
.main-content {
    margin-top: 80px;
    padding: 20px 40px;
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
}

/* 章节导航 */
.chapter-nav {
    position: sticky;
    top: 100px;
    background: rgba(3, 169, 244, 0.8);
    padding: 10px 20px;
    border-radius: 8px;
    margin-bottom: 40px;
}

.chapter-nav ul {
    list-style: none;
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.chapter-nav ul li a {
    text-decoration: none;
    color: #FFFFFF;
    font-size: 16px;
    background: rgba(103, 58, 183, 0.7);
    padding: 8px 16px;
    border-radius: 4px;
    transition: background 0.3s ease;
}

.chapter-nav ul li a:hover {
    background: #FFC107;
    color: #000000;
}

/* 文章样式 */
article {
    background: rgba(22, 33, 62, 0.8);
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.3);
    margin-bottom: 40px;
}

article h2 {
    font-size: 28px;
    color: #03A9F4;
    margin-bottom: 20px;
    position: relative;
}

article h2::after {
    content: '';
    display: block;
    width: 50px;
    height: 3px;
    background: #FFC107;
    margin-top: 10px;
    border-radius: 2px;
}

article h3 {
    font-size: 22px;
    color: #673AB7;
    margin-top: 30px;
    margin-bottom: 15px;
}

article p {
    font-size: 16px;
    color: #FFFFFF;
    margin-bottom: 20px;
}

article pre {
    background: #16213E;
    padding: 15px;
    border-radius: 8px;
    overflow-x: auto;
    margin-bottom: 20px;
}

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

/* 图片样式 */
.image-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 20px;
    margin-top: 40px;
    margin-bottom: 40px;
}

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

.image-gallery img:hover {
    transform: scale(1.05);
    box-shadow: 0 8px 16px rgba(0,0,0,0.4);
}

/* 提示信息样式 */
.reference-note {
    background: rgba(103, 58, 183, 0.9);
    padding: 15px 20px;
    border-left: 5px solid #FFC107;
    margin: 30px 0;
    font-size: 18px;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .navbar ul {
        display: none;
    }
    .sidebar {
        left: -250px;
    }
    .sidebar.open {
        transform: translateX(250px);
    }
    .main-content {
        padding: 20px;
    }
    .chapter-nav ul {
        flex-direction: column;
    }
}

@media (max-width: 480px) {
    .navbar {
        padding: 15px 20px;
    }
    .chapter-nav ul li a {
        font-size: 14px;
        padding: 6px 12px;
    }
    article h2 {
        font-size: 24px;
    }
    article h3 {
        font-size: 20px;
    }
    article p, article code {
        font-size: 14px;
    }
}

