/* ===== 全局导航栏样式 ===== */
:root {
  --primary-color: #9b59b6;
  --primary-hover: #8e44ad;
  --text-color: #2c3e50;
  --text-light: #7f8c8d;
  --bg-color: #ffffff;
  --border-color: #e0e0e0;
  --shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
  --transition: all 0.3s ease;
  --dropdown-bg: #f8f9fa;
  --border-radius: 6px;
}

/* 基础导航栏样式 */
.navbar {
  background-color: var(--bg-color);
  box-shadow: var(--shadow);
  position: sticky;
  top: 0;
  z-index: 1000;
  padding: 0.8rem 0;
  transition: var(--transition);
}

.navbar.scrolled {
  padding: 0.5rem 0;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* 限制container的flex布局只应用于导航栏 */
.navbar .container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* 品牌标识 */
.navbar-brand {
  display: flex;
  align-items: center;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary-color);
  text-decoration: none;
  transition: var(--transition);
}

.navbar-brand:hover {
  color: var(--primary-hover);
  transform: translateY(-1px);
}

/* 主导航菜单 */
.navbar-menu {
  display: flex;
  list-style: none;
  margin: 0;
  padding: 0;
  align-items: center;
}

.navbar-menu > li {
  position: relative;
  margin: 0 0.5rem;
}

.navbar-menu a {
  color: var(--text-color);
  text-decoration: none;
  font-weight: 500;
  padding: 0.5rem 1rem;
  border-radius: 4px;
  transition: var(--transition);
  display: flex;
  align-items: center;
}

.navbar-menu > li > a:hover,
.navbar-menu > li > a.active {
  color: var(--primary-color);
  background-color: var(--dropdown-bg);
  border-radius: var(--border-radius);
}

/* 下拉菜单父级激活状态 */
.dropdown.active > a {
  color: var(--primary-color) !important;
  background-color: var(--dropdown-bg) !important;
  border-radius: var(--border-radius) !important;
}

/* 下拉菜单 */
.dropdown {
  position: relative;
}

.dropdown-menu {
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 220px;
  padding: 0.5rem 0;
  margin-top: 0.2rem; /* 减少间隙从0.5rem到0.2rem，让用户更容易移动到二级菜单 */
  background: var(--bg-color);
  border-radius: 8px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: all 0.3s ease;
  z-index: 1001;
  max-height: 0;
  overflow: hidden;
  pointer-events: none;
}

/* 为dropdown添加不可见的桥接区域，防止鼠标移动时意外触发mouseleave */
.dropdown::before {
  content: '';
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  height: 0.2rem;
  background: transparent;
  z-index: 1000;
}

.dropdown:hover .dropdown-menu,
.dropdown-menu:hover,
.dropdown.active .dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  max-height: 500px;
  pointer-events: auto;
}

/* 确保悬停在整个dropdown区域都能触发下拉菜单 */
.dropdown:hover > .dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  max-height: 500px;
  pointer-events: auto;
}

/* 下拉箭头图标样式已移除 */

.dropdown-menu li {
  margin: 0;
}

.dropdown-menu a {
  padding: 0.6rem 1.5rem;
  color: var(--text-color);
  display: flex;
  align-items: center;
  transition: var(--transition);
  white-space: nowrap;
}

.dropdown-menu a:hover,
.dropdown-menu a.active {
  background-color: var(--dropdown-bg);
  color: var(--primary-color);
  padding-left: 1.8rem;
  border-left: 3px solid var(--primary-color);
}

.dropdown-menu a:hover i,
.dropdown-menu a.active i {
  color: var(--primary-color);
}

.dropdown-menu i {
  margin-right: 8px;
  width: 20px;
  text-align: center;
}

/* 移动端菜单按钮 */
.menu-toggle {
  display: none;
  flex-direction: column;
  justify-content: space-between;
  width: 30px;
  height: 24px;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0;
  z-index: 1002;
}

.menu-toggle span {
  display: block;
  width: 100%;
  height: 3px;
  background-color: var(--text-color);
  border-radius: 2px;
  transition: var(--transition);
}

/* 页脚样式 */
.footer {
  background-color: #2c3e50;
  color: #fff;
  padding: 60px 0 20px;
  font-size: 14px;
}

.footer-content {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  margin-bottom: 30px;
}

.footer-logo h2 {
  font-size: 24px;
  margin-bottom: 10px;
  color: #fff;
}

.footer-logo p {
  color: #bdc3c7;
  max-width: 300px;
  line-height: 1.6;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 40px;
}

.footer-section {
  min-width: 180px;
}

.footer-section h3 {
  color: #fff;
  font-size: 18px;
  margin-bottom: 20px;
  position: relative;
  padding-bottom: 10px;
}

.footer-section h3::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: 0;
  width: 40px;
  height: 2px;
  background-color: #3498db;
}

.footer-section ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.footer-section ul li {
  margin-bottom: 12px;
}

.footer-section ul li a {
  color: #bdc3c7;
  text-decoration: none;
  transition: color 0.3s ease;
  display: block;
}

.footer-section ul li a:hover {
  color: #3498db;
}

.footer-section i {
  margin-right: 8px;
  width: 20px;
  text-align: center;
}

.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: 20px;
  text-align: center;
  color: #bdc3c7;
  font-size: 13px;
}

/* 响应式设计 */
@media (max-width: 992px) {
  .menu-toggle {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    width: 30px;
    height: 24px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 1002;
  }
  
  .menu-toggle span {
    display: block;
    width: 100%;
    height: 3px;
    background-color: var(--text-color);
    border-radius: 2px;
    transition: all 0.3s ease;
  }

  .navbar-menu {
    position: fixed;
    top: 0;
    right: -300px;
    width: 280px;
    height: 100vh;
    background: var(--bg-color);
    flex-direction: column;
    padding: 80px 20px 30px;
    box-shadow: -5px 0 15px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease-in-out;
    z-index: 1001;
    overflow-y: auto;
  }

  .navbar-menu.active {
    right: 0;
    transform: translateX(0);
  }

  .navbar-menu > li {
    width: 100%;
    margin: 0.5rem 0;
  }
  
  .dropdown > a {
    display: flex;
    justify-content: space-between;
    align-items: center;
  }
  
  .dropdown-menu {
    position: static;
    opacity: 1;
    visibility: visible;
    transform: none;
    box-shadow: none;
    padding: 0;
    margin: 0.5rem 0 0 1.5rem;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease, padding 0.3s ease;
    background-color: rgba(0, 0, 0, 0.03);
    border-radius: 4px;
  }

  .dropdown.active .dropdown-menu {
    max-height: 500px;
    padding: 0.5rem 0;
  }
  
  .dropdown-menu a {
    padding: 0.5rem 1.5rem;
    font-size: 0.95em;
  }
  
  .dropdown-menu a:hover {
    padding-left: 1.8rem;
    background-color: rgba(0, 0, 0, 0.05);
  }
  
  /* dropdown-icon样式已移除 */
}

/* 活动状态指示器 */
.dropdown-toggle::after {
  content: '\f107';
  font-family: 'Font Awesome 5 Free';
  font-weight: 900;
  margin-left: 5px;
  display: inline-block;
  transition: transform 0.3s ease;
}

.dropdown:hover .dropdown-toggle::after {
  transform: rotate(180deg);
}

/* 移动端菜单激活状态 */
.menu-toggle.active span:nth-child(1) {
  transform: translateY(10px) rotate(45deg);
}

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

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

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

.overlay.active {
  display: block;
  opacity: 1;
}
