
/* 
整体页面样式设计
采用复古与现代结合的风格，利用CSS3高级特性实现丰富的视觉效果和响应式布局。
*/

/* 基础样式 */
body {
  margin: 0;
  padding: 0;
  font-family: 'Roboto', sans-serif; /* 正文字体，易读且现代 */
  background: linear-gradient(135deg, #F5F5DC 70%, #964B00 25%, #D4AF37 5%); /* 主色，辅色，点缀色的渐变背景 */
  color: #333;
  overflow-x: hidden; /* 防止左右滚动条 */
}

/* 导航栏样式 */
.navbar {
  position: fixed;
  top: 0;
  width: 100%;
  background-color: #964B00; /* 主色 */
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  z-index: 1000;
  transition: background-color 0.3s ease;
}

.navbar.scrolled {
  background-color: rgba(150, 75, 0, 0.9); /* 滚动时的背景色变化 */
}

.navbar .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 20px;
}

.navbar a {
  color: #FFF;
  text-decoration: none;
  margin: 0 15px;
  font-size: 16px; /* 标题字号 */
  transition: color 0.3s ease;
}

.navbar a:hover {
  color: #FFA500; /* 点缀色 */
}

/* 首页顶部横幅 */
.header {
  height: 100vh;
  background: url('https://images.gptkong.com/demo/sample1.png') center center/cover no-repeat;
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
}

.header::after {
  content: '这是一个网页样式设计参考';
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  background-color: rgba(0, 0, 0, 0.6);
  color: #FFF;
  padding: 10px 20px;
  border-radius: 5px;
  font-size: 18px; /* 标题字号 */
}

/* 章节导航 */
.section-nav {
  margin-top: 80px; /* 避免被固定导航栏遮挡 */
  padding: 40px 20px;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 20px;
}

.section-nav a {
  background-color: #1E90FF; /* 电蓝 */
  color: #FFF;
  padding: 10px 20px;
  border-radius: 8px;
  text-decoration: none;
  font-size: 16px;
  transition: background-color 0.3s ease, transform 0.3s ease;
}

.section-nav a:hover {
  background-color: #FFA500; /* 橙色 */
  transform: translateY(-3px);
}

/* 内容区样式 */
.content {
  padding: 60px 20px;
  max-width: 1200px;
  margin: 0 auto;
}

.content section {
  margin-bottom: 60px;
}

.content h2 {
  font-family: 'Garamond', serif; /* 标题字体，复古风 */
  font-size: 24px; /* h2标题字号 */
  color: #964B00;
  margin-bottom: 20px;
  position: relative;
}

.content h2::after {
  content: '';
  display: block;
  width: 50px;
  height: 3px;
  background-color: #FFA500;
  margin-top: 10px;
}

.content p {
  font-size: 16px; /* 正文字号 */
  line-height: 1.6;
  margin-bottom: 20px;
}

.content pre {
  background-color: #F5F5DC;
  padding: 15px;
  border-radius: 8px;
  overflow-x: auto;
  box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.content code {
  font-family: 'Courier New', monospace;
  color: #1E90FF;
}

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

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

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

.card {
  background-color: #FFF;
  border: 1px solid #DDD;
  border-radius: 8px;
  padding: 20px;
  box-shadow: 0 4px 6px rgba(0,0,0,0.1);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 12px rgba(0,0,0,0.2);
}

.card h3 {
  font-size: 20px;
  color: #1E90FF;
  margin-bottom: 15px;
}

.card p {
  font-size: 15px;
  color: #333;
}

/* 按钮样式 */
.button-primary {
  background-color: #1E90FF; /* 电蓝 */
  color: #FFF;
  padding: 10px 20px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  transition: background-color 0.3s ease, transform 0.3s ease;
  font-size: 16px;
}

.button-primary:hover {
  background-color: #FFA500; /* 橙色 */
  transform: translateY(-2px);
}

/* 页脚样式 */
.footer {
  background-color: #964B00; /* 主色 */
  color: #FFF;
  text-align: center;
  padding: 20px;
  position: relative;
}

.footer a {
  color: #FFA500;
  text-decoration: none;
  margin: 0 10px;
}

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

  .section-nav {
    flex-direction: column;
    align-items: center;
  }

  .content {
    padding: 40px 10px;
  }

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

/* 动画效果 */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.fade-in {
  animation: fadeIn 1s ease-in-out;
}

/* 背景动画 */
.chart::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(45deg, rgba(255,165,0,0.1) 25%, transparent 25%, 
              transparent 50%, rgba(30,144,255,0.1) 50%, rgba(30,144,255,0.1) 75%, 
              transparent 75%, transparent);
  background-size: 56.57px 56.57px;
  animation: moveBackground 10s linear infinite;
}

@keyframes moveBackground {
  0% { background-position: 0 0; }
  100% { background-position: 56.57px 56.57px; }
}

