
/* 全局样式重置，消除不同浏览器的默认样式差异 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* 设置网页的背景色，避免使用白色，采用深色渐变 */
body {
    background: linear-gradient(135deg, #0f2027, #203a43, #2c5364);
    color: #ffffff;
    font-family: 'Roboto', sans-serif;
    line-height: 1.6;
    font-size: 16px;
    overflow-x: hidden;
}

/* 顶部导航栏样式 */
.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    background: rgba(32, 58, 67, 0.9);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 50px;
    z-index: 1000;
}

.navbar .logo {
    font-size: 1.5rem;
    color: #ffffff;
    text-decoration: none;
}

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

.navbar .menu li a {
    color: #ffffff;
    text-decoration: none;
    font-size: 1rem;
    transition: color 0.3s ease;
}

.navbar .menu li a:hover {
    color: #ff7e5f;
}

/* 主视觉区样式 */
.hero-section {
    height: 100vh;
    background: linear-gradient(-45deg, #1e3c72, #2a5298, #1e3c72, #2a5298);
    background-size: 400% 400%;
    animation: aurora 15s ease infinite;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    text-align: center;
    padding: 0 20px;
}

@keyframes aurora {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.hero-section h1 {
    font-size: 3rem;
    margin-bottom: 20px;
    color: #ffffff;
}

.hero-section p {
    font-size: 1.2rem;
    margin-bottom: 30px;
    color: #d1d1d1;
}

.cta-button {
    background: linear-gradient(45deg, #ff7e5f, #feb47b);
    border: none;
    padding: 15px 30px;
    color: #ffffff;
    font-size: 1rem;
    border-radius: 25px;
    cursor: pointer;
    transition: transform 0.3s ease, background 0.3s ease;
    text-decoration: none;
}

.cta-button:hover {
    transform: scale(1.05);
    background: linear-gradient(45deg, #feb47b, #ff7e5f);
}

/* 章节导航样式 */
.chapter-nav {
    position: fixed;
    top: 80px;
    right: 50px;
    background: rgba(32, 58, 67, 0.8);
    padding: 15px;
    border-radius: 10px;
    z-index: 999;
}

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

.chapter-nav ul li {
    margin: 10px 0;
}

.chapter-nav ul li a {
    color: #ffffff;
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.3s ease;
}

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

/* 文章内容样式 */
article {
    max-width: 1000px;
    margin: 0 auto;
    padding: 100px 20px 50px 20px;
}

article h2 {
    font-size: 2rem;
    margin-bottom: 20px;
    color: #ff7e5f;
}

article h3 {
    font-size: 1.5rem;
    margin-bottom: 15px;
    color: #feb47b;
}

article p {
    margin-bottom: 20px;
    color: #d1d1d1;
}

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

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

/* 折叠区域样式 */
.collapsible {
    background-color: rgba(32, 58, 67, 0.9);
    color: #ffffff;
    cursor: pointer;
    padding: 18px;
    width: 100%;
    border: none;
    text-align: left;
    outline: none;
    font-size: 1rem;
    transition: background 0.3s ease;
    border-radius: 5px;
    margin-bottom: 10px;
}

.collapsible:hover {
    background: #ff7e5f;
}

.content {
    padding: 0 18px;
    display: none;
    background-color: rgba(32, 58, 67, 0.5);
    overflow: hidden;
    border-radius: 5px;
    margin-bottom: 20px;
}

.content p {
    color: #d1d1d1;
}

/* 图片装饰样式 */
.decorative-image {
    width: 320px;
    height: 320px;
    object-fit: cover;
    border-radius: 15px;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.5);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.decorative-image:hover {
    transform: scale(1.05);
    box-shadow: 0 20px 30px rgba(0, 0, 0, 0.7);
    border: 2px solid #ff7e5f;
}

/* 代码示例块的样式，与正文区分开 */
.code-example {
    background: rgba(0, 0, 0, 0.7);
    padding: 20px;
    border-radius: 10px;
    overflow-x: auto;
    margin-bottom: 20px;
}

.code-example code {
    color: #ff7e5f;
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.9rem;
}

/* 底部信息区样式 */
.footer {
    background: rgba(32, 58, 67, 0.9);
    color: #d1d1d1;
    padding: 40px 50px;
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
}

.footer .contact, .footer .social {
    flex: 1 1 200px;
    margin: 10px;
}

.footer a {
    color: #feb47b;
    text-decoration: none;
    margin-right: 15px;
}

/* 加载进度条样式 */
.progress-bar {
    position: fixed;
    top: 0;
    left: 0;
    height: 5px;
    background: linear-gradient(90deg, #ff7e5f, #feb47b);
    width: 0%;
    transition: width 0.4s ease;
    z-index: 1001;
}

/* 页面加载时进度条动画 */
body.loading .progress-bar {
    width: 100%;
}

/* 响应式设计：适配不同屏幕尺寸 */
@media (max-width: 1200px) {
    .navbar {
        padding: 15px 30px;
    }

    .chapter-nav {
        top: 70px;
        right: 20px;
    }
}

@media (max-width: 768px) {
    .navbar {
        flex-direction: column;
        align-items: center;
        padding: 15px 20px;
    }

    .navbar .menu {
        flex-direction: column;
        gap: 10px;
    }

    .hero-section h1 {
        font-size: 2.5rem;
    }

    .hero-section p {
        font-size: 1rem;
    }

    .chapter-nav {
        display: none;
    }

    article {
        padding: 120px 20px 50px 20px;
    }

    .decorative-image {
        width: 100%;
        height: auto;
    }
}

@media (max-width: 480px) {
    .hero-section h1 {
        font-size: 2rem;
    }

    .hero-section p {
        font-size: 0.9rem;
    }

    .cta-button {
        padding: 10px 20px;
        font-size: 0.9rem;
    }

    article h2 {
        font-size: 1.8rem;
    }

    article h3 {
        font-size: 1.3rem;
    }
}

