
/* 主体背景与整体配色 */
/* 使用深色调作为主色，营造科技感与稳重感 */
body {
  margin: 0;
  padding: 0;
  background: linear-gradient(135deg, #1a1a1a, #2e2e2e); /* 线性渐变背景 */
  color: #e0e0e0; /* 浅灰色文本 */
  font-family: 'Roboto', sans-serif; /* 现代无衬线字体 */
  transition: background 0.5s ease, color 0.5s ease; /* 背景与文字颜色平滑过渡 */
}

/* 导航栏样式 */
nav {
  position: fixed;
  top: 0;
  width: 100%;
  background: rgba(26, 26, 26, 0.9); /* 半透明深色背景 */
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.5); /* 阴影效果 */
  z-index: 1000;
}

nav ul {
  display: flex;
  justify-content: center;
  list-style: none;
  padding: 15px 0;
  margin: 0;
}

nav ul li {
  margin: 0 20px;
}

nav ul li a {
  color: #00c6ff; /* 点缀色 */
  text-decoration: none;
  font-size: 18px;
  transition: color 0.3s ease;
}

nav ul li a:hover {
  color: #00d4ff; /* 悬停时颜色变化 */
}

/* 主要内容区样式 */
.main-content {
  padding: 100px 20px 50px 20px; /* 上方留出导航栏空间 */
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr;
  gap: 40px;
}

/* 章节导航 */
.chapter-nav {
  position: fixed;
  right: 20px;
  top: 100px;
  background: rgba(26, 26, 26, 0.8);
  padding: 15px;
  border-radius: 8px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.5);
}

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

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

.chapter-nav ul li a {
  color: #00c6ff;
  text-decoration: none;
  font-size: 16px;
  transition: color 0.3s ease;
}

.chapter-nav ul li a:hover {
  color: #00d4ff;
}

/* 文章样式 */
article {
  background: #2a2a2a; /* 卡片背景色 */
  padding: 20px;
  border-radius: 10px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.5);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

article:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.7);
}

article h2 {
  color: #00c6ff;
  font-size: 24px;
  margin-bottom: 15px;
}

article h3 {
  color: #00d4ff;
  font-size: 20px;
  margin-top: 25px;
  margin-bottom: 10px;
}

article p {
  font-size: 16px;
  line-height: 1.6;
  margin-bottom: 15px;
}

article pre {
  background: #1a1a1a;
  padding: 15px;
  border-radius: 8px;
  overflow-x: auto;
  margin-bottom: 15px;
}

article pre code {
  color: #00c6ff;
  font-family: 'Courier New', Courier, monospace;
  font-size: 14px;
}

/* 按钮样式 */
.button {
  background: linear-gradient(45deg, #00c6ff, #0072ff);
  border: none;
  padding: 10px 20px;
  border-radius: 5px;
  color: #ffffff;
  cursor: pointer;
  transition: background 0.3s ease, transform 0.3s ease;
}

.button:hover {
  background: linear-gradient(45deg, #00d4ff, #0052cc);
  transform: scale(1.05);
}

/* 图片装饰样式 */
.image-gallery {
  display: flex;
  flex-wrap: wrap;
  gap: 15px;
}

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

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

/* 响应式设计 */
@media (min-width: 768px) {
  .main-content {
    grid-template-columns: 2fr 1fr;
  }

  .chapter-nav {
    top: 150px;
  }
}

@media (min-width: 1200px) {
  .main-content {
    padding: 150px 50px 50px 50px;
  }
}

/* 代码示例样式 */
.code-example {
  background: #1a1a1a;
  padding: 15px;
  border-left: 5px solid #00c6ff;
  border-radius: 5px;
  margin-bottom: 20px;
}

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

/* 折叠区域样式 */
.details-toggle summary {
  cursor: pointer;
  font-size: 16px;
  color: #00c6ff;
  margin-bottom: 10px;
}

.details-toggle summary:hover {
  color: #00d4ff;
}

.details-toggle p {
  font-size: 14px;
  color: #e0e0e0;
  margin-top: 10px;
}

/* 提示文字样式 */
.reference-note {
  text-align: center;
  font-size: 18px;
  color: #ff4081; /* 点缀色 */
  margin: 40px 0;
}

/* 高亮显示 */
.highlight {
  background: #333333;
  padding: 2px 4px;
  border-radius: 3px;
}

