/* ==========================================================================
   nanhu web theme · nav.css
   顶部导航 / 搜索面板 / 大菜单 / 响应式（PC + 手机端）
   ========================================================================== */

/* ============================ 导航主体 ============================ */
.nav-layoutcontainer {
  position: sticky;
  top: 0;
  z-index: 999;
  background: #ffffff;
  box-shadow: 0 1px 0 rgba(24, 32, 48, 0.05);
}

.horizontal-menu-navbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: var(--navheight);
  width: min(var(--maxwidth), calc(100% - 64px));
  margin: 0 auto;
  position: relative;
  flex-wrap: nowrap;
}

.horizontal-menu-navbar-logo a { display: flex; align-items: center; }

.horizontal-logosize {
  max-width: 142px;
  max-height: 42px;
  object-fit: contain;
}

/* ---------- 主菜单 ---------- */
.horizontal-menu-navbar-container {
  flex: 1;
  min-width: 0;
  padding: 0 14px;
}

.horizontal-container-navbar {
  display: flex;
  align-items: center;
  gap: 2px;
}

.horizontal-menu-navbar-scroll-btn {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: none;
  align-items: center;
  justify-content: center;
  color: #7c8490;
  flex-shrink: 0;
  transition: background 0.2s, color 0.2s;
}
.horizontal-menu-navbar-scroll-btn:hover { background: #f5f6f8; color: var(--Original); }
.horizontal-menu-navbar-scroll-btn svg {
  width: 15px; height: 15px; fill: none; stroke: currentColor;
  stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
}

.horizontal-menu-navbar-menu-container {
  flex: 1;
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: none;
}
.horizontal-menu-navbar-menu-container::-webkit-scrollbar { display: none; }

.horizontal-menu-navbar-menu {
  display: flex;
  align-items: center;
  gap: 2px;
  white-space: nowrap;
}

.horizontal-menu-navbar-menu > li > a {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 12px;
  font-size: 14px;
  font-weight: 500;
  color: var(--txtcl);
  border-radius: 8px;
  transition: color 0.2s;
}
.horizontal-menu-navbar-menu > li > a:hover,
.horizontal-menu-navbar-menu > li > a.nav-arrow-active { color: var(--Original); }
.horizontal-menu-navbar-menu > li > a:hover::after,
.horizontal-menu-navbar-menu > li > a.nav-arrow-active::after {
  content: "";
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 2px;
  height: 2px;
  border-radius: 2px;
  background: var(--Original);
}

.horizontal-menu-navbar-menu .nav-arrow .caret {
  width: 7px; height: 7px;
  margin-top: -3px;
  border-right: 1.6px solid currentColor;
  border-bottom: 1.6px solid currentColor;
  transform: rotate(45deg);
  opacity: 0.6;
}

/* 主导航项标签（如 HOT）：红底红字，与后台「导航设置」实时预览保持一致 */
.navbar-menu-tag {
  display: inline-flex;
  align-items: center;
  margin-left: 4px;
  font-size: 10px;
  line-height: 16px;
  padding: 0 5px;
  border-radius: 3px;
  background: #ffe9e7;
  color: #e8453c;
  font-weight: 600;
}
.navbar-menu-tag i {
  font-style: normal;
  font-size: 10px;
  line-height: 16px;
  padding: 0 5px;
  border-radius: 3px;
  background: #ffe9e7;
  color: #e8453c;
  font-weight: 600;
}

.horizontal-menu-navbar-menu .underline { display: none; }

/* 右侧链接（文档中心 / 控制台等）：跟随主菜单靠左排列，与主菜单之间加细分隔线；
   登录 / 注册固定在导航最右侧 */
.horizontal-menu-navbar-menu > li.nav-hrefs-first {
  position: relative;
  margin-left: 14px;
}
.horizontal-menu-navbar-menu > li.nav-hrefs-first::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 1px;
  height: 14px;
  background: #e6e8ec;
}

/* ---------- 右侧功能区 ---------- */
/* 右侧功能区：控制台 / 分隔线 / 登录 / 注册 一律同一行、不换行、垂直居中 */
.horizontal-menu-right-container {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: nowrap;
  gap: 14px;
  flex-shrink: 0;
  white-space: nowrap;
}

.input-inner-wrapper { position: relative; order: 0; }

.input-label {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 38px;
  padding: 0 12px;
  border-radius: 7px;
  background: #f5f6f8;
  border: 1px solid transparent;
  transition: background 0.2s, border-color 0.2s, box-shadow 0.2s;
}
.input-label:focus-within {
  background: #fff;
  border-color: rgba(250, 84, 28, 0.45);
  box-shadow: 0 6px 16px rgba(250, 84, 28, 0.08);
}

