/* 全站统一顶栏 — 桌面完整导航 / 手机惠租式（搜索+汉堡+全屏菜单） */
:root {
  --header-red: #ea3b2e;
}

html {
  max-width: 100%;
  overflow-x: hidden;
}

body {
  min-width: 0;
  max-width: 100%;
  overflow-x: hidden;
}

.site-header {
  position: relative;
  z-index: 100;
  height: 96px;
  background: #fff;
  box-shadow: 0 1px 4px #1110000c;
}

.header-inner {
  display: flex;
  align-items: stretch;
  width: 100%;
  height: 100%;
  margin: 0;
  padding-left: 24px;
}

.site-header .brand {
  display: grid;
  flex: 0 0 auto;
  width: auto;
  max-width: 280px;
  align-content: center;
  grid-template-columns: 43px auto;
  column-gap: 9px;
  cursor: pointer;
  overflow: hidden;
  text-decoration: none;
}

.site-header .brand-mark {
  grid-row: span 2;
  display: block;
  width: 45px;
  height: 45px;
  border-radius: 4px;
  object-fit: cover;
  box-shadow: inset 0 0 0 1px #ffffff55;
}

.site-header .brand-name {
  align-self: end;
  color: #333;
  font-size: 27px;
  font-weight: 800;
  letter-spacing: -2px;
  line-height: 25px;
}

.site-header .brand-slogan {
  align-self: start;
  margin-top: 3px;
  color: #666;
  font-size: 12px;
  white-space: nowrap;
}

.site-header .desktop-nav,
.site-header .nav {
  display: flex;
  flex: 1;
  align-items: center;
  justify-content: center;
  gap: 32px;
  margin-left: 24px;
  white-space: nowrap;
}

.site-header .nav a,
.site-header .desktop-nav a {
  color: #333;
  font-size: 16px;
  text-decoration: none;
}

.site-header .nav a.active,
.site-header .nav a:hover,
.site-header .desktop-nav a.active,
.site-header .desktop-nav a:hover {
  color: var(--header-red);
}

.site-header .head-actions {
  display: flex;
  align-items: center;
  margin-left: auto;
}

.site-header .search-wrap {
  position: relative;
  width: 318px;
  margin-right: 22px;
}

.site-header .search {
  position: relative;
  width: 318px;
  height: 33px;
}

.site-header .search:before {
  content: '⌕';
  position: absolute;
  z-index: 2;
  left: 13px;
  top: 4px;
  color: #aaa;
  font-size: 20px;
}

.site-header .search input {
  width: 100%;
  height: 100%;
  padding: 0 58px 0 42px;
  color: #333;
  border: 0;
  border-radius: 8px;
  outline: 0;
  background: #f4f4f4;
  font: inherit;
  box-sizing: border-box;
}

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

.site-header .search button {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 56px;
  height: 28px;
  border: 0;
  border-radius: 6px;
  color: #fff;
  background: var(--header-red);
  font-size: 16px;
  cursor: pointer;
}

.site-header .hot-search {
  display: flex;
  gap: 13px;
  position: absolute;
  top: 37px;
  left: 1px;
  color: #b4b4b4;
  font-size: 11px;
  white-space: nowrap;
}

.site-header .hot-search a {
  color: inherit;
  text-decoration: none;
}

.site-header .hot-search a:hover {
  color: var(--header-red);
}

.site-header .merchant-entry {
  display: grid;
  place-items: center;
  align-self: stretch;
  width: 160px;
  margin-right: -1px;
  color: #fff;
  background: var(--header-red);
  font-size: 17px;
  font-weight: 600;
  text-decoration: none;
}

/* 手机控件：桌面隐藏 */
.mobile-tools,
.mobile-panel {
  display: none;
}

