
/* 
整体布局样式
采用CSS Grid和Flexbox实现响应式网格布局，确保页面在不同设备上均有良好的显示效果。
*/

/* 主题色变量定义 */
:root {
  --primary-color: #0A2342; /* 主色调：深蓝色，传递科技感与信赖 */
  --secondary-color: #CDD3DE; /* 辅助色：银灰色，增强专业氛围 */
  --accent-color: #FF9800; /* 点缀色：橙色，突出重要信息和按钮 */
  --success-color: #67C23A; /* 正向色：绿色，用于数据可视化部分 */
  --background-color: #F5F7FA; /* 背景色：浅灰色，保持页面简洁清爽 */
}

/* 全局样式 */
body {
  margin: 0;
  padding: 0;
  font-family: 'Roboto', sans-serif;
  background-color: var(--background-color);
  color: var(--primary-color);
  line-height: 1.6;
}

/* 导航栏样式 */
.navbar {
  position: fixed;
  top: 0;
  width: 100%;
  background-color: var(--primary-color);
  display: flex;
  justify-content: space-around;
  align-items: center;
  padding: 15px 0;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  z-index: 1000;
}

.navbar a {
  color: #FFFFFF;
  text-decoration: none;
  padding: 8px 16px;
  transition: background-color 0.3s ease, transform 0.3s ease;
}

.navbar a:hover {
  background-color: var(--accent-color);
  border-radius: 4px;
  transform: scale(1.05);
}

/* 主要内容容器 */
.container {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 20px;
  padding: 100px 20px 40px 20px; /* 顶部留出导航栏空间 */
}

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

.sidebar img {
  width: 100%;
  border-radius: 8px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

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

/* 主内容样式 */
.main-content {
  grid-column: span 9;
}

.main-content h2, .main-content h3, .main-content h4 {
  color: var(--primary-color);
}

.main-content h2 {
  font-size: 2rem;
  margin-bottom: 20px;
}

.main-content h3 {
  font-size: 1.75rem;
  margin-bottom: 15px;
}

.main-content h4 {
  font-size: 1.5rem;
  margin-bottom: 10px;
}

.main-content p {
  font-size: 16px;
  color: var(--secondary-color);
  margin-bottom: 15px;
}

/* 代码块样式 */
pre {
  background: #2D2D2D;
  padding: 15px;
  border-radius: 8px;
  overflow: auto;
  margin-bottom: 20px;
}

pre code {
  color: #FFFFFF;
  font-family: 'Courier New', Courier, monospace;
  font-size: 14px;
}

/* 图片样式 */
img {
  width: 100%;
  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 8px 12px rgba(0, 0, 0, 0.2);
}

/* 折叠区域样式 */
.details {
  margin-bottom: 20px;
}

.summary {
  cursor: pointer;
  font-weight: bold;
  color: var(--accent-color);
}

summary::-webkit-details-marker {
  display: none;
}

.details summary::before {
  content: '▼ ';
  display: inline-block;
  transition: transform 0.3s ease;
}

.details[open] summary::before {
  transform: rotate(180deg);
}

/* 按钮样式 */
.button {
  padding: 12px 24px;
  background-color: var(--accent-color);
  color: #FFFFFF;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  transition: background-color 0.3s ease, transform 0.3s ease;
}

.button:hover {
  background-color: darkorange;
  transform: scale(1.05);
}

/* 底部样式 */
.footer {
  background-color: var(--primary-color);
  color: #FFFFFF;
  padding: 40px 20px;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
}

.footer .section {
  flex: 1 1 200px;
  margin: 10px;
}

.footer a {
  color: #FFFFFF;
  text-decoration: none;
  display: block;
  margin-bottom: 8px;
  transition: color 0.3s ease;
}

.footer a:hover {
  color: var(--accent-color);
}

/* 响应式设计 */
@media (max-width: 1024px) {
  .navbar {
    flex-direction: column;
    align-items: center;
  }

  .container {
    grid-template-columns: repeat(6, 1fr);
  }

  .sidebar {
    grid-column: span 6;
  }

  .main-content {
    grid-column: span 6;
  }

  .main-content h2 {
    font-size: 1.75rem;
  }
}

@media (max-width: 768px) {
  .container {
    grid-template-columns: repeat(4, 1fr);
  }

  .sidebar, .main-content {
    grid-column: span 4;
  }

  .main-content h2 {
    font-size: 1.5rem;
  }
}

@media (max-width: 480px) {
  .container {
    grid-template-columns: repeat(2, 1fr);
  }

  .sidebar, .main-content {
    grid-column: span 2;
  }

  .main-content h2 {
    font-size: 1.25rem;
  }

  .footer {
    flex-direction: column;
    align-items: center;
  }
}

/* 动画效果 */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.section {
  opacity: 0;
  animation: fadeInUp 1s forwards;
}

.section:nth-child(odd) {
  animation-delay: 0.3s;
}

.section:nth-child(even) {
  animation-delay: 0.6s;
}

