.navbar {
    background-color: #0077be;
    color: white;
    padding: 15px clamp(30px, 5vw, 5%);
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 1000;
    transition: padding 0.3s ease;
}

.navbar.scrolled {
    padding: 10px 5%;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    transition: padding 0.3s ease;
}

.logo {
    display: flex;
    align-items: center;
    margin-left: 0;
}

.logo h1 {
    white-space: nowrap;
    max-width: calc(100% - 50px);
    flex-shrink: 0;
    padding-right: 10px;
}

.logo a {
    display: flex;
    align-items: center;
    text-decoration: none;
    color: inherit;
}
.logo img {
    height: 40px;
    margin-right: 10px;
}

.logo a:hover {
    opacity: 0.9;
}
.nav-links {
    display: flex;
    margin-right: 0;
}
.navbar {
    justify-content: space-between;
}

.nav-links a {
    color: white;
    text-decoration: none;
    margin-left: clamp(2vw, 20px, 40px);
    transition: all 0.3s ease;
    font-size: clamp(0.8rem, 1vw + 0.2rem, 1rem);
}

.nav-links a:hover, .dropdown:hover, .language-switcher:hover {
    text-shadow: 0 0 10px #00a8ff, 0 0 20px #0088cc;
    transform: translateY(-2px);
}

@media (max-width: 768px) {
    .language-switcher:hover,
    .language-switcher:active {
        transform: none !important;
        text-shadow: 0 0 10px #00a8ff, 0 0 20px #0088cc;
    }
}

@media (max-width: 768px) {
    .navbar {
        flex-direction: row;
        flex-wrap: nowrap;
    }
    .logo {
        flex: 1 1;
        flex-grow: 1;
        min-width: 0;
        margin: 0;
        justify-content: space-between;
        gap: 10px;
    }
    .logo h1 {
        font-size: clamp(0.8rem, 8vw, 1.4rem);
        flex-grow: 1;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        min-width: 0;
        padding-right: 0;
        margin-right: 10px;
    }
    .nav-links {
        flex-wrap: wrap;
        justify-content: center;        
        position: fixed;
        top: calc(var(--nav-height));
        left: 0;
        width: 100%;
        background-color: #005a8c;
        max-height: 0;
        overflow: hidden;
        transition: all 0.3s ease;
        padding: 0;
    }

    .nav-links.active {
        max-height: 600px;
        padding: 20px 0;
    }
    .nav-links a {
        margin: 5px 10px;
        font-size: clamp(0.9rem, 4vw, 1.1rem);
    }
}

@media (min-width: 769px) {
  .menu-toggle {
    display: none;
  }
}

/* 新增语言切换面板样式 */
.language-switcher {
  position: relative;
  cursor: pointer;
}

.language-panel {
  display: none;
  position: fixed;
  right: 0 !important;
  top: var(--nav-height) !important;
  /* 移除transform定位偏移 */
  background: linear-gradient(135deg, #005a8c 0%, #0077be 100%);
  border-radius: 8px;
  box-shadow: 0 4px 20px rgba(0,87,184,0.3);
  width: max-content;
  z-index: 1001;
  border: 1px solid rgba(255,255,255,0.15);
  overflow: hidden;
}

.language-panel a {
  display: flex;
  align-items: center;
  padding: 12px 20px;
  margin-left: 0;
  color: rgba(255,255,255,0.9);
  text-decoration: none;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  line-height: 1.5;
  font-size: 0.95em;
}

.language-panel a:hover {
  background: rgba(255,255,255,0.1);
  transform: translateX(5px);
  text-shadow: 0 2px 8px rgba(255,255,255,0.3);
}

.language-panel a .flag-icon {
  width: 20px;
  height: 15px;
  margin-right: 12px;
  border-radius: 2px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

@media (min-width: 769px) {
  .language-switcher:hover .language-panel {
    display: block;
  }
}

@media (max-width: 768px) {
  .language-panel a {   
    padding: 2px 0px;    
  }

  .language-panel.show {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    position: static;
    margin-top: 10px;
    padding: 10px;
    background: #0077be;
    border-radius: 6px;
    box-shadow: 0 2px 15px rgba(0,0,0,0.2);
}
  
  .menu-toggle {
    position: absolute;
    right: 0px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 24px;
    cursor: pointer;
    z-index: 1001;
    display: flex;
    align-items: center;
  }
  
  .logo {
    padding-right: 30px;
  }
}