
/* 全局样式设置 */
body {
    font-family: 'Helvetica Neue', Arial, sans-serif; /* 设置全局字体 */
    color: #1E203C; /* 主文本颜色 */
    margin: 0;
    padding: 0;
    background: linear-gradient(135deg, #1E203C, #8DC63F); /* 背景渐变 */
    transition: background 0.5s ease; /* 背景过渡效果 */
}

/* 导航栏样式 */
.navbar {
    position: fixed; /* 固定定位 */
    top: 0;
    width: 100%; /* 全宽 */
    background: rgba(30, 32, 60, 0.3); /* 半透明背景 */
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1); /* 阴影效果 */
    padding: 20px; /* 内边距 */
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 1000; /* 层级 */
    transition: background 0.3s ease; /* 背景过渡 */
}

.scrolled .navbar {
    background: rgba(30, 32, 60, 0.7); /* 滚动后背景颜色 */
}

.navbar a {
    color: #E0E0E0; /* 链接颜色 */
    text-decoration: none;
    margin: 0 15px;
    transition: color 0.3s ease; /* 颜色过渡 */
}

.navbar a:hover {
    color: #8DC63F; /* 悬停颜色 */
}

/* 主内容区域 */
.container {
    display: grid;
    grid-template-columns: 1fr 3fr;
    gap: 20px;
    padding: 100px 50px 50px 50px; /* 上内边距预留导航栏 */
}

.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    width: 250px;
    height: 100vh;
    background: #1E203C;
    color: #E0E0E0;
    padding: 20px;
    transition: width 0.3s;
}

.content {
    margin-left: 270px; /* 侧边栏宽度加间隙 */
    padding: 20px;
}

@media (max-width: 768px) {
    .sidebar {
        width: 200px;
    }
    .content {
        margin-left: 220px;
    }
}

@media (max-width: 480px) {
    .navbar {
        flex-direction: column;
        align-items: flex-start;
    }
    .sidebar {
        position: relative;
        width: 100%;
        height: auto;
    }
    .content {
        margin-left: 0;
    }
    .container {
        grid-template-columns: 1fr;
        padding: 100px 20px 20px 20px;
    }
}

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

h2 {
    color: #8DC63F;
    margin-bottom: 20px;
    font-size: 24px;
}

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

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

pre {
    background: #f5f5f5;
    padding: 15px;
    border-radius: 8px;
    overflow: auto;
    position: relative;
}

pre code {
    font-size: 14px;
}

pre code::before {
    content: "代码块示例";
    display: block;
    background: #8DC63F;
    color: #fff;
    padding: 5px 10px;
    border-top-left-radius: 8px;
    border-top-right-radius: 8px;
    font-size: 14px;
}

.card {
    background: #FFFFFF;
    border-radius: 10px; /* 圆角 */
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1); /* 阴影 */
    transition: transform 0.3s, box-shadow 0.3s;
    padding: 20px;
    margin-bottom: 20px;
}

.card:hover {
    transform: translateY(-10px); /* 悬浮位移 */
    box-shadow: 0 10px 15px rgba(0, 0, 0, 0.2); /* 加深阴影 */
}

.icon {
    width: 50px;
    height: 50px;
    fill: #8DC63F;
    transition: transform 0.3s, fill 0.3s;
}

.icon:hover {
    transform: rotate(20deg) scale(1.1); /* 旋转与放大 */
    fill: #A5794D; /* 颜色变化 */
}

/* 图片样式 */
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 10px 15px rgba(0, 0, 0, 0.2);
}

/* 按钮样式 */
button {
    background: #8DC63F;
    border: none;
    color: #FFFFFF;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
    transition: background 0.3s;
}

button:hover {
    background: #A5794D;
}

/* 图表样式 */
.chart-container {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 300px;
    background: #F5F5F5;
    border-radius: 10px;
    position: relative;
}

.chart-bar {
    width: 40px;
    background: #8DC63F;
    margin: 0 10px;
    transition: height 0.3s, background 0.3s;
}

.chart-bar:hover {
    background: #A5794D;
    height: 80%;
}

/* 底部样式 */
.footer {
    background: #1E203C;
    color: #E0E0E0;
    padding: 40px 20px;
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
}

.footer .knowledge-base, .footer .feedback {
    flex: 1 1 200px;
    margin: 10px;
}

.footer a {
    color: #8DC63F;
    text-decoration: none;
    transition: color 0.3s;
}

.footer a:hover {
    color: #A5794D;
}

/* 动画关键帧 */
@keyframes twinkle {
    0%, 100% { opacity: 0.8; }
    50% { opacity: 1; }
}

@keyframes draw {
    to {
        stroke-dashoffset: 0;
    }
}

/* 星星与植物线条 */
.stars {
    background: url('https://images.gptkong.com/demo/sample1.png') repeat;
    animation: twinkle 2s infinite;
}

.plant-lines {
    stroke: #8DC63F;
    stroke-dasharray: 1000;
    stroke-dashoffset: 1000;
    animation: draw 5s forwards;
}

/* 折叠菜单样式 */
.collapsible {
    background-color: #8DC63F;
    color: white;
    cursor: pointer;
    padding: 10px;
    width: 100%;
    border: none;
    text-align: left;
    outline: none;
    font-size: 16px;
    border-radius: 5px;
    margin-bottom: 10px;
    transition: background-color 0.3s;
}

.collapsible:hover {
    background-color: #A5794D;
}

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

.active + .content-collapse {
    display: block;
}

/* 提示信息样式 */
.reference-note {
    background: #fde68a;
    padding: 15px;
    border-left: 5px solid #8DC63F;
    margin: 20px 0;
    border-radius: 5px;
    font-size: 16px;
}

