
/* 全局样式设置 */
body {
    margin: 0;
    padding: 0;
    font-family: 'Roboto', sans-serif; /* 使用Roboto无衬线字体 */
    background: linear-gradient(to bottom, #1B263B, #E5E9F2); /* 从深蓝到浅灰的渐变背景 */
    color: #E5E9F2; /* 正文字体颜色为浅灰 */
    line-height: 1.6;
}

/* 容器设置，使用12列网格系统 */
.container {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 20px;
    padding: 20px;
    max-width: 1200px;
    margin: 0 auto;
}

/* 导航栏样式 */
.navbar {
    grid-column: 1 / -1;
    position: fixed;
    top: 0;
    width: 100%;
    background-color: rgba(27, 38, 59, 0.9); /* 半透明深蓝背景 */
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 15px 0;
    z-index: 1000;
    transition: background-color 0.3s ease;
}

.navbar a {
    color: #E5E9F2;
    text-decoration: none;
    margin: 0 15px;
    font-size: 18px;
    position: relative;
}

.navbar a::after {
    content: '';
    display: block;
    width: 0;
    height: 2px;
    background: #4CAF50;
    transition: width 0.3s;
    position: absolute;
    bottom: -5px;
    left: 0;
}

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

/* 主体内容区 */
.main-content {
    grid-column: 1 / -1;
    padding-top: 80px; /* 为固定导航栏留出空间 */
}

/* 章节导航样式 */
.chapter-nav {
    position: fixed;
    top: 60px;
    right: 20px;
    background-color: rgba(27, 38, 59, 0.8);
    padding: 10px;
    border-radius: 8px;
}

.chapter-nav a {
    display: block;
    color: #E5E9F2;
    text-decoration: none;
    margin: 5px 0;
    font-size: 16px;
}

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

/* 文章样式 */
article {
    grid-column: 2 / 11; /* 居中布局 */
}

article h2, article h3 {
    color: #E5E9F2;
}

article h2 {
    font-size: 24px;
    margin-bottom: 20px;
}

article h3 {
    font-size: 20px;
    margin-top: 30px;
    margin-bottom: 10px;
}

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

article pre {
    background-color: #1B263B;
    padding: 15px;
    border-radius: 8px;
    overflow-x: auto;
}

article code {
    color: #4CAF50;
    font-family: 'Courier New', Courier, monospace;
}

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

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

/* 卡片设计 */
.card {
    background-color: rgba(27, 38, 59, 0.9);
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    padding: 20px;
    transition: transform 0.3s, box-shadow 0.3s;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 12px rgba(0, 0, 0, 0.2);
}

/* 按钮样式 */
.button {
    background-color: #4CAF50;
    color: #E5E9F2;
    padding: 10px 20px;
    border: none;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.3s;
    border-radius: 5px;
}

.button:active {
    transform: scale(0.95);
    background-color: #388E3C;
}

/* 数据可视化图表样式 */
.bar {
    fill: #4CAF50;
    transition: fill 0.3s ease, transform 0.3s ease;
}

.bar:hover {
    fill: #FF9800;
    transform: scaleY(1.1);
}

/* 线条艺术样式 */
.line-art {
    stroke: #E5E9F2;
    stroke-width: 2;
    fill: none;
    transition: stroke 0.3s ease;
}

.line-art:hover {
    stroke: #4CAF50;
}

/* 微动画 */
@keyframes clickEffect {
    0% { transform: scale(1); }
    50% { transform: scale(0.95); }
    100% { transform: scale(1); }
}

.button:active {
    animation: clickEffect 0.3s;
}

/* 侧边导航隐藏显示 */
@media (max-width: 768px) {
    .chapter-nav {
        display: none;
    }
    
    .container {
        grid-template-columns: repeat(6, 1fr);
    }

    .chapter-nav a {
        font-size: 14px;
    }
}

/* 响应式设计 */
@media (max-width: 1200px) {
    .container {
        grid-template-columns: repeat(10, 1fr);
    }
}

@media (max-width: 992px) {
    .container {
        grid-template-columns: repeat(8, 1fr);
    }
}

@media (max-width: 576px) {
    .container {
        grid-template-columns: repeat(4, 1fr);
    }
}

