
/* 全局样式设置 */
/* 引入Roboto字体，确保文本的可读性和现代感 */
@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@400;700&display=swap');

/* 设置页面的整体背景色，采用蓝紫渐变作为主色调，营造科技感与信赖感 */
body {
    margin: 0;
    padding: 0;
    font-family: 'Roboto', sans-serif;
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    color: #ffffff;
    line-height: 1.6;
    overflow-x: hidden;
}

/* 容器设置，确保内容在不同屏幕下有良好的间距和布局 */
.container {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 0;
}

/* 标题样式，采用较大的字体和加粗效果，增强视觉层次 */
h2, h3, h4 {
    font-weight: 700;
    margin-bottom: 20px;
}

h2 {
    font-size: 2em;
    color: #a8e063; /* 辅色，增强层次感 */
}

h3 {
    font-size: 1.75em;
    color: #fda085; /* 点缀色，吸引视线 */
}

h4 {
    font-size: 1.5em;
    color: #feb47b; /* 点缀色，制造视觉焦点 */
}

/* 段落样式，确保文本的可读性 */
p {
    font-size: 16px;
    margin-bottom: 20px;
    text-align: justify;
}

/* 表格样式，优化技术代码汇总部分的展示 */
table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 40px;
}

th, td {
    border: 1px solid #ffffff;
    padding: 12px;
    text-align: left;
}

th {
    background: #29323c;
    color: #ffffff;
}

td {
    background: #485563;
}

/* 代码块样式，使CSS代码在文章中清晰可见且美观 */
pre {
    background: #1e1e1e;
    padding: 15px;
    border-radius: 8px;
    overflow-x: auto;
    margin-bottom: 20px;
}

code {
    color: #00f2fe;
    font-family: 'Courier New', Courier, monospace;
}

/* 图片装饰样式，增加圆角和阴影效果 */
img.decorative {
    width: 320px;
    height: 320px;
    border-radius: 15px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    margin: 20px;
}

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

/* 导航栏样式，固定在顶部，并具备渐变背景 */
.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    background: rgba(41, 50, 60, 0.9);
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 1000;
    font-family: 'Roboto', sans-serif;
}

/* 侧边菜单样式，初始隐藏，激活时显示 */
.sidebar {
    position: fixed;
    left: -250px;
    top: 0;
    width: 250px;
    height: 100%;
    background: #29323c;
    transition: left 0.3s ease;
    padding: 20px;
}

.sidebar.active {
    left: 0;
}

/* 菜单切换按钮样式 */
.menu-toggle {
    cursor: pointer;
    font-size: 1.5em;
    color: #ffffff;
}

/* 主题切换按钮样式 */
.theme-toggle {
    background: none;
    border: none;
    cursor: pointer;
    color: #ffffff;
    font-size: 1.2em;
    transition: color 0.3s ease;
}

.theme-toggle:hover {
    color: #a8e063;
}

/* 卡片式设计样式，增强信息展示的视觉效果 */
.card {
    background: linear-gradient(120deg, #f6d365 0%, #fda085 100%);
    border-radius: 15px;
    padding: 20px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
    transform: translateY(-10px);
    box-shadow: 0 12px 20px rgba(0, 0, 0, 0.2);
}

/* 加载动画样式，实现旋转效果 */
.loader {
    border: 8px solid #f3f3f3;
    border-top: 8px solid #3498db;
    border-radius: 50%;
    width: 60px;
    height: 60px;
    animation: spin 2s linear infinite;
    margin: 50px auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 消息提示样式，使用橙红渐变色突出 */
.alert {
    background: linear-gradient(45deg, #ff7e5f, #feb47b);
    color: #ffffff;
    padding: 15px;
    border-radius: 5px;
    font-weight: bold;
    margin-bottom: 20px;
}

/* 滚动渐变动画样式 */
.fade-in-section {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
    will-change: opacity, transform;
}

.fade-in-section.is-visible {
    opacity: 1;
    transform: none;
}

/* 响应式设计，调整不同屏幕下的布局 */
@media (max-width: 768px) {
    .navbar {
        padding: 10px 15px;
    }

    h2 {
        font-size: 1.75em;
    }

    h3 {
        font-size: 1.5em;
    }

    .grid-container {
        grid-template-columns: 1fr;
        padding: 20px;
    }

    img.decorative {
        width: 100%;
        height: auto;
    }
}

/* 提示信息样式，显著位置显示 */
.reference-note {
    background: rgba(0, 0, 0, 0.5);
    padding: 10px 20px;
    border-radius: 8px;
    text-align: center;
    font-size: 1.2em;
    margin-bottom: 40px;
}

/* 折叠区域样式，次要信息隐藏 */
.collapsible {
    background-color: #485563;
    color: #ffffff;
    cursor: pointer;
    padding: 10px;
    width: 100%;
    border: none;
    text-align: left;
    outline: none;
    font-size: 1em;
    border-radius: 5px;
    transition: background-color 0.3s ease;
}

.collapsible:hover {
    background-color: #6d7a8f;
}

.content {
    padding: 0 18px;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
    background-color: #29323c;
    border-radius: 0 0 5px 5px;
    margin-bottom: 20px;
}

