
/* 全局样式设置 */
body {
  background: linear-gradient(180deg, #000000 0%, #000080 100%); /* 深色渐变背景 */
  margin: 0;
  padding: 0;
  font-family: 'Roboto', sans-serif; /* 主字体 */
  color: #CCCCCC; /* 正文字体颜色 */
  overflow-x: hidden; /* 防止横向滚动 */
}

/* 导航栏样式 */
.navbar {
  position: fixed;
  top: 0;
  width: 100%;
  background: rgba(0, 0, 0, 0.8); /* 半透明背景 */
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 40px;
  z-index: 1000;
}

.navbar a {
  color: #00FFFF; /* 主色链接 */
  text-decoration: none;
  margin: 0 15px;
  font-size: 18px;
  transition: color 0.3s;
}

.navbar a:hover {
  color: #FFA500; /* 点缀色悬停效果 */
}

/* 章节导航系统 */
.chapter-nav {
  position: fixed;
  top: 80px;
  left: 20px;
  background: rgba(0, 0, 0, 0.6);
  padding: 15px;
  border-radius: 10px;
}

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

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

.chapter-nav a {
  color: #00FFFF;
  text-decoration: none;
  font-size: 16px;
}

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

/* 主内容容器 */
.container {
  display: grid;
  grid-template-columns: repeat(12, 1fr); /* 12列网格系统 */
  gap: 20px;
  padding: 120px 40px 40px 40px; /* 上方留出导航栏空间 */
}

/* 文章样式 */
article {
  grid-column: 2 / 12;
  background: rgba(255, 255, 255, 0.05); /* 半透明背景 */
  padding: 30px;
  border-radius: 10px;
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.5);
}

article h2, article h3, article h4 {
  color: #FFFFFF;
}

article p {
  font-size: 16px;
  line-height: 1.6;
  color: #CCCCCC;
}

code {
  background: rgba(0, 0, 0, 0.7);
  padding: 2px 4px;
  border-radius: 4px;
  color: #00FFFF;
}

pre code {
  display: block;
  padding: 15px;
  background: rgba(0, 0, 0, 0.8);
  border-radius: 8px;
  overflow-x: auto;
  color: #00FFFF;
}

/* 按钮样式 */
.btn {
  background-color: #FFA500;
  color: #fff;
  padding: 12px 24px;
  border: none;
  border-radius: 6px;
  transition: background-color 0.3s, transform 0.3s;
  cursor: pointer;
  font-size: 16px;
}

.btn:hover {
  background-color: #00FFFF;
  transform: scale(1.05);
}

/* 折叠内容样式 */
.collapsible {
  background-color: rgba(0, 0, 0, 0.8);
  color: #FFFFFF;
  cursor: pointer;
  padding: 15px;
  width: 100%;
  border: none;
  text-align: left;
  outline: none;
  font-size: 18px;
  border-radius: 5px;
  margin-top: 20px;
}

.active, .collapsible:hover {
  background-color: #00FFFF;
  color: #000000;
}

.content {
  padding: 0 18px;
  display: none;
  overflow: hidden;
  background-color: rgba(0, 0, 0, 0.5);
  border-radius: 5px;
  margin-bottom: 20px;
}

.content p {
  color: #CCCCCC;
  font-size: 15px;
}

/* 星河光点样式 */
.star {
  position: absolute;
  width: 2px;
  height: 2px;
  background: #00FFFF;
  border-radius: 50%;
  animation: twinkle 2s infinite ease-in-out;
}

/* 闪烁动画 */
@keyframes twinkle {
  0%, 100% { opacity: 0.5; }
  50% { opacity: 1; }
}

/* 代码示例样式 */
.code-example {
  background: rgba(0, 0, 0, 0.7);
  padding: 20px;
  border-radius: 8px;
  margin: 30px 0;
  overflow-x: auto;
}

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

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

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

/* 渐变线条装饰 */
.decorative-line {
  height: 2px;
  background: linear-gradient(90deg, #00FFFF, #FFA500);
  margin: 40px 0;
  border-radius: 1px;
}

/* 响应式设计 */
@media (max-width: 1920px) {
  .container {
    padding: 120px 60px 60px 60px;
  }
}

@media (max-width: 1024px) {
  .chapter-nav {
    position: static;
    display: none;
  }

  .container {
    grid-template-columns: repeat(8, 1fr);
    padding: 120px 30px 30px 30px;
  }

  article {
    grid-column: 1 / -1;
  }
}

@media (max-width: 768px) {
  .navbar {
    flex-direction: column;
    align-items: flex-start;
    padding: 20px;
  }

  .navbar a {
    margin: 10px 0;
    font-size: 16px;
  }

  .container {
    grid-template-columns: repeat(4, 1fr);
    padding: 100px 20px 20px 20px;
  }

  .chapter-nav {
    display: none;
  }
}

@media (max-width: 480px) {
  .navbar a {
    font-size: 14px;
    margin: 8px 0;
  }

  .container {
    grid-template-columns: repeat(2, 1fr);
    padding: 80px 10px 10px 10px;
  }

  article {
    padding: 20px;
  }
}

/* 动态背景效果 */
.nebula {
  position: absolute;
  width: 100%;
  height: 100%;
  background: url('https://images.gptkong.com/demo/sample1.png') no-repeat center center;
  background-size: cover;
  transform: translateX(var(--mouse-x)) translateY(var(--mouse-y));
  transition: transform 0.1s ease-out;
}

/* 装饰性3D效果 */
.bar {
  width: 40px;
  height: 200px;
  background: linear-gradient(45deg, #00FFFF, #0000FF);
  transform: perspective(600px) rotateX(15deg);
  transition: transform 0.5s;
}

.bar:hover {
  transform: perspective(600px) rotateX(0deg) scaleY(1.1);
}


