
/* 全局样式设置 */
body {
    margin: 0;
    padding: 0;
    font-family: 'Lato', sans-serif; /* 使用无衬线字体 */
    background: linear-gradient(135deg, #A7C957 70%, #ECC39D 25%, #FFA500 5%);
    color: #333;
    line-height: 1.6;
}

/* 导航栏样式 */
.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    background: #A7C957;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 1000;
    transition: background 0.3s ease;
}

.navbar.scrolled {
    background: #6B8E23;
}

.navbar a {
    color: #fff;
    text-decoration: none;
    margin: 0 10px;
    font-weight: 700;
}

.navbar a:hover {
    text-decoration: underline;
}

/* 侧边栏样式 */
.sidebar {
    position: fixed;
    left: 0;
    top: 60px;
    width: 200px;
    height: calc(100% - 60px);
    background: #ECC39D;
    padding: 20px;
    transition: transform 0.3s ease;
}

.sidebar.hidden {
    transform: translateX(-100%);
}

.sidebar a {
    display: block;
    color: #333;
    text-decoration: none;
    margin: 15px 0;
    font-weight: 600;
}

.sidebar a:hover {
    color: #FFA500;
}

/* 主内容区域样式 */
.main-content {
    margin-left: 220px;
    padding: 80px 20px;
}

@media (max-width: 768px) {
    .sidebar {
        display: none;
    }
    .main-content {
        margin-left: 0;
    }
}

/* 导航链接样式 */
.nav-links a {
    position: relative;
}

.nav-links a::after {
    content: '';
    position: absolute;
    width: 0%;
    height: 2px;
    bottom: -5px;
    left: 0;
    background-color: #fff;
    transition: width 0.3s;
}

.nav-links a:hover::after {
    width: 100%;
}

/* 按钮样式 */
.button {
    background: linear-gradient(45deg, #87CEEB, #FFA500);
    border: none;
    padding: 10px 20px;
    border-radius: 25px;
    color: #fff;
    cursor: pointer;
    transition: background 0.3s ease;
    font-size: 16px;
}

.button:hover {
    background: linear-gradient(45deg, #FFA500, #87CEEB);
}

/* 卡片布局样式 */
.grid-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    padding: 20px;
}

.card {
    background: #fff;
    border-radius: 15px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    transition: transform 0.3s ease;
}

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

.card img {
    width: 100%;
    height: auto;
    border-bottom: 2px solid #ECC39D;
}

.card-content {
    padding: 15px;
}

.card-content h3 {
    font-size: 18px;
    color: #A7C957;
    margin-bottom: 10px;
}

.card-content p {
    font-size: 16px;
    color: #555;
}

/* 动画与过渡效果 */
.animated-element {
    animation: fadeIn 1s ease-in-out forwards;
    opacity: 0;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.parallax {
    background-attachment: fixed;
    background-size: cover;
    background-position: center;
    height: 400px;
    position: relative;
    z-index: 1;
    margin-bottom: 40px;
}

/* 数据可视化样式 */
.chart-container {
    width: 100%;
    height: 400px;
    position: relative;
}

.chart {
    width: 100%;
    height: 100%;
}

.tooltip {
    position: absolute;
    background: rgba(0, 0, 0, 0.7);
    color: #fff;
    padding: 5px 10px;
    border-radius: 5px;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.tooltip.visible {
    opacity: 1;
}

/* 主题切换样式 */
:root {
    --primary-color: #A7C957;
    --secondary-color: #ECC39D;
    --accent-color: #87CEEB;
    --text-color: #333;
}

[data-theme="dark"] {
    --primary-color: #2F4F4F;
    --secondary-color: #556B2F;
    --accent-color: #FFA500;
    --text-color: #fff;
}

.dashboard {
    background: var(--secondary-color);
    color: var(--text-color);
    padding: 20px;
    transition: background 0.3s ease, color 0.3s ease;
}

.theme-toggle {
    background: var(--accent-color);
    border: none;
    padding: 10px 15px;
    border-radius: 5px;
    cursor: pointer;
    color: #fff;
    transition: background 0.3s ease;
}

.theme-toggle:hover {
    background: #555;
}

/* 表格样式 */
table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
}

table th, table td {
    border: 1px solid #ddd;
    padding: 12px;
    text-align: left;
}

table th {
    background-color: #A7C957;
    color: white;
}

table tr:nth-child(even) {
    background-color: #f2f2f2;
}

/* 代码块样式 */
pre code {
    background: #f4f4f4;
    padding: 15px;
    border-radius: 5px;
    display: block;
    overflow-x: auto;
    font-family: 'Courier New', Courier, monospace;
    color: #333;
}

/* 图片样式 */
img.decorative {
    width: 100%;
    height: auto;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    transition: transform 0.3s ease;
}

img.decorative:hover {
    transform: scale(1.05);
}

/* 章节导航样式 */
.chapter-nav {
    position: fixed;
    top: 80px;
    right: 20px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 5px;
    padding: 10px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.chapter-nav a {
    display: block;
    color: #A7C957;
    text-decoration: none;
    margin: 5px 0;
    font-size: 14px;
}

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