 .logo-img {
      /* 建议高度设置在 45px-55px 之间，这样在 75px 的导航栏里会有呼吸感 */
    
    max-width: 100%;      /* 图片宽度不超过父容器 */
    height:auto;          /* 高度自适应，保持比例 */
    /* 或者固定一个高度 */
    max-height: 100px;      /* 例如限制最大高度 50px */
    width: auto;           /* 宽度自动 */
    
    width: auto;      /* 宽度设为 auto，防止图片被拉伸变形 */
    display: flex;   /* 消除图片底部的微小缝隙 */
    transition: transform 0.3s ease; /* 增加一个悬停动画 */
}

/* 鼠标滑过队徽时的小特效 */
    .logo-img:hover {
    transform: scale(1.1); /* 稍微放大一点，增加互动感 */
    filter: drop-shadow(0 0 8px rgba(159, 154, 221, 0.6));
    transition: filter 0.3s ease;
}

/* 移除原来 logo 类的文字样式（因为现在是图片了） */
    .logo {
    display: flex;
    align-items: center; /* 确保图片在垂直方向居中 */
    text-decoration: none;
    gap: 0px; 
}

    #particleCanvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    pointer-events: none; /* 让鼠标事件穿透到父容器捕获坐标 */}


.navbar {
      
      background-color: #e3e1e1c0;
        backdrop-filter: blur(10px);  /* 添加模糊效果，让背后内容更模糊 */
        -webkit-backdrop-filter: blur(10px);  /* 兼容Safari */
      margin:50px auto 0 auto;          /* 上边距，左右居中 */
      height: 75px;
      width: 90%;
      max-width: 1300px;
      border-radius: 60px;               /* 大圆角 */
      padding: 0.6rem 2rem;              /* 垂直内边距缩小，左右留白 */
      display: flex;
      align-items: center;                /* 垂直居中所有子项 */
      justify-content: space-between;
      box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1), 0 4px 8px rgba(0, 139, 37, 0.47); /* 阴影 */
      
      
      border: 1px solid rgba(61, 48, 201, 0.3);
      position: fixed;        /* 固定定位 */
        top: 24px;              /* 距离顶部24px */
        left: 0;
     right: 0;
     margin: 0 auto;         /* 居中 */
     z-index: 1000;          /* 确保在最上层 */
    animation: slideDown 0.5s ease;  /* 添加滑入动画 */
}

