
/* 全局样式设置 */
body {
  margin: 0;
  padding: 0;
  background: linear-gradient(135deg, #1e1e1e, #121212); /* 背景渐变 */
  color: #e0e0e0; /* 文字颜色 */
  font-family: 'Open Sans', sans-serif; /* 全局字体 */
  transition: background 0.5s ease, color 0.5s ease; /* 主题切换过渡效果 */
}

/* 导航栏样式 */
.navbar {
  position: fixed;
  top: 0;
  width: 100%;
  background-color: #1e1e1e;
  padding: 15px 30px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 1000;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.5); /* 阴影效果 */
}

.navbar ul {
  list-style: none;
  display: flex;
  gap: 20px;
}

.navbar ul li {
  position: relative;
}

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

.navbar ul li a:hover {
  color: #3b82f6; /* 点缀色悬停效果 */
}

.navbar ul li .submenu {
  display: none;
  position: absolute;
  top: 35px;
  left: 0;
  background-color: #2c2c2c;
  padding: 10px;
  border-radius: 4px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
}

.navbar ul li:hover .submenu {
  display: block;
}

.navbar .theme-toggle {
  background-color: transparent;
  border: 2px solid #3b82f6;
  color: #3b82f6;
  padding: 5px 10px;
  border-radius: 4px;
  cursor: pointer;
  transition: background-color 0.3s ease, color 0.3s ease;
}

.navbar .theme-toggle:hover {
  background-color: #3b82f6;
  color: #ffffff;
}

/* 容器布局 */
.container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
  padding: 80px 40px 40px 40px; /* 顶部留出导航栏空间 */
}

/* 模块样式 */
.module {
  background-color: #2c2c2c;
  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;
}

.module:hover {
  transform: translateY(-5px);
  box-shadow: 0 6px 8px rgba(0, 0, 0, 0.4);
}

.module h3 {
  color: #ffffff;
  font-family: 'Roboto', sans-serif;
  margin-bottom: 10px;
}

.module p {
  color: #e0e0e0;
  line-height: 1.6;
  font-size: 16px;
}

/* 按钮样式 */
.button-primary {
  background-color: #3b82f6;
  color: #ffffff;
  border: none;
  padding: 10px 20px;
  border-radius: 4px;
  font-size: 16px;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

.button-primary:hover {
  background-color: #2563eb;
}

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

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

/* 图片样式 */
img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

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

/* 文字样式 */
h1, h2, h3, h4 {
  font-family: 'Roboto', sans-serif;
  color: #ffffff;
}

p, span, li {
  font-family: 'Open Sans', sans-serif;
  color: #e0e0e0;
}

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

  .navbar ul {
    flex-direction: column;
    gap: 10px;
  }

  .container {
    padding: 100px 20px 20px 20px;
  }

  h1 {
    font-size: 2em;
  }

  h2 {
    font-size: 1.75em;
  }

  p, span, li {
    font-size: 1em;
  }
}

/* 动画效果 */
.fade-in {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

.icon {
  transition: transform 0.3s ease, color 0.3s ease;
}

.icon:hover {
  transform: scale(1.2);
  color: #3b82f6;
}

/* 视觉引导 */
.anchor-link {
  color: #3b82f6;
  text-decoration: none;
  transition: color 0.3s ease;
}

.anchor-link:hover {
  color: #2563eb;
}

/* 点缀元素 */
.decorative-line {
  width: 100%;
  height: 2px;
  background: linear-gradient(90deg, #3b82f6, #8b5cf6);
  margin: 20px 0;
  border: none;
}

/* 折叠区域样式 */
.collapsible {
  background-color: #2c2c2c;
  color: #e0e0e0;
  cursor: pointer;
  padding: 10px 20px;
  width: 100%;
  border: none;
  text-align: left;
  outline: none;
  font-size: 16px;
  border-radius: 4px;
  transition: background-color 0.3s ease;
}

.collapsible:hover {
  background-color: #3b82f6;
  color: #ffffff;
}

.content {
  padding: 0 20px;
  display: none;
  background-color: #1e1e1e;
  overflow: hidden;
  border-radius: 4px;
}

.content p {
  margin: 10px 0;
}

/* 高亮CSS代码块 */
.code-example {
  background-color: #1e1e1e;
  padding: 15px;
  border-radius: 6px;
  overflow-x: auto;
  margin: 20px 0;
}

.code-example code {
  color: #8be9fd;
}

/* 提示信息样式 */
.notice {
  background-color: #3b82f6;
  color: #ffffff;
  padding: 10px 20px;
  border-radius: 4px;
  text-align: center;
  font-size: 18px;
  margin: 20px 0;
}

