
/* 
  全局样式设置
  设置页面的基本字体、背景颜色及整体布局响应性
*/
:root {
  /* 颜色变量定义 */
  --forest-green: #2E8B57; /* 主色调：森林绿 */
  --sky-blue: #00AEEF; /* 辅助色：天蓝色 */
  --light-gray: #F5F5F5; /* 辅助色：浅灰色 */
  --accent-color: #FF6347; /* 点缀色：番茄红 */
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  background: var(--light-gray);
  color: var(--forest-green);
  font-family: 'Open Sans', sans-serif;
  line-height: 1.6;
  font-size: 16px;
}

/* 导航栏样式 */
.navbar {
  position: fixed;
  top: 0;
  width: 100%;
  background-color: rgba(245, 245, 245, 0.95);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  z-index: 1000;
}

.navbar ul {
  display: flex;
  justify-content: center;
  list-style: none;
  padding: 15px 0;
}

.navbar li {
  margin: 0 20px;
}

.navbar a {
  text-decoration: none;
  color: var(--forest-green);
  font-weight: bold;
  transition: color 0.3s ease;
}

.navbar a:hover {
  color: var(--sky-blue);
}

/* 横幅区域样式 */
.banner {
  background: linear-gradient(120deg, var(--forest-green), var(--sky-blue));
  height: 60vh;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 2.5em;
  font-family: 'Roboto', sans-serif;
  text-align: center;
}

/* 主要内容容器 */
.main-content {
  padding: 100px 20px 40px 20px;
  display: flex;
  flex-direction: column;
  gap: 40px;
  max-width: 1200px;
  margin: 0 auto;
}

/* 模块化布局样式 */
.module-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(500px, 1fr));
  gap: 30px;
}

/* 卡片样式 */
.card {
  background-color: white;
  border-radius: 10px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
  padding: 20px;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

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

/* 文章样式 */
article {
  background-color: white;
  padding: 30px;
  border-radius: 10px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

article h2, article h3 {
  font-family: 'Roboto', sans-serif;
  color: var(--forest-green);
  margin-bottom: 15px;
}

article p {
  margin-bottom: 20px;
  color: #333;
}

article pre {
  background: #f0f0f0;
  padding: 15px;
  border-radius: 5px;
  overflow: auto;
  position: relative;
}

article pre code {
  font-family: 'Courier New', Courier, monospace;
  color: #2E8B57;
}

article pre::before {
  content: "代码示例";
  position: absolute;
  top: -25px;
  left: 0;
  background: var(--forest-green);
  color: white;
  padding: 5px 10px;
  border-radius: 3px;
  font-size: 0.9em;
}

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

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

/* 提示条样式 */
.notification {
  background: var(--sky-blue);
  color: white;
  padding: 15px;
  text-align: center;
  font-size: 1.2em;
  font-weight: bold;
  border-radius: 5px;
  margin-bottom: 40px;
  animation: fadeIn 2s ease-in-out;
}

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

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

  .banner {
    font-size: 2em;
  }

  .main-content {
    padding: 80px 10px 30px 10px;
  }

  img.decorative {
    max-width: 100%;
  }
}

