
/* 全局样式设置 */
body {
    margin: 0;
    padding: 0;
    font-family: 'Roboto', sans-serif; /* 使用Roboto无衬线字体，提升可读性 */
    color: #333333; /* 主体文字颜色 */
    background: linear-gradient(to bottom, #e0f7fa, #ffffff); /* 渐变背景，提升层次感 */
    overflow-x: hidden; /* 防止出现水平滚动条 */
}

/* 导航栏样式 */
.navbar {
    position: fixed; /* 固定导航栏在顶部 */
    top: 0;
    width: 100%;
    background-color: #0277bd; /* 深蓝色背景 */
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1); /* 轻微阴影效果 */
    display: flex;
    justify-content: center;
    padding: 15px 0;
    z-index: 1000; /* 确保导航栏在最前 */
}

.navbar a {
    color: #ffffff; /* 白色文字 */
    text-decoration: none;
    font-weight: bold;
    margin: 0 20px;
    transition: color 0.3s; /* 过渡效果 */
}

.navbar a:hover {
    color: #a5d6a7; /* 悬停时变为绿色 */
}

/* 主要内容区样式 */
.main-content {
    padding: 100px 20px 50px 20px; /* 上方留出导航栏空间 */
    max-width: 1200px;
    margin: 0 auto;
}

/* 标题样式 */
h1, h2, h3, h4 {
    color: #0288d1; /* 浅蓝色 */
    margin-bottom: 20px;
}

h1 {
    font-size: 2.5em;
    text-align: center;
}

h2 {
    font-size: 2em;
    margin-top: 40px;
}

h3 {
    font-size: 1.75em;
    margin-top: 30px;
}

/* 段落样式 */
p {
    line-height: 1.6;
    margin-bottom: 20px;
    font-size: 16px;
}

/* 突出显示样式 */
.highlight {
    color: #4caf50; /* 绿色 */
    font-weight: bold;
}

/* 代码块样式 */
pre {
    background-color: #f5f5f5;
    border-left: 4px solid #81c784; /* 绿色边框 */
    padding: 10px 15px;
    overflow-x: auto;
    border-radius: 5px;
    font-family: 'Courier New', Courier, monospace;
    margin-bottom: 20px;
}

/* 按钮样式 */
.action-btn {
    background: linear-gradient(to right, #ff9800, #fb8c00); /* 橙色渐变 */
    border: none;
    padding: 12px 24px;
    border-radius: 25px;
    color: #ffffff;
    cursor: pointer;
    transition: background 0.3s, transform 0.2s;
    font-size: 16px;
}

.action-btn:hover {
    background: linear-gradient(to right, #ffa040, #ffb74d); /* 悬停时颜色变浅 */
    transform: scale(1.05); /* 放大效果 */
}

.action-btn:active {
    transform: scale(0.95); /* 按下时缩小 */
}

/* 卡片式布局容器 */
.grid-container {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin-top: 30px;
}

/* 单个卡片样式 */
.grid-item {
    flex: 1 1 calc(33.333% - 20px); /* 三列网格 */
    background-color: #ffffff;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s, box-shadow 0.3s;
    padding: 20px;
}

.grid-item:hover {
    transform: translateY(-10px); /* 悬浮上移效果 */
    box-shadow: 0 8px 12px rgba(0, 0, 0, 0.2); /* 阴影加深 */
}

/* 图片样式 */
.grid-item img {
    width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s, box-shadow 0.3s;
}

.grid-item img:hover {
    transform: scale(1.05); /* 放大效果 */
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

/* 背景装饰 */
.decorative-line {
    width: 100%;
    height: 2px;
    background: linear-gradient(to right, #81c784, #4caf50); /* 绿色渐变线 */
    margin: 40px 0;
    border: none;
}

/* 章节导航样式 */
.chapter-nav {
    position: fixed;
    right: 20px;
    top: 100px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.chapter-nav a {
    background-color: #81c784; /* 绿色背景 */
    color: #ffffff;
    padding: 10px 15px;
    border-radius: 5px;
    text-decoration: none;
    font-size: 14px;
    transition: background 0.3s;
}

.chapter-nav a:hover {
    background-color: #4caf50; /* 变深 */
}

/* 响应式设计 */
@media (max-width: 768px) {
    .grid-item {
        flex: 1 1 calc(50% - 20px); /* 两列网格 */
    }

    .chapter-nav {
        display: none; /* 移动端隐藏章节导航 */
    }
}

@media (max-width: 480px) {
    .grid-item {
        flex: 1 1 100%; /* 单列网格 */
    }

    .navbar {
        flex-direction: column;
        align-items: center;
    }

    .navbar a {
        margin: 10px 0;
    }
}

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

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

/* 数据更新动画 */
@keyframes dataFlow {
    0% { transform: translateX(-100%); opacity: 0; }
    50% { opacity: 1; }
    100% { transform: translateX(0); }
}

.data-update {
    animation: dataFlow 1s ease-in-out;
}

/* 代码块样式区别于正文 */
.code-example {
    background-color: #f0f0f0;
    padding: 15px;
    border-left: 5px solid #81c784;
    border-radius: 5px;
    font-family: 'Courier New', Courier, monospace;
    overflow-x: auto;
    margin-bottom: 20px;
    white-space: pre-wrap;
}

/* 装饰元素 */
.tech-illustration {
    background-image: url('https://images.gptkong.com/demo/sample1.png');
    background-size: cover;
    opacity: 0.2;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
}

