/**
 * Header V2 - Light Theme (2-row layout)
 */

/* ========== CSS Variables ========== */
:root {
  --header-bg: var(--t-surface);
  --header-bg-secondary: var(--t-surface-2);
  --header-accent: var(--t-primary-text);
  --header-accent-hover: var(--t-primary);
  --header-text: var(--t-text);
  --header-text-muted: var(--t-text-3);
  --header-border: var(--t-line);
  --header-shadow: 0 2px 12px rgba(0,0,0,0.06);
  --header-radius: 10px;
  --header-transition: all 0.25s ease;
}

/* ========== Main Header ========== */
.header-v2 {
  background: var(--header-bg);
  box-shadow: var(--header-shadow);
  border-bottom: 1px solid var(--header-border);
  position: sticky;
  top: 0;
  z-index: 1030;
}

.header-v2__main {
  padding: 0.75rem 0;
}

.header-v2__container {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

/* ========== Logo ========== */
.header-v2__logo {
  flex-shrink: 0;
}
.header-v2__logo img {
  height: 42px;
  width: auto;
  transition: var(--header-transition);
}
.header-v2__logo:hover img {
  transform: scale(1.02);
}

/* ========== Category Button ========== */
.header-v2__category-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--header-accent);
  color: var(--t-white);
  border: none;
  padding: 0.6rem 1.1rem;
  border-radius: var(--header-radius);
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  transition: var(--header-transition);
  white-space: nowrap;
}
.header-v2__category-btn:hover {
  background: var(--header-accent-hover);
  transform: translateY(-1px);
}
.header-v2__category-btn i {
  font-size: 1.1rem;
}

/* Category Dropdown (desktop) */
.header-v2__category-dropdown {
  position: relative;
}
.header-v2__category-menu {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  min-width: 260px;
  background: var(--t-surface);
  border-radius: var(--header-radius);
  box-shadow: 0 10px 40px rgba(0,0,0,0.12);
  border: 1px solid var(--header-border);
  padding: 0.5rem;
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: var(--header-transition);
  z-index: 1050;
}
.header-v2__category-dropdown:hover .header-v2__category-menu,
.header-v2__category-menu.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.header-v2__category-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.65rem 0.9rem;
  color: var(--t-text-2);
  text-decoration: none;
  border-radius: 8px;
  font-weight: 500;
  transition: var(--header-transition);
}
.header-v2__category-item:hover {
  background: var(--t-surface-3);
  color: var(--header-accent);
}
.header-v2__category-item img {
  width: 22px;
  height: 22px;
  object-fit: contain;
}
.header-v2__category-item i {
  font-size: 1.1rem;
  width: 22px;
  text-align: center;
  color: var(--header-accent);
}

/* ========== Mega Menu ========== */
.header-v2__category-menu.header-v2__mega {
  display: flex !important;
  min-width: 720px !important;
  width: 720px;
  max-height: calc(100vh - 120px);
  padding: 0 !important;
  overflow: hidden;
}
.mega-left {
  max-height: calc(100vh - 120px);
}
.mega-right {
  max-height: calc(100vh - 120px);
}

@media (max-width: 991px) {
  .header-v2__category-menu.header-v2__mega {
    display: none !important;
  }
}
.mega-left {
  width: 230px;
  flex-shrink: 0;
  border-right: 1px solid var(--header-border);
  padding: 0.4rem;
  overflow-y: auto;
  background: var(--t-surface-2);
}
.mega-parent {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.55rem 0.75rem;
  color: var(--t-text-2);
  text-decoration: none;
  border-radius: 8px;
  font-weight: 500;
  font-size: 0.95rem;
  transition: all 0.12s;
  cursor: pointer;
}
.mega-parent img { width: 20px !important; height: 20px !important; max-width: 20px !important; max-height: 20px !important; object-fit: contain; flex-shrink: 0; }
.mega-parent i:first-child { font-size: 1rem; width: 20px; text-align: center; color: var(--header-accent); flex-shrink: 0; }
.mega-parent span { flex: 1; }
.mega-arrow { font-size: 0.7rem; color: var(--t-text-4); transition: transform 0.15s; }
.mega-parent:hover, .mega-parent.active {
  background: var(--t-primary-soft);
  color: var(--header-accent);
}
.mega-parent.active .mega-arrow { transform: translateX(2px); color: var(--header-accent); }

.mega-right {
  flex: 1;
  padding: 0.75rem 1rem;
  overflow-y: auto;
  position: relative;
}
.mega-panel {
  display: none;
}
.mega-panel.active {
  display: block;
}
/* .mega-panel-head:2026-10-18b 起整行是一个链接,样式见文件末尾 */

.mega-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 4px;
}
.mega-child {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.55rem 0.75rem;
  color: var(--t-text-2);
  text-decoration: none;
  border-radius: 6px;
  font-size: 0.93rem;
  transition: all 0.12s;
}
.mega-child:hover { background: var(--t-surface-3); color: var(--header-accent); }
.mega-child img { width: 18px !important; height: 18px !important; max-width: 18px !important; max-height: 18px !important; object-fit: contain; flex-shrink: 0; }

.mega-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 2rem;
  color: var(--t-text-4);
  font-size: 0.85rem;
}
.mega-empty i { font-size: 2rem; }

/* Legacy submenu (keep for compatibility) */
.header-v2__submenu { display: none; }
.header-v2__category-item-wrap { position: relative; }
.header-v2__submenu-item { display: block; padding: 0.55rem 0.9rem; color: var(--t-text-2); text-decoration: none; border-radius: 6px; font-size: 0.9rem; }

/* ========== Search Box ========== */
.header-v2__search {
  flex: 1;
  max-width: 520px;
}
.header-v2__search-form {
  display: flex;
  align-items: center;
  background: var(--header-bg-secondary);
  border: 1px solid var(--header-border);
  border-radius: 999px;
  transition: var(--header-transition);
  position: relative;
}
.header-v2__search-form:focus-within {
  background: var(--t-surface);
  border-color: var(--header-accent);
  box-shadow: 0 0 0 3px rgba(59,130,246,0.12);
}
.header-v2__search-input {
  flex: 1;
  border: none;
  background: transparent;
  padding: 0.65rem 1rem;
  color: var(--header-text);
  font-size: 0.95rem;
  outline: none;
}
.header-v2__search-input::placeholder {
  color: var(--header-text-muted);
}
.header-v2__search {
  position: relative;
}
.header-v2__search-suggestions {
  /* 定位由 Vue 组件内部处理 */
}
.header-v2__search-btn {
  background: var(--header-accent);
  border: none;
  color: var(--t-white);
  padding: 0.65rem 1.2rem;
  cursor: pointer;
  transition: var(--header-transition);
  border-radius: 0 999px 999px 0;
  margin: -1px -1px -1px 0;
}
.header-v2__search-btn:hover {
  background: var(--header-accent-hover);
}
.header-v2__search-btn i {
  font-size: 1.1rem;
}

