/* ============================================================
   恒展智诚 · 站点骨架布局
   顶部信息条 / 主导航(含 Mega Menu) / 页脚 / 右侧悬浮转化栏
   ============================================================ */

/* ---------- 通用容器 ---------- */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}

/* ============================================================
   一、头部功能区 .header-utils（原顶部信息条并入主导航）
   咨询电话 + 站内搜索 + 语言切换
   ============================================================ */
.header-utils {
  display: flex;
  align-items: center;
  gap: 22px;
  flex-shrink: 0;
}

/* 咨询电话（号码橙色加亮） */
.header-tel {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-secondary);
  white-space: nowrap;
}

.header-tel strong {
  font-family: var(--font-en);
  font-size: 16px;
  font-weight: 700;
  color: var(--brand-orange);
}

/* 搜索框 */
.header-search {
  position: relative;
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-gray);
  padding: 6px 12px;
}

.header-search input {
  background: transparent;
  border: none;
  color: var(--text-primary);
  font-size: 13px;
  width: 130px;
}

.header-search input::placeholder {
  color: #9aa5b1;
}

.header-search .search-icon {
  display: flex;
  color: var(--text-secondary);
  font-size: 12px;
}

/* 语言切换 */
.header-lang {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  white-space: nowrap;
}

.header-lang a {
  padding: 1px 6px;
  opacity: 0.6;
  transition: var(--transition);
}

.header-lang a.active,
.header-lang a:hover {
  opacity: 1;
  color: var(--brand-orange);
  background: var(--brand-orange-light);
}

/* ---------- 搜索结果下拉（search.js 动态挂载） ---------- */
.search-results {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 280px;
  background: var(--bg-white);
  border-radius: var(--radius-btn);
  box-shadow: var(--shadow-hover);
  border: 1px solid var(--border);
  overflow: hidden;
  display: none;
  z-index: 1100;
}

.search-results.is-open {
  display: block;
}

.search-result-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  color: var(--text-primary);
  font-size: 14px;
  transition: background 0.2s ease;
}

.search-result-item:hover {
  background: var(--brand-orange-light);
}

.search-result-item em {
  font-style: normal;
  color: var(--brand-orange);
  font-weight: 700;
}

.search-result-cat {
  flex-shrink: 0;
  font-size: 12px;
  color: var(--text-secondary);
  background: var(--bg-gray);
  border-radius: 10px;
  padding: 1px 8px;
}

.search-empty {
  padding: 14px;
  font-size: 13px;
  color: var(--text-secondary);
  text-align: center;
}

/* ============================================================
   二、主导航 .header（毛玻璃 sticky）
   ============================================================ */
.header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: rgba(255, 255, 255, 0.92); /* 不支持模糊时的回退：近不透明白 */
  border-bottom: 1px solid var(--border);
  transition: box-shadow 0.3s ease, transform 0.35s ease;
}

/* 高斯模糊毛玻璃：滚动时下层内容在导航后虚化透出 */
@supports ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .header {
    background: rgba(255, 255, 255, 0.72);
    -webkit-backdrop-filter: blur(14px) saturate(1.5);
    backdrop-filter: blur(14px) saturate(1.5);
  }
}

/* 下滑时由 main.js 添加，导航向上收起隐藏；上滑即恢复 */
.header.is-hidden {
  transform: translateY(-100%);
}

/* 滚动后由 main.js 添加阴影 */
.header.is-stuck {
  box-shadow: 0 4px 20px rgba(10, 61, 98, 0.12);
}

/* 不走 .container 限宽：logo 紧贴页面左侧，功能区紧贴右侧 */
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 76px;
  padding: 0 24px;
}

/* ---- Logo 区 ---- */
.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

/* 品牌 logo 图片（assets/images/logo.png，透明底） */
.logo-img {
  height: 46px;
  width: auto;
  display: block;
}

/* 橙色太阳造型纯 CSS logo */
.logo-sun {
  position: relative;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #4E9BFF, var(--brand-orange));
  box-shadow: 0 0 0 4px var(--brand-orange-light);
}

