
/* 基本样式重置，确保不同浏览器的一致性 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}
/* 设置整体字体和背景渐变 */
body {
    font-family: 'Roboto', sans-serif; /* 使用无衬线字体，提升可读性 */
    background: linear-gradient(135deg, #0f2027, #203a43, #2c5364); /* 蓝色系渐变背景，营造科技感 */
    color: #ffffff; /* 文字颜色为白色，确保在深色背景上的良好对比度 */
    line-height: 1.6; /* 提高行高，增强可读性 */
    padding: 20px; /* 页面内边距，避免内容紧贴边缘 */
}
/* 顶部导航栏样式 */
.navbar {
    position: fixed; /* 固定导航栏，保持在页面顶部 */
    top: 0;
    width: 100%;
    background: rgba(0, 0, 0, 0.7); /* 半透明背景，融合整体设计 */
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 20px;
    z-index: 1000; /* 确保导航栏在最上层 */
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.5); /* 添加阴影，增加层次感 */
}
/* 导航栏中的链接样式 */
.navbar a {
    color: #ffffff;
    text-decoration: none;
    margin: 0 15px;
    font-size: 16px;
    transition: color 0.3s ease;
}
.navbar a:hover {
    color: #ff8c00; /* 点缀色，悬停时颜色变化 */
}
/* 侧边导航栏样式 */
.sidebar {
    position: fixed;
    left: 0;
    top: 60px; /* 导航栏高度 */
    width: 60px;
    height: calc(100% - 60px);
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    align-items: center;
    padding-top: 20px;
}
/* 侧边导航图标样式 */
.sidebar .icon {
    margin: 20px 0;
    color: #ffffff;
    font-size: 24px;
    transition: color 0.3s ease;
}
.sidebar .icon:hover {
    color: #ff8c00; /* 点缀色，悬停时颜色变化 */
}
/* 主要内容区域样式 */
.container {
    margin-left: 80px; /* 侧边导航栏宽度 */
    padding-top: 80px; /* 顶部导航栏高度 */
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}
/* 卡片式布局样式 */
.card {
    background: rgba(255, 255, 255, 0.1); /* 半透明卡片背景 */
    border-radius: 10px; /* 圆角边框 */
    padding: 20px;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1); /* 卡片阴影 */
    backdrop-filter: blur(5px); /* 模糊背景滤镜，增强玻璃效果 */
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.card:hover {
    transform: translateY(-10px); /* 悬停时轻微上移 */
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.2); /* 悬停时阴影加深 */
}
/* 图片样式 */
img.decorative {
    width: 100%;
    border-radius: 15px; /* 圆角 */
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3); /* 阴影效果 */
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}
img.decorative:hover {
    transform: scale(1.05); /* 悬停时放大 */
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.5); /* 阴影加深 */
}
/* 章节导航系统样式 */
.chapter-nav {
    position: fixed;
    top: 80px; /* 导航栏高度 */
    right: 20px;
    background: rgba(0, 0, 0, 0.6);
    padding: 10px;
    border-radius: 10px;
}
.chapter-nav a {
    display: block;
    color: #ffffff;
    text-decoration: none;
    margin: 5px 0;
    font-size: 16px;
    transition: color 0.3s ease;
}
.chapter-nav a:hover {
    color: #ff8c00; /* 点缀色 */
}
/* 代码块样式 */
pre code {
    display: block;
    background: rgba(0, 0, 0, 0.7);
    padding: 15px;
    border-radius: 8px;
    overflow-x: auto;
    color: #00ff00; /* 代码颜色 */
    font-family: 'Courier New', Courier, monospace;
    margin: 20px 0;
}
/* 折叠内容样式 */
.collapsible {
    background-color: rgba(255, 140, 0, 0.2); /* 点缀色背景 */
    color: #ffffff;
    cursor: pointer;
    padding: 10px;
    width: 100%;
    border: none;
    text-align: left;
    outline: none;
    font-size: 16px;
    border-radius: 5px;
    transition: background-color 0.3s ease;
    margin-top: 10px;
}
.collapsible:hover {
    background-color: rgba(255, 140, 0, 0.4);
}
.content {
    padding: 0 15px;
    display: none;
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 5px;
    margin-bottom: 10px;
}
.active, .collapsible:hover {
    background-color: rgba(255, 140, 0, 0.4);
}
.active + .content {
    display: block;
}
/* 加载动画样式 */
.loader {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 80px;
    height: 80px;
    border: 8px solid rgba(255, 140, 0, 0.2);
    border-top: 8px solid #ff8c00;
    border-radius: 50%;
    animation: spin 1.5s linear infinite;
    z-index: 2000;
}
@keyframes spin {
    0% { transform: translate(-50%, -50%) rotate(0deg); }
    100% { transform: translate(-50%, -50%) rotate(360deg); }
}
/* 3D动画样式 */
.animated-3d {
    width: 100%;
    height: 500px;
    perspective: 1000px;
    animation: rotate 20s linear infinite;
}
@keyframes rotate {
    from { transform: rotateY(0deg); }
    to { transform: rotateY(360deg); }
}
/* 按钮样式 */
.button {
    background: #ff8c00;
    border: none;
    border-radius: 5px;
    padding: 15px 30px;
    color: #fff;
    cursor: pointer;
    transition: background 0.3s ease;
}
.button:hover {
    background: #ff7000;
    animation: shake 0.5s;
}
@keyframes shake {
    0% { transform: translate(1px, 1px) rotate(0deg); }
    10% { transform: translate(-1px, -2px) rotate(-1deg); }
    20% { transform: translate(-3px, 0px) rotate(1deg); }
    30% { transform: translate(3px, 2px) rotate(0deg); }
    40% { transform: translate(1px, -1px) rotate(1deg); }
    50% { transform: translate(-1px, 2px) rotate(-1deg); }
    60% { transform: translate(-3px, 1px) rotate(0deg); }
    70% { transform: translate(3px, 1px) rotate(-1deg); }
    80% { transform: translate(-1px, -1px) rotate(1deg); }
    90% { transform: translate(1px, 2px) rotate(0deg); }
    100% { transform: translate(1px, -2px) rotate(-1deg); }
}
/* 响应式设计媒体查询 */
@media (max-width: 768px) {
    .container {
        grid-template-columns: 1fr;
        padding: 20px;
    }
    .navbar {
        flex-direction: column;
        align-items: center;
    }
    .sidebar {
        display: none;
    }
    .chapter-nav {
        display: none;
    }
}

