
/* 全局样式设置 */
body {
  margin: 0;
  padding: 0;
  font-family: 'Roboto', 'Open Sans', sans-serif; /* 设置全局字体 */
  background: linear-gradient(135deg, #0a192f 70%, #1c1c2b 25%, #ff5722 5%); /* 主色、辅色、点缀色渐变背景 */
  color: #ffffff; /* 全局文字颜色 */
  transition: background 0.5s ease; /* 背景过渡效果 */
}

/* 导航栏样式 */
.navbar {
  position: fixed;
  top: 0;
  width: 100%;
  background: rgba(10, 25, 47, 0.9); /* 半透明背景 */
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 40px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3); /* 阴影效果 */
  z-index: 1000;
}

.navbar:hover {
  background: rgba(28, 28, 43, 0.9); /* 悬停时背景变化 */
  transition: background 0.3s ease;
}

.navbar .logo {
  font-size: 24px;
  font-weight: bold;
  color: #00aaff; /* 主色点缀 */
  text-decoration: none;
}

.navbar ul {
  list-style: none;
  display: flex;
  gap: 20px;
}

.navbar ul li a {
  color: #ffffff;
  text-decoration: none;
  font-size: 16px;
  position: relative;
}

.navbar ul li a::after {
  content: '';
  position: absolute;
  width: 0%;
  height: 2px;
  background: #ff5722; /* 点缀色下划线 */
  left: 0;
  bottom: -5px;
  transition: width 0.3s ease;
}

.navbar ul li a:hover::after {
  width: 100%; /* 悬停时下划线展开 */
}

/* 主要内容区域 */
.main {
  padding-top: 80px; /* 留出导航栏空间 */
  display: grid;
  grid-template-columns: 1fr 3fr;
  gap: 20px;
  padding: 40px;
}

/* 侧边导航样式 */
.sidebar {
  position: sticky;
  top: 100px;
  background: rgba(10, 25, 47, 0.8);
  padding: 20px;
  border-radius: 8px;
}

.sidebar h3 {
  margin-top: 0;
  color: #00aaff;
}

.sidebar ul {
  list-style: none;
  padding: 0;
}

.sidebar ul li {
  margin-bottom: 10px;
}

.sidebar ul li a {
  color: #ffffff;
  text-decoration: none;
  font-size: 14px;
  transition: color 0.3s ease;
}

.sidebar ul li a:hover {
  color: #ff5722; /* 点缀色 */
}

/* 内容区域样式 */
.content {
  background: rgba(28, 28, 43, 0.8);
  padding: 20px;
  border-radius: 8px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
}

/* 文章样式 */
article {
  max-width: 800px;
  margin: 0 auto;
}

article h2, article h3, article h4 {
  color: #00aaff;
  margin-bottom: 10px;
}

article p {
  line-height: 1.6;
  margin-bottom: 20px;
}

article pre {
  background: #1c1c2b;
  padding: 15px;
  border-radius: 5px;
  overflow: auto;
  margin-bottom: 20px;
}

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

/* 图片样式 */
img.decorative {
  width: 100%;
  max-width: 320px;
  border-radius: 10px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.5);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

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

/* 加载动画 */
.loading-cube {
  width: 50px;
  height: 50px;
  background: #00aaff;
  animation: rotateCube 2s infinite linear;
  margin: 100px auto;
}

@keyframes rotateCube {
  from {
    transform: rotateX(0deg) rotateY(0deg);
  }
  to {
    transform: rotateX(360deg) rotateY(360deg);
  }
}

/* 视差滚动样式 */
.parallax-section {
  position: relative;
  height: 100vh;
  background: url('https://images.gptkong.com/demo/sample1.png') no-repeat center center fixed;
  background-size: cover;
  transform: translateZ(-1px) scale(2);
  z-index: -1;
}

/* 代码示例区 */
.code-example {
  background: #1c1c2b;
  padding: 20px;
  border-left: 5px solid #ff5722;
  margin-bottom: 20px;
  border-radius: 5px;
  overflow: auto;
}

.code-example code {
  color: #00aaff;
}

/* 响应式设计 */
@media (max-width: 768px) {
  .main {
    grid-template-columns: 1fr;
    padding: 20px;
  }
  
  .sidebar {
    position: static;
    margin-bottom: 20px;
  }
  
  .navbar ul {
    flex-direction: column;
    gap: 10px;
  }
}

