/* ========================================
   头部导航样式
   ======================================== */

/* 页面头部 - PC端红色渐变背景 */
.header {
  background: linear-gradient(180deg, #590110 0%, #9e031c 100%);
  height: 6.25rem;
}

.header-container {
  max-width: 100%;
  height: 100%;
  padding: 0 var(--spacing-md);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* Logo 区域 */
.header-logo {
  display: flex;
  align-items: center;
  gap: var(--spacing-xs);
  flex-shrink: 0;
}

.logo-img {
  height: 4rem;
  width: auto;
}

.logo-text {
  color: var(--white);
  font-size:1.5rem;
  font-weight: 600;
  white-space: nowrap;
}

/* 导航菜单 */
.header-nav {
  padding-top: 1rem;
  flex: 1;
  display: flex;
  justify-content: center;
}

.nav-list {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  list-style: none;
}

.nav-item {
  list-style: none;
  position: relative;
}

.nav-link {
  color: var(--white);
  font-size: 1rem;
  padding: 0.08rem 0.12rem;
  display: block;
  white-space: nowrap;
  transition: all 0.3s ease;
  position: relative;
}

.nav-link:hover {
  color: rgba(255, 255, 255, 0.8);
}

.nav-link.active {
  font-weight: 600;
}

/* 二级菜单样式 */
.submenu {
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 10rem;
  background: rgba(178, 3, 32, 0.7);
  backdrop-filter: blur(10px);
  border-radius: 0.3rem;
  box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.3);
  padding: 0.5rem 0;
  margin-top: 0.5rem;
  list-style: none;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: all 0.3s ease;
  z-index: 1000;
}

/* 鼠标移入父级导航项时显示二级菜单 */
.has-submenu:hover .submenu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

/* 二级菜单项样式 */
.submenu li {
  list-style: none;
}

.submenu a {
  display: block;
  padding: 0.6rem 1.2rem;
  color: var(--white);
  font-size: 0.9rem;
  text-decoration: none;
  white-space: nowrap;
  transition: all 0.3s ease;
  position: relative;
}

/* 二级菜单项悬停效果 */
.submenu a:hover {
  background: rgba(255, 255, 255, 0.1);
  padding-left: 1.5rem;
  color: var(--gold);
}

/* 二级菜单项左侧高亮条 */
.submenu a::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 0;
  height: 60%;
  background: var(--gold);
  transition: width 0.3s ease;
}

.submenu a:hover::before {
  width: 0.2rem;
}

/* 右侧功能区 */
.header-actions {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  flex-shrink: 0;
}

.action-btn {
  background: none;
  border: none;
  color: var(--white);
  cursor: pointer;
  padding: var(--spacing-xs);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.3s ease;
}

.action-btn:hover {
  opacity: 0.8;
}

/* 菜单按钮默认隐藏 */
.menu-btn {
  display: none;
  -webkit-tap-highlight-color: transparent;
  outline: none;
  user-select: none;
}

.menu-btn:active,
.menu-btn:focus {
  outline: none;
  background-color: transparent;
}

.search-btn {
  width: 2.2rem;
  height: 2.2rem;
  padding: 0;
  background-color: transparent;
  border-radius: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  -webkit-tap-highlight-color: transparent;
  outline: none;
}

.search-btn:active,
.search-btn:focus {
  outline: none;
}

.search-icon {
  width: 2.2rem;
  height: 2.2rem;
  display: block;
  object-fit: contain;
}

/* 移动端遮罩层 */
.mobile-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 998;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
  pointer-events: none;
}

.mobile-overlay.active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

/* ========================================
   移动端适配 (≤ 768px)
   ======================================== */
@media (max-width: 768px) {
  /* 移动端头部 - 红色渐变背景 */
  .header {
    background: linear-gradient(180deg, #590110 0%, #9e031c 100%);
    height: auto;
    min-height: 3rem;
    position: sticky;
    top: 0;
    z-index: 1002;
  }

  .header-container {
    flex-wrap: nowrap;
    padding: var(--spacing-sm) var(--spacing-md);
    align-items: center;
  }

  /* Logo区域 */
  .header-logo {
    flex: 1;
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
    flex-shrink: 0;
  }

  .logo-img {
    height: 1.2rem;
  }

  .logo-text {
    color: var(--white);
    font-size: 1.2rem;
    font-weight: 600;
    white-space: nowrap;
  }

  /* 移动端侧滑菜单 */
  .header-nav {
    position: fixed;
    top: 0;
    right: -80vw;
    width: 80vw;
    height: 100vh;
    background: linear-gradient(180deg, #590110 0%, #9e031c 100%);
    z-index: 1001;
    padding: var(--spacing-xl) var(--spacing-lg);
    overflow-y: auto;
    transition: right 0.3s ease, box-shadow 0.3s ease;
    box-shadow: none;
    padding-top: 0;
    flex: none;
    justify-content: flex-start;
  }

  .header-nav.active {
    right: 0;
    box-shadow: -2px 0 8px rgba(0, 0, 0, 0.3);
  }

  .nav-list {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    list-style: none;
    padding: var(--spacing-md) 0;
  }

  .nav-item {
    list-style: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  }

  .nav-item:last-child {
    border-bottom: none;
  }

  .nav-link {
    color: var(--white);
    padding: var(--spacing-md) 0;
    font-size: 1rem;
    display: block;
    white-space: nowrap;
    transition: all 0.3s ease;
    position: relative;
  }

  .nav-link:hover {
    color: rgba(255, 255, 255, 0.8);
  }

  .nav-link.active {
    color: var(--white);
    font-weight: 600;
  }

  /* 右侧功能区 */
  .header-actions {
    order: 2;
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    flex-shrink: 0;
  }

  .action-btn {
    background: none;
    border: none;
    color: var(--white);
    cursor: pointer;
    padding: var(--spacing-xs);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.3s ease;
  }

  .action-btn:hover {
    opacity: 0.8;
  }

  /* 移动端显示菜单按钮 */
  .menu-btn {
    display: flex;
    -webkit-tap-highlight-color: transparent;
    outline: none;
    user-select: none;
  }

  .menu-btn:active,
  .menu-btn:focus {
    outline: none;
    background-color: transparent;
  }

  .search-btn {
    width: 1.5rem;
    height: 1.5rem;
    padding: 0;
    background-color: transparent;
    border-radius: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    -webkit-tap-highlight-color: transparent;
    outline: none;
  }

  .search-btn:active,
  .search-btn:focus {
    outline: none;
  }

  .search-icon {
    width: 1.5rem;
    height: 1.5rem;
    object-fit: contain;
  }

  /* 移动端遮罩层层级 */
  .mobile-overlay {
    z-index: 0;
  }
}