/**
 * FlintHub — 轻量级 PHP 社区系统
 * 在线聊天室 — 全站悬浮入口样式
 * 位置：左下（避开右下 ai_bubble 的 right/bottom 20px + z-index 999）
 * 颜色/圆角全部走主题变量，禁止硬编码
 * @file plugins/chat_room/assets/widget.css
 * @version 2.1.0
 */

.cr-fab-wrap {
    position: fixed;
    left: 20px;
    bottom: calc(20px + env(safe-area-inset-bottom, 0px));
    z-index: 990;
    font-size: 13.5px;
    color: var(--mn-text, inherit);
}

.cr-fab {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border: 1px solid var(--mn-border, rgba(127, 127, 127, .25));
    border-radius: var(--mn-radius-lg, 50%);
    background: var(--mn-bg-card, #fff);
    color: var(--mn-primary, inherit);
    box-shadow: var(--mn-shadow, 0 6px 18px rgba(0, 0, 0, .16));
    cursor: pointer;
    transition: transform .15s ease, box-shadow .15s ease;
}

.cr-fab:hover {
    transform: translateY(-2px);
}

.cr-fab-icon {
    font-size: 22px;
    line-height: 1;
}

.cr-fab-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 999px;
    background: var(--mn-primary, #3b82f6);
    color: var(--mn-primary-contrast, #fff);
    font-size: 11px;
    line-height: 18px;
    text-align: center;
}

.cr-fab-panel {
    position: absolute;
    left: 0;
    bottom: calc(100% + 10px);
    width: 268px;
    max-height: 320px;
    overflow: auto;
    background: var(--mn-bg-card, #fff);
    border: 1px solid var(--mn-border, rgba(127, 127, 127, .25));
    border-radius: var(--mn-radius-lg, 12px);
    box-shadow: var(--mn-shadow, 0 10px 28px rgba(0, 0, 0, .18));
    padding: 10px;
}

.cr-fab-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
    gap: 8px;
}

.cr-fab-online {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: var(--mn-text-muted, inherit);
    font-size: 12px;
}

.cr-fab-online i {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--mn-success, #16a34a);
    display: inline-block;
}

.cr-fab-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.cr-fab-item {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 6px;
    align-items: baseline;
    padding: 5px 0;
    border-bottom: 1px dashed var(--mn-border, rgba(127, 127, 127, .2));
    font-size: 12.5px;
}

.cr-fab-item:last-child {
    border-bottom: 0;
}

.cr-fab-name {
    font-weight: 600;
    color: var(--mn-primary, inherit);
    white-space: nowrap;
}

.cr-fab-text {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--mn-text, inherit);
}

.cr-fab-item time {
    color: var(--mn-text-muted, inherit);
    font-size: 11px;
    white-space: nowrap;
}

.cr-fab-tip {
    padding: 8px 0;
    color: var(--mn-text-muted, inherit);
}

.cr-fab-more {
    display: block;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid var(--mn-border, rgba(127, 127, 127, .2));
    text-align: center;
    color: var(--mn-primary, inherit);
    text-decoration: none;
}

@media (max-width: 860px) {
    .cr-fab-wrap {
        left: 12px;
        bottom: calc(64px + env(safe-area-inset-bottom, 0px));
    }

    .cr-fab {
        width: 44px;
        height: 44px;
    }

    .cr-fab-panel {
        width: min(78vw, 268px);
    }
}
