
/* 全局样式设置 */
body {
    margin: 0;
    padding: 0;
    font-family: 'Roboto', sans-serif; /* 设置全局字体 */
    background: linear-gradient(135deg, #0f2027, #203a43, #2c5364); /* 主色调渐变背景 */
    color: #ffffff; /* 全局文字颜色 */
    line-height: 1.6;
}

/* 导航栏样式 */
.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    background: rgba(15, 32, 39, 0.9); /* 固定导航栏背景 */
    padding: 20px;
    z-index: 1000;
    display: flex;
    justify-content: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: background 0.3s ease;
}

.navbar ul {
    list-style: none;
    display: flex;
    gap: 30px;
}

.navbar a {
    color: #ffcc00; /* 辅助色链接 */
    text-decoration: none;
    font-size: 16px;
    transition: color 0.3s ease;
}

.navbar a:hover {
    color: #ffffff;
}

/* 主要内容区域 */
.main {
    padding-top: 100px; /* 避免内容被固定导航栏覆盖 */
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* 章节导航提示 */
.reference-note {
    text-align: center;
    font-size: 18px;
    margin: 40px 0;
    color: #ffcc00;
    font-weight: bold;
}

/* 文章内容样式 */
article {
    background: rgba(255, 255, 255, 0.1); /* 半透明背景 */
    padding: 40px;
    border-radius: 10px;
    box-shadow: 0 4px 30px rgba(0,0,0,0.1);
    backdrop-filter: blur(5px);
}

article h2, article h3, article h4 {
    color: #ffcc00; /* 标题颜色 */
    margin-top: 20px;
}

article p {
    font-size: 16px;
    color: #dcdcdc;
    margin: 15px 0;
}

article pre {
    background: rgba(0, 0, 0, 0.7);
    padding: 20px;
    border-radius: 5px;
    overflow-x: auto;
    margin: 20px 0;
}

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

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

img:hover {
    transform: scale(1.05);
    box-shadow: 0 8px 25px rgba(0,0,0,0.5);
}

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

.card {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    padding: 20px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

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

/* 按钮样式 */
.button {
    background: #ffcc00;
    color: #0f2027;
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background 0.3s ease, transform 0.3s ease;
    font-size: 16px;
}

.button:hover {
    background: #e6b800;
    transform: scale(1.05);
}

/* 折叠区域样式 */
.collapsible {
    background-color: rgba(32, 58, 67, 0.8);
    color: #ffffff;
    cursor: pointer;
    padding: 15px;
    width: 100%;
    border: none;
    text-align: left;
    outline: none;
    font-size: 18px;
    border-radius: 5px;
    transition: background 0.3s ease;
}

.collapsible:hover {
    background-color: rgba(32, 58, 67, 1);
}

.content {
    padding: 0 15px;
    display: none;
    overflow: hidden;
    background-color: rgba(32, 58, 67, 0.6);
    border-radius: 5px;
    margin-bottom: 20px;
}

.content p {
    margin: 10px 0;
}

/* CSS3代码示例样式 */
.code-sample {
    background: rgba(0, 0, 0, 0.7);
    padding: 20px;
    border-radius: 5px;
    overflow-x: auto;
    margin: 20px 0;
}

.code-sample code {
    color: #ffcc00;
    font-family: 'Courier New', Courier, monospace;
}

/* 固定导航栏过渡效果 */
.navbar.scrolled {
    background: rgba(15, 32, 39, 1);
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
}

/* 章节导航系统 */
.chapter-nav {
    position: fixed;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(15, 32, 39, 0.9);
    padding: 10px;
    border-radius: 10px;
}

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

.chapter-nav li {
    margin: 10px 0;
}

.chapter-nav a {
    color: #ffcc00;
    text-decoration: none;
    transition: color 0.3s ease;
}

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

/* 响应式设计 */
@media (max-width: 768px) {
    .navbar ul {
        flex-direction: column;
        align-items: center;
    }
    .chapter-nav {
        display: none;
    }
}

@media (max-width: 480px) {
    .button {
        width: 100%;
    }
}

