
/* 全局样式设置 */
body {
    margin: 0;
    padding: 0;
    font-family: 'Roboto', sans-serif; /* 使用现代无衬线字体 */
    background-color: #ffffff; /* 页面背景色 */
    color: #333333; /* 正文字体颜色 */
    line-height: 1.6;
}

/* 主题色变量定义 */
:root {
    --primary-color: #0B3D91; /* 主色调：深蓝色 */
    --secondary-color: #ffffff; /* 辅色调：灰白色 */
    --accent-color-1: #FFA500; /* 点缀色1：橙色 */
    --accent-color-2: #00bcd4; /* 点缀色2：电光蓝 */
    --text-color: #333333; /* 正文字体颜色 */
    --header-height: 60px; /* 导航栏高度 */
}

/* 导航栏样式 */
.navbar {
    position: fixed; /* 固定在顶部 */
    top: 0;
    width: 100%;
    height: var(--header-height);
    background-color: var(--secondary-color);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1); /* 阴影效果 */
    display: flex;
    align-items: center;
    z-index: 1000;
}

.navbar ul {
    list-style: none; /* 去除列表样式 */
    display: flex;
    margin: 0;
    padding: 0 20px;
}

.navbar li {
    margin-right: 20px;
}

.navbar a {
    text-decoration: none;
    color: var(--primary-color);
    font-weight: bold;
    transition: color 0.3s ease; /* 过渡效果 */
}

.navbar a:hover {
    color: var(--accent-color-2); /* 悬停变色 */
}

/* 面包屑导航样式 */
.breadcrumb {
    margin-top: calc(var(--header-height) + 20px);
    padding: 10px 20px;
    background-color: var(--secondary-color);
}

.breadcrumb a {
    text-decoration: none;
    color: var(--accent-color-1);
    margin-right: 5px;
}

.breadcrumb a::after {
    content: '>';
    margin-left: 5px;
}

/* 容器布局 */
.container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(500px, 1fr)); /* 最小宽度500px */
    gap: 20px;
    padding: 20px;
    margin-top: 20px;
}

/* 文章模块样式 */
article {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    background: linear-gradient(135deg, #f0f4f8, #d9e2ec); /* 渐变背景 */
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1); /* 阴影效果 */
    border-radius: 8px; /* 圆角 */
}

/* 标题样式 */
h2, h3, h4 {
    color: var(--primary-color);
    margin-bottom: 15px;
}

h2 {
    font-size: 2em;
    text-align: center;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1); /* 文字阴影 */
}

h3 {
    font-size: 1.5em;
}

h4 {
    font-size: 1.2em;
}

/* 段落样式 */
p {
    font-size: 1em;
    color: var(--text-color);
    margin-bottom: 15px;
}

/* 代码块样式 */
pre {
    background-color: #f5f5f5; /* 背景色 */
    padding: 15px;
    border-radius: 5px;
    overflow-x: auto;
    box-shadow: inset 0 0 10px rgba(0,0,0,0.1); /* 内部阴影 */
}

code {
    font-family: 'Courier New', Courier, monospace; /* 等宽字体 */
    color: #d63384; /* 代码字体颜色 */
}

/* 表格样式 */
table {
    width: 100%;
    border-collapse: collapse; /* 合并边框 */
    margin-bottom: 20px;
}

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

th {
    background-color: var(--primary-color);
    color: white;
}

/* 按钮样式 */
.button {
    display: inline-block;
    padding: 10px 20px;
    background-color: var(--accent-color-1);
    color: #ffffff;
    text-decoration: none;
    border-radius: 5px;
    transition: background-color 0.3s, transform 0.3s;
}

.button:hover {
    background-color: var(--accent-color-2);
    transform: scale(1.05); /* 放大效果 */
}

/* 图片样式 */
img.decorative {
    width: 320px;
    height: 320px;
    object-fit: cover;
    border-radius: 10px; /* 圆角 */
    box-shadow: 0 4px 8px rgba(0,0,0,0.2); /* 阴影 */
    transition: transform 0.3s, box-shadow 0.3s; /* 过渡效果 */
}

img.decorative:hover {
    transform: scale(1.05); /* 放大 */
    box-shadow: 0 8px 16px rgba(0,0,0,0.3); /* 加深阴影 */
}

/* 动画效果 */

/* 粒子流动画 */
@keyframes particleFlow {
    0% { transform: translateY(0); opacity: 1; }
    100% { transform: translateY(-100vh); opacity: 0; }
}

.particle {
    position: absolute;
    bottom: 0;
    width: 10px;
    height: 10px;
    background-color: var(--accent-color-1);
    border-radius: 50%;
    animation: particleFlow 5s linear infinite;
}

/* 流动线条动画 */
@keyframes flowLine {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.flow-line {
    position: absolute;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, var(--primary-color), var(--accent-color-2));
    animation: flowLine 3s linear infinite;
}

/* 动画元素定位 */
.background-animations {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none; /* 不干扰交互 */
    overflow: hidden;
    z-index: -1;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .container {
        grid-template-columns: 1fr; /* 单列布局 */
    }

    .navbar ul {
        flex-direction: column;
        padding: 10px;
    }

    .navbar li {
        margin-right: 0;
        margin-bottom: 10px;
    }

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

/* 折叠区域样式 */
.collapsible {
    background-color: #f1f1f1;
    color: #444;
    cursor: pointer;
    padding: 10px;
    width: 100%;
    border: none;
    text-align: left;
    outline: none;
    font-size: 16px;
    transition: background-color 0.3s;
}

.collapsible:hover {
    background-color: var(--accent-color-1);
    color: white;
}

.content {
    padding: 0 18px;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.2s ease-out;
    background-color: #f9f9f9;
}

/* 可见类 */
.visible {
    opacity: 1;
    transform: translateY(0);
}

/* 隐藏类 */
.hidden {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

/* 数据仪表盘样式 */
.dashboard {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
}

.dashboard .card {
    background-color: var(--secondary-color);
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 20px;
    flex: 1 1 calc(33% - 40px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s;
}

.dashboard .card:hover {
    transform: translateY(-5px);
}

.chart {
    width: 100%;
    height: 200px;
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color-1));
    border-radius: 4px;
    animation: pulse 2s infinite;
}

/* Pulse 动画 */
@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.7; }
    100% { opacity: 1; }
}

/* 可访问性优化 */
body {
    font-family: 'Helvetica Neue', Arial, sans-serif;
    background-color: var(--secondary-color);
    color: #333333;
}

a:focus, button:focus {
    outline: 2px dashed var(--accent-color-1);
}

/* 浏览器兼容性 */
@supports (display: grid) {
    .container {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(500px, 1fr));
    }
} else {
    .container {
        display: flex;
        flex-wrap: wrap;
    }
}

/* 折叠区展开样式 */
.collapsible.active, .collapsible:active {
    background-color: var(--accent-color-2);
    color: white;
}


