/* Top Bar Styles */
.top-bar {
  background: #fff;
  padding: 20px 0;
  width: 100%;
  position: fixed;
  top: 0;
  left: 0;
  z-index: 1001;
}

.top-bar .container {
  max-width: 90%;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.top-bar .left-content {
  display: flex;
  align-items: center;
  gap: 20px;
}

.top-bar .logo {
  flex: 0 0 auto;
}

.top-bar .logo img {
  height: 70px;
  width: auto;
}

.top-bar .company-info {
  flex: 1;
  padding-left: 10px;
}

.top-bar .company-info h1 {
  font-size: 24px;
  color: #333;
  margin: 0;
  margin-bottom: 10px;
  font-weight: normal;
  position: relative;
  padding-bottom: 10px;
}

.top-bar .company-info h1:after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 1px;
  background: #ddd;
}

.top-bar .company-info p {
  font-size: 14px;
  color: #999;
  margin: 0;
}

/* 移除原来的红线装饰 */
.top-bar .company-info p:after {
  display: none;
}

.top-bar .contact-info {
  display: flex;
  align-items: center;
  background: #595959;
  padding: 8px 15px;
  border-radius: 30px;
  gap: 5px;
}

.top-bar .contact-info .phone-icon {
  color: #fff;
  font-size: 20px;
}

.top-bar .contact-info .phone-numbers {
  display: flex;
  flex-direction: column;
  color: #fff;
  font-size: 16px;
  line-height: 1.4;
}

.top-bar .contact-info .phone-numbers span:first-child {
  border-bottom: 1px solid rgba(255, 255, 255, 0.3);
  padding-bottom: 2px;
  margin-bottom: 2px;
}

/* 导航栏样式 */
.header {
  width: 100%;
  background: transparent;
  z-index: 1000;
  position: fixed;
  top: 120px;
  left: 0;
  transition: all 0.3s ease;
  padding: 15px 0;
}

/* .header:hover, */
.header.scrolled {
  background: rgba(255, 255, 255, 0.95);
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

/* 为了防止内容被fixed定位的元素遮挡，添加一个占位空间 */
body {
  /* padding-top: 155px; */
  /* 调整padding-top值以适应新的top-bar + header高度 */
  /* top-bar高度 + header高度 */
}

/* 导航容器 */
.header .container {
  max-width: 90%;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 15px;
}

/* Logo样式 */
.logo {
  display: flex;
  align-items: center;
  padding: 0 20px;
}

.logo img {
  height: 50px;
  display: block;
}

/* 导航菜单 */
.nav {
  display: flex;
  justify-content: flex-end;
}

.nav ul {
  display: flex;
  list-style: none;
  margin: 0;
  padding: 0;
  gap: 5px;
}

.nav li {
  display: flex;
  padding: 0 25px;
}

.nav a {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 60px;
  color: #fff;
  text-decoration: none;
  font-size: 20px;
  font-weight: 500;
  transition: all 0.3s ease;
  border-radius: 2px;
  position: relative;
  padding: 0 25px;
}

.nav a::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  width: 0;
  height: 2px;
  background: #fff;
  transition: all 0.3s ease;
  transform: translateX(-50%);
}

.nav a:hover::after {
  width: 100%;
}

.header.scrolled .nav a::after {
  background: #333;
}

.header.scrolled .logo img {
  filter: grayscale(100%) brightness(0);
}

.header.scrolled .nav a:hover::after {
  width: 100%;
}

.nav li.active a::after {
  width: 100%;
}

.header.scrolled .nav li.active a::after {
  width: 100%;
  background: #333;
}

.header.scrolled .nav a {
  color: #333;
}

/* .header:hover .nav a,
.header.scrolled .nav a {
  color: #333;
} */

.nav a:hover {
  /* background: #fe0000; */
  /* border-bottom: 2px solid #fff; */
}

.nav li.active {
  /* background: #fe0000; */
  border: 2px solid #fff;
  color: #fff !important;
}

.header.scrolled .nav a:hover {
  /* border-bottom: 2px solid #333; */
}

/* .header:hover .nav a, */
.header.scrolled .nav li.active {
  /* background: #fe0000; */
  border: 2px solid #333;
  color: #333 !important;
}

.nav a.contact-btn {
  border: 1px solid rgba(255, 255, 255, 0.8);
  margin-left: 15px;
}

.header:hover .nav a.contact-btn,
.header.scrolled .nav a.contact-btn {
  border-color: #333;
}

.nav .active a::after {
  display: none;
}

.nav a.contact-btn:hover {
  border-color: #fe0000;
  background: #fe0000;
}

/* 默认隐藏菜单按钮 */
.menu-toggle {
  display: none;
}

/* 移动端菜单按钮 */
.menu-toggle {
  display: none;
  width: 30px;
  height: 24px;
  position: relative;
  cursor: pointer;
  margin-right: 20px;
}

.menu-toggle span {
  display: block;
  width: 100%;
  height: 2px;
  background: #000;
  position: absolute;
  transition: all 0.3s;
}

.menu-toggle span:nth-child(1) {
  top: 0;
}

.menu-toggle span:nth-child(2) {
  top: 50%;
  transform: translateY(-50%);
}

.menu-toggle span:nth-child(3) {
  bottom: 0;
}

