/* 基础重置 */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* 👉 【修改】让 HTML 撑满屏幕高度，为 body 提供计算基准 */
html {
  font-size: 16px;
  height: 100%;
}

/* 👉 【修改】将 body 改为垂直 Flexbox 容器 */
body {
  font-family: "Noto Sans SC", "微软雅黑", sans-serif;
  line-height: 1.6;
  color: #333;
  -webkit-text-size-adjust: 100%;
  -moz-text-size-adjust: 100%;
  -ms-text-size-adjust: 100%;
  text-size-adjust: 100%;
  background: #f8f9fa;
  height: 100%; /* 撑满高度 */
  display: flex; /* 开启 Flex 布局 */
  flex-direction: column; /* 设置子元素为从上往下排列 */
}

/* 👉 【新增】主体内容自动拉伸。只要内容少，它会伸展并把底部的页脚推下去 */
/* 提示：请确保你 HTML 页面中的主体区域（除去导航栏和页脚的部分）使用了 <main> 标签或加上 class="main-content" */
main,
.main-content {
  flex: 1 0 auto;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 15px;
}

/* 导航样式 */
.navbar {
  background: #667eea;
  padding: 12px 0;
  position: sticky;
  top: 0;
  z-index: 1000;
}

.navbar .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  font-size: 1.2rem;
  font-weight: bold;
  color: white;
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-links {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.nav-links a {
  color: white;
  text-decoration: none;
  font-size: 0.9rem;
  padding: 5px 10px;
  border-radius: 5px;
}

.nav-links a:hover,
.nav-links a.active {
  background: rgba(255, 255, 255, 0.2);
}

/* 技术分类页头 */
.techniques-header {
  background: linear-gradient(
    135deg,
    rgba(102, 126, 234, 0.9) 0%,
    rgba(118, 75, 162, 0.9) 100%
  );
  color: white;
  padding: 30px 0;
  margin-bottom: 30px;
  text-align: center;
}

.techniques-header h1 {
  font-size: 2rem;
  margin-bottom: 12px;
  padding: 0 15px;
}

.techniques-header p {
  font-size: 1rem;
  max-width: 800px;
  margin: 0 auto;
  opacity: 0.95;
  padding: 0 15px;
}

/* 面包屑导航 */
.breadcrumb {
  background: #f5f5f5;
  padding: 12px 0;
  font-size: 0.85rem;
}

.breadcrumb a {
  color: #667eea;
  text-decoration: none;
}

.breadcrumb a:hover {
  text-decoration: underline;
}

/* 子分类导航 */
.subcategory-nav {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 15px;
  margin-bottom: 30px;
}

.subcategory-card {
  background: #f9f9f9;
  border-radius: 10px;
  padding: 20px 15px;
  text-align: center;
  text-decoration: none;
  color: #333;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
  border: 2px solid transparent;
}

.subcategory-card:hover,
.subcategory-card.active {
  transform: translateY(-5px);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
  border-color: #667eea;
}

.subcategory-card div {
  font-size: 2rem;
  margin-bottom: 12px;
}

.subcategory-card h3 {
  font-size: 1.2rem;
  margin-bottom: 8px;
  color: #667eea;
}

.subcategory-card p {
  font-size: 0.85rem;
  color: #666;
}

/* 技术术语列表 */
.techniques-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 20px;
  margin-bottom: 40px;
}

.technique-card {
  background: #f9f9f9;
  border-radius: 10px;
  padding: 20px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
}

.technique-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.15);
}

.technique-card h3 {
  font-size: 1.3rem;
  margin-bottom: 12px;
  color: #667eea;
  border-bottom: 2px solid #eee;
  padding-bottom: 8px;
}

.technique-card p {
  font-size: 0.9rem;
  color: #666;
  margin-bottom: 12px;
}

.technique-meta {
  display: flex;
  gap: 12px;
  font-size: 0.8rem;
  color: #888;
  margin-top: 8px;
}

.technique-meta span {
  display: flex;
  align-items: center;
  gap: 5px;
}