/* 添加动画关键帧 */
@keyframes slideDown {
  from {
    transform: translateY(-100%);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}
   
    .logo {
      font-size: 1.8rem;
      font-weight: 700;
      color: #2f1452;
      letter-spacing: -0.5px;
      text-decoration: none;
      line-height: 1.2;
    }

    .nav-links {
      display: flex;
      align-items: center;                /* 整体垂直居中 */
      gap: 2rem;
      list-style: none;
      margin: 0;
      padding: 0;
    }

    .nav-links li {
      display: flex;                       /* 保证链接在li内垂直居中 */
      align-items: center;
    }

    .nav-links a {
      text-decoration: none;
      font-weight: 500;
      color: #012d04;
      font-size: 1.1rem;
      transition: opacity 0.2s ease, border-bottom 0.2s;
      padding: 0.3rem 0;
      border-bottom: 2px solid transparent;
      line-height: 1.4;
    }

    .nav-links a:hover {
      opacity: 0.8;
      border-bottom-color: #9f99e2;
    }
     body {
        margin: 0;
        padding-top: 120px;  /* 75px(导航栏高度) + 24px(顶部距离) + 21px(额外间距) */
    }
    
    /* 新增：确保所有主要内容不会被遮挡 */
    main, .content, section {
        scroll-margin-top: 120px;  /* 锚点滚动时不会被导航栏挡住 */
    }
 /* ===== HERO 区域 ===== */
        .hero {
            background: linear-gradient(135deg, #2b1b5e, #1a0640);
            color: white;
            text-align: center;
            padding: 4rem 2rem;
            margin-bottom: 2rem;
        }
        .hero h1 {
            font-size: 2.8rem;
            font-weight: 300;
            letter-spacing: 2px;
        }
        .hero p {
            font-size: 1.2rem;
            opacity: 0.8;
            margin-top: 0.5rem;
        }

        /* ===== 主要内容区域 ===== */
        .content-wrapper {
            display: flex;
            max-width: 1400px;
            margin: 0 auto;
            padding: 0 2rem 4rem;
            gap: 2rem;
            align-items: flex-start;  /* 确保侧边栏顶部对齐 */
        }

        /* ----- 侧边栏 (粘性 + 深紫底) ----- */
        .sidebar {
            width: 260px;
            background-color: #18034d;
            color: #ffffff;
            border-radius: 20px;
            padding: 1.5rem 1rem;
            position: sticky;
            top: 105px;              /* 距离视口顶部1.5rem时固定 */
            align-self: flex-start;
            transition: width 0.25s ease, padding 0.2s ease;
            overflow: hidden;           /* 折叠时隐藏溢出内容 */
            box-shadow: 0 10px 25px rgba(0,0,0,0.3);
        }

        /* 折叠状态 (宽度收窄) */
        .sidebar.collapsed {
            width: 60px;
            padding: 1.5rem 0.5rem;
        }

        /* 侧边栏内部容器 (用于折叠时隐藏内容) */
        .sidebar-content {
            display: flex;
            flex-direction: column;
            height: 100%;
            transition: opacity 0.2s;
        }
        .sidebar.collapsed .sidebar-content {
            opacity: 0;
            pointer-events: none;       /* 隐藏内部交互 */
        }

        /* 折叠按钮 (始终可见) */
        .toggle-btn {
            background: transparent;
            border: 1px solid rgba(255,255,255,0.3);
            color: white;
            font-size: 1.8rem;
            line-height: 1;
            cursor: pointer;
            width: 36px;
            height: 36px;
            border-radius: 8px;
            display: flex;
            align-items: center;
            justify-content: center;
            margin-bottom: 1.5rem;
            transition: all 0.2s;
            align-self: flex-end;       /* 放在右侧 */
        }
        .sidebar.collapsed .toggle-btn {
            margin: 0 auto;             /* 折叠时居中 */
            align-self: center;
        }
        .toggle-btn:hover {
            background-color: rgba(255,255,255,0.15);
            color: #FFD966;             /* 悬停变色 */
            border-color: #FFD966;
        }

        /* 阅读进度条 */
        .progress-container {
            width: 100%;
            height: 6px;
            background: rgba(255,255,255,0.2);
            border-radius: 10px;
            margin-bottom: 2rem;
            overflow: hidden;
        }
        .progress-bar {
            height: 100%;
            width: 0%;
            background: #FFF2B5;         /* 亮色进度 */
            border-radius: 10px;
            transition: width 0.1s ease-out;
        }

        /* 目录树 */
        .toc-title {
            font-size: 1rem;
            text-transform: uppercase;
            letter-spacing: 2px;
            opacity: 0.7;
            margin-bottom: 1rem;
            border-bottom: 1px solid rgba(255,255,255,0.2);
            padding-bottom: 0.5rem;
        }
        .toc-list {
            list-style: none;
            max-height: 70vh;
            overflow-y: auto;
            padding-right: 0.5rem;
        }
        .toc-list li {
            margin: 0.5rem 0;
            line-height: 1.4;
        }
        .toc-list a {
            color: #ffffff;
            text-decoration: none;
            display: block;
            padding: 0.3rem 0.5rem;
            border-radius: 6px;
            transition: all 0.2s;
            border-left: 3px solid transparent;
        }
        /* 悬停变色 */
        .toc-list a:hover {
            color: #FFD966;               /* 柔和亮黄 */
            background: rgba(255,255,255,0.1);
            border-left-color: #FFD966;
        }
        /* 缩进表示层级 */
        .toc-h1 { font-weight: 600; padding-left: 0.5rem; }
        .toc-h2 { padding-left: 2rem; font-size: 0.95rem; }
        .toc-h3 { padding-left: 3.5rem; font-size: 0.9rem; opacity: 0.9; }

        /* 高亮当前章节 */
        .toc-list a.active {
            background: rgba(255, 255, 255, 0.2);
            border-left: 4px solid #FFD966;
            font-weight: bold;
            color: #ffffff;
        }

        /* 文章主体 */
        .article {
            flex: 1;
            background: rgba(255, 255, 255, 0);
            border-radius: 28px;
            padding: 2.5rem 3rem;
            box-shadow: 0 10px 30px rgba(0,0,0,0.05);
        }

        /* 标题锚点偏移 (防止被侧边栏遮挡) */
        .article h1, .article h2, .article h3 {
            scroll-margin-top: 80px;
        }
        .article h1 {
            font-size: 2.2rem;
            margin: 2rem 0 1rem;
            color: #80DEEA;
            border-bottom: 2px solid #eee;
            padding-bottom: 0.3rem;
        }
        .article h2 {
            font-size: 1.8rem;
            margin: 2rem 0 1rem;
            color: #A3C6F2;
        }
        .article h3 {
            font-size: 1.4rem;
            margin: 1.5rem 0 0.8rem;
            color: #C5CAE9;
        }
        .article p {
            margin: 1rem 0;
            color: #ffffff;
        }   
    