/* ============================================================
   音乐考级官网 - 全局导航栏
   桌面端: 横向导航 + 酷炫动效
   移动端: 汉堡菜单 + 侧滑面板 + 动画
   ============================================================ */

/* -------- 头部容器 -------- */
.header {
  background: linear-gradient(135deg, #0f0c29, #1a1a2e 50%, #16213e);
  position: sticky;
  top: 0;
  z-index: 1000;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(255,255,255,.06);
}
.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  height: 60px;
}

/* -------- Logo -------- */
.logo {
  font-size: 22px;
  font-weight: 800;
  text-decoration: none;
  letter-spacing: 2px;
  position: relative;
  z-index: 1001;
  flex-shrink: 0;
}
.logo,
.logo:visited,
.logo:hover {
  color: transparent;
  background: linear-gradient(135deg, #e94560, #ff6b81);
  -webkit-background-clip: text;
  background-clip: text;
}
.logo span {
  color: #fff;
  background: none;
  -webkit-background-clip: unset;
  background-clip: unset;
}

/* -------- 桌面导航 -------- */
.nav {
  display: flex;
  align-items: center;
  gap: 2px;
  list-style: none;
  margin: 0;
  padding: 0;
  height: 100%;
}
.nav a {
  position: relative;
  color: #b8c5d6;
  text-decoration: none;
  padding: 8px 14px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  transition: all .25s cubic-bezier(.4, 0, .2, 1);
  white-space: nowrap;
}
.nav a:hover {
  color: #fff;
  background: rgba(255,255,255,.08);
}

/* 导航下划线动画 */
.nav a::after {
  content: '';
  position: absolute;
  bottom: 2px;
  left: 50%;
  width: 0;
  height: 2px;
  background: linear-gradient(90deg, #e94560, #ff6b81);
  border-radius: 1px;
  transition: all .3s cubic-bezier(.4, 0, .2, 1);
  transform: translateX(-50%);
}
.nav a:hover::after {
  width: 60%;
}

/* Active 状态 */
.nav a.active {
  color: #fff;
  background: rgba(233, 69, 96, .18);
  font-weight: 600;
}
.nav a.active::after {
  width: 60%;
  background: #e94560;
}

/* CTA 按钮样式 */
.nav a.btn-nav {
  background: rgba(233, 69, 96, .12);
  color: #e94560;
  font-weight: 600;
  border: 1px solid rgba(233, 69, 96, .25);
  transition: all .3s;
}
.nav a.btn-nav:hover {
  background: rgba(233, 69, 96, .22);
  border-color: rgba(233, 69, 96, .45);
  box-shadow: 0 0 18px rgba(233, 69, 96, .15);
  color: #ff6b81;
}
.nav a.btn-nav.active {
  background: rgba(233, 69, 96, .25);
  border-color: #e94560;
  color: #fff;
}

/* 登录按钮 */
.nav a.btn-nav.login-btn {
  background: rgba(233, 69, 96, .18);
  color: #e94560;
  font-weight: 600;
}

/* 用户名显示 */
.nav .user-name {
  color: #e94560;
  padding: 8px 10px;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* 登出链接 */
.nav a.logout-link {
  color: #8899aa;
  font-size: 13px;
  padding: 8px 12px;
}
.nav a.logout-link:hover {
  color: #e94560;
  background: rgba(233, 69, 96, .1);
}

/* "我的报名"入口 */
.nav a.my-reg {
  color: #8be0fd;
  font-weight: 500;
}
.nav a.my-reg:hover {
  color: #b3ecff;
  background: rgba(139, 224, 253, .1);
}
.nav a.my-reg.active {
  color: #fff;
  background: rgba(139, 224, 253, .15);
}

/* -------- 汉堡按钮（移动端） -------- */
.hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 8px;
  cursor: pointer;
  z-index: 1001;
  padding: 0;
  transition: all .3s;
  flex-shrink: 0;
}
.hamburger:hover {
  background: rgba(255,255,255,.12);
}
.hamburger span {
  display: block;
  width: 20px;
  height: 2px;
  background: #ccc;
  border-radius: 2px;
  transition: all .35s cubic-bezier(.4, 0, .2, 1);
  transform-origin: center;
}
/* 汉堡 → X 动画 */
.hamburger.active span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.hamburger.active span:nth-child(2) {
  opacity: 0;
  transform: scaleX(0);
}
.hamburger.active span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* -------- 移动端覆盖层 -------- */
.nav-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, .55);
  z-index: 998;
  opacity: 0;
  transition: opacity .3s;
}
.nav-overlay.active {
  display: block;
  opacity: 1;
}

