
/* 
  全局样式定义，设置页面的基础字体、背景颜色以及响应式布局
  使用流式布局结合Flexbox和Grid技术，确保在不同屏幕尺寸下的自适应性
*/
body {
  margin: 0;
  padding: 0;
  font-family: 'Lato', sans-serif;
  background: linear-gradient(135deg, #1E272E, #6C5CE7);
  color: #DDE6ED;
  overflow-x: hidden;
  scroll-behavior: smooth;
}

/* 固定导航栏样式，包含导航链接，采用透明背景并添加阴影效果 */
.navbar {
  position: fixed;
  top: 0;
  width: 100%;
  background-color: rgba(30, 39, 46, 0.9);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  z-index: 1000;
  display: flex;
  justify-content: center;
  padding: 10px 0;
}

/* 导航链接样式，采用亮橙色文字，悬停时颜色加深并添加下划线 */
.navbar a {
  color: #FFC312;
  margin: 0 20px;
  text-decoration: none;
  font-family: 'Montserrat', sans-serif;
  font-size: 16px;
  transition: color 0.3s, border-bottom 0.3s;
}

.navbar a:hover {
  color: #FF9F1A;
  border-bottom: 2px solid #FF9F1A;
}

/* 章节导航系统容器，固定在页面侧边或顶部，确保可见性且不遮挡内容 */
.chapter-nav {
  position: sticky;
  top: 60px;
  padding: 20px;
  background-color: rgba(30, 39, 46, 0.8);
  border-radius: 10px;
  max-width: 200px;
}

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

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

/* 主内容区域，采用Grid布局，分为侧边导航和主要文章内容 */
.container {
  display: grid;
  grid-template-columns: none;
  grid-gap: 20px;
  padding: 100px 50px 50px 50px;
}

/* 响应式设计：在768px以下设备，章节导航隐藏，内容全宽 */
@media (max-width: 768px) {
  .container {
    grid-template-columns: 1fr;
    padding: 100px 20px 20px 20px;
  }
  .chapter-nav {
    display: none;
  }
}

/* 文章标题样式，使用Montserrat字体，添加阴影和渐变效果 */
article h2 {
  font-family: 'Montserrat', sans-serif;
  font-size: 2em;
  color: #FFFFFF;
  text-align: center;
  margin-bottom: 20px;
  text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
}

/* 二级标题样式，保持一致的字体风格，添加下划线 */
article h3 {
  font-family: 'Montserrat', sans-serif;
  font-size: 1.5em;
  color: #FFC312;
  margin-top: 30px;
  margin-bottom: 10px;
  position: relative;
}

article h3::after {
  content: '';
  position: absolute;
  width: 50px;
  height: 3px;
  background: #FF9F1A;
  bottom: -5px;
  left: 0;
}

/* 段落样式，设置合适的行高和字间距，增强可读性 */
article p {
  font-size: 16px;
  line-height: 1.6;
  letter-spacing: 0.5px;
  margin-bottom: 20px;
}

/* 表格样式，采用简洁的线条和颜色，增强对比 */
article table {
  width: 100%;
  border-collapse: collapse;
  margin: 20px 0;
}

article table th, article table td {
  border: 1px solid #6C5CE7;
  padding: 10px;
  text-align: left;
}

article table th {
  background-color: #2F3640;
}

article table td {
  background-color: #1E272E;
}

/* 代码块样式，采用深色背景和等宽字体，添加圆角和内边距 */
article pre {
  background-color: #2F3640;
  padding: 15px;
  border-radius: 8px;
  overflow-x: auto;
}

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

/* 卡片式展示样式，添加阴影和圆角，悬停时提升视觉效果 */
.card {
  background-color: #2F3640;
  border-radius: 10px;
  box-shadow: 0 4px 8px rgba(0,0,0,0.2);
  padding: 20px;
  margin: 20px 0;
  transition: transform 0.3s, box-shadow 0.3s;
}

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

/* 图片样式，统一圆角和阴影，添加悬停效果 */
.card img {
  width: 100%;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
  transition: transform 0.3s, box-shadow 0.3s;
}

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

/* 按钮样式，采用亮橙色，添加圆角和过渡效果 */
.button {
  background-color: #FFC312;
  color: #1E272E;
  padding: 15px 30px;
  border: none;
  border-radius: 5px;
  font-size: 1.2em;
  cursor: pointer;
  transition: transform 0.3s, background-color 0.3s;
  text-decoration: none;
  display: inline-block;
}

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

/* 折叠区域样式，隐藏内容并在点击后显示 */
.collapsible {
  background-color: #1E272E;
  color: #FFC312;
  cursor: pointer;
  padding: 10px;
  width: 100%;
  border: none;
  text-align: left;
  outline: none;
  font-size: 16px;
  margin: 10px 0;
  border-radius: 5px;
}

.active, .collapsible:hover {
  background-color: #6C5CE7;
}

.content {
  padding: 0 18px;
  max-height: 0;
  overflow: hidden;
  background-color: #2F3640;
  transition: max-height 0.2s ease-out;
  border-radius: 5px;
}

/* 动画关键帧定义，创建元素闪烁效果 */
@keyframes blink {
  0%, 100% { opacity: 0.8; }
  50% { opacity: 1; }
}

.node {
  width: 10px;
  height: 10px;
  background-color: #6C5CE7;
  border-radius: 50%;
  position: absolute;
  animation: blink 2s infinite;
}

.node:nth-child(1) { top: 20%; left: 30%; animation-delay: 0s; }
.node:nth-child(2) { top: 40%; left: 50%; animation-delay: 0.5s; }
.node:nth-child(3) { top: 60%; left: 70%; animation-delay: 1s; }

/* 数据流动效果，通过背景渐变和动画实现动态效果 */
@keyframes flow {
  0% { background-position: 0% 50%; }
  100% { background-position: 100% 50%; }
}

.data-flow {
  background: linear-gradient(270deg, #1E272E, #6C5CE7, #1E272E);
  background-size: 600% 600%;
  animation: flow 10s linear infinite;
}

/* 动画图标旋转效果 */
svg.animated {
  width: 100px;
  height: 100px;
  animation: rotate 5s linear infinite;
}

@keyframes rotate {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* 添加背景插画与节点动画 */
.background-illustration {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
}

.background-illustration img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.3;
}

/* 强调“这是一个网页样式设计参考”的文字样式，置于显著位置 */
.reference-note {
  position: fixed;
  bottom: 10px;
  right: 10px;
  background-color: rgba(255, 195, 18, 0.8);
  color: #1E272E;
  padding: 10px 20px;
  border-radius: 5px;
  font-size: 14px;
  z-index: 1000;
  box-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

