
/* 全局样式设置 */
body {
    margin: 0;
    padding: 0;
    font-family: 'Open Sans', sans-serif; /* 设定全局字体 */
    background: linear-gradient(135deg, #6DBE45 70%, #A67C52 25%, #87CEEB 5%); /* 使用渐变背景色 */
    color: #333; /* 正文字体颜色 */
    line-height: 1.6; /* 行高设置 */
}

/* 顶部导航栏样式 */
.navbar {
    position: fixed; /* 固定在顶部 */
    top: 0;
    width: 100%;
    background-color: rgba(255, 255, 255, 0.9); /* 半透明背景 */
    box-shadow: 0 2px 4px rgba(0,0,0,0.1); /* 阴影效果 */
    z-index: 1000; /* 确保在最上层 */
    display: flex;
    justify-content: space-around; /* 水平分布导航链接 */
    align-items: center;
    padding: 10px 0;
}

.navbar a {
    color: #6DBE45; /* 链接颜色 */
    text-decoration: none; /* 去除下划线 */
    padding: 10px 15px; /* 链接内边距 */
    transition: color 0.3s, background-color 0.3s; /* 过渡效果 */
}

.navbar a:hover {
    color: #FFD700; /* 悬停时文字颜色变化 */
    background-color: rgba(109, 190, 69, 0.1); /* 悬停时背景变化 */
    border-radius: 5px; /* 圆角效果 */
}

/* 章节导航栏样式 */
.chapter-nav {
    position: fixed;
    top: 60px; /* 导航栏下方 */
    right: 20px;
    background-color: rgba(255, 255, 255, 0.8); /* 半透明背景 */
    padding: 15px;
    border-radius: 10px; /* 圆角 */
    box-shadow: 0 2px 6px rgba(0,0,0,0.1); /* 阴影 */
}

.chapter-nav ul {
    list-style: none; /* 去除列表样式 */
    padding: 0;
    margin: 0;
}

.chapter-nav li {
    margin: 10px 0; /* 列表项间距 */
}

.chapter-nav a {
    color: #6DBE45;
    text-decoration: none;
    transition: color 0.3s; /* 过渡效果 */
}

.chapter-nav a:hover {
    color: #FFD700; /* 悬停时颜色变化 */
}

/* 主要内容区域样式 */
section {
    padding: 100px 20px 50px 20px; /* 上下内边距 */
    max-width: 1200px; /* 最大宽度 */
    margin: 0 auto; /* 居中对齐 */
}

.content-block {
    margin-bottom: 50px; /* 下方间距 */
    padding: 20px;
    background-color: #fff; /* 背景色 */
    border-radius: 15px; /* 圆角 */
    box-shadow: 0 5px 15px rgba(0,0,0,0.1); /* 阴影效果 */
    transition: transform 0.3s, box-shadow 0.3s; /* 过渡效果 */
}

.content-block:hover {
    transform: translateY(-5px); /* 悬停时上移 */
    box-shadow: 0 10px 20px rgba(0,0,0,0.2); /* 阴影加深 */
}

.content-block h2, .content-block h3, .content-block h4 {
    color: #6DBE45; /* 标题颜色 */
}

.content-block pre {
    background-color: #f4f4f4; /* 代码块背景 */
    padding: 15px;
    border-radius: 10px; /* 圆角 */
    overflow-x: auto; /* 横向滚动 */
    font-family: 'Courier New', Courier, monospace; /* 等宽字体 */
}

.content-block code {
    background-color: #f4f4f4; /* 内联代码背景 */
    padding: 2px 4px;
    border-radius: 4px; /* 圆角 */
}

/* 装饰性图片样式 */
img.decorative {
    width: 320px;
    height: 320px;
    object-fit: cover; /* 保持图片比例并裁剪 */
    border-radius: 15px; /* 圆角 */
    box-shadow: 0 4px 8px rgba(0,0,0,0.1); /* 阴影 */
    transition: transform 0.3s, box-shadow 0.3s; /* 过渡效果 */
    margin: 20px auto; /* 上下间距并居中 */
    display: block;
}

img.decorative:hover {
    transform: scale(1.05); /* 悬停时放大 */
    box-shadow: 0 8px 16px rgba(0,0,0,0.2); /* 阴影增强 */
}

/* 按钮样式 */
.button {
    background-color: #6DBE45;
    color: #fff;
    padding: 10px 20px;
    border: none;
    border-radius: 25px; /* 圆形按钮 */
    cursor: pointer;
    transition: background-color 0.3s, transform 0.2s; /* 过渡效果 */
}

.button:hover {
    background-color: #5aa33d; /* 悬停时背景色变化 */
    transform: scale(1.05); /* 放大效果 */
}

/* 自定义链接样式 */
a.custom-link {
    color: #A67C52;
    text-decoration: none;
    position: relative;
    transition: color 0.3s; /* 过渡效果 */
}

a.custom-link::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    background-color: #A67C52;
    left: 0;
    bottom: -3px;
    transition: width 0.3s; /* 过渡效果 */
}

