@import url('floating-contact.css');

/* Header 组件样式 */
#header-container {
  height: var(--header-height);
}

.site-header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 100;
  height: var(--header-height);
  background: var(--color-bg-white);
  box-shadow: var(--shadow-sm);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
}

.site-header .header-inner {
  padding-left: var(--spacing-lg);
  padding-right: var(--spacing-lg);
}

.logo {
  font-size: 20px;
  font-weight: 600;
  color: var(--color-text-first);
  display: flex;
  align-items: center;
  gap: 10px;
}

.logo-img {
  width: auto;
  height: 36px;
  max-height: 40px;
  object-fit: contain;
}

.logo-text {
  letter-spacing: 0.5px;
}

.nav {
  display: flex;
  align-items: center;
  gap: var(--spacing-xl);
}

.nav-item {
  position: relative;
  height: var(--header-height);
  display: flex;
  align-items: center;
}

/* 一级与二级之间的斜向移动热区；展开态由 JS .is-open 控制，避免纯 :hover 斜穿误关 */
.nav-submenu-bridge {
  display: block;
  position: absolute;
  left: 50%;
  top: 100%;
  width: min(1200px, 100vw);
  height: 64px;
  transform: translateX(-50%);
  pointer-events: none;
  z-index: 155;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
}

.nav-item.is-open .nav-submenu-bridge,
.nav-item:focus-within .nav-submenu-bridge {
  pointer-events: auto;
}

.nav-link-parent {
  display: inline-flex;
  align-items: center;
}

.nav-submenu {
  position: fixed;
  top: var(--header-height);
  left: 0;
  right: 0;
  width: auto;
  min-width: 0;
  min-height: 112px;
  padding: 14px 8px;
  border-radius: 4px;
  background: transparent;
  box-shadow: none;
  display: flex;
  visibility: hidden;
  pointer-events: none;
  overflow: hidden;
  transform: none;
  /* 用裁剪收起，避免 scaleY 把文字/图片压成一线残影 */
  clip-path: inset(0 0 100% 0);
  transition:
    visibility 0s linear 0.28s,
    pointer-events 0s linear 0.28s,
    clip-path 0.28s cubic-bezier(0.22, 1, 0.36, 1);
  z-index: 160;
  justify-content: flex-start;
  align-items: center;
}

.nav-submenu-bg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: #fff;
  box-shadow: 0 10px 24px 0 #F2F2F3 inset, 0 6px 12px 0 #F2F2F3 inset;
  z-index: 0;
  pointer-events: none;
}

.nav-submenu-inner {
  width: max-content;
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 0;
  margin-left: clamp(16px, calc(var(--submenu-anchor-x, 50vw) - (var(--submenu-inner-width, 0px) / 2)), calc(100vw - var(--submenu-inner-width, 0px) - 16px));
  padding: 10px 20px;
  position: relative;
  z-index: 1;
}

.nav-sublink {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 144px;
  height: 40px;
  padding: 0 14px;
  font-family: "PingFang SC", "PingFang TC", "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  font-weight: 500;
  line-height: 1;
  color: rgba(0, 0, 0, 0.9);
  white-space: nowrap;
  border-radius: 2px;
}

.nav-sublink:hover,
.nav-sublink.active {
  background: #eceef2;
  color: #111827;
}

.nav-submenu-inner--products {
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 8px 12px;
  padding: 20px;
  max-width: min(1100px, calc(100vw - 32px));
  box-sizing: border-box;
}

.nav-submenu-products .nav-submenu-bg {
  min-height: 100%;
}

.nav-submenu-card {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex: 0 1 auto;
  min-width: 148px;
  max-width: 220px;
  padding: 12px 14px;
  border-radius: 6px;
  text-decoration: none;
  color: inherit;
  box-sizing: border-box;
  transition: background 0.2s ease;
}

.nav-submenu-card:hover,
.nav-submenu-card:focus-visible {
  background: #eceef2;
  outline: none;
}

.nav-submenu-card.active {
  background: #eceef2;
}

.nav-submenu-card-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.nav-submenu-card-icon img {
  /* max-width: 100%;
  max-height: 100%; */
  width: 24px;
  height: 24px;
  object-fit: contain;
}

.nav-submenu-card-body {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-width: 0;
  text-align: center;
}

