/* 导航栏样式 */
.navbar {
  background-color: var(--background-color);
  padding: 0.5rem 2rem;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  position: fixed;
  width: 100%;
  top: 0;
  z-index: 1000;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
}

.navbar-logo {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  text-decoration: none;  
  color: inherit;
  grid-column: 2;
  justify-self: center;
}

.navbar-logo img {
  height: 60px;
}

.navbar-logo span {
  font-size: 1.5rem;
  font-weight: 500;
}

/* 导航菜单 */
.navbar-menu {
  position: fixed;
  top: 0;
  right: -100%;
  width: 200px;
  height: auto;
  max-height: 300px;
  background: white;
  padding: 60px 1rem 1rem;
  margin: 1rem;
  border-radius: 12px;
  transition: right 0.3s ease;
  box-shadow: 0 4px 20px rgba(0,0,0,0.15);
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.navbar-menu.active {
  right: 0;
}

/* 导航链接样式 */
.nav-link {
  display: block;
  text-decoration: none;
  color: var(--text-color);
  font-weight: 500;
  padding: 0.7rem 1rem;
  border-radius: 6px;
  transition: all 0.3s ease;
  background: transparent;
  font-size: 0.95rem;
}

.nav-link:hover {
  background: #f8f9fa;
  color: #007bff;
  padding-left: 1.5rem;
}

.nav-link.active {
  background: #007bff;
  color: white;
}

/* 汉堡菜单按钮 */
.menu-button {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  width: 30px;
  height: 21px;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0;
  z-index: 1100;
  grid-column: 3;
}

.menu-button span {
  width: 100%;
  height: 3px;
  background: var(--text-color);
  border-radius: 3px;
  transition: all 0.3s ease;
}

.menu-button.active span:nth-child(1) {
  transform: translateY(9px) rotate(45deg);
}

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

.menu-button.active span:nth-child(3) {
  transform: translateY(-9px) rotate(-45deg);
}

/* 关闭按钮 */
.menu-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 24px;
  height: 24px;
  border: none;
  background: transparent;
  cursor: pointer;
  padding: 0;
}

.menu-close::before,
.menu-close::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 0;
  width: 100%;
  height: 2px;
  background: var(--text-color);
  transition: background 0.3s;
}

.menu-close::before {
  transform: rotate(45deg);
}

.menu-close::after {
  transform: rotate(-45deg);
}

.menu-close:hover::before,
.menu-close:hover::after {
  background: #007bff;
}

/* 遮罩层 */
.menu-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.5);
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  z-index: 999;
}

.menu-overlay.active {
  opacity: 1;
  visibility: visible;
}

/* 响应式设计 */
@media (max-width: 768px) {
  .navbar {
    padding: 0.5rem 1rem;
  }
  
  .navbar-logo {
    font-size: 1.2rem;
  }
  
  .navbar-logo img {
    height: 40px;
  }
}