/* ========== Right Actions ========== */
.header-v2__actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-left: auto;
  flex-shrink: 0;
}

/* Balance Display */
.header-v2__balance {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--t-success-soft);
  border: 1px solid var(--t-success-line);
  padding: 0.45rem 0.85rem;
  border-radius: 999px;
  color: var(--t-success-strong);
  font-weight: 600;
  font-size: 0.9rem;
  white-space: nowrap;
}
.header-v2__balance i {
  font-size: 1rem;
}

/* Recharge Button */
.header-v2__recharge {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  background: var(--t-success);
  border: none;
  border-radius: 50%;
  color: var(--t-white);
  font-size: 1rem;
  text-decoration: none;
  transition: var(--header-transition);
}
.header-v2__recharge:hover {
  background: var(--t-success-strong);
  transform: scale(1.05);
  color: var(--t-white);
}

/* User Dropdown */
.header-v2__user {
  position: relative;
}
.header-v2__user-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--header-bg-secondary);
  border: 1px solid var(--header-border);
  padding: 0.5rem 1rem;
  border-radius: 999px;
  color: var(--header-text);
  font-weight: 500;
  font-size: 0.9rem;
  cursor: pointer;
  transition: var(--header-transition);
}
.header-v2__user-btn:hover {
  background: var(--t-surface-3);
  border-color: var(--t-line-3);
}
.header-v2__user-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--header-accent);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--t-white);
  font-size: 0.85rem;
}
.header-v2__user-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 200px;
  background: var(--t-surface);
  border-radius: var(--header-radius);
  box-shadow: 0 10px 40px rgba(0,0,0,0.12);
  border: 1px solid var(--header-border);
  padding: 0.5rem;
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: var(--header-transition);
  z-index: 1050;
}
.header-v2__user:hover .header-v2__user-menu,
.header-v2__user-menu.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.header-v2__user-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.6rem 0.9rem;
  color: var(--t-text-2);
  text-decoration: none;
  border-radius: 8px;
  font-weight: 500;
  transition: var(--header-transition);
}
.header-v2__user-item:hover {
  background: var(--t-surface-3);
  color: var(--header-accent);
}
.header-v2__user-item i {
  font-size: 1rem;
  width: 20px;
  text-align: center;
}
.header-v2__user-divider {
  height: 1px;
  background: var(--t-surface-4);
  margin: 0.4rem 0;
}

/* ========== Navigation Bar ========== */
.header-v2__nav {
  background: var(--header-bg-secondary);
  border-top: 1px solid var(--header-border);
}
.header-v2__nav-container {
  display: flex;
  align-items: center;
  gap: 0;
}
.header-v2__nav-links {
  display: flex;
  align-items: center;
  margin-left: auto;
}
.header-v2__nav-link {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.85rem 1.1rem;
  color: var(--header-text-muted);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.92rem;
  border-bottom: 2px solid transparent;
  transition: var(--header-transition);
}
.header-v2__nav-link:hover,
.header-v2__nav-link.active {
  color: var(--header-accent);
  border-bottom-color: var(--header-accent);
}
.header-v2__nav-link i {
  font-size: 1rem;
}

/* Tools Dropdown in Nav */
.header-v2__tools-dropdown {
  position: relative;
}
.header-v2__tools-menu {
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 220px;
  background: var(--t-surface);
  border-radius: var(--header-radius);
  box-shadow: 0 10px 40px rgba(0,0,0,0.12);
  border: 1px solid var(--header-border);
  padding: 0.5rem;
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: var(--header-transition);
  z-index: 1050;
}
.header-v2__tools-dropdown:hover .header-v2__tools-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.header-v2__tools-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.6rem 0.9rem;
  color: var(--t-text-2);
  text-decoration: none;
  border-radius: 8px;
  font-weight: 500;
  transition: var(--header-transition);
}
.header-v2__tools-item:hover {
  background: var(--t-surface-3);
  color: var(--header-accent);
}
.header-v2__tools-item i {
  font-size: 1rem;
  width: 20px;
  text-align: center;
  color: var(--header-accent);
}

/* Seller Apply Button */
.header-v2__seller-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin-left: auto;
  background: linear-gradient(135deg, var(--t-warning), var(--t-warning));
  color: var(--t-white) !important;
  padding: 0.55rem 1rem;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.85rem;
  text-decoration: none;
  transition: var(--header-transition);
}
.header-v2__seller-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 15px rgba(249,115,22,0.35);
  color: var(--t-white);
}

/* ========== Language Dropdown ========== */
.header-v2__lang-dropdown {
  position: relative;
}
.header-v2__lang-btn {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  background: transparent;
  border: 1px solid var(--header-border);
  padding: 0.3rem 0.65rem;
  border-radius: 999px;
  color: var(--header-text-muted);
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--header-transition);
}
.header-v2__lang-btn:hover {
  background: var(--header-bg-secondary);
  border-color: var(--t-line-3);
}
.header-v2__lang-btn img {
  width: 20px;
  height: 14px;
  object-fit: cover;
  border-radius: 2px;
}
.header-v2__lang-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 140px;
  background: var(--t-surface);
  border-radius: var(--header-radius);
  box-shadow: 0 10px 40px rgba(0,0,0,0.12);
  border: 1px solid var(--header-border);
  padding: 0.4rem;
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: var(--header-transition);
  z-index: 1050;
}
.header-v2__lang-dropdown:hover .header-v2__lang-menu,
.header-v2__lang-menu.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.header-v2__lang-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.7rem;
  color: var(--t-text-2);
  text-decoration: none;
  border-radius: 6px;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--header-transition);
}
.header-v2__lang-item:hover {
  background: var(--t-surface-3);
  color: var(--header-accent);
}
.header-v2__lang-item img {
  width: 20px;
  height: 14px;
  object-fit: cover;
  border-radius: 2px;
}

/* ========== Mobile Toggle ========== */
.header-v2__mobile-toggle {
  display: none;
  background: transparent;
  border: 1px solid var(--header-border);
  color: var(--header-text);
  padding: 0.5rem 0.75rem;
  border-radius: 8px;
  font-size: 1.3rem;
  cursor: pointer;
  transition: var(--header-transition);
}
.header-v2__mobile-toggle:hover {
  background: var(--header-bg-secondary);
}

