
/* 全局样式设置 */
body {
  margin: 0;
  padding: 0;
  font-family: 'Roboto', sans-serif;
  font-size: 16px; /* 正文字号 */
  background: linear-gradient(135deg, #2c3e50 70%, #8e44ad 25%, #e67e22 5%);
  color: #ffffff;
  transition: background 0.5s ease;
}

/* 固定顶部导航栏 */
nav {
  background: linear-gradient(90deg, #1E90FF, #87CEFA);
  padding: 20px;
  position: fixed;
  top: 0;
  width: 100%;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  z-index: 1000;
}

nav ul {
  list-style: none;
  display: flex;
  justify-content: space-around;
  margin: 0;
  padding: 0;
}

nav ul li a {
  color: #ffffff;
  text-decoration: none;
  font-size: 18px; /* h2/h3/h4标题字号 */
  transition: color 0.3s ease;
}

nav ul li a:hover {
  color: #FFA500; /* 点缀色 */
}

/* 主容器样式 */
.container {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  grid-gap: 20px;
  padding: 100px 40px 40px 40px; /* 顶部留白以避免导航栏遮挡 */
}

/* 模块样式 */
.module {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
  padding: 20px;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.module:hover {
  transform: translateY(-10px);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.3);
}

/* 图片样式 */
.module img {
  width: 100%;
  height: auto;
  border-radius: 12px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
  transition: transform 0.3s ease, opacity 0.3s ease;
}

.module img:hover {
  transform: scale(1.05);
  opacity: 0.8;
}

/* 章节标题样式 */
article h2 {
  font-size: 24px;
  color: #ffffff;
  margin-top: 40px;
  position: relative;
  padding-bottom: 10px;
}

article h2::after {
  content: "";
  position: absolute;
  width: 50px;
  height: 4px;
  background: #FFA500;
  bottom: 0;
  left: 0;
  border-radius: 2px;
}

/* 章节内容样式 */
article section {
  margin-bottom: 30px;
}

article p {
  line-height: 1.6;
  font-size: 17px;
  color: #ecf0f1;
  margin-bottom: 15px;
}

/* 引导文字样式 */
.banner {
  text-align: center;
  padding: 50px 20px;
  background: rgba(0, 0, 0, 0.5);
  margin-bottom: 40px;
}

.banner h1 {
  font-size: 32px;
  color: #FFA500; /* 点缀色 */
  margin: 0;
}

/* CSS代码块样式 */
code {
  background: rgba(255, 255, 255, 0.2);
  padding: 10px;
  border-radius: 5px;
  display: block;
  overflow-x: auto;
  font-family: 'Courier New', Courier, monospace;
  color: #f1c40f;
}

pre {
  background: rgba(0, 0, 0, 0.7);
  padding: 15px;
  border-radius: 8px;
  overflow-x: auto;
  margin-bottom: 20px;
}

pre code {
  color: #ecf0f1;
  font-size: 16px;
}

/* 链接样式 */
a {
  color: #1E90FF;
  text-decoration: none;
  transition: color 0.3s ease;
}

a:hover {
  color: #FFA500;
}

/* 深色模式 */
[data-theme="dark"] {
  background: linear-gradient(135deg, #34495e 70%, #16a085 25%, #c0392b 5%);
}

[data-theme="dark"] nav {
  background: linear-gradient(90deg, #16a085, #1abc9c);
}

[data-theme="dark"] .module {
  background: rgba(0, 0, 0, 0.5);
}

[data-theme="dark"] article h2 {
  color: #ecf0f1;
}

[data-theme="dark"] article p {
  color: #bdc3c7;
}

[data-theme="dark"] a {
  color: #1abc9c;
}

/* 响应式调整 */
@media (max-width: 768px) {
  nav ul {
    flex-direction: column;
    align-items: center;
  }

  nav ul li {
    margin-bottom: 10px;
  }

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