/* 首屏黄金三角布局 */
:root {
  --header-height: 70px;
    --primary: #1a56a8;
  --secondary: #ff6f61;
  --accent: #fadb5f;
  --light: #f5f7fa;
  --header-height: 70px;
  --primary-dark: #2563eb;
  --accent-dark: #dc2626;
  }
header {
  background: linear-gradient(135deg,
      rgba(0, 35, 102, 0.9) 0%,
      rgba(0, 82, 155, 0.9) 100%),
    url("/img/bgphoto.webp") no-repeat center/cover;
  color: white;
  position: fixed;
  /* 新增关键样式 */
  min-height: 0;
  /* 重置最小高度 */
  display: flex;
  flex-direction: column;
  z-index: 100;
  top: 0;
  left: 0;
  width: 100%;
  height: var(--header-height);
}

/* ---------------------------------------------------- */
/* 滚动逻辑样式 (负责滚动时的显示/隐藏动画) */
/* ---------------------------------------------------- */
#mainHeader {

  /* 添加过渡，用于响应 JS 带来的 transform 和 opacity 变化 */
  transition: transform 0.2s ease-out, opacity 0.2s ease-out !important; 
}

/* 滚动隐藏的核心样式：覆盖动画的最终状态 */
#mainHeader.header-hidden {
    transform: translateY(-100%) !important;  /* 向上推出 */
    opacity: 0 !important;  /* 渐隐 */
    /* 滚动隐藏时，不再需要首屏动画 */
    animation: none !important; 
}

/* 滚动时添加阴影 (保持不变) */
.header-scrolled {
  box-shadow: 0 2px 15px rgba(0, 0, 0, 0.1);
}

body,
header {
  margin: 0;
  padding: 0;
}

/* 内容区域添加顶部内边距 */
main {
  padding-top: var(--header-height);
}

.nav-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 5%;
  /* 减少内边距 */
  background-color: white;
  ;
  width: 100%;
  box-sizing: border-box;
  /* 确保内边距不影响总宽度 */
  min-height: 70px;
}


.logo {
  display: flex;
  align-items: center;
}

.logo img {
  height: 40px;
  margin-right: 10px;
}

.badge {
  background: var(--accent);
  color: var(--primary);
  padding: 3px 8px;
  font-size: 12px;
  border-radius: 4px;
  font-weight: bold;
}

nav ul {
  color: rgba(0, 82, 155, 0.9);
  display: flex;
  list-style: none;
}

nav ul li {
  margin-left: 30px;
}

nav ul li a {
  color:  rgba(0, 82, 155, 0.9);
  background-color: white;
  text-decoration: none;
  font-weight: 500;
  transition: all 0.3s;
}

nav ul li a:hover {
  color: var(--accent);
}

.cta-button {
  background: var(--secondary);
  color: white;
  padding: 10px 25px;
  border-radius: 30px;
  font-weight: bold;
  text-decoration: none;
  box-shadow: 0 4px 15px rgba(255, 111, 97, 0.4);
  animation: pulse 2s infinite;
}

.logo-text {
  margin-left: 10px;
}

.logo-main {
  background:  rgba(0, 82, 155, 0.9);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  position: relative;
  font-size: 24px;
  font-weight: 700;
  letter-spacing: 0.5px;
}

.logo-main:before {
  content: "";
  background: radial-gradient(rgba(168, 216, 255, 0.3), transparent);
}

.logo-slogan {
  color: #666;
  font-size: 13px;
  margin-top: 3px;
  font-weight: 500;
}

/* 修改3：新增二级菜单箭头动画 */
.dropdown-arrow {
  margin-left: 5px;
  font-size: 12px;
  transition: transform 0.3s;
}

/* 修改子菜单样式 */
.has-submenu {
  position: relative;
}

.has-submenu .submenu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  background: white;
  min-width: 200px;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
  z-index: 100;
  padding: 10px 0;
}

.has-submenu.active .submenu {
  display: block;
}

/* 子菜单项样式 */
.submenu li {
  margin: 0;
  padding: 0;
}

.submenu a {
 
  display: block;
  padding: 8px 20px;
}

.submenu a:hover {
  background: #f5f5f5;
  color: var(--primary) !important;
}