/* ========== Mobile Category Flyout ========== */
.header-v2__mobile-category-trigger {
  position: relative;
}
.header-v2__category-btn--mobile {
  padding: 0.5rem 0.9rem;
  font-size: 0.85rem;
}
.header-v2__mobile-category-flyout {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 320px;
  width: calc(100vw - 32px);
  max-width: 460px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  background: var(--t-surface);
  border-radius: var(--header-radius);
  box-shadow: 0 10px 40px rgba(0,0,0,0.15);
  border: 1px solid var(--header-border);
  padding: 0.5rem;
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: var(--header-transition);
  z-index: 1050;
}
.header-v2__mobile-category-flyout.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.header-v2__mobile-cat-link {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.65rem 0.9rem;
  color: var(--t-text-2);
  text-decoration: none;
  border-radius: 8px;
  font-weight: 500;
  font-size: 0.9rem;
  transition: var(--header-transition);
}
.header-v2__mobile-cat-link:hover {
  background: var(--t-surface-3);
  color: var(--header-accent);
}
.header-v2__mobile-cat-link img {
  width: 22px !important;
  height: 22px !important;
  max-width: 22px !important;
  max-height: 22px !important;
  object-fit: contain;
  flex-shrink: 0;
}
.header-v2__mobile-cat-link i {
  font-size: 1.1rem;
  width: 22px;
  text-align: center;
  color: var(--header-accent);
}
.header-v2__mobile-cat-arrow {
  margin-left: auto;
  font-size: 0.75rem !important;
  width: auto !important;
  color: var(--t-text-4) !important;
  transition: transform 0.2s ease;
}
.header-v2__mobile-cat-item.open > .header-v2__mobile-cat-link .header-v2__mobile-cat-arrow {
  transform: rotate(90deg);
  color: var(--header-accent) !important;
}
.header-v2__mobile-cat-children {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
  margin-left: 0.5rem;
  border-left: 2px solid var(--t-line);
  padding-left: 0.4rem;
}
.header-v2__mobile-cat-item.open > .header-v2__mobile-cat-children {
  max-height: 800px;
}
.mobile-cat-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
}
.header-v2__mobile-cat-child {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem 0.65rem;
  color: var(--t-text-2);
  text-decoration: none;
  border-radius: 6px;
  font-size: 0.85rem;
  transition: var(--header-transition);
  white-space: nowrap;
}
.mobile-cat-grid .header-v2__mobile-cat-child {
  flex: 0 0 auto;
  background: var(--t-surface-2);
  border: 1px solid var(--t-line-2);
  border-radius: 6px;
  padding: 0.35rem 0.6rem;
  font-size: 0.82rem;
}
.mobile-cat-grid .header-v2__mobile-cat-child:hover {
  background: var(--t-primary-soft);
  border-color: var(--t-primary-line);
  color: var(--header-accent);
}
.header-v2__mobile-cat-child:hover {
  background: var(--t-surface-3);
  color: var(--header-accent);
}
.header-v2__mobile-cat-child img {
  width: 18px !important;
  height: 18px !important;
  max-width: 18px !important;
  max-height: 18px !important;
  object-fit: contain;
  flex-shrink: 0;
}
.header-v2__mobile-cat-child--all {
  font-weight: 600;
  color: var(--header-accent);
  border-bottom: 1px solid var(--header-border);
  margin-bottom: 4px;
  padding-bottom: 6px;
  width: 100%;
}

/* ========== Mobile Menu ========== */
.header-v2__mobile-menu {
  display: none;
  position: fixed;
  top: 0;
  right: -100%;
  width: 86%;
  max-width: 380px;
  height: 100vh;
  background: var(--t-surface-2);
  z-index: 10120;
  transition: right 0.3s cubic-bezier(0.22, 1, 0.36, 1);
  overflow-y: auto;
  box-shadow: -8px 0 32px rgba(15, 23, 42, 0.08);
  visibility: hidden;
  flex-direction: column;
}
.header-v2__mobile-menu.open {
  right: 0;
  visibility: visible;
}
.header-v2__mobile-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.4);
  z-index: 10110;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}
.header-v2__mobile-overlay.open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}
.header-v2__mobile-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  background: var(--t-surface);
  position: sticky;
  top: 0;
  z-index: 5;
  border-bottom: 1px solid var(--t-line);
}
.header-v2__mobile-close {
  background: transparent;
  border: none;
  color: var(--header-text);
  font-size: 1.5rem;
  cursor: pointer;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  transition: var(--header-transition);
}
.header-v2__mobile-close:hover {
  background: var(--header-bg-secondary);
}

/* Mobile search */
.header-v2__mobile-search {
  display: none;
  position: relative;
}
.header-v2__search-suggestions--mobile {
  /* 定位由 Vue 组件内部处理，只需设置 z-index */
}
.header-v2__search-suggestions--mobile .search-suggestions {
  z-index: 10200;
}

/* Mobile user card (modern elegant) */
.header-v2__mobile-user-card {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  margin: 1rem 1rem 0.5rem;
  padding: 1rem;
  background: var(--t-surface);
  border: 1px solid var(--t-line);
  border-radius: 16px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}
.header-v2__mobile-user-card-avatar {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--t-primary), var(--t-accent));
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--t-white);
  font-size: 1.1rem;
  flex-shrink: 0;
  box-shadow: 0 6px 16px rgba(99, 102, 241, 0.25);
}
.header-v2__mobile-user-card-info {
  flex: 1;
  min-width: 0;
}
.header-v2__mobile-user-card-name {
  font-weight: 700;
  color: var(--t-text);
  font-size: 0.98rem;
  margin-bottom: 0.3rem;
  letter-spacing: -0.01em;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  min-width: 0;
}
.header-v2__mobile-user-card-name-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
  flex: 0 1 auto;
}
.header-v2__mobile-user-card-lv {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px 8px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--t-warning-soft), var(--t-warning-line));
  color: var(--t-warning-strong);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  flex-shrink: 0;
}
.header-v2__mobile-user-card-lv i {
  font-size: 0.78rem;
}

