/* ==========================================================================
   layout.css —— 头部导航 / 移动端菜单 / 页脚 / 悬浮组件
   ========================================================================== */

/* ---------- 顶部信息条 ---------- */
/* 头部完全参考 alipan.com（见参考图）：无顶部信息条，纯白导航条直接衔接主视觉。
   如需恢复联系电话条，去掉本行即可。 */
.header-top {
  display: none;
  height: var(--header-top-height);
  background: var(--color-primary);
  color: var(--color-text-white);
  /* 参考 alipan 顶部 banner：0.9722vw（约 12.4px @1280） */
  font-size: 13px;
}

.header-top .container {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  height: 100%;
}

.header-top a:hover {
  text-decoration: underline;
}

.header-top .divider {
  opacity: 0.4;
}

/* ---------- 主导航 ---------- */
/* 悬浮吸顶挂在 .site-header 上（其父为 body，可全程粘住），
   避免子级 .header-nav 受限于 64px 高度的父容器导致无法吸顶 */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-nav {
  /* 样式完全参考 alipan 头部导航：白底、无边框、行高 64px */
  background: #ffffff;
  border-bottom: none;
}

/* 吸顶后投影（参考 crmeb.com：滚动后导航带投影） */
.site-header.scrolled {
  box-shadow: 0 4px 20px rgba(0, 21, 63, 0.1);
}

.header-nav .container {
  display: flex;
  align-items: center;
  height: 76px;
  gap: 24px;
}

.header-nav .logo img {
  height: 52px;
  width: auto;
}

.nav-list {
  display: flex;
  align-items: center;
  flex: 0 0 auto;
  /* 菜单间距参考 alipan：2.93vw（2560 视口约 75px / 1280 视口约 38px） */
  gap: clamp(24px, 2.6vw, 52px);
  margin: 0 0 0 calc(3.84vw - 30px);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 15px;
  /* 参考 alipan：右侧操作组靠右 */
  margin-left: auto;
}

.nav-list a {
  font-size: 22px;
  font-weight: 500;
  color: #25262b;
  position: relative;
  padding: 6px 0;
  white-space: nowrap;
  transition: color 0.2s;
}

.nav-list a:hover,
.nav-list a.active {
  color: var(--color-primary);
}

.nav-list a.active::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 4px;
  border-radius: 2px;
  background: var(--color-primary);
}

.header-actions .link-login {
  color: var(--color-text-body);
  font-size: 22px;
  font-weight: 500;
  padding: 0 4px;
  white-space: nowrap;
}

.header-actions .link-login:hover {
  color: var(--color-primary);
}

.header-actions .btn {
  font-size: 20px;
  font-weight: 500;
  height: 45px;
  padding: 0 25px;
  border-radius: 22.5px;
  line-height: 1;
}

/* 移动端菜单按钮（汉堡/关闭：SVG 双图标，同 xlwms 600x900 视觉：38x77 点击区、36px 图标、灰 #666487） */
.nav-toggle {
  display: none;
  flex-direction: column;
  width: 40px;
  height: 40px;
  align-items: center;
  justify-content: center;
}

.nav-toggle svg {
  display: block;
}

/* 关闭图标默认隐藏，展开时切换（不依赖 transform，所有环境可靠） */
.nav-toggle .icon-close {
  display: none;
}

.nav-toggle.active .icon-menu {
  display: none;
}

.nav-toggle.active .icon-close {
  display: block;
}

/* 移动端菜单：全宽下拉（参考 xlwms.com 手机版，无遮罩） */
.mobile-menu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--color-bg-page);
  z-index: 99;
  box-shadow: 0 8px 20px rgba(0, 21, 63, 0.08);
}

.mobile-menu-mask {
  display: none;
}

.mobile-menu.open {
  display: block;
}

.mobile-menu .drawer {
  padding: 0 3.2vw;
}

.mobile-menu .drawer li {
  border-bottom: 1px solid #f3f7fe;
}

.mobile-menu .drawer li:last-child {
  border-bottom: none;
}

.mobile-menu .drawer a {
  display: block;
  padding: 5.07vw 2.13vw;
  font-size: 4.27vw;
  font-weight: 500;
  color: var(--color-text-heading);
}

.mobile-menu .drawer a.active {
  color: var(--color-primary);
  font-weight: 600;
}

/* ---------- 页脚（xlwms.com 底部 1:1 还原，整体尺寸 125%） ---------- */
.site-footer {
  background: rgb(0, 3, 31);
  color: rgba(255, 255, 255, 0.72);
}

.footer-container {
  max-width: 1650px;
  margin: 0 auto;
  padding: 117.5px 50px;
  display: flex;
  justify-content: space-between;
  gap: 80px;
}

