
/* 基本重置样式，确保不同浏览器的一致性 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* 设置全局字体和背景 */
body {
    font-family: 'Open Sans', sans-serif;
    background: linear-gradient(135deg, #0d47a1, #8e24aa);
    color: #e0e0e0;
    line-height: 1.6;
    overflow-x: hidden;
}

/* 固定导航栏样式 */
.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    height: 60px;
    background: rgba(13, 71, 161, 0.8);
    display: flex;
    align-items: center;
    justify-content: space-around;
    z-index: 1000;
}

.navbar a {
    color: #fff;
    text-decoration: none;
    font-size: 1rem;
    transition: color 0.3s ease;
}

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

/* 侧边导航菜单样式 */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: 250px;
    height: 100%;
    background: #fff;
    transform: translateX(-100%);
    transition: transform 0.5s ease;
    box-shadow: 2px 0 5px rgba(0,0,0,0.1);
    z-index: 999;
}

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

.menu-toggle {
    position: absolute;
    top: 15px;
    right: -50px;
    width: 40px;
    height: 40px;
    background: #0d47a1;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    transition: transform 0.3s ease;
}

.menu-toggle:hover {
    transform: scale(1.1);
}

/* 主内容区域样式 */
.content-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 100px 20px;
}

.content-title {
    font-family: 'Montserrat', sans-serif;
    font-size: 2.5em;
    color: #fff;
    margin-bottom: 20px;
    text-align: center;
}

.content-text {
    font-family: 'Open Sans', sans-serif;
    font-size: 1.2em;
    color: #e0e0e0;
    max-width: 800px;
    text-align: center;
    line-height: 1.6;
}

/* 图片样式 */
.image-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 20px;
    padding: 50px 0;
}

.image-gallery img {
    width: 100%;
    border-radius: 15px;
    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.3);
}

/* 章节导航样式 */
.chapter-nav {
    position: fixed;
    top: 80px;
    right: 20px;
    background: rgba(255, 235, 59, 0.9);
    padding: 10px 15px;
    border-radius: 8px;
    z-index: 1000;
}

.chapter-nav a {
    display: block;
    margin-bottom: 10px;
    color: #0d47a1;
    text-decoration: none;
    font-weight: bold;
    transition: color 0.3s ease;
}

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

/* 折叠区域样式 */
.collapsible {
    background-color: #424242;
    color: white;
    cursor: pointer;
    padding: 10px;
    width: 100%;
    border: none;
    text-align: left;
    outline: none;
    font-size: 1.1em;
    margin-top: 20px;
    border-radius: 5px;
    transition: background-color 0.3s ease;
}

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

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

.content.show {
    display: block;
    animation: fadeIn 0.5s;
}

@keyframes fadeIn {
    from {opacity: 0;}
    to {opacity: 1;}
}

/* CSS3 示例代码样式 */
.code-example {
    background: #1e1e1e;
    padding: 20px;
    border-radius: 10px;
    overflow-x: auto;
    margin: 20px 0;
}

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

/* 响应式设计 */
@media (max-width: 768px) {
    .navbar {
        flex-direction: column;
        height: auto;
    }

    .chapter-nav {
        position: static;
        margin: 20px 0;
    }

    .content-title {
        font-size: 2em;
    }

    .content-text {
        font-size: 1em;
    }

    .image-gallery {
        grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    }
}