a.custom-link:hover {
    color: #FFD700; /* 悬停时文字颜色变化 */
}

a.custom-link:hover::after {
    width: 100%; /* 下划线展开 */
}

/* 数据可视化区域样式 */
.data-visualization {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); /* 自适应列数 */
    gap: 20px; /* 网格间距 */
}

.chart-card {
    background-color: #fff;
    border-radius: 10px;
    padding: 15px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease; /* 过渡效果 */
}

.chart-card:hover {
    transform: scale(1.05); /* 悬停时放大 */
    box-shadow: 0 6px 10px rgba(0,0,0,0.15); /* 阴影增强 */
}

/* 加载指示器样式 */
.loading-indicator {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%); /* 居中显示 */
}

.loading-indicator .leaf {
    width: 20px;
    height: 20px;
    background-image: url('https://images.gptkong.com/demo/sample1.png'); /* 叶子图片 */
    background-size: cover;
    animation: fall 5s infinite; /* 飘落动画 */
    animation-delay: calc(var(--i) * 1s); /* 动画延迟 */
}

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

/* 聊天助手按钮样式 */
.chatbot-button {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background-color: #FFD700;
    border: none;
    border-radius: 50%; /* 圆形按钮 */
    width: 60px;
    height: 60px;
    cursor: pointer;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1); /* 阴影 */
    transition: transform 0.3s ease, box-shadow 0.3s ease; /* 过渡效果 */
}

.chatbot-button:hover {
    transform: scale(1.1); /* 悬停时放大 */
    box-shadow: 0 6px 10px rgba(0,0,0,0.15); /* 阴影增强 */
}

/* 聊天窗口样式 */
.chatbot-window {
    position: fixed;
    bottom: 90px;
    right: 20px;
    width: 300px;
    max-height: 400px;
    background-color: #fff;
    border-radius: 10px;
    box-shadow: 0 6px 12px rgba(0,0,0,0.2);
    opacity: 0;
    transform: translateY(20px); /* 初始位置 */
    transition: opacity 0.3s ease, transform 0.3s ease; /* 过渡效果 */
}

.chatbot-window.active {
    opacity: 1;
    transform: translateY(0); /* 激活时位置 */
}

/* 教程模块样式 */
.tutorial {
    background-color: #fff;
    border-radius: 15px;
    padding: 25px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease; /* 过渡效果 */
}

.tutorial:hover {
    transform: translateY(-5px); /* 悬停时上移 */
    box-shadow: 0 8px 16px rgba(0,0,0,0.2); /* 阴影增强 */
}

.tutorial ol {
    list-style: none; /* 去除列表样式 */
    counter-reset: step; /* 重置计数器 */
    padding-left: 0;
}

.tutorial ol li {
    position: relative;
    padding-left: 30px;
    margin-bottom: 15px;
    transition: color 0.3s ease; /* 过渡效果 */
}

.tutorial ol li::before {
    content: counter(step);
    counter-increment: step; /* 递增计数器 */
    position: absolute;
    left: 0;
    top: 0;
    background-color: #6DBE45;
    color: #fff;
    border-radius: 50%; /* 圆形 */
    width: 25px;
    height: 25px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.tutorial ol li:hover {
    color: #A67C52; /* 悬停时文字颜色变化 */
}

/* 页脚样式 */
footer {
    text-align: center;
    padding: 20px;
    background-color: #6DBE45;
    color: #fff;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .chapter-nav {
        display: none; /* 小屏幕隐藏章节导航 */
    }

    .navbar {
        flex-direction: column; /* 导航栏垂直排列 */
    }

    .navbar a {
        padding: 8px 10px; /* 减小内边距 */
    }

    img.decorative {
        width: 100%;
        height: auto; /* 自适应高度 */
    }
}

