/* 基础与全局控制 */
.main-header {
  padding-top: 6px;
  background: var(--color-bg-header, #323232);
}

.main-header .container {
  width: 100%;
}

.header-controls {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 6px;
}

.header-controls .logo {
  order: 1;
}

.header-user {
  order: 3;
  display: flex;
  gap: 10px;
  flex: 0 0 auto;
  width: auto;
  text-align: center;
}

/* 按钮通用样式 */
.btn-login,
.btn-register {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem 1.25rem;
  border-radius: 0.25rem;
  font-size: 0.875rem;
  font-weight: 700;
  text-transform: uppercase;
  color: #ffffff;
  transition: all 0.2s;
  text-decoration: none;
}

.btn-login {
  background: linear-gradient(135deg, #22a8e4 0%, #0898d6 100%);
}

.btn-register {
  background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
}

.btn-login:hover,
.btn-register:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(220, 38, 38, 0.4);
}

/* 移动端 Toggle 按钮 */
.header-controls .mobile-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 6px;
  border-radius: 9999px;
  background: transparent;
  border: none;
  cursor: pointer;
}

.header-controls .mobile-toggle span {
  width: 1.5rem;
  height: 2px;
  background-color: white;
}

.flag-icon {
  width: 20px;
  height: 13px;
  border-radius: 8px;
}

.actions-right {
  display: none;
}

/* 导航栏 Head Bot 容器 */
.head-bot {
  display: block !important;
  background: #0898d6;
  border-top: 1px solid var(--color-border, transparent);
  padding: 0.5rem 0;
}

/* 桌面端导航项样式 */
.desktop-nav-ul {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0;
  list-style: none;
  margin: 0;
  padding: 0;
  z-index: 52;
}

.desktop-nav-li {
  padding: 0 0.75rem;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.9);
  text-transform: uppercase;
  text-decoration: none;
  padding: 10px 0;
  transition: all 0.2s;
}

.nav-link.active,
.nav-link:hover {
  color: #ffffff;
  font-weight: 700;
}

.nav-logo {
  transition: all 0.3s ease;
}

.header-user-h5 {
  display: none;
}

/* JS 控制的通用状态类 */
.hidden {
  display: none !important;
}

/* 移动端抽屉 (Mobile Drawer) 样式 */
.mobile-menu-wrapper {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 100;
}

.mobile-menu-overlay {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  background-color: rgba(0, 0, 0, 0.5);
}

.mobile-menu-close {
  position: absolute;
  top: 0;
  right: 0;
  z-index: 101;
  width: 3rem;
  height: 3rem;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  background: transparent;
  border: none;
  cursor: pointer;
  transition: color 0.2s;
}

.mobile-menu-close:hover {
  color: #e5e7eb;
}

.mobile-menu-panel {
  position: absolute;
  left: 0;
  top: 0;
  height: 100%;
  width: 80%;
  max-width: 280px;
  background-color: #f5f5f5;
  overflow-y: auto;
  transition: transform 300ms cubic-bezier(0, 0, 0.2, 1);
}

.-translate-x-full {
  transform: translateX(-100%);
}

/* 移动端搜索框与导航菜单项 */
.mobile-search-box {
  padding: 0.75rem;
  margin-top: 0.75rem;
}

.mobile-search-inner {
  display: flex;
}

.mobile-search-input {
  flex: 1 1 0%;
  border: 1px solid #d1d5db;
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
  background-color: #ffffff;
  outline: none;
}

.mobile-search-btn {
  background-color: #0898d6;
  color: #ffffff;
  padding: 0.5rem 0.75rem;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.mobile-nav {
  background-color: #f5f5f5;
}

.mobile-nav-ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.mobile-nav-li {
  border-bottom: 1px solid #e5e7eb;
}

.mobile-nav-link {
  display: block;
  padding: 0.75rem 1rem;
  color: #6b7280;
  text-decoration: none;
  transition: background-color 0.2s, color 0.2s;
}

.mobile-nav-link:hover {
  color: #0898d6;
  background-color: #f3f4f6;
}

.mobile-nav-text {
  font-size: 0.875rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* 粘性定位 (Sticky Header) */
@keyframes slideIn {
  from {
    transform: translateY(-100%);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.is-sticky {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  animation: slideIn 0.5s ease-out forwards;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  background-color: rgba(0, 0, 0, 0.5);
}

.is-sticky .logo-image {
  width: 140px;
  height: 70px;
}

/* 媒体查询 responsive 适配 */
@media (min-width: 768px) {
  .actions-right {
    display: flex;
    justify-content: flex-end;
    gap: 0.25rem;
    order: 3;
    flex: 0 0 auto;
    width: auto;
  }
}

@media (max-width: 850px) {
  .main-header {
    padding-top: 0;
  }

  .header-nav {
    display: block;
  }

  .header-controls {
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    padding: 0;
  }

  .header-controls .mobile-toggle {
    display: flex;
    order: 1;
  }

  .header-controls .logo {
    order: 2;
    flex: 1;
    text-align: center;
  }

  .header-controls .logo img {
    margin: 0 auto;
    width: 140px;
    height: 70px;
  }

  .header-user {
    display: none !important;
  }

  .main-header .head-bot .nav-list {
    display: none !important;
  }

  .main-header .head-bot .header-user-h5 {
    display: flex !important;
    justify-content: center;
    align-items: center;
    gap: 10px;
  }
}