/* ===== Shared Header ===== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(230, 236, 245, 0.8);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 70px;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

/* Logo */
.header-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: #1f2833;
  flex-shrink: 0;
}

.header-logo img {
  height: 40px;
  width: auto;
}

.header-logo-icon {
  width: 40px;
  height: 40px;
}

.header-logo-text {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.header-logo-name {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: 1px;
}

.header-logo-sub {
  font-size: 10px;
  letter-spacing: 3px;
  color: #999;
  text-transform: uppercase;
}

/* Navigation */
.header-nav {
  flex: 1;
  display: flex;
  justify-content: center;
}

.header-nav-list {
  display: flex;
  gap: 6px;
  list-style: none;
  padding: 0;
  margin: 0;
}

.header-nav-list li {
  position: relative;
}

.header-nav-list a {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 8px 18px;
  font-size: 16px;
  font-weight: 500;
  color: #354355;
  text-decoration: none;
  transition: color 0.2s;
  white-space: nowrap;
}

.header-nav-list a:hover,
.header-nav-list a.is-active,
.header-nav-list li.has-active-dropdown > a {
  color: var(--primary, #004EF6);
}

.header-nav-list a.is-active,
.header-nav-list li.has-active-dropdown > a {
  font-weight: 700;
}

/* Dropdown arrow icon */
.nav-arrow {
  width: 12px;
  height: 12px;
  transition: transform 0.2s;
}

.header-nav-list li:hover .nav-arrow {
  transform: rotate(180deg);
}

/* Dropdown menus */
.header-dropdown {
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  min-width: 180px;
  background: #fff;
  border: 1px solid #e6ecf5;
  border-radius: 8px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.08);
  padding: 8px 0;
  opacity: 0;
  visibility: hidden;
  transition:
    opacity 0.2s,
    visibility 0.2s,
    transform 0.2s;
  transform: translateX(-50%) translateY(8px);
  z-index: 100;
}

.header-nav-list li:hover .header-dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

.header-dropdown a {
  display: block;
  padding: 10px 20px;
  font-size: 14px;
  font-weight: 400;
  color: #555;
}

.header-dropdown a:hover {
  background: #f4f7ff;
  color: var(--primary, #004EF6);
}

.header-dropdown a.is-active {
  background: #eef3ff;
  color: var(--primary, #004EF6);
  font-weight: 700;
}

/* Contact / Hotline */
.header-contact {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.header-contact-icon {
  width: 36px;
  height: 36px;
  color: var(--primary, #004EF6);
}

.header-contact-info {
  display: flex;
  flex-direction: column;
  line-height: 1.3;
}

.header-contact-label {
  font-size: 12px;
  color: #999;
}

.header-contact-phone {
  font-size: 18px;
  font-weight: 800;
  color: #1f2833;
  letter-spacing: 0.5px;
}

/* Mobile toggle */
.header-nav-toggle {
  display: none;
  background: #fff;
  border: 1px solid #e6ecf5;
  padding: 8px 14px;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  font-size: 14px;
}

/* ===== 平板端 ≤1024px ===== */
@media (max-width: 1024px) {
  .header-inner {
    padding: 0 16px;
  }

  .header-nav-list {
    gap: 2px;
  }

  .header-nav-list a {
    padding: 8px 12px;
    font-size: 14px;
  }

  .header-contact-phone {
    font-size: 16px;
  }
}

/* Shared header should not be affected by page-level universal resets */
.site-header .header-inner {
  margin: 0 auto;
  padding: 0 24px;
}

.site-header .header-nav-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.site-header .header-nav-list a {
  padding: 8px 18px;
  text-decoration: none;
}

.site-header .header-dropdown a {
  padding: 10px 20px;
}

.site-header .header-nav-toggle {
  padding: 8px 14px;
}

@media (max-width: 1024px) {
  .site-header .header-inner {
    padding: 0 16px;
  }

  .site-header .header-nav-list a {
    padding: 8px 12px;
  }
}

@media (max-width: 768px) {
  .site-header .header-inner {
    padding: 0 16px;
  }

  .site-header .header-nav-list {
    padding: 8px 12px;
  }

  .site-header .header-nav-list a {
    padding: 10px 16px;
  }

  .site-header .header-dropdown a {
    padding: 8px 16px 8px 28px;
  }

  .site-header .header-nav-toggle {
    padding: 8px 14px;
  }
}

@media (max-width: 480px) {
  .site-header .header-inner {
    padding: 0 12px;
  }

  .site-header .header-nav-list a {
    padding: 12px 16px;
  }

  .site-header .header-nav-toggle {
    padding: 6px 10px;
  }
}

/* ===== 平板竖屏 ≤768px ===== */
@media (max-width: 768px) {
  .header-inner {
    height: 60px;
    padding: 0 16px;
  }

  .header-nav {
    position: relative;
    justify-content: flex-end;
  }

  .header-nav-toggle {
    display: inline-flex;
  }

  .header-nav-list {
    position: absolute;
    top: 52px;
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid #e6ecf5;
    border-radius: 0 0 12px 12px;
    padding: 8px 12px;
    display: none;
    flex-direction: column;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.1);
    z-index: 999;
  }

  .header-nav-list.is-open {
    display: flex;
  }

  .header-nav-list li {
    position: static;
  }

  .header-nav-list a {
    padding: 10px 16px;
    font-size: 16px;
  }

  .header-dropdown {
    position: static !important;
    transform: none !important;
    box-shadow: none !important;
    border: none !important;
    padding: 4px 0 !important;
    margin: 4px 0 0 0 !important;
    display: none;
    overflow: hidden;
    background: #f5f7fa;
    border-radius: 8px;
    min-width: auto !important;
    opacity: 1 !important;
    visibility: visible !important;
  }

  .header-dropdown a {
    padding: 8px 16px 8px 28px;
    font-size: 14px;
    color: #666;
  }

  .header-dropdown a:hover {
    color: var(--primary, #004EF6);
    background: #eef2ff;
  }

  .header-dropdown a.is-active {
    background: #e9efff;
    color: var(--primary, #004EF6);
  }

  /* 只用 display 控制显隐，覆盖所有桌面端 hover 行为 */
  .header-nav-list li:hover > .header-dropdown {
    display: none !important;
    opacity: 1 !important;
    visibility: visible !important;
    transform: none !important;
  }

  .header-nav-list li.is-dropdown-open > .header-dropdown,
  .header-nav-list li.is-dropdown-open:hover > .header-dropdown {
    display: block !important;
  }

  .header-nav-list li.is-dropdown-open > a .nav-arrow {
    transform: rotate(180deg);
  }

  .header-contact {
    display: none;
  }

  .header-logo img {
    height: 34px;
  }
}

/* ===== 手机端 ≤480px ===== */
@media (max-width: 480px) {
  .header-inner {
    height: 54px;
    padding: 0 12px;
  }

  .header-logo img {
    height: 30px;
  }

  .header-nav-toggle {
    padding: 6px 10px;
    font-size: 13px;
  }

  .header-nav-list {
    top: 48px;
  }

  .header-nav-list a {
    padding: 12px 16px;
    font-size: 14px;
    border-bottom: 1px solid #f0f0f0;
  }

  .header-nav-list li:last-child a {
    border-bottom: none;
  }
}
