
/* 页面整体样式设定 */
/* 采用冷色调为主，搭配亮色点缀，营造未来科技感 */
:root {
  --main-color: #0a1d37; /* 主色：深蓝 */
  --secondary-color: #1e3c72; /* 辅色：中蓝 */
  --accent-color1: #39ff14; /* 点缀色1：荧光绿 */
  --accent-color2: #ff6200; /* 点缀色2：橙色 */
  --text-color: #ffffff; /* 正文字体颜色 */
  --background-gradient: linear-gradient(135deg, #0a1d37 0%, #1e3c72 100%);
}

/* 全局样式 */
body {
  margin: 0;
  padding: 0;
  background: var(--background-gradient);
  color: var(--text-color);
  font-family: 'Montserrat', sans-serif;
  line-height: 1.6;
  scroll-behavior: smooth;
}

/* 导航栏样式 */
.navbar {
  position: fixed;
  top: 0;
  width: 100%;
  background-color: rgba(10, 29, 55, 0.9);
  padding: 15px 20px;
  z-index: 1000;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: 0 2px 5px rgba(0,0,0,0.3);
}

.navbar .logo {
  font-size: 1.5em;
  font-weight: bold;
  color: var(--accent-color1);
}

.navbar ul {
  list-style: none;
  display: flex;
  margin: 0;
  padding: 0;
}

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

.navbar ul li a {
  color: #fff;
  text-decoration: none;
  transition: color 0.3s ease;
}

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

/* 章节导航样式 */
.section-nav {
  position: fixed;
  top: 60px;
  right: 20px;
  background-color: rgba(10, 29, 55, 0.8);
  padding: 10px;
  border-radius: 8px;
}

.section-nav ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.section-nav ul li {
  margin: 10px 0;
}

.section-nav ul li a {
  color: #fff;
  text-decoration: none;
  font-size: 0.9em;
  transition: color 0.3s ease;
}

.section-nav ul li a:hover {
  color: var(--accent-color2);
}

/* 主内容区域样式 */
.container {
  max-width: 1200px;
  margin: 100px auto 50px;
  padding: 20px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
}

/* 模块样式 */
.module {
  background-color: rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  padding: 20px;
  box-shadow: 0 4px 6px rgba(0,0,0,0.3);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.module:hover {
  transform: scale(1.05);
  box-shadow: 0 6px 10px rgba(0,0,0,0.4);
}

/* 图片样式 */
.module img {
  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;
}

.module img:hover {
  transform: scale(1.05);
  box-shadow: 0 6px 10px rgba(0,0,0,0.4);
}

/* 按钮样式 */
.button {
  background-color: var(--accent-color1);
  border: none;
  padding: 10px 20px;
  color: #fff;
  cursor: pointer;
  border-radius: 5px;
  transition: background-color 0.3s ease, transform 0.3s ease;
  font-size: 1em;
}

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

/* 代码块样式 */
code {
  display: block;
  background-color: rgba(255, 255, 255, 0.1);
  padding: 15px;
  border-radius: 8px;
  overflow-x: auto;
  white-space: pre-wrap;
  font-family: 'Courier New', Courier, monospace;
  margin: 10px 0;
}

/* 滚动动画 */
@keyframes particlesMove {
  from { transform: translate(0, 0); }
  to { transform: translate(-1000px, 1000px); }
}

/* 粒子背景 */
.particles {
  position: absolute;
  width: 100%;
  height: 100%;
  background: transparent;
  top: 0;
  left: 0;
  pointer-events: none;
  animation: particlesMove 20s linear infinite;
}

/* 回到顶部按钮 */
.back-to-top {
  position: fixed;
  bottom: 30px;
  right: 30px;
  background-color: var(--accent-color2);
  color: #fff;
  padding: 10px;
  border-radius: 50%;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.back-to-top.show {
  opacity: 1;
}

