
/* 主色调定义 */
:root {
  --primary-color: #2E7D32; /* 深绿色，象征可持续发展 */
  --secondary-color: #81C784; /* 浅绿色，增强层次感 */
  --accent-color: #FF9800; /* 橙色，作为点缀色吸引视线 */
  --background-gradient-start: #2E7D32;
  --background-gradient-end: #B3E5FC;
  --text-color: #333333;
  --header-height: 60px;
  --font-family: 'Roboto', sans-serif;
}

/* 全局样式 */
body {
  margin: 0;
  padding: 0;
  font-family: var(--font-family);
  color: var(--text-color);
  background: linear-gradient(135deg, var(--background-gradient-start), var(--background-gradient-end));
  line-height: 1.6;
}

/* 导航栏样式 */
.header {
  position: fixed;
  top: 0;
  width: 100%;
  height: var(--header-height);
  background-color: var(--primary-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 20px;
  z-index: 1000;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.header .logo {
  font-size: 1.5em;
  color: #fff;
  text-decoration: none;
  font-weight: bold;
}

.header .nav-links {
  display: flex;
  gap: 15px;
}

.header .nav-links a {
  color: #fff;
  text-decoration: none;
  padding: 10px 15px;
  transition: background 0.3s, transform 0.3s;
}

.header .nav-links a:hover {
  background-color: var(--secondary-color);
  border-radius: 5px;
  transform: scale(1.05);
}

/* 主要内容容器 */
.container {
  display: grid;
  grid-template-columns: 1fr 3fr;
  gap: 20px;
  padding: calc(var(--header-height) + 20px) 20px 20px 20px;
  max-width: 1200px;
  margin: 0 auto;
}

/* 侧边栏样式 */
.sidebar {
  background-color: rgba(255, 255, 255, 0.8);
  padding: 20px;
  border-radius: 10px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.sidebar .nav-section {
  margin-bottom: 20px;
}

.sidebar .nav-section h3 {
  margin-bottom: 10px;
  color: var(--primary-color);
}

.sidebar .nav-section ul {
  list-style: none;
  padding: 0;
}

.sidebar .nav-section ul li {
  margin-bottom: 10px;
}

.sidebar .nav-section ul li a {
  color: var(--secondary-color);
  text-decoration: none;
  transition: color 0.3s;
}

.sidebar .nav-section ul li a:hover {
  color: var(--primary-color);
}

/* 主内容样式 */
.main-content {
  background-color: rgba(255, 255, 255, 0.9);
  padding: 20px;
  border-radius: 10px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.main-content h2, .main-content h3, .main-content h4 {
  color: var(--primary-color);
}

.main-content pre {
  background-color: #f5f5f5;
  padding: 15px;
  border-radius: 5px;
  overflow-x: auto;
}

.main-content code {
  font-family: 'Courier New', Courier, monospace;
  color: var(--primary-color);
}

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

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

/* 按钮样式 */
.button {
  display: inline-block;
  padding: 10px 20px;
  background-color: var(--secondary-color);
  color: #fff;
  text-decoration: none;
  border-radius: 5px;
  transition: background 0.3s, transform 0.3s;
}

.button:hover {
  background-color: var(--primary-color);
  transform: translateY(-2px);
}

/* 代码示例样式 */
.code-example {
  background-color: #2E7D32;
  color: #fff;
  padding: 15px;
  border-radius: 5px;
  overflow-x: auto;
}

.code-example code {
  color: #FFEB3B;
}

/* 关键帧动画 */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

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

/* 响应式设计 */
@media (max-width: 1200px) {
  .container {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .header {
    flex-direction: column;
    height: auto;
    padding: 10px;
  }

  .header .nav-links {
    flex-direction: column;
    gap: 10px;
  }

  .sidebar {
    display: none;
  }
}

