
/* 
整体页面样式
使用CSS3的高级特性，包括渐变、阴影、动画、过渡效果等，确保页面具有自然有机风格与科技感的融合。页面采用响应式设计，适配不同屏幕尺寸，确保在320px到1920px宽度范围内的良好表现。
*/

/* 基础样式 */
body {
    margin: 0;
    font-family: 'Roboto', sans-serif;
    background: linear-gradient(135deg, #228B22 0%, #87CEFA 100%); /* 背景渐变，从绿色到蓝色 */
    color: #333;
    line-height: 1.6;
    transition: background 0.5s ease-in-out;
}

/* 导航栏样式 */
.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    background-color: rgba(34, 139, 34, 0.9); /* 半透明绿色背景 */
    padding: 15px 20px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1); /* 轻微阴影 */
    z-index: 1000;
}

.navbar ul {
    display: flex;
    list-style: none;
    justify-content: space-around;
    margin: 0;
    padding: 0;
}

.navbar li a {
    color: #fff;
    text-decoration: none;
    font-weight: bold;
    transition: color 0.3s;
}

.navbar li a:hover {
    color: #20B2AA; /* 悬停时变色 */
}

/* 面包屑导航样式 */
.breadcrumb {
    display: flex;
    list-style: none;
    padding: 10px 20px;
    background-color: #f5f5f5;
    border-radius: 5px;
    margin: 100px 20px 20px; /* 适当的上边距，避免与固定导航栏重叠 */
}

.breadcrumb li + li:before {
    content: ">";
    padding: 0 8px;
    color: #888;
}

.breadcrumb li a {
    text-decoration: none;
    color: #228B22;
    transition: color 0.3s;
}

.breadcrumb li a:hover {
    color: #20B2AA;
}

/* 主内容区样式 */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* 文章样式 */
article {
    background-color: rgba(255, 255, 255, 0.8); /* 半透明白色背景 */
    padding: 20px;
    border-radius: 15px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

/* 文章标题样式 */
article h2 {
    font-size: 1.8em;
    color: #228B22;
    margin-top: 20px;
    position: relative;
}

article h2::after {
    content: '';
    display: block;
    width: 50px;
    height: 3px;
    background-color: #20B2AA;
    margin-top: 10px;
    border-radius: 2px;
}

article h3 {
    font-size: 1.6em;
    color: #20B2AA;
    margin-top: 15px;
}

article p {
    font-size: 16px;
    margin: 10px 0;
}

/* 代码块样式 */
pre {
    background-color: #2d2d2d;
    color: #ccc;
    padding: 15px;
    border-radius: 10px;
    overflow-x: auto;
    font-family: 'Courier New', Courier, monospace;
    margin: 20px 0;
}

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

/* 按钮样式 */
.button {
    background-color: #228B22;
    color: #fff;
    padding: 10px 20px;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    transition: background-color 0.3s, transform 0.3s;
    text-decoration: none;
    display: inline-block;
}

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

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

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

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

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

/* 分隔线样式 */
.section-separator {
    background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1440 320"><path fill="%2387CEFA" fill-opacity="1" d="M0,224L60,218.7C120,213,240,203,360,208C480,213,600,235,720,245.3C840,256,960,256,1080,228.3C1200,202,1320,138,1380,110.7L1440,83.3L1440,0L1380,0C1320,0,1200,0,1080,0C960,0,840,0,720,0C600,0,480,0,360,0C240,0,120,0,60,0L0,0Z"></path></svg>');
    background-repeat: no-repeat;
    background-size: cover;
    height: 100px;
    margin: 40px 0;
}

/* 叶子飘落动画样式 */
@keyframes fall {
    0% {
        transform: translateY(-10px) rotate(0deg);
        opacity: 1;
    }
    100% {
        transform: translateY(500px) rotate(360deg);
        opacity: 0;
    }
}

.leaf {
    position: absolute;
    top: -50px;
    left: 50%;
    width: 30px;
    height: 30px;
    background: url('https://images.gptkong.com/demo/sample1.png') no-repeat center / contain;
    animation: fall 5s linear infinite;
    opacity: 0.8;
}

/* 流动线条图样式 */
@keyframes move {
    0% {
        stroke-dashoffset: 1000;
    }
    100% {
        stroke-dashoffset: 0;
    }
}

.line-chart path {
    stroke: #20B2AA;
    stroke-width: 2;
    fill: none;
    stroke-dasharray: 1000;
    animation: move 3s ease-in-out forwards;
}

/* 章节导航样式 */
.chapter-nav {
    position: fixed;
    right: 20px;
    top: 100px;
    background-color: rgba(34, 139, 34, 0.8);
    padding: 10px;
    border-radius: 10px;
    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: 10px 0;
}

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

.chapter-nav li a:hover {
    color: #20B2AA;
}

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

    .card {
        width: 90%;
        margin: 10px 0;
    }

    .section-separator {
        height: 50px;
    }

    .breadcrumb {
        flex-direction: column;
        align-items: flex-start;
    }

    .chapter-nav {
        position: static;
        background-color: transparent;
        box-shadow: none;
    }

    .chapter-nav ul {
        flex-direction: row;
        flex-wrap: wrap;
    }

    .chapter-nav li {
        margin: 5px;
    }
}

@media (max-width: 480px) {
    .button {
        width: 100%;
        padding: 15px;
        font-size: 1.2em;
    }

    .navbar li {
        margin: 10px 0;
    }

    article h2 {
        font-size: 1.5em;
    }

    article h3 {
        font-size: 1.3em;
    }

    article p {
        font-size: 15px;
    }
}

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

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

/* 动态背景元素 */
.dynamic-background {
    position: relative;
    overflow: hidden;
}

.dynamic-background::before {
    content: '';
    position: absolute;
    top: -50px;
    left: -50px;
    width: 200px;
    height: 200px;
    background: rgba(34, 139, 34, 0.3);
    border-radius: 50%;
    animation: float 10s infinite alternate;
}

.dynamic-background::after {
    content: '';
    position: absolute;
    bottom: -50px;
    right: -50px;
    width: 200px;
    height: 200px;
    background: rgba(135, 206, 250, 0.3);
    border-radius: 50%;
    animation: float 12s infinite alternate-reverse;
}

@keyframes float {
    from {
        transform: translate(0, 0);
    }
    to {
        transform: translate(50px, 50px);
    }
}

/* 高亮文本样式 */
.highlight {
    background-color: #20B2AA;
    color: #fff;
    padding: 2px 5px;
    border-radius: 3px;
}

/* 按钮链接样式 */
.button-link {
    display: inline-block;
    background-color: #228B22;
    color: #fff;
    padding: 10px 20px;
    border-radius: 25px;
    text-decoration: none;
    transition: background-color 0.3s, transform 0.3s;
}

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

/* 表格样式 */
table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
}

table th, table td {
    border: 1px solid #ddd;
    padding: 10px;
    text-align: left;
}

table th {
    background-color: #20B2AA;
    color: #fff;
}

table tr:nth-child(even) {
    background-color: #f9f9f9;
}

table tr:hover {
    background-color: #f1f1f1;
}

