/* ============================================================
   歙霓自动化 · 导航栏样式（效仿 Kollmorgen 三层结构）
   配色：品牌蓝方案 A —— 主文字深蓝 #036DB7，悬停高亮浅蓝 #1A8ECF
   结构：① 顶部工具条  ② 主导航条(sticky吸顶)  ③ 悬停 mega 大菜单
   断点：≤992px 收起桌面导航，汉堡 + 右侧全屏抽屉
   命名：全部 jn- 前缀，避免与旧模板样式冲突
   ============================================================ */

/* ---------- 变量 ---------- */
:root {
  --jn-blue: #036DB7;        /* 品牌深蓝（logo 实心圆色） */
  --jn-blue-light: #1A8ECF;  /* 品牌浅蓝（logo 节点色） */
  --jn-hover: #DE8B20;       /* 悬停暗黄（同目标站） */
  --jn-ink: #414042;         /* 正文/子项深灰 */
  --jn-bg: #ffffff;
  --jn-line: #e6e9ef;
  --jn-shadow: 0 15px 21px -21px rgba(120, 120, 120, .55);
  --jn-h-bar: 96px;          /* 主导航条高度（加高，容纳 1.5 倍 logo） */
  --jn-h-top: 36px;          /* 工具条高度 */
}

/* ---------- 整体头部 ---------- */
.jn-header {
  position: sticky;
  top: 0;
  z-index: 900;
  background: var(--jn-bg);
  box-shadow: var(--jn-shadow);
  font-family: "Open Sans", "Microsoft YaHei", "PingFang SC", sans-serif;
}
.jn-header * { box-sizing: border-box; }

/* ---------- ① 顶部工具条 ---------- */
.jn-topbar {
  height: var(--jn-h-top);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 24px;
  padding: 0 30px;
  border-bottom: 1px solid var(--jn-line);
  font-size: 14px;
}
.jn-topbar a { color: var(--jn-ink); text-decoration: none; }
.jn-topbar a:hover { color: var(--jn-blue-light); }
.jn-top-phone { font-weight: 700; display: inline-flex; align-items: center; gap: 6px; }
.jn-top-phone svg { width: 15px; height: 15px; fill: var(--jn-blue); }
.jn-top-cta {
  background: var(--jn-blue);
  color: #fff !important;
  font-weight: 700;
  font-size: 14px;
  padding: 6px 22px;
  border-radius: 5px;
  transition: background .2s;
}
.jn-top-cta:hover { background: var(--jn-blue-light); }

/* ---------- ② 主导航条 ---------- */
.jn-bar {
  height: var(--jn-h-bar);
  display: flex;
  align-items: stretch;
  padding: 0 30px;
}
.jn-logo {
  display: flex;
  align-items: center;
  flex: 0 0 auto;
  margin-right: 40px;
}
.jn-logo img {
  height: 66px;
  width: auto;
  display: block;
}

/* 导航列表（整体靠右对齐，同目标站） */
.jn-nav { flex: 1 1 auto; }
.jn-nav > ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  align-items: stretch;
  justify-content: flex-end;
  height: 100%;
}
.jn-nav > ul > li { position: relative; display: flex; align-items: stretch; }
.jn-nav > ul > li > a {
  display: flex;
  align-items: center;
  padding: 0 20px;
  font-size: 22px;
  font-weight: 700;
  color: var(--jn-blue);
  text-decoration: none;
  white-space: nowrap;
  transition: color .2s;
}
.jn-nav > ul > li > a:hover,
.jn-nav > ul > li.jn-active > a { color: var(--jn-hover); }
/* 当前栏目：底部 3px 品牌蓝指示条 */
.jn-nav > ul > li.jn-active > a::after {
  content: "";
  position: absolute;
  left: 22px; right: 22px; bottom: 0;
  height: 3px;
  background: var(--jn-blue);
  border-radius: 2px 2px 0 0;
}