/* Mobile level progress (under user-card) */
.header-v2__mobile-lv-progress {
  margin: 0 1rem 0.65rem;
  padding: 10px 12px;
  background: var(--t-surface);
  border: 1px solid var(--t-line);
  border-radius: 12px;
}
.header-v2__mobile-lv-progress-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.78rem;
  color: var(--t-text-2);
  margin-bottom: 6px;
}
.header-v2__mobile-lv-progress-meta b {
  color: var(--t-warning-strong);
  font-weight: 700;
}
.header-v2__mobile-lv-progress-pct {
  font-weight: 700;
  color: var(--t-warning-text);
  font-size: 0.78rem;
  letter-spacing: 0.02em;
}
.header-v2__mobile-lv-progress-track {
  height: 6px;
  background: var(--t-surface-3);
  border-radius: 999px;
  overflow: hidden;
}
.header-v2__mobile-lv-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--t-warning), var(--t-warning));
  border-radius: 999px;
  transition: width 0.4s ease;
}
.header-v2__mobile-user-card-balance {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--t-warning-soft), var(--t-warning-line));
  color: var(--t-warning-strong);
  font-weight: 700;
  font-size: 0.82rem;
}
.header-v2__mobile-user-card-balance i {
  font-size: 0.78rem;
}
.header-v2__mobile-user-card-recharge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  background: var(--t-success);
  border-radius: 50%;
  color: var(--t-white);
  font-size: 0.7rem;
  text-decoration: none;
  margin-left: 0.15rem;
  transition: transform 0.2s ease, background 0.2s ease;
}
.header-v2__mobile-user-card-recharge:hover {
  background: var(--t-success-strong);
  color: var(--t-white);
  transform: scale(1.1);
}
.header-v2__mobile-user-card-dash {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  background: var(--t-surface-3);
  border-radius: 11px;
  color: var(--t-text-2);
  text-decoration: none;
  font-size: 0.95rem;
  flex-shrink: 0;
  transition: all 0.2s ease;
}
.header-v2__mobile-user-card-dash:hover {
  background: var(--header-accent);
  color: var(--t-white);
  transform: translateY(-1px);
}

/* Mobile auth buttons */
.header-v2__mobile-auth-btns {
  display: flex;
  gap: 0.6rem;
  padding: 1rem 1rem 0.25rem;
}
.header-v2__mobile-auth-btns a {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.7rem;
  border-radius: 12px;
  font-weight: 600;
  font-size: 0.9rem;
  text-decoration: none;
  transition: all 0.2s ease;
}
.header-v2__mobile-login-btn {
  background: linear-gradient(135deg, var(--t-primary), var(--t-accent));
  color: var(--t-white) !important;
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.25);
}
.header-v2__mobile-login-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(59, 130, 246, 0.35);
}
.header-v2__mobile-register-btn {
  background: var(--t-surface);
  border: 1px solid var(--t-line);
  color: var(--t-text-2) !important;
}
.header-v2__mobile-register-btn:hover {
  background: var(--t-surface-2);
  border-color: var(--t-line-3);
}

/* Mobile body */
.header-v2__mobile-body {
  padding: 0.5rem 0.75rem 1rem;
  flex: 1;
}

/* Mobile nav items (modern: icon chip + soft hover, no borders) */
.header-v2__mobile-nav-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-height: 46px;
  padding: 0 0.65rem;
  margin: 2px 0;
  color: var(--t-text);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.93rem;
  border-radius: 10px;
  transition: background 0.18s ease, color 0.18s ease, transform 0.18s ease;
}
.header-v2__mobile-nav-item:hover {
  color: var(--header-accent);
  background: var(--t-surface-3);
}
.header-v2__mobile-nav-item:active {
  transform: scale(0.98);
}
.header-v2__mobile-nav-item i {
  font-size: 1rem;
  width: 30px;
  height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: var(--header-accent);
  background: var(--t-primary-soft);
  border-radius: 9px;
  flex-shrink: 0;
  transition: background 0.18s ease, color 0.18s ease;
}
.header-v2__mobile-nav-item:hover i {
  background: var(--header-accent);
  color: var(--t-white);
}

/* Mobile accordion (beautified) */
.header-v2__mobile-accordion {
  margin: 2px 0;
}
.header-v2__mobile-accordion-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  min-height: 46px;
  padding: 0 0.65rem;
  background: transparent;
  border: none;
  border-radius: 10px;
  color: var(--t-text);
  font-weight: 500;
  font-size: 0.93rem;
  cursor: pointer;
  transition: background 0.18s ease;
}
.header-v2__mobile-accordion-toggle:hover {
  background: var(--t-surface-3);
}
.header-v2__mobile-accordion-toggle > span {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.header-v2__mobile-accordion-toggle i.las.la-tools,
.header-v2__mobile-accordion-toggle i.las.la-th-large {
  font-size: 1rem;
  width: 30px;
  height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--header-accent);
  background: var(--t-primary-soft);
  border-radius: 9px;
  margin: 0 !important;
}
.header-v2__mobile-accordion-toggle i:last-child {
  transition: transform 0.25s ease;
  color: var(--t-text-4);
  font-size: 0.85rem;
}
.header-v2__mobile-accordion.open .header-v2__mobile-accordion-toggle i:last-child {
  transform: rotate(180deg);
  color: var(--header-accent);
}
.header-v2__mobile-accordion-body {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
}
.header-v2__mobile-accordion.open .header-v2__mobile-accordion-body {
  max-height: 2000px;
  margin-top: 4px;
}
.header-v2__mobile-accordion-body a {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  min-height: 40px;
  padding: 0 0.65rem 0 3rem;
  margin: 1px 0;
  color: var(--t-text-2);
  text-decoration: none;
  font-size: 0.88rem;
  border-radius: 8px;
  transition: background 0.18s ease, color 0.18s ease;
}
.header-v2__mobile-accordion-body a:hover {
  color: var(--header-accent);
  background: var(--t-surface-2);
}
.header-v2__mobile-accordion-body a img {
  width: 18px;
  height: 18px;
  object-fit: contain;
}
.header-v2__mobile-accordion-body a i {
  width: 20px;
  text-align: center;
  font-size: 0.95rem;
  color: var(--header-accent);
}

