
/* 全局样式设置 */
body {
    margin: 0;
    padding: 0;
    font-family: 'Open Sans', sans-serif;
    background: linear-gradient(135deg, #4A90E2, #9013FE); /* 渐变背景 */
    color: #333;
    line-height: 1.6;
}

/* 导航栏样式 */
.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    background: rgba(0, 0, 0, 0.7); /* 半透明背景 */
    padding: 20px 0;
    z-index: 1000;
    display: flex;
    justify-content: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

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

.navbar ul li a {
    color: #fff;
    text-decoration: none;
    font-size: 16px;
    transition: color 0.3s;
}

.navbar ul li a:hover {
    color: #FF9800; /* 悬停时变色 */
}

/* 主页横幅样式 */
.hero {
    background: url('https://images.gptkong.com/demo/sample1.png') no-repeat center center/cover;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.hero::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5); /* 半透明覆盖层 */
}

.hero-content {
    position: relative;
    color: #fff;
    text-align: center;
    z-index: 1;
}

.hero-content h1 {
    font-size: 48px;
    margin-bottom: 20px;
    animation: fadeInDown 1s ease-out;
}

.hero-content p {
    font-size: 18px;
    animation: fadeInUp 1s ease-out;
}

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

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

/* 内容区域布局 */
.container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 40px;
    padding: 60px 20px;
    background-color: rgba(245, 245, 245, 0.9);
    margin-top: 100vh; /* 确保内容在横幅下方 */
}

/* 卡片样式 */
.card {
    background: #ffffff;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    transition: transform 0.3s, box-shadow 0.3s;
    opacity: 0;
    transform: translateY(20px);
    animation: fadeIn 1s forwards;
}

.card:hover {
    transform: translateY(-10px);
    box-shadow: 0 10px 15px rgba(0,0,0,0.2);
}

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

.image-gallery img {
    width: 100%;
    border-radius: 15px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    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.2);
}

/* 代码示例样式 */
.code-block {
    background: #2d2d2d;
    color: #f8f8f2;
    padding: 15px;
    border-radius: 8px;
    overflow-x: auto;
    font-family: 'Courier New', Courier, monospace;
    margin: 20px 0;
}

.code-block code {
    display: block;
    white-space: pre;
}

/* 表格样式 */
table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
}

table, th, td {
    border: 1px solid #ddd;
}

th, td {
    padding: 12px;
    text-align: left;
}

th {
    background-color: #f2f2f2;
}

/* 章节导航样式 */
.chapter-nav {
    position: sticky;
    top: 120px;
    background: #fff;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.chapter-nav ul {
    list-style: none;
    padding: 0;
}

.chapter-nav ul li a {
    text-decoration: none;
    color: #4A90E2;
    display: block;
    padding: 10px 0;
    transition: color 0.3s;
}

.chapter-nav ul li a:hover {
    color: #9013FE;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .navbar ul {
        flex-direction: column;
        align-items: center;
    }

    .chapter-nav {
        position: static;
        box-shadow: none;
    }

    .chapter-nav ul li a {
        text-align: center;
    }
}

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

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

/* 提示信息样式 */
.alert {
    background-color: #FFEB3B;
    padding: 15px;
    border-radius: 5px;
    text-align: center;
    font-weight: bold;
}


