/* 备案信息直接写在页面 HTML 中，无需登录或执行 JavaScript。 */
.site-footer {
    position: relative;
    z-index: 1;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 4px 20px;
    width: 100%;
    margin-top: 32px;
    padding: 16px 12px max(16px, env(safe-area-inset-bottom));
    box-sizing: border-box;
    border-top: 1px solid rgba(148, 163, 184, 0.15);
    color: #94a3b8;
    font: 12px/1.8 "Microsoft YaHei", "Noto Sans SC", sans-serif;
    text-align: center;
}

.site-footer a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 28px;
    color: inherit;
    text-decoration: none;
    cursor: pointer;
}

.site-footer a:hover,
.site-footer a:focus-visible {
    color: #f8fafc;
    text-decoration: underline;
    text-underline-offset: 4px;
}

.site-footer a:focus-visible {
    outline: 2px solid currentColor;
    outline-offset: 4px;
    border-radius: 2px;
}

.site-footer img {
    flex: 0 0 20px;
    width: 20px;
    height: 20px;
    object-fit: contain;
}

/* 工牌与页脚使用正常文档流，矮屏可以滚动，不遮挡登录按钮。 */
body.auth-with-footer {
    flex-direction: column;
    justify-content: flex-start;
    gap: 32px;
    height: auto;
    min-height: 100vh;
    min-height: 100svh;
    width: 100%;
    overflow-x: hidden;
    overflow-y: auto;
    padding-top: 32px;
}

body.auth-with-footer > .badge-container {
    flex-shrink: 0;
    margin: auto 0;
}

body.auth-with-footer > .site-footer {
    flex-shrink: 0;
    margin-top: 0;
}

/* 保持登录成功时工牌铺满屏幕的原有过场。 */
body.auth-with-footer:has(> .badge-container.expanded) {
    padding-top: 0;
    gap: 0;
    height: 100vh;
    overflow: hidden;
}

body.auth-with-footer:has(> .badge-container.expanded) > .site-footer {
    display: none;
}

@media print {
    .site-footer { display: none; }
}

/* 站内浅色页面与深色页面共用结构。 */
.site-footer--light { color: #64748b; border-top-color: #e2e8f0; }
.site-footer--light a:hover,
.site-footer--light a:focus-visible { color: #334155; }
.site-footer-embedded .site-footer { display: none; }

:root { --site-footer-height: 34px; }
@media (max-width: 380px) {
    :root { --site-footer-height: 62px; }
}

/* 内容较少时贴近屏幕底部；长页面随正文滚动到末尾。 */
html:not(.site-footer-embedded) body[data-site-footer="flow"] {
    position: relative;
    box-sizing: border-box;
    min-height: 100vh;
    min-height: 100dvh;
    padding-bottom: calc(32px + var(--site-footer-height));
}
html:not(.site-footer-embedded) [data-site-footer="flow"] > .site-footer {
    position: absolute;
    left: 0;
    bottom: 0;
    margin: 0;
}

/* 全屏应用的内容区与备案栏分开，导航、输入框不会压在备案链接上。 */
html:not(.site-footer-embedded) body.site-footer-viewport {
    height: calc(100vh - var(--site-footer-height));
    height: calc(100dvh - var(--site-footer-height));
    min-height: 0;
}
html:not(.site-footer-embedded) .site-footer-viewport > .site-footer {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 60;
    margin: 0;
    padding: 2px 8px calc(2px + env(safe-area-inset-bottom));
    gap: 0 16px;
    background: #0b1120;
}
html:not(.site-footer-embedded) .site-footer-viewport > .site-footer--light {
    background: #f8fafc;
}
html:not(.site-footer-embedded) [data-site-footer="sheet"] .nav-bar {
    bottom: var(--site-footer-height);
}
html:not(.site-footer-embedded) [data-site-footer="office"] .office-wrap,
html:not(.site-footer-embedded) [data-site-footer="chat"] .chat-container {
    height: 100%;
}
html:not(.site-footer-embedded) [data-site-footer="office"] .office-legend {
    bottom: calc(16px + var(--site-footer-height));
}
html:not(.site-footer-embedded) [data-site-footer="desktop"] .taskbar {
    bottom: var(--site-footer-height);
}
html:not(.site-footer-embedded) [data-site-footer="desktop"] .appwin {
    bottom: calc(48px + var(--site-footer-height));
}
html:not(.site-footer-embedded) [data-site-footer="desktop"] .profile-pop,
html:not(.site-footer-embedded) [data-site-footer="desktop"] .dwin {
    bottom: calc(62px + var(--site-footer-height));
    max-height: calc(100dvh - 130px - var(--site-footer-height));
}
@media (max-width: 860px) {
    html:not(.site-footer-embedded) [data-site-footer="desktop"] #maDock {
        bottom: calc(12px + var(--site-footer-height));
    }
    html:not(.site-footer-embedded) [data-site-footer="desktop"] #maDots {
        bottom: calc(86px + var(--site-footer-height));
    }
    html:not(.site-footer-embedded) [data-site-footer="desktop"] .dicons {
        bottom: calc(130px + var(--site-footer-height));
    }
    html:not(.site-footer-embedded) [data-site-footer="desktop"] .cards,
    html:not(.site-footer-embedded) [data-site-footer="desktop"] .appwin,
    html:not(.site-footer-embedded) [data-site-footer="desktop"] .appwin#winDocs.windowed,
    html:not(.site-footer-embedded) [data-site-footer="desktop"] .dwin,
    html:not(.site-footer-embedded) [data-site-footer="desktop"] .profile-pop {
        bottom: var(--site-footer-height) !important;
        max-height: none !important;
    }
}
@media print {
    html:not(.site-footer-embedded) .site-footer-viewport > .site-footer { display: none; }
    html:not(.site-footer-embedded) body.site-footer-viewport { height: auto; }
}
