/* ==========================================================================
   1. 基础重置与全局样式
   ========================================================================== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* 👉 【修改】让 HTML 撑满屏幕高度 */
html {
  font-size: 16px;
  height: 100%;
}

/* 👉 【修改】将 body 改为垂直 Flex 容器 */
body {
  font-family: "Noto Sans SC", "微软雅黑", sans-serif;
  line-height: 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%;
  height: 100%;           /* 确保撑满整个屏幕高度 */
  display: flex;          /* 开启弹性盒模型 */
  flex-direction: column;    /* 规定子元素从上往下垂直排列 */
}

/* 👉 【新增】网页主体内容自动扩展区域。如果内容不够多，它会拉伸来填满剩余屏幕，从而把页脚压到最下面 */
/* 提示：请确保 HTML 页面中处于导航栏和页脚之间的所有模块都用一个 <main> 标签包裹起来 */
main, .main-content {
  flex: 1 0 auto;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 15px;
}

/* ==========================================================================
   2. 导航栏与面包屑
   ========================================================================== */
.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);
}

.breadcrumb {
  background: #f5f5f5;
  padding: 12px 0;
  font-size: 0.85rem;
}

.breadcrumb a {
  color: #667eea;
  text-decoration: none;
}

.breadcrumb a:hover {
  text-decoration: underline;
}

/* ==========================================================================
   3. 页面头部与通用按钮
   ========================================================================== */
.term-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;
}

.term-header h1 {
  font-size: 2rem;
  margin-bottom: 15px;
  padding: 0 15px;
}

.term-header .term-origin {
  font-size: 1rem;
  background: rgba(255, 255, 255, 0.2);
  padding: 8px 15px;
  border-radius: 20px;
  display: inline-block;
}

.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);
}

/* ==========================================================================
   4. 核心内容布局区域（语言卡片、文章内容、图集、相关技术）
   ========================================================================== */
/* 多语言表述 */
.language-expressions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 15px;
  margin-bottom: 30px;
}

.language-card {
  background: #f9f9f9;
  border-radius: 10px;
  padding: 20px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
  text-align: center;
}

.language-card h3 {
  font-size: 1.3rem;
  margin-bottom: 12px;
  color: #667eea;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.language-card .expression {
  font-size: 1.1rem;
  font-weight: bold;
  margin: 10px 0;
  padding: 8px;
  background: white;
  border-radius: 8px;
}

.language-card .pronunciation {
  color: #666;
  font-size: 0.9rem;
  margin-top: 5px;
}

/* 内容文章区域与通用列表整合 */
.content-section {
  margin-bottom: 40px;
}

.content-section h2 {
  font-size: 1.7rem;
  margin-bottom: 15px;
  color: #667eea;
  border-bottom: 2px solid #667eea;
  padding-bottom: 8px;
}

.content-section p {
  font-size: 0.95rem;
  color: #555;
  margin-bottom: 15px;
}

/* 将文章内列表与底部重复定义的列表样式完美融合 */
.content-section ul,
.content-section ol,
.rack-element ul {
  padding-left: 20px;
  margin-left: 20px;
  margin-bottom: 15px;
  margin-top: 10px;
}

.content-section li,
.rack-element li {
  margin-bottom: 8px;
  font-size: 0.95rem;
  line-height: 1.5;
}

/* 图片展示区 */
.image-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
  margin-bottom: 30px;
}

.image-item {
  background: #f9f9f9;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
  transition: transform 0.3s ease;
}

.image-item:hover {
  transform: translateY(-5px);
}

.image-item img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  display: block;
}

.image-caption {
  padding: 15px;
  font-size: 0.9rem;
  color: #666;
  text-align: center;
}

/* 相关技术区域 */
.related-techniques {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 15px;
  margin-bottom: 30px;
}

.related-card {
  background: #f9f9f9;
  border-radius: 10px;
  padding: 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;
}

.related-card:hover {
  background: #667eea;
  color: white;
  transform: translateY(-5px);
}

.related-card h4 {
  font-size: 1.1rem;
  margin-bottom: 5px;
}

/* ==========================================================================
   5. 特殊网格与组件（RACK元素、流程步骤、对比表格）
   ========================================================================== */
/* RACK网格布局 */
.rack-elements {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(20%, 1fr));
  gap: 20px;
  margin-top: 20px;
}

