/* ==========================================================================
   1. 基础重置与全局样式
   ========================================================================== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: 16px;
}

body {
  /* 融合了：微软雅黑和Noto Sans SC字体，保留了背景色，加入了防iOS自动调整字体 */
  font-family: "Noto Sans SC", "微软雅黑", "Helvetica Neue", Arial, sans-serif;
  line-height: 1.5; /* 采用 index.html 的 1.5 */
  color: #333;
  background-color: #f8f9fa;
  -webkit-text-size-adjust: 100%;
  -moz-text-size-adjust: 100%;
  -ms-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 15px; /* 采用 index.html 的 15px，兼顾移动端 */
}

/* ==========================================================================
   2. 导航栏样式 (Navbar)
   ========================================================================== */
.navbar {
  /* 融合：index.html 中纯色背景覆盖了渐变，内边距采用 12px 0 */
  background: #667eea;
  padding: 12px 0;
  position: sticky;
  top: 0;
  z-index: 1000;
}

.navbar .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  /* 融合：加入了 index.html 的小字号以及 flex 布局（带间距） */
  font-size: 1.2rem;
  font-weight: bold;
  color: white;
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-links {
  /* 引入 index.html 新增的弹性盒及换行布局 */
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.nav-links a {
  color: white;
  text-decoration: none;
  font-size: 0.9rem; /* 采用 index.html 的 0.9rem */
  padding: 5px 10px; /* 采用 index.html 的按钮式内边距 */
  border-radius: 5px;
  transition: opacity 0.3s;
}

.nav-links a:hover {
  opacity: 0.8;
}

.nav-links a:hover,
.nav-links a.active {
  /* 融合 index.html：高亮或悬停时加入半透明白底 */
  background: rgba(255, 255, 255, 0.2);
}

/* ==========================================================================
   3. 页头与巨幕样式 (Header / Hero)
   ========================================================================== */
/* 旧版纯文字页头 */
.header {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 60px 0;
  text-align: center;
  margin-bottom: 40px;
}

.header h1 {
  font-size: 3rem;
  margin-bottom: 15px;
}

.header p {
  font-size: 1.3rem;
  max-width: 800px;
  margin: 0 auto;
}

/* 新版图文带搜索框的巨幕区 */
.hero-section {
  background:
    linear-gradient(
      135deg,
      rgba(102, 126, 234, 0.9) 0%,
      rgba(118, 75, 162, 0.9) 100%
    ),
    url("assets/images/hero-bg.jpg") center/cover no-repeat;
  color: white;
  padding: 40px 0;
  text-align: center;
  margin-bottom: 30px;
}

.hero-title {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 15px;
  text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.2);
}

.hero-subtitle {
  font-size: 1rem;
  max-width: 800px;
  margin: 0 auto 20px;
  line-height: 1.5;
  opacity: 0.95;
}

/* 搜索框组件 */
.search-box {
  max-width: 500px;
  margin: 20px auto;
  position: relative;
}

.search-box input {
  width: 100%;
  padding: 12px 15px;
  padding-left: 45px;
  border: none;
  border-radius: 25px;
  font-size: 0.95rem;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
}

.search-box i {
  position: absolute;
  left: 15px;
  top: 50%;
  transform: translateY(-50%);
  color: #667eea;
  font-size: 1rem;
}

/* ==========================================================================
   4. 分类导航卡片样式
   ========================================================================== */
.category-nav {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 15px; /* 采用 index.html 的 15px 间距 */
  margin: 30px 0; /* 采用 index.html 的 30px 边距 */
}

.category-card {
  background: white;
  border-radius: 12px; /* 采用 index.html 的 12px 圆角 */
  padding: 20px 15px; /* 采用 index.html 的紧凑内边距 */
  text-align: center;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.08);
  transition: all 0.3s ease;
  text-decoration: none;
  color: inherit;
  display: block;
  border: 2px solid transparent;
}

.category-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.12);
  border-color: #667eea; /* 融合：hover时增加紫色边框 */
}

/* 旧版卡片图标 */
.category-card i {
  font-size: 2.5rem;
  margin-bottom: 15px;
  color: #667eea;
}

/* 新版卡片独立图标样式 */
.category-icon {
  font-size: 2rem;
  margin-bottom: 10px;
  display: block;
}

.category-card h3 {
  font-size: 1.2rem; /* 采用 index.html 的 1.2rem */
  margin-bottom: 8px;
  color: #333;
}

/* 新版卡片说明文字 */
.category-card p {
  color: #666;
  font-size: 0.85rem;
  line-height: 1.4;
}

/* ==========================================================================
   5. 数据统计与快捷链接 (新版独有)
   ========================================================================== */
/* 统计区块 */
.statistics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 15px;
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
  border-radius: 12px;
  padding: 20px;
  margin: 30px 0;
}

.stat-item {
  text-align: center;
}

.stat-number {
  font-size: 1.8rem;
  font-weight: 700;
  color: #667eea;
  display: block;
}

.stat-label {
  color: #666;
  font-size: 0.85rem;
  margin-top: 5px;
}

/* 快捷链接区块 */
.quick-links {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 15px;
  margin: 30px 0;
}

.quick-link {
  background: white;
  padding: 15px;
  border-radius: 10px;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.05);
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: inherit;
  transition: all 0.2s;
}

