
/* 全局样式设置与CSS变量定义 */
:root {
    /* 主色调：深蓝色，传达专业与信任感 */
    --primary-color: #2E4053;
    /* 辅色调：灰色，增加页面的现代感与层次感 */
    --secondary-color: #636E72;
    /* 点缀色1：橙色，用于突出重点信息 */
    --accent-orange: #FFA726;
    /* 点缀色2：绿色，用于传递温暖与活力 */
    --accent-green: #66BB6A;
    /* 背景渐变色 */
    --background-gradient: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    /* 字体颜色 */
    --text-color: #ecf0f1;
    /* 标题颜色 */
    --title-color: #ffffff;
    /* 链接颜色 */
    --link-color: var(--accent-green);
    /* 悬停链接颜色 */
    --link-hover-color: var(--accent-orange);
    /* 按钮背景颜色 */
    --button-bg: var(--accent-orange);
    /* 按钮悬停背景颜色 */
    --button-hover-bg: var(--accent-green);
}

/* 重置默认浏览器样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* 设置body的整体样式 */
body {
    font-family: 'Helvetica Neue', Arial, sans-serif;
    background: var(--background-gradient);
    color: var(--text-color);
    line-height: 1.6;
    overflow-x: hidden;
}

/* 固定导航栏的样式 */
.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    background-color: var(--primary-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    z-index: 1000;
}

/* 导航栏中的Logo样式 */
.navbar-logo {
    font-size: 1.5rem;
    font-weight: bold;
    color: #ffffff;
}

/* 导航菜单的样式 */
.navbar-menu {
    display: flex;
    gap: 1.5rem;
}

/* 导航链接的样式 */
.navbar-menu a {
    color: #ffffff;
    text-decoration: none;
    font-size: 1rem;
    transition: color 0.3s ease;
}

/* 导航链接的悬停效果 */
.navbar-menu a:hover {
    color: var(--link-hover-color);
}

/* 汉堡菜单样式（用于移动端） */
.hamburger {
    display: none;
    flex-direction: column;
    gap: 5px;
    cursor: pointer;
}

.hamburger div {
    width: 25px;
    height: 3px;
    background-color: #ffffff;
    transition: all 0.3s ease;
}

/* 显示汉堡菜单 */
@media (max-width: 768px) {
    .navbar-menu {
        display: none;
        flex-direction: column;
        background-color: var(--primary-color);
        position: absolute;
        top: 60px;
        right: 20px;
        padding: 1rem;
        border-radius: 8px;
    }

    .navbar-menu.active {
        display: flex;
    }

    .hamburger {
        display: flex;
    }
}

/* 参考提示横幅的样式 */
.reference-banner {
    background-color: var(--accent-green);
    color: #ffffff;
    text-align: center;
    padding: 1rem;
    border-radius: 8px;
    margin: 5rem 2rem 2rem 2rem;
    font-size: 1.2rem;
    font-weight: bold;
    animation: fadeIn 2s ease-in-out;
}

/* 页面主体内容的样式 */
.main-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

/* 文章标题的样式 */
.main-content article h2 {
    font-size: 2rem;
    margin-bottom: 1rem;
    color: var(--title-color);
}

/* 文章副标题的样式 */
.main-content article h3 {
    font-size: 1.5rem;
    margin-bottom: 0.75rem;
    color: var(--accent-orange);
}

/* 文章段落的样式 */
.main-content article p {
    font-size: 1rem;
    margin-bottom: 1rem;
    color: var(--text-color);
}

/* 高亮文本的样式 */
.highlight {
    color: var(--accent-orange);
}

/* 成功文本的样式 */
.success {
    color: var(--accent-green);
}

/* 代码块的样式 */
.main-content article pre {
    background-color: #2c3e50;
    padding: 1rem;
    border-radius: 8px;
    overflow-x: auto;
    margin-bottom: 1rem;
}

/* 代码文本的样式 */
.main-content article code {
    color: #ecf0f1;
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.9rem;
}

/* 模块化卡片的样式 */
.card {
    background-color: #ffffff;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    width: 48%;
    margin-bottom: 2rem;
    padding: 1.5rem;
    transition: transform 0.3s ease;
}

.card:hover {
    transform: translateY(-10px);
}

/* 内容网格布局的样式 */
.content-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 2rem;
}

/* 装饰性图片的样式 */
img.decorative {
    width: 100%;
    max-width: 320px;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

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

/* 代码示例块的样式 */
.code-sample {
    background-color: #34495e;
    padding: 1rem;
    border-radius: 8px;
    overflow-x: auto;
    margin-bottom: 1rem;
}

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

/* 浮动按钮的样式 */
.floating-button {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background-color: var(--button-bg);
    color: #ffffff;
    border: none;
    border-radius: 50%;
    width: 60px;
    height: 60px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    cursor: pointer;
    transition: transform 0.3s ease, background-color 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.floating-button:hover {
    transform: scale(1.1);
    background-color: var(--button-hover-bg);
}

/* 页脚的样式 */
.footer {
    background-color: var(--primary-color);
    padding: 2rem;
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    color: #ffffff;
}

.footer-links, .footer-contact {
    flex: 1 1 200px;
    margin: 1rem;
}

.footer-links ul {
    list-style: none;
    padding: 0;
}

.footer-links li {
    margin-bottom: 0.5rem;
}

.footer-links a {
    color: var(--link-color);
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-links a:hover {
    color: var(--link-hover-color);
}

/* 智能客服机器人的样式 */
.chatbot {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background-color: var(--button-bg);
    color: #ffffff;
    border-radius: 50%;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.3s ease;
}

.chatbot:hover {
    background-color: var(--button-hover-bg);
    transform: scale(1.1);
}

/* 页脚链接的样式 */
.footer a {
    color: var(--link-color);
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer a:hover {
    color: var(--link-hover-color);
}

/* 关键帧动画：淡入效果 */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* 响应式布局调整 */
@media (max-width: 768px) {
    .card {
        width: 100%;
    }

    .reference-banner {
        margin: 5rem 1rem 1rem 1rem;
    }

    .main-content {
        padding: 1rem;
    }

    .footer {
        flex-direction: column;
        align-items: center;
    }
}

/* 章节导航栏的样式 */
.chapter-navigation {
    position: sticky;
    top: 80px;
    background-color: var(--secondary-color);
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 2rem;
}

.chapter-navigation ul {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.chapter-navigation li a {
    color: #ffffff;
    text-decoration: none;
    transition: color 0.3s ease;
}

.chapter-navigation li a:hover {
    color: var(--accent-orange);
}

/* 折叠区域的样式 */
.accordion {
    background-color: var(--secondary-color);
    color: #ffffff;
    cursor: pointer;
    padding: 1rem;
    width: 100%;
    text-align: left;
    border: none;
    outline: none;
    transition: background-color 0.3s ease;
    border-radius: 8px;
    margin-bottom: 0.5rem;
}

.accordion.active, .accordion:hover {
    background-color: var(--accent-orange);
}

.accordion-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
    background-color: var(--primary-color);
    padding: 0 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
}

.accordion-content p {
    padding: 1rem 0;
}

/* 动画效果的样式 */
.animate-fade-in {
    animation: fadeIn 2s ease-in-out;
}