/* Mobile language section (capsule buttons) */
.header-v2__mobile-lang {
  padding: 0.85rem 0.5rem 0.5rem;
  margin-top: 0.65rem;
  border-top: 1px solid var(--t-line);
}
.header-v2__mobile-lang-label {
  font-weight: 600;
  color: var(--t-text-4);
  padding: 0.25rem 0.25rem 0.6rem;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.header-v2__mobile-lang-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.header-v2__mobile-lang-item {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem 0.75rem;
  border: 1px solid var(--header-border);
  border-radius: 999px;
  color: var(--header-text);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--header-transition);
}
.header-v2__mobile-lang-item:hover {
  border-color: var(--header-accent);
  color: var(--header-accent);
  background: var(--t-primary-soft);
}
.header-v2__mobile-lang-item.active {
  border-color: var(--header-accent);
  color: var(--header-accent);
  background: var(--t-primary-soft);
  font-weight: 600;
}
.header-v2__mobile-lang-item img {
  width: 18px;
  height: 13px;
  object-fit: cover;
  border-radius: 2px;
}
/* Combined Language + Currency: tab style */
.header-v2__mobile-locale {
  padding: 0.75rem 0;
  border-top: 1px solid var(--t-line-2);
  margin-top: 0.5rem;
}
.header-v2__mobile-locale-tabs {
  display: flex;
  gap: 4px;
  padding: 4px;
  background: var(--t-surface-3);
  border-radius: 12px;
  margin-bottom: 0.7rem;
}
.header-v2__mobile-locale-tab {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.3rem 0.4rem;
  padding: 0.5rem 0.4rem;
  background: transparent;
  border: none;
  border-radius: 8px;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--header-text-muted);
  cursor: pointer;
  transition: all 0.18s;
  min-width: 0;
}
.header-v2__mobile-locale-tab i {
  font-size: 0.95rem;
  flex-shrink: 0;
}
.header-v2__mobile-locale-tab-label {
  font-weight: 500;
}
.header-v2__mobile-locale-tab-cur {
  font-weight: 700;
  color: var(--header-accent);
  font-size: 0.78rem;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.header-v2__mobile-locale-tab.active {
  background: var(--t-surface);
  color: var(--header-text);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
  font-weight: 600;
}
.header-v2__mobile-locale-tab.active .header-v2__mobile-locale-tab-cur {
  color: var(--header-accent);
}
.header-v2__mobile-locale-panel {
  display: none;
}
.header-v2__mobile-locale-panel.active {
  display: block;
}

/* Mobile footer (logout fixed at bottom) */
.header-v2__mobile-footer {
  padding: 0.85rem 1rem;
  border-top: 1px solid var(--t-line);
  margin-top: auto;
  background: var(--t-surface-2);
  position: sticky;
  bottom: 0;
}
.header-v2__mobile-logout {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.7rem;
  color: var(--t-danger-text);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9rem;
  border: 1px solid var(--t-danger-line);
  border-radius: 12px;
  background: var(--t-surface);
  transition: all 0.2s ease;
}
.header-v2__mobile-logout:hover {
  background: var(--t-danger-soft);
  border-color: var(--t-danger-line);
  color: var(--t-danger-text);
}

/* ========== Responsive ========== */
@media (max-width: 1199px) {
  .header-v2__search {
    max-width: 400px;
  }
  .header-v2__nav-link {
    padding: 0.85rem 0.85rem;
    font-size: 0.88rem;
  }
}

@media (max-width: 991px) {
  .header-v2__nav {
    display: none;
  }
  .header-v2__mobile-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
  }
  .header-v2__mobile-menu,
  .header-v2__mobile-overlay {
    display: block;
  }
  .header-v2__mobile-menu {
    display: flex;
  }
  .header-v2__search {
    /* flex 可收缩 + min-width:0 链:input 固有宽度会撑住 flex 项不肯缩,
       768~991 区间曾因此把头部撑出容器 54px */
    flex: 1 1 140px;
    min-width: 0;
    max-width: 320px;
  }
  .header-v2__search-form,
  .header-v2__search-input {
    min-width: 0;
  }
}

@media (max-width: 767px) {
  .header-v2__container {
    gap: 0.75rem;
  }
  .header-v2__search {
    display: none;
  }
  .header-v2__mobile-search {
    display: block;
    padding: 1rem 1rem 0;
  }
  .header-v2__mobile-search .header-v2__search-form {
    background: var(--t-surface-3);
    border-radius: 12px;
  }
  .header-v2__balance {
    display: none;
  }
  .header-v2__recharge {
    display: none !important;
  }
  .header-v2__logo img {
    height: 36px;
  }
  .header-v2__actions {
    margin-left: auto;
  }
}

@media (max-width: 575px) {
  .header-v2__main {
    padding: 0.5rem 0;
  }
  .header-v2__user-btn span:not(.header-v2__user-avatar) {
    display: none;
  }
  .header-v2__user-btn {
    padding: 0.4rem;
  }
  .header-v2__recharge {
    width: 32px;
    height: 32px;
  }
  .header-v2__category-btn--mobile {
    padding: 0.5rem 0.65rem;
  }
}

@media (max-width: 575px) {
  .header-v2__mobile-category-flyout {
    position: fixed;
    top: auto;
    left: 12px;
    right: 12px;
    min-width: auto;
  }
}

@media (max-width: 420px) {
  .header-v2__category-btn--mobile span {
    display: none;
  }
}

/* ========== Custom Category Dropdown ========== */
.header-v2__search-cat-dropdown {
  position: relative;
  flex-shrink: 0;
}
.header-v2__search-cat-btn {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  background: transparent;
  border: none;
  color: var(--header-text);
  font-size: 0.88rem;
  font-weight: 500;
  padding: 0.65rem 0.5rem 0.65rem 1rem;
  cursor: pointer;
  transition: var(--header-transition);
  flex-shrink: 0;
  max-width: 110px;
}
.header-v2__search-cat-btn .search-cat-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 70px;
}
.header-v2__search-cat-btn:hover {
  color: var(--header-accent);
}
.header-v2__search-cat-btn i {
  flex-shrink: 0;
  font-size: 0.7rem;
  transition: transform 0.2s;
}
.header-v2__search-cat-dropdown.open .header-v2__search-cat-btn i {
  transform: rotate(180deg);
}
.header-v2__search-cat-menu {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  min-width: 180px;
  max-height: 320px;
  overflow-y: auto;
  background: var(--t-surface);
  border-radius: 12px;
  box-shadow: 0 8px 30px rgba(0,0,0,0.12), 0 2px 8px rgba(0,0,0,0.08);
  border: 1px solid var(--header-border);
  padding: 0.5rem;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: all 0.2s ease;
  z-index: 1050;
}
.header-v2__search-cat-dropdown.open .header-v2__search-cat-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.header-v2__search-cat-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 0.75rem;
  font-size: 0.875rem;
  color: var(--header-text);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s;
}
.header-v2__search-cat-item:hover {
  background: var(--header-bg-secondary);
  color: var(--header-accent);
}
.header-v2__search-cat-item.active {
  background: linear-gradient(135deg, var(--t-primary-soft), var(--t-primary-soft-2));
  color: var(--header-accent);
  font-weight: 500;
}
.header-v2__search-cat-item img {
  width: 20px;
  height: 20px;
  object-fit: contain;
  border-radius: 4px;
}
.header-v2__search-cat-item--child {
  padding-left: 1.5rem;
  font-size: 0.82rem;
  color: var(--header-text-muted);
}
.header-v2__search-cat-item--child:hover {
  color: var(--header-accent);
}
.header-v2__search-divider {
  width: 1px;
  height: 20px;
  background: var(--header-border);
  flex-shrink: 0;
}
/* Mobile adjustments */
.header-v2__search-cat-dropdown--mobile .header-v2__search-cat-btn {
  font-size: 0.8rem;
  padding: 0.5rem 0.3rem 0.5rem 0.6rem;
  max-width: 85px;
}
.header-v2__search-cat-dropdown--mobile .header-v2__search-cat-btn .search-cat-label {
  max-width: 50px;
}
.header-v2__search-cat-dropdown--mobile .header-v2__search-cat-menu {
  min-width: 160px;
  max-height: 280px;
}
/* Scrollbar styling */
.header-v2__search-cat-menu::-webkit-scrollbar {
  width: 4px;
}
.header-v2__search-cat-menu::-webkit-scrollbar-track {
  background: transparent;
}
.header-v2__search-cat-menu::-webkit-scrollbar-thumb {
  background: var(--t-line-3);
  border-radius: 4px;
}
.header-v2__search-cat-menu::-webkit-scrollbar-thumb:hover {
  background: var(--t-text-4);
}
/* Adjust search input padding */
.header-v2__search-form:has(.header-v2__search-cat-dropdown) .header-v2__search-input {
  padding-left: 0.75rem;
}


