
/* 
 * 全局样式初始化，确保不同浏览器下有一致的显示效果 
 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* 
 * 定义 CSS 变量，便于主题颜色的统一管理和修改 
 */
:root {
    --primary-color: #1E3A8A; /* 主色调：深蓝色 */
    --secondary-color: #F3F4F6; /* 次色调：浅灰色 */
    --highlight-color: #F97316; /* 点缀色：橙色 */
    --text-color: #333333; /* 正文字体颜色 */
    --background-color: #FFFFFF; /* 页面背景色 */
    --font-family: 'Roboto', sans-serif; /* 全局字体 */
}

/* 
 * 设置页面整体背景和字体样式 
 */
body {
    background-color: var(--secondary-color);
    color: var(--text-color);
    font-family: var(--font-family);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* 
 * 导航栏样式，包括响应式设计和汉堡菜单的隐藏显示 
 */
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: var(--primary-color);
    padding: 15px 20px;
}

.navbar a {
    color: var(--background-color);
    margin: 0 10px;
    text-decoration: none;
    font-weight: bold;
    transition: color 0.3s;
}

.navbar a:hover {
    color: var(--highlight-color);
}

.hamburger {
    display: none;
    flex-direction: column;
    cursor: pointer;
}

.hamburger div {
    width: 25px;
    height: 3px;
    background-color: var(--background-color);
    margin: 4px 0;
    transition: all 0.3s;
}

/* 
 * 移动端导航样式，展示汉堡菜单 
 */
@media (max-width: 768px) {
    .navbar a {
        display: none;
    }
    .hamburger {
        display: flex;
    }
    .navbar.active a {
        display: block;
        margin: 10px 0;
    }
}

/* 
 * 主要内容区域布局，采用响应式网格布局 
 */
.container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    padding: 20px;
    flex: 1;
}

/* 
 * 卡片样式，包含悬停效果和阴影 
 */
.card {
    background: var(--background-color);
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s, box-shadow 0.3s;
    overflow: hidden;
}

.card:hover {
    transform: scale(1.05);
    box-shadow: 0 10px 15px rgba(0, 0, 0, 0.2);
}

/* 
 * 动态矩阵区域的样式，包含动画效果 
 */
.matrix {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 15px;
    animation: fadeIn 1s ease-in-out;
}

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

.matrix .card {
    position: relative;
    overflow: hidden;
}

.matrix .card:hover .overlay {
    opacity: 0.8;
}

.overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(31, 58, 138, 0.7);
    color: var(--background-color);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s;
}

/* 
 * 数据可视化图表的样式，包含动态效果 
 */
.chart {
    position: relative;
    width: 100%;
    height: 200px;
    background: linear-gradient(135deg, var(--primary-color), var(--highlight-color));
    border-radius: 10px;
    overflow: hidden;
}

.chart::before {
    content: '';
    position: absolute;
    bottom: 0;
    width: 100%;
    height: 0;
    background: rgba(255, 255, 255, 0.3);
    transition: height 0.5s ease-in-out;
}

.chart:hover::before {
    height: 100%;
}

/* 
 * 个性化设置区域的样式，允许用户调整界面 
 */
.customizer {
    display: flex;
    flex-direction: column;
    padding: 20px;
    background-color: var(--background-color);
    border-top: 1px solid #E5E7EB;
}

.customizer label {
    margin-bottom: 10px;
    font-weight: bold;
}

.customizer input[type="color"],
.customizer input[type="range"] {
    margin-bottom: 20px;
}

/* 
 * 响应式设计，针对不同屏幕尺寸调整布局 
 */
@media (max-width: 1024px) {
    .container {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    }
}

@media (max-width: 480px) {
    .matrix {
        grid-template-columns: 1fr;
    }
}

/* 
 * 字体与图形的样式，确保信息层次分明 
 */
h2 {
    font-size: 2em;
    font-weight: 700;
    margin-bottom: 15px;
    color: var(--primary-color);
}

h3 {
    font-size: 1.5em;
    font-weight: 600;
    margin-bottom: 10px;
    color: var(--highlight-color);
}

p {
    font-size: 1em;
    line-height: 1.6;
    margin-bottom: 15px;
}

pre, code {
    background-color: #f5f5f5;
    padding: 10px;
    border-radius: 5px;
    overflow-x: auto;
}

.illustration {
    width: 100%;
    height: auto;
    border-radius: 10px;
    margin: 20px 0;
}

/* 
 * 提示信息的样式，确保显著位置 
 */
.reference-note {
    background-color: var(--highlight-color);
    color: var(--background-color);
    text-align: center;
    padding: 10px 0;
    font-weight: bold;
    font-size: 1.2em;
}

