
  /* 全局样式设置 */
  body {
    margin: 0;
    padding: 0;
    font-family: 'Roboto', sans-serif; /* 采用现代无衬线字体，增强可读性 */
    background: linear-gradient(135deg, #1E3A8A 0%, #374151 100%); /* 渐变背景，深蓝到灰色 */
    color: #FFFFFF; /* 文字颜色为白色，保证良好对比度 */
    line-height: 1.6; /* 行高设置，提升阅读体验 */
  }

  /* 导航栏样式 */
  nav {
    position: fixed;
    top: 0;
    left: 0;
    width: 250px;
    height: 100vh;
    background-color: #1E3A8A; /* 主色调为深蓝色 */
    padding: 20px;
    box-sizing: border-box;
    overflow-y: auto;
    box-shadow: 2px 0 5px rgba(0, 0, 0, 0.5); /* 侧边导航阴影效果 */
  }

  nav a {
    display: block;
    color: #FFFFFF;
    text-decoration: none;
    margin-bottom: 15px;
    font-size: 16px;
    transition: color 0.3s ease; /* 悬停时颜色过渡效果 */
  }

  nav a:hover {
    color: #F97316; /* 悬停时变为点缀色橙色 */
  }

  /* 主内容容器 */
  .container {
    margin-left: 270px; /* 为导航栏预留空间 */
    padding: 20px;
    max-width: 1200px;
  }

  /* 标题样式 */
  h1 {
    text-align: center;
    font-size: 2.5em;
    margin-bottom: 20px;
    color: #FBD38D; /* 点缀色用于标题 */
  }

  h2, h3, h4 {
    color: #F97316; /* 使用橙色作为副标题和小标题的颜色 */
    margin-top: 30px;
    margin-bottom: 15px;
  }

  /* 段落样式 */
  p {
    font-size: 16px;
    margin-bottom: 20px;
    text-align: justify;
  }

  /* 提示信息样式 */
  .tip {
    text-align: center;
    font-size: 1.5em;
    margin: 30px 0;
    color: #FBD38D;
    background: rgba(255, 255, 255, 0.1);
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.3);
  }

  /* 图片样式 */
  .image-gallery {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    margin: 20px 0;
  }

  .image-gallery img {
    width: 320px;
    height: 320px;
    object-fit: cover;
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.3);
    transition: transform 0.3s, box-shadow 0.3s;
    margin-bottom: 20px;
  }

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

  /* 代码块样式 */
  pre {
    background-color: #2D3748; /* 代码块背景色 */
    padding: 15px;
    border-radius: 5px;
    overflow-x: auto;
    margin: 20px 0;
  }

  code {
    font-family: 'Courier New', Courier, monospace; /* 等宽字体 */
    color: #FBD38D; /* 代码字体颜色为点缀色 */
    display: block;
    white-space: pre-wrap;
    word-wrap: break-word;
  }

  /* CSS3示例代码样式，与正文区分 */
  .css-example {
    background-color: #2D3748;
    padding: 20px;
    border-left: 5px solid #F97316;
    margin: 20px 0;
    border-radius: 5px;
  }

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

  /* 章节导航样式 */
  .chapter-nav {
    position: fixed;
    top: 100px;
    right: 20px;
    background: rgba(55, 65, 81, 0.8);
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.3);
  }

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

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

  .chapter-nav a {
    color: #FBD38D;
    text-decoration: none;
    font-size: 14px;
    transition: color 0.3s;
  }

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

  /* 响应式设计 */
  @media (max-width: 1200px) {
    .container {
      max-width: 1000px;
    }
  }

  @media (max-width: 992px) {
    nav {
      width: 200px;
    }
    .container {
      margin-left: 220px;
    }
    h1 {
      font-size: 2em;
    }
    .chapter-nav {
      top: 80px;
      right: 10px;
    }
  }

  @media (max-width: 768px) {
    nav {
      position: relative;
      width: 100%;
      height: auto;
      box-shadow: none;
    }
    .container {
      margin-left: 0;
      padding: 10px;
    }
    .image-gallery {
      justify-content: center;
    }
    .image-gallery img {
      width: 100%;
      height: auto;
    }
    .chapter-nav {
      position: fixed;
      top: 10px;
      right: 10px;
      background: rgba(55, 65, 81, 0.9);
    }
  }

  @media (max-width: 480px) {
    h1 {
      font-size: 1.8em;
    }
    h2, h3, h4 {
      font-size: 1.2em;
    }
    p {
      font-size: 14px;
    }
    .chapter-nav a {
      font-size: 12px;
    }
  }

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

  .animate {
    animation: fadeInUp 1s ease-out forwards;
    opacity: 0;
  }

  /* 交互效果 */
  .button {
    background-color: #F97316;
    border: none;
    padding: 12px 24px;
    color: #FFFFFF;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.3s ease;
    font-size: 16px;
  }

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

  /* 分隔线样式 */
  .divider {
    height: 2px;
    background: linear-gradient(to right, #1E3A8A, #F97316);
    margin: 40px 0;
    border: none;
    border-radius: 1px;
  }

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

  a:hover {
    color: #F97316;
  }