/* ═══ 极窄屏(≤380px):logo/分类按钮收缩,防头部撑破(实测320px曾溢出20px) ═══ */
@media (max-width: 380px) {
  .header-v2__logo { min-width: 0; flex-shrink: 1; }
  .header-v2__logo img { height: 30px; max-width: 34vw; object-fit: contain; }
  .header-v2__mobile-category-trigger .header-v2__category-btn span { display: none; }
  .header-v2__mobile-category-trigger .header-v2__category-btn { padding: 8px 10px; }
  .header-v2__actions { gap: 0.4rem; }
}

/* ===== 2026-10-05 导航自适应(按语言实际宽度) =====
   英文 / 越南文导航比中文长 190–414px,固定断点压不住(1280 宽英文把 Home 拆成 Hom/e)。
   文字一律不折行;header_v2 里的脚本量一下放不放得下,放不下依次:
   nav-fit-1 去装饰图标 / NEW 徽标并收紧 → nav-fit-2 再缩小字号 → html.nav-collapsed 收成「☰」菜单(手机菜单里链接齐全) */
.header-v2__nav-link,
.header-v2__seller-btn,
.header-v2__nav-container .header-v2__category-btn { white-space: nowrap; }
.header-v2__nav-container.nav-fit-1 .header-v2__nav-link { padding-left: 0.55rem; padding-right: 0.55rem; gap: 0.25rem; }
.header-v2__nav-container.nav-fit-1 .header-v2__nav-link > i:first-child:not(.la-angle-down),
.header-v2__nav-container.nav-fit-1 .nav-new-badge { display: none; }
.header-v2__nav-container.nav-fit-1 .header-v2__seller-btn { padding-left: 0.8rem; padding-right: 0.8rem; margin-left: 0.4rem; }
.header-v2__nav-container.nav-fit-1 .header-v2__category-btn { padding-left: 0.9rem; padding-right: 0.9rem; }
.header-v2__nav-container.nav-fit-2 .header-v2__nav-link { padding-left: 0.4rem; padding-right: 0.4rem; font-size: 0.82rem; }
.header-v2__nav-container.nav-fit-2 .header-v2__seller-btn { font-size: 0.82rem; }
/* 2026-11-09 量尺寸时关掉过渡:导航链接的 padding / 字号带 transition,fit() 加完类名立刻量到的还是过渡起点的旧宽度,
   误判「还放不下」直接收成「☰」(俄文 1000–1199 宽就是这样被收起的) */
.header-v2__nav-container.nav-fitting .header-v2__nav-link,
.header-v2__nav-container.nav-fitting .header-v2__seller-btn,
.header-v2__nav-container.nav-fitting .header-v2__category-btn { transition: none !important; }
/* 2026-11-08 nav-fit-3:收成「☰」之前再试一档 —— 卖家按钮只留图标(文字还在,读屏可读)、分类按钮和链接再收紧;外语(俄文)标签长时整条导航才不至于直接消失 */
.header-v2__nav-container.nav-fit-3 .header-v2__seller-btn { font-size: 0; gap: 0; padding-left: 0.65rem; padding-right: 0.65rem; margin-left: 0.3rem; }
.header-v2__nav-container.nav-fit-3 .header-v2__seller-btn .ai,
.header-v2__nav-container.nav-fit-3 .header-v2__seller-btn i,
.header-v2__nav-container.nav-fit-3 .header-v2__seller-btn svg { font-size: 1.05rem; margin-right: 0; }
.header-v2__nav-container.nav-fit-3 .header-v2__nav-link { padding-left: 0.3rem; padding-right: 0.3rem; font-size: 0.8rem; }
.header-v2__nav-container.nav-fit-3 .header-v2__category-btn { padding-left: 0.7rem; padding-right: 0.7rem; }
@media (min-width: 992px) {
  html.nav-collapsed .header-v2__nav { display: none; }
  html.nav-collapsed .header-v2__mobile-toggle { display: flex; align-items: center; justify-content: center; }
  html.nav-collapsed .header-v2__mobile-overlay { display: block; }
  html.nav-collapsed .header-v2__mobile-menu { display: flex; }
}

/* 2026-10-05 公开页头(登录态)992–1199px:余额 + 语言 + 用户名在 1024 宽挤出屏幕(页宽 1088)→ 用户名只留头像
   2026-11-01 语言入口缩成「国旗 + 币种」(150→72px)后 992 宽也放得下(搜索框 400→335),只在 992–1023 保留只留头像 */
@media (min-width: 992px) and (max-width: 1023.98px) {
  #header .hua__user-name, #header .hua__user-arrow { display: none !important; }
}

/* ===== 2026-10-05 修主题全局 .btn{color:var(--t-white) !important} 误伤 =====
   main.min.css 给所有 .btn 强制白字,Bootstrap 的描边 / 浅色 / 链接按钮(底色透明或浅色)因此白底白字看不见
   (例:推广提现「最大」、搜索无结果「清除筛选」)。按 Bootstrap 原配色恢复;描边按钮悬停时填充底色、文字回白。 */
.btn.btn-outline-primary   { color: var(--t-primary-text) !important; }
.btn.btn-outline-secondary { color: var(--t-text-2) !important; }
.btn.btn-outline-success   { color: var(--t-success-strong) !important; }
.btn.btn-outline-danger    { color: var(--t-danger-text) !important; }
.btn.btn-outline-warning   { color: var(--t-warning-text) !important; }
.btn.btn-outline-info      { color: var(--t-info-text) !important; }
.btn.btn-outline-dark      { color: var(--t-text) !important; }
.btn.btn-light             { color: var(--t-text) !important; }
.btn.btn-link              { color: var(--t-primary-text) !important; }
.btn[class*="btn-outline-"]:hover,
.btn[class*="btn-outline-"]:focus-visible,
.btn[class*="btn-outline-"].active { color: var(--t-white) !important; }
.btn.btn-outline-light { color: var(--t-white) !important; }

