
/* 
========================================================================
|                           全局样式设置
------------------------------------------------------------------------
| 此部分包括全局字体、颜色变量、基础布局以及响应式设计的
| 基础样式。通过使用CSS变量，提升颜色管理的灵活性与可维护性。
========================================================================
*/

/* 定义CSS变量，便于统一管理颜色 */
:root {
  --primary-color: #1E90FF; /* 主色调，深蓝色，体现科技感与专业性 */
  --secondary-color: #FFA500; /* 辅助色，橙色，用于增强视觉层次 */
  --background-color: #f5f5f5; /* 背景色，浅灰色，提供舒适的视觉基础 */
  --text-color: #333333; /* 文字颜色，深灰色，确保良好的可读性 */
  --accent-color: #00CED1; /* 点缀色，青色，用于高亮重要信息 */
}

/* 全局字体与背景设置 */
body {
  margin: 0;
  padding: 0;
  background-color: var(--background-color);
  color: var(--text-color);
  font-family: 'Roboto', sans-serif;
  line-height: 1.6;
}

/* 图片的默认样式，包含圆角、阴影与过渡效果 */
img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

img:hover {
  transform: scale(1.05);
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.2);
}

/* 链接的默认样式，包含颜色与悬停效果 */
a {
  color: var(--primary-color);
  text-decoration: none;
  transition: color 0.3s ease;
}

a:hover {
  color: var(--secondary-color);
}

/* 代码块的样式，确保与正文区分开 */
pre {
  background-color: #2d2d2d;
  color: #ccc;
  padding: 15px;
  border-radius: 5px;
  overflow-x: auto;
  font-family: 'Courier New', Courier, monospace;
  margin: 20px 0;
}

code {
  font-family: 'Courier New', Courier, monospace;
}

/* 导航栏的样式，固定在顶部，包含背景色与阴影 */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  background-color: var(--primary-color);
  color: #fff;
  padding: 15px 40px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 1000;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.navbar a {
  color: #fff;
  margin: 0 15px;
  text-decoration: none;
  font-weight: 500;
  transition: color 0.3s ease;
}

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

/* 面包屑导航的样式，帮助用户定位当前页面 */
.breadcrumb {
  display: flex;
  align-items: center;
  margin: 80px 20px 20px 20px; /* 考虑导航栏的高度 */
  font-size: 14px;
  color: #666;
}

.breadcrumb a {
  color: var(--primary-color);
  text-decoration: none;
  margin-right: 5px;
  transition: color 0.3s ease;
}

.breadcrumb a:hover {
  color: var(--secondary-color);
}

.breadcrumb span {
  margin-right: 5px;
}

/* 主内容区域的样式，使用网格布局 */
.container {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 20px;
  padding: 40px;
  max-width: 1200px;
  margin: 0 auto;
}

/* 头部与底部的样式，占据12栏 */
.header, .footer {
  grid-column: span 12;
  background-color: var(--primary-color);
  color: #fff;
  padding: 20px;
  text-align: center;
}

/* 侧边栏的样式，占据3栏 */
.sidebar {
  grid-column: span 3;
  background-color: #fff;
  padding: 20px;
  box-shadow: 0 0 10px rgba(0,0,0,0.1);
}

/* 主要内容区的样式，占据9栏 */
.main {
  grid-column: span 9;
  background-color: #fff;
  padding: 20px;
  box-shadow: 0 0 10px rgba(0,0,0,0.1);
}

/* 模块化设计，卡片的样式 */
.module {
  background-color: #fff;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  padding: 20px;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.module:hover {
  transform: translateY(-5px);
  box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

/* 按钮的样式，包含颜色与悬停效果 */
.button {
  background-color: var(--secondary-color);
  border: none;
  color: #fff;
  padding: 10px 20px;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

.button:hover {
  background-color: darken(var(--secondary-color), 10%);
}

/* 进度条的样式 */
.progress {
  background-color: #e0e0e0;
  border-radius: 4px;
  overflow: hidden;
  height: 10px;
}

.progress-bar {
  height: 100%;
  background-color: var(--secondary-color);
  transition: width 0.5s ease;
}

/* 图表的样式，使用flex布局 */
.chart {
  display: flex;
  align-items: flex-end;
  height: 300px;
  padding: 20px;
  background-color: #f0f0f0;
  border-radius: 8px;
  overflow: hidden;
}

.bar {
  flex: 1;
  margin: 0 10px;
  background-color: var(--primary-color);
  border-radius: 4px 4px 0 0;
  transition: height 0.5s ease, background-color 0.3s ease;
}

.bar:hover {
  background-color: var(--secondary-color);
}

/* 进度条悬停效果 */
.progress-bar:hover {
  background-color: var(--accent-color);
}

/* 动态背景中的关键帧动画 */
@keyframes moveBackground {
  from { transform: translate(0, 0); }
  to { transform: translate(-100%, -100%); }
}

/* 头部动画 */
.hero::before {
  content: '';
  position: absolute;
  width: 200%;
  height: 200%;
  background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="200" height="200"><circle cx="100" cy="100" r="50" fill="rgba(255, 255, 255, 0.1)" /></svg>') repeat;
  animation: moveBackground 20s linear infinite;
  opacity: 0.3;
}

/* 动态背景的样式 */
.hero {
  height: 400px;
  background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  text-align: center;
}

/* 卡片动画 */
.card {
  background-color: #fff;
  border-radius: 8px;
  box-shadow: 0 4px 6px rgba(0,0,0,0.1);
  overflow: hidden;
  transform: translateY(20px);
  opacity: 0;
  animation: fadeInUp 0.6s forwards;
}

@keyframes fadeInUp {
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

/* 加载动画的样式 */
.loader {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(255, 255, 255, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  animation: fadeOut 1s forwards;
  animation-delay: 2s;
}

@keyframes fadeOut {
  to {
    opacity: 0;
    visibility: hidden;
  }
}

/* 表格样式，增强可读性与美观 */
table {
  width: 100%;
  border-collapse: collapse;
  margin: 20px 0;
  font-size: 16px;
  text-align: left;
}

th, td {
  padding: 12px 15px;
  border-bottom: 1px solid #ddd;
}

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

tr:hover {
  background-color: #f1f1f1;
}

/* 响应式设计，适配不同屏幕尺寸 */
@media (max-width: 1024px) {
  .container {
    grid-template-columns: repeat(8, 1fr);
  }
  
  .sidebar {
    grid-column: span 2;
  }
  
  .main {
    grid-column: span 6;
  }
}

@media (max-width: 768px) {
  .container {
    grid-template-columns: repeat(4, 1fr);
    padding: 20px;
  }
  
  .sidebar {
    display: none;
  }
  
  .main {
    grid-column: span 4;
  }
}

@media (max-width: 480px) {
  .navbar {
    flex-direction: column;
    align-items: flex-start;
    padding: 10px 20px;
  }
  
  .breadcrumb {
    flex-direction: column;
    align-items: flex-start;
  }
  
  .container {
    grid-template-columns: 1fr;
    padding: 10px;
  }
  
  .main {
    grid-column: span 1;
  }
  
  .hero {
    height: 300px;
  }
}

