/* ===== 土巴兔风格头部 — 一比一复刻 ===== */
.header-nav {
  position: relative;
  z-index: 1000;
  font-family: "PingFang SC", "Microsoft YaHei", "微软雅黑", Arial, sans-serif;
  color: #333;
  height: 111px;
}

/* ---------- 第一层：顶部信息栏 ---------- */
.header-first-box {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 36px;
  line-height: 36px;
  background-color: #f5f5f5;
  transition: margin 0.3s ease;
  -webkit-transition: margin 0.3s ease;
  -moz-transition: margin 0.3s ease;
  -ms-transition: margin 0.3s ease;
  -o-transition: margin 0.3s ease;
  z-index: 2;
  overflow: hidden;
}

.top-bar-wrapper {
  max-width: 1220px;
  margin: 0 auto;
  padding: 0 15px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.top-bar-left {
  font-size: 12px;
  color: #999;
}

.top-welcome {
  color: #999;
}

.top-bar-right {
  font-size: 12px;
}

.top-phone {
  color: #999;
  cursor: pointer;
}

.phone-underline {
  color: #e73c00;
  border-bottom: 1px solid #e73c00;
}

/* ---------- 第二层：主导航栏 ---------- */
.header-nav .header-main-nav {
  position: absolute;
  top: 36px;
  left: 0;
  width: 100%;
  height: 75px;
  background-color: #fff;
  border-bottom: 1px solid #eee;
  transition: all 0.3s ease;
  -webkit-transition: all 0.3s ease;
  -moz-transition: all 0.3s ease;
  -ms-transition: all 0.3s ease;
  -o-transition: all 0.3s ease;
  z-index: 1;
}

.main-nav-wrapper {
  max-width: 1220px;
  margin: 0 auto;
  padding: 0 15px;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* Logo */
.nav-logo {
  flex-shrink: 0;
  margin-right: 20px;
  transition: all 0.3s ease;
}

.nav-logo a {
  display: block;
}

.logo-img {
  max-height: 48px;
  width: auto;
  transition: all 0.3s ease;
}

/* 导航菜单 — 土巴兔精确做法：inline-block + text-align:center */
.nav-menu {
  flex: 1;
  height: 100%;
  text-align: center;
  min-width: 0;
}

.nav-menu-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: inline-block;
  height: 100%;
  font-size: 0;
  vertical-align: top;
}

.nav-menu-list > li {
  position: relative;
  height: 100%;
  display: inline-block !important;
  vertical-align: top;
  font-size: 14px;
  width: auto !important;
  float: none !important;
}

.nav-menu-list > li > a {
  display: block !important;
  padding: 0 20px;
  font-size: 14px;
  color: #333;
  text-decoration: none;
  line-height: 75px;
  height: 75px;
  transition: all 0.2s ease;
  position: relative;
  white-space: nowrap;
}

.nav-menu-list > li > a::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%) scaleX(0);
  width: 80%;
  height: 3px;
  background: #e73c00;
  transition: transform 0.25s ease;
}

.nav-menu-list > li > a:hover,
.nav-menu-list > li.current > a {
  color: #e73c00;
}

.nav-menu-list > li > a:hover::after,
.nav-menu-list > li.current > a::after {
  transform: translateX(-50%) scaleX(1);
}

/* 下拉菜单 */
/* 覆盖 style.css 旧 nav 规则：nav ul li ul / nav ul li:hover ul 会匹配 .dropdown-list，必须强制重置 */
.nav-dropdown .dropdown-list {
  position: static !important;
  width: auto !important;
  left: auto !important;
  top: auto !important;
  z-index: auto !important;
  display: block !important;
}
.nav-dropdown .dropdown-list li {
  float: none !important;
  width: 100% !important;
  line-height: normal !important;
  background: transparent !important;
  padding: 0 !important;
  text-align: left !important;
  position: static !important;
}
.nav-dropdown .dropdown-list li a {
  display: block !important;
  font-weight: normal !important;
  background: transparent !important;
}
.nav-dropdown .dropdown-list li a:hover {
  background: #fafafa !important;
  color: #e73c00 !important;
}

/* 覆盖 style.css 一级导航旧规则：nav ul li 会匹配到 .nav-menu-list > li */
nav.nav-menu .nav-menu-list > li {
  float: none !important;
  display: inline-block !important;
  width: auto !important;
  text-align: left !important;
  line-height: normal !important;
}
nav.nav-menu .nav-menu-list > li > a {
  float: none !important;
  display: block !important;
  width: auto !important;
}

.has-dropdown {
  position: relative;
}

.nav-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 200px;
  background: #fff;
  border: 1px solid #e5e5e5;
  border-top: 3px solid #e73c00;
  box-shadow: 0 8px 24px rgba(0,0,0,0.1);
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: all 0.25s ease;
  z-index: 1001;
  padding: 10px 0;
}