.quick-link:hover {
  transform: translateX(3px);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.quick-link i {
  font-size: 1.5rem;
  color: #667eea;
}

.quick-link h4 {
  font-size: 1rem;
  margin-bottom: 3px;
  color: #333;
}

.quick-link p {
  color: #666;
  font-size: 0.8rem;
}

/* ==========================================================================
   6. 术语卡片样式 (Term Card)
   ========================================================================== */
.term-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px; /* 采用 index.html 的 20px */
  margin: 40px 0;
}

.term-card {
  background: white;
  border-radius: 10px; /* 采用 index.html 的 10px */
  padding: 20px; /* 采用 index.html 的 20px */
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.05); /* 采用 index.html 的浅阴影 */
  transition: all 0.3s;
}

.term-card:hover {
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
}

.term-card h3 {
  font-size: 1.3rem; /* 采用 index.html 的 1.3rem */
  color: #333; /* 采用 index.html 的颜色，若要沿用原蓝色可自行改为 #667eea */
  margin-bottom: 10px;
  padding-bottom: 10px;
  border-bottom: 2px solid #f0f0f0;
}

.term-card p {
  font-size: 0.9rem; /* 采用 index.html 的 0.9rem */
  color: #666;
  margin-bottom: 10px;
}

/* 标签样式 (新版) */
.tag {
  background: #4caf50;
  color: white;
  padding: 3px 8px;
  border-radius: 15px;
  font-size: 0.75rem;
}

/* ==========================================================================
   7. 页脚样式 (Footer)
   ========================================================================== */
.footer {
  /* 融合：背景变为了 #333 纯黑灰，内边距和外边距按 index.html 进行了轻量化 */
  background: #333;
  color: white;
  text-align: center; /* 新增了整体居中 */
  padding: 25px 0;
  margin-top: 40px;
}

/* 用于多列展示的旧版容器（保留以防多页面共用） */
.footer .container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 30px;
}

.footer h4 {
  font-size: 1.1rem; /* 采用 index.html 的小标题 */
  margin-bottom: 10px;
}

.footer a {
  color: #bdc3c7;
  text-decoration: none;
  font-size: 0.85rem; /* 采用 index.html 的大小 */
  display: block;
  margin-bottom: 5px;
}

.footer a:hover {
  color: white;
}

.copyright {
  margin-top: 5px;
  font-size: 0.85rem;
  color: #bdc3c7;
}


/* ==========================================================================
   8. 锚点跳转优化与特殊定义
   ========================================================================== */
#categories {
  /* 防止导航栏遮挡住跳转后的标题 */
  scroll-margin-top: 40px !important;
}

/* ==========================================================================
   9. 响应式设计 (Media Queries)
   ========================================================================== */
@media (max-width: 768px) {
  html {
    font-size: 15px;
  }
  .header h1 {
    font-size: 2.2rem;
  }
  .header p {
    font-size: 1.1rem;
  }

  /* 融合自 index.html 的移动端优化 */
  .hero-title {
    font-size: 1.8rem;
    padding: 0 10px;
  }
  .hero-subtitle {
    font-size: 0.95rem;
    padding: 0 10px;
  }
  .category-nav {
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 10px;
  }
  .category-card {
    padding: 15px 10px;
  }
  .category-card h3 {
    font-size: 1.1rem;
  }
  .category-card p {
    font-size: 0.8rem;
  }
  .statistics {
    grid-template-columns: repeat(2, 1fr);
    padding: 15px;
    gap: 10px;
  }
  .stat-number {
    font-size: 1.5rem;
  }
  .stat-label {
    font-size: 0.8rem;
  }
  .term-list {
    grid-template-columns: 1fr;
    gap: 15px;
  }
  .term-card {
    padding: 15px;
  }
  .term-card h3 {
    font-size: 1.2rem;
  }
  .term-card p {
    font-size: 0.85rem;
  }
  .quick-links {
    grid-template-columns: 1fr;
  }
  .nav-links {
    gap: 8px;
  }
  .nav-links a {
    font-size: 0.9rem;
    padding: 4px 8px;
    margin-left: 0;
  }
  .logo {
    font-size: 1.2rem;
    gap: 8px;
  }
  section h2 {
    font-size: 1.5rem !important;
    margin: 30px 0 20px !important;
  }
}

@media (max-width: 480px) {
  html {
    font-size: 14px;
  }
  .hero-title {
    font-size: 1.6rem;
  }
  .hero-section {
    padding: 30px 0;
  }
  .category-nav {
    grid-template-columns: 1fr;
  }
  .statistics {
    grid-template-columns: repeat(2, 1fr);
  }
  .navbar .container {
    flex-direction: column;
    gap: 10px;
  }
  .search-box input {
    padding: 10px 12px;
    padding-left: 40px;
    font-size: 0.9rem;
  }
  .container {
    padding: 0 10px;
  }
  section h2 {
    font-size: 1.4rem !important;
  }
  .category-card h3 {
    font-size: 1.1rem;
  }
}

@media (max-width: 360px) {
  html {
    font-size: 13px;
  }
  .hero-title {
    font-size: 1.4rem;
  }
  .category-icon {
    font-size: 1.8rem;
  }
  .stat-number {
    font-size: 1.3rem;
  }
  .nav-links a {
    font-size: 0.8rem;
    padding: 3px 6px;
  }
}
