/* ==========================================================================
   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 {
  /* 防止窄屏时 flex 压缩把 logo 挤变形 */
  flex: 0 0 auto;
}

.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;
}

/* ---------- 下载桌面端 下拉（按钮与下拉面板对齐 alipan.com） ---------- */
.header-download {
  position: relative;
  display: inline-flex;
}

.header-download-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 45px;
  padding: 0 26px;
  border: 1px solid #e8ebf0;
  border-radius: 22.5px;
  background: #ffffff;
  color: #1a1a1a;
  font-family: inherit;
  font-size: 20px;
  font-weight: 500;
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.header-download-btn:hover,
.header-download.is-open .header-download-btn {
  border-color: #d4dae4;
  background: #fafbfd;
}

/* 面板外层负责 12px 悬停桥接，内层才是白色卡片 */
.header-download-panel {
  position: absolute;
  top: 100%;
  left: 50%;
  padding-top: 12px;
  opacity: 0;
  visibility: hidden;
  transform: translate(-50%, -8px);
  transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s ease;
  z-index: 110;
}

.header-download:hover .header-download-panel,
.header-download:focus-within .header-download-panel,
.header-download.is-open .header-download-panel {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, 0);
}

.header-download-panel-inner {
  min-width: 216px;
  padding: 8px 0;
  background: #ffffff;
  border-radius: 16px;
  box-shadow: 0 8px 28px rgba(0, 21, 63, 0.12), 0 1px 3px rgba(0, 21, 63, 0.04);
}

.header-download-item {
  display: flex;
  align-items: center;
  gap: 12px;
  height: 58px;
  padding: 0 24px;
  color: #1a1a1a;
  font-size: 18px;
  font-weight: 400;
  white-space: nowrap;
  transition: background 0.15s ease;
}

.header-download-item:hover {
  background: #f5f6f8;
}

.header-download-item .dl-icon {
  width: 20px;
  height: 20px;
  flex: none;
}

.header-download-divider {
  display: block;
  height: 1px;
  margin: 0 20px;
  background: #f0f1f4;
}

/* 移动端菜单按钮（汉堡/关闭：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） ---------- */
/* 1600~1440 常见笔记本宽度：导航间距与字号轻微随视口收缩，
   给新增的「下载桌面端」按钮腾出空间，避免 logo 被挤压 */
@media (max-width: 1599px) {
  .nav-list {
    gap: clamp(18px, 1.6vw, 30px);
  }

  .nav-list a {
    font-size: clamp(18px, 1.5vw, 22px);
  }

  .header-actions {
    gap: 12px;
  }

  .header-download-btn {
    padding: 0 20px;
    font-size: 18px;
  }
}

@media (max-width: 1365px) {
  /* 断点尺寸 = 原 49px/32px x 125% */
  .header-nav .container {
    height: 61px;
  }

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

  .nav-list {
    gap: 16px;
  }

  .nav-list a {
    font-size: 18px;
  }
}

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

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

  /* 下载桌面端按钮同步收小 */
  .header-download-btn {
    height: 40px;
    padding: 0 20px;
    border-radius: 20px;
    font-size: 18px;
  }
}

@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;
    /* 容纳 60px 高的「产品矩阵」按钮（与首屏主按钮同尺寸） */
    min-height: 76px;
  }

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

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

  /* 手机版：头部 CTA 换成「下载桌面端」按钮 */
  .header-actions .btn {
    display: none;
  }

  .header-download {
    display: block;
  }

  /* 与首屏「申请演示」按钮（.btn--primary.btn--lg）字号、尺寸一致；
     窄屏（375/390）时按视口等比收缩，避免把汉堡按钮挤出屏幕 */
  .header-download-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: min(225px, 52vw);
    height: 60px;
    padding: 0 min(50px, 6.4vw);
    font-size: min(22.5px, 6vw);
    border-radius: 160px;
  }

  /* 手机版下拉面板改为右对齐按钮，避免超出屏幕 */
  .header-download-panel {
    left: auto;
    right: 0;
    transform: translateY(-8px);
  }

  .header-download:hover .header-download-panel,
  .header-download:focus-within .header-download-panel,
  .header-download.is-open .header-download-panel {
    transform: translateY(0);
  }

  .header-download-panel-inner {
    min-width: min(240px, 62vw);
  }

  /* 手机版下拉条目：字号与按钮一致，窄屏按视口收缩 */
  .header-download-item {
    height: 60px;
    padding: 0 min(24px, 3vw);
    gap: min(12px, 2vw);
    font-size: min(22.5px, 5.8vw);
  }

  .header-download-item .dl-icon {
    width: 24px;
    height: 24px;
  }

  .header-download-divider {
    margin: 0 min(20px, 2.6vw);
  }

  /* 汉堡点击区同 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);
  }
}

/* ==========================================================================
   申请演示弹窗（参考卫瓴：扫码添加弹窗）
   ========================================================================== */