.has-dropdown:hover .nav-dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.dropdown-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.dropdown-list li a {
  display: block;
  padding: 10px 20px;
  font-size: 14px;
  color: #666;
  text-decoration: none;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.dropdown-list li a:hover {
  color: #e73c00;
  background: #fafafa;
}

/* 右侧工具区 */
.nav-tools {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-shrink: 0;
}

/* 搜索框 */
.nav-search {
  display: flex;
  align-items: center;
  height: 34px;
  border: 1px solid #e5e5e5;
  border-radius: 4px;
  overflow: hidden;
  background: #fff;
  transition: all 0.3s ease;
}

.nav-search:hover {
  border-color: #ccc;
}

.search-input {
  border: none;
  outline: none;
  padding: 0 8px;
  font-size: 13px;
  color: #333;
  width: 120px;
  height: 100%;
  background: transparent;
}

.search-input::placeholder {
  color: #999;
}

.search-btn {
  border: none;
  background: #e73c00;
  color: #fff;
  font-size: 13px;
  padding: 0 14px;
  height: 100%;
  cursor: pointer;
  transition: all 0.2s ease;
}

.search-btn:hover {
  background: #c03000;
}

/* CTA按钮 */
.nav-cta-btn {
  display: inline-flex;
  align-items: center;
  height: 34px;
  padding: 0 12px;
  background: linear-gradient(135deg, #e73c00, #f05a28);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  border-radius: 4px;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.nav-cta-btn:hover {
  background: linear-gradient(135deg, #c03000, #d04000);
  color: #fff;
  text-decoration: none;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(231,60,0,0.3);
}

/* ========== 滚动后固定 & 收缩 ========== */
.header-nav.is-fixed .header-first-box {
  margin-top: -36px;
}

.header-nav.is-fixed .header-main-nav {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 60px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  z-index: 1000;
}

.header-nav.is-fixed .nav-menu-list > li > a {
  line-height: 60px;
  height: 60px;
  font-size: 12px;
  padding: 0 12px;
}

.header-nav.is-fixed .logo-img {
  max-height: 38px;
}

/* ========== 移动端导航 ========== */
.mobile-menu-btn {
  width: 32px;
  height: 32px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  cursor: pointer;
  position: absolute;
  top: 50%;
  right: 15px;
  transform: translateY(-50%);
  z-index: 1003;
}

.m-line {
  display: block;
  width: 22px;
  height: 2px;
  background: #333;
  border-radius: 1px;
  transition: all 0.3s ease;
}

.mobile-menu-btn.active .m-line:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}
.mobile-menu-btn.active .m-line:nth-child(2) {
  opacity: 0;
}
.mobile-menu-btn.active .m-line:nth-child(3) {
  transform: rotate(-45deg) translate(5px, -5px);
}

.mobile-nav-panel {
  position: fixed;
  top: 0;
  right: -280px;
  width: 280px;
  height: 100vh;
  background: #fff;
  border-left: 1px solid #eee;
  padding: 60px 20px 20px;
  transition: right 0.3s ease;
  z-index: 1002;
  overflow-y: auto;
  box-shadow: -4px 0 16px rgba(0,0,0,0.1);
}

.mobile-nav-panel.active {
  right: 0;
}

.mobile-nav-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.mobile-nav-list > li {
  border-bottom: 1px solid #f0f0f0;
}

.mobile-nav-list > li > a {
  display: block;
  padding: 14px 0;
  font-size: 15px;
  color: #333;
  text-decoration: none;
  transition: all 0.2s ease;
}

.mobile-nav-list > li > a:hover {
  color: #e73c00;
}

.mobile-sub-list {
  padding-left: 16px;
  list-style: none;
  margin: 0 0 8px 0;
}

.mobile-sub-list li {
  border-bottom: none;
}

.mobile-sub-list li a {
  display: block;
  padding: 8px 0;
  font-size: 13px;
  color: #999;
  text-decoration: none;
}

.mobile-sub-list li a:hover {
  color: #e73c00;
}

/* ========== 响应式 ========== */
@media (max-width: 1199px) {
  .nav-menu-list > li > a {
    padding: 0 10px;
    font-size: 12px;
  }
  .search-input {
    width: 100px;
  }
  .nav-cta-btn {
    padding: 0 8px;
    font-size: 12px;
  }
}

@media (max-width: 991px) {
  body { padding-top: 60px; }
  .header-nav { height: 60px; }
  .header-first-box { display: none; }
  .header-main-nav {
    height: 60px;
    top: 0;
  }
  .nav-menu { display: none; }
  .nav-search { display: none; }
  .nav-cta-btn { display: none; }
  .nav-logo {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
  }
  .logo-img { max-height: 38px; }
}

@media (max-width: 576px) {
  .top-welcome { display: none; }
  .top-bar-left { display: none; }
  .top-bar-wrapper { justify-content: center; }
}