/* 买化塑 PC 公共头部样式（topbar / logo+搜索 / 主导航）
 * 由 mhs_v2.css 头部段抽取，供 base/header.html 全站引入（须在 mhsIndex 之后）
 */

/* 买化塑 PC 商城首页 v2 - 头部样式 */

#app {
  font-family: "Microsoft YaHei", "PingFang SC", sans-serif;
  font-size: 12px;
  color: #333;
}

.mhs-v2-container {
  width: 1312px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* ========== 顶部工具栏 ========== */
.mhs-v2-topbar {
  background-color: #302f75;
  color: #fff;
  height: 32px;
  line-height: 32px;
  position: relative;
  z-index: 101;
  font-size: 12px;
  font-family: "Microsoft YaHei", "PingFang SC", sans-serif;
  overflow: visible;
}

.mhs-v2-topbar-left,
.mhs-v2-topbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
  overflow: visible;
}

.mhs-v2-topbar .mhs-v2-container {
  overflow: visible;
}

.mhs-v2-header-wrapper {
  display: contents;
}

.mhs-v2-welcome {
  margin-right: 4px;
}

.mhs-v2-topbar .mhs-v2-link,
.mhs-v2-topbar .mhs-v2-dropdown-trigger,
.mhs-v2-topbar .mhs-v2-welcome,
.mhs-v2-topbar .mhs-v2-divider {
  font-size: 12px !important;
  font-family: "Microsoft YaHei", "PingFang SC", sans-serif !important;
  line-height: 32px;
}

.mhs-v2-topbar .mhs-v2-link {
  color: #fff;
  text-decoration: none;
  white-space: nowrap;
  margin: 0 10px;
}

.mhs-v2-topbar .mhs-v2-link:hover {
  opacity: 0.85;
}

.mhs-v2-divider {
  color: rgba(255, 255, 255, 0.5);
  user-select: none;
}

.mhs-v2-dropdown-arrow {
  display: inline-block;
  width: 6px;
  height: 6px;
  margin-left: 2px;
  margin-top: -2px;
  vertical-align: middle;
  border-right: 1px solid currentColor;
  border-bottom: 1px solid currentColor;
  transform: rotate(45deg);
  flex-shrink: 0;
  transition: transform 0.2s;
  box-sizing: border-box;
}

/* ========== 顶部下拉菜单（收藏夹等） ========== */
.mhs-v2-dropdown {
  position: relative;
  height: 32px;
}

.mhs-v2-dropdown-trigger {
  display: flex;
  align-items: center;
  gap: 5px;
  height: 32px;
  padding: 0 10px;
  cursor: pointer;
  color: #fff;
  white-space: nowrap;
  box-sizing: border-box;
}

.mhs-v2-dropdown:hover .mhs-v2-dropdown-trigger {
  background-color: #fff;
  color: #302f75;
}

.mhs-v2-dropdown:hover .mhs-v2-dropdown-arrow {
  transform: rotate(-135deg);
}

.mhs-v2-dropdown-menu {
  display: none;
  position: absolute;
  left: 0;
  top: 32px;
  min-width: 100%;
  width: max-content;
  padding: 5px 9px;
  background-color: #fff;
  border: 1px solid #eaeaea;
  border-top: 0;
  box-sizing: border-box;
  z-index: 102;
}

.mhs-v2-dropdown:hover .mhs-v2-dropdown-menu {
  display: block;
}

.mhs-v2-dropdown-menu a {
  display: block;
  line-height: 28px;
  color: #333;
  text-decoration: none;
  white-space: nowrap;
}

.mhs-v2-dropdown-menu a:hover {
  color: #302f75;
}

.mhs-v2-dropdown--right .mhs-v2-dropdown-menu {
  left: auto;
  right: 0;
}

.mhs-v2-dropdown-menu--service {
  min-width: 156px;
  padding: 0 9px;
}

.mhs-v2-service-top,
.mhs-v2-service-bottom {
  padding: 5px 0;
  text-align: center;
}

.mhs-v2-service-top {
  position: relative;
}

.mhs-v2-service-top::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 0;
  width: 100px;
  height: 1px;
  margin-left: -50px;
  background-color: #f0f0f0;
}

.mhs-v2-service-top h4,
.mhs-v2-service-bottom h4 {
  font-size: 14px;
  line-height: 24px;
  font-weight: normal;
  color: #333;
}

