
/* 全局样式设置 */
body {
    margin: 0;
    padding: 0;
    font-family: 'Roboto', sans-serif; /* 设置全局字体为Roboto，无衬线字体 */
    background: linear-gradient(135deg, #1e3c72, #2a5298); /* 使用线性渐变作为背景 */
    color: #c9d1d9; /* 设置全局文字颜色 */
    line-height: 1.6;
    overflow-x: hidden; /* 避免出现水平滚动条 */
}

/* 导航栏样式 */
.navbar {
    position: fixed; /* 固定在顶部 */
    top: 0;
    width: 100%;
    background-color: rgba(13, 17, 23, 0.9); /* 半透明背景色 */
    backdrop-filter: blur(10px); /* 背景模糊效果 */
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 30px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1); /* 阴影效果 */
    z-index: 1000;
}

.navbar .logo {
    font-size: 1.5em;
    color: #21c7a8; /* 主色调 */
    text-decoration: none;
}

.navbar .menu {
    display: flex;
    gap: 20px;
}

.navbar .menu a {
    color: #c9d1d9;
    text-decoration: none;
    transition: color 0.3s;
    position: relative;
}

.navbar .menu a::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    background: #3ee9d9; /* 点缀色 */
    left: 50%;
    bottom: -5px;
    transition: width 0.3s, left 0.3s;
}

.navbar .menu a:hover::after {
    width: 100%;
    left: 0;
}

.language-switcher {
    display: flex;
    gap: 10px;
}

.language-switcher button {
    background: none;
    border: none;
    color: #c9d1d9;
    cursor: pointer;
    transition: color 0.3s;
    font-size: 1em;
}

.language-switcher button:hover {
    color: #3ee9d9;
}

/* 章节导航系统样式 */
.chapter-nav {
    position: fixed;
    top: 80px;
    left: 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 500;
}

.chapter-nav a {
    color: #c9d1d9;
    text-decoration: none;
    padding: 8px 12px;
    border-radius: 5px;
    transition: background-color 0.3s, color 0.3s;
}

.chapter-nav a:hover {
    background-color: #21c7a8;
    color: #0d1117;
}

/* 主内容区样式 */
.main-content {
    margin-top: 80px; /* 为固定导航栏留出空间 */
    padding: 20px 40px;
    display: grid;
    grid-template-columns: 1fr 3fr;
    gap: 20px;
}

/* 左侧导航隐藏在小屏幕 */
@media (max-width: 768px) {
    .chapter-nav {
        display: none;
    }
    .main-content {
        grid-template-columns: 1fr;
    }
}

/* 文章内容样式 */
article {
    background-color: rgba(30, 30, 47, 0.9); /* 深色背景 */
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
    color: #c9d1d9;
}

article h2, article h3, article h4 {
    color: #21c7a8; /* 辅助色 */
}

article pre {
    background-color: #2a2a3d;
    padding: 15px;
    border-radius: 5px;
    overflow-x: auto;
    margin: 20px 0;
}

article code {
    color: #3ee9d9; /* 点缀色 */
    font-family: 'Courier New', Courier, monospace;
}

.article-highlight {
    background-color: #1e1e2f;
    padding: 10px;
    border-left: 5px solid #21c7a8;
    margin: 20px 0;
}

/* 图片样式 */
img.decorative {
    width: 100%;
    max-width: 320px;
    height: auto;
    border-radius: 15px; /* 圆角 */
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2); /* 阴影 */
    transition: transform 0.3s, box-shadow 0.3s;
}

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

/* 提示文本样式 */
.prominent-banner {
    background: linear-gradient(135deg, #21c7a8, #3ee9d9); /* 渐变背景 */
    color: #0d1117;
    text-align: center;
    padding: 20px;
    border-radius: 10px;
    margin: 20px 0;
    font-size: 1.2em;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
}

/* 折叠区域样式 */
.collapsible {
    background-color: #2a2a3d;
    color: #c9d1d9;
    cursor: pointer;
    padding: 10px;
    width: 100%;
    border: none;
    text-align: left;
    outline: none;
    font-size: 1em;
    border-radius: 5px;
    margin: 10px 0;
    transition: background-color 0.3s;
}

.collapsible:hover {
    background-color: #21c7a8;
    color: #0d1117;
}

.content {
    padding: 0 15px;
    display: none;
    overflow: hidden;
    background-color: #1e1e2f;
    border-radius: 5px;
    margin-bottom: 10px;
}

.content.show {
    display: block;
}

/* 响应式设计 */
@media (max-width: 1200px) {
    .main-content {
        padding: 20px;
    }
}

@media (max-width: 480px) {
    .navbar {
        flex-direction: column;
        align-items: flex-start;
    }
    .navbar .menu {
        flex-direction: column;
        width: 100%;
    }
    .navbar .menu a {
        padding: 10px 0;
        width: 100%;
    }
}

/* 代码示例块样式 */
.code-sample {
    background-color: #2a2a3d;
    padding: 15px;
    border-radius: 8px;
    overflow-x: auto;
    margin: 20px 0;
}

.code-sample code {
    color: #3ee9d9;
    font-family: 'Courier New', Courier, monospace;
}

/* 按钮样式 */
.button {
    background-color: #21c7a8;
    color: #0d1117;
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    transition: transform 0.3s, background-color 0.3s;
    cursor: pointer;
    font-size: 1em;
}

.button:hover {
    transform: scale(1.05);
    background-color: #3ee9d9;
}

/* 滚动动画 */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translate3d(0, 40px, 0);
    }
    to {
        opacity: 1;
        transform: translate3d(0, 0, 0);
    }
}

.fade-in-up {
    animation: fadeInUp 1s ease forwards;
    opacity: 0;
}

/* 数据可视化仪表盘样式 */
.dashboard {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    padding: 20px;
}

.dashboard .widget {
    background-color: #1e1e2f;
    border-radius: 10px;
    padding: 15px;
    position: relative;
    overflow: hidden;
}

.dashboard .widget::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(120deg, rgba(33,199,168,0.5), rgba(62,233,217,0.5));
    animation: slide 3s linear infinite;
}

@keyframes slide {
    0% { left: -100%; }
    100% { left: 100%; }
}

.widget-content {
    position: relative;
    z-index: 1;
    color: #c9d1d9;
}

