/*
 * 顶栏导航样式（header.css）
 * 适用页面：所有引入 common/header.html 的页面
 * 内容：毛玻璃吸顶 header、Logo、中间文章分类导航、右侧用户区、手机端抽屉菜单
 * 说明：白色科技风，header 白色毛玻璃 + 浅灰边框，文字深灰。
 */
.nav-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(255,255,255,.82);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(100,116,139,.14);
}

.header-inner {
  max-width: 1200px; margin: 0 auto; padding: 0 24px;
  display: flex; align-items: center; justify-content: space-between; gap: 16px; height: 64px;
}

.logo { display: flex; align-items: center; gap: 12px; flex-shrink: 0; }

.logo-icon {
  width: 40px; height: 40px; display: flex; align-items: center; justify-content: center;
  border-radius: 12px; color: #fff; font-size: 22px;
  background: linear-gradient(135deg, #3b82f6, #22d3ee);
  box-shadow: 0 4px 16px rgba(59,130,246,.4);
}

.logo-text { font-size: 20px; font-weight: 700; color: #0f172a; letter-spacing: .5px; }

.header-cats {
  flex: 1; min-width: 0; display: flex; align-items: center; gap: 4px;
  overflow-x: auto; padding: 0 8px;
  scrollbar-width: none;
}
.header-cats::-webkit-scrollbar { display: none; }

.cat-link {
  color: #64748b; font-size: 14px; padding: 5px 12px; border-radius: 8px;
  white-space: nowrap; transition: color .2s, background .2s; flex-shrink: 0;
}
.cat-link:hover { color: #3b82f6; background: rgba(59,130,246,.08); }
.cat-link.active { color: #2563eb; background: rgba(59,130,246,.12); font-weight: 600; }

.nav-right { display: flex; align-items: center; gap: 18px; flex-shrink: 0; }

.nav-link { color: #475569; font-size: 14px; transition: color .2s; }
.nav-link:hover { color: #2563eb; }

.nav-btn {
  padding: 7px 18px; border-radius: 8px; color: #fff;
  background: linear-gradient(135deg, #3b82f6, #22d3ee);
  box-shadow: 0 4px 14px rgba(59,130,246,.3);
}
.nav-btn:hover { color: #fff; opacity: .9; }

/* ===== 手机端汉堡按钮 ===== */
.header-burger {
  display: none; align-items: center; justify-content: center;
  width: 36px; height: 36px; border: none; cursor: pointer;
  border-radius: 10px; color: #475569; font-size: 20px;
  background: #fff; border: 1px solid rgba(100,116,139,.18);
  flex-shrink: 0; transition: all .2s;
}
.header-burger:hover { color: #2563eb; border-color: rgba(59,130,246,.45); }

/* ===== 抽屉菜单 ===== */
.drawer-mask {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(15,23,42,.45);
  opacity: 0; visibility: hidden;
  transition: opacity .25s ease;
}
.drawer-mask.show { opacity: 1; visibility: visible; }

.header-drawer {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 210;
  width: min(300px, 86vw);
  background: #fff;
  box-shadow: -20px 0 60px rgba(15,23,42,.15);
  transform: translateX(100%);
  transition: transform .28s ease;
  display: flex; flex-direction: column;
}
.header-drawer.open { transform: translateX(0); }

.drawer-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 20px;
  border-bottom: 1px solid rgba(100,116,139,.12);
}
.drawer-title {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 16px; font-weight: 700; color: #0f172a;
}
.drawer-title .layui-icon { color: #2563eb; font-size: 18px; }
.drawer-close {
  width: 30px; height: 30px; display: flex; align-items: center; justify-content: center;
  border: none; cursor: pointer; border-radius: 8px; color: #94a3b8; font-size: 15px;
  background: #f1f5f9; transition: all .2s;
}
.drawer-close:hover { color: #ef4444; background: rgba(239,68,68,.08); }

.drawer-section { padding: 18px 20px 0; }
.drawer-section-title {
  font-size: 12px; color: #94a3b8; margin-bottom: 10px; font-weight: 600;
  letter-spacing: 1px;
}
.drawer-cats, .drawer-links { display: flex; flex-direction: column; gap: 2px; }

.drawer-cats .cat-link {
  padding: 11px 12px; border-radius: 10px; font-size: 15px; flex-shrink: 1;
}
.drawer-links .nav-link {
  padding: 11px 12px; border-radius: 10px; font-size: 15px;
  display: flex; align-items: center; gap: 8px;
}
.drawer-links .nav-btn { display: block; text-align: center; margin-top: 4px; }

@media (max-width: 768px) {
  .header-inner { padding: 0 14px; gap: 10px; height: 56px; }
  .logo { gap: 8px; }
  .logo-icon { width: 34px; height: 34px; border-radius: 10px; font-size: 18px; }
  .logo-text { font-size: 17px; }
  .header-cats, .nav-right { display: none; }
  .header-burger { display: flex; }
}
