﻿/* ============================================
   页眉 Header - 吸顶 + 背景模糊
   ============================================ */
.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-height);
  z-index: 1000;
  transition: all 0.3s ease;
}

.header::before {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0);
  backdrop-filter: blur(0px);
  -webkit-backdrop-filter: blur(0px);
  transition: all 0.3s ease;
}

.header.scrolled::before {
  background: rgba(255, 255, 255, 0.55);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  border-bottom: none;
}

.header-inner {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  padding: 0 50px; /* 完美对齐下方通栏内容两端 50px 的边距，消除错位，在超宽屏下亦完美对称 */
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 40px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}

.logo-icon {
  width: 34px;
  height: 34px;
  flex-shrink: 0;
}

.logo-text-group {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.logo-text-main {
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  letter-spacing: 0.5px;
  line-height: 1;
  transition: color 0.3s;
}

.logo-text-sub {
  font-size: 14px;
  font-weight: 700;
  color: #fff;
  line-height: 1.1;
  transition: color 0.3s;
}

.logo-text-desc {
  font-size: 10px;
  color: rgba(255, 255, 255, 0.6);
  line-height: 1;
  transform: scale(0.85);
  transform-origin: left center;
  white-space: nowrap;
  transition: color 0.3s;
}

.header.scrolled .logo-text-main,
.header.scrolled .logo-text-sub {
  color: #111827;
}

.header.scrolled .logo-text-desc {
  color: #6b7280;
}

.nav {
  display: flex;
  align-items: center;
  gap: 2px;
}

.nav-item {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 6px 10px;
  font-size: 14px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.85);
  border-radius: 20px;
  text-decoration: none;
  transition: all 0.3s ease;
  white-space: nowrap;
}

/* nav-item 下拉小箭头 */
.nav-item-wrap.has-mega:hover > .nav-item > svg {
  transform: rotate(180deg);
}
.nav-item > svg {
  transition: transform 0.25s ease;
  opacity: 0.7;
  flex-shrink: 0;
}

.nav-item:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.15);
}

/* 激活的“图片”标签：半透明红底白/红字 */
.nav-item.nav-item--active {
  color: #096ddd;
  background: rgba(9, 109, 221, 0.14);
  font-weight: 600;
}

.nav-item.nav-item--active:hover {
  background: rgba(9, 109, 221, 0.22);
}

/* AIGC带闪烁图标样式 */
.nav-item--aigc svg {
  color: #fbbf24;
  animation: aigc-sparkle 1.6s infinite alternate;
}

@keyframes aigc-sparkle {
  0% { transform: scale(0.95); opacity: 0.8; }
  100% { transform: scale(1.15); opacity: 1; }
}

.header.scrolled .nav-item {
  color: #374151;
}

.header.scrolled .nav-item:hover {
  color: #111827;
  background: rgba(17, 24, 39, 0.06);
}

.header.scrolled .nav-item.nav-item--active {
  color: #096ddd;
  background: rgba(9, 109, 221, 0.09);
}

.header-right {
  display: flex;
  align-items: center;
  gap: 20px;
}

.header-link {
  font-size: 14px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.85);
  text-decoration: none;
  transition: color 0.3s;
}

.header-link:hover {
  color: #fff;
}

.header.scrolled .header-link {
  color: #374151;
}

.header.scrolled .header-link:hover {
  color: #096ddd;
}

/* 胶囊框登录注册按钮 */
.btn-login-outline {
  display: inline-flex;
  align-items: center;
  padding: 6px 18px;
  font-size: 13px;
  font-weight: 500;
  color: #fff;
  border: 1.5px solid rgba(255, 255, 255, 0.45);
  border-radius: 20px;
  text-decoration: none;
  transition: all 0.3s ease;
}

.btn-login-outline:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: #fff;
  box-shadow: 0 1px 8px rgba(255, 255, 255, 0.1);
}

.header.scrolled .btn-login-outline {
  color: #096ddd;
  border-color: rgba(9, 109, 221, 0.4);
}

.header.scrolled .btn-login-outline:hover {
  background: rgba(9, 109, 221, 0.05);
  border-color: #096ddd;
}

/* ============================================
   滚动时 Header 内搜索框（吸顶搜索效果）
   ============================================ */
