/* 与首页统一的深蓝渐变页脚（供未加载 xj-theme 的独立应用页使用） */
.xj-footer {
  margin-top: 64px;
  border-top: 0;
  color: rgba(255, 255, 255, 0.72);
  background: linear-gradient(180deg,
    var(--paper, #fbfaf5) 0px,
    #0d2347 18px,
    #000 100%) !important;
  background-color: transparent !important;
  padding: 0 !important;
  font-family: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
}

/* 学生/教学中心公开登录页以深色品牌区收尾：页脚顶部沿用画面底色收口，去掉突兀的白纸渐变带 */
html[data-dark="0"] body[data-xj-page="student"]:has(#loginView:not([hidden])) .xj-footer,
html[data-dark="0"] body[data-xj-page="teacher"]:has(#loginPage:not(.hidden)) .xj-footer {
  background: linear-gradient(180deg,
    #08151d 0px,
    #06121a 26px,
    #000 100%) !important;
}
.xj-footer-hero {
  position: relative;
  overflow: hidden;
  padding: 22px 0 42px;
  -webkit-mask-image: linear-gradient(180deg, transparent 0, #000 40px);
  mask-image: linear-gradient(180deg, transparent 0, #000 40px);
}
.xj-footer-hero::before {
  content: "";
  position: absolute; left: 0; right: 0; bottom: 0;
  height: 46px;
  background:
    radial-gradient(120px 34px at 12% 100%, rgba(255, 255, 255, 0.07), transparent 70%),
    radial-gradient(180px 40px at 38% 100%, rgba(255, 255, 255, 0.05), transparent 70%),
    radial-gradient(140px 32px at 64% 100%, rgba(255, 255, 255, 0.06), transparent 70%),
    radial-gradient(200px 44px at 88% 100%, rgba(255, 255, 255, 0.05), transparent 70%);
  pointer-events: none;
}
.xj-footer-inner {
  position: relative;
  width: 100%;
  margin: 0 auto;
  padding: 0 22px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  column-gap: 28px;
}
.xj-footer-brand { display: flex; align-items: center; gap: 13px; min-width: 0; grid-column: 1; justify-self: start; }
.xj-footer-brand img { width: 46px; height: 46px; object-fit: contain; flex: 0 0 46px; }
.xj-footer-brand-text { display: flex; flex-direction: column; justify-content: center; align-items: flex-start; gap: 1px; height: auto; min-height: 46px; line-height: 1.2; min-width: 0; text-align: left; }
.xj-footer-brand-text strong { margin: 0; font-size: 15.5px; line-height: 1.2; color: #fff; letter-spacing: 0.01em; white-space: nowrap; }
.xj-footer-brand-text span { margin: 0; font-size: 12px; line-height: 1.2; color: rgba(255, 255, 255, 0.55); }
.xj-footer-brand-text small { display: block; margin: 2px 0 0; font-size: 11.5px; line-height: 1.2; color: rgba(255, 255, 255, 0.48); letter-spacing: 0.01em; }
.xj-footer-copy {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  flex: none;
  width: max-content; max-width: 100%;
  min-width: 0; margin: 0; padding: 0;
  border-top: 0; text-align: center; white-space: nowrap;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0;
}
.xj-footer-legal { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-width: 0; margin: 0; padding: 0; }
.xj-footer-copy small { color: rgba(255, 255, 255, 0.42); font-size: 12px; line-height: 1.35; }
.xj-footer-icp { display: block; color: rgba(255, 255, 255, 0.42); font: inherit; font-size: 11.5px; line-height: 1.3; letter-spacing: .02em; text-decoration: none; }
.xj-footer-icp:hover { color: rgba(255, 255, 255, 0.68); text-decoration: none; }
.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;
}
.xj-footer-nav a {
  position: relative;
  color: rgba(255, 255, 255, 0.66);
  font-size: 13.5px;
  text-decoration: none;
  padding: 4px 2px;
  transition: color 0.2s ease;
}
.xj-footer-nav a::after {
  content: "";
  position: absolute; left: 50%; bottom: 0; width: 0; height: 2px;
  background: var(--xj-gnav-accent, #1d5d9b);
  transform: translateX(-50%);
  transition: width 0.22s ease;
}
.xj-footer-nav a:hover { color: #fff; }
.xj-footer-nav a:hover::after { width: 100%; }
@media (max-width: 640px) {
  .xj-footer-hero { padding: 18px 0 16px; }
  .xj-footer-inner { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 14px; padding: 6px 18px 4px; }
  .xj-footer-brand { flex-direction: column; gap: 8px; }
  .xj-footer-brand-text { align-items: center; text-align: center; }
  .xj-footer-nav { display: flex; flex-wrap: wrap; justify-content: center; gap: 2px 16px; width: 100%; }
  .xj-footer-copy { position: static; transform: none; flex: 1 1 100%; order: 3; width: 100%; padding: 6px 18px 0; white-space: normal; }
}
@media (min-width: 641px) and (max-width: 999px) {
  .xj-footer-inner {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
      "brand nav"
      "copy copy";
    row-gap: 8px;
  }
  .xj-footer-brand { grid-area: brand; }
  .xj-footer-nav { grid-area: nav; }
  .xj-footer-copy { position: static; transform: none; grid-area: copy; justify-self: center; width: 100%; padding: 2px 0 0; }
}

/* 短页面页脚贴底：内容不足一屏时页脚贴住视口底部，避免悬空 */
body:has(> .xj-footer) {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}
body:has(> .xj-footer) > .xj-footer {
  margin-top: auto;
  flex-shrink: 0;
}

/* 夜间模式：去掉页脚顶部与页面底色的浅色过渡带，整段直接深蓝 */
html[data-theme="dark"] .xj-footer,
html[data-dark="1"] .xj-footer {
  background: linear-gradient(180deg, #0d2347 0, #000 100%) !important;
}
html[data-theme="dark"] .xj-footer-hero,
html[data-dark="1"] .xj-footer-hero {
  -webkit-mask-image: none;
  mask-image: none;
}

/* 教学中心登录页原本按整屏高度撑开，会把页脚顶到下一屏，改由 flex 分配空间 */
body:has(> .xj-footer) .loginPage {
  min-height: 0;
  flex: 1 0 auto;
}

@media (min-width: 1100px) {
  .xj-footer-nav { margin-right: 64px; }
}

/* 页脚底部不再叠白色光斑，保持纯黑收口 */
.xj-footer .xj-footer-hero::before { display: none !important; }