/* 工具区（电话 + 联系我们已上移至工具条，此处留搜索位） */
.jn-tools {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 14px;
}
.jn-search {
  width: 40px; height: 40px;
  display: flex; align-items: center; justify-content: center;
  border: none; background: transparent; cursor: pointer;
  border-radius: 50%;
  transition: background .2s;
}
.jn-search svg { width: 20px; height: 20px; fill: var(--jn-blue); }
.jn-search:hover { background: #eef5fa; }

/* ---------- 搜索下拉面板 ---------- */
.jn-search-panel {
  position: absolute;
  left: 0; right: 0; top: 100%;
  height: 0;
  overflow: hidden;
  background: var(--jn-bg);
  box-shadow: var(--jn-shadow);
  transition: height .3s linear;
  z-index: 898;
}
.jn-search-panel.jn-open { height: 74px; }
.jn-search-panel form {
  display: flex;
  gap: 10px;
  max-width: 760px;
  margin: 0 auto;
  padding: 17px 30px;
}
.jn-search-panel input {
  flex: 1;
  height: 40px;
  border: 1px solid var(--jn-line);
  border-radius: 4px;
  padding: 0 14px;
  font-size: 15px;
  outline: none;
}
.jn-search-panel input:focus { border-color: var(--jn-blue); }
.jn-search-panel button {
  height: 40px;
  padding: 0 26px;
  background: var(--jn-blue);
  color: #fff;
  border: none;
  border-radius: 4px;
  font-size: 15px;
  cursor: pointer;
}
.jn-search-panel button:hover { background: var(--jn-blue-light); }

/* ---------- ③ mega 大菜单（二级标签页 + 三级内容面板） ---------- */
.jn-mega {
  position: fixed;            /* 相对视口全宽；头部 sticky 于顶部，面板恒贴导航下沿 */
  left: 0; right: 0;
  top: calc(var(--jn-h-top) + var(--jn-h-bar));
  height: 0;                 /* JS 展开为内容高度，CSS 负责过渡 */
  overflow: hidden;
  background: linear-gradient(180deg, #ffffff 0%, #f7fafd 60%, #eef5fb 100%);
  border-top: 1px solid #dfe6ee;   /* 顶级导航与二级标签之间的分隔线 */
  box-shadow: var(--jn-shadow);
  transition: height .3s linear;
  z-index: 899;
}
.jn-mega-inner {
  display: flex;
  align-items: stretch;
  min-height: 320px;
}

/* ---------- 左侧预览区：灰底竖带 + 白色图片卡片 + 标题 + 描述 ---------- */
.jn-mega-preview {
  flex: 0 0 300px;
  margin-left: 10%;
  background: #f1f3f5;
  padding: 30px 34px 34px;
}
.jn-mvp-card {
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(30, 40, 60, .08);
  padding: 14px;
  height: 170px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.jn-mvp-img {
  display: block;
  max-width: 100%;
  max-height: 142px;
  object-fit: contain;
}
.jn-mvp-img.jn-empty { display: none; }
.jn-mvp-ph {
  display: none;
  color: #9aa5ad;
  font-size: 13px;
  letter-spacing: 1px;
}
.jn-mvp-ph.jn-show { display: block; }
.jn-mvp-name {
  margin-top: 18px;
  font-size: 18px;
  font-weight: 700;
  color: #2b2b2b;
}
.jn-mvp-desc {
  margin: 10px 0 0;
  font-size: 13.5px;
  font-weight: 400;
  color: #555;
  line-height: 1.75;
  display: -webkit-box;
  -webkit-line-clamp: 5;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.jn-mvp-desc.jn-hide { display: none; }
.jn-mega-preview .jn-mvp-card,
.jn-mega-preview .jn-mvp-name,
.jn-mega-preview .jn-mvp-desc {
  transition: opacity .18s;
}
.jn-mega-preview.jn-fading .jn-mvp-card,
.jn-mega-preview.jn-fading .jn-mvp-name,
.jn-mega-preview.jn-fading .jn-mvp-desc { opacity: 0; }

/* ---------- 右侧主体：二级标签行 + 分隔线 + 三级内容 ---------- */
.jn-mega-main {
  flex: 1 1 auto;
  padding: 26px 40px 34px 48px;
  min-width: 0;
}
.jn-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 30px;
  padding-bottom: 13px;
  border-bottom: 1px solid rgba(3, 109, 183, .22);   /* 二级与三级之间的分隔线 */
  margin-bottom: 20px;
}
.jn-tab {
  position: relative;
  font-size: 17.6px;
  font-weight: 700;
  color: var(--jn-blue);
  text-decoration: none;
  padding-bottom: 10px;
  white-space: nowrap;
}
.jn-tab:hover { color: var(--jn-hover); }
.jn-tab.jn-tab-on { color: var(--jn-hover); }
.jn-tab.jn-tab-on::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -14px;
  height: 3px;
  background: var(--jn-hover);
  border-radius: 2px;
}
.jn-pane { display: none; }
.jn-pane.jn-pane-on { display: block; }

.jn-mega-cols {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 0;
}
.jn-mega-col {
  flex: 0 1 auto;
  min-width: 150px;
  padding: 2px 16px;
}
/* 第四层：三级栏目下的产品列表 */
.jn-mega-col .jn-prods { list-style: none; margin: 0; padding: 0; }
.jn-mega-col .jn-prods li a {
  display: block;
  font-size: 14.5px;
  font-weight: 400;
  color: var(--jn-ink);
  line-height: 1.85;
  white-space: nowrap;
  text-decoration: none;
}
.jn-mega-col .jn-prods li a:hover { color: var(--jn-hover); }
.jn-mega-col > a {
  display: block;
  font-size: 16.5px;
  font-weight: 700;
  color: #2b2b2b;
  padding: 6px 0;
  white-space: nowrap;
  text-decoration: none;
}
.jn-mega-col > a:hover { color: var(--jn-hover); }

/* ---------- 移动端（≤992px） ---------- */
.jn-burger { display: none; }
.jn-drawer, .jn-drawer-mask { display: none; }

@media (max-width: 992px) {
  .jn-topbar { padding: 0 16px; gap: 14px; font-size: 13px; }
  .jn-bar { padding: 0 16px; height: 64px; }
  .jn-logo { margin-right: auto; }
  .jn-logo img { height: 44px; }
  .jn-nav { display: none; }
  .jn-tools { display: none; }

  /* 汉堡按钮（三条杠，垂直居中对齐） */
  .jn-burger {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-self: center;
    gap: 5px;
    width: 44px; height: 44px;
    padding: 10px;
    margin: 0;
    background: transparent;
    border: none;
    cursor: pointer;
  }
  .jn-burger span {
    display: block;
    height: 2.5px;
    background: var(--jn-blue);
    border-radius: 2px;
    transition: transform .25s, opacity .25s;
  }
  .jn-burger.jn-open span:nth-child(1) { transform: translateY(7.5px) rotate(45deg); }
  .jn-burger.jn-open span:nth-child(2) { opacity: 0; }
  .jn-burger.jn-open span:nth-child(3) { transform: translateY(-7.5px) rotate(-45deg); }

  /* 遮罩 */
  .jn-drawer-mask {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .45);
    opacity: 0;
    pointer-events: none;
    transition: opacity .3s;
    z-index: 950;
  }
  .jn-drawer-mask.jn-show { opacity: 1; pointer-events: auto; }

  /* 右侧全屏抽屉 */
  .jn-drawer {
    display: block;
    position: fixed;
    top: 0; right: 0; bottom: 0;
    width: min(82vw, 360px);
    background: #fff;
    transform: translateX(105%);
    transition: transform .3s ease;
    z-index: 960;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 18px 20px 40px;
  }
  .jn-drawer.jn-open { transform: translateX(0); }

  .jn-drawer ul { list-style: none; margin: 0; padding: 0; }
  .jn-drawer > ul > li { border-bottom: 1px solid var(--jn-line); }
  .jn-drawer a {
    display: block;
    padding: 13px 4px;
    font-size: 16px;
    font-weight: 700;
    color: var(--jn-blue);
    text-decoration: none;
  }
  /* 二级/三级折叠区：默认收起 */
  .jn-d-sub { max-height: 0; overflow: hidden; transition: max-height .3s ease; }
  .jn-d-expanded .jn-d-sub { max-height: 600px; }
  .jn-d-sub a {
    font-weight: 400;
    font-size: 14.5px;
    color: var(--jn-ink);
    padding-left: 18px;
  }
  .jn-d-sub .jn-d-sub a { padding-left: 32px; }
  /* 展开箭头 */
  .jn-d-item[data-jn-toggle]::after {
    content: "";
    float: right;
    width: 8px; height: 8px;
    border-right: 2px solid var(--jn-blue);
    border-bottom: 2px solid var(--jn-blue);
    transform: rotate(45deg);
    transition: transform .25s;
    margin-top: 12px;
  }
  .jn-d-expanded > .jn-d-item[data-jn-toggle]::after { transform: rotate(-135deg); }

  /* 工具条电话在窄屏隐藏，抽屉底部提供 */
  .jn-topbar { display: none; }
  .jn-d-cta {
    display: block;
    margin-top: 22px;
    background: var(--jn-blue);
    color: #fff !important;
    text-align: center;
    padding: 12px;
    border-radius: 5px;
    font-weight: 700;
  }
}

/* ≥993px 时抽屉相关一律不显示（防御性） */
@media (min-width: 993px) {
  .jn-drawer, .jn-drawer-mask { display: none !important; }
  .jn-burger { display: none !important; }
}
