/* ==========================================================================
   layout.css —— 布局：版心 / 头部导航 / 页脚 / 分区 / 栅格
   --------------------------------------------------------------------------
   维护说明：全站骨架样式。新增分区或调整栅格在此修改。
   ========================================================================== */

/* ---- 版心容器 ---- */
.container {
  max-width: var(--container-max);
  margin: 0 auto;
  padding-left: var(--container-pad);
  padding-right: var(--container-pad);
}

/* ---- 通用分区 ---- */
.section { padding: var(--section-py) 0; }
.section--soft { background: var(--color-bg-soft); }        /* 浅色分区 */
.section--dark {                                            /* 深色分区 */
  background: linear-gradient(135deg, #16afa2, #0f73db);
  color: var(--color-text-invert);
}
.section--dark h2, .section--dark h3 { color: var(--color-text-invert); }

/* 分区标题组 */
.section__head { text-align: center; margin-bottom: var(--space-lg); }
.section__head h2 { color: var(--color-primary); }
.section--dark .section__head h2 { color: var(--color-text-invert); }
.section__head .section__desc {
  /* max-width: 760px; */
  margin: var(--space-sm) auto 0;
  color: var(--color-text-secondary);
}
.section--dark .section__desc { color: rgba(255, 255, 255, 0.75); }
/* 标题下装饰线 */
.section__head h2::after {
  content: "";
  display: block;
  width: 48px;
  height: 3px;
  margin: 0.75rem auto 0;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--color-accent), var(--color-cyan));
}

/* ---- 响应式栅格：PC 多列 → 平板 2 列 → 手机 1 列 ---- */
.grid { display: grid; gap: var(--space-md); }
.grid--2 { grid-template-columns: repeat(2, 1fr); }
.grid--3 { grid-template-columns: repeat(3, 1fr); }
.grid--4 { grid-template-columns: repeat(4, 1fr); }

@media (max-width: 992px) {
  .grid--3, .grid--4 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
  .grid--2, .grid--3, .grid--4 { grid-template-columns: 1fr; }
}

/* ==========================================================================
   头部导航（PC 横排 / 移动端抽屉）
   ========================================================================== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--header-h);
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--color-border);
}
.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--header-h);
}

/* Logo */
.site-logo {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  min-height: var(--tap-size);
}
.site-logo img { height: 36px; width: auto; } /* Logo 图片按高度等比缩放，兼容横版图 */
.site-logo__text { line-height: 1.2; }
.site-logo__name {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--color-primary);
  display: block;
}
.site-logo__slogan {
  font-size: 0.6875rem;
  color: var(--color-text-secondary);
  display: block;
  letter-spacing: 0.08em;
}

/* 主导航（PC） */
.site-nav__list {
  display: flex;
  gap: 0.25rem;
  list-style: none;
  padding: 0;
  
}
.site-nav__link {
  display: flex;
  align-items: center;
  min-height: var(--tap-size);
  padding: 0 1rem;
  color: var(--color-text);
  font-weight: 500;
  border-radius: var(--radius-sm);
}
.site-nav__link:hover { color: var(--color-accent); background: var(--color-bg-soft); }
/* 当前页高亮：给 <li> 加 .is-active */
.site-nav__item.is-active .site-nav__link {
  color: var(--color-accent);
  font-weight: 700;
}

/* 导航容器：PC 端链接与语言切换横向排列 */
.site-nav {
  display: flex;
  align-items: center;
  gap: 80px;
}

/* ==========================================================================
   语言切换按钮（参考 ai-dm-cn lang-switch，药丸式滑块）
   ========================================================================== */
.lang-switch {
  display: flex;
  align-items: center;
  position: relative;
  background: var(--color-bg-soft);
  border-radius: 999px;
  padding: 3px;
  margin-left: var(--space-md);
  flex-shrink: 0;
}
.lang-switch__slider {
  position: absolute;
  top: 3px;
  left: 3px;
  width: calc(50% - 3px);
  height: calc(100% - 6px);
  background: var(--color-accent);
  border-radius: 999px;
  transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  pointer-events: none;
}
.lang-switch.is-en .lang-switch__slider {
  left: calc(50%);
}
.lang-switch__btn {
  position: relative;
  z-index: 1;
  border: none;
  background: transparent;
  padding: 0.25rem 0.75rem;
  font-size: 0.8125rem;
  font-weight: 600;
  line-height: 1.4;
  cursor: pointer;
  color: var(--color-text-secondary);
  transition: color 0.3s ease;
  white-space: nowrap;
  font-family: inherit;
}
.lang-switch__btn.is-active {
  color: #fff;
}

