
/* 全局样式设置 */
body {
    margin: 0;
    padding: 0;
    font-family: 'Roboto', sans-serif; /* 使用Roboto无衬线字体 */
    line-height: 1.6;
    color: #333;
    background: linear-gradient(135deg, #4567b7 70%, #663399 25%, #ff9800 5%); /* 渐变背景 */
    overflow-x: hidden; /* 防止出现水平滚动条 */
}

/* 导航栏样式 */
.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    background: rgba(69, 103, 183, 0.9); /* 半透明背景 */
    padding: 15px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 1000;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

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

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

/* 主内容区域样式 */
.container {
    max-width: 1200px;
    margin: 100px auto 50px auto; /* 留出导航栏空间 */
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 40px;
}

/* 文章内容样式 */
article h2, article h3 {
    color: #4567b7;
}

article p {
    font-size: 16px;
    margin-bottom: 1em;
}

article pre {
    background: #f5f5f5;
    padding: 15px;
    border-radius: 8px;
    overflow-x: auto;
}

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

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

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

/* 提示信息样式 */
.notice {
    background: #ff9800;
    color: #fff;
    padding: 20px;
    text-align: center;
    font-size: 18px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

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

.chapter-nav a {
    background: #4567b7;
    color: #fff;
    padding: 10px 15px;
    border-radius: 5px;
    text-decoration: none;
    font-size: 14px;
    transition: background 0.3s ease;
}

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

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

    .chapter-nav {
        display: none; /* 小屏幕隐藏章节导航 */
    }

    .container {
        margin: 80px 20px 20px 20px;
    }
}

/* 代码块美化 */
.code-block {
    background: #2d2d2d;
    color: #ccc;
    padding: 15px;
    border-radius: 8px;
    font-family: 'Courier New', Courier, monospace;
    overflow-x: auto;
}

.code-block:hover {
    background: #3e3e3e;
}

/* 动画效果 */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.fade-in {
    animation: fadeIn 1s ease-in-out;
}

/* 折叠区域样式 */
.details-summary {
    cursor: pointer;
    color: #4567b7;
    font-weight: bold;
}

.details-content {
    margin-top: 10px;
    display: none;
}

.details-content.show {
    display: block;
}

