
/* 
整体样式设计
以下样式采用深色主题，结合霓虹色调和高级质感，营造出未来感与科技感相结合的视觉效果。使用CSS3高级特性如渐变、阴影、动画和响应式设计，确保在各种设备上均有良好的显示效果。通过灵活运用Flexbox和Grid布局，创建层次分明且视觉张力十足的页面结构。

1. 基础样式
- 使用Box-sizing为所有元素设置border-box，便于布局控制。
- 采用无衬线字体，确保文本清晰易读。
- 设置全局背景色为深色，主色调为霓虹蓝，辅色为银灰色，点缀色为紫色，遵循黄金比例配色法则。

2. 布局设计
- 头部导航固定在页面顶部，采用渐变背景，包含导航链接和标识。
- 使用Grid布局创建内容区域，包括侧边导航栏和主内容区，确保信息结构清晰。
- 图片使用圆角、阴影和悬浮效果，增强视觉美感和互动性。

3. 交互动效
- 按钮和链接在悬停时改变颜色，添加微动画，提升用户体验。
- 使用关键帧动画实现动态背景和浮动元素，增强页面的动感。
- 实现视差滚动效果，增加页面的深度感和沉浸感。

4. 响应式设计
- 通过媒体查询调整布局，使页面在不同屏幕尺寸下均有良好展示。
- 利用Flexbox和Grid的自适应特性，确保内容在移动设备上流畅排列。
- 隐藏或调整侧边导航栏在小屏设备上的显示方式，优化用户操作。

5. 代码高亮样式
- 为文章中的代码块设计独特的样式，采用深色背景和亮色字体，区分于正文内容。
- 添加代码块内的行号和语法高亮，提升可读性和美观性。

6. 图像处理
- 所有装饰性图片设置alt属性为空，避免无关信息干扰。
- 图片在不同设备下自动调整大小，保持页面整洁。

7. 特殊提示
- 在页面显著位置添加“这是一个网页样式设计参考”的提示，采用醒目颜色和字体样式。

8. 导航系统
- 设计清晰的章节导航栏，使用有意义的标题，引导用户快速定位内容。
- 导航链接添加rel="nofollow"属性，符合SEO规范。

9. 附加样式
- 定义表格、列表和段落的样式，确保内容的可读性和整洁性。
- 使用过渡效果和阴影，增加页面元素的层次感和互动性。

10. 优化与兼容性
- 通过优化CSS选择器和减少冗余样式，提升页面加载速度。
- 确保样式在主流浏览器中的兼容性，提供一致的用户体验。

以下是具体的CSS代码实现：
*/

/* 基础样式重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* 全局字体与颜色 */
body {
    font-family: 'Roboto', sans-serif;
    background-color: #1e1e1e; /* 深色背景 */
    color: #ffffff;
    line-height: 1.6;
    overflow-x: hidden;
}

/* 头部导航栏样式 */
.header {
    background: linear-gradient(135deg, #1e3c72, #2a5298); /* 渐变背景 */
    padding: 20px 40px;
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 1000;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.5);
}

.header .logo {
    font-size: 24px;
    font-weight: bold;
    color: #00c6ff;
    text-decoration: none;
}

.navbar {
    display: flex;
    gap: 20px;
}

.navbar a {
    color: #ffffff;
    text-decoration: none;
    position: relative;
    transition: color 0.3s ease;
}

.navbar a:hover {
    color: #00c6ff;
}

.navbar a::after {
    content: '';
    display: block;
    width: 0;
    height: 2px;
    background: #00c6ff;
    transition: width 0.3s ease;
}

.navbar a:hover::after {
    width: 100%;
}

/* 主内容区布局 */
.container {
    display: grid;
    grid-template-columns: 250px 1fr;
    grid-gap: 20px;
    padding: 100px 40px 40px 40px; /* 上边距留出固定头部 */
}

/* 侧边导航样式 */
.sidebar {
    position: sticky;
    top: 100px;
    background: #2a2a2a;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.5);
}

.sidebar a {
    display: block;
    color: #ffffff;
    text-decoration: none;
    padding: 10px 0;
    border-left: 4px solid transparent;
    transition: all 0.3s ease;
}

.sidebar a:hover {
    color: #00c6ff;
    border-left: 4px solid #00c6ff;
}

.sidebar a[rel="nofollow"] {
    /* 强制添加rel属性样式，如不需要可忽略 */
}

/* 主内容样式 */
.main-content {
    background: #1a1a1a;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.5);
}

