
/* 整体页面的基本样式设定，包括字体、背景色、颜色搭配等 */
body {
    margin: 0;
    padding: 0;
    font-family: 'Roboto', sans-serif; /* 使用现代无衬线字体，增强可读性与现代感 */
    background: linear-gradient(135deg, #1e3c72, #2a5298); /* 主色调渐变，传达专业与信任感 */
    color: #ffffff; /* 文字颜色设为白色，确保与深色背景的对比度 */
    line-height: 1.6;
}

/* 顶部导航栏样式 */
.navbar {
    display: flex;
    justify-content: space-around;
    align-items: center;
    background: rgba(0, 0, 0, 0.5); /* 半透明背景，增强层次感 */
    padding: 15px 0;
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 1000;
}

/* 导航链接样式 */
.navbar a {
    color: #ffffff;
    text-decoration: none;
    font-size: 16px;
    transition: color 0.3s ease;
}

.navbar a:hover {
    color: #ff7043; /* 点缀色，用于悬停效果，吸引视线 */
}

/* 主内容区的样式，通过网格布局实现响应式设计 */
.main-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    padding: 100px 20px 50px 20px; /* 顶部留出导航栏空间 */
}

/* 卡片式设计的样式 */
.card {
    background: rgba(255, 255, 255, 0.1); /* 半透明背景，增加科技感 */
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
    padding: 20px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
    transform: translateY(-10px); /* 悬停时上浮，增强互动性 */
    box-shadow: 0 12px 16px rgba(0, 0, 0, 0.4);
}

/* 图像样式，包括圆角、阴影和悬浮效果 */
.card img {
    width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card img:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

/* 章节导航栏样式，使用固定定位，确保可点击性 */
.chapter-nav {
    position: fixed;
    right: 20px;
    top: 100px;
    background: rgba(0, 0, 0, 0.5);
    padding: 10px;
    border-radius: 8px;
}

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

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

.chapter-nav a {
    color: #ffffff;
    text-decoration: none;
    font-size: 14px;
    transition: color 0.3s ease;
}

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

/* 样式化文章中的代码块 */
.article code {
    background: rgba(0, 0, 0, 0.7);
    color: #ffcc00;
    padding: 2px 4px;
    border-radius: 4px;
    font-family: 'Courier New', Courier, monospace;
}

.article pre {
    background: rgba(0, 0, 0, 0.8);
    padding: 15px;
    border-radius: 8px;
    overflow-x: auto;
    font-family: 'Courier New', Courier, monospace;
    color: #ffcc00;
}

/* 按钮样式，包括悬停和点击效果 */
.btn {
    background-color: #42a5f5;
    color: #ffffff;
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.3s ease;
    text-decoration: none;
    display: inline-block;
}

.btn:hover {
    background-color: #1e88e5;
    transform: scale(1.05);
}

.btn:active {
    background-color: #1565c0;
    transform: scale(0.95);
}

/* 提示信息样式，突出显示 */
.notification {
    background: linear-gradient(45deg, #66bb6a, #43a047);
    color: #ffffff;
    padding: 15px;
    border-radius: 8px;
    text-align: center;
    margin: 20px 0;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
    animation: fadeIn 2s ease-in-out;
}

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

/* 响应式设计，适配不同屏幕尺寸 */
@media (max-width: 768px) {
    .navbar {
        flex-direction: column;
    }

    .chapter-nav {
        display: none; /* 移动端隐藏章节导航，避免占用过多空间 */
    }
}

@media (max-width: 480px) {
    body {
        font-size: 14px;
    }

    .navbar a {
        font-size: 14px;
    }
}

/* 样式化折叠区域，用于补充说明或次要信息 */
.collapsible {
    background-color: rgba(255, 255, 255, 0.1);
    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;
}

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

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

.content.show {
    display: block;
    animation: slideDown 0.5s ease-out;
}

@keyframes slideDown {
    from { max-height: 0; }
    to { max-height: 500px; }
}

/* 样式化代码示例部分，使其与文章主体风格区分 */
.code-example {
    background: rgba(0, 0, 0, 0.85);
    color: #ffcc00;
    padding: 15px;
    border-radius: 8px;
    font-family: 'Courier New', Courier, monospace;
    overflow-x: auto;
    margin: 20px 0;
}