/* ==========================================================================
   H5 语言切换按钮（移动端）+ 屏幕居中弹窗
   ========================================================================== */
.lang-toggle {
  display: none; /* PC 端隐藏，≤900px 才出现 */
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  min-width: 60px;
  height: 40px;
  padding: 0 0.875rem 0 1rem;
  box-sizing: border-box;
  border: 1.5px solid var(--color-accent);
  border-radius: 999px;
  background: #fff;
  color: var(--color-primary);
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  flex-shrink: 0;
  order: 2;
  margin-right: 1.25rem;
  transition: all var(--transition);
}
.lang-toggle::after {
  content: "";
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 5px solid var(--color-accent);
  transition: transform var(--transition);
}
.lang-toggle[aria-expanded="true"]::after { transform: rotate(180deg); }

/* 语言选择弹窗：屏幕居中 */
.lang-modal {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: var(--container-pad);
}
.lang-modal.is-open { display: flex; }
.lang-modal__overlay {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  background: rgba(5, 23, 40, 0.55);
}
.lang-modal__dialog {
  position: relative;
  width: 100%;
  max-width: 320px;
  background: #fff;
  border-radius: var(--radius-lg);
  box-shadow: 0 20px 60px rgba(5, 23, 40, 0.3);
  overflow: hidden;
  text-align: center;
}
.lang-modal__title {
  margin: 0;
  padding: var(--space-md) var(--space-md) var(--space-sm);
  font-size: 1rem;
  font-weight: 500;
  color: var(--color-text-secondary);
}
.lang-modal__list { list-style: none; margin: 0; padding: 0; }
.lang-modal__item {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 54px;
  border-top: 1px solid var(--color-border);
  color: var(--color-text);
  font-size: 1.0625rem;
  font-weight: 500;
}
.lang-modal__item.is-active { color: var(--color-accent); font-weight: 700; }
.lang-modal__tag {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--color-accent);
  padding: 0.15rem 0.45rem;
  background: rgba(7, 159, 202, 0.1);
  border-radius: 999px;
}
.lang-modal__cancel {
  display: block;
  width: 100%;
  min-height: 54px;
  border: none;
  border-top: 1px solid var(--color-border);
  background: var(--color-bg-soft);
  color: var(--color-text-secondary);
  font-family: inherit;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
}

/* 汉堡按钮（仅移动端显示） */
.nav-toggle {
  display: none;
  width: var(--tap-size);
  height: var(--tap-size);
  border: none;
  background: transparent;
  cursor: pointer;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  order: 3;
}
.nav-toggle__bar {
  width: 22px;
  height: 2px;
  background: var(--color-primary);
  border-radius: 2px;
  transition: transform var(--transition), opacity var(--transition);
}
/* 展开态 → 汉堡变 ✕ */
.nav-toggle[aria-expanded="true"] .nav-toggle__bar:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-toggle__bar:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] .nav-toggle__bar:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ---- 移动端导航抽屉 ---- */
@media (max-width: 900px) {
  .nav-toggle { display: flex; }
  .lang-toggle { display: inline-flex; }
  .site-nav .lang-switch { display: none; }

  .site-nav {
    position: fixed;
    top: var(--header-h);
    left: 0;
    right: 0;
    background: #fff;
    border-bottom: 1px solid var(--color-border);
    box-shadow: var(--shadow-card);
    /* 默认收起：max-height 负责动画；visibility + pointer-events 负责
     * 在微信内置 WebView（X5 内核）里彻底屏蔽被裁掉内容的 hit-testing，
     * 避免“隐形抽屉”盖住 #h5-lang 等兄弟元素，导致点击失效。
     * 仅写 max-height:0 + overflow:hidden 在 X5 里仍会被点击命中。 */
    max-height: 0;
    overflow: hidden;
    visibility: hidden;
    pointer-events: none;
    transition: max-height 0.3s ease, visibility 0s linear 0.3s;
  }
  .site-nav.is-open {
    max-height: 400px;
    visibility: visible;
    pointer-events: auto;
    transition: max-height 0.3s ease, visibility 0s;
  }

  .site-nav__list { flex-direction: column; padding: 0.5rem 0; gap: 0; }
  .site-nav__link {
    padding: 0 var(--container-pad);
    min-height: 48px; /* 触屏加大点击区 */
  }
  .lang-switch {
    margin: var(--space-sm) 0 0;
    margin-left: 0;
  }
}
@media (max-width: 600px) {
  .lang-toggle { margin-right: 0.75rem; }
}

