
/* 全局样式设置 */
body {
  margin: 0;
  padding: 0;
  font-family: 'Roboto', sans-serif; /* 使用现代无衬线字体 */
  background: linear-gradient(135deg, #0f2027, #203a43, #2c5364); /* 渐变背景色，传达科技感 */
  color: #ffffff; /* 文字颜色为白色，提升可读性 */
}

/* 导航栏样式 */
.navbar {
  position: fixed;
  top: 0;
  width: 100%;
  background: rgba(32, 58, 67, 0.9); /* 半透明背景，确保内容可见 */
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 2rem;
  z-index: 1000; /* 确保导航栏在最上层 */
  transition: background 0.3s ease; /* 背景过渡效果 */
}

.navbar:hover {
  background: rgba(32, 58, 67, 1); /* 悬停时背景色变深 */
}

.navbar a {
  color: #ffffff;
  text-decoration: none;
  margin: 0 1rem;
  font-size: 1rem;
  transition: color 0.3s ease;
}

.navbar a:hover {
  color: #ff5533; /* 悬停时文字颜色变为点缀色 */
}

/* 主视觉区样式 */
.hero {
  height: 100vh;
  background: url('https://images.gptkong.com/demo/sample1.png') center center / cover no-repeat;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  position: relative;
}

.hero::after {
  content: "这是一个网页样式设计参考"; /* 显著位置提示 */
  position: absolute;
  bottom: 20px;
  font-size: 1.2rem;
  color: #ffffff;
  opacity: 0.7;
}

/* 标题样式 */
h1, h2, h3, h4 {
  color: #ffffff;
  margin-bottom: 1rem;
}

h1 {
  font-size: 2.5rem;
}

h2 {
  font-size: 2rem;
}

h3 {
  font-size: 1.75rem;
}

h4 {
  font-size: 1.5rem;
}

/* 内容区块样式 */
.section {
  padding: 4rem 2rem;
  background: rgba(44, 83, 100, 0.8); /* 半透明背景，增加层次感 */
  margin: 2rem 0;
}

.section:nth-child(even) {
  background: rgba(32, 58, 67, 0.8); /* 交替背景色 */
}

.section-content {
  max-width: 1200px;
  margin: 0 auto;
}

/* 卡片式布局 */
.card-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 2rem;
}

.card {
  background: #ffffff;
  color: #333333;
  border-radius: 10px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  overflow: hidden;
  transition: transform 0.3s, box-shadow 0.3s;
}

.card:hover {
  transform: translateY(-10px);
  box-shadow: 0 10px 15px rgba(0, 0, 0, 0.2);
}

.card img {
  width: 100%;
  height: auto;
  border-bottom: 1px solid #e0e0e0;
}

.card-body {
  padding: 1.5rem;
}

.card-title {
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
}

.card-text {
  font-size: 1rem;
  color: #666666;
}

/* 按钮样式 */
.btn {
  display: inline-block;
  padding: 0.75rem 1.5rem;
  background: linear-gradient(135deg, #4285F4, #1A73E8);
  color: #ffffff;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  transition: background 0.3s ease;
  text-decoration: none;
  font-size: 1rem;
}

.btn:hover {
  background: linear-gradient(135deg, #1A73E8, #4285F4); /* 悬停时颜色反转 */
}

/* 图片装饰样式 */
.decorative-images {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: center;
  margin: 2rem 0;
}

.decorative-images img {
  width: 320px;
  height: 320px;
  object-fit: cover;
  border-radius: 15px;
  box-shadow: 0 4px 8px rgba(0,0,0,0.2);
  transition: transform 0.3s, box-shadow 0.3s;
}

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

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

  .navbar a {
    margin: 0.5rem 0;
    font-size: 1.2rem;
  }

  .hero {
    height: 70vh;
  }

  .section {
    padding: 2rem 1rem;
  }

  .card-container {
    grid-template-columns: 1fr;
  }

  .decorative-images img {
    width: 100%;
    height: auto;
  }
}

/* 微动画效果 */
.fade-in {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

/* 按钮渐变效果 */
.button-gradient {
  background: linear-gradient(135deg, #ff5533, #ff8a75);
}

.button-gradient:hover {
  background: linear-gradient(135deg, #ff8a75, #ff5533);
}

/* 章节导航样式 */
.chapter-nav {
  position: fixed;
  right: 20px;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(32, 58, 67, 0.9);
  padding: 1rem;
  border-radius: 10px;
  z-index: 1000;
}

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

.chapter-nav li {
  margin: 0.5rem 0;
}

.chapter-nav a {
  color: #ffffff;
  text-decoration: none;
  font-size: 0.9rem;
  transition: color 0.3s ease;
}

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

/* 代码块样式 */
code {
  background: #f5f5f5;
  color: #333333;
  padding: 0.2rem 0.4rem;
  border-radius: 4px;
}

pre {
  background: #f5f5f5;
  padding: 1rem;
  border-radius: 5px;
  overflow-x: auto;
  font-family: 'Courier New', Courier, monospace;
}

/* 热力图样式 */
.heatmap {
  display: grid;
  grid-template-columns: repeat(10, 1fr);
  gap: 5px;
}

.heatmap .cell {
  width: 30px;
  height: 30px;
  background: linear-gradient(to top, #ffedea, #ffcec5, #ffad9f, #ff8a75, #ff5533);
  border-radius: 3px;
  transition: transform 0.3s;
}

.heatmap .cell:hover {
  transform: scale(1.2);
  z-index: 1;
}

/* 安全提示样式 */
.security-alert {
  background: #1A73E8;
  color: #ffffff;
  padding: 1rem;
  border-radius: 5px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  font-size: 1rem;
  margin-bottom: 1rem;
}

