
/* 全局样式设置 */
body {
    margin: 0;
    padding: 0;
    font-family: 'Roboto', sans-serif; /* 使用Roboto字体 */
    background: linear-gradient(135deg, #2E8B57 70%, #1E90FF 25%, #FF8C00 5%);
    color: #333;
    line-height: 1.6;
}

/* 导航栏样式 */
.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    background: rgba(30, 144, 255, 0.9);
    display: flex;
    justify-content: space-around;
    align-items: center;
    padding: 15px 0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    z-index: 1000;
}

.navbar a {
    color: #fff;
    text-decoration: none;
    font-size: 16px;
    padding: 10px 15px;
    transition: background-color 0.3s ease, transform 0.3s ease;
}

.navbar a:hover {
    background-color: #FF8C00;
    transform: scale(1.05);
    border-radius: 5px;
}

/* 主体内容容器 */
.container {
    display: grid;
    grid-template-areas:
        "header"
        "main"
        "footer";
    grid-gap: 20px;
    padding: 100px 20px 20px 20px; /* 留出导航栏空间 */
    max-width: 1200px;
    margin: 0 auto;
}

/* 章节导航 */
.chapter-nav {
    position: fixed;
    top: 60px;
    right: 20px;
    background: rgba(245, 245, 220, 0.9);
    padding: 10px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

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

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

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

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

/* 文章内容样式 */
article {
    background: rgba(255, 255, 255, 0.8);
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

article h2, article h3, article h4 {
    color: #2E8B57;
}

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

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

article h4 {
    font-size: 18px;
    margin-top: 15px;
    margin-bottom: 8px;
}

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

article pre {
    background: #f5f5f5;
    padding: 10px;
    border-radius: 5px;
    overflow-x: auto;
    margin-bottom: 15px;
}

article code {
    font-family: 'Courier New', Courier, monospace;
    background: #eaeaea;
    padding: 2px 4px;
    border-radius: 3px;
}

/* 图片样式 */
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;
    margin: 10px 0;
}

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

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

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

/* 页脚样式 */
.footer {
    background-color: #1E90FF;
    color: #fff;
    text-align: center;
    padding: 20px;
    border-radius: 10px;
    margin-top: 20px;
}

/* 加载动画样式 */
@keyframes fall {
    0% { transform: translateY(0) rotate(0deg); opacity: 1; }
    100% { transform: translateY(100vh) rotate(360deg); opacity: 0; }
}

.leaf {
    position: absolute;
    top: -50px;
    animation: fall 5s linear infinite;
    opacity: 0.8;
}

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

    .navbar .menu {
        display: none;
    }

    .navbar .hamburger {
        display: block;
    }

    .chapter-nav {
        display: none;
    }

    article {
        padding: 15px;
    }

    article h2 {
        font-size: 22px;
    }

    article h3 {
        font-size: 18px;
    }

    article h4 {
        font-size: 16px;
    }

    article p, article code {
        font-size: 14px;
    }
}

/* 代码块样式 */
.code-example {
    background: #272822;
    color: #f8f8f2;
    padding: 15px;
    border-radius: 5px;
    font-family: 'Courier New', Courier, monospace;
    overflow-x: auto;
    margin-bottom: 20px;
}

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

/* 点缀线条 */
.decorative-line {
    height: 2px;
    background: linear-gradient(90deg, #2E8B57, #1E90FF, #FF8C00);
    margin: 20px 0;
    border: none;
}

/* 提示信息样式 */
.notice {
    background-color: #FF8C00;
    color: #fff;
    text-align: center;
    padding: 10px;
    font-size: 18px;
    border-radius: 5px;
    margin-bottom: 20px;
}

/* 图文并茂区块 */
.image-text-block {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    margin-bottom: 20px;
}

.image-text-block img {
    flex: 1 1 300px;
    margin-right: 20px;
}

.image-text-block div {
    flex: 2 1 500px;
}

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

.card:hover {
    transform: translateY(-10px);
    box-shadow: 0 10px 15px rgba(0,0,0,0.2);
}

.card-header {
    background-color: #FF8C00;
    padding: 15px;
    color: #fff;
    font-size: 1.2em;
}

.card-body {
    padding: 20px;
}

/* 渐变背景 */
.section {
    height: 100vh;
    background-image: url('https://images.gptkong.com/demo/sample1.png'), url('https://images.gptkong.com/demo/sample2.png');
    background-blend-mode: overlay;
    background-color: rgba(46, 139, 87, 0.8);
    background-size: cover, contain;
    background-attachment: fixed;
}

/* 视差滚动 */
.parallax {
    background-attachment: fixed;
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
}

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

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