
/* 定义CSS变量，方便整体色彩管理 */
:root {
  --primary-color: #0D47A1; /* 深蓝色，主色调 */
  --background-color: #FFFFFF; /* 白色，背景色 */
  --secondary-background: #F5F5F5; /* 浅灰色，辅助背景色 */
  --accent-color-blue: #00BCD4; /* 电光蓝，强调色 */
  --accent-color-orange: #FF9800; /* 橙色，点缀色 */
  --text-color: #333333; /* 正文字体颜色 */
  --font-family: 'Roboto', sans-serif; /* 主字体 */
}

/* 全局样式设置 */
body {
  margin: 0;
  padding: 0;
  background-color: var(--background-color);
  color: var(--text-color);
  font-family: var(--font-family);
  line-height: 1.6;
  transition: background-color 0.3s ease, color 0.3s ease;
}

/* 固定导航栏样式 */
.navbar {
  position: fixed;
  top: 0;
  width: 100%;
  background-color: var(--primary-color);
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  z-index: 1000;
  transition: top 0.3s ease;
}

.navbar.hidden {
  top: -60px;
}

.navbar ul {
  list-style: none;
  margin: 0;
  padding: 10px 20px;
  display: flex;
  justify-content: flex-end;
}

.navbar ul li {
  margin-left: 20px;
}

.navbar ul li a {
  color: #FFFFFF;
  text-decoration: none;
  font-size: 16px;
  transition: color 0.3s ease;
}

.navbar ul li a:hover {
  color: var(--accent-color-orange);
}

/* 容器样式，采用网格布局 */
.container {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 20px;
  padding: 100px 20px 20px 20px; /* 顶部留出导航栏空间 */
}

/* 头部区域样式 */
.header {
  grid-column: 1 / -1;
  position: relative;
  height: 300px;
  background: var(--primary-color);
  overflow: hidden;
}

.geometric-shape {
  position: absolute;
  width: 100px;
  height: 100px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  animation: rotateShape 20s linear infinite;
}

@keyframes rotateShape {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* 主要内容布局 */
.main-content {
  grid-column: 4 / -1;
}

/* 侧边栏样式 */
.sidebar {
  grid-column: 1 / 4;
}

@media (max-width: 1024px) {
  .sidebar {
    grid-column: 1 / -1;
  }
  .main-content {
    grid-column: 1 / -1;
  }
}

/* 文章样式 */
article {
  max-width: 1000px;
  margin: 0 auto;
}

article h2, article h3 {
  color: var(--primary-color);
}

article pre {
  background-color: var(--secondary-background);
  padding: 15px;
  border-radius: 5px;
  overflow-x: auto;
}

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

.image-gallery {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  margin: 20px 0;
}

.image-gallery img {
  width: 320px;
  height: 320px;
  object-fit: cover;
  border-radius: 10px;
  box-shadow: 0 4px 10px rgba(0,0,0,0.1);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.image-gallery img:hover {
  transform: scale(1.05);
  box-shadow: 0 8px 20px rgba(0,0,0,0.2);
}

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

.button:hover, .link:hover {
  background-color: var(--accent-color-orange);
  transform: translateY(-3px);
}

/* 数据监控面板样式 */
.data-panel {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
}

.data-card {
  background-color: var(--secondary-background);
  border: 1px solid #ddd;
  border-radius: 8px;
  padding: 20px;
  flex: 1 1 calc(33.333% - 40px);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

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

/* 夜间模式样式 */
body.dark-mode {
  --background-color: #121212;
  --primary-color: #BB86FC;
  --secondary-background: #1E1E1E;
}

.toggle-button {
  position: fixed;
  top: 80px;
  right: 20px;
  background: var(--accent-color-blue);
  border: none;
  border-radius: 50%;
  width: 50px;
  height: 50px;
  cursor: pointer;
  transition: background 0.3s ease;
}

.toggle-button:hover {
  background: var(--accent-color-orange);
}

/* 响应式设计调整 */
@media (max-width: 768px) {
  .data-card {
    flex: 1 1 calc(50% - 40px);
  }
}

@media (max-width: 600px) {
  .data-card {
    flex: 1 1 100%;
  }
}

