/*
 * 样式文件：style.css
 * 作用：控制页面的所有外观（颜色、布局、动画、按钮样式等）
 */

/* 全局样式重置（核心） */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: -apple-system, BlinkMacSystemFont, "微软雅黑", sans-serif;
}

/* CSS变量（新手友好：改一处全页面生效） */
:root {
  /* 背景色变量 */
  --bg-main: #e9ecef;
  --bg-card: #ffffff;
  /* 文字颜色变量 */
  --text-title: #1d1d1f;
  --text-body: #6e6e73;
  --text-light: #86868b;
  /* 其他基础变量 */
  --shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
  --divider-color: #e5e5e5;

  /* 按钮颜色变量 */
  --btn-blue: #007aff;
  --btn-green: #34c759;
  --btn-orange: #ff9500;
  --btn-teal: #5ac8fa;
  --btn-purple: #9c27b0;
  --btn-gradient: linear-gradient(to right, #007aff, #5ac8fa);

  /* 按钮尺寸变量 */
  --btn-radius: 8px;
  --btn-padding: 12px;
  --btn-font-size: 15px;
  --btn-gap: 10px;
  --btn-height: 44px;
  --section-side-margin: 15px;
  /* 导航栏高度变量 */
  --navbar-height: 56px;
}

/* 动画定义：fadeUp（淡入+向上移动） */
@keyframes fadeUp {
  0% {
    opacity: 0;
    transform: translateY(20px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

/* 页面主体样式 */
body {
  background-color: var(--bg-main);
  padding: 20px 0;
}

/* 容器样式（限制页面最大宽度，居中显示） */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--section-side-margin);
}

/* 顶部导航栏核心样式 */
.navbar {
  background-color: var(--bg-card);
  border-radius: 16px;
  box-shadow: var(--shadow);
  margin: 0 auto 20px;
  padding: 0 20px;
  animation: fadeUp 0.6s ease forwards;
  opacity: 0;
  animation-delay: 0.05s;
  max-width: 1140px;
}

/* 导航列表样式（横向排列） */
.nav-list {
  list-style: none;
  display: flex;
  justify-content: center;
  align-items: center;
  height: var(--navbar-height);
  gap: 0;
}

/* 导航选项样式 */
.nav-item {
  flex: 0 1 auto;
}

/* 导航链接核心样式 */
.nav-link {
  display: inline-block;
  padding: 10px 30px;
  color: var(--text-title);
  font-size: 16px;
  text-decoration: none;
  border-radius: var(--btn-radius);
  transition: all 0.2s ease;
  white-space: nowrap;
}

/* 导航链接hover效果 */
.nav-link:hover {
  background: rgba(0, 0, 0, 0.08);
  transform: scale(1.02);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

/* 导航链接选中状态 */
.nav-link.active {
  background-color: var(--btn-blue);
  color: #fff;
}

/* 选中状态hover效果 */
.nav-link.active:hover {
  background-color: #0066cc;
  transform: scale(1.03);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

/* 头部区域样式 */
.header {
  background-color: #FFFFFF;
  color: var(--text-title);
  text-align: center;
  padding: 25px;
  border-radius: 16px;
  box-shadow: var(--shadow);
  margin: 0 auto 20px;
  max-width: 1140px;
  position: relative;
  overflow: hidden;
  animation: fadeUp 0.6s ease forwards;
  opacity: 0;
  animation-delay: 0.1s;
}

/* 头部标题样式 */
.header h1 {
  font-size: 36px;
  margin-bottom: 8px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
}

/* 头部标题里的图标样式 */
.header h1 .h1-icon {
  width: 1em !important;
  height: 1em !important;
  object-fit: cover;
  vertical-align: middle;
  margin-right: 8px;
  border-radius: 12px !important;
}

/* 头部副标题样式 */
.header p {
  font-size: 18px;
  margin-bottom: 12px;
  color: var(--text-body);
}

/* 头部按钮组容器（社交按钮：QQ/远程服务/手机卡） */
.header-buttons {
  display: flex;
  justify-content: center;
  gap: 0 !important; /* 关键：取消容器间距，避免与按钮margin叠加 */
  flex-wrap: wrap;
  padding: 0 10px;
}

/* 头部社交按钮样式（QQ/远程服务/手机卡） */
.header .social-box {
  background: rgba(0, 0, 0, 0.08);
  color: var(--text-title);
  padding: 8px 18px;
  border-radius: 20px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 16px;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
  margin: 0 3px 8px; /* 关键：缩小左右margin，让间距更紧凑（原5px→3px） */
}

/* 社交按钮hover效果 */
.header .social-box:hover {
  background: rgba(0, 0, 0, 0.15);
  transform: scale(1.02);
}

/* 社交按钮图标（与文字同大小，修复间距+防止压缩） */
.social-icon {
  width: 1em !important;
  height: 1em !important;
  object-fit: cover;
  border-radius: 4px !important;
  margin-right: 6px !important; /* 新增：图标与文字的间距 */
  flex-shrink: 0 !important; /* 新增：防止图标被压缩 */
}

/* 行容器（横向排列多个分区） */
.row {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

/* 通用分区样式 */
.section {
  background: var(--bg-card);
  border-radius: 16px;
  padding: 20px;
  box-shadow: var(--shadow);
  flex: 1 1 300px;
  animation: fadeUp 0.6s ease forwards;
  opacity: 0;
  display: flex;
  flex-direction: column;
  margin: 0 var(--section-side-margin);
}

/* 资源区域动画延迟 */
.resource-section {
  animation-delay: 0.2s;
}

/* 分区标题样式 */
.section-title {
  font-size: 19px;
  color: var(--text-title);
  margin-bottom: 15px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--divider-color);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.5);
}

/* 分区标题前的图标（伪元素） */
.section-title::before {
  content: "";
  display: inline-block;
  width: 22px;
  height: 22px;
  background-size: cover;
  opacity: 0.8;
  filter: invert(18%) sepia(0%) saturate(0%) hue-rotate(90deg) brightness(95%) contrast(90%);
}

/* 资源列表分区标题图标 */
.resource-section .section-title::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='22' height='22' viewBox='0 0 24 24' fill='none' stroke='%23555555' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4'%3E%3C/path%3E%3Cpolyline points='7 10 12 15 17 10'%3E%3C/polyline%3E%3Cline x1='12' y1='15' x2='12' y2='3'%3E%3C/line%3E%3C/svg%3E");
}

/* 资源列表容器：默认单列，电脑端双列 */
.resource-list {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  gap: 20px;
  margin-top: 10px;
}

/* 单个资源项 */
.resource-item {
  flex: 0 0 100%; /* 手机端单列 */
  background: #f5f5f7;
  border-radius: 12px;
  padding: 15px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* 电脑端（屏幕宽度≥992px）：双列排列 */
@media (min-width: 992px) {
  .resource-item {
    flex: 0 0 calc(50% - 10px);
  }
}

/* 资源项头部（图片+标题+时间） */
.resource-header {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: nowrap;
}

/* 资源图片：自适应尺寸，保留圆角 */
.resource-img {
  max-width: 100px !important;
  max-height: 80px !important;
  width: auto !important;
  height: auto !important;
  object-fit: contain !important;
  border-radius: 8px !important;
}

/* 资源信息（标题+时间） */
.resource-info {
  flex: 1;
}

/* 资源标题 */
.resource-title {
  font-size: 18px;
  color: var(--text-title);
  margin-bottom: 4px;
}

/* 资源时间 */
.resource-time {
  font-size: 14px;
  color: var(--text-light);
}

/* 分割线 */
.divider {
  height: 1px;
  background-color: var(--divider-color);
  width: 100%;
}

/* 详情图片：自适应尺寸 */
.resource-detail-img {
  width: 100% !important;
  max-height: 300px !important;
  height: auto !important;
  object-fit: contain !important;
  border-radius: 8px !important;
}

/* 文字简介 */
.resource-desc {
  background: rgba(0, 0, 0, 0.05);
  padding: 12px;
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.resource-desc p {
  font-size: 14px;
  color: var(--text-body);
}

/* 按钮组容器样式 */
.btn-group {
  display: flex;
  gap: var(--btn-gap);
  margin-top: 15px;
  width: 100%;
}

/* 资源项按钮组 */
.resource-btn-group {
  margin-top: 8px;
}

/* 通用按钮样式 */
.btn-group .btn {
  flex: 1;
  padding: var(--btn-padding);
  border: none;
  border-radius: var(--btn-radius);
  color: #fff;
  font-size: var(--btn-font-size);
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  height: var(--btn-height);
  min-width: 0;
}

/* 按钮hover效果 */
.btn:hover {
  transform: scale(1.03);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

/* 跳转按钮 */
.btn-jump {
  background: var(--btn-teal);
}

.btn-jump:hover {
  background: #4aa8e0;
}

/* 下载按钮 */
.btn-download {
  background: var(--btn-blue);
}

.btn-download:hover {
  background: #0066cc;
}

/* 下载小图标样式 */
.icon-download {
  display: inline-block;
  width: 16px;
  height: 16px;
  margin-right: 6px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4'%3E%3C/path%3E%3Cpolyline points='7 10 12 15 17 10'%3E%3C/polyline%3E%3Cline x1='12' y1='15' x2='12' y2='3'%3E%3C/line%3E%3C/svg%3E");
  background-size: cover;
  vertical-align: middle;
}

/* 页脚样式 */
.footer {
  text-align: center;
  color: var(--text-light);
  font-size: 14px;
  margin-top: 15px;
  animation: fadeUp 0.6s ease forwards;
  opacity: 0;
  animation-delay: 0.6s;
  padding: 0 var(--section-side-margin);
}

/* 响应式样式（手机端适配：屏幕宽度≤768px时生效） */
@media (max-width: 768px) {
  /* 手机端分区占满整行，补全原有语法错误 */
  .section {
    flex: 1 1 100%;
    margin-bottom: 20px; /* 补全：原代码只写了2，缺少单位和数值 */
  }
  /* 手机端头部按钮适配：更小的间距和字体 */
  .header-buttons {
    gap: 0 !important;
  }
  .header .social-box {
    padding: 8px 12px; /* 缩小内边距 */
    font-size: 14px; /* 缩小字体 */
    margin: 0 2px 8px; /* 进一步缩小左右margin */
  }
  /* 手机端社交图标适配 */
  .social-icon {
    width: 1em !important;
    height: 1em !important;
  }
}