.main-content h2, .main-content h3, .main-content h4 {
    color: #00c6ff;
    margin-bottom: 15px;
}

.main-content p {
    margin-bottom: 15px;
    font-size: 16px;
}

.main-content pre {
    background: #2a2a2a;
    padding: 15px;
    border-radius: 5px;
    overflow-x: auto;
    margin-bottom: 15px;
}

.main-content code {
    color: #ff416c;
    font-family: 'Courier New', Courier, monospace;
}

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

.main-content img:hover {
    transform: scale(1.05);
    box-shadow: 0 8px 20px rgba(0, 198, 255, 0.5);
}

/* 按钮样式 */
.button {
    background: linear-gradient(45deg, #00c6ff, #0072ff);
    border: none;
    border-radius: 25px;
    color: #ffffff;
    padding: 10px 20px;
    cursor: pointer;
    transition: background 0.3s ease, transform 0.3s ease;
    text-decoration: none;
    display: inline-block;
}

.button:hover {
    background: linear-gradient(45deg, #0072ff, #00c6ff);
    transform: scale(1.05);
}

/* 动画效果 */
@keyframes float {
    0% { transform: translateY(0) rotate(0deg); }
    50% { transform: translateY(-20px) rotate(45deg); }
    100% { transform: translateY(0) rotate(0deg); }
}

.dynamic-illustration {
    animation: float 6s ease-in-out infinite;
}

/* 代码块高亮样式 */
.language-css {
    color: #ff416c;
    background: #2a2a2a;
    padding: 10px;
    border-radius: 5px;
    overflow-x: auto;
}

/* 表格样式 */
.data-table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
}

.data-table thead {
    background: #1e3c72;
    color: #ffffff;
}

.data-table th, .data-table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #444;
}

.data-table tbody tr:hover {
    background: #2a5298;
    color: #ffffff;
}

/* 响应式设计 */
@media only screen and (max-width: 1200px) {
    .container {
        grid-template-columns: 200px 1fr;
        padding: 100px 20px 20px 20px;
    }

    .sidebar {
        width: 200px;
    }

    .main-content {
        padding: 15px;
    }
}

@media only screen and (max-width: 768px) {
    .container {
        grid-template-columns: 1fr;
        padding: 100px 20px 20px 20px;
    }

    .sidebar {
        display: none;
    }

    .navbar {
        flex-direction: column;
        gap: 10px;
    }

    .main-content {
        padding: 10px;
    }

    .main-content img {
        max-width: 100%;
    }
}

/* 特别提示样式 */
.special-note {
    background: #ff4b2b;
    color: #ffffff;
    padding: 15px;
    border-radius: 5px;
    text-align: center;
    font-size: 18px;
    margin-bottom: 20px;
    box-shadow: 0 4px 10px rgba(255, 75, 43, 0.5);
}

/* 折叠区域样式 */
.collapsible {
    background-color: #2a2a2a;
    color: #ffffff;
    cursor: pointer;
    padding: 10px;
    width: 100%;
    border: none;
    text-align: left;
    outline: none;
    font-size: 18px;
    transition: background 0.3s ease;
    border-radius: 5px;
}

.collapsible:hover {
    background-color: #00c6ff;
    color: #2a2a2a;
}

.content-collapsible {
    padding: 0 15px;
    display: none;
    background-color: #1a1a1a;
    overflow: hidden;
    border-radius: 5px;
}

/* 导航章节链接样式 */
.chapter-nav {
    margin-bottom: 20px;
}

.chapter-nav a {
    color: #00c6ff;
    text-decoration: none;
    display: block;
    padding: 5px 0;
    transition: color 0.3s ease;
}

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

/* 添加滚动到顶部按钮 */
.scroll-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: #00c6ff;
    color: #ffffff;
    padding: 10px 15px;
    border-radius: 50%;
    cursor: pointer;
    display: none;
    box-shadow: 0 4px 10px rgba(0, 198, 255, 0.5);
    transition: background 0.3s ease;
}

.scroll-top:hover {
    background: #0072ff;
}

/* 表单样式（如果有） */
.form-input {
    width: 100%;
    padding: 10px;
    margin: 10px 0;
    border: 1px solid #444;
    border-radius: 5px;
    background: #2a2a2a;
    color: #ffffff;
}

.form-submit {
    background: #00c6ff;
    border: none;
    padding: 10px 20px;
    border-radius: 25px;
    color: #ffffff;
    cursor: pointer;
    transition: background 0.3s ease;
}

.form-submit:hover {
    background: #0072ff;
}

