/* 基本重置 */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* 页面主体样式 */
body {
  font-family: Arial, sans-serif;
  line-height: 1.6;
  color: #333;
  background-color: #f7f7f7;
  padding: 0 10px;
}

/* 头部和标题 */
header {
  background-color: #3498db;
  color: #fff;
  padding: 20px 10px;
  text-align: center;
}
header h1 {
  font-size: 2rem;
  margin-bottom: 10px;
}

/* 导航样式 */
nav {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 10px 0;
}

/* 菜单按钮，移动端显示 */
.menu-toggle {
  display: none;
  cursor: pointer;
  background-color: #2980b9;
  padding: 8px 12px;
  border-radius: 4px;
  color: #fff;
  font-size: 1rem;
}

/* 菜单列表样式 */
nav ul.menu {
  display: flex;
  flex-wrap: wrap;
  gap: 15px;
  list-style: none;
  padding: 0;
  margin: 0;
}
nav ul.menu li a {
  color: #fff;
  text-decoration: none;
  font-weight: bold;
  font-size: 1rem;
  padding: 8px 12px;
  transition: background-color 0.3s, transform 0.3s;
}
nav ul.menu li a:hover {
  background-color: rgba(255, 255, 255, 0.2);
  transform: scale(1.05);
}

/* 移动端样式：屏幕宽度小于768px */
@media (max-width: 768px) {
  .menu-toggle {
    display: block; /* 显示菜单按钮 */
  }
  nav ul.menu {
    display: none; /* 默认隐藏菜单 */
    flex-direction: column;
    width: 100%;
    text-align: center;
    margin-top: 10px;
  }
  /* 当导航添加了 .menu-opened 类时，显示菜单 */
  nav.menu-opened ul.menu {
    display: flex;
  }
}



/* 主体区域 */
main {
  max-width: 1200px;
  margin: 20px auto;
  background-color: #fff;
  padding: 20px;
  border-radius: 4px;
}
section {
  margin-bottom: 20px;
}
section h2 {
  margin-bottom: 10px;
  color: #3498db;
}

/* 上半部分：购买及下载 + 视频展示 */
.purchase-video-container {
  max-width: 1200px;
  margin: 40px auto;
  padding: 0 20px;
}

.purchase-video-flex {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
}

.purchase-area {
  flex: 1 1 300px;
  background-color: #f5f5f5;
  padding: 20px;
  border-radius: 10px;
}

.purchase-area h3 {
  font-size: 18px;
  margin-bottom: 10px;
}

.purchase-area p {
  font-size: 14px;
  margin-bottom: 8px;
}

.purchase-area a {
  display: inline-block;
  margin-top: 10px;
  padding: 8px 16px;
  background: #007bff;
  color: white;
  text-decoration: none;
  border-radius: 5px;
}

.video-area {
  flex: 2 1 600px;
}

.video-area h3 {
  font-size: 18px;
  margin-bottom: 10px;
}

.video-container {
  position: relative;
  padding-bottom: 56.25%; /* 16:9 */
  height: 0;
  overflow: hidden;
  border-radius: 8px;
}

.video-container video {
  position: absolute;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* 移动端：上下堆叠 */
@media (max-width: 768px) {
  .purchase-video-flex {
    flex-direction: column;
  }

  .purchase-area, .video-area {
    flex: 1 1 100%;
  }

  .video-container {
    padding-bottom: 56.25%;
  }
}


/* 图文展示区域：4列网格 */
.featured-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 20px;
  margin-top: 20px;
}

.featured-item {
  display: block;
  text-decoration: none;
  color: #333;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
  transition: transform 0.3s, box-shadow 0.3s;
}

.featured-item img {
  width: 100%;
  height: auto;
  display: block;
}

.featured-item p {
  padding: 10px;
  background-color: #fafafa;
  text-align: center;
  font-size: 14px;
}

.featured-item:hover {
  transform: translateY(-4px);
  box-shadow: 0 6px 12px rgba(0,0,0,0.1);
}