/* 太阳光芒 */
.logo-sun::before {
  content: "";
  position: absolute;
  inset: -7px;
  border-radius: 50%;
  background:
    conic-gradient(from 0deg,
      var(--brand-orange) 0deg 12deg, transparent 12deg 45deg,
      var(--brand-orange) 45deg 57deg, transparent 57deg 90deg,
      var(--brand-orange) 90deg 102deg, transparent 102deg 135deg,
      var(--brand-orange) 135deg 147deg, transparent 147deg 180deg,
      var(--brand-orange) 180deg 192deg, transparent 192deg 225deg,
      var(--brand-orange) 225deg 237deg, transparent 237deg 270deg,
      var(--brand-orange) 270deg 282deg, transparent 282deg 315deg,
      var(--brand-orange) 315deg 327deg, transparent 327deg 360deg);
  -webkit-mask: radial-gradient(circle, transparent 24px, #000 25px);
          mask: radial-gradient(circle, transparent 24px, #000 25px);
}

/* 太阳中心的高光点 */
.logo-sun::after {
  content: "";
  position: absolute;
  top: 9px;
  left: 10px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.55);
}

.logo-text {
  line-height: 1.2;
}

.logo-text .logo-cn {
  display: block;
  font-size: 22px;
  font-weight: 700;
  color: var(--brand-blue);
  letter-spacing: 2px;
}

.logo-text .logo-en {
  display: block;
  font-family: var(--font-en);
  font-size: 10px;
  color: var(--text-secondary);
  letter-spacing: 1.5px;
}

/* ---- 一级菜单 ---- */
.nav {
  display: flex;
  align-items: center;
  height: 100%;
}

.nav-item {
  position: relative;
  height: 100%;
  display: flex;
  align-items: center;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 0 16px;
  height: 76px;
  font-size: 15px;
  font-weight: 500;
  color: var(--text-primary);
  position: relative;
  transition: color 0.25s ease;
  white-space: nowrap;
}

/* 当前页 / hover 橙色下划线 */
.nav-link::after {
  content: "";
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: 0;
  height: 3px;
  background: var(--brand-orange);
  border-radius: 2px;
  transform: scaleX(0);
  transition: transform 0.25s ease;
}

.nav-link:hover,
.nav-item.active > .nav-link {
  color: var(--brand-orange);
}

.nav-link:hover::after,
.nav-item.active > .nav-link::after {
  transform: scaleX(1);
}

/* 下拉箭头 */
.nav-link .caret {
  font-size: 10px;
  transition: transform 0.25s ease;
}

.nav-item:hover .caret {
  transform: rotate(180deg);
}

/* ---- 简单下拉菜单 ---- */
.dropdown {
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translate(-50%, 8px);
  min-width: 180px;
  background: #fff;
  border-radius: 10px;
  box-shadow: var(--shadow-hover);
  padding: 8px;
  opacity: 0;
  visibility: hidden;
  transition: var(--transition);
  z-index: 100;
}

.nav-item:hover > .dropdown {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, 0);
}

.dropdown a {
  display: block;
  padding: 10px 16px;
  font-size: 14px;
  color: var(--text-primary);
  border-radius: 6px;
  transition: var(--transition);
}

.dropdown a:hover {
  background: var(--brand-orange-light);
  color: var(--brand-orange);
}

/* ---- Mega Menu（产品中心） ---- */
.mega-menu {
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translate(-50%, 8px);
  width: 860px;
  max-width: calc(100vw - 48px);
  background: #fff;
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-hover);
  padding: 28px;
  display: flex;
  gap: 28px;
  opacity: 0;
  visibility: hidden;
  transition: var(--transition);
  z-index: 100;
}

.nav-item:hover > .mega-menu {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, 0);
}

/* 左侧 5 个分类列 */
.mega-menu-cats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px 28px;
  flex: 1;
}

.mega-cat-title {
  display: block;
  font-size: 15px;
  font-weight: 700;
  color: var(--brand-blue);
  padding-bottom: 8px;
  margin-bottom: 8px;
  border-bottom: 2px solid var(--brand-orange);
}

.mega-cat-title:hover {
  color: var(--brand-orange);
}

