
/* 全局样式设置 */
/* 定义色彩变量：主色调、辅色调、点缀色 */
:root {
    --primary-color: #1E1F26; /* 主色调：深蓝色，营造科技感 */
    --secondary-color: #3A3B44; /* 辅色调：灰紫色，增强层次感 */
    --accent-color: #FF6F61; /* 点缀色：珊瑚色，吸引视觉焦点 */
    --background-color: #2C2D35; /* 页面背景色，避免纯白 */
    --text-color: #FFFFFF; /* 正文字体颜色 */
    --header-color: #FFFFFF; /* 头部文字颜色 */
    --link-color: #FF6F61; /* 链接颜色 */
    --link-hover-color: #FF8F80; /* 链接悬停颜色 */
    --shadow-color: rgba(0, 0, 0, 0.5); /* 阴影颜色 */
}

/* 全局字体与字体大小 */
body {
    margin: 0;
    padding: 0;
    font-family: 'Roboto', sans-serif; /* 现代无衬线字体 */
    font-size: 16px; /* 正文字号约16px */
    color: var(--text-color);
    background-color: var(--background-color);
    transition: background-color 0.3s, color 0.3s;
}

/* 链接样式 */
a {
    color: var(--link-color);
    text-decoration: none;
    transition: color 0.3s;
}

a:hover {
    color: var(--link-hover-color);
}

/* 头部导航样式 */
header {
    position: fixed;
    top: 0;
    width: 100%;
    background-color: var(--primary-color);
    box-shadow: 0 2px 5px var(--shadow-color);
    z-index: 1000;
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 30px;
}

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

.nav-menu {
    display: flex;
    gap: 20px;
}

.nav-menu a {
    font-size: 1em;
    padding: 5px 10px;
    border-radius: 5px;
}

.nav-menu a:hover {
    background-color: var(--secondary-color);
}

/* 主要内容区域 */
.main-content {
    padding: 100px 20px 50px 20px; /* 顶部留出头部空间 */
    max-width: 1200px;
    margin: 0 auto;
}

/* 强调提示 */
.prompt-banner {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    padding: 20px;
    text-align: center;
    font-size: 1.2em;
    font-weight: bold;
    border-radius: 10px;
    margin-bottom: 30px;
    box-shadow: 0 4px 10px var(--shadow-color);
}

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

article h2, article h3, article h4 {
    color: var(--accent-color);
}

article h2 {
    font-size: 2em;
    margin-bottom: 20px;
}

article h3 {
    font-size: 1.6em;
    margin-top: 30px;
    margin-bottom: 15px;
}

article p {
    font-size: 1em;
    line-height: 1.6;
    margin-bottom: 15px;
}

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

article table, article th, article td {
    border: 1px solid var(--secondary-color);
}

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

article th {
    background-color: var(--secondary-color);
}

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

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

/* 图片样式 */
img {
    width: 100%;
    max-width: 320px;
    height: auto;
    border-radius: 10px;
    box-shadow: 0 4px 10px var(--shadow-color);
    transition: transform 0.3s, box-shadow 0.3s;
}

img:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 15px var(--shadow-color);
}

/* 响应式布局：流式布局与网格系统 */
.container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    padding: 20px;
}

.grid-item {
    background-color: rgba(224, 187, 228, 0.1);
    padding: 20px;
    border-radius: 8px;
    transition: transform 0.3s;
}

.grid-item:hover {
    transform: translateY(-10px);
}

/* 章节导航 */
.chapter-nav {
    position: fixed;
    top: 80px;
    right: 20px;
    background-color: var(--secondary-color);
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0 4px 10px var(--shadow-color);
}

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

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

.chapter-nav a {
    color: var(--text-color);
    font-size: 0.9em;
}

.chapter-nav a:hover {
    color: var(--accent-color);
}

/* 折叠区域样式 */
.collapsible {
    background-color: var(--secondary-color);
    color: white;
    cursor: pointer;
    padding: 10px;
    width: 100%;
    border: none;
    text-align: left;
    outline: none;
    font-size: 1em;
    border-radius: 5px;
    margin-top: 10px;
}

.active, .collapsible:hover {
    background-color: var(--accent-color);
}

.content {
    padding: 0 15px;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
    background-color: rgba(255, 255, 255, 0.05);
    border-radius: 5px;
    margin-bottom: 15px;
}

/* CSS3代码块样式 */
.code-example {
    background-color: rgba(0, 0, 0, 0.8);
    padding: 20px;
    border-radius: 8px;
    overflow-x: auto;
    margin: 20px 0;
}

.code-example code {
    color: #00FF7F;
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.9em;
}

/* 滚动动画 */
@keyframes flow {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.flow-line {
    position: absolute;
    top: 50%;
    width: 200%;
    height: 2px;
    background: rgba(255, 255, 255, 0.2);
    animation: flow 10s linear infinite;
}

/* 响应式媒体查询 */
@media (max-width: 1024px) {
    .nav-menu {
        display: none; /* 简化导航 */
    }
    .chapter-nav {
        display: none;
    }
}

@media (max-width: 600px) {
    .prompt-banner {
        font-size: 1em;
        padding: 15px;
    }
    article h2 {
        font-size: 1.8em;
    }
    article h3 {
        font-size: 1.4em;
    }
    .nav-container {
        flex-direction: column;
        align-items: flex-start;
    }
}

