
/* 页面整体样式设置 */
body {
    margin: 0;
    font-family: 'Roboto', sans-serif; /* 使用现代无衬线字体 */
    background: linear-gradient(135deg, #2E4053 70%, #34C759 25%, #FF9F40 5%);
    color: #333333;
    line-height: 1.6;
    overflow-x: hidden; /* 防止出现横向滚动条 */
}

/* 导航栏样式 */
.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    background-color: rgba(46, 64, 83, 0.9);
    color: #FFFFFF;
    padding: 20px;
    z-index: 1000;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.navbar .logo {
    font-size: 24px;
    font-weight: bold;
}

.navbar .menu {
    display: flex;
    gap: 15px;
}

.navbar .menu a {
    color: #FFFFFF;
    text-decoration: none;
    font-size: 16px;
    transition: color 0.3s ease;
}

.navbar .menu a:hover {
    color: #34C759;
}

/* 主要内容区样式 */
.main {
    padding: 100px 20px 40px 20px; /* 上方留出导航栏空间 */
    max-width: 1200px;
    margin: 0 auto;
}

.notice {
    background-color: #FF9F40;
    color: #FFFFFF;
    padding: 15px;
    text-align: center;
    font-size: 18px;
    border-radius: 5px;
    margin-bottom: 40px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

/* 文章样式 */
article {
    background-color: rgba(255, 255, 255, 0.9);
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

article h2 {
    font-size: 24px;
    color: #2E4053;
    margin-top: 20px;
    margin-bottom: 15px;
    position: relative;
}

article h2::after {
    content: '';
    display: block;
    width: 50px;
    height: 3px;
    background-color: #34C759;
    margin-top: 5px;
    border-radius: 2px;
}

article section {
    margin-bottom: 30px;
}

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

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

article section pre code {
    font-family: 'Courier New', Courier, monospace;
    color: #2E4053;
    font-size: 14px;
}

/* 图片样式 */
.image-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 20px;
    margin-top: 40px;
}

.image-gallery img {
    width: 100%;
    height: auto;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

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

/* CSS代码示例区块样式 */
.code-sample {
    background-color: #2E4053;
    color: #FFFFFF;
    padding: 20px;
    border-radius: 8px;
    font-family: 'Courier New', Courier, monospace;
    font-size: 14px;
    overflow-x: auto;
    margin-bottom: 30px;
}

.code-sample code {
    display: block;
    white-space: pre-wrap;
    word-wrap: break-word;
}

/* 章节导航样式 */
.nav-chapters {
    position: sticky;
    top: 100px;
    padding: 20px;
    background-color: rgba(46, 64, 83, 0.8);
    color: #FFFFFF;
    border-radius: 10px;
    margin-bottom: 40px;
}

.nav-chapters h3 {
    font-size: 20px;
    margin-bottom: 15px;
}

.nav-chapters ul {
    list-style: none;
    padding: 0;
}

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

.nav-chapters ul li a {
    color: #FFFFFF;
    text-decoration: none;
    font-size: 16px;
    transition: color 0.3s ease;
}

.nav-chapters ul li a:hover {
    color: #34C759;
}

/* Footer样式 */
.footer {
    background-color: rgba(46, 64, 83, 0.9);
    color: #FFFFFF;
    padding: 40px 20px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 20px;
}

.footer a {
    color: #FFFFFF;
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer a:hover {
    color: #34C759;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .navbar .menu {
        flex-direction: column;
        gap: 10px;
    }

    .nav-chapters {
        position: static;
        margin-bottom: 20px;
    }
}