/* 技术详情区 */
.technique-detail {
  background: #f9f9f9;
  border-radius: 10px;
  padding: 25px;
  margin-bottom: 30px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.technique-detail h2 {
  font-size: 1.7rem;
  margin-bottom: 12px;
  color: #333;
  border-bottom: 2px solid #667eea;
  padding-bottom: 8px;
}

.technique-detail h3 {
  font-size: 1.2rem;
  margin: 20px 0 8px;
  color: #667eea;
}

.technique-detail ul,
.technique-detail ol {
  margin-left: 20px;
  margin-bottom: 12px;
}

.technique-detail li {
  margin-bottom: 6px;
  font-size: 0.9rem;
}

/* 👉 【修改】优化页脚样式 */
.footer {
  background: #333;
  color: white;
  text-align: center;
  padding: 25px 0;
  /* margin-top: 40px; */ /* 移除固定边距，完全交由 flex 控制 */
  flex-shrink: 0; /* 核心属性：确保页脚在内容极多的长页面里不会被挤压变形 */
}

.footer-links {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-bottom: 15px;
  flex-wrap: wrap;
}

.footer-links a {
  color: #ddd;
  text-decoration: none;
  font-size: 0.9rem;
}

.footer-links a:hover {
  color: white;
  text-decoration: underline;
}

.footer p {
  font-size: 0.9rem;
  margin-top: 10px;
}

.back-button {
  display: inline-block;
  background: #667eea;
  color: white;
  text-decoration: none;
  padding: 10px 20px;
  border-radius: 25px;
  font-weight: 500;
  margin: 20px 0;
  transition: all 0.3s ease;
}

.back-button:hover {
  background: #5a6fd8;
  transform: translateX(-3px);
}

/* 响应式调整 */
@media (max-width: 992px) {
  html {
    font-size: 16px;
  }

  .subcategory-nav {
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 12px;
  }

  .techniques-header h1 {
    font-size: 1.8rem;
  }

  .techniques-header p {
    font-size: 0.95rem;
  }
}

@media (max-width: 768px) {
  html {
    font-size: 15px;
  }

  .techniques-header {
    padding: 25px 0;
  }

  .techniques-header h1 {
    font-size: 1.6rem;
  }

  .techniques-header p {
    font-size: 0.9rem;
  }

  .subcategory-nav {
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  }

  .subcategory-card div {
    font-size: 1.8rem;
  }

  .subcategory-card h3 {
    font-size: 1.1rem;
  }

  .subcategory-card p {
    font-size: 0.8rem;
  }

  .techniques-list {
    grid-template-columns: 1fr;
    gap: 15px;
  }

  .technique-card {
    padding: 15px;
  }

  .technique-card h3 {
    font-size: 1.2rem;
  }

  .technique-card p {
    font-size: 0.85rem;
  }

  .technique-detail {
    padding: 20px;
  }

  .technique-detail h2 {
    font-size: 1.5rem;
  }

  .technique-detail h3 {
    font-size: 1.1rem;
  }

  .navbar .container {
    flex-direction: column;
    gap: 10px;
  }

  .nav-links {
    gap: 8px;
  }

  .nav-links a {
    font-size: 0.85rem;
    padding: 4px 8px;
  }

  .logo {
    font-size: 1.1rem;
  }

  section h2 {
    font-size: 1.5rem !important;
    margin-bottom: 20px !important;
  }
}

@media (max-width: 576px) {
  html {
    font-size: 13px;
  }

  .techniques-header h1 {
    font-size: 1.4rem;
  }

  .subcategory-nav {
    grid-template-columns: repeat(2, 1fr);
  }

  .subcategory-card {
    padding: 15px 10px;
  }

  .subcategory-card div {
    font-size: 1.6rem;
  }

  .subcategory-card h3 {
    font-size: 1.3rem;
  }

  .technique-detail {
    padding: 15px;
  }

  .technique-detail h2 {
    font-size: 1.3rem;
  }

  .technique-detail h3 {
    font-size: 1rem;
  }

  .nav-links a {
    font-size: 0.8rem;
    padding: 3px 6px;
  }

  .container {
    padding: 0 10px;
  }

  .footer-links {
    gap: 15px;
  }

  .footer-links a {
    font-size: 0.85rem;
  }
}

@media (max-width: 360px) {
  html {
    font-size: 13px;
  }

  .techniques-header h1 {
    font-size: 1.4rem;
  }

  .subcategory-nav {
    grid-template-columns: 1fr;
  }

  .nav-links {
    align-items: center;
  }

  .nav-links a {
    font-size: 0.8rem;
    padding: 3px 6px;
  }
}
