
/* 全局样式设置 */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box; /* 确保所有元素的尺寸计算包括内边距和边框 */
}

/* 字体设置 */
body {
  font-family: 'Open Sans', sans-serif; /* 正文字体 */
  font-size: 16px; /* 基础字号 */
  background: linear-gradient(135deg, #2ECC71, #3498DB); /* 绿色到蓝色的渐变背景 */
  color: #2C3E50; /* 主文本颜色 */
  line-height: 1.6;
}

/* 头部导航栏样式 */
.header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 60px;
  background-color: rgba(46, 204, 113, 0.9); /* 主色半透明背景 */
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  z-index: 1000;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1); /* 轻微阴影效果 */
}

/* 导航链接样式 */
.nav-links a {
  color: #fff;
  text-decoration: none;
  margin: 0 15px;
  font-weight: bold;
  transition: color 0.3s;
}

.nav-links a:hover {
  color: #F1C40F; /* 点缀色悬停效果 */
}

/* 主容器布局 */
.container {
  display: grid;
  grid-template-areas:
    'header'
    'main'
    'footer';
  grid-template-rows: 60px 1fr 40px;
  min-height: 100vh;
  padding-top: 60px; /* 预留头部高度 */
}

/* 主内容区域样式 */
.main {
  grid-area: main;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* 文章标题样式 */
article h2 {
  font-size: 24px;
  color: #2ECC71;
  margin-bottom: 10px;
}

/* 文章副标题样式 */
article h3 {
  font-size: 20px;
  color: #3498DB;
  margin-top: 20px;
  margin-bottom: 10px;
}

/* 正文段落样式 */
article p {
  font-size: 16px;
  margin-bottom: 15px;
}

/* 代码块样式 */
article pre {
  background-color: #34495E;
  color: #ECF0F1;
  padding: 15px;
  border-radius: 5px;
  overflow-x: auto;
  font-family: 'Courier New', Courier, monospace;
  margin-bottom: 15px;
}

/* 行内代码样式 */
article code {
  background-color: #ecf0f1;
  color: #2C3E50;
  padding: 2px 4px;
  border-radius: 3px;
  font-family: 'Courier New', Courier, monospace;
}

/* 表格样式 */
article table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 20px;
}

article table th,
article table td {
  border: 1px solid #95A5A6;
  padding: 10px;
  text-align: left;
}

article table th {
  background-color: #2ECC71;
  color: #fff;
}

article table tr:nth-child(even) {
  background-color: #ecf0f1;
}

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

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

/* 高亮提示文字样式 */
.highlight {
  font-size: 18px;
  color: #E74C3C;
  text-align: center;
  margin: 20px 0;
  font-weight: bold;
}

/* 折叠区域样式 */
.collapsible {
  background-color: #3498DB;
  color: white;
  cursor: pointer;
  padding: 10px;
  width: 100%;
  border: none;
  text-align: left;
  outline: none;
  font-size: 16px;
  border-radius: 5px;
  transition: background-color 0.3s;
}

.collapsible:hover {
  background-color: #2980B9;
}

.content {
  padding: 0 15px;
  display: none;
  overflow: hidden;
  background-color: #ecf0f1;
  border-radius: 5px;
  margin-bottom: 10px;
}

.content p {
  color: #2C3E50;
}

/* 导航系统样式 */
.nav-section {
  position: fixed;
  top: 60px;
  left: 0;
  width: 200px;
  height: calc(100% - 100px);
  background-color: #95A5A6;
  padding: 20px;
  overflow-y: auto;
  display: none;
}

.nav-section.active {
  display: block;
}

.nav-section a {
  display: block;
  color: #fff;
  text-decoration: none;
  margin-bottom: 10px;
  transition: color 0.3s;
}

.nav-section a:hover {
  color: #F1C40F;
}

/* 主题切换按钮样式 */
.theme-toggle {
  position: fixed;
  top: 20px;
  right: 20px;
  background-color: #3498DB;
  border: none;
  border-radius: 50%;
  width: 50px;
  height: 50px;
  cursor: pointer;
  transition: background-color 0.3s;
}

.theme-toggle:hover {
  background-color: #2980B9;
}

/* 页脚样式 */
.footer {
  grid-area: footer;
  background-color: rgba(52, 152, 219, 0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
}

/* 响应式设计 */
@media (max-width: 768px) {
  .nav-section {
    width: 100%;
    height: auto;
    position: relative;
  }
  
  .container {
    padding: 10px;
  }
  
  .highlight {
    font-size: 16px;
  }
}

@media (min-width: 769px) {
  .main {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: space-between;
  }
  
  .nav-section.active {
    display: block;
  }
}

