
/* 全局样式设置 */
/* 设置页面的背景色，使用线性渐变营造深邃的科技感 */
body {
    margin: 0;
    padding: 0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #2c3e50, #34495e);
    color: #ecf0f1;
    line-height: 1.6;
}

/* 导航栏样式 */
nav {
    position: fixed; /* 固定导航栏在顶部 */
    top: 0;
    width: 100%;
    background: rgba(44, 62, 80, 0.9); /* 半透明背景 */
    padding: 15px 20px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    z-index: 1000; /* 确保导航栏在最上层 */
}

/* 导航菜单列表 */
nav ul {
    list-style: none;
    display: flex;
    justify-content: space-around;
    align-items: center;
    margin: 0;
    padding: 0;
}

/* 导航菜单项 */
nav ul li {
    position: relative;
}

/* 导航链接样式 */
nav ul li a {
    color: #ecf0f1;
    text-decoration: none;
    padding: 10px 15px;
    transition: color 0.3s ease;
}

/* 鼠标悬停导航链接的颜色变换 */
nav ul li a:hover {
    color: #1abc9c;
}

/* 下拉菜单样式 */
nav ul li ul {
    display: none; /* 默认隐藏 */
    position: absolute;
    top: 40px;
    left: 0;
    background: rgba(44, 62, 80, 0.95);
    padding: 10px 0;
    border-radius: 5px;
    min-width: 150px;
}

/* 显示下拉菜单 */
nav ul li:hover > ul {
    display: block;
}

/* 下拉菜单项样式 */
nav ul li ul li {
    padding: 10px 20px;
}

/* 鼠标悬停下拉菜单项的背景色与动画 */
nav ul li ul li:hover {
    background: rgba(26, 188, 156, 0.8);
    transform: translateX(10px);
    transition: all 0.3s ease;
}

/* 主要内容区域的容器样式 */
.container {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 20px;
    padding: 100px 40px 40px 40px; /* 上方留出导航栏空间 */
    max-width: 1920px;
    margin: 0 auto;
}

/* 侧边栏样式 */
.sidebar {
    grid-column: 1 / 4;
    position: sticky;
    top: 100px; /* 距离顶部100px */
    background: rgba(44, 62, 80, 0.8);
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

/* 侧边栏链接样式 */
.sidebar a {
    display: block;
    color: #ecf0f1;
    text-decoration: none;
    padding: 10px 0;
    transition: color 0.3s ease;
}

/* 鼠标悬停侧边栏链接的颜色变换 */
.sidebar a:hover {
    color: #1abc9c;
}

/* 主要内容区域样式 */
.main-content {
    grid-column: 4 / -1;
    background: rgba(255, 255, 255, 0.1);
    padding: 20px;
    border-radius: 10px;
    backdrop-filter: blur(10px); /* 背景模糊 */
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
}

/* 标题样式 */
h1, h2, h3, h4 {
    color: #1abc9c;
    margin-bottom: 10px;
}

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

/* 按钮样式 */
button {
    background: linear-gradient(45deg, #1abc9c, #16a085);
    border: none;
    border-radius: 5px;
    color: #fff;
    padding: 10px 20px;
    cursor: pointer;
    transition: background 0.3s ease, transform 0.3s ease;
}

/* 鼠标悬停按钮的颜色反转与轻微放大 */
button:hover {
    background: linear-gradient(45deg, #16a085, #1abc9c);
    transform: scale(1.05);
}

/* 卡片样式 */
.card {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

/* 鼠标悬停卡片的放大与阴影增强 */
.card:hover {
    transform: scale(1.02);
    box-shadow: 0 6px 40px rgba(0, 0, 0, 0.2);
}

/* 图片样式，圆角与阴影 */
img.decorative {
    width: 100%;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

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

/* 动画关键帧 */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* 应用淡入动画到主要内容 */
.main-content {
    animation: fadeIn 2s ease-in-out;
}

/* 响应式设计：调整布局在不同屏幕宽度下的显示方式 */
@media (max-width: 1200px) {
    .container {
        grid-template-columns: repeat(8, 1fr);
    }
}

@media (max-width: 768px) {
    nav ul {
        flex-direction: column;
    }

    .container {
        grid-template-columns: 1fr;
        padding: 100px 20px 20px 20px;
    }

    .sidebar {
        grid-column: 1 / -1;
        position: static;
        margin-bottom: 20px;
    }

    .main-content {
        grid-column: 1 / -1;
    }
}

/* 代码示例区块样式 */
.code-sample {
    background: rgba(0, 0, 0, 0.7);
    padding: 15px;
    border-radius: 5px;
    overflow-x: auto;
    margin-bottom: 20px;
    font-family: 'Courier New', Courier, monospace;
    color: #2ecc71;
}

/* 使代码块内的代码高亮显示 */
.code-sample code {
    display: block;
}

/* 图片裁剪样式 */
.image-clip {
    width: 100%;
    height: auto;
    clip-path: polygon(0 0, 100% 0, 85% 100%, 15% 100%);
    transition: clip-path 0.5s ease;
}

/* 鼠标悬停时图片裁剪为圆形 */
.image-clip:hover {
    clip-path: circle(50% at 50% 50%);
}

/* 按钮互动动效 */
.button-interactive {
    background: #8e44ad;
    color: #fff;
    padding: 12px 25px;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    transition: background 0.3s ease, transform 0.3s ease;
}

/* 鼠标悬停按钮的背景色变换及上浮效果 */
.button-interactive:hover {
    background: #9b59b6;
    transform: translateY(-5px);
}

/* 动态插画元素的动效 */
.animated-illustration {
    width: 100px;
    height: 100px;
    background: url('https://images.gptkong.com/demo/sample1.png') no-repeat center center / contain;
    animation: float 6s ease-in-out infinite;
}

/* 上下浮动动画 */
@keyframes float {
    0% { transform: translateY(0px); }
    50% { transform: translateY(-20px); }
    100% { transform: translateY(0px); }
}

/* 背景视差效果 */
.parallax {
    background-image: url('https://images.gptkong.com/demo/sample2.png');
    height: 500px;
    background-attachment: fixed;
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
    position: relative;
}

/* 视差内容区样式 */
.parallax .content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #fff;
    font-size: 2em;
    text-align: center;
}

/* 数据可视化图表容器 */
.chart-container {
    display: flex;
    justify-content: space-around;
    align-items: center;
    padding: 50px;
    background: rgba(44, 62, 80, 0.8);
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
}

/* 单个图表样式 */
.chart {
    width: 200px;
    height: 200px;
    background: conic-gradient(#1abc9c 25%, #16a085 25% 50%, #2980b9 50% 75%, #8e44ad 75%);
    border-radius: 50%;
    animation: rotateChart 5s linear infinite;
}

/* 图表旋转动画 */
@keyframes rotateChart {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* 按钮交互反馈 */
button.interactive {
    padding: 10px 20px;
    border: none;
    background: #1abc9c;
    color: #fff;
    border-radius: 5px;
    cursor: pointer;
    transition: transform 0.2s ease, background 0.2s ease;
}

/* 鼠标悬停按钮的颜色变换与放大效果 */
button.interactive:hover {
    background: #16a085;
    transform: scale(1.05);
}