/* —— 手机：惠租结构 —— */
@media (max-width: 1100px) {
  body.nav-open {
    overflow: hidden;
  }

  .site-header {
    position: sticky;
    top: 0;
    height: auto;
    min-height: 56px;
    box-shadow: none;
    border-bottom: 1px solid #eee;
  }

  .site-header.nav-open {
    position: fixed;
    inset: 0;
    z-index: 300;
    height: 100%;
    min-height: 100%;
    border-bottom: 0;
    background: #fff;
  }

  .header-inner {
    flex-wrap: wrap;
    align-items: center;
    min-height: 56px;
    height: auto;
    padding: 8px 8px 8px 16px;
  }

  .site-header.nav-open .header-inner {
    height: 100%;
    align-content: flex-start;
  }

  .site-header .brand {
    flex: 1 1 auto;
    order: 1;
    min-width: 0;
    max-width: none;
    grid-template-columns: 36px minmax(0, 1fr);
    column-gap: 8px;
  }

  .site-header .brand-mark {
    width: 36px;
    height: 36px;
    border-radius: 6px;
  }

  .site-header .brand-name {
    font-size: 20px;
    letter-spacing: 0;
    line-height: 22px;
    color: #222;
  }

  .site-header .brand-slogan {
    display: block;
    margin-top: 2px;
    color: #999;
    font-size: 10px;
    line-height: 1.25;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  /* 桌面导航隐藏 */
  .site-header .desktop-nav,
  .site-header .nav {
    display: none !important;
  }

  /* 桌面搜索条默认隐藏；点放大镜展开 */
  .site-header .head-actions {
    display: none !important;
    order: 20;
    flex: 0 0 100%;
    flex-direction: column;
    width: 100%;
    margin: 0;
    padding: 12px 8px 16px;
    border-top: 1px solid #f0f0f0;
    gap: 10px;
  }

  .site-header.search-open .head-actions {
    display: flex !important;
  }

  .site-header.search-open .merchant-entry {
    display: none !important;
  }

  .site-header .search-wrap,
  .site-header .search {
    width: 100%;
    margin: 0;
  }

  .site-header .search {
    height: 40px;
  }

  .site-header .hot-search {
    position: static;
    flex-wrap: wrap;
    margin-top: 10px;
    gap: 12px;
  }

  /* 右侧搜索 + 汉堡 */
  .mobile-tools {
    display: flex !important;
    order: 2;
    flex: 0 0 auto;
    align-items: center;
    margin-left: auto;
  }

  .mobile-tools .search-toggle,
  .mobile-tools .nav-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: #777;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
  }

  .mobile-tools .nav-toggle {
    flex-direction: column;
    gap: 5px;
  }

  .mobile-tools .nav-toggle span {
    display: block;
    width: 18px;
    height: 1.5px;
    border-radius: 1px;
    background: #666;
    transition: transform .2s, opacity .2s;
  }

  .site-header.nav-open .nav-toggle span:nth-child(1) {
    transform: translateY(6.5px) rotate(45deg);
  }

  .site-header.nav-open .nav-toggle span:nth-child(2) {
    opacity: 0;
  }

  .site-header.nav-open .nav-toggle span:nth-child(3) {
    transform: translateY(-6.5px) rotate(-45deg);
  }

  .site-header.nav-open .search-toggle {
    visibility: hidden;
    pointer-events: none;
  }

  /* 全屏菜单 */
  .mobile-panel {
    display: none;
    order: 10;
    flex: 1 1 100%;
    width: 100%;
    padding: 8px 16px 40px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    background: #fff;
  }

  .site-header.nav-open .mobile-panel {
    display: block;
  }

  .mobile-menu {
    display: flex;
    flex-direction: column;
  }

  .mobile-menu > a,
  .mobile-menu .mobile-acc {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    box-sizing: border-box;
    padding: 18px 4px;
    border: 0;
    background: transparent;
    color: #222;
    font-size: 18px;
    font-weight: 500;
    line-height: 1.3;
    text-align: left;
    text-decoration: none;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    font-family: inherit;
  }

  .mobile-menu > a.active,
  .mobile-menu .mobile-acc.active,
  .mobile-menu > a:hover {
    color: var(--header-red);
  }

  .nav-chevron {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-right: 1.5px solid #bbb;
    border-bottom: 1.5px solid #bbb;
    transform: rotate(45deg);
    transition: transform .2s;
    flex: 0 0 auto;
  }

  .mobile-acc.open .nav-chevron {
    transform: rotate(-135deg);
    margin-top: 4px;
  }

  .mobile-acc-panel {
    display: none;
    padding: 0 4px 8px;
  }

  .mobile-acc.open + .mobile-acc-panel {
    display: block;
  }

  .mobile-acc-panel a {
    display: block;
    padding: 12px 4px;
    color: #666;
    font-size: 15px;
    text-decoration: none;
  }

  .mobile-acc-panel a:hover {
    color: var(--header-red);
  }
}

@media (max-width: 380px) {
  .site-header .brand-name {
    font-size: 18px;
  }

  .mobile-menu > a,
  .mobile-menu .mobile-acc {
    font-size: 17px;
  }
}
