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

/* 设置整个页面的背景色，使用渐变色营造高级感 */
body {
    font-family: 'Open Sans', sans-serif;
    background: linear-gradient(135deg, #2c3e50, #3498db);
    color: #ffffff;
    line-height: 1.6;
    padding: 0;
    margin: 0;
    overflow-x: hidden; /* 避免水平滚动条 */
}

/* 导航栏样式 */
.navbar {
    background: linear-gradient(90deg, #006400, #00BFFF);
    padding: 20px;
    position: fixed;
    width: 100%;
    top: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 1000;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

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

.navbar li {
    position: relative;
}

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

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

.navbar li ul {
    display: none;
    position: absolute;
    top: 40px;
    left: 0;
    background: #ffffff;
    color: #000000;
    padding: 10px;
    border-radius: 5px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.navbar li:hover ul {
    display: block;
}

.navbar .search-bar input {
    padding: 8px 12px;
    border: none;
    border-radius: 3px;
    transition: width 0.4s ease-in-out;
}

.navbar .search-bar input:focus {
    width: 200px;
}

/* 主内容区样式 */
.container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    padding: 100px 40px 40px 40px; /* 顶部留出导航栏空间 */
}

/* 模块化布局模块样式 */
.module {
    background: rgba(255, 255, 255, 0.1);
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.module:hover {
    transform: translateY(-10px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.2);
}

/* 图片样式，添加圆角和阴影 */
.module img {
    width: 100%;
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    transition: transform 0.3s ease;
}

.module img:hover {
    transform: scale(1.05);
}

/* 章节导航样式 */
.chapter-nav {
    position: fixed;
    top: 80px;
    right: 20px;
    background: rgba(0, 0, 0, 0.5);
    padding: 10px;
    border-radius: 8px;
}

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

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

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

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

/* 提示信息样式 */
.prompt {
    text-align: center;
    font-size: 18px;
    margin-bottom: 40px;
    color: #FFFF00;
    animation: fadeIn 2s ease-in-out;
}

/* CSS代码示例样式 */
.code-block {
    background: #1e1e1e;
    color: #dcdcdc;
    padding: 15px;
    border-radius: 5px;
    overflow-x: auto;
    font-family: 'Courier New', Courier, monospace;
    margin: 20px 0;
}

.code-block pre {
    margin: 0;
}

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

    .navbar.active ul {
        display: flex;
    }

    .chapter-nav {
        display: none;
    }

    .container {
        padding: 100px 20px 20px 20px;
    }
}

@media (max-width: 480px) {
    .navbar .search-bar input {
        width: 100px;
    }

    .footer {
        flex-direction: column;
        text-align: center;
    }

    .footer .social-icons {
        margin-bottom: 20px;
    }
}

/* 关键帧动画 */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* 页面底部样式 */
.footer {
    background: rgba(0, 0, 0, 0.8);
    color: #ffffff;
    padding: 30px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}

.footer .social-icons a {
    color: #FFD700;
    margin-right: 15px;
    transition: color 0.3s ease;
}

.footer .social-icons a:hover {
    color: #00BFFF;
}

.footer .community-link {
    color: #ffffff;
    text-decoration: none;
    font-weight: bold;
    transition: color 0.3s ease;
}

.footer .community-link:hover {
    color: #FFD700;
}

