
/* 全局样式设置 */
body {
    /* 使用深蓝到灰色的渐变背景，营造科技感 */
    background: linear-gradient(135deg, #0f2027, #203a43, #2c5364);
    color: #ffffff;
    font-family: 'Roboto', sans-serif;
    margin: 0;
    padding: 0;
    line-height: 1.6;
    font-size: 16px;
}

/* 导航栏样式 */
.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    background-color: rgba(20, 29, 53, 0.9);
    padding: 15px 30px;
    z-index: 1000;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background-color 0.3s ease;
}

.navbar.scrolled {
    background-color: rgba(20, 29, 53, 1);
}

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

.navbar a:hover {
    color: #00c6ff;
    transition: color 0.3s ease;
}

/* 侧边导航样式 */
.sidebar {
    position: fixed;
    left: 0;
    top: 60px;
    width: 220px;
    height: calc(100% - 60px);
    background-color: #152238;
    padding: 20px;
    transition: transform 0.3s ease;
}

.sidebar.hidden {
    transform: translateX(-100%);
}

.sidebar a {
    display: block;
    color: #e0e0e0;
    text-decoration: none;
    margin: 10px 0;
    font-size: 16px;
}

.sidebar a:hover {
    color: #00c6ff;
    transition: color 0.3s ease;
}

/* 容器样式 */
.container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    grid-gap: 20px;
    padding: 100px 40px 40px 280px;
}

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

.module:hover {
    transform: translateY(-10px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.5);
}

/* 标题样式 */
h1, h2, h3, h4 {
    font-family: 'Roboto', sans-serif;
    color: #ffffff;
    margin-bottom: 10px;
}

h1 {
    font-size: 24px;
    text-align: center;
    margin-top: 80px;
}

h2 {
    font-size: 20px;
    border-bottom: 2px solid #00c6ff;
    padding-bottom: 5px;
}

h3 {
    font-size: 18px;
    margin-top: 20px;
}

h4 {
    font-size: 17px;
    margin-top: 15px;
}

/* 段落与列表样式 */
p, li {
    font-size: 16px;
    color: #e0e0e0;
}

ul {
    list-style-type: disc;
    padding-left: 20px;
}

/* 图片样式 */
img {
    width: 100%;
    height: auto;
    border-radius: 12px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.5);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

img:hover {
    transform: scale(1.05);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.7);
}

/* 按钮样式 */
.button {
    display: inline-block;
    padding: 10px 20px;
    background: linear-gradient(45deg, #00c6ff, #0072ff);
    color: #ffffff;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    text-decoration: none;
    font-size: 16px;
    transition: background 0.5s ease;
}

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

/* 背景画布样式 */
.background-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
}

/* 波浪动画 */
@keyframes waveMotion {
    0% { transform: translateX(0); }
    100% { transform: translateX(-100%); }
}

.wave-animation {
    animation: waveMotion 10s linear infinite;
}

/* 滚动触发动画 */
.fade-in {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

/* 代码示例块样式 */
code {
    background-color: rgba(0, 0, 0, 0.7);
    padding: 5px 10px;
    border-radius: 5px;
    color: #00c6ff;
    font-family: 'Courier New', Courier, monospace;
}

/* 高亮代码块样式 */
pre {
    background-color: rgba(0, 0, 0, 0.85);
    padding: 15px;
    border-radius: 8px;
    overflow-x: auto;
    margin: 20px 0;
}

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

.chapter-nav a {
    display: block;
    color: #ffffff;
    text-decoration: none;
    margin: 10px 0;
    font-size: 16px;
    transition: color 0.3s ease;
}

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

/* 提示文字样式 */
.reference-note {
    text-align: center;
    font-size: 18px;
    margin: 20px 0;
    color: #00c6ff;
}

/* 加载动画样式 */
.loader {
    width: 100px;
    height: 100px;
    border: 10px solid #00c6ff;
    border-top: 10px solid transparent;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 50px auto;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* 响应式设计 */
@media (max-width: 768px) {
    .container {
        grid-template-columns: 1fr;
        padding: 100px 20px 20px 20px;
    }
    
    .sidebar {
        display: none;
    }
    
    .chapter-nav {
        position: static;
        background-color: transparent;
        padding: 0;
    }
}

