/* vipkei.com externalized from DedeCMS common template
 * source phase: P1 step 5 common
 * version: 20260612-p1s5-common
 */

/* =========================================================
   VIPKEI 手机公共头部稳定规则
   目的：
   1. 修复旧 float/固定百分比布局造成的窄屏溢出。
   2. 导航菜单在头部下方按正常文档流展开，不覆盖 Banner。
   3. 保持现有品牌颜色、Logo 和菜单内容不变。
   ========================================================= */
.vk-mobile-topbar,
.vk-mobile-header-shell,
.vk-mobile-site-header,
.vk-mobile-site-header *,
.vk-mobile-header-shell .vk-mobile-nav__panel,
.vk-mobile-header-shell .vk-mobile-nav__panel * {
  box-sizing: border-box;
}

.vk-mobile-topbar {
  position: relative;
  z-index: 1201;
  width: 100%;
  padding-right: 6px;
  padding-left: 6px;
}

.vk-mobile-header-shell {
  position: relative;
  z-index: 1200;
  width: 100%;
  background: #FFFFFF;
}

.vk-mobile-site-header {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
  min-height: 76px;
  height: auto;
  margin: 0;
  padding: 0 54px 0 6px;
  overflow: visible;
  background: #FFFFFF;
}

.vk-mobile-site-header .vk-mobile-site-header__brand {
  display: flex;
  align-items: center;
  min-width: 0;
  width: 100%;
  height: 76px;
  float: none;
  overflow: hidden;
}

.vk-mobile-site-header .vk-mobile-site-header__logo {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  height: 100%;
}

.vk-mobile-site-header .vk-mobile-site-header__logo img {
  display: block;
  width: auto;
  height: 44px;
  max-width: 100%;
  margin: 0;
  float: none;
}

.vk-mobile-site-header .vk-mobile-site-header__brand-name {
  min-width: 0;
  margin: 0 0 0 8px;
  padding: 0;
  overflow: hidden;
  color: #30B7EF;
  font-size: 14px;
  font-weight: 400;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.vk-mobile-site-header .vk-mobile-site-header__tools {
  position: absolute;
  top: 50%;
  right: 10px;
  width: 36px;
  height: 36px;
  transform: translateY(-50%);
}

.vk-mobile-site-header .vk-mobile-nav {
  position: relative;
  width: 100%;
  height: 100%;
}

.vk-mobile-site-header .vk-mobile-nav__toggle {
  display: block;
  width: 36px;
  height: 36px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 3px;
  background-color: transparent;
  background-image: url(/m/skin/images/menu_bg.png);
  background-repeat: no-repeat;
  background-position: center;
  background-size: 25px auto;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.vk-mobile-site-header .vk-mobile-nav__toggle:focus-visible {
  outline: 2px solid #30B7EF;
  outline-offset: 2px;
}

/*
 * 菜单面板放在 header 后方并参与正常文档流：
 * 展开时增加头部区域高度，Banner 自动下移，不再被菜单覆盖。
 */
.vk-mobile-header-shell .vk-mobile-nav__panel {
  position: static;
  z-index: auto;
  display: block;
  width: calc(100% - 12px);
  max-width: none;
  max-height: 420px;
  max-height: min(62vh, 420px);
  margin: 0 6px 8px;
  overflow-x: hidden;
  overflow-y: auto;
  border: 1px solid rgba(11, 61, 92, .10);
  border-radius: 5px;
  background: #30B7EF;
  box-shadow: 0 8px 20px rgba(11, 61, 92, .16);
  -webkit-overflow-scrolling: touch;
}

.vk-mobile-header-shell .vk-mobile-nav__panel[hidden] {
  display: none !important;
}

.vk-mobile-header-shell .vk-mobile-nav__panel ul {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  width: 100%;
  max-width: none;
  margin: 0;
  gap: 1px;
  padding: 6px;
  float: none;
  background: rgba(255, 255, 255, .18);
  list-style: none;
}

.vk-mobile-header-shell .vk-mobile-nav__panel li {
  min-width: 0;
  width: auto;
  height: auto;
  margin: 0;
  background: #30B7EF;
}

.vk-mobile-header-shell .vk-mobile-nav__panel a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 44px;
  padding: 8px 6px;
  overflow: hidden;
  color: #FFFFFF;
  font-size: 13px;
  line-height: 1.35;
  text-align: center;
  text-decoration: none;
  text-overflow: ellipsis;
  white-space: nowrap;
  -webkit-tap-highlight-color: transparent;
}

.vk-mobile-header-shell .vk-mobile-nav__panel a:active,
.vk-mobile-header-shell .vk-mobile-nav__panel a:focus-visible {
  background: rgba(11, 61, 92, .18);
  outline: 0;
}

@media (max-width: 360px) {
  .vk-mobile-site-header {
    padding-right: 50px;
  }

  .vk-mobile-site-header .vk-mobile-site-header__brand-name {
    margin-left: 6px;
    font-size: 13px;
  }

  .vk-mobile-header-shell .vk-mobile-nav__panel a {
    font-size: 12px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .vk-mobile-header-shell .vk-mobile-nav__panel {
    scroll-behavior: auto;
  }
}
