
/* 基本样式重置，消除浏览器默认的内边距和外边距 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* 设置网页的整体字体、背景色和主色调 */
body {
    font-family: 'Roboto', sans-serif; /* 使用Roboto无衬线字体 */
    font-size: 16px; /* 正文字号设置为16px */
    line-height: 1.6; /* 设置行高提升可读性 */
    color: #333333; /* 主文本颜色为深灰色 */
    background: linear-gradient(135deg, #2c3e50, #bdc3c7); /* 背景使用渐变颜色 */
    overflow-x: hidden; /* 防止横向滚动 */
}

/* 固定导航栏样式 */
.navbar {
    position: fixed; /* 固定定位 */
    top: 0;
    width: 100%;
    background-color: rgba(26, 26, 26, 0.9); /* 半透明深色背景 */
    color: #ffffff; /* 白色文字 */
    display: flex;
    justify-content: space-between; /* 主内容左右对齐 */
    align-items: center;
    padding: 15px 30px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1); /* 轻微阴影 */
    z-index: 1000; /* 确保导航栏在最上层 */
}

/* 导航栏中的Logo样式 */
.navbar .logo {
    font-size: 1.5em;
    font-weight: bold;
    color: #ffffff;
    text-decoration: none;
}

/* 导航链接样式 */
.navbar .nav-links a {
    margin-left: 20px;
    color: #ffffff;
    text-decoration: none;
    transition: color 0.3s ease;
}

/* 导航链接悬停效果 */
.navbar .nav-links a:hover {
    color: #00BFFF; /* 亮蓝色高亮 */
}

/* 主容器样式 */
.container {
    max-width: 1200px; /* 最大宽度 */
    margin: 100px auto 50px; /* 顶部留空间以避免导航栏遮挡 */
    padding: 0 20px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); /* 响应式网格布局 */
    gap: 20px; /* 网格间距 */
}

/* 各个模块的样式 */
.module {
    background-color: rgba(255, 255, 255, 0.8); /* 半透明白色背景 */
    border-radius: 10px; /* 圆角边框 */
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1); /* 阴影效果 */
    padding: 20px;
    transition: transform 0.3s ease, box-shadow 0.3s ease; /* 动画过渡 */
}

/* 模块悬停时的动画效果 */
.module:hover {
    transform: translateY(-10px); /* 向上移动 */
    box-shadow: 0 8px 12px rgba(0, 0, 0, 0.2); /* 加深阴影 */
}

/* 文章标题样式 */
h1, h2, h3, h4 {
    color: #1a1a1a;
    margin-bottom: 15px;
}

/* h2标题样式 */
h2 {
    font-size: 2em;
    border-bottom: 2px solid #00BFFF; /* 亮蓝色底边 */
    padding-bottom: 10px;
}

/* h3标题样式 */
h3 {
    font-size: 1.5em;
    margin-top: 20px;
    color: #2c3e50;
}

/* 段落文字样式 */
p {
    margin-bottom: 20px;
    font-size: 1em;
    color: #555555;
}

/* 强调文字样式 */
span {
    color: #00BFFF; /* 亮蓝色 */
    font-weight: bold;
}

/* 代码块样式 */
pre {
    background-color: #2c3e50; /* 深色背景 */
    color: #555; /* 浅色文字 */
    padding: 15px;
    border-radius: 5px;
    overflow-x: auto;
    margin-bottom: 20px;
    font-family: 'Courier New', Courier, monospace;
}

/* 代码块内的代码样式 */
code {
    font-size: 0.9em;
}

/* 突出显示代码示例区块 */
.code-example {
    background-color: #34495e; /* 深蓝色背景 */
    padding: 10px;
    border-radius: 5px;
    margin: 20px 0;
}

/* 图片样式 */
img {
    width: 100%;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    transition: transform 0.3s ease;
}

/* 图片悬停效果 */
img:hover {
    transform: scale(1.05); /* 放大图片 */
}

/* 章节导航栏样式 */
.chapter-nav {
    background-color: rgba(26, 26, 26, 0.8);
    padding: 10px 20px;
    border-radius: 5px;
    margin-bottom: 30px;
}

