/* 在线状态徽章样式 */
.zib-avatar-with-status {
    position: relative;
    display: inline-block;
    vertical-align: middle;
}

.zib-online-badge {
    position: absolute;
    bottom: 0;
    left: 0;
    z-index: 100;
    transition: all 0.3s ease;
}

/* 小尺寸头像的徽章 */
.avatar-24 .zib-online-badge,
.avatar-32 .zib-online-badge {
    bottom: -2px;
    left: -2px;
}

/* 中尺寸头像的徽章 */
.avatar-48 .zib-online-badge,
.avatar-64 .zib-online-badge {
    bottom: 2px;
    left: 2px;
}

/* 大尺寸头像的徽章 */
.avatar-96 .zib-online-badge,
.avatar-120 .zib-online-badge {
    bottom: 5px;
    left: 5px;
}

.badge-dot {
    display: block;
    width: 12px;
    height: 12px;
    border: 2px solid #fff;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    transition: all 0.3s ease;
}

.badge-text {
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    white-space: nowrap;
    padding: 4px 8px;
    background: rgba(0,0,0,0.8);
    color: #fff;
    border-radius: 4px;
    font-size: 12px;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    margin-bottom: 5px;
}

.badge-text:after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 4px solid transparent;
    border-top-color: rgba(0,0,0,0.8);
}

.zib-online-badge:hover .badge-text {
    opacity: 1;
    visibility: visible;
}

/* 在线状态 */
.zib-online-badge.online .badge-dot {
    background: #44b549;
    animation: pulse 2s infinite;
}

.zib-online-badge.online .badge-text {
    background: #44b549;
}

.zib-online-badge.online .badge-text:after {
    border-top-color: #44b549;
}

/* 离线状态 */
.zib-online-badge.offline .badge-dot {
    background: #ccc;
}

.zib-online-badge.offline .badge-text {
    background: #999;
}

.zib-online-badge.offline .badge-text:after {
    border-top-color: #999;
}

/* 忙碌状态 */
.zib-online-badge.busy .badge-dot {
    background: #ff4757;
    animation: pulse-red 2s infinite;
}

/* 离开状态 */
.zib-online-badge.away .badge-dot {
    background: #ffa502;
}

/* 脉冲动画 */
@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(68, 181, 73, 0.4);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(68, 181, 73, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(68, 181, 73, 0);
    }
}

@keyframes pulse-red {
    0% {
        box-shadow: 0 0 0 0 rgba(255, 71, 87, 0.4);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(255, 71, 87, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(255, 71, 87, 0);
    }
}

/* 用户中心特定样式 */
.user-center-header .zib-online-badge {
    bottom: 10px;
    left: 10px;
}

.user-center-header .badge-dot {
    width: 16px;
    height: 16px;
    border-width: 3px;
}

/* 移动端适配 */
@media (max-width: 768px) {
    .zib-online-badge .badge-text {
        display: none;
    }
    
    .badge-dot {
        width: 10px;
        height: 10px;
    }
} 