.search-input {
  width: 150px;
  border: 0;
  outline: 0;
  background: transparent;
  font-size: 13px;
  color: #333;
}
.search-input::placeholder { color: #a4a9b3; }

.search-icon {
  width: 15px; height: 15px;
  fill: none;
  stroke: #9096a3;
  stroke-width: 2;
  stroke-linecap: round;
}

.navbar-public a,
.navbar-Register a {
  color: #333;
  font-size: 14px;
  transition: color 0.2s;
}
.navbar-public a:hover,
.navbar-Register a:hover { color: var(--Original); }

.delimiter {
  flex: 0 0 1px;
  align-self: center;
  width: 1px;
  height: 14px;
  background: #e6e8ec;
}

/* 控制台入口：固定在右侧功能区（登录/注册之前），与登录/注册同一行并垂直居中 */
.navbar-console {
  display: inline-flex;
  align-items: center;
  height: 38px;
  flex-shrink: 0;
  color: #333;
  font-size: 14px;
  line-height: 1;
  white-space: nowrap;
  transition: color 0.2s;
}
.navbar-console:hover { color: var(--Original); }

.navbar-Login {
  display: flex;
  align-items: center;
  height: 38px;
  margin-left: 5px;
  padding: 0 18px;
  border-radius: 7px;
  background: var(--nav-register);
  color: #fff !important;
  font-size: 13px;
  font-weight: 500;
  transition: background 0.2s, box-shadow 0.2s;
}
.navbar-Login:hover {
  background: var(--nav-register-hover);
  box-shadow: 0 8px 18px rgba(244, 122, 32, 0.28);
}

/* ============================ 搜索面板 ============================ */
.nav-search {
  position: absolute;
  top: calc(100% + 12px);
  right: 0;
  width: 430px;
  max-width: calc(100vw - 32px);
  padding: 20px;
  background: #fff;
  border: 1px solid #f0f0f0;
  border-radius: 12px;
  box-shadow: 0 18px 44px rgba(24, 32, 48, 0.12);
  display: none;
  z-index: 80;
}
.nav-search.open { display: block; animation: fxFadeDown 0.22s ease; }

.nav-search-body { position: relative; }

.nav-search-close {
  position: absolute;
  top: -6px;
  right: -6px;
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #98a0aa;
  border-radius: 50%;
  transition: background 0.2s, color 0.2s;
}
.nav-search-close:hover { background: #f5f6f8; color: #333; }
.nav-search-close svg {
  width: 13px; height: 13px; fill: none; stroke: currentColor;
  stroke-width: 2; stroke-linecap: round;
}

.nav-search-tabs {
  display: flex;
  gap: 22px;
  border-bottom: 1px solid #f0f2f5;
  padding-bottom: 10px;
  margin-bottom: 16px;
}

.nav-search-tab {
  position: relative;
  font-size: 14px;
  color: #8a9297;
  cursor: pointer;
  padding-bottom: 4px;
  transition: color 0.2s;
}
.nav-search-tab:hover { color: #4b5563; }
.nav-search-tab.active { color: var(--Original); font-weight: 600; }
.nav-search-tab.active::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -11px;
  height: 2px;
  border-radius: 2px;
  background: var(--Original);
}

.nav-search-input-wrapper {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 42px;
  padding: 0 12px;
  border: 1px solid #eceef2;
  border-radius: 9px;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.nav-search-input-wrapper:focus-within {
  border-color: rgba(250, 84, 28, 0.45);
  box-shadow: 0 0 0 3px rgba(250, 84, 28, 0.08);
}
.nav-search-input { flex: 1; border: 0; outline: 0; font-size: 14px; background: transparent; }
.nav-search-input-suffix { display: flex; }

.nav-search-hotProducts {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 18px 0 10px;
}
.nav-search-hotProducts-title { font-size: 13px; color: #8a9297; }

.nav-search-recommendation { display: flex; flex-wrap: wrap; gap: 8px; }

.nav-search-hot-link {
  padding: 5px 12px;
  border-radius: 99px;
  background: #f6f7f9;
  color: #4b5563;
  font-size: 13px;
  transition: background 0.2s, color 0.2s;
}
.nav-search-hot-link:hover { background: rgba(250, 84, 28, 0.08); color: var(--Original); }

/* ============================ 大菜单 ============================ */
.menu-dropdown-container {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  z-index: 60;
  display: none;
}
.menu-dropdown-container.open { display: block; }

.menu-dropdown-panel { display: none; }
.menu-dropdown-panel.active { display: block; animation: fxFadeDown 0.2s ease; }

.Submenu-container {
  display: flex;
  width: min(1180px, calc(100% - 64px));
  margin: 0 auto;
  border-radius: 0 0 12px 12px;
  box-shadow: 0 22px 44px rgba(24, 32, 48, 0.1);
  overflow: hidden;
}

.Submenu-left {
  width: 268px;
  min-width: 268px;
  background: #f7f9fd;
  padding: 28px 0 28px 28px;
}

.Submenu-menuInfo-title {
  font-size: 26px;
  font-weight: 300;
  color: #000;
  line-height: 1.35;
  margin-bottom: 8px;
}

.Submenu-product-list { margin: 14px 0 24px; }

.Submenu-product-name {
  display: flex;
  line-height: 42px;
}
.Submenu-product-name a {
  position: relative;
  display: block;
  max-width: 214px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  color: var(--txtcl);
  font-size: 14px;
  cursor: pointer;
}
.Submenu-product-name a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 0;
  height: 2px;
  background-color: var(--Original);
  transition: all 0.5s ease-out;
}
.Submenu-product-name:hover a { color: var(--Original); }
.Submenu-product-name.active a { font-weight: 500; color: var(--Original); }
.Submenu-product-name.active a::after { width: 100%; }

.Submenu-right {
  flex: 1;
  min-width: 0;
  background: #fff;
  padding: 24px 32px;
  min-height: 420px;
  max-height: 72vh;
  overflow-y: auto;
}

.Submenu-products { display: none; }
.Submenu-products.active {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  align-content: start;
}

.list-product-content {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  min-height: 88px;
  padding: 16px 22px;
  border-radius: var(--radius-pill);
  background: rgba(240, 244, 255, 0.24);
  box-shadow: 0 1px 3px rgba(49, 49, 49, 0.02);
  transition: box-shadow 0.2s ease, background 0.2s ease;
  overflow: hidden;
}
.list-product-content:hover {
  background: #fff;
  box-shadow: 0 6px 18px rgba(49, 49, 49, 0.12);
  animation: fxShake 0.5s ease 1;
}

.list-product-title {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.5;
  color: var(--txtcl);
  transition: color 0.3s ease-out;
}
.list-product-content:hover .list-product-name { color: var(--Original); }

.list-product-hot {
  color: #ff2626;
  font-size: 12px;
  font-weight: 500;
  font-style: normal;
  border: 1px solid #ff2626;
  padding: 1px 4px;
  flex-shrink: 0;
}
.list-product-hot i { font-style: normal; }

/* ============================ 动画 ============================ */
@keyframes fxFadeDown {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: none; }
}
@keyframes fxShake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-4px); }
  75% { transform: translateX(4px); }
}

