/* ------------------------------------------- */
/* 1. 基础和重置样式 */
/* ------------------------------------------- */
body {
  /* font-family: Arial, sans-serif; */
  overflow-x: hidden;
  margin: 0;
  padding: 0;
  scroll-behavior: smooth;
  color: #333;
}
a {
  text-decoration: none;
  color: inherit;
}
*,
*::before,
*::after {
  box-sizing: border-box;
}
h1,
h2,
h3,
h4,
h5,
h6,
p,
span {
  user-select: none;
}
.container {
  width: 90%;
  max-width: 75rem;
  margin: 0 auto;
  padding: 0 2rem;
}

:root {
  /* 默认高度为 100vh，防止 JS 失败时页面错乱 */
  --page-height: 100vh;
  /* 全局颜色变量  */
  --color-primary: #1d293b; /* 品牌色  */
  --color-btn: #2563ec;
  --color-secondary: #314254; /* 次要色  */
  --color-text: #242a3e; /* 主文本色  */
  --color-background: #ffffff; /* 浅背景色  */
  --color-white: #f9fafe; /* 卡片背景色和部分文字颜色  */
  --header-height: 4.375rem;
}

/*按钮基础和主次样式 */
.btn {
  display: inline-block;
  padding: 0.75rem 1.5625rem;
  font-weight: 600;
  text-align: center;
  border-radius: 0.25rem;
  transition: all 0.3s ease;
  text-decoration: none;
  cursor: pointer;
  margin-right: 0.9375rem;
}

/* 主按钮样式 */
.btn-primary {
  background-color: var(--color-btn);
  color: var(--color-white);
  border: 0.125rem solid var(--color-btn);
}

.btn-primary:hover {
  background-color: var(--color-secondary);
  border-color: var(--color-secondary);
}

/* 次按钮样式 */
.btn-secondary {
  background-color: var(--color-secondary);
  color: var(--color-white);
  border: 0.125rem solid var(--color-secondary);
}

.btn-secondary:hover {
  background-color: var(--color-primary);
  color: var(--color-white);
}

section {
  /* 导航栏高度为 70px。这里的高度是动态计算的：设备高度 - 导航栏高度 */
  min-height: var(--page-height);
  height: var(--page-height); /* 确保完全占满 */

  padding: 0; /* 移除固定的 padding，让内容居中 */

  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  background-color: var(--color-primary);
}

/* 针对第一屏 (#home) 覆盖其高度 */
#home {
  /* 第一屏需要填满整个视窗，因为它的顶部从 0 开始 */
  min-height: 100vh;
  height: 100vh;

  /* 并且需要留出 70px 的空间给固定导航栏，将内容推下去 */
  padding-top: 4.375rem;
}

/* 恢复内容区的 padding，确保内容不贴边 */
section .container {
  padding-top: 3.125rem;
  padding-bottom: 3.125rem;
}

/* ------------------------------------------- */
/* 2. 导航栏 (Header/Navbar) - 桌面版默认样式 */
/* ------------------------------------------- */
#header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  /* background-color: var(--color-primary); */
  background-color: var(--color-background);
  box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.1);
  height: 4.375rem;
  z-index: 1000;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 5%;
}
.logo {
  width: 16.25rem;
  height: 3.75rem;
  background: url(/images/logo.db97f16d705f98be51a2.png) no-repeat;
  background-position: left;
  background-size: 16.25rem 3.75rem;
}
.logo a {
  font-size: 1.5rem;
  font-weight: bold;
  color: var(--color-white);
}

/* 桌面导航链接容器 */
.nav ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
}
.nav ul li {
  margin-left: 1.875rem;
}
.nav ul li a {
  color: var(--color-secondary);
  font-size: 1rem;
  padding: 0.3125rem 0;
  transition: color 0.3s, border-bottom 0.3s; /* 增加 border-bottom 过渡 */
  border-bottom: 0.125rem solid transparent; /* 默认透明边框 */
}
.nav ul li a:hover {
  color: var(--color-secondary);
}

/* 导航项高亮样式 */
.nav ul li a.current {
  color: var(--color-primary); /* 高亮颜色 */
  font-weight: bold;
  border-bottom: 0.125rem solid #4f6b87; /* 底部强调线 */
}

/* ------------------------------------------- */
/* 3. 汉堡包菜单按钮 (Hamburger Menu CSS) */
/* ------------------------------------------- */

/* 默认隐藏汉堡包按钮 */
.menu-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.9375rem 0.625rem; /* 增加点击区域 */
  z-index: 1010;
  position: relative; /* 确保 z-index 在导航链接之上 */
}