/* 2026-10-10 手机顶栏:越南文「Danh mục sản phẩm」/ 英文分类按钮文字太长,把登录 / 菜单按钮挤出屏幕(站长 iPhone 截图)。
   外语在手机宽度(≤575px)分类按钮只留图标,尺寸与中文版窄屏一致(不改内边距——第一版清了上下内边距,按钮只剩 20px 高);
   576–991px 放得下,用短说法 Categories / Danh mục。 */
.header-v2__category-btn .cat-short { display: none; }
@media (max-width: 991.98px) {
  html:not([lang^="zh"]) .header-v2__mobile-category-trigger .header-v2__category-btn .cat-long { display: none; }
  html:not([lang^="zh"]) .header-v2__mobile-category-trigger .header-v2__category-btn .cat-short { display: inline; }
}
@media (max-width: 575.98px) {
  html:not([lang^="zh"]) .header-v2__mobile-category-trigger .header-v2__category-btn .cat-short { display: none; }
  .header-v2__actions { min-width: 0; flex-shrink: 1; }
  .header-v2__actions > * { flex-shrink: 0; }
  .header-v2__actions a, .header-v2__actions button { white-space: nowrap; }
}

/* ========== 2026-10-18 分类菜单:右侧面板只在有二级分类时浮出 ========== */
.header-v2__category-menu.header-v2__mega {
  width: auto;
  min-width: 0 !important;
  max-height: none;
  overflow: visible;
  display: block !important;
}
.header-v2__mega .mega-left {
  width: 236px;
  max-height: calc(100vh - 150px);
  padding: 0.35rem;
  border-right: 0;
  border-radius: inherit;
  background: var(--t-surface);
}
.header-v2__mega .mega-parent {
  padding: 0.32rem 0.7rem;
  font-size: 0.9rem;
}
.header-v2__mega .mega-right {
  display: none;
  position: absolute;
  top: -1px;
  left: calc(100% - 1px);
  width: 440px;
  max-height: calc(100vh - 150px);
  overflow-y: auto;
  padding: 0.75rem 1rem;
  background: var(--t-surface);
  border: 1px solid var(--header-border);
  border-radius: var(--header-radius);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.12);
}
.header-v2__mega.has-flyout .mega-right { display: block; }
.header-v2__mega .mega-services {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 4px;
  margin-top: 4px;
  padding: 6px 2px 2px;
  border-top: 1px solid var(--header-border);
}
.header-v2__mega .mega-svc {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  padding: 4px 9px;
  border: 1px solid var(--header-border);
  border-radius: 8px;
  background: var(--t-surface-2);
  color: var(--t-text-2);
  font-size: 0.8rem;
  text-decoration: none;
  white-space: nowrap;
}
.header-v2__mega .mega-svc i { color: var(--header-accent); font-size: 0.95rem; }
.header-v2__mega .mega-svc:hover { border-color: var(--header-accent); color: var(--header-accent); }
.header-v2__mega .mega-child { align-items: flex-start; }
.header-v2__mega .mega-child span { white-space: normal; line-height: 1.35; overflow-wrap: anywhere; }
.header-v2__mega .mega-child img, .header-v2__mega .mega-child i { margin-top: 1px; }

/* ========== 2026-10-18b 分类菜单第二版:行高 36px(放不下收成 32px 再滚动)/ 服务入口两列 / 面板标题整行可点 /
   面板跟随所在行 / 在售数 / 当前分类 / 键盘焦点。只作用于电脑端(≤991px 整个菜单隐藏,手机分类弹层不受影响) ========== */
:root { --header-pop-shadow: 0 10px 40px rgba(0, 0, 0, 0.12); }
html[data-theme="dark"] { --header-pop-shadow: 0 12px 40px rgba(0, 0, 0, 0.5); }
.header-v2__category-menu,
.header-v2__mega .mega-right,
.header-v2__tools-menu { box-shadow: var(--header-pop-shadow); }
html[data-theme="dark"] .header-v2__category-menu.header-v2__mega,
html[data-theme="dark"] .header-v2__mega .mega-right { border-color: var(--t-line-3); }

/* 脚本接管开关:CSS 悬停只在脚本没跑起来时生效;按钮和菜单之间 8px 空隙补一条看不见的桥,移过去不会断 */
.header-v2__category-dropdown.js-mega:hover .header-v2__category-menu:not(.show) { opacity: 0; visibility: hidden; transform: translateY(10px); }
.header-v2__mega::before { content: ""; position: absolute; left: 0; right: 0; top: -10px; height: 10px; }
.header-v2__mega.has-flyout { border-top-right-radius: 0; border-bottom-right-radius: 0; }

/* 左栏 */
.header-v2__mega .mega-left {
  width: 244px;
  max-height: var(--mega-max, calc(100vh - 150px));
  padding-bottom: 0;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: var(--t-line-3) transparent;
  scroll-padding-bottom: 84px; /* 键盘移到底部几行时,别被贴底的服务入口(约 77px)挡住 */
}
.header-v2__mega .mega-parent {
  min-height: 36px;
  padding: 0 0.7rem;
  gap: 0.6rem;
  font-size: 0.9rem;
  line-height: 1.3;
}
.header-v2__mega .mega-parent .mega-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.header-v2__mega .mega-parent:not([data-has-children]) .mega-arrow { visibility: hidden; }
.header-v2__mega .mega-arrow { flex: none; }

/* 右侧面板:位置(top)由脚本按所在行算 */
.header-v2__mega .mega-right {
  padding: 0.35rem;
  border-top-left-radius: 0;
  border-bottom-left-radius: 0;
  max-height: var(--mega-max, calc(100vh - 150px));
  overscroll-behavior: contain;
}
.header-v2__mega .mega-panel-head {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  min-height: 36px;
  padding: 0 0.7rem;
  margin-bottom: 0.25rem;
  border-bottom: 1px solid var(--t-line-2);
  font-size: 0.9rem;
  color: var(--t-text);
  text-decoration: none;
}
.header-v2__mega .mega-panel-head > i:first-child { color: var(--header-accent); }
.header-v2__mega .mega-panel-head > img { width: 20px; height: 20px; object-fit: contain; flex-shrink: 0; }
.header-v2__mega .mega-panel-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; color: var(--t-text); }
.header-v2__mega .mega-panel-all { display: inline-flex; align-items: center; gap: 2px; flex: none; margin-left: auto; font-size: 0.8rem; color: var(--t-text-3); white-space: nowrap; }
.header-v2__mega .mega-panel-head:hover .mega-panel-all { color: var(--header-accent); }
.header-v2__mega .mega-child {
  align-items: center;
  min-height: 36px;
  padding: 0.42rem 0.7rem;
  font-size: 0.9rem;
}
.header-v2__mega .mega-child .mega-cname { flex: 1; min-width: 0; }

