
/* 
  全局样式设置
  设定页面的基本字体、颜色和背景，使用冷色调来传达科技感和专业性。
*/
body {
  margin: 0;
  padding: 0;
  background: linear-gradient(135deg, #0d47a1, #424242); /* 背景渐变，从深蓝到灰色 */
  color: #ffffff; /* 字体颜色为白色 */
  font-family: 'Roboto', sans-serif; /* 使用Roboto字体，简洁现代 */
  line-height: 1.6; /* 行高设置 */
}

/* 
  导航栏样式
  固定在页面顶部，包含多级下拉菜单，提升用户访问便利性。
*/
.navbar {
  position: fixed;
  top: 0;
  width: 100%;
  background: rgba(13, 71, 161, 0.9); /* 半透明深蓝背景 */
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1); /* 轻微阴影 */
  z-index: 1000; /* 确保导航栏在最上层 */
}

.navbar ul {
  list-style: none;
  display: flex;
  padding: 0;
  margin: 0;
}

.navbar li {
  position: relative;
  padding: 15px 20px;
}

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

.navbar li:hover > ul {
  display: block; /* 悬停时显示下级菜单 */
}

.navbar ul ul {
  display: none;
  position: absolute;
  top: 50px;
  left: 0;
  background: rgba(13, 71, 161, 0.95);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.navbar ul ul li {
  width: 200px;
  padding: 10px 20px;
}

.navbar ul ul li a:hover {
  background: rgba(255, 152, 0, 0.2); /* 下拉菜单悬停效果 */
}

/* 
  面包屑导航样式
  帮助用户了解当前位置，提升页面易用性。
*/
.breadcrumb {
  display: flex;
  list-style: none;
  padding: 10px 20px;
  background: transparent;
  margin-top: 70px; /* 避免与固定导航栏重叠 */
}

.breadcrumb li + li:before {
  content: ">";
  padding: 0 8px;
  color: #ffffff;
}

.breadcrumb a {
  color: #ff9800; /* 点缀色橙色 */
  text-decoration: none;
}

.breadcrumb a:hover {
  text-decoration: underline;
}

/* 
  Hero Section样式
  首页大型横幅，展示核心价值主张，使用全屏背景图或视频。
*/
.hero {
  position: relative;
  width: 100%;
  height: 100vh;
  background: url('https://images.gptkong.com/demo/sample1.png') center center / cover no-repeat;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.hero::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(4, 22, 66, 0.5); /* 半透明覆盖层 */
}

.hero-content {
  position: relative;
  z-index: 1;
}

.hero h1 {
  font-size: 48px;
  margin-bottom: 20px;
}

.hero p {
  font-size: 18px;
  max-width: 600px;
  margin: 0 auto;
}

/* 
  提示信息样式
  在显著位置提示“这是一个网页样式设计参考”。
*/
.design-note {
  background: rgba(255, 152, 0, 0.8); /* 点缀色橙色背景 */
  color: #ffffff;
  padding: 10px 20px;
  text-align: center;
  font-size: 16px;
}

/* 
  主内容区模块样式
  使用卡片式布局，图文并茂，配合磨砂玻璃效果。
*/
.card-container {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  padding: 40px 20px;
}

.card {
  background: rgba(255, 255, 255, 0.1); /* 半透明背景 */
  backdrop-filter: blur(5px); /* 磨砂玻璃效果 */
  border: 1px solid rgba(255, 255, 255, 0.3); /* 边框 */
  border-radius: 10px;
  flex: 1 1 calc(33% - 40px);
  padding: 20px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1); /* 阴影 */
  transition: transform 0.3s, background 0.3s; /* 过渡效果 */
}

.card:hover {
  transform: translateY(-10px); /* 悬停时平移 */
  background: rgba(255, 255, 255, 0.2); /* 背景变化 */
}

/* 
  图片样式
  圆角、阴影、悬浮效果。
*/
.card img {
  width: 100%;
  border-radius: 10px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
  transition: transform 0.3s, box-shadow 0.3s;
}

.card img:hover {
  transform: scale(1.05); /* 悬停放大 */
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

/* 
  章节导航样式
  清晰的章节导航，帮助读者快速定位内容。
*/
.chapter-nav {
  position: fixed;
  right: 20px;
  top: 100px;
  background: rgba(13, 71, 161, 0.8);
  padding: 10px;
  border-radius: 8px;
}

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

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

.chapter-nav a {
  color: #ffffff;
  text-decoration: none;
  font-size: 14px;
}

.chapter-nav a:hover {
  text-decoration: underline;
}

/* 
  文章内容样式
  使用合理的排版，增强阅读体验。
*/
article {
  padding: 20px;
  max-width: 1200px;
  margin: 0 auto;
}

article h2 {
  font-size: 28px;
  margin-top: 40px;
  margin-bottom: 20px;
  color: #ff9800; /* 点缀色橙色 */
}

article h3 {
  font-size: 22px;
  margin-top: 30px;
  margin-bottom: 15px;
}

article p {
  font-size: 16px;
  margin-bottom: 15px;
}

article pre {
  background: rgba(0, 0, 0, 0.7);
  padding: 15px;
  border-radius: 8px;
  overflow-x: auto;
  margin-bottom: 15px;
}

article code {
  color: #ff9800; /* 代码颜色橙色 */
}

/* 
  按钮样式
  关键按钮与CTA，使用渐变色和悬停效果。
*/
.cta-button {
  background: linear-gradient(90deg, #ff9800, #f44336); /* 橙色到红色渐变 */
  border: none;
  border-radius: 25px;
  color: #ffffff;
  padding: 15px 30px;
  font-size: 16px;
  cursor: pointer;
  transition: background 0.3s, transform 0.3s;
}

.cta-button:hover {
  background: linear-gradient(90deg, #f44336, #ff9800); /* 渐变方向变化 */
  transform: scale(1.05); /* 放大效果 */
}

/* 
  图标样式
  线性简约风格，悬停变色。
*/
.icon {
  width: 24px;
  height: 24px;
  fill: #ffffff;
  transition: fill 0.3s;
}

.icon:hover {
  fill: #ff9800; /* 变为橙色 */
}

/* 
  加载动画样式
  页面加载时的旋转动画。
*/
.loader {
  border: 8px solid rgba(255, 255, 255, 0.2);
  border-top: 8px solid #ff9800;
  border-radius: 50%;
  width: 60px;
  height: 60px;
  animation: spin 1s linear infinite;
  margin: 100px auto;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* 
  响应式设计
  使用媒体查询确保在不同设备上的良好展示。
*/
@media (max-width: 1200px) {
  .card {
    flex: 1 1 calc(50% - 40px);
  }
}

@media (max-width: 768px) {
  .card {
    flex: 1 1 100%;
  }

  .navbar ul {
    flex-direction: column;
  }

  .navbar li {
    padding: 10px 15px;
  }

  .chapter-nav {
    display: none; /* 移动端隐藏章节导航 */
  }
}

/* 
  顶部导航在移动设备上的样式调整
*/
@media (max-width: 768px) {
  .navbar {
    padding: 10px;
  }

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