.nav-submenu-card-title {
  display: block;
  font-size: 15px;
  font-weight: 600;
  color: rgba(0, 0, 0, 0.92);
  line-height: 24px;
  text-align: center;
}

.nav-submenu-card-desc {
  display: block;
  font-size: 12px;
  line-height: 1.45;
  color: #6b7280;
  text-align: center;
}

.nav-item.is-open .nav-submenu,
.nav-item:focus-within .nav-submenu {
  visibility: visible;
  pointer-events: auto;
  clip-path: inset(0 0 0 0);
  /* 打开：立即响应 + 原 0.34s 展开 */
  transition:
    visibility 0s,
    pointer-events 0s,
    clip-path 0.34s cubic-bezier(0.22, 1, 0.36, 1);
}

.header-cta {
  white-space: nowrap;
}

/* 预约体验等 CTA：保留占位与原有尺寸类，仅视觉与交互隐藏 */
.site-header .nav-cta--layout-only {
  visibility: hidden;
  pointer-events: none;
  user-select: none;
}

.mobile-nav-toggle {
  display: none;
  width: 40px;
  height: 40px;
  border: 1px solid #dcdfe6;
  border-radius: 8px;
  background: #fff;
  align-items: center;
  justify-content: center;
  gap: 4px;
  flex-direction: column;
}

.mobile-nav-toggle-bar {
  width: 18px;
  height: 2px;
  background: #222;
  border-radius: 99px;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.mobile-nav-toggle.is-open .mobile-nav-toggle-bar:nth-child(1) {
  transform: translateY(6px) rotate(45deg);
}

.mobile-nav-toggle.is-open .mobile-nav-toggle-bar:nth-child(2) {
  opacity: 0;
}

.mobile-nav-toggle.is-open .mobile-nav-toggle-bar:nth-child(3) {
  transform: translateY(-6px) rotate(-45deg);
}

.mobile-nav-drawer {
  display: none;
}

.mobile-nav-drawer[hidden] {
  display: none !important;
}

.mobile-nav-drawer:not([hidden]) {
  display: block;
}

.nav-link {
  font-size: 16px;
  color: var(--color-text-primary);
  padding: var(--spacing-lg) 0;
  transition: color 0.2s;
}

.nav-link:hover,
.nav-link.active {
  /* color: var(--color-primary); */
  font-weight: 600;
}

/* Footer 组件样式 */
.site-footer {
  background: var(--color-bg-footer);
  color: rgba(255, 255, 255, 0.85);
  padding: var(--spacing-4xl) 0 var(--spacing-lg);
}

.footer-top {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: var(--spacing-3xl);
  padding-bottom: var(--spacing-2xl);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-contact .footer-title {
  margin-bottom: var(--spacing-lg);
}

.contact-list {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-md);
  font-size: 14px;
}

.contact-list li {
  display: flex;
  align-items: flex-start;
  gap: var(--spacing-sm);
}

.contact-list .icon {
  flex-shrink: 0;
  line-height: 1.4;
}

.contact-list .contact-icon {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  margin-top: 2px;
}

.contact-list .contact-icon img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.footer-links {
  display: flex;
  gap: var(--spacing-xl);
  flex-wrap: nowrap;
  justify-content: space-between;
  padding-top: 10px
}
.footer-contact-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #fff;
  margin-bottom: 10px;
  > img {
    /* width: 36px; */
    width: 168px;
    height: px;
    max-height: 40px;
    object-fit: contain;
    margin-bottom: 10px;
  }
  .logo-text {
    font-size: 20px;
    font-weight: 600;
    color: #fff;
  }
}

.footer-col {
  min-width: 0;
  padding-top: 3px;
}

.footer-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--color-bg-white);
  margin-bottom: var(--spacing-md);
}

.footer-col ul {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-sm);
}

.footer-col a {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.75);
  transition: color 0.2s;
}

.footer-col a:hover {
  color: var(--color-bg-white);
}

.footer-bottom {
  display: flex;
  justify-content: center;
  gap: 14px;
  align-items: center;
  padding-top: var(--spacing-sm);
  font-size: 12px;
  color: rgba(255, 255, 255, 0.6);
  text-align: center;
}