/* ============================================
   吸顶后：搜索图标 + 页眉下方全宽展开搜索面板
   ============================================ */
/* 搜索触发按钮（由 JS 注入到 header-right，吸顶后显示：图标 + 文字） */
.header-search-toggle {
  display: none;
  align-items: center;
  gap: 6px;
  height: 36px;
  padding: 0 16px;
  border-radius: 18px;
  border: 1px solid var(--border-color);
  background: rgba(255, 255, 255, 0.7);
  color: #374151;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}
.header.scrolled .header-search-toggle {
  display: inline-flex;
}
.header-search-toggle svg {
  flex-shrink: 0;
}
.header-search-toggle:hover {
  border-color: #096ddd;
  color: #096ddd;
  box-shadow: 0 2px 10px rgba(9, 109, 221, 0.14);
}
.header-search-toggle.is-active {
  border-color: #096ddd;
  background: linear-gradient(135deg, #49c9e9, #096ddd);
  color: #fff;
}

/* 全宽下拉搜索面板：固定在页眉正下方，默认隐藏 */
.header .header-search {
  position: fixed;
  top: var(--header-height);
  left: 0;
  right: 0;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin: 0;
  max-width: none;
  padding: 22px 50px;
  background: #ffffff;
  border-radius: 0;
  border: none;
  border-bottom: 1px solid var(--border-color);
  box-shadow: 0 14px 30px rgba(15, 23, 42, 0.1);
  transform: translateY(-16px);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.28s ease, transform 0.28s ease, visibility 0.28s ease;
  z-index: 1001;
  box-sizing: border-box;
}

.header .header-search.is-open {
  transform: translateY(0);
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

/* 居中的搜索条：圆角框内含输入框 + 内嵌渐变按钮 */
.header-search__bar {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
  max-width: 680px;
  border: 2px solid var(--border-color);
  border-radius: 8px;
  background: #f8fafc;
  transition: border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}
.header-search__bar:focus-within {
  border-color: #096ddd;
  background: #fff;
  box-shadow: 0 4px 16px rgba(9, 109, 221, 0.12);
}
.header-search .search-input {
  flex: 1;
  min-width: 0;
  border: none;
  outline: none;
  font-size: 15px;
  padding: 13px 20px;
  background: transparent;
  font-family: inherit;
  color: var(--text-primary);
}
.header-search .search-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  margin: 4px;
  padding: 10px 26px;
  font-size: 14px;
  font-weight: 600;
  color: #fff;
  background: linear-gradient(135deg, var(--gradient-start), var(--gradient-end));
  border-radius: 22px;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.header-search .search-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(9, 109, 221, 0.35);
}

/* 移动端不使用该吸顶搜索（手机端用抽屉内搜索框） */
@media (max-width: 768px) {
  .header-search-toggle { display: none !important; }
  .header .header-search { display: none !important; }
}

.header-search .search-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 16px;
  font-size: 13px;
  font-weight: 600;
  color: #fff;
  background: linear-gradient(135deg, var(--gradient-start), var(--gradient-end));
  border-radius: 7px;
  cursor: pointer;
  flex-shrink: 0;
  transition: all 0.2s ease;
}

.header-search .search-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(9, 109, 221, 0.35);
}

.header.scrolled .nav {
  gap: 2px;
}

.header.scrolled::after {
  display: none;
}

/* ============================================
   导航栏“更多”下拉菜单样式
   ============================================ */
.nav-more-dropdown {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  height: 32px;
}

.nav-more-trigger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  color: rgba(255, 255, 255, 0.85);
  border-radius: 4px;
  transition: all 0.3s ease;
}

.nav-more-trigger:hover {
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
}

.header.scrolled .nav-more-trigger {
  color: #374151;
}

.header.scrolled .nav-more-trigger:hover {
  background: rgba(17, 24, 39, 0.06);
  color: #111827;
}

/* 下拉浮层 */
.nav-dropdown-menu {
  position: absolute;
  top: calc(100% + 12px);
  left: 50%;
  transform: translateX(-50%) translateY(12px) scale(0.95);
  background: #ffffff;
  border-radius: 14px;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.15), 0 0 0 1px rgba(0, 0, 0, 0.03);
  padding: 16px 0;
  min-width: 160px;
  opacity: 0;
  visibility: hidden;
  transition: all 0.25s cubic-bezier(0.22, 1, 0.36, 1);
  z-index: 1100;
}

