
/* 全局样式设置 */
/* 设置盒模型为 border-box，方便布局和元素尺寸计算 */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* 设置基础字体和背景渐变 */
body {
    font-family: 'Roboto', sans-serif; /* 使用Roboto无衬线字体，增强现代感 */
    background: linear-gradient(135deg, #0d47a1, #1e88e5); /* 采用深蓝色到浅蓝色的线性渐变，传达稳重与专业 */
    color: #ffffff; /* 全局文字颜色设为白色，确保与深色背景的对比*/
    line-height: 1.6; /* 增加行高，提升可读性 */
    overflow-x: hidden; /* 防止水平滚动条出现 */
    transition: background 0.5s, color 0.5s; /* 平滑过渡效果，适应主题切换 */
}

/* 固定导航栏样式 */
.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    background: rgba(0, 0, 0, 0.7); /* 半透明黑色背景，保持内容可见性 */
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 1000; /* 确保导航栏在最前 */
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.5); /* 添加阴影，提升层次感 */
}

/* 导航链接样式 */
.navbar a {
    color: #ffffff;
    text-decoration: none;
    margin: 0 15px;
    font-size: 16px;
    transition: color 0.3s;
}

/* 导航链接悬停效果 */
.navbar a:hover {
    color: #ff9800; /* 使用橙色作为点缀色，突出交互 */
}

/* 主内容区域样式 */
.main-content {
    padding-top: 100px; /* 留出导航栏空间 */
    display: grid;
    grid-template-columns: 1fr 3fr; /* 左侧导航，右侧内容 */
    gap: 20px;
    padding: 20px;
}

/* 侧边导航栏样式 */
.sidebar {
    position: sticky;
    top: 100px; /* 与导航栏高度一致 */
    background: rgba(0, 77, 64, 0.8); /* 墨绿色背景，增强专业感 */
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
}

/* 侧边导航链接样式 */
.sidebar a {
    display: block;
    color: #ffffff;
    text-decoration: none;
    margin: 10px 0;
    font-size: 16px;
    transition: color 0.3s, transform 0.3s;
}

/* 侧边导航链接悬停效果 */
.sidebar a:hover {
    color: #ffc107; /* 使用黄色作为点缀色 */
    transform: scale(1.05); /* 轻微放大，增强互动性 */
}

/* 内容区域样式 */
.content {
    background: rgba(255, 255, 255, 0.1); /* 半透明白色背景，增加层次感 */
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    color: #ffffff;
    backdrop-filter: blur(5px); /* 背景模糊，增强视觉效果 */
}

/* 文章标题样式 */
.content h2,
.content h3,
.content h4 {
    color: #ff9800; /* 使用橙色突出标题 */
    margin-bottom: 15px;
}

/* 文章段落样式 */
.content p {
    margin-bottom: 15px;
    font-size: 16px;
}

/* 代码块样式 */
.content pre {
    background: rgba(0, 0, 0, 0.8);
    padding: 15px;
    border-radius: 5px;
    overflow-x: auto;
    margin-bottom: 20px;
}

/* 代码块内文字样式 */
.content code {
    color: #ffc107; /* 使用黄色突出代码 */
    font-family: 'Courier New', Courier, monospace;
}

/* 图片样式 */
.content img {
    width: 100%;
    height: auto;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    transition: transform 0.3s, box-shadow 0.3s;
    margin-bottom: 20px;
}

/* 图片悬停效果 */
.content img:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.5);
}