/* 文章介绍区域：2列，每列采用独特风格 */
.article-intro-section {
  max-width: 1200px;
  margin: 30px auto;
  padding: 0 20px;
}
.article-intro-section h2 {
  font-size: 20px;
  margin-bottom: 16px;
}
.article-intro-grid {
  display: flex;
  gap: 20px;
}
.article-intro-left,
.article-intro-right {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.article-intro-left a,
.article-intro-right a {
  text-decoration: none;
  color: #333;
}
.article-intro-left h3,
.article-intro-right h3 {
  font-size: 18px;
  background-color: #f2f2f2;
  padding: 10px 14px;
  border-radius: 6px;
  transition: background 0.3s;
}
.article-intro-left h3:hover,
.article-intro-right h3:hover {
  background-color: #e6e6e6;
}

/* ✅ 移动端优化：一列显示 + 字体自适应 */
@media (max-width: 768px) {
  .article-intro-grid {
    flex-direction: column;
  }
  .article-intro-left,
  .article-intro-right {
    width: 100%;
  }
  .article-intro-left h3,
  .article-intro-right h3 {
    font-size: 16px;
  }
}


/* 页脚 */
footer {
  text-align: center;
  padding: 15px;
  font-size: 0.9rem;
  color: #777;
  margin-top: 20px;
}

/* 响应式调整 */
@media (max-width: 768px) {
  nav ul {
    flex-direction: column;
    gap: 10px;
  }
  
  .purchase-video-container {
    flex-direction: column;
  }
  
  .featured-item {
    flex: 1 1 calc(50% - 20px);
  }
  
  .article-intro-item {
    flex: 1 1 100%;
  }
}
@media (max-width: 480px) {
  header h1 {
    font-size: 1.5rem;
  }
}
/* 栏目图文展示区域 */
.category-section {
  margin: 20px 0;
}
.category-section h2 {
  text-align: center;
  margin-bottom: 20px;
}
.category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
}
.category-item {
  background: #fff;
  border-radius: 6px;
  overflow: hidden;
  box-shadow: 0 0 8px rgba(0,0,0,0.05);
  text-align: center;
  transition: transform 0.3s;
}
.category-item img {
  width: 100%;
  height: auto;
  display: block;
}
.category-item h3 {
  margin: 12px;
}
.category-item a {
  color: #333;
  text-decoration: none;
}
.category-item:hover {
  transform: translateY(-5px);
}

/* 文章页布局 */
/* 让 main 居中且最大宽度不超过1200px */
.article-container {
  max-width: 1200px;
  margin: 0 auto; /* 水平居中 */
  padding: 20px;
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
}


/* 主文章区域 */
.article-main {
  flex: 1 1 70%;
  background-color: #fff;
  padding: 20px;
  box-shadow: 0 0 6px rgba(0,0,0,0.05);
  border-radius: 6px;
}
.article-main h2 {
  margin-bottom: 10px;
}
.article-main img {
  width: 100%;
  border-radius: 4px;
  margin: 20px 0;
}

/* 侧边栏区域 */
.article-sidebar {
  flex: 1 1 25%;
  background-color: #f4f4f4;
  padding: 15px;
  border-radius: 6px;
}
.article-sidebar h3 {
  margin-bottom: 10px;
}
.article-sidebar ul {
  list-style: none;
  padding-left: 0;
}
.article-sidebar ul li {
  margin-bottom: 8px;
}
.article-sidebar ul li a {
  text-decoration: none;
  color: #2980b9;
}

/* 移动端自适应 */
@media (max-width: 768px) {
  .article-container {
    flex-direction: column;
  }
  .article-main, .article-sidebar {
    flex: 1 1 100%;
  }
}

footer {
  background-color: #f8f8f8;
  padding: 20px;
  text-align: center;
  font-size: 14px;
  color: #666;
}

/* 标签列表在 footer 内部的样式 */
footer .tag-list {
  margin-bottom: 20px;
}
footer .tag-list h3 {
  margin-bottom: 12px;
  font-size: 16px;
  color: #333;
}
footer .tags {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-bottom: 10px;
}
footer .tags a {
  background-color: #e8f0fe;
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 14px;
  text-decoration: none;
  color: #0366d6;
  transition: background 0.3s;
}
footer .tags a:hover {
  background-color: #d0e2ff;
}