.mega-cat-links a {
  display: block;
  font-size: 13px;
  color: var(--text-secondary);
  padding: 4px 0;
  transition: var(--transition);
}

.mega-cat-links a:hover {
  color: var(--brand-orange);
  padding-left: 4px;
}

/* 右侧主题图占位 */
.mega-menu-aside {
  width: 220px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.mega-menu-aside .img-ph {
  flex: 1;
  min-height: 180px;
  border-radius: 10px;
}

.mega-menu-aside .mega-aside-link {
  text-align: center;
  font-size: 13px;
  font-weight: 600;
  color: var(--brand-orange);
}

/* ---- 汉堡按钮（≤1024 显示） ---- */
.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  padding: 8px;
}

.nav-toggle span {
  display: block;
  height: 2px;
  background: var(--brand-blue);
  border-radius: 2px;
  transition: var(--transition);
}

/* 汉堡 → 叉号动画 */
.nav-toggle.is-open span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.nav-toggle.is-open span:nth-child(2) {
  opacity: 0;
}

.nav-toggle.is-open span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* ---- 移动端抽屉菜单 ---- */
.nav-drawer-mask {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  z-index: 1100;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.nav-drawer-mask.is-open {
  opacity: 1;
}

.nav-drawer {
  display: none;
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 300px;
  max-width: 85vw;
  background: #fff;
  z-index: 1200;
  transform: translateX(100%);
  transition: transform 0.3s ease;
  overflow-y: auto;
  padding: 20px 0 40px;
}

.nav-drawer.is-open {
  transform: translateX(0);
}

.nav-drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px 16px;
  border-bottom: 1px solid var(--border);
  font-weight: 700;
  color: var(--brand-blue);
}

.nav-drawer-close {
  font-size: 22px;
  color: var(--text-secondary);
  line-height: 1;
}

/* 抽屉一级项 */
.drawer-item {
  border-bottom: 1px solid var(--bg-gray);
}

.drawer-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 14px 20px;
  font-size: 15px;
  color: var(--text-primary);
  text-align: left;
}

.drawer-link.active {
  color: var(--brand-orange);
}

/* 可展开的子级箭头 */
.drawer-link .caret {
  font-size: 11px;
  color: var(--text-secondary);
  transition: transform 0.25s ease;
}

.drawer-item.is-expanded > .drawer-link .caret {
  transform: rotate(180deg);
}

/* 抽屉二/三级，默认收起 */
.drawer-sub {
  display: none;
  background: var(--bg-gray);
  padding: 6px 0;
}

.drawer-item.is-expanded > .drawer-sub {
  display: block;
}

.drawer-sub a,
.drawer-sub .drawer-sub-title {
  display: block;
  padding: 9px 20px 9px 34px;
  font-size: 14px;
  color: var(--text-secondary);
}

.drawer-sub .drawer-sub-title {
  font-weight: 600;
  color: var(--brand-blue);
}

.drawer-sub .drawer-sub-links a {
  padding-left: 48px;
  font-size: 13px;
}

.drawer-sub a:hover {
  color: var(--brand-orange);
}

/* ============================================================
   三、页脚 .footer
   ============================================================ */
.footer {
  background: var(--brand-blue-dark);
  color: rgba(255, 255, 255, 0.75);
  font-size: 14px;
}

.footer-main {
  display: grid;
  /* 5 列导航 + 联系区 */
  grid-template-columns: repeat(5, 1fr) 1.4fr;
  gap: 32px;
  padding: 60px 0 40px;
}

.footer-col-title {
  font-size: 16px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 18px;
}

.footer-col a {
  display: block;
  padding: 5px 0;
  transition: var(--transition);
}

.footer-col a:hover {
  color: var(--brand-orange);
  padding-left: 4px;
}

/* 联系区 */
.footer-contact .footer-tel {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}

.footer-contact .footer-tel .label {
  color: rgba(255, 255, 255, 0.55);
  flex-shrink: 0;
}

.footer-contact .footer-tel strong {
  font-family: var(--font-en);
  font-size: 18px;
  color: var(--brand-orange);
}

.footer-addr {
  display: flex;
  gap: 8px;
  margin-bottom: 10px;
  line-height: 1.7;
}

