
/* 
整体样式设置
设置页面的基础字体、背景颜色、全局盒模型等，以确保一致的视觉效果和响应式布局。
*/
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}
body {
    font-family: 'Roboto', sans-serif; /* 使用现代无衬线字体 */
    background: linear-gradient(135deg, #032B44 70%, #F7F7F7 25%, #1E90FF 5%);
    color: #032B44;
    line-height: 1.6;
    padding: 20px;
}
/* 
导航栏样式
设计固定在顶部的导航栏，包含主要的导航链接，使用深蓝色作为主色调，并添加阴影以增强层次感。
*/
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background-color: #032B44;
    color: #F7F7F7;
    padding: 16px 24px;
    z-index: 1000;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.navbar a {
    color: #F7F7F7;
    text-decoration: none;
    margin-left: 20px;
    font-size: 16px;
}
.navbar a:hover {
    text-decoration: underline;
}
/* 
侧边栏样式
设计可收起的侧边菜单，利用CSS3的转换和过渡效果实现滑动动画，确保兼容各种设备。
*/
.sidebar {
    position: fixed;
    top: 64px; /* 导航栏高度 */
    left: 0;
    width: 250px;
    height: calc(100% - 64px);
    background-color: #1E90FF;
    transform: translateX(0);
    transition: transform 0.3s ease;
    padding: 20px;
}
.sidebar.collapsed {
    transform: translateX(-100%);
}
.sidebar a {
    display: block;
    color: #F7F7F7;
    text-decoration: none;
    margin: 15px 0;
    font-size: 16px;
}
.sidebar a:hover {
    text-decoration: underline;
}
.toggle-button {
    position: absolute;
    top: 16px;
    right: -40px;
    background-color: #3EB489;
    width: 40px;
    height: 40px;
    cursor: pointer;
    border-radius: 0 8px 8px 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #FFFFFF;
    font-size: 20px;
}
.toggle-button:hover {
    background-color: #1E90FF;
}
/* 
主内容区样式
使用CSS Grid实现灵活的网格布局，确保内容在不同屏幕尺寸下的自适应和一致性。
*/
.container {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 20px;
    margin-top: 80px; /* 为导航栏留出空间 */
}
@media (max-width: 1200px) {
    .container {
        grid-template-columns: repeat(8, 1fr);
    }
}
@media (max-width: 768px) {
    .container {
        grid-template-columns: repeat(4, 1fr);
    }
}
@media (max-width: 480px) {
    .container {
        grid-template-columns: repeat(2, 1fr);
    }
}
/* 
卡片样式
设计卡片式布局，包含渐变背景、阴影效果和悬停动画，提升视觉层次感和交互体验。
*/
.card {
    background: linear-gradient(135deg, #1E90FF, #3EB489);
    border: 1px solid #F7F7F7;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: box-shadow 0.3s ease, transform 0.3s ease;
    padding: 20px;
    color: #FFFFFF;
}
.card:hover {
    box-shadow: 0 8px 12px rgba(0, 0, 0, 0.2);
    transform: translateY(-5px);
}
/* 
图像样式
确保图片不超过最大宽度，添加圆角、阴影和悬浮效果，提升装饰性和美观性。
*/
img.decorative {
    max-width: 100%;
    height: auto;
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    margin: 20px 0;
}
img.decorative:hover {
    transform: scale(1.05);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
}
/* 
正文内容样式
确保正文内容在较大屏幕上不小于500px宽度，使用流式布局和排版优化阅读体验。
*/
.content {
    grid-column: span 8;
    min-width: 500px;
}
@media (max-width: 1200px) {
    .content {
        grid-column: span 8;
    }
}
@media (max-width: 768px) {
    .content {
        grid-column: span 4;
    }
}
@media (max-width: 480px) {
    .content {
        grid-column: span 2;
    }
}
/* 
代码块样式
为CSS代码示例添加专属样式，使用深色背景和高亮字体，确保与正文内容区分开。
*/
pre.code-block {
    background-color: #1E1E1E;
    color: #D4D4D4;
    padding: 16px;
    border-radius: 8px;
    overflow-x: auto;
    font-family: 'Courier New', Courier, monospace;
    margin: 20px 0;
}
pre.code-block code {
    display: block;
}
/* 
提示信息样式
在显著位置展示提示信息，使用醒目的颜色和字体，确保易于辨识。
*/
.prompt {
    background-color: #3EB489;
    color: #FFFFFF;
    padding: 15px;
    border-radius: 8px;
    text-align: center;
    font-size: 18px;
    margin-bottom: 30px;
}
/* 
链接样式
内部链接添加 rel="nofollow" 属性，使用不同颜色和下划线样式，增强可读性。
*/
a.internal-link {
    color: #FFD700;
    text-decoration: none;
    position: relative;
}
a.internal-link::after {
    content: '';
    position: absolute;
    width: 100%;
    transform: scaleX(0);
    height: 2px;
    bottom: 0;
    left: 0;
    background-color: #FFD700;
    transform-origin: bottom right;
    transition: transform 0.25s ease-out;
}
a.internal-link:hover::after {
    transform: scaleX(1);
    transform-origin: bottom left;
}
/* 
折叠区域样式
设计折叠区域的展开和收起效果，使用平滑的过渡动画。
*/
.collapsible-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.5s ease;
}
.collapsible-content.expanded {
    max-height: 500px; /* 可根据内容调整 */
}
/* 
按钮样式
为按钮添加渐变背景、圆角和悬停效果，提升互动性和视觉吸引力。
*/
.button {
    background: linear-gradient(135deg, #1E90FF, #3EB489);
    color: #FFFFFF;
    padding: 10px 20px;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    transition: background 0.3s ease, transform 0.2s ease;
    font-size: 16px;
}
.button:hover {
    background: linear-gradient(135deg, #3EB489, #1E90FF);
    transform: scale(1.05);
}
.button:active {
    transform: scale(0.95);
}
/* 
代码高亮样式
为代码块内的关键字、属性等添加高亮，增强代码的可读性和美观性。
*/
code.keyword {
    color: #FFD700;
    font-weight: bold;
}
code.property {
    color: #ADFF2F;
}
code.value {
    color: #00CED1;
}
/* 
动画效果
定义关键帧动画，用于动态元素的展示，如通知弹出动画。
*/
@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
.notification {
    animation: fadeInDown 0.5s ease forwards;
}
/* 
防止导航栏padding导致内容溢出
确保导航栏的宽度设置和内边距不会导致内容显示不全，利用box-sizing和适当的布局调整。
*/
.navbar, .sidebar, .container {
    width: 100%;
    box-sizing: border-box;
}
/* 
确保页面无水平滚动条
通过设置overflow-x为hidden，避免内容超出视口宽度导致的水平滚动条。
*/
body {
    overflow-x: hidden;
}
/* 
响应式图片布局
保证图片在不同屏幕尺寸下不会超出容器，且保持良好的布局和显示效果。
*/
.image-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 20px 0;
}
.image-wrapper img {
    max-width: 650px;
    width: 100%;
    height: auto;
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.image-wrapper img:hover {
    transform: scale(1.05);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
}

