/* =========================================
   Header 极简磨砂重构版
   ========================================= */
header {
  grid-column: 1 / -1;
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.85), rgba(30, 64, 175, 0.85));
  backdrop-filter: blur(24px) saturate(160%);
  -webkit-backdrop-filter: blur(24px) saturate(160%);
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 12px 32px rgba(37, 99, 235, 0.2);
  border-radius: 16px;
  color: white;
  padding: 16px 24px;
  position: relative;
  z-index: var(--z-nav);
  margin: 20px 0; /* 顶部和底部间距统一为 20px */ /* 顶部留白 16px，底部留白 32px */
}

/* 闪光动画（2026-11-03 改为 background-position，避免溢出 header） */
header::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 16px;
  background: linear-gradient(45deg, transparent 30%, rgba(255, 255, 255, 0.15) 50%, transparent 70%);
  background-size: 200% 100%;
  animation: shimmer 3s infinite;
  pointer-events: none;
}

@keyframes shimmer {
  0%   { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

/* 深色模式保留 */
body.dark-theme header {
  background: linear-gradient(135deg, rgba(30, 41, 59, 0.85), rgba(15, 23, 42, 0.85));
  border-color: rgba(255, 255, 255, 0.08);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.3);
}

/* 顶部行布局：标题左，按钮右 */
.header-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  gap: 10px;
}

/* 移动端/平板操作区基础设定（防止在断点之间折行） */
.mobile-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  flex-shrink: 0;
}

/* 缩小字号，保留渐变文字 */
.site-logo {
  font-size: 1.8rem;
  font-weight: 700;
  margin-bottom: 0;
  display: inline-block;
  white-space: nowrap;
  flex-shrink: 0;
  background: linear-gradient(45deg, #fff, #e0e7ff);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-decoration: none;
  transition: opacity 0.2s;
}
.site-logo:hover { opacity: 0.9; }

/* 删掉废弃的 .logo p 样式 */

/* 恢复右侧三个按钮的磨砂圆形底座 */
.social-icons {
  display: flex;
  gap: 12px;
}

.social-icons a {
  color: white;
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: all 0.3s ease;
}

/* 确保内部 SVG 图标大小合适 */
.social-icons a svg {
  width: 20px;
  height: 20px;
}

.social-icons a:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* 移动端菜单按钮也保留一下基础设置，虽然目前是桌面端 */
.mobile-menu-toggle {
  display: none; /* 默认隐藏，由媒体查询唤醒 */
  width: 34px;
  height: 34px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 50%;
  flex-shrink: 0;
  border: none;
  cursor: pointer;
  padding: 0;
  transition: background 0.3s ease;
}
.mobile-menu-toggle:hover {
  background: rgba(255, 255, 255, 0.3);
}
.mobile-menu-toggle span {
  width: 18px;
  height: 2px;
  background: white;
  border-radius: 2px;
  display: block;
}


/* header.css —— 从 layout.css 拆出（原第 17-148 行）
   Header + 桌面导航
   拆分日期：2026-10-30 */

/* 桌面导航 */
.main-nav.desktop-nav ul {
  display: flex;
  gap: 2px;
  list-style: none;
  justify-content: center;
  flex-wrap: nowrap; /* 禁止换行 */
}

.main-nav .nav-link {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  color: rgba(255, 255, 255, 0.9);
  text-decoration: none;
  border-radius: 20px;
  transition: all 0.3s ease;
  font-weight: 500;
  font-size: 0.95rem;
}

.main-nav .nav-link:hover,
.main-nav .nav-link.active {
  background: rgba(255, 255, 255, 0.2);
  color: white;
}

/* 平板/小笔记本（1024px 以下）：切换为汉堡菜单 */
@media (max-width: 1024px) {
  /* 隐藏桌面导航，显示汉堡按钮 */
  .main-nav.desktop-nav {
    display: none;
  }
  .mobile-menu-toggle {
    display: flex;
  }
  /* 去掉导航隐藏后遗留的下边距，确保上下对称 */
  header {
    padding-top: 18px;
    padding-bottom: 18px;
  }
  .header-top {
    margin-bottom: 0;
  }
}

/* 移动端与小平板（768px 以下） */
@media (max-width: 768px) {
  header {
    /* 仅保留移动端合理的左右边距缩减，上下间距交由桌面默认值统一管理 */
    padding-left: 16px;
    padding-right: 16px;
  }
  .header-top {
    display: flex;
    flex-wrap: nowrap;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
  }
  .logo {
    flex: 1;
    min-width: 0;
  }
  .site-logo {
    font-size: 1.3rem;
    white-space: nowrap;
  }
  .mobile-actions {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
  }
  .social-icons {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
  }
  .social-icons a {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
  }
}
