/* ==========================================================================
   HBDTECH IoT  华必达物联 — 全站统一样式规范：顶部导航栏 (Navbar)
   确保首页 (/) 与所有子页面 (tools/faq/downloads/contact) 的
   宽度、高度、字号、字位、Logo 尺寸及右上角按钮排版 100% 像素级一致。
   ========================================================================== */

:root {
  --nav-brand-blue: #0284c7;
  --nav-brand-hover: #0369a1;
  --nav-btn-orange: #ea580c;
  --nav-btn-orange-hover: #c2410c;
  --nav-text-dark: #334155;
  --nav-border: #cbd5e1;
}

/* 1. 顶栏容器 */
.top-header {
  background: rgba(255, 255, 255, 0.98);
  border-bottom: 1px solid #e2e8f0;
  box-shadow: 0 2px 10px rgba(15, 23, 42, 0.05);
  position: sticky;
  top: 0;
  z-index: 1000;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.top-header .container,
.top-header.container {
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 20px;
  box-sizing: border-box;
  width: 100%;
}

.header-inner {
  height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  box-sizing: border-box;
}

/* 2. Logo 统一规范 */
.logo-box {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  height: 42px;
  padding: 0;
  margin: 0;
  background: transparent;
  flex-shrink: 0;
  transition: transform 0.2s ease;
}

.logo-box:hover {
  transform: translateY(-1px);
}

.logo-img {
  height: 38px;
  width: auto;
  display: block;
  object-fit: contain;
}

/* 3. 导航菜单链接 */
.nav-menu {
  display: flex;
  align-items: center;
  list-style: none;
  margin: 0;
  padding: 0;
  gap: 26px;
}

.nav-menu a {
  color: var(--nav-text-dark);
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.3px;
  transition: color 0.2s ease;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  height: 68px;
  line-height: 68px;
  position: relative;
  box-sizing: border-box;
}

.nav-menu a:hover,
.nav-menu a.active {
  color: var(--nav-brand-blue);
}

.nav-menu a.active::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--nav-brand-blue);
  border-radius: 3px 3px 0 0;
}

/* 4. 右侧操作区：登录、免费注册、语言切换 */
.header-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

/* 登录按钮 */
.btn-nav-login {
  height: 36px;
  padding: 0 16px;
  border: 1px solid var(--nav-border);
  border-radius: 6px;
  background: #ffffff;
  color: var(--nav-text-dark);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
  box-sizing: border-box;
  transition: all 0.2s ease;
}

.btn-nav-login:hover {
  border-color: var(--nav-brand-blue);
  color: var(--nav-brand-blue);
  background: #f0f7ff;
}

/* 免费注册按钮 (主操作 CTA 统一橙色) */
.btn-nav-reg {
  height: 36px;
  padding: 0 18px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: var(--nav-btn-orange);
  color: #ffffff;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  letter-spacing: 0.3px;
  white-space: nowrap;
  box-sizing: border-box;
  box-shadow: 0 1px 2px rgba(234, 88, 12, 0.25);
  transition: all 0.2s ease;
}

.btn-nav-reg:hover {
  background: var(--nav-btn-orange-hover);
  box-shadow: 0 3px 8px rgba(234, 88, 12, 0.35);
  transform: translateY(-1px);
}

/* 5. 原生 7 国语言下拉菜单组件 */
.lang-dropdown-wrap {
  position: relative;
  display: inline-block;
  visibility: visible !important;
}

.lang-dropdown-btn {
  height: 36px;
  padding: 0 12px;
  border-radius: 6px;
  border: 1px solid var(--nav-border);
  background: #ffffff;
  color: var(--nav-text-dark);
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  box-sizing: border-box;
  white-space: nowrap;
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
  visibility: visible !important;
  opacity: 1 !important;
}

.lang-dropdown-btn:hover,
.lang-dropdown-wrap.open .lang-dropdown-btn {
  border-color: var(--nav-brand-blue);
  color: var(--nav-brand-blue);
  background: #f0f7ff;
}

.lang-dropdown-btn .lang-icon {
  font-size: 14px;
  line-height: 1;
  display: inline-block;
}

.lang-dropdown-btn .lang-cur-text {
  font-size: 13px;
  font-weight: 600;
  min-width: 18px;
  text-align: center;
}

.lang-dropdown-btn svg.chevron {
  width: 12px;
  height: 12px;
  stroke: currentColor;
  transition: transform 0.2s ease;
}

.lang-dropdown-wrap.open .lang-dropdown-btn svg.chevron {
  transform: rotate(180deg);
}

.lang-dropdown-menu {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 176px;
  background: #ffffff;
  border: 1px solid var(--nav-border);
  border-radius: 8px;
  box-shadow: 0 10px 25px rgba(15, 23, 42, 0.12);
  padding: 6px 0;
  z-index: 1000;
}

.lang-dropdown-wrap.open .lang-dropdown-menu {
  display: block;
}

.lang-dropdown-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 8px 14px;
  font-size: 13px;
  color: var(--nav-text-dark);
  background: transparent;
  border: none;
  cursor: pointer;
  text-align: left;
  box-sizing: border-box;
  transition: background 0.15s, color 0.15s;
}

.lang-dropdown-item:hover {
  background: #f0f7ff;
  color: var(--nav-brand-blue);
}

.lang-dropdown-item.active {
  color: var(--nav-brand-blue);
  font-weight: 600;
  background: #f8fafc;
}

.lang-item-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.lang-item-flag {
  font-size: 15px;
  line-height: 1;
}

.lang-item-code {
  font-size: 11px;
  color: #64748b;
  text-transform: uppercase;
  font-weight: 600;
}

.lang-item-check {
  color: var(--nav-brand-blue);
  font-weight: 700;
  margin-left: 6px;
}

/* 6. 移动端汉堡按钮与抽屉菜单 */
.mobile-menu-btn {
  display: none;
  width: 36px;
  height: 36px;
  padding: 0;
  align-items: center;
  justify-content: center;
  background: #ffffff;
  border: 1px solid var(--nav-border);
  border-radius: 6px;
  color: var(--nav-text-dark);
  cursor: pointer;
  box-sizing: border-box;
  transition: all 0.2s ease;
}

.mobile-menu-btn:hover {
  border-color: var(--nav-brand-blue);
  color: var(--nav-brand-blue);
  background: #f0f7ff;
}

.mobile-drawer {
  display: none;
  background: #ffffff;
  border-top: 1px solid #e2e8f0;
  box-shadow: 0 12px 24px rgba(15, 23, 42, 0.08);
  padding: 12px 20px 20px;
}

.mobile-drawer.open {
  display: block;
}

.mobile-nav-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.mobile-nav-list a {
  display: block;
  padding: 10px 14px;
  color: var(--nav-text-dark);
  text-decoration: none;
  font-size: 15px;
  font-weight: 600;
  border-radius: 6px;
  transition: all 0.2s ease;
}

.mobile-nav-list a:hover {
  background: #f0f7ff;
  color: var(--nav-brand-blue);
}

/* 7. 响应式断点 */
@media (max-width: 960px) {
  .nav-menu {
    display: none !important;
  }
  .mobile-menu-btn {
    display: inline-flex !important;
  }
  .btn-nav-login,
  .btn-nav-reg {
    display: none !important;
  }
}