.demo-modal-mask {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  padding: 20px;
}

.demo-modal-mask.show {
  opacity: 1;
  visibility: visible;
}

.demo-modal {
  background: #fff;
  border-radius: 20px;
  width: 100%;
  max-width: 360px;
  padding: 44px 36px 36px;
  position: relative;
  transform: translateY(30px) scale(0.95);
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 25px 70px rgba(0, 0, 0, 0.25);
  text-align: center;
  overflow: hidden;
}

/* 顶部渐变装饰条 */
.demo-modal::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 6px;
  background: linear-gradient(90deg, #2563eb, #3b82f6, #60a5fa);
}

.demo-modal-mask.show .demo-modal {
  transform: translateY(0) scale(1);
}

.demo-modal-close {
  position: absolute;
  top: 18px;
  right: 18px;
  width: 36px;
  height: 36px;
  border: none;
  background: #f5f7fa;
  border-radius: 50%;
  font-size: 22px;
  color: #999;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  transition: all 0.25s;
  z-index: 2;
}

.demo-modal-close:hover {
  background: #e8eef9;
  color: #2563eb;
  transform: rotate(90deg);
}

/* 二维码弹窗 */
.qr-modal-title {
  font-size: 22px;
  font-weight: 700;
  color: #0f172a;
  line-height: 1.4;
  margin-bottom: 8px;
}

.qr-modal-subtitle {
  font-size: 14px;
  color: #64748b;
  margin-bottom: 28px;
}

.qr-modal-title span {
  color: #2563eb;
}

.qr-modal-img {
  width: 220px;
  height: 220px;
  margin: 0 auto 20px;
  border-radius: 12px;
  overflow: hidden;
  background: #f8fafc;
  padding: 10px;
  box-sizing: border-box;
  border: 1px solid #e2e8f0;
  box-shadow: 0 8px 24px rgba(37, 99, 235, 0.1);
}

.qr-modal-img img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 6px;
}

.qr-modal-tip {
  font-size: 13px;
  color: #94a3b8;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.qr-modal-tip::before {
  content: "💬";
  font-size: 14px;
}

/* 手机版适配 */
@media (max-width: 768px) {
  .demo-modal {
    padding: 36px 24px 28px;
    border-radius: 16px;
  }
  .qr-modal-title {
    font-size: 20px;
  }
  .qr-modal-subtitle {
    font-size: 13px;
    margin-bottom: 22px;
  }
  .qr-modal-img {
    width: 200px;
    height: 200px;
  }
}

/* ==========================================================================
   图片放大弹窗（lightbox）
   ========================================================================== */
.lightbox-mask {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  padding: 40px;
}

.lightbox-mask.show {
  opacity: 1;
  visibility: visible;
}

.lightbox-img {
  max-width: 90%;
  max-height: 90%;
  border-radius: 8px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  transform: scale(0.9);
  transition: transform 0.3s ease;
}

.lightbox-mask.show .lightbox-img {
  transform: scale(1);
}

.lightbox-close {
  position: absolute;
  top: 24px;
  right: 24px;
  width: 44px;
  height: 44px;
  border: none;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 50%;
  font-size: 28px;
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  transition: background 0.2s;
}

.lightbox-close:hover {
  background: rgba(255, 255, 255, 0.3);
}