/* 移动端响应式 */
@media (max-width: 768px) {
  .has-submenu .submenu {
    position: static;
    box-shadow: none;
    background: rgba(0, 0, 0, 0.1);
  }
 

  /* 隐藏桌面导航 */
  nav ul {
    display: none;
  }

  /* 显示移动菜单按钮 */
  .mobile-menu-btn {
    display: block;
    background: none;
    border: none;
    color: var(--primary);
    cursor: pointer;
    margin-left: 15px;
    padding: 2px 8px;
    /* 减少按钮内边距 */
    font-size: 1.3rem;
  }

  header {
    height: auto;
    min-height: 0;
    padding-bottom: 0;
    /* 移除底部内边距 */
  }

  .nav-container {
    height: 70px;
    padding: 10px 5%;
    /* 进一步减少内边距 */
    position: relative;
    /* 确保绝对定位的子元素参考正确 */
  }




  /* 移动菜单激活状态 */
  .mobile-nav-active nav ul {
    display: flex;
    flex-direction: column;
    position: absolute;
    left: 0;
    right: 0;
    background:var(--primary);
    z-index: 1000;
    top: 70px;
    /* 与导航栏高度一致 */
    padding: 10px;
  }


  .mobile-nav-active nav ul li a {
    display: block;
    padding: 15px 20px;
  }

  /* 子菜单在移动端的样式 */
  .mobile-nav-active .has-submenu .submenu {
    display: none;
    position: static;
    background: rgba(0, 0, 0, 0.2);
    box-shadow: none;
  }

  .mobile-nav-active .has-submenu.active .submenu {
    display: block;
  }

  .mobile-nav-active .submenu li {
    padding-left: 30px;
  }

  /* 桌面端样式 - 保持原有下拉图标 */
  @media (min-width: 768px) {}

  .has-submenu .desktop-arrow {
    display: inline-block;
    margin-left: 5px;
    font-size: 12px;
    transition: transform 0.3s;
  }

  .has-submenu:hover .desktop-arrow {
    transform: rotate(180deg);
  }


  /* 隐藏桌面端的Font Awesome图标 */
  .has-submenu .desktop-arrow {
    display: none;
  }

  /* 其他现有样式保持不变... */

  /* 修正所有服务菜单的对齐问题 */
  .mobile-nav-active nav ul li.has-submenu>span {
    display: block;
    padding: 15px 20px;
    color: white;
    cursor: pointer;
    position: relative;
  }

  .mobile-nav-active nav ul li.has-submenu>span:after {
    content: "\f078";
    font-family: "Font Awesome 5 Free";
    font-weight: 900;
    position: absolute;
    right: 20px;
    top: 15px;
    font-size: 14px;
    transition: transform 0.3s;
  }

  .mobile-nav-active nav ul li.has-submenu.active>span:after {
    transform: rotate(180deg);
  }

  /* 确保所有菜单项对齐 */
  .mobile-nav-active nav ul li {
    margin: 0;
    padding: 0;
    width: 100%;
  }

  .mobile-nav-active nav ul li a,
  .mobile-nav-active nav ul li.has-submenu>span {
    text-align: left;
    padding-left: 20px !important;
      color:  rgba(0, 82, 155, 0.9);
  background-color: white;
  }

  /* 子菜单项增加缩进 */
  .mobile-nav-active .submenu li a {
    padding-left: 40px !important;
  }
 
/* 让菜单自己可滚动 */ 
  .mobile-nav-active nav ul {
    overflow-y: auto;
    max-height: calc(100vh - 70px);
  }
}







/* 移动菜单激活时禁止页面滚动 */
.mobile-nav-active {
  overflow: hidden;
  height: 100vh;
}



/* --- Language Switcher Styles --- */
.language-switcher {
  position: relative;
  margin-left: 20px;
  /* 与导航菜单保持一些间距 */
  align-self: center;
  /* 垂直居中 */
}

.language-switcher .lang-current {
  background-color:  rgba(0, 82, 155, 0.9);
  border: 1px solid #ddd;
  border-radius: 5px;
  padding: 8px 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  font-size: 14px;
  color: white;
  /* 根据你的网站主色调调整 */
}

.language-switcher .lang-current i {
  margin-right: 8px;
}

.language-switcher .lang-dropdown {
  display: none;
  /* 默认隐藏 */
  position: absolute;
  top: 100%;
  right: 0;
  background-color: rgba(0, 35, 102, 0.5);
  border: 1px solid white;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
  list-style: none;
  padding: 5px 0;
  margin: 5px 0 0 0;
  min-width: 120px;
  z-index: 1000;
  border-radius: 5px;
}

/* 当切换器被点击时，显示下拉菜单 */
.language-switcher.active .lang-dropdown {
  display: block;
}

.language-switcher .lang-dropdown li a {
  display: block;
  padding: 10px 15px;
  color: white;
  text-decoration: none;
  font-size: 14px;
}

.language-switcher .lang-dropdown li a:hover {
  background-color: rgba(0, 35, 102);
}

/* --- Mobile Nav & Submenu Active State Styles --- */

/* 当移动端菜单激活时，将导航推入视图 */
@media (max-width: 992px) {
  body.mobile-nav-active #mainNav {
    /* 根据你的移动菜单样式调整 */
    transform: translateX(0);
  }

  /* 在移动端，将语言切换器移动到菜单内部 */
  .mobile-nav-active #mainNav {
    /* 你可能需要用 JS 把 language-switcher 移动到 #mainNav 里，
           或者为它设计一个固定在菜单里的样式。
           简单起见，这里我们只确保它在移动端可见。 */
  }

  .language-switcher {
    margin-left: auto;
    /* 将其推到右侧 */
    margin-right: 10px;
  }
}

/* 二级菜单激活状态 */
.has-submenu.active>.submenu {
  display: block;
  opacity: 1;
  visibility: visible;
}

/* 箭头旋转效果 */
.has-submenu.active>span .desktop-arrow {
  transform: rotate(180deg);
}

/* 确保 a 标签内的 logo 正常显示 */
.logo a {
  display: flex;
  align-items: center;
  text-decoration: none;
  color: inherit;
}