/* 悬停展开 */
.nav-more-dropdown:hover .nav-dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0) scale(1);
}

.nav-dropdown-item {
  display: block;
  padding: 14px 28px;
  font-size: 15px;
  font-weight: 500;
  color: #1d2129;
  text-decoration: none;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.nav-dropdown-item:hover {
  color: #096ddd;
  background: rgba(9, 109, 221, 0.05);
}

/* 导航栏“更多”菜单内子项激活态样式 */
.nav-dropdown-item.nav-dropdown-item--active {
  color: #096ddd;
  background: rgba(9, 109, 221, 0.04);
  font-weight: 600;
}

/* 更多触发器激活状态（用于标明下拉菜单里有当前页激活项） */
.nav-more-trigger.nav-more-trigger--active {
  color: #096ddd;
}

.header.scrolled .nav-more-trigger.nav-more-trigger--active {
  color: #096ddd;
}

/* ============================================
   移动端专用元素（默认隐藏，仅在窄屏显示）
   ============================================ */
.mobile-menu-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  padding: 0;
  background: transparent;
  border: none;
  color: #fff;
  cursor: pointer;
}

.mobile-icon {
  display: none;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  color: #fff;
  text-decoration: none;
}

.header.scrolled .mobile-menu-toggle,
.header.scrolled .mobile-icon {
  color: #111827;
}

/* 移动端搜索框：默认（PC端）隐藏 */
.nav-mobile-search {
  display: none;
}

/* 超级菜单 Mega Menu */
.nav-item {
  position: relative;
}

.nav-mega-menu {
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%) translateY(8px);
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.12);
  padding: 12px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s, visibility 0.25s, transform 0.25s;
  z-index: 1200;
  width: 560px;
  pointer-events: none;
  overflow: hidden;
}

.nav-item:hover .nav-mega-menu {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
  pointer-events: auto;
}

.nav-mega-menu__banner {
  width: 100%;
  height: 60px;
  border-radius: 6px;
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%) center/cover no-repeat;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 2px;
  overflow: hidden;
}

.nav-mega-menu__body {
  padding: 20px 24px 24px;
}

.nav-mega-menu__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
}

.nav-mega-menu__grid--4col {
  grid-template-columns: repeat(4, 1fr);
}

.nav-mega-menu__grid--2col {
  grid-template-columns: repeat(2, 1fr);
}

.nav-mega-menu__col {
  padding: 0 12px;
  border-right: 1px solid #f1f5f9;
}

.nav-mega-menu__col:last-child {
  border-right: none;
}

.nav-mega-menu__col-title {
  font-size: 13px;
  font-weight: 600;
  color: #1d2129;
  margin-bottom: 10px;
  padding: 0 10px;
  border-left: 3px solid #096ddd;
  display: flex;
  align-items: center;
  min-height: 24px;
}

.nav-mega-menu__link {
  display: block;
  padding: 5px 10px;
  font-size: 13px;
  color: #4b5563;
  text-decoration: none;
  border-radius: 4px;
  transition: color 0.2s, background 0.2s;
}

.nav-mega-menu__link:hover {
  color: #096ddd;
  background: #eff6ff;
}


/* 已登录状态小头像 */
.user-avatar-mini {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #e0e7ff center/cover no-repeat;
  cursor: pointer;
  border: 2px solid #f1f5f9;
  transition: border-color 0.2s;
  display: inline-block;
}

.user-avatar-mini:hover {
  border-color: #096ddd;
}


/* 用户头像悬停下拉面板 */
.user-avatar-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
}

/* 会员皇冠角标（VIP 用户头像显示，置于头像右下角，仅图标、无底色/阴影） */
.user-avatar-wrap.is-vip::after {
  content: "";
  position: absolute;
  bottom: -3px;
  right: -3px;
  width: 14px;
  height: 14px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='%23f59e0b' stroke='%23f59e0b' stroke-width='0.5'%3E%3Cpath d='M2 4l3 12h14l3-12-5 4-5-6-5 6-5-4z'/%3E%3Crect x='5' y='16' width='14' height='4' rx='1'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 14px;
  pointer-events: none;
  z-index: 2;
}

