
/* 
    全局样式设置
    设置页面的全局字体、背景色以及基础排版样式
*/
body {
    margin: 0;
    padding: 0;
    font-family: 'Roboto', sans-serif; /* 使用现代无衬线字体确保可读性 */
    background: linear-gradient(135deg, #f5f5dc 70%, #8B4513 25%, #FF5722 5%); /* 使用渐变背景，符合黄金比配色 */
    color: #333333;
    overflow-x: hidden; /* 防止出现横向滚动条 */
}

/* 
    导航栏样式
    固定顶部导航栏，使用复古色调和现代设计元素结合
*/
.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    background-color: #8B4513; /* 棕色主色调 */
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    z-index: 1000;
}

.navbar a {
    color: #FF5722; /* 橘红色点缀 */
    margin: 0 10px;
    text-decoration: none;
    font-size: 16px;
    transition: color 0.3s ease;
}

.navbar a:hover {
    color: #FFC107; /* 鼠标悬停时颜色过渡 */
}

/* 
    主要内容容器
    使用网格布局实现响应式设计
*/
.container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    padding: 100px 40px 40px; /* 顶部留出导航栏空间 */
}

/* 
    卡片样式
    每个功能模块使用卡片式设计，带有阴影和圆角
*/
.card {
    background-color: #ffffff;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
    transform: translateY(-10px);
    box-shadow: 0 10px 15px rgba(0, 0, 0, 0.2);
}

/* 
    卡片图片样式
    图片圆角、阴影及悬停效果
*/
.card img {
    width: 100%;
    height: auto;
    border-bottom: 2px solid #FF5722; /* 橘红色边框 */
    transition: transform 0.3s ease;
}

.card img:hover {
    transform: scale(1.05); /* 图片悬停时放大 */
}

/* 
    卡片内容样式
    内容内边距和文本排版
*/
.card-content {
    padding: 20px;
}

.card-content h3 {
    font-family: 'Georgia', serif; /* 经典衬线字体 */
    color: #4B0082; /* 深蓝色 */
    font-size: 18px;
    margin-bottom: 10px;
}

.card-content p {
    font-size: 16px;
    line-height: 1.6;
    color: #555555;
}

/* 
    导航提示样式
    突出显示提示信息
*/
.promo {
    text-align: center;
    background-color: rgba(255, 87, 34, 0.1); /* 轻微的橘红色背景 */
    padding: 15px;
    font-size: 20px;
    color: #FF5722;
    border: 2px dashed #FF5722;
    margin: 20px 0;
    border-radius: 5px;
    animation: fadeIn 2s ease-in-out;
}

/* 
    渐变动画
    为提示信息添加淡入效果
*/
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* 
    章节导航样式
    使用固定位置和滚动效果
*/
.chapter-nav {
    position: fixed;
    top: 80px;
    left: 20px;
    background-color: rgba(139, 69, 19, 0.8); /* 半透明棕色背景 */
    padding: 10px;
    border-radius: 5px;
}

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

.chapter-nav a:hover {
    background-color: #FF5722;
    padding-left: 5px;
}

/* 
    文章内容样式
    使用分割线和装饰性元素增强视觉层次
*/
article {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
}

article h2 {
    font-family: 'Georgia', serif;
    color: #4B0082;
    font-size: 24px;
    margin-bottom: 15px;
}

article h3 {
    font-family: 'Georgia', serif;
    color: #4B0082;
    font-size: 20px;
    margin-top: 20px;
    margin-bottom: 10px;
}

article p {
    font-size: 16px;
    line-height: 1.8;
    color: #333333;
    margin-bottom: 15px;
}

/* 
    图片装饰样式
    设置图片的圆角、阴影及悬停效果
*/
.decorative-image {
    width: 320px;
    height: 320px;
    object-fit: cover;
    border-radius: 15px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

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

/* 
    响应式设计
    针对不同屏幕尺寸调整布局
*/
@media (max-width: 768px) {
    .container {
        grid-template-columns: 1fr;
        padding: 80px 20px 20px;
    }

    .chapter-nav {
        display: none; /* 移动端隐藏章节导航 */
    }

    article {
        padding: 10px;
    }
}

@media (min-width: 769px) {
    .container {
        grid-template-columns: repeat(3, 1fr);
    }
}

