/* 桌面端页脚内容压到横幅底部；右侧快捷键入口由导航右侧留白避让 */
@media (min-width: 641px) {
  .xj-footer-hero { padding-bottom: 2px; }
}

/* 宽屏给右下角返回顶部与快捷键入口留出空间 */
@media (min-width: 1100px) {
  .xj-footer .xj-footer-nav { margin-right: 64px; }
}

/* 页脚左右贴边；版权与备案固定页面中心，右侧导航两行 */
.xj-footer .xj-footer-inner {
  position: relative;
  max-width: none;
  width: 100%;
  padding-left: 22px;
  padding-right: 22px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  column-gap: 28px;
}
.xj-footer .xj-footer-brand {
  grid-column: 1;
  justify-self: start;
}
.xj-footer .xj-footer-copy {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  flex: none;
  width: max-content;
  max-width: 100%;
  padding: 0;
}
.xj-footer .xj-footer-nav {
  grid-column: 2;
  justify-self: end;
  display: grid;
  grid-template-columns: repeat(4, max-content);
  justify-items: end;
  align-items: center;
  gap: 1px 18px;
  width: max-content;
}

@media (min-width: 641px) and (max-width: 999px) {
  .xj-footer .xj-footer-inner {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
      "brand nav"
      "copy copy";
    align-items: center;
    row-gap: 8px;
  }
  .xj-footer .xj-footer-brand { grid-area: brand; }
  .xj-footer .xj-footer-nav { grid-area: nav; }
  .xj-footer .xj-footer-copy {
    position: static;
    transform: none;
    grid-area: copy;
    justify-self: center;
    width: 100%;
    padding: 2px 0 0;
    text-align: center;
  }
}

@media (max-width: 640px) {
  .xj-footer .xj-footer-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 6px 18px 50px;
  }
  .xj-footer .xj-footer-brand { flex-direction: column; gap: 8px; }
  .xj-footer .xj-footer-brand-text { align-items: center; text-align: center; }
  .xj-footer .xj-footer-nav {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 2px 16px;
    width: 100%;
  }
  .xj-footer .xj-footer-copy {
    position: static;
    transform: none;
    order: 3;
    flex: 1 1 100%;
    width: 100%;
    padding: 6px 18px 0;
    text-align: center;
    white-space: normal;
  }
}

/* 备案号与版权行收紧为 2px，去掉全局 16px 上边距 */
.xj-footer .xj-footer-legal small { margin-top: 0; }

/* 品牌名下方公司名与上两行贴近 */
.xj-footer .xj-footer-brand-text small { margin-top: 2px; }

/* 手机横屏：品牌与导航同排，备案版权收成右下角一行 */
@media (orientation: landscape) and (max-height: 520px) {
  .xj-footer { margin-top: 36px; }
  .xj-footer-hero { padding: 14px 0 calc(10px + env(safe-area-inset-bottom)); -webkit-mask-image: linear-gradient(180deg, transparent 0, #000 28px); mask-image: linear-gradient(180deg, transparent 0, #000 28px); }
  .xj-footer .xj-footer-inner {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas: "brand nav" "legal legal";
    align-items: center;
    gap: 7px 20px;
    max-width: none;
    padding: 0 max(18px, env(safe-area-inset-right)) 0 max(18px, env(safe-area-inset-left));
  }
  .xj-footer-brand { grid-area: brand; gap: 10px; align-items: center; }
  .xj-footer-brand img { width: 38px; height: 38px; flex-basis: 38px; }
  .xj-footer-brand-text { min-height: 38px; }
  .xj-footer-brand-text strong { font-size: 14px; }
  .xj-footer-brand-text span { font-size: 11px; }
  .xj-footer-brand-text small { margin-top: 1px; font-size: 10.5px; }
  .xj-footer-nav { display: flex; grid-area: nav; flex: 0 0 auto; justify-content: flex-end; flex-wrap: nowrap; gap: 14px; }
  .xj-footer-nav a { padding: 3px 1px; font-size: 12px; white-space: nowrap; }
  .xj-footer-copy { position: static; transform: none; grid-area: legal; justify-self: center; align-self: end; display: block; padding: 0; text-align: center; width: 100%; }
  .xj-footer-copy .xj-footer-legal { flex-direction: row; justify-content: center; align-items: center; gap: 10px; }
  .xj-footer-copy small, .xj-footer-copy .xj-footer-icp { font-size: 10.5px; line-height: 1.2; }
  .xj-kb-pill { display: none; }
}

/* 页脚导航统一为普通文字，不再给「网站地图」单独加胶囊样式 */

/* 资料库归档页带左侧目录，页脚内容区整体右移；版权与备案按整页中心对齐 */
@media (min-width: 1101px) {
  .shell .xj-footer .xj-footer-copy { left: calc(50% - 116px); }
}
@media (min-width: 1000px) and (max-width: 1100px) {
  .shell .xj-footer .xj-footer-copy { left: calc(50% - 105px); }
  .shell .xj-footer .xj-footer-nav { grid-template-columns: repeat(3, max-content); }
}
