
/* 全局样式设置 */
body {
    margin: 0;
    padding: 0;
    font-family: 'Roboto', sans-serif; /* 使用现代无衬线字体 */
    font-size: 16px; /* 正文字号 */
    background: linear-gradient(135deg, #1e3c72, #2a5298); /* 渐变背景，主色调蓝色与青色 */
    color: #333333; /* 主要文字颜色 */
    line-height: 1.6;
    /* 背景动画 */
    background-size: 400% 400%;
    animation: gradientBackground 15s ease infinite;
}

/* 背景渐变动画 */
@keyframes gradientBackground {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* 导航栏样式 */
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    background-color: rgba(30, 60, 114, 0.9); /* 半透明深蓝色背景 */
    color: #ffffff;
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.navbar .logo {
    font-size: 1.5em;
    font-weight: bold;
}

.navbar .search {
    flex: 1;
    margin: 0 20px;
}

.navbar .search input {
    width: 100%;
    padding: 8px 12px;
    border: none;
    border-radius: 4px;
}

.navbar .icons a {
    color: #ffffff;
    text-decoration: none;
    margin-left: 15px;
    transition: color 0.3s;
}

.navbar .icons a:hover {
    color: #ffcc00; /* 点缀色 */
}

/* 侧边栏样式 */
.sidebar {
    position: fixed;
    top: 80px; /* 与导航栏高度保持一致 */
    left: 0;
    width: 200px;
    height: calc(100% - 80px);
    background-color: rgba(255, 255, 255, 0.1);
    padding: 20px;
    box-sizing: border-box;
    transition: transform 0.3s;
}

.sidebar a {
    display: block;
    color: #ffffff;
    text-decoration: none;
    margin-bottom: 15px;
    font-size: 1em;
    transition: color 0.3s;
}

.sidebar a:hover {
    color: #ffcc00; /* 点缀色 */
}

/* 主内容区样式 */
.main-content {
    margin-left: 220px; /* 侧边栏宽度加20px间距 */
    padding: 100px 40px 40px 40px; /* 顶部留白以避开固定导航栏 */
    box-sizing: border-box;
    background-color: rgba(255, 255, 255, 0.8);
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

/* 章节导航系统 */
.chapter-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin-bottom: 40px;
}

.chapter-nav a {
    background-color: #2a5298; /* 主色调 */
    color: #ffffff;
    padding: 10px 20px;
    border-radius: 8px;
    text-decoration: none;
    transition: background-color 0.3s;
}

.chapter-nav a:hover {
    background-color: #1e3c72; /* 主色调深色 */
}

/* 文章内容样式 */
article h2 {
    font-size: 1.8em;
    color: #1e3c72; /* 主色调 */
    margin-top: 40px;
    margin-bottom: 20px;
    position: relative;
}

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

article section {
    margin-bottom: 30px;
    padding: 20px;
    background-color: #ffffff;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

article section h3 {
    font-size: 1.5em;
    color: #2a5298; /* 辅色调 */
    margin-top: 20px;
    margin-bottom: 10px;
}

article section pre {
    background-color: #f5f5f5;
    padding: 15px;
    border-radius: 8px;
    overflow-x: auto;
    margin-bottom: 10px;
}

article section pre code {
    font-family: 'Courier New', Courier, monospace;
    color: #333333;
}

article section p {
    font-size: 1em;
    color: #333333;
    line-height: 1.8;
}

/* 图片装饰样式 */
.decorative-image {
    width: 100%;
    max-width: 320px;
    height: auto;
    border-radius: 12px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
    transition: transform 0.3s, box-shadow 0.3s;
    margin: 20px 0;
}

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

/* 响应式设计 */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-220px);
    }
    
    .main-content {
        margin-left: 0;
        padding: 100px 20px 20px 20px;
    }
    
    .chapter-nav {
        flex-direction: column;
    }
}

@media (max-width: 480px) {
    .navbar {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .navbar .search {
        margin: 10px 0;
    }
    
    .chapter-nav a {
        width: 100%;
        text-align: center;
    }
}

/* 提示文字样式 */
.reference-note {
    text-align: center;
    font-size: 1.2em;
    color: #ffcc00; /* 点缀色 */
    margin-bottom: 40px;
}

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

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

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

.card img {
    width: 100%;
    height: auto;
    display: block;
}

.card-content {
    padding: 20px;
}

.card-title {
    font-size: 1.5em;
    color: #2a5298;
    margin-bottom: 10px;
}

.card-description {
    font-size: 1em;
    color: #333333;
}

/* 高级CSS示例代码块样式 */
.code-example {
    background-color: #282c34;
    color: #61dafb;
    padding: 15px;
    border-radius: 8px;
    font-family: 'Courier New', Courier, monospace;
    overflow-x: auto;
    margin-bottom: 20px;
}


