
/* 全局样式设置 */
/* 设置页面的基本字体、背景、边距和填充 */
body {
    margin: 0;
    padding: 0;
    font-family: 'Roboto', sans-serif; /* 使用现代无衬线字体，提高可读性 */
    background: linear-gradient(135deg, #4A90E2 70%, #8E44AD 25%, #FFD700 5%); /* 运用渐变色，符合黄金比配色 */
    color: #ffffff; /* 设置文字颜色为白色，增强对比度 */
    line-height: 1.6;
    transition: background 0.5s ease; /* 平滑过渡效果，便于主题切换 */
}

/* 统一的盒模型，消除元素默认外边距和填充 */
*, *::before, *::after {
    box-sizing: border-box;
}

/* 固定导航栏样式 */
.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    background: rgba(76, 175, 80, 0.8); /* 半透明背景，玻璃拟态效果 */
    backdrop-filter: blur(10px); /* 模糊背景，增加玻璃拟态质感 */
    padding: 20px 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 1000; /* 确保导航栏在最前 */
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1); /* 轻微阴影，增加深度感 */
}

/* 导航栏的链接样式 */
.navbar a {
    color: #ffffff;
    text-decoration: none;
    margin: 0 15px;
    font-size: 18px;
    transition: color 0.3s ease, transform 0.3s ease; /* 过渡动画，提升交互体验 */
}

.navbar a:hover {
    color: #FFD700; /* 高亮色，用于悬停时强调 */
    transform: scale(1.1); /* 放大效果，增强交互反馈 */
}

/* 主视觉区块样式 */
.hero {
    height: 100vh;
    background: url('https://images.gptkong.com/demo/sample1.png') center/cover no-repeat; /* 使用样式图像作为背景 */
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    position: relative;
}

/* 主视觉文案样式 */
.hero::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5); /* 半透明覆盖层，提升文字可读性 */
}

.hero-content {
    position: relative;
    z-index: 1;
}

.hero h1 {
    font-size: 48px;
    margin-bottom: 20px;
    color: #FFD700; /* 使用点缀色，突出重要信息 */
    animation: fadeInDown 1s ease-out; /* 动画效果，增强视觉吸引力 */
}

.hero p {
    font-size: 20px;
    max-width: 600px;
    margin: 0 auto;
    color: #ffffff;
    animation: fadeInUp 1s ease-out;
}

/* 渐变线条装饰元素 */
.decorative-line {
    width: 80px;
    height: 4px;
    background: linear-gradient(to right, #FFD700, #8E44AD);
    margin: 20px auto;
    border-radius: 2px;
}

/* 章节导航系统样式 */
.section-nav {
    position: fixed;
    left: 20px;
    top: 100px;
    display: flex;
    flex-direction: column;
    z-index: 999;
}

.section-nav a {
    color: #ffffff;
    text-decoration: none;
    margin: 10px 0;
    font-size: 16px;
    transition: color 0.3s ease, transform 0.3s ease;
}

.section-nav a:hover {
    color: #FFD700;
    transform: scale(1.1);
}

/* 主要内容区块样式 */
.section {
    padding: 100px 40px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
}

.section:nth-child(even) {
    background: rgba(255, 255, 255, 0.1); /* 交替背景色，增加层次感 */
}

.section-content {
    max-width: 1200px;
    width: 100%;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    align-items: center;
}

/* 图像样式 */
.section-content img {
    width: 100%;
    border-radius: 15px; /* 圆角效果 */
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3); /* 阴影效果，增加立体感 */
    transition: transform 0.3s ease, box-shadow 0.3s ease; /* 过渡动画，增强互动感 */
}

.section-content img:hover {
    transform: scale(1.05); /* 放大效果 */
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.5); /* 加深阴影，突出图像 */
}

/* 文字内容样式 */
.section-content .text {
    color: #ffffff;
}

.section-content .text h2 {
    font-size: 28px;
    margin-bottom: 20px;
    color: #FFD700;
    position: relative;
}

