
/* 全局样式设置，包含字体、颜色、背景等 */
body {
    margin: 0;
    padding: 0;
    font-family: 'Open Sans', sans-serif;
    color: #333333;
    background: linear-gradient(135deg, #0F4C81 70%, #3D7B9C 25%, #FF9900 5%);
    line-height: 1.6;
    overflow-x: hidden;
    transition: background 0.5s ease;
}

/* 导航栏样式 */
.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    background-color: rgba(15, 76, 129, 0.9);
    padding: 20px 40px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    z-index: 1000;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background-color 0.3s ease;
}

.navbar:hover {
    background-color: rgba(61, 123, 156, 0.9);
}

.navbar a {
    color: #FFFFFF;
    margin: 0 15px;
    text-decoration: none;
    font-weight: bold;
    transition: color 0.3s ease;
}

.navbar a:hover {
    color: #FF9900;
}

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

.header::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 76, 129, 0.7);
}

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

.header h1 {
    font-size: 48px;
    margin-bottom: 20px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
}

.header p {
    font-size: 18px;
}

/* 章节导航样式 */
.section-nav {
    position: fixed;
    top: 80px;
    right: 20px;
    background-color: rgba(255, 153, 0, 0.9);
    padding: 10px 20px;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

.section-nav a {
    display: block;
    color: #FFFFFF;
    margin: 10px 0;
    text-decoration: none;
    transition: color 0.3s ease;
}

.section-nav a:hover {
    color: #3D7B9C;
}

/* 主要内容区样式 */
.main-content {
    padding: 100px 40px 40px 40px;
    max-width: 1200px;
    margin: 0 auto;
}

.section {
    margin-bottom: 60px;
}

.section h2 {
    font-size: 32px;
    color: #0F4C81;
    margin-bottom: 20px;
    position: relative;
}

.section h2::after {
    content: "";
    width: 50px;
    height: 4px;
    background-color: #FF9900;
    position: absolute;
    left: 0;
    bottom: -10px;
}

.section h3 {
    font-size: 24px;
    color: #3D7B9C;
    margin-top: 40px;
    margin-bottom: 15px;
}

.section p {
    font-size: 16px;
    margin-bottom: 20px;
    color: #333333;
}

.section pre {
    background-color: #F5F5F5;
    padding: 15px;
    border-radius: 8px;
    overflow-x: auto;
    margin-bottom: 20px;
}

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

/* 图片样式 */
.section img {
    width: 100%;
    max-width: 320px;
    height: auto;
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    margin: 20px 0;
}

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

/* 代码块样式 */
.code-block {
    background-color: #2D2D2D;
    color: #CCCCCC;
    padding: 20px;
    border-radius: 8px;
    overflow-x: auto;
    font-family: 'Courier New', Courier, monospace;
    margin-bottom: 20px;
}

.code-block::before {
    content: "代码示例";
    display: block;
    font-weight: bold;
    margin-bottom: 10px;
    color: #FF9900;
}

/* 折叠区域样式 */
.collapsible {
    background-color: #FF9900;
    color: #FFFFFF;
    cursor: pointer;
    padding: 18px;
    width: 100%;
    border: none;
    text-align: left;
    outline: none;
    font-size: 18px;
    border-radius: 8px;
    transition: background-color 0.3s ease;
}

.collapsible:hover {
    background-color: #5EBD3E;
}

.collapsible:after {
    content: '\002B';
    font-size: 13px;
    float: right;
}

.collapsible.active:after {
    content: "\2212";
}

.content {
    padding: 0 18px;
    display: none;
    overflow: hidden;
    background-color: #f1f1f1;
    border-radius: 8px;
    margin-bottom: 20px;
}

.content p {
    color: #333333;
}

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

    .section-nav {
        display: none;
    }

    .header h1 {
        font-size: 32px;
    }

    .header p {
        font-size: 16px;
    }

    .main-content {
        padding: 100px 20px 20px 20px;
    }
}

@media (max-width: 480px) {
    .header h1 {
        font-size: 24px;
    }

    .section h2 {
        font-size: 24px;
    }

    .section h3 {
        font-size: 20px;
    }

    .section p {
        font-size: 14px;
    }
}

/* 按钮样式 */
.button {
    background: linear-gradient(45deg, #FF9900, #5EBD3E);
    border: none;
    border-radius: 25px;
    color: #FFFFFF;
    padding: 12px 30px;
    font-size: 16px;
    cursor: pointer;
    transition: transform 0.2s ease, background 0.3s ease;
}

.button:hover {
    transform: scale(1.05);
    background: linear-gradient(45deg, #5EBD3E, #FF9900);
}

/* 动画效果 */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

.fade-in {
    animation: fadeIn 1s forwards;
}

.slide-in {
    animation: slideIn 1s forwards;
}

/* 图片轮播样式 */
.carousel {
    display: flex;
    overflow-x: scroll;
    scroll-snap-type: x mandatory;
    gap: 20px;
    padding: 20px 0;
}

.carousel img {
    scroll-snap-align: center;
}

/* 代码示例样式 */
.code-example {
    background-color: #1E1E1E;
    color: #C5C8C6;
    padding: 20px;
    border-radius: 8px;
    font-family: 'Courier New', Courier, monospace;
    margin-bottom: 20px;
}

.code-example::before {
    content: "CSS3 示例代码";
    display: block;
    font-weight: bold;
    margin-bottom: 10px;
    color: #FF9900;
}

