
/* 全局样式设置，定义基本的字体、背景及颜色 */
body {
  margin: 0;
  padding: 0;
  font-family: 'Roboto', sans-serif;
  background: linear-gradient(135deg, #0D47A1, #1E88E5); /* 主色调渐变背景 */
  color: rgba(255, 255, 255, 0.9); /* 主文本颜色 */
  transition: background 0.5s ease, color 0.5s ease; /* 主题切换平滑过渡 */
}

/* 导航栏样式 */
.navbar {
  position: fixed; /* 固定在顶部 */
  top: 0;
  width: 100%;
  background: rgba(13, 71, 161, 0.8); /* 半透明背景 */
  backdrop-filter: blur(10px); /* 背景模糊效果 */
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3); /* 阴影效果 */
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 20px;
  z-index: 1000;
}

.navbar .logo {
  font-size: 1.5em;
  font-weight: bold;
  color: #FFFFFF;
}

.navbar .nav-items {
  display: flex;
  gap: 20px;
}

.nav-item {
  position: relative;
  transition: color 0.3s ease; /* 颜色过渡 */
  cursor: pointer;
}

.nav-item:hover {
  color: #00E676; /* 悬停颜色变化 */
}

.nav-item::after {
  content: '';
  position: absolute;
  width: 0;
  height: 2px;
  background: #00E676;
  left: 50%;
  bottom: -5px;
  transition: width 0.3s ease, left 0.3s ease; /* 下划线动画 */
}

.nav-item:hover::after {
  width: 100%;
  left: 0;
}

/* 主题切换按钮样式 */
.theme-switcher {
  background: #00E676;
  border: none;
  padding: 8px 16px;
  border-radius: 4px;
  color: #FFFFFF;
  cursor: pointer;
  transition: background 0.3s ease, transform 0.3s ease;
}

.theme-switcher:hover {
  background: #00C853;
  transform: scale(1.05);
}

/* 主内容区样式 */
.main-content {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100vh;
  background: url('https://images.gptkong.com/demo/sample1.png') no-repeat center center fixed; /* 使用示例图片作为背景 */
  background-size: cover;
  color: #FFFFFF;
  text-align: center;
  padding: 20px;
}

.main-content .intro-text {
  max-width: 600px;
  animation: fadeIn 2s ease forwards; /* 淡入动画 */
}

/* 模块化分区布局 */
.container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); /* 自适应网格 */
  gap: 20px;
  padding: 80px 40px;
}

.module {
  background: rgba(255, 255, 255, 0.1); /* 半透明背景 */
  padding: 20px;
  border-radius: 8px; /* 圆角 */
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1); /* 阴影 */
  transition: transform 0.3s ease, background 0.3s ease; /* 动画过渡 */
}

.module:hover {
  transform: translateY(-10px); /* 悬停提升效果 */
  background: rgba(255, 255, 255, 0.2); /* 背景变化 */
}

/* 图文并茂展示 */
.image-gallery {
  display: flex;
  flex-wrap: wrap;
  gap: 15px;
}

.image-gallery img {
  width: 100%;
  border-radius: 8px; /* 圆角 */
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2); /* 阴影 */
  transition: transform 0.3s ease, box-shadow 0.3s ease; /* 动画过渡 */
}

.image-gallery img:hover {
  transform: scale(1.05); /* 悬停放大 */
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.3); /* 阴影增强 */
}

/* 代码块样式 */
pre code {
  background: rgba(0, 0, 0, 0.7);
  color: #00E676;
  padding: 15px;
  border-radius: 8px;
  overflow-x: auto;
  display: block;
  font-family: 'Courier New', Courier, monospace;
  margin: 20px 0;
}

/* 章节导航样式 */
.sidebar {
  position: fixed;
  top: 80px;
  left: 20px;
  background: rgba(33, 33, 33, 0.8);
  padding: 20px;
  border-radius: 8px;
  max-width: 200px;
}

.sidebar a {
  display: block;
  color: #FFFFFF;
  text-decoration: none;
  margin-bottom: 10px;
  transition: color 0.3s ease;
}

.sidebar a:hover {
  color: #00E676;
}

/* 折叠区域样式 */
.collapsible {
  background-color: rgba(255, 255, 255, 0.1);
  color: #FFFFFF;
  cursor: pointer;
  padding: 10px;
  width: 100%;
  border: none;
  text-align: left;
  outline: none;
  font-size: 16px;
  border-radius: 4px;
  transition: background 0.3s ease;
}

.active, .collapsible:hover {
  background-color: rgba(255, 255, 255, 0.2);
}

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

.content p {
  margin: 10px 0;
}

/* 底部样式 */
.footer {
  background: rgba(33, 33, 33, 0.9);
  color: #FFFFFF;
  padding: 40px 20px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.footer .community {
  max-height: 200px;
  overflow-y: scroll;
  padding-right: 10px;
}

.footer .support {
  display: flex;
  justify-content: flex-end;
}

.footer .support button {
  background: #00E676;
  border: none;
  padding: 10px 20px;
  border-radius: 4px;
  color: #FFFFFF;
  cursor: pointer;
  transition: background 0.3s ease;
}

.footer .support button:hover {
  background: #00C853;
}

/* 响应式设计 */
@media (max-width: 768px) {
  .navbar {
    flex-direction: column;
    align-items: flex-start;
  }

  .sidebar {
    display: none; /* 移动设备隐藏侧边导航 */
  }

  .container {
    padding: 60px 20px;
  }
}

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

@keyframes slideIn {
  from { opacity: 0; transform: translateX(-50px); }
  to { opacity: 1; transform: translateX(0); }
}

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

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