.footer-addr .addr-tag {
  flex-shrink: 0;
  background: rgba(22, 104, 220, 0.18);
  color: var(--brand-orange);
  font-size: 12px;
  padding: 1px 8px;
  border-radius: 4px;
  height: fit-content;
  margin-top: 3px;
}

/* 底部 bar */
.footer-bar {
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  padding: 18px 0;
  text-align: center;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.5);
}

.footer-bar a:hover {
  color: var(--brand-orange);
}

/* ============================================================
   四、右侧悬浮转化栏 .floatbar
   ============================================================ */
.floatbar {
  position: fixed;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  z-index: 900;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.floatbar-item {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  background: var(--brand-blue);
  color: #fff;
  font-size: 20px;
  transition: var(--transition);
  cursor: pointer;
}

.floatbar-item:first-child {
  border-radius: 8px 0 0 0;
}

.floatbar-item:last-child {
  border-radius: 0 0 0 8px;
}

.floatbar-item:hover {
  background: var(--brand-orange);
}

/* hover 展开的气泡（热线号码等） */
.floatbar-pop {
  position: absolute;
  right: 60px;
  top: 50%;
  transform: translateY(-50%);
  white-space: nowrap;
  background: #fff;
  color: var(--brand-blue);
  font-size: 14px;
  font-weight: 700;
  font-family: var(--font-en);
  padding: 10px 16px;
  border-radius: 8px;
  box-shadow: var(--shadow-hover);
  opacity: 0;
  visibility: hidden;
  transition: var(--transition);
  pointer-events: none;
}

.floatbar-pop::after {
  content: "";
  position: absolute;
  right: -6px;
  top: 50%;
  transform: translateY(-50%);
  border: 6px solid transparent;
  border-left-color: #fff;
  border-right: none;
}

.floatbar-item:hover .floatbar-pop {
  opacity: 1;
  visibility: visible;
}

/* 回顶部按钮：默认隐藏，滚动 300px 后由 main.js 显示 */
.floatbar-backtop {
  opacity: 0;
  visibility: hidden;
}

.floatbar-backtop.is-visible {
  opacity: 1;
  visibility: visible;
}

/* ============================================================
   响应式
   ============================================================ */
/* 中等屏：压缩头部功能区，避免与导航拥挤 */
@media (max-width: 1360px) {
  .header-tel span {
    display: none; /* 只保留号码 */
  }

  .header-search input {
    width: 96px;
  }

  .header-utils {
    gap: 14px;
  }
}

@media (max-width: 1280px) {
  .header-tel {
    display: none; /* 电话由悬浮栏/联系页承接 */
  }
}

@media (max-width: 1150px) {
  .header-search {
    display: none;
  }
}

@media (max-width: 1024px) {
  /* 折叠为汉堡菜单 */
  .nav,
  .mega-menu,
  .dropdown {
    display: none;
  }

  /* 移动端仅保留语言切换；电话由悬浮栏承接，搜索暂不展开 */
  .header-tel,
  .header-search {
    display: none;
  }

  .nav-toggle {
    display: flex;
  }

  .nav-drawer,
  .nav-drawer-mask {
    display: block;
  }

  .nav-drawer-mask {
    visibility: hidden;
  }

  .nav-drawer-mask.is-open {
    visibility: visible;
  }

  .footer-main {
    grid-template-columns: repeat(3, 1fr);
  }

  .footer-contact {
    grid-column: 1 / -1;
  }
}

@media (max-width: 768px) {
  .header-inner {
    height: 64px;
    padding: 0 16px;
  }

  /* 小屏压缩 logo 区，避免挤出右侧汉堡按钮 */
  .logo-img {
    height: 38px;
  }

  .logo-text .logo-en {
    display: none;
  }

  .nav-link {
    height: 64px;
  }

  .footer-main {
    grid-template-columns: repeat(2, 1fr);
    padding: 44px 0 30px;
  }

  /* 移动端悬浮栏缩小，避免遮挡内容 */
  .floatbar-item {
    width: 44px;
    height: 44px;
    font-size: 17px;
  }
}
