
/* 设置全局变量，定义主色调、辅助色和点缀色 */
:root {
    --main-color: #2C3E50; /* 深蓝色 */
    --secondary-color: #34495E; /* 灰色 */
    --accent-color: #1ABC9C; /* 蓝绿色 */
    --background-color: rgba(44, 62, 80, 0.8); /* 半透明背景色 */
    --text-color: #ecf0f1; /* 文字颜色 */
    --font-family-primary: 'Open Sans', sans-serif;
    --font-family-secondary: 'Roboto', sans-serif;
}

/* 全局样式设置 */
body {
    margin: 0;
    padding: 0;
    font-family: var(--font-family-primary);
    color: var(--text-color);
    background: linear-gradient(135deg, #2C3E50 70%, #34495E 25%, #1ABC9C 5%);
    overflow-x: hidden;
}

/* 导航栏样式 */
.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    background: rgba(44, 62, 80, 0.9);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 40px;
    z-index: 1000;
    transition: background 0.3s;
}

.navbar.scrolled {
    background: rgba(44, 62, 80, 1);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.navbar a {
    color: var(--text-color);
    text-decoration: none;
    margin: 0 15px;
    font-weight: 500;
}

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

/* 横幅区域样式 */
.banner {
    height: 400px;
    background: url('https://images.gptkong.com/demo/sample1.png') center/cover no-repeat;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-family: var(--font-family-secondary);
    position: relative;
    margin-top: 80px; /* 为固定导航栏预留空间 */
}

.banner::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    backdrop-filter: blur(5px);
    background-color: rgba(44, 62, 80, 0.5);
}

.banner-content {
    position: relative;
    z-index: 1;
    text-align: center;
}

.banner-content h1 {
    font-size: 36px;
    margin-bottom: 20px;
}

.banner-content p {
    font-size: 18px;
}

/* 主要内容容器 */
.main-content {
    display: grid;
    grid-template-columns: 1fr;
    gap: 40px;
    padding: 60px 40px;
}

.article-section {
    background: var(--background-color);
    border-radius: 15px;
    padding: 30px;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.article-section h2, .article-section h3 {
    font-family: var(--font-family-secondary);
    color: var(--text-color);
}

.article-section h2 {
    font-size: 28px;
    margin-bottom: 20px;
}

.article-section h3 {
    font-size: 22px;
    margin-top: 30px;
    margin-bottom: 15px;
}

.article-section p {
    font-size: 16px;
    line-height: 1.8;
    margin-bottom: 20px;
}

.article-section pre {
    background: #1A1A1A;
    padding: 15px;
    border-radius: 10px;
    overflow: auto;
}

.article-section code {
    color: #E74C3C;
}

/* 图片样式 */
.image-gallery {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin-top: 20px;
}

.image-gallery img {
    width: 320px;
    height: 320px;
    object-fit: cover;
    border-radius: 15px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    transition: transform 0.3s, box-shadow 0.3s;
}

.image-gallery img:hover {
    transform: scale(1.05);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.3);
}

/* 交互动效 */
.button {
    background: var(--main-color);
    color: var(--text-color);
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background 0.3s, transform 0.3s;
    font-size: 16px;
}

.button:hover {
    background: linear-gradient(45deg, var(--main-color), var(--accent-color));
    transform: scale(1.05);
}

.fade-in {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 1s ease-out, transform 1s ease-out;
}

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

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animated {
    animation: fadeInUp 1s forwards;
}

/* 响应式设计 */
@media (max-width: 1200px) {
    .main-content {
        padding: 60px 20px;
    }
    .image-gallery img {
        width: 300px;
        height: 300px;
    }
}

@media (max-width: 768px) {
    .navbar {
        flex-direction: column;
        align-items: flex-start;
        padding: 15px 20px;
    }
    .banner {
        height: 300px;
    }
    .banner-content h1 {
        font-size: 28px;
    }
    .banner-content p {
        font-size: 16px;
    }
    .image-gallery {
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .navbar a {
        margin: 10px 0;
    }
    .banner {
        height: 250px;
    }
    .banner-content h1 {
        font-size: 24px;
    }
    .banner-content p {
        font-size: 14px;
    }
    .image-gallery img {
        width: 100%;
        height: auto;
    }
}

