
/* 全局样式设置 */
:root {
    /* 主色调 */
    --primary-color: #2C3E50; /* 深蓝色 */
    --secondary-color: #8E44AD; /* 紫色 */
    --accent-color: #3498DB; /* 亮蓝 */
    --background-color: #ECF0F1; /* 浅灰色 */
    /* 辅助色 */
    --highlight-color: #ff6f61; /* 点缀色 */
    /* 字体 */
    --font-primary: 'Montserrat', sans-serif;
    --font-secondary: 'Open Sans', sans-serif;
}

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

body {
    font-family: var(--font-secondary);
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: #FFFFFF;
    line-height: 1.6;
    overflow-x: hidden;
    transition: background 0.5s ease;
}

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

.navbar .logo {
    font-family: var(--font-primary);
    font-size: 1.5em;
    color: var(--highlight-color);
    text-decoration: none;
}

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

.navbar ul li {
    margin-left: 20px;
    position: relative;
}

.navbar ul li a {
    color: #FFFFFF;
    text-decoration: none;
    font-size: 1em;
    transition: color 0.3s ease;
}

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

.dropdown {
    position: absolute;
    top: 40px;
    left: 0;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    backdrop-filter: blur(10px);
    display: none;
    flex-direction: column;
    padding: 10px 0;
}

.navbar ul li:hover .dropdown {
    display: flex;
}

.dropdown a {
    padding: 10px 20px;
    color: #FFFFFF;
    text-decoration: none;
    transition: background 0.3s ease;
    white-space: nowrap;
}

.dropdown a:hover {
    background: rgba(255, 111, 97, 0.2);
}

/* 主内容区域 */
.main {
    padding-top: 80px; /* 留出固定导航栏的位置 */
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* 轮播/英雄区域 */
.hero {
    width: 100%;
    min-height: 500px;
    background: url('https://images.gptkong.com/demo/sample1.png') no-repeat center center/cover;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    position: relative;
}

.hero::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(44, 62, 80, 0.6);
}

.hero-content {
    position: relative;
    text-align: center;
}

.hero-content h1 {
    font-family: var(--font-primary);
    font-size: 2.5em;
    margin-bottom: 20px;
    color: var(--highlight-color);
    animation: fadeInUp 1s ease forwards;
}

.hero-content p {
    font-size: 1.2em;
    margin-bottom: 30px;
    animation: fadeInUp 1.5s ease forwards;
}

.hero-content a {
    text-decoration: none;
    background: var(--highlight-color);
    color: #FFFFFF;
    padding: 10px 25px;
    border-radius: 25px;
    font-size: 1em;
    transition: background 0.3s ease, transform 0.3s ease;
}

.hero-content a:hover {
    background: #ff3b2e;
    transform: scale(1.05);
}

/* 模块样式 */
.section {
    width: 90%;
    max-width: 1200px;
    margin: 50px 0;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.section h2 {
    font-family: var(--font-primary);
    font-size: 2em;
    margin-bottom: 20px;
    color: var(--accent-color);
    position: relative;
}

.section h2::after {
    content: "";
    position: absolute;
    width: 50px;
    height: 3px;
    background: var(--highlight-color);
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
}

.cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    width: 100%;
}

.card {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    padding: 20px;
    box-shadow: 0 8px 32px rgba(31, 38, 135, 0.37);
    backdrop-filter: blur(8.5px);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
    transform: translateY(-10px);
    box-shadow: 0 12px 40px rgba(31, 38, 135, 0.5);
}

.card img {
    width: 100%;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    transition: transform 0.3s ease;
}

.card img:hover {
    transform: scale(1.05);
}

.card h3 {
    font-family: var(--font-primary);
    font-size: 1.5em;
    margin: 15px 0;
    color: #FFFFFF;
}

.card p {
    font-size: 1em;
    color: #ecf0f1;
}

/* 文章区域 */
.article {
    width: 90%;
    max-width: 800px;
    margin: 50px 0;
    background: rgba(255, 255, 255, 0.05);
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
}

.article h2, .article h3 {
    font-family: var(--font-primary);
    color: var(--accent-color);
}

.article p {
    font-size: 1em;
    color: #ecf0f1;
    margin-bottom: 15px;
}

.article pre {
    background: rgba(0, 0, 0, 0.7);
    padding: 15px;
    border-radius: 5px;
    overflow-x: auto;
    margin-bottom: 15px;
}

.article code {
    font-family: 'Courier New', Courier, monospace;
    color: #ecf0f1;
}

.article pre code::before {
    content: "代码示例";
    display: block;
    font-family: var(--font-primary);
    color: var(--highlight-color);
    margin-bottom: 5px;
}

.article img {
    width: 100%;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
    margin: 20px 0;
    transition: transform 0.3s ease;
}

.article img:hover {
    transform: scale(1.02);
}

/* 提示语样式 */
.reference-banner {
    background: var(--secondary-color);
    color: #FFFFFF;
    padding: 20px;
    text-align: center;
    font-size: 1.2em;
    border-radius: 10px;
    margin: 30px 0;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    animation: fadeInUp 1s ease;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .navbar ul {
        flex-direction: column;
        background: rgba(44, 62, 80, 0.9);
        position: absolute;
        top: 60px;
        right: 0;
        width: 200px;
        display: none;
    }

    .navbar ul.active {
        display: flex;
    }

    .navbar .menu-toggle {
        display: block;
        cursor: pointer;
        font-size: 1.5em;
        color: #FFFFFF;
    }

    .cards {
        grid-template-columns: 1fr;
    }

    .hero-content h1 {
        font-size: 2em;
    }
}

/* 按钮样式 */
.btn {
    display: inline-block;
    background: var(--highlight-color);
    color: #FFFFFF;
    padding: 10px 20px;
    border-radius: 25px;
    text-decoration: none;
    transition: background 0.3s ease, transform 0.3s ease;
}

.btn:hover {
    background: #ff3b2e;
    transform: scale(1.05);
}

/* 动画效果 */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideIn {
    from {
        transform: translateX(-100%);
    }
    to {
        transform: translateX(0);
    }
}


