
/* 全局样式 */
body {
    margin: 0;
    padding: 0;
    font-family: 'Roboto', sans-serif; /* 使用现代无衬线字体 */
    background: linear-gradient(-45deg, #00c6ff, #0072ff, #4b6cb7, #182848);
    background-size: 400% 400%;
    animation: gradientMove 15s ease infinite; /* 背景渐变动画 */
    color: #333333;
}

/* 背景渐变动画关键帧 */
@keyframes gradientMove {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

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

.navbar ul {
    list-style: none;
    display: flex;
    margin: 0;
    padding: 0;
}

.navbar li {
    margin-left: 20px;
}

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

.navbar a:hover {
    color: #00c6ff; /* 悬停时颜色变化 */
}

/* 汉堡菜单样式 */
.hamburger {
    display: none;
    flex-direction: column;
    cursor: pointer;
}

.hamburger div {
    width: 25px;
    height: 3px;
    background: white;
    margin: 4px 0;
    transition: 0.4s;
}

/* 移动设备上的导航样式 */
@media (max-width: 768px) {
    .navbar ul {
        display: none;
        flex-direction: column;
        background: rgba(0, 0, 0, 0.9);
        position: absolute;
        top: 60px;
        left: 0;
        width: 100%;
    }
    .navbar ul.show {
        display: flex;
    }
    .navbar li {
        margin: 15px 0;
        text-align: center;
    }
    .hamburger {
        display: flex;
    }
}

/* 容器样式 */
.container {
    max-width: 1200px;
    margin: 100px auto 50px; /* 顶部留出导航栏空间 */
    padding: 20px;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
}

/* 模块样式 */
.module {
    flex: 1 1 300px;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 10px;
    padding: 20px;
    margin: 20px;
    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 8px 12px rgba(0, 0, 0, 0.2);
}

/* 图片样式 */
.module img {
    width: 100%;
    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 img:hover {
    transform: scale(1.05);
    box-shadow: 0 8px 12px rgba(0, 0, 0, 0.2);
}

/* 标题样式 */
h1, h2, h3, h4 {
    color: #0072ff;
    margin-top: 0;
}

h1 {
    font-size: 2.5em;
    text-align: center;
    margin-bottom: 20px;
}

h2 {
    font-size: 2em;
    margin-bottom: 15px;
}

h3 {
    font-size: 1.75em;
    margin-bottom: 10px;
}

h4 {
    font-size: 1.5em;
    margin-bottom: 10px;
}

/* 正文样式 */
p {
    font-size: 16px;
    line-height: 1.6;
    color: #333333;
    margin-bottom: 15px;
}

/* 代码块样式 */
pre {
    background: #f4f4f4;
    padding: 15px;
    border-radius: 5px;
    overflow-x: auto;
    margin-bottom: 15px;
}

code {
    font-family: 'Courier New', Courier, monospace;
    color: #0072ff;
}

/* 折叠区域样式 */
.collapsible {
    background-color: #0072ff;
    color: white;
    cursor: pointer;
    padding: 10px;
    width: 100%;
    border: none;
    text-align: left;
    outline: none;
    font-size: 16px;
    border-radius: 5px;
    margin-bottom: 10px;
}

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

.content {
    padding: 0 15px;
    display: none;
    overflow: hidden;
    background-color: rgba(255, 255, 255, 0.8);
    border-radius: 5px;
    margin-bottom: 15px;
}

/* 按钮样式 */
.button {
    background: linear-gradient(45deg, #00c6ff, #0072ff);
    border: none;
    border-radius: 25px;
    color: white;
    padding: 15px 30px;
    font-size: 16px;
    cursor: pointer;
    transition: transform 0.3s ease, background 0.3s ease;
}

.button:hover {
    background: linear-gradient(45deg, #0072ff, #00c6ff);
    transform: scale(1.05);
}

/* 搜索框样式 */
.search-container {
    position: relative;
    display: flex;
    align-items: center;
    margin-bottom: 20px;
}

.search-input {
    padding: 10px 20px;
    border: none;
    border-radius: 20px;
    outline: none;
    transition: width 0.4s ease;
    width: 200px;
}

.search-input:focus {
    width: 300px;
}

.search-icon {
    position: absolute;
    right: 15px;
    color: #0072ff;
}

/* 章节导航样式 */
.nav-section {
    position: fixed;
    right: 20px;
    top: 100px;
    background: rgba(0, 0, 0, 0.7);
    padding: 10px;
    border-radius: 5px;
}

.nav-section ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.nav-section li {
    margin: 10px 0;
}

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

.nav-section a:hover {
    color: #00c6ff;
}

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

.code-example code {
    color: #c586c0;
}

/* 小屏幕下调整 */
@media (max-width: 768px) {
    .nav-section {
        display: none;
    }
}

