/**
 * footer.css — Shared site footer styles
 * Provides the .site-footer block with brand + 备案 (ICP / 公网安备) links.
 *
 * Usage: link this file on every page that renders <footer class="site-footer">.
 * Works on three layout families:
 *   1. Page-header pages (.page-header + .page-body / .container-lg)
 *   2. Auth pages (body.auth-page — centered card on gradient background)
 *   3. Standalone centered pages (body.standalone-page — 404 / offline)
 */

/* ── Base footer ──────────────────────────────────────────────────────── */
/* No background or border — blends with the page's own background. */
.site-footer {
  flex-shrink: 0;
  width: 100%;
  padding: 14px 20px;
  text-align: center;
  font-family: "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 12px;
  color: #94a3b8;
  line-height: 1.7;
  box-sizing: border-box;
  opacity: 0.6;
}

.site-footer-beian {
  display: flex;
  flex-wrap: wrap;
  gap: 2px 14px;
  justify-content: center;
  align-items: center;
}

.site-footer-beian a {
  color: #94a3b8;
  text-decoration: none;
  transition: color .15s;
  white-space: nowrap;
}

.site-footer-beian a:hover {
  color: #1a56db;
  text-decoration: underline;
}

/* ── 公安备案 icon ─────────────────────────────────────────────────────── */
/* Append the MPS badge icon before the 公网安备 link via attribute selector,
   sized to match the surrounding text height. Pure CSS — no HTML change. */
.site-footer-beian a[href*="beian.gov.cn/portal"]::before {
  content: "";
  display: inline-block;
  width: 1.15em;
  height: 1.15em;
  background: url("https://beian.mps.gov.cn/web/resource/img/head-logo.png") center / contain no-repeat;
  vertical-align: middle;
  margin-right: 4px;
}

/* ── Pin footer to viewport bottom on short pages ────────────────────── */
/* On regular pages, make body a flex column so margin-top:auto pushes the
   footer to the bottom even when content is short. Auth/standalone pages
   already pin the footer via position:fixed, so they are excluded. */
body:not(.auth-page):not(.standalone-page) {
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
}

body:not(.auth-page):not(.standalone-page) .site-footer {
  margin-top: auto;
}

/* Leave room for the fixed .submit-bar (check / batch-change pages) so the
   footer isn't hidden behind it. */
body:has(.submit-bar) .site-footer {
  margin-bottom: 70px;
}
@media (max-width: 576px) {
  body:has(.submit-bar) .site-footer {
    margin-bottom: 110px;
  }
}

/* ── Auth pages (centered card on gradient background) ────────────────── */
/* Float the footer at the bottom of the viewport so it doesn't break the
   centered-card flex layout of body.auth-page. */
body.auth-page .site-footer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 10px 20px;
  color: rgba(255, 255, 255, .75);
}
body.auth-page .site-footer-beian a { color: rgba(255, 255, 255, .75); }
body.auth-page .site-footer-beian a:hover { color: #fff; }

/* Prevent the auth card from being hidden behind the fixed footer */
body.auth-page { padding-bottom: 72px; }

/* ── Standalone centered pages (404, offline) ─────────────────────────── */
/* These pages use a flex-column body with justify-content: center; the
   footer floats at the bottom of the viewport so the card stays centered. */
body.standalone-page .site-footer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 10px 20px;
}

@media (max-width: 480px) {
  .site-footer-beian { gap: 0px 10px; }
  .site-footer { padding: 12px 16px; }
}
