
/* 定义颜色变量 */
:root {
  --主色: #212F3D; /* 深蓝色，作为整体背景色，传达科技感与专业性 */
  --辅助分隔线色: #6E7781; /* 钢灰色，用于模块分隔线，增强层次感 */
  --点缀色1: #FFA500; /* 亮橙色，用于按钮激活态和视觉焦点 */
  --点缀色2: #4CAF50; /* 绿色，用于成功提示和强调 */
}

/* 全局样式 */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  background-color: var(--主色);
  color: #FFFFFF;
  font-family: 'Roboto', sans-serif;
  line-height: 1.6;
  font-size: 16px;
  overflow-x: hidden; /* 防止水平滚动条出现 */
}

/* 导航栏样式 */
.navbar {
  position: fixed;
  top: 0;
  width: 100%;
  background-color: rgba(33, 47, 61, 0.9);
  transition: background-color 0.3s ease;
  z-index: 1000;
  padding: 10px 20px;
}

.navbar.scrolled {
  background-color: var(--主色);
}

.navbar-menu {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.navbar-menu ul {
  display: flex;
  list-style: none;
}

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

.navbar-menu li a {
  color: #FFFFFF;
  text-decoration: none;
  padding: 10px 15px;
  transition: color 0.3s ease;
}

.navbar-menu li a:hover {
  color: var(--点缀色1);
}

/* 汉堡菜单样式（移动设备） */
.hamburger-menu {
  display: none;
  flex-direction: column;
  cursor: pointer;
}

.hamburger-menu div {
  width: 25px;
  height: 3px;
  background-color: #FFFFFF;
  margin: 4px 0;
  transition: all 0.3s ease;
}

/* 响应式设计 */
@media (max-width: 768px) {
  .navbar-menu ul {
    display: none;
    flex-direction: column;
    width: 100%;
  }
  .navbar-menu ul.active {
    display: flex;
  }
  .hamburger-menu {
    display: flex;
  }
}

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

/* 模块样式 */
.module {
  grid-column: span 12;
  padding: 40px 20px;
}

@media (min-width: 768px) {
  .module {
    grid-column: span 6;
  }
}

@media (min-width: 1200px) {
  .module {
    grid-column: span 4;
  }
}

/* 按钮样式 */
.btn-active {
  background-color: var(--点缀色1);
  color: #FFFFFF;
  border: none;
  padding: 10px 20px;
  border-radius: 5px;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

.btn-active:hover {
  background-color: darken(var(--点缀色1), 10%);
}

/* 成功提示样式 */
.success-message {
  color: var(--点缀色2);
  font-weight: bold;
}

/* 图片样式 */
.deco-image {
  width: 100%;
  border-radius: 10px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.deco-image:hover {
  transform: scale(1.05);
  box-shadow: 0 8px 12px rgba(0, 0, 0, 0.5);
}

/* 代码块样式 */
pre {
  background-color: #2C3E50;
  padding: 15px;
  border-radius: 8px;
  overflow-x: auto;
}

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

/* 折叠内容样式 */
.collapsible {
  background-color: var(--主色);
  color: #FFFFFF;
  cursor: pointer;
  padding: 10px 20px;
  width: 100%;
  border: none;
  text-align: left;
  outline: none;
  font-size: 16px;
  transition: background-color 0.3s ease;
}

.active, .collapsible:hover {
  background-color: var(--点缀色1);
}

.content {
  padding: 0 20px;
  display: none;
  overflow: hidden;
  background-color: #34495E;
  border-radius: 8px;
}

/* 渐变线条装饰 */
.gradient-line {
  height: 2px;
  background: linear-gradient(90deg, rgba(255,165,0,0), rgba(255,165,0,0.5), rgba(255,165,0,0));
  margin: 20px 0;
  animation: slide 3s infinite;
}

@keyframes slide {
  0% { transform: translateX(-100%); }
  50% { transform: translateX(100%); }
  100% { transform: translateX(-100%); }
}

/* 页脚样式 */
.footer {
  background-color: var(--主色);
  padding: 40px 20px;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
}

.footer .social-links a {
  color: #FFFFFF;
  margin-right: 15px;
  font-size: 1.5em;
  transition: color 0.3s ease;
}

.footer .social-links a:hover {
  color: var(--点缀色1);
}

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

.dynamic-chart {
  animation: loadChart 1s ease-out forwards;
}

/* 时间轴样式 */
.timeline {
  position: relative;
  padding: 40px 0;
  list-style: none;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 50%;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--辅助分隔线色);
  transform: translateX(-50%);
}

.timeline-item {
  position: relative;
  width: 50%;
  padding: 20px 40px;
  box-sizing: border-box;
}

.timeline-item:nth-child(odd) {
  left: 0;
}

.timeline-item:nth-child(even) {
  left: 50%;
}

.timeline-item::before {
  content: '';
  position: absolute;
  top: 20px;
  width: 12px;
  height: 12px;
  background: var(--点缀色1);
  border-radius: 50%;
  transform: translateX(-50%);
}

.timeline-item:nth-child(odd)::before {
  right: -6px;
}

.timeline-item:nth-child(even)::before {
  left: -6px;
}

.timeline-item-content {
  background: #2C3E50;
  padding: 15px;
  border-radius: 8px;
  transition: background 0.3s ease;
}

.timeline-item-content:hover {
  background: var(--点缀色1);
}

/* 表格样式 */
.table {
  width: 100%;
  border-collapse: collapse;
  margin: 20px 0;
}

.table th, .table td {
  border: 1px solid var(--辅助分隔线色);
  padding: 10px;
  text-align: left;
}

.table th {
  background-color: #34495E;
}

.table tr:nth-child(even) {
  background-color: #2C3E50;
}

/* 阴影效果 */
.box-shadow {
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

/* 文字阴影 */
.text-shadow {
  text-shadow: 1px 1px 2px rgba(0,0,0,0.5);
}