.back-top {
  color: rgba(255, 255, 255, 0.75);
  font-size: 14px;
  transition: color 0.2s;
}

.back-top:hover {
  color: var(--color-bg-white);
}

.back-top-floating {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 300;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 88px;
  height: 40px;
  padding: 0 14px;
  border-radius: 999px;
  background: rgba(29, 33, 41, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: rgba(255, 255, 255, 0.9);
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.25);
}

.back-top-floating:hover {
  color: #fff;
  background: rgba(21, 93, 209, 0.96);
}

@media (max-width: 1024px) {
  #header-container {
    height: 64px;
    overflow: visible;
  }

  .site-header {
    height: 64px;
    overflow: visible;
  }

  .header-inner {
    position: relative;
  }

  .site-header .header-inner {
    padding-left: var(--spacing-md);
    padding-right: var(--spacing-md);
  }

  .logo-text {
    font-size: 17px;
  }

  .header-cta {
    display: none;
  }

  .mobile-nav-toggle {
    display: inline-flex;
  }

  .footer-top {
    grid-template-columns: 1fr;
  }

  .footer-links {
    flex-wrap: wrap;
    justify-content: flex-start;
  }
  
  .nav {
    display: none;
  }

  .mobile-nav-drawer:not([hidden]) {
    display: flex;
    flex-direction: column;
  }

  .mobile-nav-drawer {
    position: fixed;
    left: 0;
    right: 0;
    top: 64px;
    bottom: 0;
    z-index: 140;
    height: auto;
    max-height: none;
    padding: 0;
    overflow: hidden;
    background: #fff;
    border-top: 1px solid #edf0f5;
    box-shadow: 0 14px 32px rgba(0, 0, 0, 0.08);
  }

  .mobile-nav-drawer-scroll {
    flex: 1;
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-y: contain;
    padding: 10px 16px calc(20px + env(safe-area-inset-bottom, 0px));
    touch-action: pan-y;
  }

  .mobile-nav {
    display: flex;
    flex-direction: column;
  }

  .mobile-nav-link {
    display: block;
    font-size: 15px;
    padding: 12px 10px;
    border-bottom: 1px solid #f0f2f6;
  }

  .mobile-nav-summary {
    display: flex;
    align-items: center;
    width: 100%;
    min-height: 44px;
    padding: 12px 10px;
    font-size: 15px;
    font-weight: 500;
    color: var(--color-text-primary);
    list-style: none;
    cursor: pointer;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    border-bottom: 1px solid #f0f2f6;
  }

  .mobile-nav-details[open] .mobile-nav-summary {
    border-bottom-color: #e8eaef;
  }

  .mobile-nav-summary::-webkit-details-marker {
    display: none;
  }

  .mobile-nav-summary-text {
    flex: 1;
    text-align: left;
  }

  .mobile-nav-summary::after {
    content: "›";
    flex-shrink: 0;
    margin-left: 8px;
    font-size: 1.1rem;
    line-height: 1;
    opacity: 0.55;
    transform: rotate(0deg);
    transition: transform 0.2s ease;
  }

  .mobile-nav-details[open] .mobile-nav-summary::after {
    transform: rotate(90deg);
  }

  .mobile-nav-children {
    display: flex;
    flex-direction: column;
  }

  .mobile-nav-children .mobile-nav-link {
    border-bottom: 1px solid #f0f2f6;
  }

  .mobile-nav-children .mobile-nav-link:last-child {
    border-bottom: none;
  }

  .mobile-nav-sublink {
    padding-left: 28px;
    font-size: 14px;
    color: #5f6675;
  }

  .mobile-nav-cta {
    display: inline-flex;
    width: 100%;
    margin-top: 12px;
    min-height: 44px;
    padding: 12px 16px;
    font-size: 16px;
    line-height: 1.35;
    white-space: normal;
  }

  .has-mobile-nav-open {
    overflow: hidden;
    overscroll-behavior: none;
  }
}

@media (max-width: 768px) {
  .site-footer {
    padding-top: var(--spacing-2xl);
  }

  .footer-links {
    gap: var(--spacing-lg);
  }

  .footer-col {
    width: calc(50% - 12px);
  }

  .back-top-floating {
    right: 14px;
    bottom: 14px;
    min-width: 72px;
    height: 34px;
    font-size: 12px;
  }
}