/* 按钮样式 */
.btn-primary {
    background: linear-gradient(45deg, #ff9800, #ffc107);
    border: none;
    padding: 10px 20px;
    color: #ffffff;
    cursor: pointer;
    border-radius: 5px;
    transition: background 0.3s, transform 0.3s;
    font-size: 16px;
}

/* 按钮悬停效果 */
.btn-primary:hover {
    background: linear-gradient(45deg, #ffb74d, #ffe082);
    transform: scale(1.05);
}

/* 悬停交互元素 */
.interactive-element {
    background-color: #1e88e5;
    padding: 15px;
    border-radius: 5px;
    transition: background-color 0.3s ease, transform 0.3s ease;
}

/* 悬停交互元素效果 */
.interactive-element:hover {
    background-color: #1565c0;
    transform: scale(1.05);
}

/* 加载动画样式 */
.loader {
    border: 8px solid #f3f3f3;
    border-top: 8px solid #1e88e5;
    border-radius: 50%;
    width: 60px;
    height: 60px;
    animation: spin 2s linear infinite;
    margin: auto;
}

/* 旋转动画关键帧 */
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 返回顶部按钮样式 */
.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: #ff9800;
    color: #ffffff;
    padding: 10px 15px;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    transition: background 0.3s, transform 0.3s;
}

/* 返回顶部按钮悬停效果 */
.back-to-top:hover {
    background: #ffb74d;
    transform: scale(1.1);
}

/* 响应式布局调整 */
@media (max-width: 768px) {
    .main-content {
        grid-template-columns: 1fr; /* 垂直布局 */
    }

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

    .navbar a {
        margin: 10px 0;
    }

    .sidebar {
        position: static;
        width: 100%;
    }
}

/* 折叠区域样式 */
.collapsible {
    background-color: rgba(0, 77, 64, 0.8);
    color: #ffffff;
    cursor: pointer;
    padding: 10px;
    width: 100%;
    border: none;
    text-align: left;
    outline: none;
    font-size: 16px;
    border-radius: 5px;
    transition: background 0.3s;
}

.collapsible:hover {
    background-color: #1565c0;
}

.content-collapsible {
    padding: 0 18px;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
    background-color: rgba(0, 77, 64, 0.5);
    border-radius: 5px;
    margin-bottom: 10px;
}

/* 展开后的折叠区域样式 */
.collapsible.active + .content-collapsible {
    max-height: 500px; /* 根据内容高度调整 */
}

/* 视差背景效果 */
.parallax-background {
    background-image: url('https://images.gptkong.com/demo/sample1.png');
    height: 500px;
    background-attachment: fixed;
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
    position: relative;
    transform: translateY(-25%);
    transition: transform 0.5s ease-out;
}

/* 滚动时背景移动效果 */
body.scrolled .parallax-background {
    transform: translateY(-50%);
}

/* 数据可视化图表样式 */
.bar-chart {
    display: flex;
    align-items: flex-end;
    height: 300px;
    padding: 20px;
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.bar {
    width: 40px;
    margin: 0 10px;
    background-color: #42a5f5;
    transition: height 1s ease;
}

.bar:hover {
    background-color: #1e88e5;
}

.line-chart {
    position: relative;
    width: 100%;
    height: 300px;
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.line-chart::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    border-left: 2px solid #1e88e5;
    border-bottom: 2px solid #1e88e5;
    width: 100%;
    height: 100%;
    background: linear-gradient(to top right, #ff9800, #ffc107);
    clip-path: polygon(0 100%, 0 0, 100% 0);
    animation: drawLine 2s forwards;
}

@keyframes drawLine {
    from { clip-path: polygon(0 100%, 0 100%, 100% 100%); }
    to { clip-path: polygon(0 100%, 0 0, 100% 0); }
}

/* 3D效果图片样式 */
.scene-image {
    width: 100%;
    height: 400px;
    background-image: url('https://images.gptkong.com/demo/sample2.png');
    background-size: cover;
    background-position: center;
    transform: rotateY(15deg) rotateX(5deg);
    transition: transform 0.5s ease;
    perspective: 1000px;
}

.scene-image:hover {
    transform: rotateY(0deg) rotateX(0deg);
}

/* 虚拟现实窗口样式 */
.vr-window {
    width: 100%;
    height: 300px;
    background-color: rgba(0, 0, 0, 0.8);
    border: 2px solid #ff9800;
    border-radius: 10px;
    box-shadow: 0 0 20px rgba(255, 152, 0, 0.5);
    position: relative;
    overflow: hidden;
}

.vr-window::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 150%;
    height: 150%;
    background: radial-gradient(circle, rgba(255,152,0,0.5), rgba(0,0,0,0));
    transform: translate(-50%, -50%) scale(0);
    transition: transform 0.5s ease;
}

.vr-window:hover::before {
    transform: translate(-50%, -50%) scale(1);
}

/* 高级CSS代码示例区分样式 */
.code-example {
    background: rgba(0, 0, 0, 0.8);
    padding: 20px;
    border-radius: 8px;
    margin: 20px 0;
    overflow-x: auto;
}

.code-example code {
    color: #ff9800;
    font-family: 'Courier New', Courier, monospace;
    font-size: 14px;
}