/* 章节导航链接样式 */
.chapter-nav a {
    margin-right: 15px;
    color: #ffffff;
    text-decoration: none;
    font-weight: bold;
    transition: color 0.3s ease;
}

/* 章节导航链接悬停效果 */
.chapter-nav a:hover {
    color: #32CD32; /* 绿色高亮 */
}

/* 提示信息样式 */
.alert {
    background-color: #ffeb3b; /* 黄色背景 */
    padding: 15px;
    border-radius: 5px;
    text-align: center;
    font-weight: bold;
    margin-bottom: 30px;
}

/* 折叠内容容器样式 */
.collapsible {
    background-color: #ffffff;
    color: #333333;
    cursor: pointer;
    padding: 15px;
    width: 100%;
    border: none;
    text-align: left;
    outline: none;
    font-size: 1em;
    border-radius: 5px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: background-color 0.3s ease;
    margin-bottom: 10px;
}

/* 折叠内容默认隐藏 */
.collapsible-content {
    display: none;
    padding: 0 20px 20px 20px;
    background-color: rgba(255, 255, 255, 0.9);
    border-radius: 5px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* 折叠按钮展开时的样式 */
.collapsible.active, .collapsible:hover {
    background-color: #e0f7fa;
}

/* 结束横线样式 */
.separator {
    height: 2px;
    background: linear-gradient(90deg, #00BFFF, #32CD32);
    margin: 30px 0;
    border: none;
    border-radius: 1px;
}

/* 底部样式 */
.footer {
    background-color: rgba(26, 26, 26, 0.9);
    color: #ffffff;
    padding: 40px 30px;
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    border-top: 2px solid #00BFFF;
}

/* 底部各部分样式 */
.footer .section {
    flex: 1 1 200px;
    margin: 10px;
}

/* 底部标题样式 */
.footer .section h4 {
    margin-bottom: 15px;
    font-size: 1.2em;
    color: #00BFFF;
}

/* 底部链接样式 */
.footer .section a {
    display: block;
    color: #ffffff;
    text-decoration: none;
    margin-bottom: 10px;
    transition: color 0.3s ease;
}

/* 底部链接悬停效果 */
.footer .section a:hover {
    color: #32CD32;
}

/* CSS3示例代码区块的样式 */
.article code {
    background-color: #f4f4f4;
    padding: 2px 4px;
    border-radius: 4px;
    font-size: 0.95em;
}

/* 章节标题的特别样式 */
.article .chapter-title {
    background: linear-gradient(90deg, #00BFFF, #32CD32);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    font-weight: bold;
}

/* 高亮显示的代码示例区块 */
.syntax-highlight {
    background-color: #f0f0f0;
    padding: 15px;
    border-left: 5px solid #00BFFF;
    margin: 20px 0;
    border-radius: 5px;
    overflow-x: auto;
}

/* 弹出工具提示样式 */
.tooltip {
    position: relative;
    display: inline-block;
}

.tooltip .tooltiptext {
    visibility: hidden;
    width: 120px;
    background-color: rgba(0,0,0,0.7);
    color: #fff;
    text-align: center;
    border-radius: 6px;
    padding: 5px 0;
    position: absolute;
    z-index: 1;
    bottom: 125%; /* 上方 */
    left: 50%;
    margin-left: -60px;
    opacity: 0;
    transition: opacity 0.3s;
}

.tooltip:hover .tooltiptext {
    visibility: visible;
    opacity: 1;
}

/* 动画效果 */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* 应用fadeIn动画到整个页面 */
body {
    animation: fadeIn 2s ease-in;
}

/* 响应式设计调整 */
@media (max-width: 768px) {
    .navbar {
        flex-direction: column;
        align-items: flex-start;
    }
    .navbar .nav-links {
        display: none; /* 隐藏导航链接 */
    }
    .navbar .menu-toggle {
        display: block;
        cursor: pointer;
    }
    .container {
        grid-template-columns: 1fr; /* 单列布局 */
    }
}


