/**
 * 用户在线状态样式
 */

/* 用户头像容器 */
.user-avatar-wrapper {
    position: relative;
    display: inline-block;
    line-height: 0;
}

.user-avatar-wrapper .user-avatar {
    display: block;
    border-radius: 50%;
    object-fit: cover;
}

/* 在线状态指示器 */
.online-status-indicator {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 2px solid #fff;
    box-shadow: 0 0 4px rgba(0,0,0,0.2);
    z-index: 1;
    cursor: pointer;
}

.online-status-indicator.online {
    background: #10b981; /* 绿色 */
    animation: pulse-online 2s ease-in-out infinite;
}

.online-status-indicator.offline {
    background: #9ca3af; /* 灰色 */
}

/* 在线状态脉冲动画 */
@keyframes pulse-online {
    0%, 100% {
        box-shadow: 0 0 4px rgba(0,0,0,0.2), 0 0 0 0 rgba(16, 185, 129, 0.7);
    }
    50% {
        box-shadow: 0 0 4px rgba(0,0,0,0.2), 0 0 0 4px rgba(16, 185, 129, 0);
    }
}

/* 不同尺寸的指示器 */
.user-avatar-wrapper.size-small .online-status-indicator {
    width: 8px;
    height: 8px;
    border-width: 1.5px;
}

.user-avatar-wrapper.size-medium .online-status-indicator {
    width: 10px;
    height: 10px;
    border-width: 2px;
}

.user-avatar-wrapper.size-large .online-status-indicator {
    width: 16px;
    height: 16px;
    border-width: 3px;
}

/* 悬停效果 */
.online-status-indicator:hover {
    transform: scale(1.2);
    transition: transform 0.2s;
}

/* 移动端适配 */
@media (max-width: 768px) {
    .online-status-indicator {
        width: 10px;
        height: 10px;
        border-width: 1.5px;
    }
    
    .user-avatar-wrapper.size-small .online-status-indicator {
        width: 6px;
        height: 6px;
        border-width: 1px;
    }
    
    .user-avatar-wrapper.size-large .online-status-indicator {
        width: 14px;
        height: 14px;
        border-width: 2.5px;
    }
}

/* 特殊场景适配 */

/* 帖子列表作者头像 */
.post-item .meta-avatar-wrapper {
    vertical-align: middle;
}

/* 评论列表头像 */
.comment-avatar-wrapper {
    flex-shrink: 0;
}

/* 排行榜头像 */
.ranking-item-avatar .user-avatar-wrapper,
.top3-avatar .user-avatar-wrapper {
    display: block;
}

/* 私信列表头像 */
.conv-avatar-wrapper {
    flex-shrink: 0;
}

/* 用户卡片头像 */
.user-card-avatar .user-avatar-wrapper {
    display: block;
    margin: 0 auto;
}
