/* ==========================================
   Navbar - 最终纯净版（无 main 样式）
   ========================================== */

/* ===== 基础重置 ===== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body {
  background: #f5f6fa;
  min-height: 100vh;
}

/* ===== Navbar 主体 ===== */
.navbar {
  position: fixed;
  inset: 0 0 auto 0;
  height: 60px;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  z-index: 1000;
}

/* ===== Logo ===== */
.logo {
  display: flex;
  align-items: center;
  gap: 10px;
}

.logo img {
  height: 32px;
}

.logo span {
  font-weight: 600;
  color: #222;
  font-size: 16px;
}

/* ===== 菜单容器 ===== */
.menu {
  display: flex;
  gap: 24px;
  list-style: none;
}

/* ===== 菜单项 ===== */
.menu-item {
  position: relative;
  cursor: pointer;
  padding: 8px 0;
  font-size: 14px;
  color: #333;
  white-space: nowrap;
}

/* ===== 箭头 ===== */
.arrow {
  display: inline-block;
  margin-left: 4px;
  transition: transform 0.3s ease;
  font-size: 12px;
}

/* ==========================================
   桌面端（≥769px）：纯 CSS Hover
   ========================================== */
@media (min-width: 769px) {
  .menu-item:hover {
    color: #4f46e5;
  }

  .menu-item:hover > .dropdown {
    display: block !important;
  }

  .menu-item:hover > .arrow {
    transform: rotate(180deg);
  }
}

/* ==========================================
   下拉菜单（默认 = 桌面端悬浮样式）
   ========================================== */
.dropdown {
  position: absolute;
  top: 38px;
  left: 0;
  min-width: 180px;
  background: #fff;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
  border-radius: 6px;
  display: none;
  z-index: 1001;
}

.dropdown .menu-item {
  padding: 10px 16px;
  display: block;
}

.dropdown .menu-item:hover {
  background: #f5f5f5;
}

/* 三级菜单（桌面端） */
.dropdown .dropdown {
  top: 0;
  left: 100%;
}

/* ==========================================
   汉堡按钮
   ========================================== */
.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  padding: 8px;
}

.hamburger span {
  width: 22px;
  height: 2px;
  background: #333;
  border-radius: 2px;
}

/* ==========================================
   移动端（≤768px）：纯扁平结构
   ========================================== */
@media (max-width: 768px) {

  /* 显示汉堡 */
  .hamburger {
    display: flex;
  }

  /* 侧边栏 */
  .menu {
    position: fixed;
    top: 60px;
    right: 0;
    width: 260px;
    height: calc(100vh - 60px);
    background: #fff;
    flex-direction: column;
    padding: 20px;
    box-shadow: -2px 0 10px rgba(0, 0, 0, 0.1);
    transform: translateX(100%);
    transition: transform 0.3s ease;
    overflow-y: auto;
  }

  .menu.open {
    transform: translateX(0);
  }

  /* 取消悬浮属性 */
  .dropdown {
    position: static !important;
    box-shadow: none !important;
    border-radius: 0 !important;
    background: transparent !important;
    padding-left: 12px;
    display: none;
  }

  .menu-item.active > .dropdown {
    display: block;
  }

  .menu-item.active > .arrow {
    transform: rotate(180deg);
  }

  /* ==========================================
     三级菜单（无白条 + 字号还原）
     ========================================== */
  .dropdown .dropdown {
    background: #ffffff !important;
    border-left: none !important; /* ✅ 无白条 */
    margin-top: 2px !important;
    padding-left: 12px !important;
    box-shadow: none !important;
    position: static !important;
  }

  .dropdown .dropdown .menu-item {
    padding: 10px 12px !important;
    font-size: 14px !important; /* ✅ 字号还原 */
    color: #555;
  }

  .dropdown .dropdown .arrow {
    display: none !important;
  }
}
