/* ========== 防滚动条显隐导致布局跳动 ========== */
html {
  overflow-y: scroll; /* 关键：始终保留滚动条占位 */
}

/* ========== 基础样式 ========== */
body {
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Microsoft YaHei", sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

/* ========== 导航容器 ========== */
#header-placeholder .nav-container {
  width: 100%;
  height: 64px;
  background: rgba(201, 11, 11, 1);
  display: flex;
  justify-content: center;
  /* ❌ 不使用 align-items: center，避免依赖字体基线 */
  position: relative;
  z-index: 9999;
  transform: translateZ(0);
  backface-visibility: hidden;
}

/* ========== 主导航 ========== */
#header-placeholder .main-nav {
  display: flex;
  list-style: none;
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0;
  justify-content: space-between;
  white-space: nowrap;
  transform: translateZ(0);
}

/* ========== 普通菜单项 ========== */
#header-placeholder .main-nav > li {
  position: relative;
  height: 64px;
  margin: 0 8px;
}

/* ========== 所有一级链接 —— 使用固定 padding 垂直居中 ========== */
#header-placeholder .main-nav > li > a,
#header-placeholder .split-link-item > a {
  display: block;
  color: white;
  text-decoration: none;
  font-size: 22px;
  font-weight: 700;
  white-space: nowrap;
  box-sizing: border-box;
  position: relative;
  line-height: 1;
  text-align: center;

  /* ✅ 关键：用固定 padding 替代 flex align-items */
  padding: 21px 0; /* (64 - 22) / 2 = 21px */
}

/* ========== 伪元素下划线 ========== */
#header-placeholder .main-nav > li > a::after,
#header-placeholder .split-link-item > a::after {
  content: '';
  position: absolute;
  bottom: 7px;
  left: 50%;
  width: 0;
  height: 2px;
  background-color: white;
  transform: translateX(-50%);
  transition: width 0.2s ease;
}

/* hover / active 状态 */
#header-placeholder .main-nav > li:not(.split-link-item):hover > a::after,
#header-placeholder .main-nav > li > a.active::after,
#header-placeholder .split-link-item > a:hover::after,
#header-placeholder .split-link-item > a.active::after {
  width: 100%;
}

/* ========== 特殊结构：头条・要闻 ========== */
#header-placeholder .split-link-item {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  height: 64px;
  padding: 0 8px; /* 内部留出左右空间 */
}

/* split 中的 a 单独设置（保持一致） */
#header-placeholder .split-link-item > a {
  padding: 21px 0;
  min-width: auto;
}

#header-placeholder .split-separator {
  display: inline-block;
  margin-top: 4px;
  width: 6px;
  height: 6px;
  border-radius: 3px;
  background-color: #fff;
}

/* ========== 下拉菜单 ========== */
#header-placeholder .dropdown-content {
  display: none;
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  min-width: 180px;
  background-color: rgba(252, 218, 211, 1);
  border: 1px solid #ddd;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
  box-sizing: border-box;
}

#header-placeholder .dropdown-content a {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px 16px;
  text-decoration: none;
  font-size: 18px;
  font-weight: 700;
  color: rgba(201, 11, 11, 1);
  border-bottom: none !important;
}

#header-placeholder .dropdown-content a:hover {
  background-color: white;
}

#header-placeho lder .dropdown:hover .dropdown-content {
  display: block;
}