/* ==========================================================================
   页面骨架与备案页脚
   --------------------------------------------------------------------------
   同样只管结构，颜色引用 theme.css 的变量，亮色/暗色共用一份。
   依赖：theme.css 需先加载
   ========================================================================== */

/* ---------- 可滚动的主体内容 ---------- */
.page-content {
    max-width: var(--page-max);
    margin: 0 auto;
    padding-bottom: 70px; /* 给固定页脚留出空间 */
}

/* 无页脚的页面（doc.html）不需要为固定页脚预留空间 */
.page-content--no-footer {
    padding-bottom: 0;
}

/* ---------- 固定底部页脚 ---------- */
.site-footer {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 100;

    background: var(--footer-bg);
    border-top: 1px solid var(--footer-border);
    /* 适配 iPhone 底部安全区 */
    padding: 16px 20px calc(16px + env(safe-area-inset-bottom));

    font-size: 13px;
    color: var(--footer-text);
    line-height: 1.9;
    text-align: center;

    /* 防止页脚内容过长时溢出 */
    max-height: 40vh;
    overflow-y: auto;
}

.site-footer a {
    color: var(--footer-text);
    text-decoration: none;
    transition: color 0.2s ease;
}

.site-footer a:hover {
    color: var(--footer-link-hover);
}

.footer-row {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 4px 16px;
}

.footer-divider {
    color: var(--footer-divider);
    user-select: none;
}

.footer-police {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.footer-police img {
    width: 16px;
    height: 16px;
    display: block;
}

/* ==========================================================================
   移动端适配
   ========================================================================== */
@media (max-width: 640px) {
    .page-content {
        padding-bottom: 100px; /* 手机端页脚更高，留更多空间 */
    }

    /* 无页脚的页面同样不需要预留 */
    .page-content--no-footer {
        padding-bottom: 0;
    }

    .site-footer {
        font-size: 12px;
        padding: 12px 14px calc(12px + env(safe-area-inset-bottom));
    }

    .footer-row {
        flex-direction: column;
        gap: 2px;
    }

    /* 竖排后分隔符无意义 */
    .footer-divider {
        display: none;
    }
}