.mhs-v2-service-top h4 a {
  color: #333;
  text-decoration: none;
}

.mhs-v2-service-top h4 a:hover {
  color: #302f75;
}

.mhs-v2-service-links {
  line-height: 24px;
}

.mhs-v2-service-links a {
  display: inline-block;
  margin: 0 10px;
  line-height: 24px;
  color: #666;
  text-decoration: none;
}

.mhs-v2-service-links a:hover {
  color: #302f75;
}

.mhs-v2-service-bottom p {
  line-height: 24px;
  color: #333;
}

/* ========== 主头部 ========== */
.mhs-v2-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background-color: #fff;
  padding: 12px 0;
  box-shadow: none;
  transition: box-shadow 0.2s ease;
}

.mhs-v2-header.is-sticky {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.mhs-v2-header-sentinel {
  height: 0;
  margin: 0;
  padding: 0;
  overflow: hidden;
  pointer-events: none;
}

.mhs-v2-header .mhs-v2-container {
  align-items: center;
}

.mhs-v2-logo {
  display: block;
  text-decoration: none;
  flex-shrink: 0;
  margin-left: 15px;
}

.mhs-v2-logo img {
  display: block;
  height: 60px;
  width: auto;
}

.mhs-v2-search-area {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.mhs-v2-search-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.mhs-v2-search-box {
  display: flex;
  align-items: center;
  width: 560px;
  height: 45px;
  padding: 2px 2px 2px 0;
  border: 1px solid #302f75;
  border-radius: 999px;
  box-sizing: border-box;
  background: #fff;
  overflow: hidden;
}

.mhs-v2-search-input {
  flex: 1;
  min-width: 0;
  height: 100%;
  border: none;
  outline: none;
  padding: 0 18px;
  font-size: 14px;
  color: #333;
  background: transparent;
  border-radius: 999px 0 0 999px;
  -webkit-appearance: none;
  appearance: none;
}

/* 覆盖旧版 mhsIndex.css #s1 定位，避免空搜 .active 闪烁错位 */
.mhs-v2-search-box .mhs-v2-search-input,
.mhs-v2-search-box #s1 {
  position: static !important;
  top: auto !important;
  left: auto !important;
  right: auto !important;
  bottom: auto !important;
  float: none !important;
  width: auto !important;
  max-width: none !important;
  min-width: 0 !important;
  flex: 1 1 auto !important;
  height: 100% !important;
  min-height: 0 !important;
  max-height: none !important;
  line-height: normal !important;
  margin: 0 !important;
  padding: 0 18px !important;
  box-sizing: border-box !important;
  border: none !important;
  outline: none !important;
  background: transparent !important;
  background-color: transparent !important;
  border-radius: 999px 0 0 999px !important;
  -webkit-appearance: none !important;
  appearance: none !important;
  vertical-align: middle !important;
  transform: none !important;
}

/* Chrome 部分版本：下拉回填 / autofill 会给 input 加黄底并撑破圆角 */
.mhs-v2-search-box .mhs-v2-search-input:-webkit-autofill,
.mhs-v2-search-box .mhs-v2-search-input:-webkit-autofill:hover,
.mhs-v2-search-box .mhs-v2-search-input:-webkit-autofill:focus,
.mhs-v2-search-box .mhs-v2-search-input:-webkit-autofill:active,
.mhs-v2-search-box #s1:-webkit-autofill,
.mhs-v2-search-box #s1:-webkit-autofill:hover,
.mhs-v2-search-box #s1:-webkit-autofill:focus,
.mhs-v2-search-box #s1:-webkit-autofill:active {
  -webkit-text-fill-color: #333 !important;
  caret-color: #333;
  border: none !important;
  border-radius: 999px 0 0 999px !important;
  box-shadow: 0 0 0 1000px #fff inset !important;
  transition: background-color 99999s ease-out 0s;
  -webkit-transition: background-color 99999s ease-out 0s;
}

.mhs-v2-search-box .mhs-v2-search-input.active,
.mhs-v2-search-box #s1.active {
  position: static !important;
  top: auto !important;
  left: auto !important;
  border-radius: 999px 0 0 999px;
  animation: mhs-v2-search-flash 1.5s ease-in-out 0s 1 alternate forwards !important;
  -webkit-animation: mhs-v2-search-flash 1.5s ease-in-out 0s 1 alternate forwards !important;
}

