
/* 全局样式设置 */
body {
    margin: 0;
    padding: 0;
    font-family: 'Roboto', sans-serif;
    font-size: 16px;
    line-height: 1.6;
    background: linear-gradient(135deg, #2E4053 70%, #6C5CE7 25%, #8EF7B1 5%);
    color: #FFFFFF;
    overflow-x: hidden;
}

/* 导航栏样式 */
nav {
    position: fixed;
    top: 0;
    width: 100%;
    background: rgba(46, 64, 83, 0.9);
    padding: 20px;
    z-index: 1000;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

nav .logo {
    font-size: 24px;
    font-weight: bold;
}

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

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

nav ul li a:hover {
    color: #8EF7B1;
}

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

.header::after {
    content: "这是一个网页样式设计参考";
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(46, 64, 83, 0.8);
    padding: 10px 20px;
    border-radius: 20px;
    font-size: 18px;
    color: #8EF7B1;
}

/* 章节导航栏样式 */
.sidebar {
    position: fixed;
    top: 100px;
    left: 20px;
    background: rgba(46, 64, 83, 0.8);
    padding: 20px;
    border-radius: 10px;
}

.sidebar ul {
    list-style: none;
}

.sidebar ul li {
    margin-bottom: 10px;
}

.sidebar ul li a {
    text-decoration: none;
    color: #FFFFFF;
    transition: color 0.3s;
}

.sidebar ul li a:hover {
    color: #8EF7B1;
}

/* 文章内容样式 */
.content {
    padding: 100px 20px 50px 300px;
    max-width: 1200px;
    margin: 0 auto;
}

.content h2,
.content h3,
.content h4 {
    color: #8EF7B1;
    margin-top: 40px;
    margin-bottom: 20px;
}

.content p {
    margin-bottom: 20px;
}

.content pre {
    background: rgba(255, 255, 255, 0.1);
    padding: 15px;
    border-radius: 8px;
    overflow-x: auto;
    margin-bottom: 20px;
}

.content pre code {
    font-family: 'Courier New', Courier, monospace;
    color: #FFD700;
    display: block;
    white-space: pre-wrap;
}

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

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

/* 折叠区域样式 */
details {
    background: rgba(46, 64, 83, 0.7);
    padding: 10px 20px;
    border-radius: 8px;
    margin-bottom: 20px;
}

details summary {
    cursor: pointer;
    font-weight: bold;
    color: #FFD700;
}

details[open] summary {
    color: #8EF7B1;
}

details p {
    margin-top: 10px;
}

/* 代码示例样式 */
.code-example {
    background: #1e1e1e;
    padding: 15px;
    border-radius: 8px;
    overflow-x: auto;
    margin-bottom: 20px;
}

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

/* 响应式设计 */
@media (max-width: 1920px) {
    .content {
        padding: 100px 40px 50px 300px;
    }
}

@media (max-width: 1200px) {
    .sidebar {
        left: 10px;
    }

    .content {
        padding: 100px 20px 50px 200px;
    }
}

@media (max-width: 768px) {
    nav ul {
        display: none;
    }

    .sidebar {
        display: none;
    }

    .content {
        padding: 120px 20px 50px 20px;
    }

    .header {
        background: url('https://images.gptkong.com/demo/sample2.png') no-repeat center center/cover;
    }
}

@media (max-width: 480px) {
    .header::after {
        font-size: 16px;
        padding: 8px 16px;
    }

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

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

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

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

.section {
    animation: fadeIn 1s ease-in;
}

