
/* 全局重置样式，确保不同浏览器下样式一致 */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* 定义颜色变量，便于统一管理和修改 */
:root {
  --primary-color: #0D2C54; /* 主色调：深蓝色 */
  --secondary-color: #EAEAEA; /* 辅助色：银灰色 */
  --gradient-blue: linear-gradient(to right, #0D2C54, #3F87F1); /* 渐变蓝色 */
  --highlight-orange: #FFA500; /* 点缀色：亮橙色 */
  --background-color: #1A1A1A; /* 页面背景色，避免使用纯白 */
  --text-color: #FFFFFF; /* 文字颜色 */
  --link-color: var(--highlight-orange); /* 链接颜色 */
  --font-family-primary: 'Helvetica Neue', Helvetica, Arial, sans-serif; /* 主字体 */
  --font-family-secondary: 'Arial Black', Gadget, sans-serif; /* 副字体 */
}

/* 设置页面背景和基本文字样式 */
body {
  background: var(--background-color);
  color: var(--text-color);
  font-family: var(--font-family-primary);
  line-height: 1.6;
  padding: 0;
  margin: 0;
}

/* 固定导航栏样式 */
.navbar {
  position: fixed;
  top: 0;
  width: 100%;
  background: var(--primary-color);
  display: flex;
  justify-content: space-between;
  padding: 15px 30px;
  z-index: 1000;
}

/* 导航栏内的链接样式 */
.navbar a {
  color: var(--text-color);
  text-decoration: none;
  margin: 0 15px;
  font-size: 16px;
  transition: color 0.3s;
}

.navbar a:hover {
  color: var(--highlight-orange);
}

/* 下拉菜单容器 */
.nav-item {
  position: relative;
}

.dropdown {
  display: none;
  position: absolute;
  top: 45px;
  left: 0;
  background: var(--secondary-color);
  min-width: 150px;
  box-shadow: 0 8px 16px rgba(0,0,0,0.2);
  border-radius: 5px;
}

.nav-item:hover .dropdown {
  display: block;
}

/* 下拉菜单内链接样式 */
.dropdown a {
  color: var(--primary-color);
  padding: 12px 16px;
  text-decoration: none;
  display: block;
  transition: background 0.3s, color 0.3s;
}

.dropdown a:hover {
  background: var(--gradient-blue);
  color: #FFFFFF;
}

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

/* 响应式布局：宽屏设备下分为两列 */
@media (min-width: 768px) {
  .container {
    grid-template-columns: 1fr 3fr;
  }
}

/* 文章内容样式 */
article {
  background: var(--secondary-color);
  padding: 20px;
  border-radius: 10px;
  box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

/* 侧边导航样式 */
.sidebar {
  background: var(--secondary-color);
  padding: 20px;
  border-radius: 10px;
  box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.sidebar ul {
  list-style: none;
}

.sidebar li {
  margin-bottom: 15px;
}

.sidebar a {
  color: var(--primary-color);
  text-decoration: none;
  font-size: 16px;
  transition: color 0.3s;
}

.sidebar a:hover {
  color: var(--highlight-orange);
}

/* 图片样式：圆角、阴影、悬浮效果 */
img.decorative {
  width: 100%;
  border-radius: 10px;
  box-shadow: 0 4px 8px rgba(0,0,0,0.2);
  transition: transform 0.3s, box-shadow 0.3s;
}

img.decorative:hover {
  transform: scale(1.05);
  box-shadow: 0 8px 16px rgba(0,0,0,0.3);
}

/* 代码块样式，区分于正文 */
pre code {
  display: block;
  background: #2e2e2e;
  color: #f8f8f2;
  padding: 15px;
  border-radius: 5px;
  overflow-x: auto;
  font-family: 'Courier New', Courier, monospace;
}

/* 代码块中的注释样式 */
pre code .comment {
  color: #75715e;
}

/* 重要提示样式 */
.alert {
  background: var(--highlight-orange);
  color: #FFFFFF;
  padding: 10px 20px;
  border-radius: 5px;
  text-align: center;
  font-size: 18px;
  margin-bottom: 20px;
}

/* 渐变按钮样式 */
.button {
  background: var(--gradient-blue);
  border: none;
  padding: 12px 24px;
  color: #FFFFFF;
  font-size: 16px;
  cursor: pointer;
  border-radius: 5px;
  box-shadow: 0 4px 6px rgba(0,0,0,0.1);
  transition: background 0.3s, transform 0.2s;
}

.button:hover {
  background: var(--highlight-orange);
  transform: translateY(-2px);
}

/* 页脚样式 */
.footer {
  background: var(--primary-color);
  color: #FFFFFF;
  text-align: center;
  padding: 20px;
  position: fixed;
  bottom: 0;
  width: 100%;
}

/* 链接样式，添加rel="nofollow"时的样式 */
a[rel="nofollow"] {
  color: var(--link-color);
  text-decoration: underline;
}

/* 折叠区域样式 */
.collapsible {
  background: var(--secondary-color);
  color: var(--primary-color);
  cursor: pointer;
  padding: 10px 20px;
  width: 100%;
  border: none;
  text-align: left;
  outline: none;
  font-size: 16px;
  border-radius: 5px;
  transition: background 0.3s;
}

.collapsible:hover {
  background: var(--gradient-blue);
  color: #FFFFFF;
}

.content {
  padding: 0 20px;
  display: none;
  background: var(--secondary-color);
  overflow: hidden;
  border-radius: 5px;
  margin-bottom: 10px;
}

.collapsible.active + .content {
  display: block;
}

/* 章节导航样式 */
.chapter-nav {
  position: fixed;
  top: 120px;
  right: 20px;
  background: rgba(13, 44, 84, 0.8);
  padding: 15px;
  border-radius: 10px;
  box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

.chapter-nav a {
  display: block;
  color: #FFFFFF;
  text-decoration: none;
  margin-bottom: 10px;
  transition: color 0.3s;
}

.chapter-nav a:hover {
  color: var(--highlight-orange);
}

/* 动画效果：淡入 */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.fade-in {
  animation: fadeIn 1s ease-out forwards;
}

/* 适配各种屏幕尺寸，确保响应式设计 */
@media (max-width: 768px) {
  .chapter-nav {
    display: none;
  }
  .container {
    grid-template-columns: 1fr;
  }
}

