
/* 全局样式设置 */
body {
    margin: 0;
    padding: 0;
    font-family: 'Roboto', sans-serif;
    background: linear-gradient(135deg, #e0f7fa, #a7ffeb); /* 主色调渐变背景 */
    color: #2E8B57; /* 主色 */
    line-height: 1.6;
}

/* 导航栏样式 */
.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    background: rgba(46, 139, 87, 0.9); /* 半透明主色 */
    display: flex;
    justify-content: center;
    padding: 15px 0;
    z-index: 1000;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}
.navbar a {
    color: #fff;
    text-decoration: none;
    margin: 0 15px;
    padding: 10px 20px;
    border-bottom: 2px solid transparent;
    transition: border-bottom 0.3s, color 0.3s;
}
.navbar a:hover {
    border-bottom: 2px solid #9370DB; /* 点缀色 */
    color: #FFD700; /* 点缀色 */
}

/* 主要内容区 */
.container {
    max-width: 1200px;
    margin: 100px auto 50px auto; /* 顶部留白以避开固定导航 */
    padding: 20px;
    display: grid;
    grid-template-columns: 1fr;
    gap: 40px;
}

/* 章节导航 */
.chapter-nav {
    position: sticky;
    top: 100px;
    background: rgba(255, 255, 255, 0.8);
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}
.chapter-nav h3 {
    margin-top: 0;
    color: #A0522D; /* 辅色 */
}
.chapter-nav ul {
    list-style: none;
    padding: 0;
}
.chapter-nav li {
    margin: 10px 0;
}
.chapter-nav a {
    text-decoration: none;
    color: #4682B4; /* 辅色 */
    transition: color 0.3s;
}
.chapter-nav a:hover {
    color: #2E8B57; /* 主色 */
}

/* 文章内容 */
article h2 {
    font-size: 2em;
    color: #2E8B57;
    margin-bottom: 20px;
    text-align: center;
}
article h3 {
    font-size: 1.5em;
    color: #A0522D;
    margin-top: 30px;
    margin-bottom: 10px;
}
article p {
    font-size: 16px;
    color: #333;
    margin-bottom: 15px;
}
article pre {
    background: #f4f4f4;
    padding: 15px;
    border-radius: 8px;
    overflow-x: auto;
    margin-bottom: 20px;
}
article code {
    font-family: 'Courier New', Courier, monospace;
    color: #A0522D;
}

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

/* 强调提示 */
.highlight {
    background: #FFFACD; /* 柠檬绸色 */
    padding: 20px;
    border-left: 5px solid #FFD700;
    margin: 20px 0;
    font-size: 18px;
    color: #2E8B57;
}

/* 表格样式 */
table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
}
table th, table td {
    border: 1px solid #A0522D;
    padding: 10px;
    text-align: left;
}
table th {
    background: #f0f0f0;
    color: #2E8B57;
}
table tr:nth-child(even) {
    background: #fafafa;
}

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

/* 响应式设计 */
@media (min-width: 768px) {
    .container {
        grid-template-columns: 3fr 1fr;
    }
    .chapter-nav {
        position: sticky;
        top: 80px;
    }
}
@media (max-width: 480px) {
    .navbar a {
        margin: 0 10px;
        padding: 8px 12px;
    }
    article h2 {
        font-size: 1.5em;
    }
    article h3 {
        font-size: 1.3em;
    }
    article p, article code {
        font-size: 14px;
    }
}