.footer-left {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.footer-logo img {
  height: 50px;
  width: auto;
  filter: brightness(0) invert(1);
}

.footer-title {
  font-size: 38.75px;
  font-weight: 700;
  color: #fff;
}

.footer-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  align-self: flex-start;
  height: 64px;
  padding: 0 38px;
  margin-top: 10px;
  font-size: 22.5px;
  font-weight: 500;
  line-height: 1;
  border-radius: 160px;
  background: rgb(11, 92, 255);
  color: #fff;
  text-decoration: none;
  transition: opacity 0.2s;
}

.footer-btn:hover {
  opacity: 0.9;
}

.footer-btn svg {
  width: 20px;
  height: 20px;
}

.footer-right {
  flex: 1;
  max-width: 1050px;
  display: flex;
  flex-direction: column;
  gap: 50px;
}

.footer-right-top {
  display: flex;
  justify-content: space-between;
}

.footer-right-top a {
  font-size: 20px;
  font-weight: 500;
  color: #fff;
  text-decoration: none;
}

.footer-right-top a:hover {
  color: rgb(11, 92, 255);
}

.footer-right-middle {
  border-top: 1px solid rgba(255, 255, 255, 0.15);
}

.footer-right-bottom {
  display: flex;
  justify-content: space-between;
  gap: 40px;
}

.footer-right-bottom-left {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.footer-tel,
.footer-email {
  font-size: 20px;
  font-weight: 700;
  color: #fff;
  text-decoration: none;
}

.footer-right-bottom-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: flex-end;
  gap: 5px;
}

.footer-copyright,
.footer-address {
  font-size: 15px;
  color: rgba(255, 255, 255, 0.45);
}

.footer-privacy {
  font-size: 15px;
  color: #fff;
  text-decoration: none;
}

.footer-privacy:hover {
  text-decoration: underline;
}

/* ---------- 页尾 CTA 横幅 ---------- */
.footer-cta {
  background: linear-gradient(120deg, var(--color-primary) 0%, var(--color-primary-deep) 100%);
  padding: 48px 0;
  color: var(--color-text-white);
}

.footer-cta .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 20px;
}

.footer-cta .cta-title {
  /* 统一为 xlwms「领星WMS，提供更高效的解决方案」样式 x125%：55px / 500 / 行高80（CTA 蓝底保持白字） */
  font-size: 55px;
  font-weight: 700;
  line-height: 80px;
  color: var(--color-text-white);
}

.footer-cta .cta-sub {
  margin-top: 6px;
  /* 副标题统一 25px（20px × 125%） */
  font-size: 25px;
  opacity: 0.9;
}

/* ---------- 悬浮客服入口 ---------- */
.float-widgets {
  position: fixed;
  right: 24px;
  bottom: 40px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  z-index: 90;
}

.float-widgets .widget-btn {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--color-text-white);
  color: var(--color-primary);
  box-shadow: var(--shadow-card);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s;
}

.float-widgets .widget-btn:hover {
  transform: scale(1.08);
}

.float-widgets .widget-btn--primary {
  background: var(--color-primary);
  color: var(--color-text-white);
}

/* 微信二维码浮层 */
.qr-pop {
  display: none;
  position: absolute;
  right: 56px;
  bottom: 0;
  background: var(--color-bg-page);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-hover);
  padding: 12px;
  width: 160px;
  text-align: center;
}

.qr-pop.show {
  display: block;
}

.qr-pop img {
  width: 136px;
  height: 136px;
  border-radius: 6px;
}

.qr-pop span {
  display: block;
  margin-top: 8px;
  font-size: 12px;
  color: var(--color-text-muted);
}

/* ---------- PC 右侧悬浮导航 side-menu（参考 xlwms.com） ---------- */
.side-menu {
  position: fixed;
  right: 24px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 900;
  display: flex;
  flex-direction: column;
  background: #ffffff;
  border-radius: 10px;
  box-shadow: 0 4px 20px rgba(15, 35, 80, 0.12);
  overflow: visible;
}
.side-menu-item {
  width: 65px;
  height: 65px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  border-bottom: 1px solid #f0f2f5;
  cursor: pointer;
  background: transparent;
  border-left: none;
  border-right: none;
  border-top: none;
  text-decoration: none;
}
.side-menu-item:last-child {
  border-bottom: none;
}
.side-menu-item:first-child {
  border-radius: 10px 10px 0 0;
}
.side-menu-item:last-child {
  border-radius: 0 0 10px 10px;
}
.sm-icon {
  width: 28px;
  height: 28px;
  display: block;
}
.sm-normal {
  color: #9aa3b2;
}
.sm-hover {
  display: none;
  color: #1677ff;
}
.side-menu-item:hover .sm-normal {
  display: none;
}
.side-menu-item:hover .sm-hover {
  display: block;
}
.side-menu-item .qr-pop {
  right: 75px;
  bottom: 50%;
  transform: translateY(50%);
}