/* 中间那根杠 */
.hamburger-icon {
  display: block;
  width: 1.5625rem;
  height: 0.1875rem;
  background-color: var(--color-primary);
  position: relative;
  transition: background-color 0.3s;
}

/* 上下两根杠（伪元素） */
.hamburger-icon::before,
.hamburger-icon::after {
  content: "";
  position: absolute;
  width: 100%;
  height: 0.1875rem;
  background-color: var(--color-primary);
  /* 修复对齐问题的关键：使用负值和百分比定位 */
  left: 0;
  transition: transform 0.3s, top 0.3s;
}

/* 调整上下杠的垂直间距 */
.hamburger-icon::before {
  top: -0.5rem;
}
.hamburger-icon::after {
  top: 0.5rem;
}

/* ------------------------------------------- */
/* 4. 版块样式 (保持不变) */
/* ------------------------------------------- */
/*home section*/
.section-title {
  font-size: 2.625rem;
  font-weight: 700;
  color: var(--color-text);
  text-align: center;
  margin-bottom: 0.9375rem;
}

.section-subtitle {
  font-size: 1.5rem;
  color: var(--color-secondary);
  text-align: center;
  /* max-width: 600px; 限制副标题宽度 */
  margin: 0 auto 3.125rem auto;
  line-height: 1.6;
}

#home {
  background-color: var(--color-primary); /* 使用变量 */
  /* 其他吸附相关的样式在文件顶部已定义，无需在此重复 */
}
/* 替换原有的 #home h1 和 #home p 样式 */

.home-layout {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 0;
}

.home-content {
  flex: 1;
  max-width: 50%;
  padding-right: 3.125rem;
}

.home-image-area {
  flex: 1;
  max-width: 50%;
  text-align: right;
}

.home-title {
  font-size: 3rem; /* 增大标题 */
  font-weight: 700;
  line-height: 1.2;
  color: var(--color-white);
  margin-bottom: 1.5625rem;
  user-select: none;
}

.home-description {
  font-size: 1.125rem;
  color: var(--color-white);
  line-height: 1.6;
  margin-bottom: 2.1875rem;
}

.hero-image {
  max-width: 100%;
  height: auto;
  border-radius: 0.5rem;
  box-shadow: 0 0.625rem 1.875rem rgba(0, 0, 0, 0.1);
}

.home-actions {
  display: flex; /* 让按钮保持一行 */
  gap: 0.9375rem; /* 使用 gap 代替 margin-right */
}
.home-actions .btn {
  margin-right: 0; /* 清除原有按钮的 margin-right */
}

/*service section*/
#services,
#advantages,
#clients,
#faq,
#contact {
  background-color: var(--color-background); /* 保持白色背景 */
}

/* .service-grid 只是一个包装器，我们可以让它居中 */
.service-grid {
  display: flex;
  justify-content: center;
}

.service-column {
  max-width: 62.5rem;
  width: 100%;
}

.service-column-title {
  font-size: 1.375rem;
  font-weight: 600;
  color: var(--color-primary);
  margin-bottom: 0.625rem;
  text-align: center;
}

.service-column-description {
  font-size: 1.125rem;
  color: var(--color-secondary);
  margin-bottom: 2.5rem;
  line-height: 1.5;
  text-align: center;
}

.feature-list {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.875rem;
  margin-top: 2.5rem;
}

.feature-item {
  background-color: var(--color-white);
  border: none;
  padding: 1.25rem;
  border-radius: 0.375rem;
  box-shadow: 0 0.125rem 0.625rem rgba(0, 0, 0, 0.05);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  /* text-align: center; */
}

.feature-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--color-text);
  margin-bottom: 0.5rem;
  text-align: center;
}

.feature-item p {
  font-size: 1rem;
  color: var(--color-secondary);
  text-align: center;
}

.feature-item:hover {
  transform: translateY(-0.3125rem);
  box-shadow: 0 0.25rem 0.9375rem rgba(0, 0, 0, 0.05);
}

.advantage-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.875rem;
  text-align: center;
  margin-top: 3.125rem;
}
.advantage-item h3 {
  color: #007bff;
}
#products {
  background-color: #e9ecef;
}
.product-list {
  display: flex;
  justify-content: space-around;
  flex-wrap: wrap;
  margin-top: 3.125rem;
}
.product-item {
  width: 30%;
  padding: 1.25rem;
  text-align: center;
  background-color: var(--color-background);
  border-radius: 0.3125rem;
  box-shadow: 0 0.0625rem 0.1875rem rgba(0, 0, 0, 0.1);
  margin-bottom: 1.25rem;
}

.testimonial-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr); /* 桌面端 3 栏 */
  gap: 1.875rem;
}