/* ==========================================
   移动端断点
   ========================================== */
@media (max-width: 768px) {

  .header-inner {
    padding: 0 14px;
    height: 54px;
  }
  .logo {
    font-size: 18px;
  }

  /* 隐藏桌面导航，显示汉堡 */
  .hamburger {
    display: flex;
  }

  .nav {
    position: fixed;
    top: 0;
    right: -100%;
    width: 280px;
    max-width: 80vw;
    height: 100%;
    height: 100dvh;
    background: linear-gradient(180deg, #0f0c29 0%, #1a1a2e 40%, #16213e 100%);
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 70px 0 30px;
    z-index: 999;
    overflow-y: auto;
    transition: right .35s cubic-bezier(.4, 0, .2, 1);
    box-shadow: -8px 0 30px rgba(0, 0, 0, .4);
    border-left: 1px solid rgba(255,255,255,.06);
  }
  .nav.active {
    right: 0;
  }

  /* 移动端菜单项 */
  .nav a {
    padding: 14px 24px;
    font-size: 15px;
    border-radius: 0;
    border-bottom: 1px solid rgba(255,255,255,.04);
    opacity: 0;
    transform: translateX(20px);
    transition: all .35s cubic-bezier(.4, 0, .2, 1);
  }
  .nav.active a {
    opacity: 1;
    transform: translateX(0);
  }
  /* 逐项延迟 */
  .nav a:nth-child(1)  { transition-delay: .06s; }
  .nav a:nth-child(2)  { transition-delay: .10s; }
  .nav a:nth-child(3)  { transition-delay: .14s; }
  .nav a:nth-child(4)  { transition-delay: .18s; }
  .nav a:nth-child(5)  { transition-delay: .22s; }
  .nav a:nth-child(6)  { transition-delay: .26s; }
  .nav a:nth-child(7)  { transition-delay: .30s; }
  .nav a:nth-child(8)  { transition-delay: .34s; }
  .nav a:nth-child(9)  { transition-delay: .38s; }
  .nav a:nth-child(10) { transition-delay: .42s; }

  .nav a::after {
    display: none;
  }
  .nav a:hover {
    background: rgba(255,255,255,.06);
  }
  .nav a.active {
    background: rgba(233, 69, 96, .15);
    border-left: 3px solid #e94560;
  }

  /* 移动端按钮样式 */
  .nav a.btn-nav {
    margin: 4px 16px;
    border-radius: 8px;
    text-align: center;
    border-bottom: none;
  }

  /* 用户名 */
  .nav .user-name {
    padding: 14px 24px;
    border-bottom: 1px solid rgba(255,255,255,.06);
    max-width: none;
    font-size: 14px;
    opacity: 0;
    transform: translateX(20px);
  }
  .nav.active .user-name {
    opacity: 1;
    transform: translateX(0);
    transition: all .35s cubic-bezier(.4, 0, .2, 1) .34s;
  }

  .nav a.logout-link {
    padding: 14px 24px;
    border-bottom: 1px solid rgba(255,255,255,.06);
    border-radius: 0;
  }

  .nav a.my-reg {
    border-bottom: 1px solid rgba(255,255,255,.06);
  }
}

/* 小屏手机优化 */
@media (max-width: 380px) {
  .nav {
    width: 100%;
    max-width: 100vw;
  }
  .nav a {
    padding: 13px 20px;
    font-size: 14px;
  }
}

/* 大屏优化 */
@media (min-width: 1200px) {
  .header-inner {
    padding: 0 32px;
    height: 66px;
  }
  .nav a {
    padding: 10px 16px;
    font-size: 15px;
  }
}

/* 通用底部栏 */
.footer { background:#1a1a2e; color:#ccc; text-align:center; padding:40px 20px; font-size:14px; flex-shrink:0; }
.footer a { color:#e94560; text-decoration:none; }
.footer p { margin:6px 0; }