/* ---------- 响应式（断点完全对齐 xlwms.com：1365 / 1024 / 833） ---------- */
@media (max-width: 1365px) {
  /* 断点尺寸 = 原 49px/32px x 125% */
  .header-nav .container {
    height: 61px;
  }

  .header-nav .logo img {
    height: 40px;
  }
}

@media (max-width: 1024px) {
  .nav-list {
    gap: 27.5px;
  }

  /* 注册按钮 = 原 32px x 125% */
  .header-actions .btn {
    height: 40px;
    border-radius: 20px;
  }
}

@media (max-width: 833px) {
  .header-top .container {
    justify-content: center;
  }

  /* 手机版 header 尺寸完全按 xlwms.com（375 基准 x 视口/375 缩放）：
     导航 89.6px / logo 44.8px / 按钮 51.2px @600 = 14.93vw / 7.47vw / 8.53vw */
  .header-nav .container {
    height: 14.93vw;
  }

  .header-nav .logo img {
    height: 7.47vw;
  }

  .nav-list,
  .header-actions .link-login {
    display: none;
  }

  /* 手机版免费注册按钮（xlwms：字 16~19.2px 随视口、高 8.53vw） */
  .header-actions .btn {
    display: inline-flex;
    height: 8.53vw;
    padding: 0 5.33vw;
    font-size: clamp(16px, 3.2vw, 19.2px);
    border-radius: 4.27vw;
  }

  /* 汉堡点击区同 xlwms 600x900 实测：38x77px（12.83vw 高、6.33vw 宽，375 时 48x24 与原站一致） */
  .nav-toggle {
    display: flex;
    width: 6.33vw;
    height: 12.83vw;
    gap: 12px;
  }



  .footer-main {
    grid-template-columns: 1fr 1fr;
    gap: 32px;
  }
}

@media (max-width: 640px) {
  .footer-main {
    grid-template-columns: 1fr;
  }

  .footer-cta .cta-title {
    font-size: 22px;
  }
}

/* 手机版页脚字号（xlwms 600x900 实测：标题 41.6px / 列标题、链接 22.4px / 版权 16px） */
@media (max-width: 833px) {
  .footer-cta .cta-title {
    font-size: 6.93vw;
  }

  .footer-cta .cta-sub {
    font-size: 4.27vw;
  }

  .footer-container {
    flex-direction: column;
    padding: 60px 20px;
    gap: 40px;
  }

  .footer-right {
    max-width: none;
    gap: 24px;
  }

  .footer-right-top {
    flex-wrap: wrap;
    gap: 12px;
  }

  .footer-right-bottom {
    flex-direction: column;
    gap: 24px;
  }

  .footer-right-bottom-right {
    align-items: flex-start;
  }

  .footer-title {
    font-size: 24px;
  }

  .footer-btn {
    height: 48px;
    font-size: 17px;
    padding: 0 28px;
  }

  .footer-logo img {
    height: 36px;
  }

  .footer-tel,
  .footer-email {
    font-size: 16px;
  }

  .footer-copyright,
  .footer-address,
  .footer-privacy {
    font-size: 13px;
  }
}

/* 手机版固定底部条：咨询客服/预约演示
   xlwms 600x900 实测：fixed 底部、高 77px、两半宽按钮、字 28.8px
   （375 基准：高 48px / 字 18px，随视口缩放 = 12.83vw / 4.8vw） */
.mobile-sticky-footer {
  display: none;
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  height: 12.83vw;
  z-index: 998;
  transition: opacity 0.3s ease, transform 0.3s ease;
}

/* 往下拉消失（xlwms 实测：opacity 0 + 下移滑出），回到顶部恢复 */
.mobile-sticky-footer.hidden {
  opacity: 0;
  transform: translateY(100%);
  pointer-events: none;
}

.mobile-sticky-footer a {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  font-size: 4.8vw;
  font-weight: 400;
  text-decoration: none;
  line-height: 1;
}

.mobile-sticky-footer .sticky-call {
  background: #fff;
  color: rgb(137, 150, 174);
  border-top: 1px solid #eef1f6;
}

.mobile-sticky-footer .sticky-demo {
  background: rgb(11, 92, 255);
  color: #fff;
  border-top: 1px solid rgb(11, 92, 255);
}

@media (max-width: 833px) {
  .side-menu {
    display: none;
  }
  .mobile-sticky-footer {
    display: flex;
  }

  /* 为固定底部条留出内容空间，避免遮挡页脚 */
  .site-footer {
    padding-bottom: calc(12.83vw + 24px);
  }
}