/* 移动端适配 */
@media (max-width: 768px) {
  .top-bar {
    padding: 10px 15px;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background: #fff;
    z-index: 1001;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
  }

  .top-bar .container {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    max-width: 100%;
    padding: 0;
    position: relative;
  }

  .top-bar .left-content {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 10px;
    margin-right: 40px; /* 为菜单按钮留出空间 */
  }

  .top-bar .logo {
    padding: 0;
  }

  .top-bar .logo img {
    height: 35px;
    width: auto;
  }

  .top-bar .company-info {
    flex: 1;
  }

  .top-bar .company-info h1 {
    font-size: 14px;
    margin: 0;
    padding: 0;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .top-bar .company-info p {
    font-size: 10px;
    margin: 2px 0 0;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .top-bar .contact-info {
    display: none;
  }

  /* 移动端菜单按钮样式 */
  .menu-toggle {
    display: flex !important; /* 强制显示 */
    flex-direction: column;
    justify-content: space-between;
    width: 25px;
    height: 20px;
    padding: 0;
    margin: 0;
    background: none;
    border: none;
    cursor: pointer;
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    z-index: 1002;
  }

  .menu-toggle span {
    display: block;
    width: 100%;
    height: 2px;
    background: #333;
    transition: all 0.3s ease;
  }

  .menu-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
  }

  .menu-toggle.active span:nth-child(2) {
    opacity: 0;
  }

  .menu-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
  }

  /* 隐藏原来的header */
  .header {
    display: none;
  }

  /* 导航菜单样式 */
  .nav {
    position: fixed;
    top: 55px;
    left: 0;
    width: 100%;
    height: calc(100vh - 55px);
    background: rgba(0, 0, 0, 0.95);
    display: none;
    padding: 20px 0;
    overflow-y: auto;
  }

  .nav.active {
    display: block;
  }

  .nav ul {
    flex-direction: column;
    padding: 0;
    margin: 0;
  }

  .nav li {
    padding: 0;
    margin: 0;
    border: none !important;
  }

  .nav a {
    display: block;
    padding: 12px 20px;
    color: #fff !important;
    font-size: 16px;
    text-align: left;
    border-bottom: 1px solid rgba(255,255,255,0.1);
  }

  .nav a:hover,
  .nav li.active a {
    background: rgba(255,255,255,0.1);
  }
}

@media (max-width: 480px) {
  .top-bar {
    padding: 8px 10px;
  }

  .top-bar .logo img {
    height: 30px;
  }

  .top-bar .company-info h1 {
    font-size: 12px;
  }

  .top-bar .company-info p {
    font-size: 9px;
  }

  .menu-toggle {
    width: 22px;
    height: 18px;
  }
}

/* 移动端导航样式 */
.mobile-nav {
    display: none;
    position: fixed;
    top: 55px;
    left: 0;
    width: 100%;
    height: calc(100vh - 55px);
    background: rgba(0, 0, 0, 0.95);
    z-index: 1000;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.mobile-nav.active {
    display: block;
}

.mobile-nav-container {
    padding: 20px 0;
}

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

.mobile-nav li {
    margin: 0;
    padding: 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.mobile-nav li:last-child {
    border-bottom: none;
}

.mobile-nav a {
    display: block;
    padding: 15px 20px;
    color: #fff;
    font-size: 16px;
    text-decoration: none;
    transition: all 0.3s ease;
}

.mobile-nav li.active a,
.mobile-nav a:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* 菜单打开时禁止body滚动 */
body.menu-open {
    overflow: hidden;
}

@media (max-width: 768px) {
    .top-bar {
        padding: 10px 15px;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        background: #fff;
        z-index: 1001;
        box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    }

    .top-bar .container {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        gap: 10px;
        max-width: 100%;
        padding: 0;
        position: relative;
    }

    .top-bar .left-content {
        flex: 1;
        display: flex;
        align-items: center;
        gap: 10px;
        margin-right: 40px;
    }

    .top-bar .logo {
        padding: 0;
    }

    .top-bar .logo img {
        height: 35px;
        width: auto;
    }

    .top-bar .company-info {
        flex: 1;
    }

    .top-bar .company-info h1 {
        font-size: 14px;
        margin: 0;
        padding: 0;
        line-height: 1.2;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .top-bar .company-info p {
        font-size: 10px;
        margin: 2px 0 0;
        line-height: 1.2;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .top-bar .contact-info {
        display: none;
    }

    .menu-toggle {
        display: flex !important;
        flex-direction: column;
        justify-content: space-between;
        width: 25px;
        height: 20px;
        padding: 0;
        margin: 0;
        background: none;
        border: none;
        cursor: pointer;
        position: absolute;
        right: 0;
        top: 50%;
        transform: translateY(-50%);
        z-index: 1002;
    }

    .menu-toggle span {
        display: block;
        width: 100%;
        height: 2px;
        background: #333;
        transition: all 0.3s ease;
  }

  .menu-toggle.active span:nth-child(1) {
        transform: rotate(45deg) translate(5px, 5px);
  }

  .menu-toggle.active span:nth-child(2) {
    opacity: 0;
  }

  .menu-toggle.active span:nth-child(3) {
        transform: rotate(-45deg) translate(5px, -5px);
    }

    /* 隐藏PC端导航 */
    .header {
        display: none;
    }
}

@media (max-width: 480px) {
    .top-bar {
        padding: 8px 10px;
    }

    .top-bar .logo img {
        height: 30px;
    }

    .top-bar .company-info h1 {
        font-size: 12px;
    }

    .top-bar .company-info p {
        font-size: 9px;
    }

    .menu-toggle {
        width: 22px;
        height: 18px;
    }

    .mobile-nav a {
        padding: 12px 15px;
        font-size: 14px;
  }
}