
/* 全局样式设置 */
body {
    margin: 0;
    padding: 0;
    font-family: 'Roboto', sans-serif; /* 使用现代无衬线字体 */
    background: linear-gradient(135deg, #2c3e50, #4ca1af); /* 主色调渐变背景 */
    color: #ecf0f1;
    overflow-x: hidden; /* 避免水平滚动条 */
}

/* 导航栏样式 */
.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    background: rgba(44, 62, 80, 0.8); /* 模糊透明效果 */
    backdrop-filter: blur(10px); /* 背景模糊 */
    padding: 15px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 1000;
}

.navbar a {
    color: #ecf0f1;
    margin: 0 15px;
    text-decoration: none;
    transition: color 0.3s ease;
}

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

/* 主要内容区样式 */
.container {
    padding-top: 80px; /* 为导航栏留出空间 */
    display: flex;
    flex-direction: column;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
}

/* 章节导航系统 */
.chapter-nav {
    position: fixed;
    right: 20px;
    top: 100px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.chapter-nav a {
    background: #34495e;
    color: #ecf0f1;
    padding: 10px 15px;
    border-radius: 5px;
    text-decoration: none;
    transition: background 0.3s ease;
}

.chapter-nav a:hover {
    background: #f39c12;
}

/* 文章内容样式 */
article {
    width: 100%;
    line-height: 1.6;
}

article h2, article h3, article h4 {
    color: #f1c40f; /* 主色调用于标题 */
}

article pre {
    background: rgba(255, 255, 255, 0.1);
    padding: 15px;
    border-radius: 8px;
    overflow-x: auto;
    margin: 20px 0;
}

article code {
    color: #2ecc71;
    font-family: 'Courier New', Courier, monospace;
}

article table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
}

article table, article th, article td {
    border: 1px solid #7f8c8d;
}

article th, article td {
    padding: 10px;
    text-align: left;
}

/* 图片样式 */
img.decorative {
    width: 100%;
    max-width: 320px;
    border-radius: 10px;
    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 10px 15px rgba(0,0,0,0.5);
}

/* 卡片式设计 */
.card {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    padding: 30px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    margin: 20px 0;
}

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

/* 动画效果 */
.fade-in {
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInUp 1s forwards;
    animation-delay: 0.5s;
}

@keyframes fadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.button {
    background: linear-gradient(45deg, #f3ec78, #af4261); /* 主色调渐变 */
    border: none;
    border-radius: 25px;
    color: #fff;
    padding: 15px 30px;
    cursor: pointer;
    transition: background 0.3s ease, transform 0.2s ease;
}

.button:hover {
    background: linear-gradient(45deg, #af4261, #f3ec78);
    transform: scale(1.05);
}

/* 响应式设计 */
@media (max-width: 768px) {
    .chapter-nav {
        display: none; /* 在小屏幕上隐藏章节导航 */
    }
}

@media (max-width: 480px) {
    .navbar {
        flex-direction: column;
        align-items: flex-start;
    }
    .navbar a {
        margin: 5px 0;
    }
}

