
/* 
整体样式设计
主色调为深蓝色（#1A237E），辅色为绿色（#66BB6A）和橙色（#FFB300），点缀色为白色和灰色。背景采用渐变效果，从深蓝过渡到墨黑，增强科技感和沉浸感。
*/

body {
    margin: 0;
    padding: 0;
    background: linear-gradient(135deg, #1A237E, #000000);
    color: #FFFFFF;
    font-family: 'Roboto', sans-serif;
    line-height: 1.6;
    transition: background 0.5s, color 0.5s;
}

/* 
导航栏样式
固定在左侧，使用固定宽度，包含主要功能入口。采用Flexbox布局，垂直排列导航项，添加悬停效果增强互动性。
*/
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 220px;
    height: 100vh;
    background-color: rgba(26, 35, 126, 0.95);
    display: flex;
    flex-direction: column;
    align-items: center;
    padding-top: 20px;
    box-shadow: 2px 0 5px rgba(0,0,0,0.5);
    z-index: 1000;
}

.nav-item {
    width: 100%;
    padding: 15px 0;
    text-align: center;
    color: #FFFFFF;
    text-decoration: none;
    font-size: 18px;
    transition: background-color 0.3s, color 0.3s;
}

.nav-item:hover {
    background-color: #3949AB;
    color: #FFB300;
}

/* 
主内容区样式
使用Grid布局，将页面划分为多个功能区域，包括头部、主展示区和侧边栏。确保响应式设计，适应不同屏幕宽度。
*/
.container {
    margin-left: 220px;
    display: grid;
    grid-template-areas:
        "header header"
        "main sidebar";
    grid-template-columns: 1fr 300px;
    grid-template-rows: 60px 1fr;
    height: auto;
}

.header {
    grid-area: header;
    background-color: rgba(40, 53, 147, 0.9);
    display: flex;
    align-items: center;
    padding: 0 20px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.3);
}

.header h1 {
    margin: 0;
    font-size: 24px;
    color: #FFFFFF;
}

.main {
    grid-area: main;
    padding: 20px;
    overflow-y: auto;
}

/* 
侧边栏样式
用于个性化设置和快捷操作按钮，采用渐变背景，添加动画效果提升用户体验。
*/
.sidebar {
    grid-area: sidebar;
    background: linear-gradient(180deg, #283593, #3949AB);
    padding: 20px;
    box-shadow: -2px 0 5px rgba(0,0,0,0.5);
    position: relative;
}

.sidebar h2 {
    font-size: 20px;
    margin-bottom: 10px;
    color: #FFB300;
}

.sidebar .settings {
    display: flex;
    flex-direction: column;
}

.sidebar .settings label {
    margin-bottom: 10px;
    font-size: 16px;
    color: #FFFFFF;
}

.sidebar .settings input[type="checkbox"] {
    margin-right: 10px;
}

.sidebar .toggle-button {
    background-color: #66BB6A;
    border: none;
    padding: 10px;
    color: #FFFFFF;
    font-size: 16px;
    cursor: pointer;
    border-radius: 5px;
    transition: background-color 0.3s;
}

.sidebar .toggle-button:hover {
    background-color: #81C784;
}

/* 
文章内容样式
使用高级排版，段落独立成块，添加阴影和圆角，提升可读性和美观度。
*/
article {
    background-color: rgba(255, 255, 255, 0.1);
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
    color: #B0BEC5;
}

article h2, article h3, article h4 {
    color: #FFFFFF;
    margin-top: 20px;
}

article p {
    font-size: 16px;
    margin-bottom: 15px;
    line-height: 1.8;
}

article pre {
    background-color: rgba(255, 255, 255, 0.2);
    padding: 15px;
    border-radius: 5px;
    overflow-x: auto;
}

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

/* 
图片样式
为装饰性图片添加圆角、阴影及悬浮效果，提升视觉美感。
*/
img.decorative {
    width: 100%;
    max-width: 320px;
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.3);
    transition: transform 0.3s, box-shadow 0.3s;
    margin: 10px 0;
}

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

/* 
响应式设计
确保页面在不同设备上均有良好显示效果。使用媒体查询调整布局，隐藏或调整某些元素以适应较小屏幕。
*/
@media (max-width: 1200px) {
    .container {
        grid-template-columns: 1fr 250px;
        grid-template-areas:
            "header header"
            "main sidebar";
    }
    .sidebar {
        width: 250px;
    }
}

