/*
 * 主样式表
 * 
 * 该文件定义了网站的配色方案、排版、布局以及适配移动端的样式。
 * 采用现代、简洁的风格，使用温暖柔和的色彩，符合 2025 年强调舒适与可读性
 * 的网页趋势【233014421024955†L111-L156】。导航、卡片和表单等组件采用
 * 清晰的边距和对比度来增强可读性，并确保在手机和桌面端都能良好呈现【351566844021299†L61-L69】。
 */

/* 全局变量定义 */
:root {
  /* 主要背景色，偏米白色，提升阅读舒适度 */
  /* 站点背景为接近黑色，营造沉浸式体验 */
  --bg-color: #0a0a0a;
  /* 主色调：深绿色，用于按钮、链接等强调元素 */
  --primary-color: #2e8b57;
  /* 次要强调色：更深的绿色，用于悬停状态或次级按钮 */
  --secondary-color: #256c48;
  /* 字体颜色：浅灰白色，确保在深色背景下的可读性 */
  --text-color: #e6e6e6;
  /* 链接颜色：稍亮的绿色，用于可点击元素 */
  --link-color: #6bbf73;
  /* 卡片背景色：深灰色，与背景区分开来 */
  --card-bg: #1a1a1a;
  /* 阴影颜色：深色背景下使用较淡的阴影 */
  --shadow-color: rgba(255, 255, 255, 0.05);
}

/* 通用重置 */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Helvetica Neue', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
  color: var(--text-color);
  background-color: var(--bg-color);
  line-height: 1.6;
}

/* 顶部导航栏 */
header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  background-color: var(--bg-color);
  box-shadow: 0 2px 4px var(--shadow-color);
  z-index: 999;
  padding: 0.5rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

header .logo {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary-color);
}

nav ul {
  list-style: none;
  display: flex;
  align-items: center;
}

nav li {
  margin-left: 1.5rem;
}

nav a {
  text-decoration: none;
  color: var(--text-color);
  font-weight: 500;
  transition: color 0.2s ease;
}

nav a:hover {
  color: var(--primary-color);
}

/* 主内容容器 */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1rem;
}

/* Hero 区域 */
.hero {
  height: 100vh;
  padding-top: 5rem;
  background: url('../images/hero.png') no-repeat center/cover;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  /* 深色主题下默认文本颜色使用全局变量 */
  color: var(--text-color);
  position: relative;
}

.hero::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  /* 深色模式下使用半透明的黑色遮罩，营造沉浸感 */
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(1px);
}

.hero .hero-content {
  position: relative;
  z-index: 1;
}

.hero h1 {
  font-size: 2.5rem;
  margin-bottom: 1rem;
  line-height: 1.2;
}

.hero p {
  font-size: 1.25rem;
  margin-bottom: 2rem;
  max-width: 600px;
}

.hero .btn {
  display: inline-block;
  background-color: var(--primary-color);
  color: white;
  padding: 0.75rem 1.5rem;
  border-radius: 4px;
  text-decoration: none;
  font-weight: 600;
  transition: background-color 0.2s ease;
}

.hero .btn:hover {
  background-color: var(--secondary-color);
}

/* 段落标题和区块 */
section {
  padding: 4rem 1rem;
}

section h2 {
  font-size: 2rem;
  margin-bottom: 1.5rem;
  color: var(--primary-color);
  text-align: center;
}

/* 网格布局用于卡片 */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5rem;
}

.card {
  background-color: var(--card-bg);
  border-radius: 8px;
  box-shadow: 0 2px 8px var(--shadow-color);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.card img {
  width: 100%;
  height: 180px;
  object-fit: cover;
}

.card-body {
  padding: 1rem;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.card-body h3 {
  font-size: 1.25rem;
  margin-bottom: 0.5rem;
}

.card-body p {
  flex: 1;
  font-size: 0.95rem;
  margin-bottom: 1rem;
}

.card-body a {
  align-self: flex-start;
  text-decoration: none;
  color: var(--primary-color);
  font-weight: 600;
  transition: color 0.2s ease;
}

.card-body a:hover {
  color: var(--secondary-color);
}

/* 表单样式 */
form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  max-width: 600px;
  margin: 0 auto;
}

form label {
  font-weight: 600;
}

form input,
form textarea {
  padding: 0.75rem;
  border: 1px solid #444444;
  border-radius: 4px;
  font-size: 1rem;
  resize: vertical;
  background-color: #1e1e1e;
  color: var(--text-color);
}

form button {
  background-color: var(--primary-color);
  color: white;
  padding: 0.75rem;
  border: none;
  border-radius: 4px;
  font-size: 1rem;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

form button:hover {
  background-color: var(--secondary-color);
}

/* 页脚 */
footer {
  background-color: var(--bg-color);
  padding: 2rem 1rem;
  text-align: center;
  color: #666666;
  font-size: 0.85rem;
  border-top: 1px solid #eee;
  margin-top: 2rem;
}

/* 响应式调整 */
@media (max-width: 768px) {
  header {
    flex-direction: column;
    align-items: flex-start;
  }
  nav ul {
    flex-wrap: wrap;
    margin-top: 0.5rem;
  }
  nav li {
    margin-left: 1rem;
    margin-top: 0.5rem;
  }
  .hero h1 {
    font-size: 2rem;
  }
  .hero p {
    font-size: 1rem;
  }
}