.rack-element {
  background: #f8f9fa;
  border-radius: 10px;
  padding: 20px;
  border-left: 3px solid #667eea;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.08);
}

.element-icon {
  font-size: 1.2rem;
  color: #667eea;
  margin-bottom: 15px;
}

.element-en {
  font-size: 0.9rem;
  color: #666;
  font-weight: normal;
  font-style: italic;
}

/* 流程图组件 */
.rack-flowchart {
  margin-top: 20px;
}

.flow-step {
  background: white;
  border-radius: 10px;
  padding: 10px;
  margin-bottom: 2px;
  display: flex;
  align-items: center;
  border: 2px solid #e9ecef;
  position: relative;
}

.step-number {
  background: #667eea;
  color: white;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  font-size: 1rem;
  margin-right: 20px;
  flex-shrink: 0;
}

.step-content {
  flex-grow: 1;
}

.step-content h4 {
  color: #333;
  margin-bottom: 5px;
}

/* 👉 【融合补全】整合了后半部分关于流程步骤描述文字的样式 */
.step-content p {
  color: #666;
  font-size: 0.9rem;
}

.step-arrow {
  color: #667eea;
  font-size: 1rem;
  margin-left: 20px;
}

/* 对比表格 */
.comparison-table {
  overflow-x: auto;
  margin-top: 20px;
}

.comparison-table table {
  width: 100%;
  border-collapse: collapse;
  background: white;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.08);
}

.comparison-table th {
  background: #667eea;
  color: white;
  padding: 15px;
  text-align: left;
  font-weight: 600;
}

.comparison-table td {
  padding: 15px;
  border-bottom: 1px solid #e9ecef;
}

.comparison-table tr:nth-child(even) {
  background: #f8f9fa;
}

/* ==========================================================================
   6. 页脚页尾
   ========================================================================== */
/* 👉 【修改】优化页脚核心基础定义 */
.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;
}

/* ==========================================================================
   7. 响应式媒体查询（从大屏幕到小屏幕严格排序，防止乱序覆盖）
   ========================================================================== */
/* 平板与小屏幕电脑 */
@media (max-width: 992px) {
  html {
    font-size: 15px;
  }
  .term-header h1 {
    font-size: 2rem;
  }
  .language-expressions {
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  }
  .image-gallery {
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  }
}

/* 手机横屏或大屏手机 */
@media (max-width: 768px) {
  html {
    font-size: 14px;
  }
  .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;
  }
  .term-header {
    padding: 25px 0;
  }
  .term-header h1 {
    font-size: 1.8rem;
  }
  .language-expressions {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  .language-card {
    padding: 15px;
  }
  .language-card h3 {
    font-size: 1.2rem;
  }
  .content-section h2 {
    font-size: 1.5rem;
  }
  .image-gallery {
    grid-template-columns: 1fr;
    gap: 15px;
  }
  .image-item img {
    height: 180px;
  }
  .related-techniques {
    grid-template-columns: repeat(2, 1fr);
  }

  /* RACK与组件响应式 */
  .rack-elements {
    grid-template-columns: 1fr;
  }
  .flow-step {
    flex-direction: column;
    text-align: center;
    padding: 15px;
  }
  .step-number {
    margin-right: 0;
    margin-bottom: 15px;
  }
  .step-arrow {
    margin-left: 0;
    margin-top: 10px;
    transform: rotate(90deg); /* 在移动端箭头自动向下转动 */
  }
}

/* 标准手机屏幕 */
@media (max-width: 576px) {
  html {
    font-size: 13px;
  }
  .container {
    padding: 0 10px;
  }
  .nav-links a {
    font-size: 0.8rem;
    padding: 3px 6px;
  }
  .term-header h1 {
    font-size: 1.6rem;
    padding: 0 10px;
  }
  .content-section h2 {
    font-size: 1.4rem;
  }
  .image-item img {
    height: 160px;
  }
  .related-techniques {
    grid-template-columns: 1fr;
  }
  .footer-links {
    gap: 15px;
  }
}

/* 微型手机屏幕 */
@media (max-width: 360px) {
  html {
    font-size: 12px;
  }
  .nav-links {
    flex-direction: column;
    align-items: center;
  }
  .nav-links a {
    font-size: 0.85rem;
  }
  .term-header h1 {
    font-size: 1.4rem;
  }
}
