/* common.css — 统一三页导航栏的横向布局，消除切换页面时的跳动。
   只控制导航区域的尺寸/间距/对齐（不动配色、不动内容区）。
   用 !important 覆盖各页原有规则和媒体查询里的差异化值。 */

/* ====== header 容器：宽度、内边距、高度 三页一致 ====== */
header .inner {
  display: flex !important;
  align-items: center !important;
  justify-content: flex-start !important;
  gap: 32px !important;
  max-width: 1180px !important;
  min-height: 72px !important;
  height: 72px !important;
  margin: 0 auto !important;
  padding: 12px 24px !important;
  box-sizing: border-box !important;
}

/* ====== logo / wordmark 区域 ====== */
.wordmark,
.brand,
.brand h1 {
  display: inline-flex !important;
  align-items: center !important;
  min-height: 34px !important;
  font-size: 30px !important;
  font-weight: 700 !important;
  letter-spacing: -.02em !important;
  white-space: nowrap !important;
  text-decoration: none !important;
  line-height: 1 !important;
}
/* athletes 页的小方块 logo 缩小到与文字等高，不抢空间 */
.brand .logo {
  width: 28px !important;
  height: 28px !important;
  min-height: 28px !important;
  border-radius: 6px !important;
  flex-shrink: 0 !important;
}
/* 隐藏 brand 副标题（只有 athletes 有），保持导航栏干净 */
.brand p {
  display: none !important;
}

/* ====== 导航项容器 ====== */
.top-actions {
  display: flex !important;
  align-items: center !important;
  justify-content: flex-start !important;
  gap: 8px !important;
  margin-left: auto !important;   /* 把导航推到右侧，三页统一 */
}

/* ====== 每个导航链接：尺寸/字号/内边距 一致 ====== */
.nav-action,
a.back,
#athletesLink {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  min-height: 34px !important;
  padding: 0 12px !important;
  margin: 0 !important;
  border: 0 !important;
  border-radius: 9px !important;
  font-size: 15px !important;
  font-weight: 650 !important;
  text-decoration: none !important;
  white-space: nowrap !important;
  line-height: 1 !important;
  box-sizing: border-box !important;
}

/* Persistent current-page feedback shared by every page and language. */
.top-actions a.nav-action,
.top-actions a.back,
.top-actions #athletesLink {
  position: relative !important;
  color: #929b96 !important;
  font-weight: 650 !important;
  transition: color .16s ease, background-color .16s ease, box-shadow .16s ease,
              transform .1s ease !important;
}
.top-actions a[aria-current="page"] {
  color: #fff !important;
  background: transparent !important;
  box-shadow: none !important;
  font-weight: 700 !important;
}
html[data-theme="light"] .top-actions a[aria-current="page"] {
  color: #151917 !important;
}
.top-actions a:hover { color: #fff !important; background: rgba(127,127,127,.11) !important; }
html[data-theme="light"] .top-actions a.nav-action,
html[data-theme="light"] .top-actions a.back,
html[data-theme="light"] .top-actions #athletesLink {
  color: #666 !important;
}
html[data-theme="light"] .top-actions a:hover { color: #151917 !important; }
.top-actions a:active { transform: translateY(1px) !important; }
.top-actions a:focus-visible {
  outline: 2px solid currentColor !important;
  outline-offset: 2px !important;
}

/* ====== 容器顶部留白一致（内容区不碰） ====== */
.container {
  box-sizing: border-box !important;
  padding-top: 20px !important;
}

/* ====== ICP 备案页脚（法规要求悬挂） ====== */
.icp-footer { text-align: center; padding: 18px 12px 28px; font-size: 12px; color: #7a817d; }
.icp-footer a { color: inherit; text-decoration: none; }
.icp-footer a:hover { text-decoration: underline; }

/* ====== 手机端（≤680px）：logo 一行、导航项独占一行（超小屏行内滑动），
   不再允许换行堆叠——换行会让导航散成多行、顶出半屏高 ====== */
@media (max-width: 680px) {
  header .inner {
    gap: 2px 12px !important;
    min-height: 0 !important;
    height: auto !important;
    padding: 8px 12px 6px !important;
    flex-wrap: wrap !important;  /* 让导航容器换行独占一行，跟在 logo 下面 */
  }
  .wordmark,
  .brand,
  .brand h1 {
    font-size: 19px !important;
    min-height: 28px !important;
  }
  .top-actions {
    gap: 2px !important;
    flex-wrap: nowrap !important;    /* 导航项之间不换行 */
    width: 100% !important;          /* 独占一整行 */
    margin-left: 0 !important;
    overflow-x: auto !important;     /* 装不下时行内滑动，不撑破页面 */
    scrollbar-width: none !important;
  }
  .top-actions::-webkit-scrollbar { display: none; }
  .nav-action,
  a.back,
  #athletesLink {
    min-height: 30px !important;
    padding: 0 8px !important;
    font-size: 12.5px !important;
    flex-shrink: 0 !important;
  }
}
