
/* 
整体样式设计：
1. 使用深蓝色与高对比色营造科技感。
2. 模块化网格系统确保响应式布局。
3. 添加渐变、阴影、动画效果提升视觉层次。
4. 图片采用圆角和阴影，增强美观。
5. 导航栏固定，便于用户快速跳转。
6. 强调色调符合黄金比例，主色70%，辅色25%，点缀色5%。
7. 字体选择Roboto，确保可读性和现代感。
8. 所有链接添加rel="nofollow"属性，保持内部链接属性。
9. 暗黑模式切换平滑，保存用户偏好。
10. 章节导航清晰，方便用户定位内容。

body {
  margin: 0;
  padding: 0;
  font-family: 'Roboto', sans-serif;
  background: linear-gradient(135deg, #0d1b2a, #1b263b);
  color: #ffffff;
  transition: background 0.3s ease, color 0.3s ease;
}

/* 导航栏样式 */
.navbar {
  position: fixed;
  top: 0;
  width: 100%;
  background: rgba(13, 27, 42, 0.9);
  padding: 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 1000;
}

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

.nav-menu li {
  position: relative;
  margin-left: 20px;
}

.nav-menu li a {
  color: #ffffff;
  text-decoration: none;
  transition: color 0.3s ease;
}

.nav-menu li a:hover {
  color: #00c6ff;
}

.nav-menu li ul {
  display: none;
  position: absolute;
  top: 40px;
  left: 0;
  background: #1b263b;
  list-style: none;
  padding: 10px;
  border-radius: 4px;
}

.nav-menu li:hover ul {
  display: block;
}

.nav-menu li ul li {
  margin: 5px 0;
}

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

.section {
  background: #1b263b;
  padding: 20px;
  border-radius: 8px;
  box-shadow: 0 4px 6px rgba(0,0,0,0.3);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.section:hover {
  transform: translateY(-10px);
  box-shadow: 0 10px 20px rgba(0,0,0,0.5);
}

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

.section img:hover {
  transform: scale(1.05);
}

/* 按钮样式 */
.button-primary {
  background: linear-gradient(45deg, #00c6ff, #0072ff);
  border: none;
  padding: 12px 24px;
  color: #ffffff;
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.3s ease, box-shadow 0.3s ease;
}

.button-primary:hover {
  background: linear-gradient(45deg, #0072ff, #00c6ff);
  box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

/* 章节导航样式 */
.chapter-nav {
  position: fixed;
  right: 20px;
  top: 100px;
  display: flex;
  flex-direction: column;
}

.chapter-nav a {
  margin: 10px 0;
  color: #00c6ff;
  text-decoration: none;
  transition: color 0.3s ease;
}

.chapter-nav a:hover {
  color: #2ec4b6;
}

/* 暗黑模式切换按钮 */
.toggle-theme {
  position: fixed;
  top: 20px;
  right: 20px;
  background: #00c6ff;
  border: none;
  padding: 10px;
  border-radius: 50%;
  cursor: pointer;
  transition: background 0.3s ease;
}

.toggle-theme:hover {
  background: #0072ff;
}

/* 样式代码示例区 */
.code-sample {
  background: #0d1b2a;
  padding: 20px;
  border-radius: 8px;
  overflow-x: auto;
  box-shadow: 0 4px 6px rgba(0,0,0,0.3);
  margin: 20px 0;
}

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

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

  .nav-menu {
    flex-direction: column;
    width: 100%;
  }

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

  .chapter-nav {
    display: none;
  }
}

