/**
 * 登录页与 Shell 共用页脚：布局 + 按 data-admin-visual-theme 与各视觉主题融合。
 * 勿在模板内联样式。
 */

/* —— 登录页骨架 —— */
.login-body-with-footer {
    margin: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.login-body-with-footer .login-page {
    flex: 1;
    min-height: 0;
}

/* —— 主题令牌（默认：ocean_dark） —— */
.admin-portal-footer {
    --apf-surface: #0f172a;
    --apf-border: #334155;
    --apf-top-shine: rgba(148, 163, 184, 0.12);
    --apf-text: #e2e8f0;
    --apf-muted: #94a3b8;
    --apf-link: #38bdf8;
    --apf-link-hover: #7dd3fc;
    --apf-badge-bg: rgba(30, 41, 59, 0.85);
    --apf-badge-border: #475569;
    --apf-badge-text: #f1f5f9;
    --apf-legal-border: rgba(148, 163, 184, 0.2);

    flex-shrink: 0;
    width: 100%;
    padding: 0.85rem 1.25rem 1.1rem;
    font-size: 0.72rem;
    line-height: 1.5;
    color: var(--apf-muted);
    background: var(--apf-surface);
    border-top: 1px solid var(--apf-border);
    box-shadow: inset 0 1px 0 var(--apf-top-shine);
}

.admin-portal-footer__inner {
    max-width: 52rem;
    margin: 0 auto;
}

/* 顶行：版本徽标 | 公司+版权 | 官网 */
.admin-portal-footer__head {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.65rem 1rem;
    align-items: center;
    text-align: center;
}

@media (min-width: 40rem) {
    .admin-portal-footer__head {
        grid-template-columns: auto 1fr auto;
        text-align: unset;
    }

    .admin-portal-footer__identity {
        text-align: center;
    }

    .admin-portal-footer__actions {
        justify-self: end;
    }
}

.admin-portal-footer__badge {
    display: inline-flex;
    align-items: baseline;
    gap: 0.35rem;
    padding: 0.2rem 0.65rem 0.28rem;
    border-radius: 999px;
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.03em;
    background: var(--apf-badge-bg);
    border: 1px solid var(--apf-badge-border);
    color: var(--apf-badge-text);
    width: fit-content;
    margin: 0 auto;
}

@media (min-width: 40rem) {
    .admin-portal-footer__badge {
        margin: 0;
    }
}

.admin-portal-footer__badge--action {
    cursor: pointer;
    user-select: none;
}

.admin-portal-footer__badge--action:hover {
    filter: brightness(1.06);
}

.admin-portal-footer__badge--action:focus {
    outline: none;
}

.admin-portal-footer__badge--action:focus-visible {
    outline: 2px solid var(--apf-link);
    outline-offset: 2px;
}

.admin-portal-footer__badge-label {
    opacity: 0.82;
    font-weight: 500;
    font-size: 0.62rem;
    text-transform: uppercase;
}

.admin-portal-footer__badge-value {
    font-variant-numeric: tabular-nums;
}

.admin-portal-footer__identity {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 0.35rem 0.5rem;
    color: var(--apf-text);
    font-size: 0.74rem;
}

.admin-portal-footer__sep {
    display: none;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: var(--apf-muted);
    opacity: 0.55;
}

@media (min-width: 40rem) {
    .admin-portal-footer__sep {
        display: inline-block;
    }
}

/**
 * 站点名、公司名、版权行：同一字号与次要色（与 __copyright 一致）。
 */
.admin-portal-footer__site-name,
.admin-portal-footer__company,
.admin-portal-footer__copyright {
    font-size: 0.68rem;
    color: var(--apf-muted);
}

.admin-portal-footer__actions {
    display: flex;
    justify-content: center;
}

.admin-portal-footer__cta {
    display: inline-flex;
    align-items: center;
    padding: 0.28rem 0.75rem;
    border-radius: 8px;
    font-size: 0.72rem;
    font-weight: 600;
    text-decoration: none;
    color: var(--apf-link);
    border: 1px solid var(--apf-badge-border);
    background: var(--apf-badge-bg);
    transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

.admin-portal-footer__cta:hover {
    color: var(--apf-link-hover);
    border-color: var(--apf-link);
    background: var(--apf-badge-bg);
}

.admin-portal-footer__cta-host {
    font-weight: 500;
}

/* 联系信息 */
.admin-portal-footer__contact {
    margin: 0.65rem 0 0;
    padding-top: 0.65rem;
    border-top: 1px solid var(--apf-legal-border);
    text-align: center;
    font-size: 0.66rem;
    line-height: 1.6;
    color: var(--apf-muted);
}

/* 备案行 */
.admin-portal-footer__legal {
    margin: 0.5rem 0 0;
    padding: 0;
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 0.35rem 0.65rem;
    font-size: 0.64rem;
    color: var(--apf-muted);
}

.admin-portal-footer__legal-item {
    margin: 0;
}

.admin-portal-footer__legal-item:not(:last-child)::after {
    content: '·';
    margin-left: 0.65rem;
    opacity: 0.45;
}

a.admin-portal-footer__legal-link {
    color: inherit;
    text-decoration: underline;
    text-underline-offset: 0.12em;
}

a.admin-portal-footer__legal-link:hover {
    color: var(--apf-link);
}

/* ========== 按视觉主题融合（登录 body / Shell body 同源 data-admin-visual-theme） ========== */

/* ocean_dark */
body.login-body-with-footer[data-admin-visual-theme='ocean_dark'] .admin-portal-footer,
body.admin-shell[data-admin-visual-theme='ocean_dark'] > .admin-portal-footer {
    --apf-surface: #0f172a;
    --apf-border: #334155;
    --apf-top-shine: rgba(56, 189, 248, 0.1);
    --apf-text: #e2e8f0;
    --apf-muted: #94a3b8;
    --apf-link: #38bdf8;
    --apf-link-hover: #7dd3fc;
    --apf-badge-bg: rgba(30, 41, 59, 0.9);
    --apf-badge-border: #475569;
    --apf-badge-text: #f1f5f9;
    --apf-legal-border: rgba(51, 65, 85, 0.85);
}

/* slate_light */
body.login-body-with-footer[data-admin-visual-theme='slate_light'] .admin-portal-footer,
body.admin-shell[data-admin-visual-theme='slate_light'] > .admin-portal-footer {
    --apf-surface: #ffffff;
    --apf-border: #e2e8f0;
    --apf-top-shine: rgba(255, 255, 255, 0.95);
    --apf-text: #0f172a;
    --apf-muted: #64748b;
    --apf-link: #2563eb;
    --apf-link-hover: #1d4ed8;
    --apf-badge-bg: #f8fafc;
    --apf-badge-border: #cbd5e1;
    --apf-badge-text: #334155;
    --apf-legal-border: rgba(226, 232, 240, 0.95);
}

/* default-theme */
body.login-body-with-footer[data-admin-visual-theme='default-theme'] .admin-portal-footer,
body.admin-shell[data-admin-visual-theme='default-theme'] > .admin-portal-footer {
    --apf-surface: #0f172a;
    --apf-border: #334155;
    --apf-top-shine: rgba(64, 158, 255, 0.12);
    --apf-text: #e2e8f0;
    --apf-muted: #94a3b8;
    --apf-link: #60a5fa;
    --apf-link-hover: #93c5fd;
    --apf-badge-bg: rgba(30, 41, 59, 0.9);
    --apf-badge-border: #475569;
    --apf-badge-text: #f1f5f9;
    --apf-legal-border: rgba(51, 65, 85, 0.85);
}

/* dark-theme：登录页主区更深，Shell 仍为 ocean 底时页脚跟主内容 */
body.login-body-with-footer[data-admin-visual-theme='dark-theme'] .admin-portal-footer {
    --apf-surface: #020617;
    --apf-border: #1e3a5f;
    --apf-top-shine: rgba(96, 165, 250, 0.1);
    --apf-text: #e2e8f0;
    --apf-muted: #94a3b8;
    --apf-link: #60a5fa;
    --apf-link-hover: #93c5fd;
    --apf-badge-bg: rgba(15, 23, 42, 0.92);
    --apf-badge-border: #334155;
    --apf-badge-text: #f8fafc;
    --apf-legal-border: rgba(30, 58, 95, 0.75);
}

body.admin-shell[data-admin-visual-theme='dark-theme'] > .admin-portal-footer {
    --apf-surface: #0f172a;
    --apf-border: #334155;
    --apf-top-shine: rgba(96, 165, 250, 0.1);
    --apf-text: #e2e8f0;
    --apf-muted: #94a3b8;
    --apf-link: #60a5fa;
    --apf-link-hover: #93c5fd;
    --apf-badge-bg: rgba(30, 41, 59, 0.9);
    --apf-badge-border: #475569;
    --apf-badge-text: #f1f5f9;
    --apf-legal-border: rgba(51, 65, 85, 0.85);
}

/* light-blue-theme */
body.login-body-with-footer[data-admin-visual-theme='light-blue-theme'] .admin-portal-footer {
    --apf-surface: #0c1929;
    --apf-border: #2563a8;
    --apf-top-shine: rgba(147, 197, 253, 0.12);
    --apf-text: #e0f2fe;
    --apf-muted: #93c5fd;
    --apf-link: #93c5fd;
    --apf-link-hover: #bfdbfe;
    --apf-badge-bg: rgba(12, 25, 41, 0.88);
    --apf-badge-border: #3b6ba8;
    --apf-badge-text: #f0f9ff;
    --apf-legal-border: rgba(59, 107, 168, 0.55);
}

body.admin-shell[data-admin-visual-theme='light-blue-theme'] > .admin-portal-footer {
    --apf-surface: #0f172a;
    --apf-border: #334155;
    --apf-top-shine: rgba(147, 197, 253, 0.1);
    --apf-text: #e2e8f0;
    --apf-muted: #94a3b8;
    --apf-link: #93c5fd;
    --apf-link-hover: #bfdbfe;
    --apf-badge-bg: rgba(30, 41, 59, 0.9);
    --apf-badge-border: #475569;
    --apf-badge-text: #f1f5f9;
    --apf-legal-border: rgba(51, 65, 85, 0.85);
}

/* autumn-theme */
body.login-body-with-footer[data-admin-visual-theme='autumn-theme'] .admin-portal-footer,
body.admin-shell[data-admin-visual-theme='autumn-theme'] > .admin-portal-footer {
    --apf-surface: #1a0f08;
    --apf-border: #5c3d24;
    --apf-top-shine: rgba(253, 186, 116, 0.1);
    --apf-text: #fef3e2;
    --apf-muted: #d4a574;
    --apf-link: #fdba74;
    --apf-link-hover: #fed7aa;
    --apf-badge-bg: rgba(45, 31, 20, 0.92);
    --apf-badge-border: #6b4423;
    --apf-badge-text: #fff7ed;
    --apf-legal-border: rgba(92, 61, 36, 0.65);
}

/* grass-green-theme */
body.login-body-with-footer[data-admin-visual-theme='grass-green-theme'] .admin-portal-footer,
body.admin-shell[data-admin-visual-theme='grass-green-theme'] > .admin-portal-footer {
    --apf-surface: #0d1f12;
    --apf-border: #2e5c38;
    --apf-top-shine: rgba(165, 214, 167, 0.1);
    --apf-text: #e8f5e9;
    --apf-muted: #a5d6a7;
    --apf-link: #81c784;
    --apf-link-hover: #c8e6c9;
    --apf-badge-bg: rgba(27, 61, 36, 0.9);
    --apf-badge-border: #3d6b47;
    --apf-badge-text: #f1f8f4;
    --apf-legal-border: rgba(46, 92, 56, 0.65);
}

/* sakura-pink-theme */
body.login-body-with-footer[data-admin-visual-theme='sakura-pink-theme'] .admin-portal-footer,
body.admin-shell[data-admin-visual-theme='sakura-pink-theme'] > .admin-portal-footer {
    --apf-surface: #1a0a16;
    --apf-border: #831843;
    --apf-top-shine: rgba(249, 168, 212, 0.1);
    --apf-text: #fce7f3;
    --apf-muted: #f9a8d4;
    --apf-link: #f9a8d4;
    --apf-link-hover: #fbcfe8;
    --apf-badge-bg: rgba(74, 25, 66, 0.88);
    --apf-badge-border: #9d174d;
    --apf-badge-text: #fdf2f8;
    --apf-legal-border: rgba(131, 24, 67, 0.55);
}

/* cool-black-theme */
body.login-body-with-footer[data-admin-visual-theme='cool-black-theme'] .admin-portal-footer,
body.admin-shell[data-admin-visual-theme='cool-black-theme'] > .admin-portal-footer {
    --apf-surface: #0a0f1a;
    --apf-border: #2d3f5c;
    --apf-top-shine: rgba(90, 156, 248, 0.1);
    --apf-text: #e2e8f0;
    --apf-muted: #94a3b8;
    --apf-link: #5a9cf8;
    --apf-link-hover: #93c5fd;
    --apf-badge-bg: rgba(26, 39, 68, 0.92);
    --apf-badge-border: #3d4f6f;
    --apf-badge-text: #f1f5f9;
    --apf-legal-border: rgba(45, 63, 92, 0.65);
}

/* fire-red-theme */
body.login-body-with-footer[data-admin-visual-theme='fire-red-theme'] .admin-portal-footer,
body.admin-shell[data-admin-visual-theme='fire-red-theme'] > .admin-portal-footer {
    --apf-surface: #1c0a0a;
    --apf-border: #7f1d1d;
    --apf-top-shine: rgba(252, 165, 165, 0.1);
    --apf-text: #fee2e2;
    --apf-muted: #fca5a5;
    --apf-link: #fca5a5;
    --apf-link-hover: #fecaca;
    --apf-badge-bg: rgba(69, 10, 10, 0.9);
    --apf-badge-border: #991b1b;
    --apf-badge-text: #fef2f2;
    --apf-legal-border: rgba(127, 29, 29, 0.55);
}

/* golden-theme */
body.login-body-with-footer[data-admin-visual-theme='golden-theme'] .admin-portal-footer,
body.admin-shell[data-admin-visual-theme='golden-theme'] > .admin-portal-footer {
    --apf-surface: #1c1004;
    --apf-border: #78350f;
    --apf-top-shine: rgba(252, 211, 77, 0.1);
    --apf-text: #fef3c7;
    --apf-muted: #fcd34d;
    --apf-link: #fcd34d;
    --apf-link-hover: #fde68a;
    --apf-badge-bg: rgba(66, 32, 6, 0.9);
    --apf-badge-border: #92400e;
    --apf-badge-text: #fffbeb;
    --apf-legal-border: rgba(120, 53, 15, 0.55);
}

/* metal-theme */
body.login-body-with-footer[data-admin-visual-theme='metal-theme'] .admin-portal-footer,
body.admin-shell[data-admin-visual-theme='metal-theme'] > .admin-portal-footer {
    --apf-surface: #141414;
    --apf-border: #404040;
    --apf-top-shine: rgba(212, 212, 212, 0.08);
    --apf-text: #e5e5e5;
    --apf-muted: #a3a3a3;
    --apf-link: #d4d4d4;
    --apf-link-hover: #fafafa;
    --apf-badge-bg: rgba(45, 45, 45, 0.92);
    --apf-badge-border: #525252;
    --apf-badge-text: #fafafa;
    --apf-legal-border: rgba(64, 64, 64, 0.75);
}

/* retro-poster-theme */
body.login-body-with-footer[data-admin-visual-theme='retro-poster-theme'] .admin-portal-footer,
body.admin-shell[data-admin-visual-theme='retro-poster-theme'] > .admin-portal-footer {
    --apf-surface: #1a0d04;
    --apf-border: #7c2d12;
    --apf-top-shine: rgba(253, 186, 116, 0.12);
    --apf-text: #ffedd5;
    --apf-muted: #fdba74;
    --apf-link: #fdba74;
    --apf-link-hover: #fed7aa;
    --apf-badge-bg: rgba(66, 32, 6, 0.9);
    --apf-badge-border: #9a3412;
    --apf-badge-text: #fff7ed;
    --apf-legal-border: rgba(124, 45, 18, 0.55);
}

/* starry-purple-theme */
body.login-body-with-footer[data-admin-visual-theme='starry-purple-theme'] .admin-portal-footer,
body.admin-shell[data-admin-visual-theme='starry-purple-theme'] > .admin-portal-footer {
    --apf-surface: #0f0518;
    --apf-border: #5b21b6;
    --apf-top-shine: rgba(196, 181, 253, 0.1);
    --apf-text: #ede9fe;
    --apf-muted: #c4b5fd;
    --apf-link: #c4b5fd;
    --apf-link-hover: #ddd6fe;
    --apf-badge-bg: rgba(46, 16, 101, 0.88);
    --apf-badge-border: #6d28d9;
    --apf-badge-text: #f5f3ff;
    --apf-legal-border: rgba(91, 33, 182, 0.5);
}

/* tech-silver-theme */
body.login-body-with-footer[data-admin-visual-theme='tech-silver-theme'] .admin-portal-footer,
body.admin-shell[data-admin-visual-theme='tech-silver-theme'] > .admin-portal-footer {
    --apf-surface: #0a0a0a;
    --apf-border: #404040;
    --apf-top-shine: rgba(163, 163, 163, 0.08);
    --apf-text: #e5e5e5;
    --apf-muted: #a3a3a3;
    --apf-link: #a3a3a3;
    --apf-link-hover: #d4d4d4;
    --apf-badge-bg: rgba(38, 38, 38, 0.92);
    --apf-badge-border: #525252;
    --apf-badge-text: #fafafa;
    --apf-legal-border: rgba(64, 64, 64, 0.75);
}

/* windows-xp-theme */
body.login-body-with-footer[data-admin-visual-theme='windows-xp-theme'] .admin-portal-footer,
body.admin-shell[data-admin-visual-theme='windows-xp-theme'] > .admin-portal-footer {
    --apf-surface: #082f49;
    --apf-border: #0369a1;
    --apf-top-shine: rgba(125, 211, 252, 0.12);
    --apf-text: #e0f2fe;
    --apf-muted: #7dd3fc;
    --apf-link: #7dd3fc;
    --apf-link-hover: #bae6fd;
    --apf-badge-bg: rgba(12, 74, 110, 0.88);
    --apf-badge-border: #0284c7;
    --apf-badge-text: #f0f9ff;
    --apf-legal-border: rgba(3, 105, 161, 0.5);
}