.testimonial-card {
  background-color: var(--color-white);
  padding: 1.25rem;
  border-radius: 0.3125rem;
  box-shadow: 0 0.25rem 0.9375rem rgba(0, 0, 0, 0.05);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.testimonial-card:hover {
  transform: translateY(-0.3125rem);
  box-shadow: 0 0.5rem 1.5625rem rgba(0, 0, 0, 0.1);
}

.testimonial-avatar {
  width: 3.125rem;
  height: 3.125rem;
  border-radius: 50%;
  /* margin-bottom: 5px; */
}
.testimonial-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  border: 0.1875rem solid var(--color-background);
}

.testimonial-quote {
  font-size: 1rem;
  color: var(--color-secondary);
  line-height: 1.6;
  font-style: italic;
  margin-bottom: 0.625rem;
  flex-grow: 1;
}

.testimonial-author {
  font-size: 1rem;
  font-weight: 700;
  color: var(--color-primary);
  margin-bottom: 0.3125rem;
  margin-right: 0.3125rem;
  display: inline;
}

.testimonial-position {
  display: inline;
  font-size: 0.875rem;
  color: var(--color-secondary); /* 职位使用次要色调 */
}

.advantage-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.875rem;
  margin-top: 3.125rem;
}

.advantage-card {
  background-color: var(--color-white);
  padding: 2.5rem 1.875rem;
  border-radius: 0.5rem;
  text-align: left;
  display: flex;
  flex-direction: column;
}

.advantage-icon {
  width: 2.8125rem;
  height: 2.8125rem;
  margin-bottom: 0.3125rem;
}

.icon-img {
  width: 100%;
  height: 100%;
}

.advantage-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--color-primary); /* 标题使用主色调 */
  margin-bottom: 0.625rem;
}

.advantage-description {
  font-size: 1rem;
  color: var(--color-secondary);
  line-height: 1.6;
}

.faq-list {
  /* 限制 FAQ 列表的最大宽度，使其在超宽屏上不会过长 */
  max-width: 56.25rem;
  margin: 3.125rem auto 0 auto;
  border-top: 0.0625rem solid var(--color-background); /* 顶部细线 */
}

.faq-item {
  border-bottom: 0.0625rem solid var(--color-background); /* 每项底部分割线 */
  background-color: var(--color-white);
}

.faq-question {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.25rem 1.25rem;
  cursor: pointer;
  user-select: none; /* 防止文本被选中 */
  transition: background-color 0.3s ease;
}

.faq-question-text {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--color-text);
  padding-right: 0.9375rem;
}

.faq-icon {
  width: 1.5rem;
  height: 1.5rem;
  color: var(--color-btn); /* 使用主色调作为图标颜色 */
  transition: transform 0.2s ease;
}

/* 答案样式 (JS 会移除 hidden 类来显示) */
.faq-answer {
  font-size: 1rem;
  color: var(--color-secondary);
  line-height: 1.6;
  padding: 0 1.25rem 1.875rem;
  display: none;
}

.faq-icon {
  transition: transform 0.2s ease;
}

.faq-item.active .faq-icon {
  /* 箭头翻转修复：设置 transform 属性实现 180 度旋转 */
  transform: rotate(180deg);
}

.contact-form {
  margin: 0 auto;
}
.contactBlock {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.contactRow {
  width: 48%;
  display: inline-block;
}
.contact-form label {
  display: block;
  margin-top: 0.625rem;
  font-weight: bold;
}

.formFeild {
  width: 100%;
  padding: 0.625rem;
  margin-top: 0.3125rem;
  margin-bottom: 0.9375rem;
  border: 0.0625rem solid #ccc;
  border-radius: 0.25rem;
  box-sizing: border-box;
}

.contact-form textarea {
  width: 100%;
  padding: 0.625rem;
  margin-top: 0.3125rem;
  margin-bottom: 0.9375rem;
  border: 0.0625rem solid #ccc;
  border-radius: 0.25rem;
  box-sizing: border-box;
}
.contact-form textarea {
  resize: vertical;
  height: 9.375rem;
}
#submitBtn {
  display: block;
  margin: 1.25rem auto 0;
}

#toast {
  position: fixed;
  top: 9.375rem;
  left: 50%;
  transform: translateX(-50%); /* 确保水平居中 */
  background-color: #28a745;
  color: white;
  padding: 0.9375rem 1.25rem;
  border-radius: 0.3125rem;
  box-shadow: 0 0.25rem 0.5rem rgba(0, 0, 0, 0.2);
  z-index: 9001;
  display: none;
}