@keyframes mhs-v2-search-flash {
  0% {
    background: transparent;
  }
  25% {
    background: #fd9f83;
  }
  50% {
    background: transparent;
  }
  75% {
    background: #fd9f83;
  }
  100% {
    background: transparent;
  }
}

@-webkit-keyframes mhs-v2-search-flash {
  0% {
    background: transparent;
  }
  25% {
    background: #fd9f83;
  }
  50% {
    background: transparent;
  }
  75% {
    background: #fd9f83;
  }
  100% {
    background: transparent;
  }
}

.mhs-v2-search-input::placeholder {
  color: #bbb;
}

.mhs-v2-search-btn {
  position: static !important;
  top: auto !important;
  right: auto !important;
  left: auto !important;
  float: none !important;
  width: auto !important;
  min-width: 88px;
  height: 100% !important;
  line-height: 1 !important;
  margin: 0 !important;
  padding: 0 22px !important;
  flex-shrink: 0;
  border: none !important;
  border-radius: 999px !important;
  background-color: #302f75 !important;
  background-image: none !important;
  color: #fff !important;
  font-size: 14px !important;
  text-indent: 0 !important;
  cursor: pointer;
  display: flex !important;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
  transition: background-color 0.2s;
  z-index: 2;
}

.mhs-v2-search-btn::before {
  display: none !important;
  content: none !important;
}

.mhs-v2-search-btn:hover {
  background-color: #25245e;
}

.mhs-v2-procure-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 45px;
  padding: 0 24px;
  background-color: #302f75;
  color: #fff;
  font-size: 14px;
  text-decoration: none;
  border-radius: 999px;
  white-space: nowrap;
  transition: background-color 0.2s;
}

.mhs-v2-procure-btn:hover {
  background-color: #25245e;
  color: white;
}

.mhs-v2-search-hot {
  display: flex;
  flex-wrap: wrap;
  gap: 0 16px;
  width: 560px;
  margin-top: 8px;
  padding-left: 2px;
  box-sizing: border-box;
}

.mhs-v2-search-hot a {
  font-size: 12px;
  line-height: 18px;
  color: #999;
  text-decoration: none;
}

.mhs-v2-search-hot a:hover {
  color: #302f75;
}

/* ========== 主导航 ========== */
.mhs-v2-main-nav {
  background-color: #fff;
  border-bottom: 1px solid #eee;
}

.mhs-v2-main-nav-inner {
  height: 40px;
  gap: 0;
  justify-content: flex-start;
}

.mhs-v2-cat-tabs {
  display: flex;
  width: 224px;
  height: 40px;
  flex-shrink: 0;
  list-style: none;
  margin: 0;
  padding: 0;
  border-radius: 5px 5px 0 0;
  overflow: hidden;
}

.mhs-v2-cat-tabs li {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  color: #fff;
  background-color: #302f75;
  cursor: pointer;
  user-select: none;
  transition: background-color 0.2s;
}

.mhs-v2-cat-tabs li.is-active {
  background-color: #fa4a14;
  color: #fff;
}

.mhs-v2-nav-links {
  display: flex;
  flex: 1;
  height: 40px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.mhs-v2-nav-links > li {
  flex: 1;
  position: relative;
}

.mhs-v2-nav-links > li > a {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 40px;
  font-size: 15px;
  color: #333;
  text-decoration: none;
  transition: color 0.2s;
}

.mhs-v2-nav-links > li > a:hover {
  color: #fa4a14;
}

.mhs-v2-nav-dropdown-menu {
  display: none;
  position: absolute;
  left: 0;
  top: 40px;
  min-width: 180px;
  padding: 5px 0;
  background-color: #fff;
  border: 1px solid #eaeaea;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  z-index: 50;
}

.mhs-v2-nav-dropdown:hover .mhs-v2-nav-dropdown-menu {
  display: block;
}

.mhs-v2-nav-dropdown-menu a {
  display: block;
  padding: 0 14px;
  line-height: 32px;
  font-size: 13px;
  color: #333;
  text-decoration: none;
  white-space: nowrap;
}

.mhs-v2-nav-dropdown-menu a:hover {
  color: #302f75;
  background-color: #f7f7f7;
}

.mhs-v2-nav-icon img {
  width: 20px;
  margin-right: 8px;
}
