/* ════════════════════════════════════════════════════════
   Subai 全站统一导航样式 — DO NOT EDIT per-page
   铁律: 所有页面引用此文件，禁止页面内重复定义 nav CSS
   依赖: :root 变量 (--bg, --card, --text, --dim, --border, --purple)
   ════════════════════════════════════════════════════════ */

/* ── 顶部导航容器 ── */
nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  padding: 0 32px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(8,8,15,.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border, rgba(255,255,255,.06));
  height: 60px;
}

/* ── Logo 容器 ── */
nav .nav-brand {
  display: flex;
  align-items: center;
  gap: 0;
  height: 100%;
}

nav .logo {
  font-size: 22px;
  font-weight: 800;
  background: linear-gradient(135deg, #7c5cfc, #a78bfa);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: 1px;
  text-decoration: none;
}

nav .back-home {
  display: none;
  font-size: 12px;
  color: var(--dim);
  text-decoration: none;
  margin-left: 12px;
}

/* ── 链接容器 ── */
nav .links {
  display: flex;
  gap: 4px;
  align-items: center;
  height: 100%;
}

/* ── 普通链接 ── */
nav .links > a,
nav .links .nav-item > span {
  color: var(--dim, #86868b);
  text-decoration: none;
  font-size: 13px;
  transition: .2s;
  padding: 8px 12px;
  border-radius: 8px;
  white-space: nowrap;
  height: 100%;
  display: flex;
  align-items: center;
}

nav .links > a:hover,
nav .links .nav-item:hover > span {
  color: var(--text, #1d1d1f);
  background: rgba(255,255,255,.04);
}

/* ── 登录按钮 ── */
nav .links .btn-nav {
  padding: 6px 16px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--purple, #7c5cfc), #8b5cf6);
  color: #fff !important;
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
}

nav .links .btn-nav:hover {
  opacity: .9;
  background: linear-gradient(135deg, var(--purple, #7c5cfc), #8b5cf6);
}

/* ── 下拉菜单容器 ── */
.nav-item {
  position: relative;
  height: 100%;
  display: flex;
  align-items: center;
}

.nav-item > span {
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
}

.nav-item > span::after {
  content: '▾';
  font-size: 10px;
  margin-left: 2px;
}

/* ── 下拉面板 ── */
.nav-dropdown {
  display: none;
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  background: var(--card, #fff);
  border: 1px solid var(--border, rgba(0,0,0,.06));
  border-radius: 12px;
  padding: 8px;
  min-width: 180px;
  box-shadow: 0 12px 40px rgba(0,0,0,.5);
  z-index: 200;
}

.nav-item:hover .nav-dropdown {
  display: block;
}

.nav-dropdown a {
  display: block;
  padding: 8px 14px !important;
  border-radius: 8px;
  font-size: 13px !important;
  color: var(--text, #1d1d1f) !important;
  margin: 2px 0;
}

.nav-dropdown a:hover {
  background: rgba(124,92,252,.1) !important;
  color: var(--text, #1d1d1f) !important;
}

.nav-dropdown .drop-more {
  margin-top: 6px;
  padding-top: 10px !important;
  border-top: 1px solid var(--border, rgba(0,0,0,.08));
  color: var(--purple, #7c5cfc) !important;
  font-weight: 600;
  text-align: center;
}

/* ── 汉堡菜单按钮 ── */
.hamburger {
  display: none;
  background: none;
  border: none;
  color: var(--text, #1d1d1f);
  font-size: 24px;
  cursor: pointer;
  padding: 8px;
}

/* ── 移动端遮罩 ── */
.nav-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 98;
  background: rgba(0,0,0,.3);
}

/* ── 移动端菜单头 ── */
.mobile-menu-header {
  display: none;
}

.mobile-menu-title {
  font-size: 16px;
  font-weight: 700;
}

.mobile-close {
  background: none;
  border: none;
  font-size: 20px;
  cursor: pointer;
  color: var(--text, #1d1d1f);
}

/* ── 移动端适配：全屏抽屉 + 平铺分组（不折叠） ── */
@media (max-width: 768px) {
  nav {
    padding: 0 16px;
  }

  .hamburger {
    display: block;
  }

  nav .links {
    display: none;
    position: fixed;
    top: 60px;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(8,8,15,.98);
    flex-direction: column;
    align-items: stretch;
    padding: 8px 16px calc(24px + env(safe-area-inset-bottom));
    z-index: 99;
    gap: 2px;
    height: auto;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  nav .links.open {
    display: flex;
  }

  .mobile-menu-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 8px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 6px;
  }
  .mobile-menu-title { color: var(--text, #1d1d1f); }
  .mobile-close { color: var(--text, #1d1d1f); }

  .nav-overlay.open {
    display: block;
  }

  /* 直达链接（首页/关于我们）：整行大按钮 */
  nav .links > a.nav-top {
    height: 48px;
    font-size: 15px;
    padding: 0 12px;
    border-radius: 8px;
    color: var(--text, #1d1d1f);
  }

  /* 一级项：分组标题，不折叠 */
  .nav-item {
    flex-direction: column;
    height: auto;
    align-items: stretch;
  }

  .nav-item > span {
    height: 44px;
    font-size: 15px;
    font-weight: 700;
    padding: 0 12px;
    color: var(--text, #1d1d1f);
  }

  .nav-item > span::after {
    display: none;   /* 平铺不折叠，去掉箭头 */
  }

  /* 二级：默认平铺显示，一次点直达 */
  .nav-dropdown {
    display: block;
    position: static;
    transform: none;
    box-shadow: none;
    background: transparent;
    border: none;
    padding: 0 0 4px 12px;
    min-width: auto;
  }

  .nav-dropdown a {
    display: block;
    padding: 12px 14px !important;
    font-size: 14px !important;
    color: var(--dim, #86868b) !important;
    margin: 0;
    border-radius: 8px;
  }

  .nav-dropdown a:active {
    background: rgba(124,92,252,.12);
  }

  .nav-dropdown .drop-more {
    border-top: 1px solid var(--border, rgba(255,255,255,.08));
    color: var(--purple, #a78bfa) !important;
  }

  /* 登录按钮在抽屉里占满整行 */
  nav .links .btn-nav {
    height: 48px;
    font-size: 15px;
    justify-content: center;
    border-radius: 8px;
    margin-top: 6px;
  }
}

/* ── 页面内容偏移（防止被固定导航遮挡） ── */
/* 使用 unified-nav 的页面应确保内容区有 padding-top: 70px */
