
/* 全局样式设置 */
body {
  margin: 0;
  padding: 0;
  font-family: 'Roboto', sans-serif;
  background: linear-gradient(135deg, #2c3e50 70%, #34495e 25%, #e67e22 5%);
  color: #ecf0f1;
  line-height: 1.6;
}

/* 章节导航栏 */
.navbar {
  position: fixed;
  top: 0;
  width: 100%;
  background-color: rgba(44, 62, 80, 0.9);
  padding: 15px 30px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  z-index: 1000;
}

.navbar ul {
  list-style: none;
  display: flex;
  justify-content: space-around;
}

.navbar li {
  margin: 0 15px;
}

.navbar a {
  color: #ecf0f1;
  text-decoration: none;
  font-size: 16px;
  transition: color 0.3s ease;
}

.navbar a:hover {
  color: #27ae60;
}

/* 主内容区域 */
.container {
  max-width: 1200px;
  margin: 100px auto 50px;
  padding: 20px;
}

/* 标题样式 */
h1, h2, h3, h4 {
  color: #ecf0f1;
}

h1 {
  font-size: 32px;
  margin-bottom: 20px;
}

h2 {
  font-size: 28px;
  margin-top: 40px;
  margin-bottom: 20px;
  border-bottom: 2px solid #27ae60;
  padding-bottom: 10px;
}

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

h4 {
  font-size: 20px;
  margin-top: 20px;
  margin-bottom: 10px;
}

/* 段落与文本 */
p {
  font-size: 16px;
  margin-bottom: 15px;
  color: #bdc3c7;
}

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

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

/* 微交互效果 */
.card {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  padding: 20px;
  margin-bottom: 30px;
  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(-10px);
  box-shadow: 0 10px 15px rgba(0, 0, 0, 0.2);
}

/* 代码块样式 */
code.example {
  display: block;
  background: rgba(44, 62, 80, 0.8);
  padding: 15px;
  border-radius: 5px;
  overflow-x: auto;
  font-family: 'Courier New', Courier, monospace;
  color: #ecf0f1;
  margin: 20px 0;
}

code.example span.keyword {
  color: #e67e22;
  font-weight: bold;
}

code.example span.selector {
  color: #f1c40f;
}

code.example span.property {
  color: #2ecc71;
}

code.example span.value {
  color: #3498db;
}

/* 渐变分隔线 */
.separator {
  height: 2px;
  background: linear-gradient(90deg, #27ae60, #e67e22);
  margin: 40px 0;
}

/* 按钮样式 */
.button {
  background-color: #27ae60;
  color: #ffffff;
  padding: 10px 20px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  transition: background-color 0.3s ease;
  display: inline-block;
  text-decoration: none;
  font-size: 16px;
}

.button:hover {
  background-color: #2ecc71;
}

/* 导航链接样式 */
.nav-links a {
  display: block;
  padding: 10px 0;
}

/* 留白与分区 */
.section {
  padding: 40px 0;
}

/* 响应式设计 */
@media (max-width: 768px) {
  .navbar ul {
    flex-direction: column;
    align-items: center;
  }
  
  .container {
    margin: 120px 20px 20px;
  }
  
  h1 {
    font-size: 28px;
  }
  
  h2 {
    font-size: 24px;
  }
  
  img.decorative {
    max-width: 100%;
  }
  
  .button {
    width: 100%;
    text-align: center;
  }
}