.user-dropdown {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 8px;
  width: 260px;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 12px 40px rgba(0,0,0,0.12), 0 2px 8px rgba(0,0,0,0.06);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px);
  transition: all 0.25s ease;
  z-index: 1100;
  overflow: hidden;
}

.user-avatar-wrap:hover .user-dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.user-dropdown__header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 20px 20px 14px;
}

.user-dropdown__avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #f1f5f9 center/cover no-repeat;
  flex-shrink: 0;
}

.user-dropdown__info {
  flex: 1;
  min-width: 0;
}

.user-dropdown__name {
  font-size: 14px;
  font-weight: 600;
  color: #1d2129;
  margin-bottom: 2px;
}

.user-dropdown__id {
  font-size: 11px;
  color: #a5adb6;
}

.user-dropdown__vip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 0 16px 14px;
  padding: 8px 12px;
  background: #f9fafb;
  border-radius: 6px;
}

.user-dropdown__vip-badge {
  display: inline-flex;
  align-items: center;
  font-size: 12px;
  font-weight: 600;
  color: #667085;
}

.user-dropdown__vip.is-vip .user-dropdown__vip-badge {
  color: #f59e0b;
}

.user-dropdown__vip-date {
  font-size: 11px;
  color: #a5adb6;
}

.user-dropdown__menu {
  padding: 4px 8px;
}

.user-dropdown__item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  font-size: 13px;
  color: #4b5563;
  border-radius: 6px;
  transition: all 0.15s;
  text-decoration: none;
}

.user-dropdown__item:hover {
  background: #f5f7fa;
  color: #1d2129;
}

.user-dropdown__item svg {
  color: #a5adb6;
  flex-shrink: 0;
}

.user-dropdown__item:hover svg {
  color: #4b5563;
}

.user-dropdown__extra {
  margin-left: auto;
  font-size: 12px;
  color: #a5adb6;
}

.user-dropdown__footer {
  border-top: 1px solid #f1f5f9;
  padding: 6px 8px;
  margin-top: 4px;
}

.user-dropdown__item--logout {
  color: #86909c;
}

.user-dropdown__item--logout:hover {
  color: #096ddd;
  background: #eff6ff;
}

.user-dropdown__item--logout:hover svg {
  color: #096ddd;
}


/* ============================================
   笔记本/中等屏幕适配：收紧间距让 9 个导航项全部显示
   （这些断点放在文件末尾，确保覆盖前面的基础间距）
   ============================================ */
@media (max-width: 1440px) {
  .header-inner { padding: 0 28px; }
  .header-left { gap: 22px; }
  .nav { gap: 0; }
  .nav-item { padding: 6px 8px; font-size: 13.5px; }
  .header-right { gap: 14px; }
}

@media (max-width: 1280px) {
  .header-inner { padding: 0 18px; }
  .header-left { gap: 14px; }
  .nav-item { padding: 6px 6px; font-size: 13px; gap: 2px; }
  .logo-text-desc { display: none; }
  .header-right { gap: 10px; }
  .header-link { font-size: 13px; }
  .header-search-toggle { padding: 0 12px; font-size: 12.5px; }
}

@media (max-width: 1180px) and (min-width: 769px) {
  .header-inner { padding: 0 14px; }
  .header-left { gap: 10px; }
  .logo-text-group { display: none; } /* 仅留 logo 图标，给导航腾出空间 */
  .nav-item { padding: 5px 5px; font-size: 12.5px; }
  .nav-item svg { display: none; } /* 隐藏下拉小箭头进一步省空间 */
  .header-link { font-size: 12.5px; }
}
.user-avatar-notice-dot,.user-dropdown__notice-dot{display:block;width:8px;height:8px;border-radius:50%;background:#ef4444;box-shadow:0 0 0 2px #fff}.user-avatar-notice-dot{position:absolute;top:-1px;right:-1px;z-index:4;pointer-events:none}.user-dropdown__notice-dot{margin-left:auto;flex:0 0 auto}