
/* 全局样式设置 */
body {
    margin: 0;
    padding: 0;
    font-family: 'Roboto', sans-serif; /* 使用现代无衬线字体 */
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%); /* 背景渐变色，符合冷色调主色 */
    color: #ffffff; /* 全局文字颜色为白色 */
    line-height: 1.6;
}

/* 容器设置 */
.container {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 60px 0;
}

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

.navbar a {
    color: #00c6ff; /* 点缀色 */
    text-decoration: none;
    margin-left: 20px;
    transition: color 0.3s ease;
}

.navbar a:hover {
    color: #ff8c00; /* 悬停时变更颜色 */
}

/* 提示信息样式 */
.prompt {
    text-align: center;
    font-size: 18px;
    margin: 80px 0 40px;
    color: #ff8c00; /* 点缀色突出显示 */
}

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

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

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

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

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

/* 文章区块样式 */
article {
    background: rgba(255, 255, 255, 0.1);
    padding: 40px;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.3);
    margin-bottom: 40px;
}

article h2, article h3, article h4 {
    color: #00c6ff;
    margin-bottom: 20px;
}

article h2 {
    font-size: 24px;
}

article h3 {
    font-size: 20px;
}

article h4 {
    font-size: 18px;
}

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

/* 代码块样式 */
pre {
    background: #1c1c1c;
    padding: 20px;
    border-radius: 8px;
    overflow-x: auto;
    margin-bottom: 20px;
}

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

/* 图片样式 */
img.decorative {
    width: 100%;
    max-width: 320px;
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.5);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    margin: 20px 0;
}

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

/* 模块化卡片布局 */
.card-container {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    justify-content: center;
}

.card {
    background: rgba(44, 83, 100, 0.9);
    border-radius: 10px;
    width: 300px;
    padding: 20px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.3);
    transition: transform 0.3s ease, background 0.3s ease;
}

.card:hover {
    transform: translateY(-10px);
    background: rgba(44, 83, 100, 1);
}

/* 按钮样式 */
.button {
    background: #00c6ff;
    color: #ffffff;
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background 0.3s ease, transform 0.3s ease;
    text-decoration: none;
    display: inline-block;
}

.button:hover {
    background: #0072ff;
    transform: scale(1.05);
}

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

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

    .chapter-nav ul {
        display: flex;
        flex-wrap: wrap;
    }

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

    .card-container {
        flex-direction: column;
        align-items: center;
    }
}

/* 动画效果 */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.fade-in {
    animation: fadeIn 2s ease-in-out;
}

/* 过渡效果 */
.section-divider {
    height: 2px;
    background: linear-gradient(90deg, #00c6ff, #ff8c00);
    margin: 40px 0;
    border: none;
    transition: background 0.5s ease;
}

.section-divider:hover {
    background: linear-gradient(90deg, #ff8c00, #00c6ff);
}

/* 折叠区域样式 */
.collapsible {
    background: rgba(0, 0, 0, 0.5);
    color: #ffffff;
    cursor: pointer;
    padding: 18px;
    width: 100%;
    border: none;
    text-align: left;
    outline: none;
    font-size: 18px;
    border-radius: 5px;
    transition: background 0.3s ease;
}

.collapsible:hover {
    background: rgba(0, 0, 0, 0.7);
}

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

/* CSS3 示例代码区块样式 */
.css-example {
    background: #121212;
    padding: 20px;
    border-radius: 8px;
    overflow-x: auto;
}

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

/* 数据可视化样式 */
.chart {
    width: 100%;
    height: 400px;
    background: rgba(44, 83, 100, 0.8);
    border-radius: 10px;
    position: relative;
    overflow: hidden;
}

.chart .bar {
    fill: #00c6ff;
    transition: fill 0.3s ease, transform 0.3s ease;
}

.chart .bar:hover {
    fill: #0072ff;
    transform: translateY(-10px);
}

