
/* 
==================================================
全局样式设置
==================================================
*/
/* 设置盒模型为边框盒，方便布局控制 */
*,
*::before,
*::after {
  box-sizing: border-box;
}

/* 重置默认的外边距和内边距 */
body, h1, h2, h3, h4, p, ul, li, figure, figcaption, blockquote, dl, dd {
  margin: 0;
  padding: 0;
}

/* 设置网页的基本字体和背景色 */
body {
  font-family: 'Roboto', sans-serif; /* 使用无衬线字体，提升可读性 */
  font-size: 16px; /* 基本文字大小 */
  line-height: 1.6; /* 行高，确保阅读舒适 */
  color: #333333; /* 主文字颜色 */
  background: linear-gradient(135deg, #2D9CDB, #56CCF2); /* 渐变背景，科技感强 */
  min-height: 100vh; /* 最小高度为视口高度 */
  display: flex;
  flex-direction: column;
}

/* 设置页面容器，使用流式布局和间距 */
.container {
  width: 90%;
  max-width: 1200px;
  margin: 0 auto;
  flex: 1; /* 让容器填满剩余空间 */
  display: flex;
  flex-direction: column;
  padding: 20px 0;
}

/* 头部样式 */
header {
  text-align: center;
  padding: 20px 0;
}

header h1 {
  font-size: 2.5rem; /* 大标题字号 */
  color: #FFFFFF; /* 白色文字，与背景形成对比 */
  text-shadow: 2px 2px 4px rgba(0,0,0,0.3); /* 文字阴影，提升立体感 */
}

/* 突出提示文本样式 */
.highlight {
  background-color: rgba(255, 159, 67, 0.1); /* 点缀色背景 */
  padding: 10px 20px;
  border-left: 5px solid #FF9F43; /* 点缀色边框 */
  margin: 20px 0;
  font-size: 1.2rem;
  color: #FFFFFF;
  border-radius: 4px;
}

/* 导航栏样式 */
nav {
  background-color: rgba(255, 255, 255, 0.1); /* 半透明背景 */
  padding: 10px 20px;
  border-radius: 4px;
  margin-bottom: 20px;
}

nav ul {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
}

nav ul li {
  margin: 0 15px;
}

nav ul li a {
  color: #FFFFFF;
  text-decoration: none;
  font-size: 1rem;
  transition: color 0.3s ease;
}

nav ul li a:hover {
  color: #FF9F43; /* 点缀色悬停效果 */
}

/* 主要内容区样式 */
main {
  background-color: rgba(255, 255, 255, 0.2); /* 半透明背景 */
  padding: 30px;
  border-radius: 8px;
  box-shadow: 0 4px 6px rgba(0,0,0,0.1); /* 轻微阴影，增加层次感 */
}

article h2 {
  font-size: 2rem;
  color: #FFFFFF;
  margin-bottom: 15px;
  border-bottom: 2px solid #FF9F43; /* 点缀色下边框 */
  padding-bottom: 5px;
}

article h3 {
  font-size: 1.5rem;
  color: #FFFFFF;
  margin-top: 20px;
  margin-bottom: 10px;
}

article p {
  font-size: 1rem;
  color: #F2F2F2;
  margin-bottom: 15px;
  line-height: 1.8;
}

/* 图片样式 */
img {
  width: 100%;
  max-width: 320px;
  height: auto;
  border-radius: 10px; /* 圆角效果 */
  box-shadow: 0 4px 8px rgba(0,0,0,0.2); /* 阴影增加立体感 */
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  margin: 10px;
}

img:hover {
  transform: scale(1.05); /* 悬停放大效果 */
  box-shadow: 0 8px 16px rgba(0,0,0,0.3); /* 加强阴影 */
}

/* 代码块样式 */
pre {
  background-color: #1A1A1A;
  color: #F2F2F2;
  padding: 15px;
  border-radius: 5px;
  overflow-x: auto;
  margin-bottom: 20px;
  font-size: 0.9rem;
  line-height: 1.5;
}

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

/* 表格样式 */
table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 20px;
}

thead {
  background-color: #2D9CDB;
  color: #FFFFFF;
}

th, td {
  padding: 12px 15px;
  text-align: left;
  border-bottom: 1px solid #CCCCCC;
}

tbody tr:nth-child(even) {
  background-color: rgba(255, 255, 255, 0.1);
}

tbody tr:hover {
  background-color: rgba(255, 159, 67, 0.2);
}

/* 按钮样式 */
.button {
  background-color: #2D9CDB;
  color: #FFFFFF;
  padding: 10px 20px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  transition: transform 0.2s, background-color 0.2s;
  font-size: 1rem;
}

.button:hover {
  background-color: #56CCF2;
  transform: scale(1.05);
}

/* 模态窗口样式 */
.modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background-color: rgba(0, 0, 0, 0.8);
  padding: 30px;
  border-radius: 8px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
  z-index: 1000;
}

.modal.active {
  opacity: 1;
  visibility: visible;
}

.modal-content {
  background-color: #FFFFFF;
  padding: 20px;
  border-radius: 5px;
  color: #333333;
}

/* 箭头导航样式 */
.back-to-top {
  position: fixed;
  bottom: 30px;
  right: 30px;
  background-color: #FF9F43;
  color: #FFFFFF;
  padding: 10px 15px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 1.2rem;
  box-shadow: 0 4px 6px rgba(0,0,0,0.3);
  transition: background-color 0.3s ease;
  z-index: 999;
}

.back-to-top:hover {
  background-color: #34C759;
}

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

  nav ul li {
    margin: 10px 0;
  }

  .container {
    padding: 10px 0;
  }

  .highlight {
    font-size: 1rem;
  }
}

@media (max-width: 480px) {
  header h1 {
    font-size: 2rem;
  }

  nav ul li a {
    font-size: 0.9rem;
  }

  .button {
    padding: 8px 16px;
    font-size: 0.9rem;
  }
}

/* 滚动平滑效果 */
html {
  scroll-behavior: smooth;
}

/* 章节导航样式 */
.chapter-nav {
  position: fixed;
  top: 100px;
  right: 20px;
  background-color: rgba(255, 255, 255, 0.1);
  padding: 15px;
  border-radius: 8px;
  max-width: 200px;
  display: none;
  flex-direction: column;
}

.chapter-nav.active {
  display: flex;
}

.chapter-nav a {
  color: #FFFFFF;
  text-decoration: none;
  margin: 5px 0;
  font-size: 0.9rem;
  transition: color 0.3s ease;
}

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

/* 适配更大屏幕显示章节导航 */
@media (min-width: 1024px) {
  .chapter-nav {
    display: flex;
  }
}