/* ==========================================================================
   页脚
   ========================================================================== */
.site-footer {
  background:
    linear-gradient(rgba(5, 23, 40, 0.5), rgba(5, 23, 40, 0.5)),
    url("../img/footerbg.jpg") center / cover no-repeat,
    var(--color-bg-dark);
  color: rgba(255, 255, 255, 0.72);
  font-size: var(--fs-small);
}
.site-footer a { color: rgba(255, 255, 255, 0.72); min-height: var(--tap-size); display: flex;
    align-items: center;}
.site-footer a:hover { color: #fff; }

.site-footer__main {
  position: relative;
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 2fr;
  gap: var(--space-lg);
  /* 上下各减 20px，整体压缩 40px */
  padding: calc(var(--space-xl) - 20px) var(--container-pad) calc(var(--space-lg) - 20px);
}
.site-footer__main::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: var(--container-pad);
  right: var(--container-pad);
  height: 1px;
  background: rgba(255, 255, 255, 1);
}

@media (max-width: 992px) {
  .site-footer__main { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 640px) {
  .site-footer__main { grid-template-columns: 1fr; gap: var(--space-md); }
}

.site-footer h3 {
  font-size: 1rem;
  color: #fff;
  margin-bottom: var(--space-sm);
}
/* 品牌栏：Logo 图 + 公司名 + 定位语 + 两行简介 */
.site-footer__logo {
  height: 48px;
  width: auto;
  display: block;
  margin-bottom: var(--space-sm);
}
.site-footer__company {
  font-size: 1.0625rem;
  color: #fff;
  margin-bottom: var(--space-md);
}
.site-footer__slogan {
  color: var(--color-cyan);
  font-weight: 800;
  margin-bottom: 0.6rem;
}
.site-footer__brand p { margin: 0 0 0.4rem;  }
.site-footer__links { list-style: none; padding: 0; }
/* .site-footer__links li { margin-bottom: 0.35rem; } */
.site-footer__links a {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
}
/* 二维码栏：公众号 + 官方销售 并排 */
.site-footer__qr-group {
  display: flex;
  gap: var(--space-lg);
  justify-content: flex-end;
  align-items: flex-start;
}
@media (max-width: 992px) {
  .site-footer__qr-group { justify-content: flex-start; }
}
.site-footer__qr { margin: 0; text-align: center; }
.site-footer__qr img {
  width: 160px;
  height: 160px;
  display: block;
  background: #fff;
}
.site-footer__qr figcaption {
  margin-top: 0.75rem;
  color: #fff;
  font-weight: 600;
}

/* 底栏：左侧版权 + 备案，右侧电话 + 邮箱 */
.site-footer__bottom {
  
  padding: var(--space-xs) 0; /* 上下间距缩短一半 */
  font-size: 0.8125rem;
  color: rgba(255, 255, 255, 0.5);
  padding-left: var(--container-pad);
  padding-right: var(--container-pad);
}
.site-footer__bottom .container {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 0.5em 1.5em;
  padding: 0;
}
.site-footer__bottom p { margin: 0; }
.site-footer__copyright,
.site-footer__bottom-contact {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-lg);
  justify-content: center;
  
}
.site-footer__bottom-contact {
  width: calc(320px + var(--space-lg));
}
/* 版权栏内部间距单独收窄，不影响右侧联系块 */
.site-footer__copyright { gap: 1rem; }

.site-footer__bottom-contact a {
  display: inline-flex;
  align-items: center;
  gap: 0.4em;

}
.site-footer__bottom-contact img { width: 14px; height: 14px; }
.site-footer__divider { color: rgba(255, 255, 255, 0.3); }
/* 窄屏下居中堆叠 */
@media (max-width: 640px) {
  .site-footer__bottom .container { justify-content: center; text-align: center; }
}

/* H5 移动端语言切换的相关样式已内联到每个页面的 <style> 块，
 * 此处保留移动端公共规则。 */
@media (max-width: 900px) {
  .site-header__inner { gap: 0; }
}
