
/* 全局样式设置 */
body {
    /* 使用线性渐变作为背景，营造科技感与未来感 */
    background: linear-gradient(135deg, #0d47a1, #6a1b9a);
    color: #ffffff;
    font-family: 'Roboto', sans-serif;
    margin: 0;
    padding: 0;
    /* 使用流式布局，确保响应式设计 */
    display: flex;
    flex-direction: column;
    align-items: center;
    /* 设置最小宽度，防止内容过窄 */
    min-width: 320px;
    box-sizing: border-box;
    /* 添加平滑过渡效果 */
    transition: background 0.5s ease, color 0.5s ease;
}

/* 固定导航栏样式 */
.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    background: rgba(13, 71, 161, 0.9);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 30px;
    z-index: 1000;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

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

/* 导航链接悬停效果 */
.navbar a:hover {
    color: #ff9800;
}

/* 主内容区样式 */
.main-content {
    /* 为避免导航栏遮挡，添加顶部内边距 */
    padding-top: 80px;
    width: 90%;
    max-width: 1200px;
    display: grid;
    grid-template-columns: 1fr;
    grid-gap: 40px;
    margin: 0 auto;
}

/* 文章区块样式 */
article {
    background: rgba(255, 255, 255, 0.1);
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    /* 使用渐变边框增强视觉效果 */
    border: 1px solid transparent;
    background-clip: padding-box;
    position: relative;
}

article::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: 10px;
    padding: 2px;
    background: linear-gradient(45deg, #ff9800, #4caf50);
    -webkit-mask: 
        linear-gradient(#fff 0 0) content-box, 
        linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
}

/* 文章标题样式 */
article h2 {
    font-size: 24px;
    margin-bottom: 20px;
    color: #ffffff;
}

/* 文章副标题样式 */
article h3 {
    font-size: 20px;
    margin-top: 30px;
    margin-bottom: 15px;
    color: #ff9800;
}

/* 文章段落样式 */
article p {
    font-size: 16px;
    line-height: 1.6;
    margin-bottom: 20px;
    color: #f0f0f0;
}

/* 代码块样式 */
pre {
    background: rgba(0, 0, 0, 0.7);
    padding: 15px;
    border-radius: 5px;
    overflow: auto;
    position: relative;
}

/* 代码标签样式 */
code {
    color: #00e676;
    font-family: 'Courier New', Courier, monospace;
    /* 确保代码内容不被遮挡 */
    overflow: visible;
}

/* 代码块标题样式 */
pre code::before {
    content: "代码示例";
    display: block;
    font-size: 14px;
    color: #ffeb3b;
    margin-bottom: 5px;
}

/* 图片装饰样式 */
.decorative-image {
    width: 100%;
    max-width: 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;
}

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

/* 响应式布局 */
@media (min-width: 500px) {
    .main-content {
        grid-template-columns: 2fr 1fr;
    }
    
    .sidebar {
        position: sticky;
        top: 80px;
    }
}

@media (max-width: 768px) {
    .navbar {
        flex-direction: column;
        align-items: flex-start;
    }

    .navbar a {
        margin: 10px 0;
        font-size: 18px;
    }

    .main-content {
        grid-template-columns: 1fr;
    }
}

/* 提示信息样式 */
.reference-note {
    background: rgba(255, 152, 0, 0.8);
    color: #ffffff;
    padding: 10px 20px;
    border-radius: 5px;
    text-align: center;
    font-size: 18px;
    margin: 20px 0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* 按钮样式 */
.button {
    background: #ff9800;
    color: #ffffff;
    border: none;
    padding: 10px 20px;
    border-radius: 25px;
    cursor: pointer;
    transition: background 0.3s ease, transform 0.3s ease;
    font-size: 16px;
}

.button:hover {
    background: #4caf50;
    transform: scale(1.05);
}

/* 折叠区域样式 */
.collapsible {
    background: rgba(255, 255, 255, 0.2);
    color: #ffffff;
    cursor: pointer;
    padding: 10px;
    width: 100%;
    border: none;
    text-align: left;
    outline: none;
    font-size: 18px;
    border-radius: 5px;
    transition: background 0.3s ease;
}

.collapsible:hover {
    background: rgba(255, 152, 0, 0.8);
}

.content {
    padding: 0 20px;
    display: none;
    background: rgba(0, 0, 0, 0.5);
    overflow: hidden;
    border-radius: 5px;
}

.content.show {
    display: block;
}

/* Loader样式 */
.loader {
    border: 8px solid #f3f3f3;
    border-top: 8px solid #ff9800;
    border-radius: 50%;
    width: 60px;
    height: 60px;
    animation: spin 1s linear infinite;
    margin: 100px auto;
}

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

/* 高亮信息块样式 */
.highlight {
    position: relative;
    z-index: 10;
    background: #4caf50;
    color: #ffffff;
    padding: 10px 15px;
    border-radius: 5px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

/* 图表容器样式 */
.chart-container {
    width: 100%;
    max-width: 800px;
    margin: 50px auto;
}

.chart {
    display: flex;
    align-items: flex-end;
    height: 300px;
    background: #f5f5f5;
    padding: 20px;
    border-radius: 10px;
}

.chart-bar {
    flex: 1;
    margin: 0 10px;
    background: linear-gradient(180deg, #6a1b9a, #8e24aa);
    border-radius: 5px 5px 0 0;
    transition: height 0.3s ease;
}

.chart-bar:hover {
    background: linear-gradient(180deg, #8e24aa, #6a1b9a);
}

/* SVG图标样式 */
.svg-icon {
    width: 50px;
    height: 50px;
    transition: fill 0.3s ease, transform 0.3s ease;
}

.svg-icon:hover {
    fill: #ff9800;
    transform: scale(1.1);
}

/* 加载动画关键帧 */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* 动画应用 */
.fade-in {
    animation: fadeIn 2s ease-in-out;
}

