
/* 
  基础样式重置，确保不同浏览器下的一致性。
*/
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* 
  设置整个页面的背景使用线性渐变，主色调为深蓝到紫蓝色，辅色调为亮橙和青绿。
*/
body {
  background: linear-gradient(135deg, #182848, #4b6cb7);
  color: #ffffff;
  font-family: 'Open Sans', sans-serif;
  line-height: 1.6;
  font-size: 16px;
  overflow-x: hidden; /* 防止出现左右滚动条 */
}

/* 
  固定顶部导航栏样式，确保在滚动时始终可见。
*/
.header {
  position: fixed;
  top: 0;
  width: 100%;
  background: rgba(24, 40, 72, 0.9);
  padding: 15px 30px;
  z-index: 1000;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* 
  导航栏内链接样式，去除下划线，使用辅色调，添加悬停效果。
*/
.nav-links a {
  color: #c6f6d5;
  text-decoration: none;
  margin-left: 20px;
  font-size: 16px;
  transition: color 0.3s ease;
}

.nav-links a:hover {
  color: #ff7e5f;
}

/* 
  页面主要内容区域的布局，使用CSS Grid实现响应式设计，确保在不同屏幕宽度下的良好表现。
*/
.container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  grid-gap: 30px;
  padding: 100px 50px 50px 50px; /* 顶部留出导航栏空间 */
}

/* 
  各个章节的样式，设置独立的视觉区块，添加渐变边框和阴影效果。
*/
.section {
  background: rgba(255, 255, 255, 0.1);
  padding: 20px;
  border-radius: 10px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
  position: relative;
}

/* 
  使用伪元素添加渐变分隔线，增强视觉分隔效果。
*/
.section::before {
  content: '';
  position: absolute;
  top: -20px;
  left: 0;
  width: 100%;
  height: 5px;
  background: linear-gradient(90deg, #ff7e5f, #c6f6d5);
  border-radius: 5px 5px 0 0;
}

/* 
  标题样式，采用Roboto字体，颜色使用主色调，添加底部装饰线条。
*/
h2, h3, h4 {
  font-family: 'Roboto', sans-serif;
  color: #ffffff;
  margin-bottom: 15px;
}

h2 {
  font-size: 2em;
  border-bottom: 2px solid #ff7e5f;
  display: inline-block;
  padding-bottom: 5px;
}

h3 {
  font-size: 1.75em;
  border-bottom: 1.5px solid #c6f6d5;
  display: inline-block;
  padding-bottom: 3px;
}

h4 {
  font-size: 1.5em;
  color: #ff7e5f;
  margin-bottom: 10px;
}

/* 
  段落文字样式，使用辅色调，适当的行高和字距，确保良好的可读性。
*/
p {
  color: #c6f6d5;
  margin-bottom: 15px;
  font-size: 1em;
}

/* 
  按钮样式，主色调背景，圆角，添加渐变和阴影，悬停时颜色过渡。
*/
.button {
  background: linear-gradient(45deg, #ff7e5f, #c6f6d5);
  border: none;
  padding: 10px 20px;
  color: #ffffff;
  border-radius: 5px;
  cursor: pointer;
  transition: background 0.3s ease, transform 0.3s ease;
}

.button:hover {
  background: linear-gradient(45deg, #c6f6d5, #ff7e5f);
  transform: scale(1.05);
}

/* 
  图片样式，设置圆角，阴影，悬浮放大效果。
*/
img.decorative {
  width: 100%;
  border-radius: 10px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

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

/* 
  代码块样式，与正文区分明显，使用深色背景和等宽字体，添加内边距和圆角。
*/
pre code {
  display: block;
  background: rgba(24, 40, 72, 0.8);
  padding: 15px;
  border-radius: 5px;
  color: #c6f6d5;
  font-family: 'Courier New', Courier, monospace;
  overflow-x: auto;
  margin-bottom: 15px;
}

/* 
  渐变分隔线样式，用于章节之间的视觉分隔。
*/
.divider {
  height: 5px;
  background: linear-gradient(90deg, #ff7e5f, #c6f6d5);
  border-radius: 5px;
  margin: 30px 0;
}

/* 
  导航系统样式，侧边导航栏固定在页面一侧，使用辅色调，高亮当前章节。
*/
.sidebar {
  position: fixed;
  top: 100px;
  left: 20px;
  width: 200px;
}

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

.sidebar a:hover {
  color: #ff7e5f;
}

/* 
  响应式设计：在屏幕宽度小于768px时，调整布局，隐藏侧边导航栏，导航栏内链接垂直排列。
*/
@media (max-width: 768px) {
  .container {
    grid-template-columns: 1fr;
    padding: 100px 20px 20px 20px;
  }

  .sidebar {
    display: none;
  }

  .header {
    flex-direction: column;
    align-items: flex-start;
  }

  .nav-links {
    margin-top: 10px;
    width: 100%;
    display: flex;
    flex-direction: column;
  }

  .nav-links a {
    margin: 10px 0;
  }
}

/* 
  响应式设计：在屏幕宽度小于480px时，进一步调整字体大小，确保移动端的可读性。
*/
@media (max-width: 480px) {
  h2 {
    font-size: 1.5em;
  }

  h3 {
    font-size: 1.3em;
  }

  h4 {
    font-size: 1.1em;
  }

  p {
    font-size: 0.9em;
  }

  .button {
    padding: 8px 16px;
    font-size: 0.9em;
  }
}

/* 
  加载动画样式，居中显示，使用主色调和点缀色。
*/
.loader {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100vh;
  background: linear-gradient(135deg, #182848, #4b6cb7);
}

.loader::after {
  content: '>';
  display: inline-block;
  font-size: 2em;
  color: #ff7e5f;
  animation: codeFlow 1s infinite;
}

/* 
  定义加载动画的关键帧，实现持续的左右移动效果。
*/
@keyframes codeFlow {
  0% { transform: translateX(0); }
  50% { transform: translateX(10px); }
  100% { transform: translateX(0); }
}

/* 
  动态波浪动画样式，使用SVG背景和关键帧动画实现平滑的横向移动。
*/
.waves {
  position: relative;
  width: 100%;
  height: 200px;
  background: url('https://images.gptkong.com/demo/sample1.png') repeat-x;
  animation: waveAnimation 10s linear infinite;
}

@keyframes waveAnimation {
  from { transform: translateX(0); }
  to { transform: translateX(-100%); }
}

/* 
  交互式图表区域样式，确保图表响应式且与整体设计协调。
*/
.chart {
  background: rgba(24, 40, 72, 0.8);
  padding: 20px;
  border-radius: 10px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

/* 
  智能推荐系统的样式，使用渐变色背景和圆角按钮，提升视觉体验。
*/
.recommendations {
  background: rgba(255, 255, 255, 0.1);
  padding: 20px;
  border-radius: 10px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

/* 
  用户登录仪表盘样式，使用卡片式设计，信息清晰展示。
*/
.dashboard {
  background: rgba(24, 40, 72, 0.9);
  padding: 30px;
  border-radius: 10px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.dashboard h2 {
  color: #ff7e5f;
  margin-bottom: 20px;
}

/* 
  社区互动区域样式，使用现代化设计元素，增强用户粘性。
*/
.community {
  background: rgba(255, 255, 255, 0.05);
  padding: 20px;
  border-radius: 10px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

/* 
  视频直播区域样式，确保视频播放器适应不同屏幕。
*/
.live-stream {
  position: relative;
  padding-bottom: 56.25%; /* 16:9 */
  padding-top: 25px;
  height: 0;
}

.live-stream iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: 0;
  border-radius: 10px;
}

/* 
  过渡效果，用于页面内部元素的平滑变化。
*/
.transition-effect {
  transition: all 0.3s ease;
}

/* 
  数据可视化工具样式，确保图表与整体设计协调。
*/
.d3-chart {
  background: rgba(24, 40, 72, 0.8);
  padding: 20px;
  border-radius: 10px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

/* 
  按需添加更多CSS样式，以满足设计需求，确保页面元素美观且功能齐全。
*/

