
/* 
  全局样式设置
  设置基本的字体、颜色、背景以及全局布局
*/
body {
  margin: 0;
  padding: 0;
  font-family: 'Roboto', sans-serif;
  background: linear-gradient(135deg, #1E90FF, #00BFFF);
  color: #333;
  line-height: 1.6;
  overflow-x: hidden; /* 防止出现水平滚动条 */
}

/* 导航栏样式 */
.navbar {
  position: fixed;
  top: 0;
  width: 100%;
  background-color: rgba(30, 144, 255, 0.8); /* 半透明背景 */
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 20px;
  backdrop-filter: blur(5px); /* 背景模糊效果 */
  z-index: 1000; /* 确保导航栏在最上层 */
}

.navbar .logo {
  font-size: 1.5em;
  color: #fff;
  font-weight: bold;
}

.navbar .menu {
  display: flex;
  gap: 15px;
}

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

.navbar .menu a:hover {
  color: #FFD700; /* 点缀色，吸引视线 */
}

/* 响应式菜单图标 */
.menu-icon {
  display: none;
  font-size: 24px;
  color: #fff;
  background: none;
  border: none;
  cursor: pointer;
}

/* 章节导航样式 */
.chapter-nav {
  position: fixed;
  left: 0;
  top: 60px;
  width: 200px;
  background-color: rgba(255, 255, 255, 0.8);
  padding: 20px;
  border-right: 1px solid #ccc;
  box-shadow: 2px 0 5px rgba(0,0,0,0.1);
  height: calc(100% - 60px);
  overflow-y: auto;
}

.chapter-nav a {
  display: block;
  margin-bottom: 10px;
  color: #333;
  text-decoration: none;
  font-size: 16px;
  transition: color 0.3s ease;
}

.chapter-nav a:hover {
  color: #1E90FF;
}

/* 主内容区域 */
.container {
  display: grid;
  grid-template-columns: 200px 1fr; /* 章节导航占200px，主内容自适应 */
  gap: 20px;
  padding: 80px 40px 40px 40px; /* 避免与固定导航栏重叠 */
}

/* 移动端样式调整 */
@media (max-width: 768px) {
  .navbar {
    flex-direction: column;
    align-items: flex-start;
  }

  .navbar .menu {
    display: none;
    flex-direction: column;
    width: 100%;
  }

  .navbar .menu.show {
    display: flex;
  }

  .menu-icon {
    display: block;
  }

  .chapter-nav {
    display: none;
  }

  .container {
    grid-template-columns: 1fr;
    padding: 80px 20px 20px 20px;
  }
}

/* 图片容器样式 */
.image-container {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
}

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

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

/* 文章样式 */
article {
  background: rgba(255, 255, 255, 0.2);
  padding: 20px;
  border-radius: 10px;
  box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

article h2, article h3, article h4 {
  color: #fff;
  text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
}

article p {
  font-size: 16px;
  color: #f0f0f0;
}

article pre {
  background: rgba(0, 0, 0, 0.6);
  padding: 15px;
  border-radius: 5px;
  overflow-x: auto;
}

article code {
  color: #00FF7F;
  font-family: 'Courier New', Courier, monospace;
}

/* 提示信息样式 */
.reference-note {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background: rgba(255, 215, 0, 0.9);
  color: #333;
  padding: 10px 20px;
  border-radius: 5px;
  box-shadow: 0 4px 6px rgba(0,0,0,0.2);
  font-size: 14px;
}

/* 按钮样式 */
.button {
  background: linear-gradient(45deg, #1E90FF, #00BFFF);
  border: none;
  padding: 15px 30px;
  color: #fff;
  border-radius: 5px;
  cursor: pointer;
  transition: background 0.3s ease;
}

.button:hover {
  background: linear-gradient(45deg, #00BFFF, #1E90FF);
}

/* 折叠区域样式 */
.collapsible {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  cursor: pointer;
  padding: 10px;
  width: 100%;
  border: none;
  text-align: left;
  outline: none;
  font-size: 18px;
  transition: background 0.3s ease;
  border-radius: 5px;
  margin-top: 10px;
}

.collapsible:hover {
  background: rgba(255, 255, 255, 0.2);
}

.content {
  padding: 0 15px;
  display: none;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 5px;
  margin-bottom: 10px;
}

/* CSS3代码示例块样式 */
.code-example {
  background: rgba(0, 0, 0, 0.7);
  padding: 20px;
  border-radius: 10px;
  overflow-x: auto;
  margin: 20px 0;
}

.code-example code {
  color: #00FF7F;
  font-family: 'Courier New', Courier, monospace;
}

/* 关键帧动画 */
@keyframes float {
  0% { transform: translateY(0); }
  50% { transform: translateY(-20px); }
  100% { transform: translateY(0); }
}

/* 动态网络节点 */
.network-node {
  width: 15px;
  height: 15px;
  background-color: #00BFFF;
  border-radius: 50%;
  position: absolute;
  animation: float 6s infinite;
}

/* 渐变线条装饰 */
.gradient-line {
  height: 4px;
  background: linear-gradient(90deg, #1E90FF, #00BFFF, #1E90FF);
  border-radius: 2px;
  margin: 20px 0;
  animation: gradientMove 3s infinite;
}

@keyframes gradientMove {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

