
/* 整体页面样式 */
body {
    margin: 0;
    padding: 0;
    font-family: 'Merriweather', serif;
    background: linear-gradient(135deg, #2E8B57 70%, #00BFFF 25%, #E6E6FA 5%);
    color: #333;
    line-height: 1.6;
}

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

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

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

/* 主容器样式 */
.container {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 100px 20px 50px 20px;
}

/* 文章样式 */
article {
    max-width: 1200px;
    width: 100%;
    background: rgba(255, 255, 255, 0.8);
    padding: 40px;
    border-radius: 10px;
    box-shadow: 0 8px 16px rgba(0,0,0,0.2);
    margin-bottom: 30px;
}

h2, h3 {
    font-family: 'Roboto', sans-serif;
    color: #2E8B57;
}

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

h3 {
    font-size: 22px;
    margin-top: 30px;
    margin-bottom: 15px;
}

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

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

code {
    font-family: 'Courier New', Courier, monospace;
    color: #d6336c;
}

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

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

/* 模块化布局 */
.section {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(500px, 1fr));
    gap: 30px;
    margin-bottom: 50px;
}

.section img {
    grid-column: span 1;
}

.section .text {
    grid-column: span 1;
}

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

button:hover, .btn:hover {
    background: #2E8B57;
    transform: translateY(-3px);
}

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

    .section {
        grid-template-columns: 1fr;
    }
}

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

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

/* 折叠区域样式 */
.collapsible {
    background-color: #2E8B57;
    color: white;
    cursor: pointer;
    padding: 18px;
    width: 100%;
    border: none;
    text-align: left;
    outline: none;
    font-size: 18px;
    margin-bottom: 10px;
    border-radius: 5px;
}

.active, .collapsible:hover {
    background-color: #00BFFF;
}

.content {
    padding: 0 18px;
    display: none;
    overflow: hidden;
    background-color: #f1f1f1;
    border-radius: 5px;
}

.content p {
    color: #333;
}

/* 高级CSS3示例代码块样式 */
pre code {
    position: relative;
    display: block;
    padding: 20px;
    background: #282c34;
    color: #abb2bf;
    border-radius: 5px;
    overflow: auto;
}

pre code::before {
    content: "代码示例";
    position: absolute;
    top: -20px;
    left: 0;
    background: #61dafb;
    color: #000;
    padding: 5px 10px;
    border-radius: 3px 3px 0 0;
    font-size: 14px;
}

