footer {
    background-color: #f1f1f1;
    padding: 1em 0;
    width: 100%;
    bottom: 0;
    text-align: center;
    box-sizing: border-box;
}

/* 主容器：左右广告位 + 中间内容 */
.footer-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    min-height: 120px;
    padding: 16px 0;
    box-sizing: border-box;
}

/* 广告位 */
.footer-ad {
    flex: 2.5;
    text-align: center;
    overflow: hidden;
    min-width: 120px;
    min-height: 80px;
    background: transparent;
}

/* 主内容 */
.footer-content {
    flex: 5;
    text-align: center;
    box-sizing: border-box;
}

/* LA widget 占位（脚本注入前保留空间） */
.la-widget-placeholder {
    min-height: 1px;
    min-width: 120px;
    background: transparent;
    box-sizing: border-box;
}

/* 链接与行内段落样式 */
.footer-content p {
    margin: 0.2em 0;
}

.footer-content a {
    color: inherit;
    text-decoration: underline;
}

/* 分页/右侧等若需特殊样式可继续扩展 */

/* 移动端优化：一行显示、隐藏广告位、缩小字体并省略超长文本 */
@media (max-width: 480px) {
    footer { padding: 6px 4px; }
    .footer-container {
        display: flex;
        flex-direction: row;
        align-items: center;
        justify-content: center;
        gap: 8px;
        padding: 6px 8px;
    }

    /* 隐藏左右广告位，给主体留出空间 */
    .footer-ad {
        display: none !important;
    }

    /* 主体：每行保持单行（nowrap），但不使用省略号（由 JS 缩小字体以保证显示） */
    .footer-content {
        display: block;
        text-align: center;
        /* 初始/最大字体（JS 会在需要时缩小到 min 5px） */
        font-size: clamp(5px, 2.6vw, 12px) !important;
        line-height: 1 !important;
        white-space: nowrap !important;        /* 保持每个 <p> 为单行 */
        overflow: hidden !important;           /* 如果 JS 未能适配，超出部分隐藏 */
        /* 移除 text-overflow: ellipsis，以免出现省略号 */
        padding: 0 !important;
        margin: 0;
        width: calc(100% - 12px);
        box-sizing: border-box;
    }

    .footer-content p {
        display: block !important;             /* 每个段落在独立的一行 */
        margin: 0 0 4px 0 !important;
        padding: 0 !important;
        white-space: nowrap !important;
    }

    .footer-content a {
        display: inline-block !important;
        padding: 0 4px !important;
        margin: 0 !important;
        font-size: inherit !important;
        line-height: 1 !important;
        vertical-align: middle;
    }

    .la-widget-placeholder {
        display: none !important;
    }
}