/* 响应式导航样式 - PC和移动端通用 */

/* 移动端菜单按钮 */
.mobile-menu-button {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  width: 40px;
  height: 40px;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  z-index: 9999;
  background: transparent;
  border: none;
  padding: 8px;
  /* 增加点击区域 */
  min-width: 44px;
  min-height: 44px;
}

.mobile-menu-button:hover {
  transform: scale(1.1);
}

.mobile-menu-button span {
  display: block;
  width: 25px;
  height: 3px;
  background-color: white;
  margin: 3px 0;
  border-radius: 2px;
  transition: all 0.3s ease;
  pointer-events: none; /* 防止span阻止点击 */
}

/* 移动端菜单容器 */
.mobile-menu {
  display: none;
  position: fixed;
  top: 0;
  right: -100%;
  width: 280px;
  height: 100vh;
  background: linear-gradient(180deg, rgba(71, 85, 105, 0.98) 0%, rgba(51, 65, 85, 0.98) 100%);
  backdrop-filter: blur(20px);
  box-shadow: -5px 0 30px rgba(0, 0, 0, 0.5);
  z-index: 1002;
  overflow-y: auto;
  transition: right 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.mobile-menu.active {
  right: 0;
}

/* 移动端菜单头部 */
.mobile-menu-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.mobile-menu-title {
  font-size: 20px;
  font-weight: bold;
  color: white;
  text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.3);
}

.mobile-menu-close {
  width: 35px;
  height: 35px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  transition: all 0.3s ease;
}

.mobile-menu-close:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: rotate(90deg);
}

.mobile-menu-close::before,
.mobile-menu-close::after {
  content: '';
  position: absolute;
  width: 20px;
  height: 2px;
  background: white;
  border-radius: 1px;
}

.mobile-menu-close::before {
  transform: rotate(45deg);
}

.mobile-menu-close::after {
  transform: rotate(-45deg);
}

/* 移动端菜单链接列表 */
.mobile-menu-links {
  padding: 10px 0;
}

.mobile-menu-links li {
  list-style: none;
}

.mobile-menu-links a {
  display: block;
  padding: 16px 20px;
  color: white;
  font-size: 16px;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.3s ease;
  border-left: 4px solid transparent;
}

.mobile-menu-links a:hover,
.mobile-menu-links a.active {
  background: rgba(51, 65, 85, 0.8);
  border-left-color: #10b981;
  padding-left: 24px;
  transform: translateX(4px);
}

.mobile-menu-links a:active {
  background: rgba(255, 255, 255, 0.15);
}

/* 遮罩层 */
.menu-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  background: rgba(0, 0, 0, 0.7);
  z-index: 1001;
  opacity: 0;
  transition: opacity 0.4s ease;
  pointer-events: none; /* 默认不阻挡点击 */
}

.menu-overlay.active {
  opacity: 1;
  pointer-events: auto; /* 激活时才可点击 */
}

/* 响应式断点 */
@media (max-width: 767px) {
  /* 隐藏PC端导航 */
  .desktop-menu {
    display: none !important;
  }
  
  /* 显示移动端菜单按钮和容器 */
  .mobile-menu-button {
    display: flex !important;
  }
  
  .mobile-menu {
    display: block !important;
  }
  
  .menu-overlay {
    display: block !important;
  }
}

@media (min-width: 768px) {
  /* PC端显示桌面导航 */
  .desktop-menu {
    display: flex !important;
  }
  
  /* PC端隐藏移动端元素 */
  .mobile-menu-button {
    display: none !important;
  }
  
  .mobile-menu {
    display: none !important;
  }
  
  .menu-overlay {
    display: none !important;
  }
}

/* 动画增强 */
@keyframes slideInFromRight {
  from {
    transform: translateX(100%);
  }
  to {
    transform: translateX(0);
  }
}

.mobile-menu.active {
  animation: slideInFromRight 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* 滚动条美化（仅Webkit浏览器）*/
.mobile-menu::-webkit-scrollbar {
  width: 6px;
}

.mobile-menu::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.05);
}

.mobile-menu::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.3);
  border-radius: 3px;
}

.mobile-menu::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.5);
}
