
/* 全局样式设置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* 设置网页背景及字体 */
body {
    font-family: 'Roboto', sans-serif;
    background: linear-gradient(135deg, #2E8B57 70%, #1E90FF 25%, #FFA500 5%);
    color: #333;
    line-height: 1.6;
}

/* 导航栏样式 */
.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    background-color: rgba(46, 139, 87, 0.9);
    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.1);
}

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

.navbar a:hover {
    color: #FFA500;
}

/* 主容器 */
.container {
    max-width: 1200px;
    margin: 100px auto 50px auto;
    padding: 20px;
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 20px;
}

/* 侧边栏样式 */
.sidebar {
    grid-column: span 3;
    background-color: rgba(255, 255, 255, 0.8);
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.sidebar h3 {
    margin-bottom: 15px;
    font-size: 18px;
    color: #2E8B57;
}

.sidebar ul {
    list-style: none;
}

.sidebar ul li {
    margin-bottom: 10px;
}

.sidebar ul li a {
    color: #1E90FF;
    text-decoration: none;
    transition: color 0.3s ease;
}

.sidebar ul li a:hover {
    color: #FFA500;
}

/* 主内容样式 */
.main-content {
    grid-column: span 9;
}

.main-content h2 {
    font-size: 24px;
    margin-bottom: 20px;
    color: #2E8B57;
}

.main-content section {
    margin-bottom: 40px;
    padding: 20px;
    background-color: rgba(255, 255, 255, 0.9);
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    position: relative;
}

.main-content section h3 {
    font-size: 20px;
    margin-bottom: 15px;
    color: #1E90FF;
}

.main-content section p {
    font-size: 16px;
    margin-bottom: 10px;
}

.main-content section pre {
    background-color: #f0f0f0;
    padding: 15px;
    border-radius: 5px;
    overflow-x: auto;
    margin-bottom: 10px;
}

.main-content section code {
    color: #d14;
    background-color: #f9f2f4;
    padding: 2px 4px;
    border-radius: 3px;
}

/* 卡片式设计 */
.card {
    background-color: #fff;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    padding: 20px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

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

/* 图片样式 */
.image-gallery {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-top: 20px;
}

.image-gallery img {
    width: 100%;
    max-width: 320px;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.image-gallery img:hover {
    transform: scale(1.05);
    box-shadow: 0 8px 12px rgba(0,0,0,0.2);
}

/* 提示文字样式 */
.highlight {
    display: block;
    text-align: center;
    font-size: 18px;
    color: #FFA500;
    margin: 30px 0;
    font-weight: bold;
}

/* 响应式设计 */
@media (max-width: 1200px) {
    .container {
        grid-template-columns: repeat(8, 1fr);
    }
    .sidebar {
        grid-column: span 2;
    }
    .main-content {
        grid-column: span 6;
    }
}

@media (max-width: 768px) {
    .navbar {
        flex-direction: column;
        align-items: flex-start;
    }
    .navbar a {
        margin: 10px 0;
    }
    .container {
        grid-template-columns: 1fr;
        margin: 120px 20px 20px 20px;
    }
    .sidebar {
        grid-column: span 1;
        margin-bottom: 20px;
    }
    .main-content {
        grid-column: span 1;
    }
}

/* 章节导航样式 */
.chapter-nav {
    position: fixed;
    top: 60px;
    right: 30px;
    background-color: rgba(46, 139, 87, 0.9);
    padding: 15px;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

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

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

.chapter-nav ul li a {
    color: #fff;
    text-decoration: none;
    font-size: 14px;
    transition: color 0.3s ease;
}

.chapter-nav ul li a:hover {
    color: #FFA500;
}

/* CSS示例代码块样式 */
.code-example {
    background-color: #f0f0f0;
    padding: 20px;
    border-left: 5px solid #FFA500;
    margin: 20px 0;
    border-radius: 5px;
    font-family: 'Courier New', Courier, monospace;
    overflow-x: auto;
}

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

/* 按钮样式 */
.button-gradient {
    background: linear-gradient(45deg, #1E90FF, #FFA500);
    border: none;
    color: #fff;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
    transition: background 0.3s ease;
    font-size: 16px;
}

.button-gradient:hover {
    background: linear-gradient(45deg, #FFA500, #1E90FF);
}

/* 动画线条样式 */
.animated-lines {
    background: url('lines.svg') repeat-x;
    animation: moveLines 30s linear infinite;
}

@keyframes moveLines {
    0% {
        transform: translateX(0);
    }
    100% {
        transform: translateX(-100%);
    }
}

/* 按钮点击效果 */
.button:active {
    transform: scale(0.98);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* 响应式字体大小 */
html {
    font-size: 16px;
}

@media (max-width: 1200px) {
    html {
        font-size: 14px;
    }
}

@media (max-width: 768px) {
    html {
        font-size: 12px;
    }
}