/* 放不下时(脚本加 .is-dense)两种行都收成 32px */
.header-v2__mega.is-dense .mega-parent,
.header-v2__mega.is-dense .mega-child { min-height: 32px; padding-top: 0.3rem; padding-bottom: 0.3rem; }

/* 在售数(第一次打开菜单时懒加载;没取到就不显示) */
.header-v2__mega .mega-n { flex: none; padding-left: 0.4rem; font-size: 0.75rem; color: var(--t-text-4); font-variant-numeric: tabular-nums; white-space: nowrap; }
.header-v2__mega .mega-n:empty { display: none; }

/* 服务入口:两列小标签,左栏滚动时贴在底部 */
.header-v2__mega .mega-services {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px;
  margin-top: 6px;
  padding: 6px 0 0.35rem;
  border-top: 1px solid var(--t-line-2);
  position: sticky;
  bottom: 0;
  z-index: 1;
  background: var(--t-surface);
}
.header-v2__mega .mega-svc {
  height: 30px;
  padding: 0 0.55rem;
  border: 1px solid var(--header-border);
  border-radius: 8px;
  background: transparent;
  color: var(--t-text-2);
  font-size: 0.8rem;
}
.header-v2__mega .mega-svc span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.header-v2__mega .mega-svc i { flex: none; color: var(--t-text-3); }

/* 行状态:悬停 / 面板展开中 / 当前分类 / 无货 / 键盘焦点 */
.header-v2__mega .mega-parent:hover,
.header-v2__mega .mega-child:hover,
.header-v2__mega .mega-svc:hover { background: var(--t-surface-3); color: var(--header-accent); }
.header-v2__mega .mega-svc:hover { border-color: var(--header-border); }
.header-v2__mega .mega-svc:hover i { color: var(--header-accent); }
.header-v2__mega .mega-parent.active { background: var(--t-primary-soft); color: var(--header-accent); }
.header-v2__mega .mega-parent.active .mega-arrow { color: var(--header-accent); transform: translateX(2px); }
.header-v2__mega .mega-parent.is-current,
.header-v2__mega .mega-child.is-current { color: var(--header-accent); font-weight: 600; }
.header-v2__mega .is-empty { opacity: 0.5; }
.header-v2__mega .is-empty .mega-n { display: none; }
.header-v2__mega .mega-parent:focus-visible,
.header-v2__mega .mega-child:focus-visible,
.header-v2__mega .mega-panel-head:focus-visible,
.header-v2__mega .mega-svc:focus-visible { outline: 2px solid var(--t-primary); outline-offset: -2px; }

/* 过渡只给颜色:行高 / 内边距要立刻生效(打开时脚本马上量高度决定要不要收紧);
   打开那一刻 visibility 不过渡,键盘打开后能立刻聚焦到分类行(关闭仍照常淡出) */
.header-v2__mega .mega-parent,
.header-v2__mega .mega-child,
.header-v2__mega .mega-panel-head,
.header-v2__mega .mega-svc { transition: background-color 0.12s, color 0.12s; }
.header-v2__category-menu.header-v2__mega.show { transition: opacity 0.25s ease, transform 0.25s ease, visibility 0s; }

@media (prefers-reduced-motion: reduce) {
  .header-v2__category-menu.header-v2__mega,
  .header-v2__category-menu.header-v2__mega.show { transition: none; transform: none !important; }
  .header-v2__mega .mega-parent,
  .header-v2__mega .mega-child,
  .header-v2__mega .mega-panel-head,
  .header-v2__mega .mega-svc,
  .header-v2__mega .mega-arrow { transition: none; }
  .header-v2__mega .mega-parent.active .mega-arrow { transform: none; }
}


/* ════════ 2026-11-01 头部优化(062):去胶囊、两行压矮、卖家中心入口 ════════
   站长不要胶囊(10-29);搜索框 / 卖家按钮改 8~10px 圆角,不再悬浮上抬和发光;
   第一行约 70→62px、第二行约 52→46px(手机头部不变)。 */
.header-v2__main { padding: .55rem 0; }
.header-v2__search-form { border-radius: 10px; }
.header-v2__search-input { padding: .55rem 1rem; }
.header-v2__search-cat-btn { padding: .55rem .5rem .55rem .9rem; }
.header-v2__search-btn { border-radius: 0 10px 10px 0; padding: .55rem 1.15rem; }
.header-v2__nav-link { padding: .7rem 1rem; }
.header-v2__nav .header-v2__category-btn { padding: .5rem 1rem; }
.header-v2__category-btn:hover { transform: none; }
/* 站长:最讨厌带框的按钮 → 卖家入口和导航一样做成文字(卖家中心灰字,申请成为卖家橙字),悬停下划线 */
.header-v2__seller-btn { background: transparent; border: 0; border-bottom: 2px solid transparent; border-radius: 0; padding: .7rem 0 .7rem 1rem; font-size: .92rem; font-weight: 600; color: var(--t-warning-text) !important; }
.header-v2__seller-btn:hover { transform: none; box-shadow: none; background: transparent; border-bottom-color: var(--t-warning-text); }
.header-v2__seller-btn--center { font-weight: 500; color: var(--header-text-muted) !important; }
.header-v2__seller-btn--center:hover { color: var(--header-accent) !important; border-bottom-color: var(--header-accent); }
/* 分类菜单底部「代理 / 社媒增粉 / Stars 充值 / 全部分类」:去掉方框,和上面分类行一样是文字行 */
.header-v2__mega .mega-svc,
.header-v2__mega .mega-svc:hover { border: 0; border-radius: 6px; }
/* 四个入口换成站长给的立体图标(11-01),22px;行高保持 30px,否则矮屏会触发分类列表自动收紧 */
.header-v2__mega .mega-svc { gap: 8px; }
.header-v2__mega .mega-svc img { flex: none; width: 22px; height: 22px; object-fit: contain; }

/* 126 板块:商品分类菜单按「账号购买 / 充值与卡券」分组的小标题 */
.mega-sec { display: flex; align-items: center; gap: 6px; padding: 10px 14px 4px; font-size: 11.5px; font-weight: 600; letter-spacing: .02em; color: var(--header-muted, #94a3b8); text-transform: none; user-select: none; }
.mega-sec + .mega-parent { border-top: 0; }
.mega-sec:not(:first-child) { margin-top: 6px; border-top: 1px solid var(--header-line, rgba(148,163,184,.18)); padding-top: 10px; }
.mega-sec i { font-size: 13px; }
.header-v2__mobile-cat-sec { display: flex; align-items: center; gap: 6px; padding: 10px 14px 4px; font-size: 12px; font-weight: 600; color: var(--header-muted, #94a3b8); }
.header-v2__mobile-cat-sec:not(:first-child) { margin-top: 6px; border-top: 1px solid var(--header-line, rgba(148,163,184,.18)); padding-top: 10px; }
