
/* 全局样式设置 */
body {
    margin: 0;
    padding: 0;
    font-family: 'Helvetica', 'Arial', sans-serif; /* 设置全局字体为无衬线字体，提升可读性 */
    background: linear-gradient(135deg, #F5DEB3 0%, #FFFACD 100%); /* 应用柔和的渐变背景色，营造温暖氛围 */
    color: #333; /* 全局文字颜色设为深灰，保证良好对比度 */
    line-height: 1.6; /* 提高行高，增强阅读体验 */
}

/* 标题样式 */
h1, h2, h3, h4 {
    font-family: 'Baskerville', serif; /* 使用有衬线字体，增加复古感 */
    color: #8B4513; /* 设置标题颜色为深棕色，符合复古主题 */
    margin-top: 40px;
    margin-bottom: 20px;
}

/* 导航栏样式 */
.navbar {
    position: fixed; /* 固定在页面顶部 */
    top: 0;
    width: 100%;
    background-color: rgba(139, 69, 19, 0.8); /* 半透明背景色，增强层次感 */
    display: flex;
    justify-content: space-around; /* 均匀分布导航链接 */
    align-items: center;
    padding: 15px 0;
    transition: background-color 0.5s; /* 背景色过渡效果 */
    z-index: 1000; /* 确保导航栏在最上层 */
}

.navbar.scrolled {
    background-color: rgba(139, 69, 19, 1); /* 滚动后背景色变为完全不透明 */
}

/* 导航链接样式 */
.navbar a {
    color: #FFF; /* 设置导航链接文字颜色为白色 */
    text-decoration: none; /* 移除链接下划线 */
    font-size: 18px; /* 设置导航链接字体大小 */
    padding: 10px 15px;
    transition: background-color 0.3s, transform 0.3s; /* 添加悬停过渡效果 */
}

.navbar a:hover {
    background-color: #FF7F50; /* 悬停时背景颜色变化 */
    transform: scale(1.05); /* 悬停时轻微放大 */
}

/* 主内容区布局 */
.main-content {
    display: grid;
    grid-template-columns: 1fr 3fr; /* 设置两栏布局，侧栏占1份，主栏占3份 */
    grid-gap: 30px; /* 设置网格间隙 */
    max-width: 1200px;
    margin: 100px auto 50px auto; /* 设置上下左右外边距，顶部留出导航栏空间 */
    padding: 0 20px;
}

/* 侧边导航栏样式 */
.sidebar {
    background-color: rgba(255, 255, 255, 0.9); /* 侧栏背景色为半透明白色 */
    padding: 20px;
    border-radius: 8px; /* 圆角边框 */
    box-shadow: 0 4px 6px rgba(0,0,0,0.1); /* 轻微阴影效果 */
    position: sticky;
    top: 120px; /* 侧栏在滚动时保持在视口顶部 */
}

.sidebar h2 {
    font-size: 20px;
    margin-bottom: 15px;
    color: #8B4513; /* 标题颜色与复古主题一致 */
}

.sidebar ul {
    list-style: none; /* 移除默认列表样式 */
    padding: 0;
}

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

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

.sidebar ul li a:hover {
    color: #FF7F50; /* 悬停时链接颜色变化 */
}

/* 文章内容样式 */
.article-content {
    background-color: rgba(255, 255, 255, 0.9); /* 文章背景色为半透明白色 */
    padding: 20px;
    border-radius: 8px; /* 圆角边框 */
    box-shadow: 0 4px 6px rgba(0,0,0,0.1); /* 轻微阴影效果 */
}

.article-content h1 {
    text-align: center;
    font-size: 32px;
    margin-bottom: 30px;
}

.article-content h2 {
    font-size: 24px;
    margin-top: 30px;
    margin-bottom: 15px;
}

.article-content h3 {
    font-size: 20px;
    margin-top: 25px;
    margin-bottom: 10px;
}

.article-content p {
    font-size: 16px;
    margin-bottom: 20px;
    text-align: justify; /* 两端对齐文本 */
}

.article-content img {
    width: 100%;
    max-width: 320px;
    border-radius: 10px; /* 圆角效果 */
    box-shadow: 0 4px 6px rgba(0,0,0,0.1); /* 阴影效果 */
    transition: transform 0.3s, box-shadow 0.3s; /* 悬停过渡效果 */
    margin-bottom: 20px;
    display: block;
    margin-left: auto;
    margin-right: auto;
}

.article-content img:hover {
    transform: scale(1.05); /* 悬停时放大 */
    box-shadow: 0 8px 12px rgba(0,0,0,0.2); /* 悬停时加深阴影 */
}

/* 按钮样式 */
.button {
    background-color: #FF7F50; /* 按钮背景颜色 */
    color: #FFF; /* 按钮文字颜色 */
    padding: 10px 20px;
    border: none;
    border-radius: 25px; /* 圆角按钮 */
    cursor: pointer;
    transition: background-color 0.3s, transform 0.3s; /* 悬停过渡效果 */
    display: inline-block;
    text-decoration: none;
    font-size: 16px;
}

.button:hover {
    background-color: #FFA07A; /* 悬停时背景色变化 */
    transform: translateY(-5px); /* 悬停时轻微上移 */
}

/* 响应式设计 */
@media (max-width: 768px) {
    .main-content {
        grid-template-columns: 1fr; /* 单栏布局 */
        margin: 100px 20px 20px 20px; /* 调整外边距 */
    }
    
    .sidebar {
        display: none; /* 隐藏侧边导航栏 */
    }
    
    .navbar {
        flex-direction: column; /* 导航栏垂直排列 */
    }
    
    .navbar a {
        padding: 10px;
        font-size: 16px;
    }
    
    .article-content img {
        max-width: 100%; /* 图片宽度适应小屏设备 */
    }
}

/* 数据可视化图表样式 */
.chart {
    position: relative;
    width: 200px;
    height: 200px;
    border: 5px solid #8B4513; /* 边框颜色为深棕色 */
    border-radius: 50%; /* 圆形图表 */
    background: linear-gradient(135deg, #F5DEB3, #FFFACD); /* 背景渐变 */
    margin: 40px auto; /* 居中显示 */
}

.pointer {
    position: absolute;
    width: 50%;
    height: 2px;
    background-color: #FF4500; /* 指针颜色为橙色 */
    top: 50%;
    left: 50%;
    transform-origin: 0% 50%; /* 设置旋转中心 */
    animation: rotate 5s linear infinite; /* 旋转动画 */
}

@keyframes rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* 加载动画样式 */
.loader {
    border: 8px solid #f3f3f3; /* 轻灰色边框 */
    border-top: 8px solid #FF7F50; /* 顶部边框为橙色 */
    border-radius: 50%;
    width: 60px;
    height: 60px;
    animation: spin 2s linear infinite; /* 旋转动画 */
    margin: 50px auto; /* 居中显示 */
}

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

/* 卡片式布局样式 */
.card {
    background: #FFF;
    border: 1px solid #ddd;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    padding: 20px;
    transition: transform 0.3s;
    margin-bottom: 20px;
}

.card:hover {
    transform: translateY(-10px); /* 悬停时上移 */
}

/* 按钮组样式 */
.button-group {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 30px;
}

/* 搜索框样式 */
.search-box {
    width: 100%;
    max-width: 400px;
    margin: 20px auto;
    display: flex;
}

.search-box input {
    width: 100%;
    padding: 10px 15px;
    border: 2px solid #8B4513;
    border-right: none;
    border-radius: 25px 0 0 25px;
    outline: none;
    font-size: 16px;
}

.search-box button {
    padding: 10px 20px;
    border: 2px solid #8B4513;
    background-color: #FF7F50;
    color: #FFF;
    border-radius: 0 25px 25px 0;
    cursor: pointer;
    transition: background-color 0.3s;
}

.search-box button:hover {
    background-color: #FFA07A;
}

/* 面包屑导航样式 */
.breadcrumb {
    display: flex;
    flex-wrap: wrap;
    list-style: none;
    padding: 10px 0;
    background-color: rgba(255, 255, 255, 0.8);
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    margin-bottom: 20px;
}

.breadcrumb li {
    margin-right: 5px;
}

.breadcrumb li a {
    color: #8B4513;
    text-decoration: none;
    transition: color 0.3s;
}

.breadcrumb li a:hover {
    color: #FF7F50;
}

.breadcrumb li::after {
    content: '>';
    margin-left: 5px;
    color: #8B4513;
}

.breadcrumb li:last-child::after {
    content: '';
}

/* 音频播放器样式 */
.audio-player {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 30px;
}

.audio-player audio {
    width: 100%;
    max-width: 400px;
    outline: none;
}

/* 视频内容样式 */
.video-content {
    position: relative;
    padding-bottom: 56.25%; /* 16:9 aspect ratio */
    padding-top: 25px;
    height: 0;
    margin-top: 30px;
}

.video-content iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

/* 窗口滚动动画 */
.fade-in {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 1s ease-out, transform 1s ease-out;
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