@media (max-width: 992px) {
    .container {
        grid-template-columns: 1fr;
        grid-template-areas:
            "header"
            "main"
            "sidebar";
    }
    .navbar {
        width: 100%;
        height: 60px;
        flex-direction: row;
        justify-content: space-around;
    }
    .nav-item {
        font-size: 16px;
    }
    .sidebar {
        width: 100%;
        position: relative;
        box-shadow: none;
    }
}

@media (max-width: 768px) {
    .header h1 {
        font-size: 20px;
    }
    article p {
        font-size: 14px;
    }
    .navbar {
        display: none;
    }
}

/* 
微交互效果
为按钮和链接添加平滑过渡和动画效果，增强用户体验。
*/
a.internal-link {
    color: #66BB6A;
    text-decoration: none;
    position: relative;
    transition: color 0.3s;
}

a.internal-link::after {
    content: '';
    position: absolute;
    width: 0%;
    height: 2px;
    background-color: #FFB300;
    left: 0;
    bottom: -3px;
    transition: width 0.3s;
}

a.internal-link:hover {
    color: #FFB300;
}

a.internal-link:hover::after {
    width: 100%;
}

/* 
折叠区域样式
为次要信息提供折叠功能，保持页面整洁。使用CSS3过渡实现展开与收起的动画效果。
*/
.collapsible {
    background-color: rgba(255, 255, 255, 0.2);
    color: #FFFFFF;
    cursor: pointer;
    padding: 10px;
    width: 100%;
    border: none;
    text-align: left;
    outline: none;
    font-size: 16px;
    transition: background-color 0.3s;
    margin-top: 10px;
    border-radius: 5px;
}

.collapsible:hover {
    background-color: rgba(255, 255, 255, 0.3);
}

.content {
    padding: 0 15px;
    display: none;
    overflow: hidden;
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 5px;
    margin-bottom: 10px;
}

.content.show {
    display: block;
}

/* 
渐变线条装饰
在页面中添加科技感强的渐变线条，增强视觉层次。
*/
.gradient-line {
    height: 2px;
    background: linear-gradient(to right, #66BB6A, #FFB300, #66BB6A);
    margin: 20px 0;
    border: none;
    border-radius: 1px;
}

/* 
章节导航系统
设计清晰的章节导航，帮助用户快速定位内容。使用固定定位和适当的样式确保导航栏不影响内容阅读。
*/
.chapter-nav {
    position: fixed;
    top: 80px;
    right: 20px;
    background-color: rgba(26, 35, 126, 0.95);
    padding: 15px;
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.3);
    z-index: 1000;
}

.chapter-nav h3 {
    margin-top: 0;
    font-size: 18px;
    color: #FFB300;
}

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

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

.chapter-nav a {
    color: #66BB6A;
    text-decoration: none;
    font-size: 16px;
    transition: color 0.3s;
}

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

/* 
提示信息样式
在显著位置显示提示信息，使用动画效果吸引用户注意。
*/
#page-note {
    position: fixed;
    top: 10px;
    right: 50%;
    transform: translateX(50%);
    background-color: #FFB300;
    color: #1A237E;
    padding: 10px 20px;
    border-radius: 20px;
    font-size: 16px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.3);
    animation: fadeIn 2s ease-in-out;
    z-index: 1001;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* 
代码示例样式
为代码示例添加独特样式，区别于正文内容，确保可读性和美观度。
*/
.code-example {
    background-color: rgba(0, 0, 0, 0.7);
    padding: 15px;
    border-radius: 5px;
    overflow-x: auto;
    margin: 20px 0;
}

.code-example code {
    color: #66BB6A;
    font-family: 'Courier New', Courier, monospace;
    font-size: 14px;
}

/* 
页面背景动态效果
添加微弱的霓虹线条动画，增强页面的科技感和动感。
*/
.background-animation {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: repeating-linear-gradient(
        45deg,
        transparent,
        transparent 10px,
        rgba(255, 255, 255, 0.1) 10px,
        rgba(255, 255, 255, 0.1) 20px
    );
    animation: moveBackground 30s linear infinite;
    z-index: 0;
}

@keyframes moveBackground {
    from { background-position: 0 0; }
    to { background-position: 1000px 1000px; }
}

/* 
自定义滚动条样式
美化滚动条，提升整体美观度。
*/
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: #66BB6A;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #FFB300;
}

