/* ============================================================
   易语言源码网 · 会员头部专属样式 head.css
   与主站 style.css 配合使用，依赖相同 CSS 变量
   ============================================================ */

/* ── 顶部信息条 ─────────────────────────────────────────── */
.m-topbar {
  background: linear-gradient(90deg, #0f172a 0%, #1e293b 50%, #0f172a 100%);
  border-bottom: 1px solid rgba(37, 99, 235, 0.25);
  font-size: 12px;
  color: rgba(255, 255, 255, 0.65);
  position: relative;
}

.m-topbar::before {
  content: '';
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    90deg,
    transparent,
    transparent 120px,
    rgba(37, 99, 235, 0.04) 120px,
    rgba(37, 99, 235, 0.04) 121px
  );
  pointer-events: none;
}

.m-topbar-in {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 16px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

/* 左侧状态标签组 */
.m-ts-wrap {
  display: flex;
  align-items: center;
  gap: 18px;
}

.m-ts {
  display: flex;
  align-items: center;
  gap: 5px;
  color: rgba(255, 255, 255, 0.55);
  font-size: 11.5px;
  letter-spacing: 0.2px;
  transition: color 0.22s ease;
}

.m-ts:hover {
  color: rgba(255, 255, 255, 0.85);
}

.m-ts i {
  font-size: 10.5px;
  color: var(--acc, #2563eb);
}

.m-ts strong {
  color: #60a5fa;
  font-weight: 700;
}

/* 右侧操作区 */
.m-tb-r {
  display: flex;
  align-items: center;
  gap: 6px;
}

.m-tb-r a {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  font-size: 11.5px;
  color: rgba(255, 255, 255, 0.62);
  border-radius: 4px;
  transition: color 0.2s ease, background 0.2s ease;
}

.m-tb-r a:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
}

.m-tb-r a i {
  font-size: 11px;
}

.m-btn-up {
  background: linear-gradient(135deg, var(--acc, #2563eb), #0ea5e9) !important;
  color: #fff !important;
  border-radius: 5px !important;
  padding: 3px 11px !important;
  font-weight: 600;
  box-shadow: 0 1px 6px rgba(37, 99, 235, 0.28);
  transition: opacity 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease !important;
}

.m-btn-up:hover {
  opacity: 0.92;
  transform: translateY(-1px);
  box-shadow: 0 3px 10px rgba(37, 99, 235, 0.38) !important;
  background: linear-gradient(135deg, var(--acc, #2563eb), #0ea5e9) !important;
}

/* ── 站点头部 ────────────────────────────────────────────── */
.m-site-header {
  background: #fff;
  border-bottom: 1px solid var(--border, #e5e7eb);
  box-shadow: 0 1px 8px rgba(0, 0, 0, 0.05);
}

.m-header-in {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 16px;
  height: 76px;
  display: flex;
  align-items: center;
  gap: 24px;
}

/* Logo */
.m-logo {
  display: flex;
  align-items: center;
  gap: 11px;
  text-decoration: none;
  flex-shrink: 0;
  transition: opacity 0.22s ease;
}

.m-logo:hover {
  opacity: 0.88;
}

.m-logo-icon {
  width: 44px;
  height: 44px;
  border-radius: 11px;
  background: linear-gradient(135deg, var(--acc, #2563eb) 0%, #0ea5e9 100%);
  color: #fff;
  font-size: 20px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.3);
  transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.3s ease;
  flex-shrink: 0;
}

.m-logo:hover .m-logo-icon {
  transform: rotate(-6deg) scale(1.08);
  box-shadow: 0 6px 20px rgba(37, 99, 235, 0.4);
}

.m-logo-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.m-logo-l1 {
  font-size: 16px;
  font-weight: 800;
  color: var(--text, #111827);
  letter-spacing: 0.3px;
  line-height: 1.2;
}

.m-logo-l2 {
  font-size: 11px;
  color: var(--muted, #9ca3af);
  letter-spacing: 0.5px;
}

/* 广告语 */
.m-header-ad {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 6px 14px;
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.06), rgba(14, 165, 233, 0.06));
  border: 1px solid rgba(37, 99, 235, 0.12);
  border-radius: 20px;
  font-size: 12.5px;
  color: var(--acc, #2563eb);
  font-weight: 600;
  white-space: nowrap;
  letter-spacing: 0.3px;
  transition: background 0.22s ease, border-color 0.22s ease, transform 0.22s ease;
}

.m-header-ad:hover {
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.1), rgba(14, 165, 233, 0.1));
  border-color: rgba(37, 99, 235, 0.22);
  transform: translateY(-1px);
}

.m-header-ad i {
  font-size: 12px;
  animation: adIconPulse 2.5s ease-in-out infinite;
}

@keyframes adIconPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.2) rotate(-8deg); }
}

/* 搜索框 */
.m-search-wrap {
  flex: 1;
  max-width: 480px;
  margin-left: auto;
}

.m-search-wrap form {
  width: 100%;
}

.m-search-box {
  display: flex;
  align-items: center;
  height: 40px;
  background: var(--bg2, #f8fafc);
  border: 1.5px solid var(--border, #e5e7eb);
  border-radius: 10px;
  overflow: hidden;
  transition: border-color 0.22s ease, box-shadow 0.22s ease, background 0.22s ease;
}

.m-search-box:focus-within {
  border-color: var(--acc, #2563eb);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
  background: #fff;
}

.m-s-cat {
  height: 100%;
  padding: 0 8px 0 12px;
  border: none;
  background: transparent;
  font-size: 12.5px;
  color: var(--text2, #374151);
  cursor: pointer;
  outline: none;
  font-family: inherit;
  flex-shrink: 0;
}

.m-s-sep {
  width: 1px;
  height: 18px;
  background: var(--border, #e5e7eb);
  flex-shrink: 0;
}

.m-s-ico {
  padding: 0 8px;
  color: var(--muted, #9ca3af);
  font-size: 13px;
  flex-shrink: 0;
}

.m-search-ipt {
  flex: 1;
  height: 100%;
  border: none;
  background: transparent;
  font-size: 13px;
  color: var(--text, #111827);
  outline: none;
  font-family: inherit;
  min-width: 0;
}

.m-search-ipt::placeholder {
  color: var(--muted, #9ca3af);
}

.m-search-btn {
  height: 100%;
  padding: 0 18px;
  background: linear-gradient(135deg, var(--acc, #2563eb), #0ea5e9);
  color: #fff;
  border: none;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  letter-spacing: 0.5px;
  transition: opacity 0.2s ease, filter 0.2s ease;
  flex-shrink: 0;
}

.m-search-btn:hover {
  opacity: 0.92;
  filter: brightness(1.05);
}

/* ── 主导航 ──────────────────────────────────────────────── */
/* 与主站 .main-nav 保持完全一致的配色和交互 */
.m-main-nav {
  background: #1a56db;
  position: relative;
  z-index: 100;
}

.m-nav-in {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 16px;
  display: flex;
  align-items: stretch;
  height: 46px;
}

.m-nav-list {
  display: flex;
  align-items: stretch;
  list-style: none;
  margin: 0;
  padding: 0;
  width: 100%;
}

.m-nav-item {
  position: relative;
}

.m-nav-item.push {
  margin-left: auto;
}

.m-nav-link {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 16px;
  height: 46px;
  font-size: 13.5px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.9);
  white-space: nowrap;
  position: relative;
  transition: color 0.2s ease, background 0.2s ease;
}

.m-nav-link::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: rgba(255, 255, 255, 0.85);
  border-radius: 3px 3px 0 0;
  transform: scaleX(0);
  transition: transform 0.22s ease;
}

.m-nav-item:hover > .m-nav-link {
  color: #fff;
  background: rgba(0, 0, 0, 0.12);
}

.m-nav-item:hover > .m-nav-link::after {
  transform: scaleX(1);
}

.m-nav-link i {
  font-size: 12px;
}

.m-arr {
  font-size: 10px !important;
  opacity: 0.7;
  transition: transform 0.25s ease !important;
}

.m-nav-item:hover .m-arr {
  transform: rotate(180deg);
}

/* 下拉菜单 */
.m-nav-drop {
  position: absolute;
  top: calc(100% + 2px);
  left: 0;
  min-width: 168px;
  background: #fff;
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 10px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.13), 0 2px 8px rgba(0, 0, 0, 0.06);
  padding: 6px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px) scale(0.96);
  transform-origin: top left;
  transition: opacity 0.2s ease, visibility 0.2s ease, transform 0.22s cubic-bezier(0.34, 1.56, 0.64, 1);
  z-index: 200;
}

.m-nav-drop-r,
.m-nav-item.push .m-nav-drop {
  left: auto;
  right: 0;
  transform-origin: top right;
}

.m-nav-item:hover .m-nav-drop {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

.m-nav-drop a {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 12px;
  font-size: 13px;
  color: var(--text2, #374151);
  border-radius: 7px;
  transition: color 0.18s ease, background 0.18s ease, padding-left 0.2s ease;
  white-space: nowrap;
}

.m-nav-drop a:hover {
  color: var(--acc, #2563eb);
  background: var(--acc-l, #eff6ff);
  padding-left: 16px;
}

.m-nav-drop a i {
  font-size: 12px;
  color: var(--muted, #9ca3af);
  width: 14px;
  text-align: center;
  flex-shrink: 0;
  transition: color 0.18s ease, transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.m-nav-drop a:hover i {
  color: var(--acc, #2563eb);
  transform: scale(1.2) rotate(-8deg);
}

/* 汉堡按钮（移动端） */
.m-nav-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  margin: auto 0;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  font-size: 15px;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease;
}

.m-nav-toggle:hover {
  background: rgba(255, 255, 255, 0.18);
  border-color: rgba(255, 255, 255, 0.5);
}

/* ── 响应式 ──────────────────────────────────────────────── */
@media (max-width: 900px) {
  .m-header-ad {
    display: none;
  }
}

@media (max-width: 768px) {
  .m-topbar-in {
    padding: 0 12px;
  }
  .m-ts-wrap .m-ts:not(:first-child) {
    display: none;
  }

  .m-header-in {
    height: auto;
    padding: 12px;
    flex-wrap: wrap;
    gap: 10px;
  }
  .m-logo-l1 {
    font-size: 14px;
  }
  .m-logo-l2 {
    display: none;
  }
  .m-search-wrap {
    width: 100%;
    max-width: 100%;
    order: 3;
    flex: none;
    margin-left: 0;
  }

  /* 导航移动端 */
  .m-nav-in {
    height: 46px;
    position: relative;
  }
  .m-nav-toggle {
    display: flex;
  }
  .m-nav-list {
    position: fixed;
    top: 0;
    left: -280px;
    width: 270px;
    height: 100vh;
    background: #1a2744;
    flex-direction: column;
    align-items: stretch;
    overflow-y: auto;
    padding: 60px 0 20px;
    z-index: 500;
    transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  }
  .m-nav-list.open {
    left: 0;
  }
  .m-nav-item {
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  }
  .m-nav-item.push {
    margin-left: 0;
  }
  .m-nav-link {
    height: 48px;
    padding: 0 18px;
    font-size: 14px;
    justify-content: space-between;
  }
  .m-nav-link::after {
    display: none;
  }
  .m-nav-drop {
    position: static;
    opacity: 1;
    visibility: hidden;
    transform: none;
    box-shadow: none;
    border: none;
    border-radius: 0;
    background: rgba(0, 0, 0, 0.2);
    padding: 0;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease, visibility 0.3s ease;
  }
  .m-nav-item.open .m-nav-drop {
    visibility: visible;
    max-height: 300px;
  }
  .m-nav-drop a {
    color: rgba(255, 255, 255, 0.65);
    padding: 10px 24px 10px 36px;
    border-radius: 0;
    font-size: 13px;
  }
  .m-nav-drop a:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.06);
    padding-left: 42px;
  }
  .m-nav-drop a i {
    color: rgba(255, 255, 255, 0.4);
  }
  .m-nav-drop a:hover i {
    color: var(--acc, #2563eb);
  }
  .m-nav-item.open .m-arr {
    transform: rotate(180deg);
  }
}

/* ===== 会员菜单修复 ===== */

.user-item > .m-nav-link{
    height:46px;
    display:flex;
    align-items:center;
    gap:6px;
    padding:0 16px;
    color:rgba(255,255,255,.92) !important;
    background:transparent !important;
}

/* hover 状态 */
.user-item:hover > .m-nav-link{
    color:#fff !important;
    background:rgba(0,0,0,.12) !important;
}

/* 下拉箭头 */
.user-item .m-arr{
    font-size:10px;
    opacity:.7;
    transition:transform .25s ease;
}

.user-item:hover .m-arr{
    transform:rotate(180deg);
}

/* 修复用户名过高 */
.user-item{
    display:flex;
    align-items:stretch;
}

/* ===== 移动端限制菜单高度，防止溢出 ===== */
@media (max-width:768px){

    .user-item .m-nav-drop{
        position:absolute;
        top:100%;
        right:0;
        left:auto;

        max-height:60vh;
        overflow-y:auto;

        transform:none !important;
    }

}
.m-nav-link{
    display:flex;
    align-items:center;
    gap:6px;
    padding:10px 14px;
    line-height:1;
}
.top-user-nav .m-nav-link{
    padding:12px 14px;
}
/* ===== 修复手机端会员下拉菜单白屏 ===== */

@media (max-width:768px){

    /* 强制会员菜单恢复白底黑字 */
    .user-item .m-nav-drop{
        background:#fff !important;
    }

    .user-item .m-nav-drop a{
        color:#374151 !important;
    }

    .user-item .m-nav-drop a i{
        color:#9ca3af !important;
    }

    .user-item .m-nav-drop a:hover{
        color:var(--acc,#2563eb) !important;
        background:var(--acc-l,#eff6ff) !important;
    }

}