.section-content .text h2::after {
    content: "";
    position: absolute;
    width: 50px;
    height: 3px;
    background: #FFD700;
    left: 0;
    bottom: -10px;
    border-radius: 2px;
}

.section-content .text p {
    font-size: 16px;
    line-height: 1.8;
    color: #f0f0f0;
    margin-bottom: 15px;
}

/* CSS3代码示例部分样式 */
.code-example {
    background: rgba(0, 0, 0, 0.7);
    padding: 20px;
    border-radius: 10px;
    overflow-x: auto;
    margin: 20px 0;
}

.code-example pre {
    margin: 0;
    font-family: 'Courier New', Courier, monospace;
    font-size: 14px;
    color: #00FF00; /* 设置代码颜色为绿色 */
}

/* 页脚样式 */
.footer {
    background: rgba(76, 175, 80, 0.8);
    backdrop-filter: blur(10px);
    padding: 20px 40px;
    text-align: center;
    color: #ffffff;
    position: relative;
}

/* 滚动到顶部按钮样式 */
.scroll-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: #FFD700;
    color: #000000;
    padding: 10px 15px;
    border-radius: 50%;
    cursor: pointer;
    display: none;
    transition: background 0.3s ease, transform 0.3s ease;
    z-index: 1000;
}

.scroll-top:hover {
    background: #FFC107;
    transform: scale(1.1);
}

/* 响应式设计 */
/* 针对小屏幕设备调整布局 */
@media (max-width: 768px) {
    .navbar {
        flex-direction: column;
        align-items: flex-start;
    }

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

    .section-nav {
        display: none; /* 移动设备隐藏章节导航 */
    }

    .hero h1 {
        font-size: 32px;
    }

    .hero p {
        font-size: 16px;
    }
}

/* 动画效果 */
/* 主视觉区域文字下滑动画 */
@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 主视觉区域文字上滑动画 */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* CSS变量定义，用于主题切换 */
:root {
    --primary-color: #4A90E2;
    --secondary-color: #8E44AD;
    --highlight-color: #FFD700;
    --background-color: rgba(255, 255, 255, 0.2);
}

.dark-theme {
    --primary-color: #2C3E50;
    --secondary-color: #1ABC9C;
    --highlight-color: #FF5733;
    --background-color: rgba(0, 0, 0, 0.7);
}

/* 高亮按钮样式 */
.button-highlight {
    background-color: var(--highlight-color);
    color: #000000;
    padding: 12px 25px;
    border: none;
    border-radius: 25px;
    font-size: 16px;
    cursor: pointer;
    transition: background 0.3s ease, transform 0.3s ease;
}

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

/* 工具提示样式 */
.tooltip {
    position: relative;
    display: inline-block;
    cursor: pointer;
}

.tooltip::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 125%; /* 工具提示显示在元素上方 */
    left: 50%;
    transform: translateX(-50%);
    background-color: rgba(0, 0, 0, 0.8);
    color: #ffffff;
    padding: 8px;
    border-radius: 5px;
    white-space: nowrap;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
    font-size: 14px;
}

.tooltip:hover::after {
    opacity: 1;
}

/* 折叠/展开功能样式 */
.collapsible {
    background-color: rgba(255, 255, 255, 0.1);
    color: #ffffff;
    cursor: pointer;
    padding: 18px;
    width: 100%;
    border: none;
    text-align: left;
    outline: none;
    font-size: 18px;
    transition: background 0.3s ease;
}

.collapsible.active, .collapsible:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

.collapsible-content {
    padding: 0 18px;
    display: none;
    overflow: hidden;
    background-color: rgba(255, 255, 255, 0.05);
}

.collapsible-content p {
    margin: 10px 0;
    font-size: 16px;
}

/* 过渡动画效果 */
.fade-in {
    opacity: 0;
    animation: fadeIn 2s forwards;
}

@keyframes fadeIn {
    to {
        opacity: 1;
    }
}