/* ==========================================================================
   响应式：手机端
   ========================================================================== */
@media (max-width: 1100px) {
  .horizontal-menu-navbar { width: calc(100% - 48px); }
  .search-input { width: 110px; }
}

@media (max-width: 900px) {
  /* 三行堆叠：Logo / 搜索 + 账户 / 可横滑菜单 */
  .horizontal-menu-navbar {
    flex-wrap: wrap;
    width: calc(100% - 32px);
    height: auto;
    min-height: 70px;
    padding: 8px 0 0;
    row-gap: 4px;
  }

  .horizontal-menu-navbar-logo { order: 1; }
  .horizontal-logosize { max-height: 36px; }

  .horizontal-menu-navbar-search { order: 2; margin-left: auto; }
  .horizontal-menu-right-container { gap: 8px; }

  .navbar-public,
  .delimiter,
  .nav-hrefs,
  .navbar-console { display: none; }

  .navbar-Register { display: none; }
  .navbar-Login { height: 34px; padding: 0 14px; margin-left: 0; }

  .search-input { width: 120px; }
  .input-label { height: 34px; border-radius: 17px; }

  .horizontal-menu-navbar-container {
    order: 3;
    /* 基础样式的 flex:1 会令 flex-basis:0%，导致不换行、菜单被挤在首行；
       显式 flex-basis:100% 让菜单独占第二行，首行仅 Logo + 登录/注册（贴右） */
    flex: 1 1 100%;
    width: 100%;
    padding: 0;
    margin-top: 2px;
    border-top: 1px solid #f4f5f7;
  }
  .horizontal-menu-navbar-menu-container { overflow-x: auto; }
  .horizontal-menu-navbar-menu { padding: 2px 0 6px; }
  .horizontal-menu-navbar-menu > li > a { padding: 8px 10px; font-size: 13.5px; }
  .horizontal-menu-navbar-scroll-btn { display: none !important; }

  /* 手机端：点击有子菜单的项原地展开大菜单（抽屉式：标题 + 横滑分类 + 卡片列表） */
  .Submenu-container {
    flex-direction: column;
    width: 100%;
    border-radius: 0 0 18px 18px;
    max-height: calc(100vh - 120px);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }
  .Submenu-left {
    width: 100%;
    min-width: 0;
    padding: 16px 16px 12px;
    border-bottom: 1px solid #edf1f6;
  }
  .Submenu-menuInfo-title { font-size: 17px; margin-bottom: 10px; }
  /* 二级分类：横滑圆角标签，避免换行挤压 */
  .Submenu-product-list {
    display: flex;
    flex-wrap: nowrap;
    gap: 8px;
    margin: 0;
    padding-bottom: 2px;
    overflow-x: auto;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }
  .Submenu-product-list::-webkit-scrollbar { display: none; }
  .Submenu-product-name { flex: 0 0 auto; line-height: 1; }
  .Submenu-product-name a {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    max-width: none;
    padding: 8px 14px;
    border: 1px solid #e5ebf2;
    border-radius: 999px;
    background: #fff;
    font-size: 13px;
    line-height: 1.4;
  }
  .Submenu-product-name a::after { display: none; }
  .Submenu-product-name.active a {
    border-color: var(--Original);
    background: rgba(250, 84, 28, 0.07);
  }
  .Submenu-right {
    padding: 14px 16px 18px;
    min-height: 0;
    max-height: none;
    overflow: visible;
  }
  .Submenu-products.active { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .list-product-content {
    min-height: 52px;
    padding: 13px 14px;
    border: 1px solid #eef2f6;
    border-radius: 12px;
    background: #fff;
  }
  .list-product-content:hover { border-color: #f4d7c4; }
  .list-product-title { font-size: 13.5px; }

  .nav-search {
    position: fixed;
    left: 12px;
    right: 12px;
    top: 74px;
    width: auto;
    max-width: none;
  }
}

@media (max-width: 540px) {
  .horizontal-logosize { max-width: 116px; }
  .search-input { width: 88px; }
  .navbar-Login { padding: 0 12px; font-size: 12.5px; }
  .nav-search { top: 70px; padding: 16px; }
  .nav-search-tabs { gap: 16px; }
}

/* ============================ 顶部公告条 ============================ */
.site-notice-bar {
  background: #fff4ea;
  border-bottom: 1px solid #f6ddc5;
}
.site-notice-bar.hidden { display: none; }
.site-notice-inner {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 40px;
  font-size: 13px;
  color: #8a5a3a;
}
.site-notice-icon {
  flex-shrink: 0;
  width: 16px;
  height: 16px;
  fill: none;
  stroke: #e56721;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.site-notice-text {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.site-notice-text a { color: #b54108; font-weight: 600; }
.site-notice-text a:hover { color: #d22c00; }
.site-notice-close {
  flex-shrink: 0;
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  color: #b08b6d;
  transition: background 0.2s, color 0.2s;
}
.site-notice-close svg {
  width: 13px;
  height: 13px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
}
.site-notice-close:hover { background: #ffe9d6; color: #8a5a3a; }

/* ============================ 弹窗公告 ============================ */
.fx-popup-mask {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  background: rgba(20, 16, 12, 0.45);
  -webkit-backdrop-filter: blur(2px);
  backdrop-filter: blur(2px);
  opacity: 0;
  transition: opacity 0.22s ease;
}
.fx-popup-mask[hidden] { display: none; }
.fx-popup-mask.show { opacity: 1; }
.fx-popup {
  position: relative;
  width: min(680px, calc(100% - 32px));
  margin-top: 16vh;
  max-height: 70vh;
  overflow: auto;
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 30px 80px rgba(24, 16, 8, 0.28);
  transform: translateY(-14px);
  transition: transform 0.22s ease;
}
.fx-popup-mask.show .fx-popup { transform: none; }
.fx-popup-close {
  position: absolute;
  top: 10px;
  right: 12px;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  color: #98a0aa;
  font-size: 20px;
  line-height: 1;
  transition: background 0.2s, color 0.2s;
}
.fx-popup-close:hover { background: #f5f6f8; color: #333; }
.fx-popup-body {
  padding: 32px 32px 8px;
  font-size: 14px;
  line-height: 1.9;
  color: #5a4f48;
  word-break: break-word;
}
.fx-popup-body img { max-width: 100%; height: auto; }
.fx-popup-body p { margin: 0 0 10px; }
.fx-popup-footer {
  display: flex;
  justify-content: center;
  padding: 14px 24px 24px;
}
.fx-popup-btn {
  min-width: 160px;
  height: 42px;
  padding: 0 24px;
  border-radius: 8px;
  background: linear-gradient(180deg, #ff6830, #fa541c 64%, #d22c00);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  box-shadow: 0 8px 18px rgba(250, 84, 28, 0.28);
  transition: filter 0.2s, transform 0.2s;
}
.fx-popup-btn:hover { filter: brightness(1.06); transform: translateY(-1px); }

@media (max-width: 540px) {
  .fx-popup { margin-top: 10vh; }
  .fx-popup-body { padding: 26px 18px 6px; }
}
