
/* 全局样式设置，采用Roboto字体，确保现代感与易读性 */
body {
    margin: 0;
    padding: 0;
    font-family: 'Roboto', sans-serif; /* 使用Roboto字体，现代感强 */
    background: linear-gradient(135deg, #2E4053 70%, #3498DB 25%, #2ECC71 5%); /* 黄金比配色，主色70%，辅色25%，点缀5% */
    color: #333;
    line-height: 1.6;
}

/* 导航栏样式设置，固定在顶部，带有半透明背景 */
.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    background: rgba(46, 64, 83, 0.9); /* 深蓝色半透明背景 */
    padding: 20px 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 1000;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1); /* 下阴影增加层次感 */
}

/* 导航链接样式，含过渡效果 */
.navbar a {
    color: #FFFFFF;
    text-decoration: none;
    margin: 0 15px;
    font-size: 16px;
    transition: color 0.3s ease;
}

.navbar a:hover {
    color: #2ECC71; /* 点缀色用于悬停效果 */
}

/* 章节导航栏样式，固定在右侧，帮助用户快速定位 */
.chapter-nav {
    position: fixed;
    right: 20px;
    top: 100px;
    background: rgba(52, 152, 219, 0.8); /* 辅色背景 */
    padding: 10px;
    border-radius: 8px;
}

.chapter-nav a {
    display: block;
    color: #FFFFFF;
    margin: 5px 0;
    text-decoration: none;
    font-size: 14px;
    transition: color 0.3s ease;
}

.chapter-nav a:hover {
    color: #2ECC71;
}

/* 主要内容区域样式，带有内边距与最大宽度限制 */
.section {
    padding: 100px 20px 60px; /* 顶部留出导航栏空间 */
    max-width: 1200px;
    margin: 0 auto;
}

/* 标题样式，含下方渐变线 */
.section h2 {
    font-size: 24px;
    color: #2E4053;
    margin-bottom: 20px;
    position: relative;
}

.section h2::after {
    content: '';
    display: block;
    width: 50px;
    height: 3px;
    background: #2ECC71; /* 点缀色 */
    margin-top: 10px;
    border-radius: 2px;
}

/* 段落样式设置，确保字体大小和颜色的协调 */
.section p {
    font-size: 17px;
    color: #34495E;
    margin-bottom: 20px;
}

/* 图片装饰样式，包含圆角、阴影与悬停效果 */
img.decorative {
    width: 100%;
    max-width: 320px;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    margin: 20px 0;
}

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

/* 代码块样式，区别于正文内容 */
pre {
    background: #F0F0F0;
    padding: 15px;
    border-radius: 5px;
    overflow-x: auto;
    font-family: 'Courier New', Courier, monospace;
    margin-bottom: 20px;
}

code {
    color: #E74C3C; /* 代码部分颜色强调 */
}

/* 按钮样式，含渐变与动态效果 */
.button {
    background: #3498DB;
    color: #FFFFFF;
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.3s ease, transform 0.3s ease;
}

.button:hover {
    background: linear-gradient(to right, #3498DB, #2ECC71);
    transform: translateY(-2px);
}

/* 仪表盘布局样式，使用Flexbox实现响应式设计 */
.dashboard {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    background: #FFFFFF;
    padding: 20px;
    border-radius: 8px;
}

.dashboard .widget {
    flex: 1 1 calc(50% - 40px);
    background: #F5F5F5;
    padding: 15px;
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: transform 0.3s ease;
}

.dashboard .widget:hover {
    transform: scale(1.05);
}

/* 背景区块样式，使用浅色背景与圆角 */
.background-section {
    background: #F5F5F5;
    padding: 60px 20px;
    margin: 40px 0;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

/* 加载动画样式，使用CSS动画实现旋转效果 */
.loader {
    border: 6px solid #f3f3f3;
    border-top: 6px solid #3498DB;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 2s linear infinite;
    margin: 20px auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 动画效果定义，用于元素的渐入效果 */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.fade-in {
    animation: fadeIn 2s ease-in-out;
}

/* 响应式设计，适应不同屏幕宽度 */
@media (max-width: 768px) {
    .navbar {
        flex-direction: column;
        padding: 10px 20px;
    }

    .nav-links {
        flex-direction: column;
        align-items: flex-start;
    }

    .nav-links a {
        margin: 10px 0;
        font-size: 15px;
    }

    .section {
        padding: 80px 10px 40px;
    }

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

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

    .dashboard .widget {
        flex: 1 1 100%;
    }

    .chapter-nav {
        top: auto;
        bottom: 20px;
        right: 10px;
    }
}

/* 章节导航链接悬停颜色变化 */
.chapter-nav a:hover {
    color: #2ECC71;
}

/* 文字高亮提示样式 */
.highlight {
    background: #2ECC71;
    color: #FFFFFF;
    padding: 5px 10px;
    border-radius: 4px;
    font-weight: bold;
}

/* 渐变线装饰元素，用于区分内容 */
.decorative-line {
    height: 2px;
    background: linear-gradient(to right, #3498DB, #2ECC71);
    margin: 20px 0;
    border-radius: 1px;
}

/* 交互提示工具提示样式 */
.tooltip {
    position: relative;
    display: inline-block;
}

.tooltip .tooltiptext {
    visibility: hidden;
    width: 140px;
    background-color: #2ECC71;
    color: #fff;
    text-align: center;
    border-radius: 6px;
    padding: 5px 0;
    position: absolute;
    z-index: 1;
    bottom: 125%; /* 位置在元素上方 */
    left: 50%;
    margin-left: -70px;
    opacity: 0;
    transition: opacity 0.3s;
}

.tooltip:hover .tooltiptext {
    visibility: visible;
    opacity: 1;
}

/* 背景过渡效果，增强视觉体验 */
.background-transition {
    background: linear-gradient(45deg, #2E4053, #3498DB, #2ECC71);
    background-size: 600% 600%;
    animation: gradient 15s ease infinite;
}

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