
/* 
    整体页面样式定义，融合未来感与高级质感
    使用CSS3高级特性，包括渐变、阴影、动画等
    响应式设计，适配各种屏幕尺寸
*/

/* 定义色彩变量，方便统一管理 */
:root {
    --primary-color: #228B22; /* 森林绿作为主色 */
    --secondary-color: #003366; /* 深蓝色作为辅色 */
    --accent-color: #FFA500; /* 鲜橙色作为点缀色 */
    --background-color: #F5F5F5; /* 页面背景色 */
    --text-color: #333333; /* 正文字体颜色 */
    --header-height: 80px; /* 导航栏高度 */
    --transition-speed: 0.3s; /* 过渡动画速度 */
}

/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* 设置页面背景色，避免使用纯白色 */
body {
    background-color: var(--background-color);
    font-family: 'Roboto', sans-serif;
    color: var(--text-color);
    line-height: 1.6;
    overflow-x: hidden; /* 防止水平滚动 */
}

/* 导航栏样式 */
.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    height: var(--header-height);
    background-color: rgba(0, 51, 102, 0.8);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 30px;
    transition: background-color var(--transition-speed) ease;
    z-index: 1000;
}

.navbar.scrolled {
    background-color: var(--secondary-color);
}

.navbar .logo {
    font-size: 24px;
    font-weight: bold;
    color: white;
}

.navbar ul {
    list-style: none;
    display: flex;
    gap: 20px;
}

.navbar ul li a {
    color: white;
    text-decoration: none;
    font-size: 16px;
    transition: color var(--transition-speed) ease;
}

.navbar ul li a:hover {
    color: var(--accent-color);
}

/* 主内容区域，留出导航栏高度 */
.main-content {
    margin-top: var(--header-height);
    padding: 40px 20px;
    display: grid;
    grid-template-columns: 1fr;
    gap: 40px;
}

/* 头部区域样式，包含背景渐变和标题 */
.header {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    padding: 100px 20px;
    text-align: center;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    position: relative;
}

/* 添加背景装饰图片，使用圆角和阴影效果 */
.header::after {
    content: "";
    background-image: url('https://images.gptkong.com/demo/sample1.png');
    background-size: cover;
    background-repeat: no-repeat;
    position: absolute;
    top: 10%;
    right: 10%;
    width: 100px;
    height: 100px;
    border-radius: 50%;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
    opacity: 0.8;
}

/* 模块化布局，使用网格系统 */
.module {
    background-color: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: transform var(--transition-speed) ease, box-shadow var(--transition-speed) ease;
}

.module:hover {
    transform: translateY(-10px);
    box-shadow: 0 8px 12px rgba(0, 0, 0, 0.2);
}

/* 图片样式，添加圆角、阴影和悬浮效果 */
.module img {
    width: 100%;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: transform var(--transition-speed) ease, box-shadow var(--transition-speed) ease;
}

.module img:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

/* 标题样式 */
h2, h3, h4 {
    font-family: 'Roboto', sans-serif;
    color: var(--secondary-color);
    margin-bottom: 15px;
}

h2 {
    font-size: 28px;
}

h3 {
    font-size: 24px;
}

h4 {
    font-size: 20px;
}

/* 段落样式 */
p {
    font-size: 16px;
    margin-bottom: 15px;
    color: var(--text-color);
}

/* 按钮样式 */
.button {
    background-color: var(--accent-color);
    color: white;
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color var(--transition-speed) ease, transform var(--transition-speed) ease;
}

.button:hover {
    background-color: darkorange;
    transform: scale(1.05);
}

/* 代码块样式 */
pre {
    background-color: #2d2d2d;
    color: #f8f8f2;
    padding: 15px;
    border-radius: 8px;
    overflow: auto;
    position: relative;
}

pre::before {
    content: "代码块";
    position: absolute;
    top: -20px;
    left: 0;
    background-color: #333;
    color: #fff;
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 14px;
}

pre code {
    font-family: 'Courier New', Courier, monospace;
    font-size: 14px;
    white-space: pre-wrap;
}

/* 滚动动画效果 */
.fade-in {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

/* 响应式设计，使用媒体查询调整布局 */
@media (min-width: 768px) {
    .main-content {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1200px) {
    .main-content {
        grid-template-columns: repeat(3, 1fr);
    }
}