/* 成功样式 (绿色) */
#toast.success {
  background-color: #4caf50; /* 绿色 */
}

/* 失败样式 (红色)*/
#toast.error {
  background-color: #f44336; /* 红色 */
}

#footer {
  background-color: #343a40;
  color: white;
  padding: 1.875rem 0;
  text-align: center;
  font-size: 0.875rem;
}
#footer a {
  color: #adb5bd;
  margin: 0 0.625rem;
}
#footer a:hover {
  color: #fff;
}

/* ------------------------------------------- */
/* 5. 媒体查询：小屏幕 (max-width: 768px) */
/* ------------------------------------------- */
@media (max-width: 992px) {
  /* 使用 992px 适配平板和桌面小窗口 */
  section {
    min-height: auto !important;
    height: auto !important;
    /* 恢复正常的垂直内边距 */
    padding: 3.75rem 0 !important; /* 使用 60px 垂直内边距 */
  }

  .section-title {
    font-size: 2rem;
  }

  /* 针对 Home 屏的特殊修复 */
  #home {
    min-height: auto !important;
    height: auto !important;
    padding-top: 4.375rem !important;
    padding-bottom: 3.75rem !important;
  }

  /* 针对 Services/Advantages/Clients 的特殊修复 */
  #advantages,
  #clients,
  #faq {
    overflow-y: visible !important;
  }
  .logo a {
    font-size: 1.125rem;
  }
  .container {
    padding: 0 1.25rem;
  }
  /* Home 响应式布局 */
  .home-layout {
    flex-direction: column; /* 垂直堆叠 */
    padding: 0 1.25rem;
  }
  .home-content,
  .home-image-area {
    max-width: 100%;
    padding-right: 0;
    text-align: center;
  }

  .home-content {
    max-width: 100%;
    padding-right: 0;
    text-align: center;
    order: 2; /* 图片在内容上方 */
    margin-top: 1.25rem;
  }

  .home-image-area {
    order: 1;
    margin-bottom: 1.25rem;
  }

  .home-title {
    font-size: 2.25rem;
    user-select: none;
  }

  .home-actions {
    flex-direction: column; /* 垂直堆叠按钮 */
  }

  .home-actions a.btn {
    width: 80%;
    margin: 0.3125rem auto; /* 按钮间距 */
  }
  .section-subtitle {
    display: none;
  }
  .feature-list {
    /* 移动端：改为单栏垂直排列 */
    grid-template-columns: 1fr;
    gap: 1.25rem; /* 减小移动端间距 */
  }

  /* 调整一下移动端的卡片内边距 */
  .feature-item {
    padding: 1.5625rem;
  }
}

@media (max-width: 768px) {
  .home-title {
    font-size: 2.25rem; /* 手机端进一步减小字体 */
  }
  /* 桌面导航链接隐藏 */
  .nav {
    /* 确保 display 属性的优先级低于 .nav.active */
    position: fixed;
    top: 4.375rem;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--color-white);
    overflow-y: auto;

    display: none; /* 默认隐藏 */

    box-shadow: 0 0.25rem 0.375rem rgba(0, 0, 0, 0.1);
    z-index: 999;
  }

  .nav.active {
    /* 当 jQuery 添加 .active 类时，强制显示 */
    display: block !important;
  }

  /* 汉堡包按钮显示 */
  .menu-toggle {
    display: block;
  }

  /* 修复移动端导航链接垂直排列 */
  .nav ul {
    flex-direction: column;
    align-items: center;
    padding: 3.125rem 0; /* 增加上下间距 */
  }

  .nav ul li {
    margin: 1.25rem 0; /* 增加链接间距 */
    font-size: 1.125rem;
  }

  .nav ul li a.current {
    color: var(--color-primary); /* 移动菜单如果是全白背景，可以换一个颜色 */
    /* background-color: var(--color-secondary); */
    border-radius: 0.25rem;
    padding: 0.625rem 1.25rem;
    display: block;
  }

  /* 汉堡包 X 动画 */
  .menu-toggle.active .hamburger-icon {
    background-color: transparent;
  }
  .menu-toggle.active .hamburger-icon::before {
    top: 0;
    transform: rotate(45deg);
  }
  .menu-toggle.active .hamburger-icon::after {
    top: 0;
    transform: rotate(-45deg);
  }
}

/* Contact 表单必填星号样式 */
.contact-form .required-star {
  color: #ff4444; /* 醒目的红色 */
  font-size: 1.2em; /* 稍微大一点，更显眼 */
  font-weight: bold;
  margin-left: 0.1875rem; /* 与前面的文本稍微拉开距离 */
  position: relative;
  top: 0.3125rem;
}

