Gold edges up to Rs 31,585 on spot demand, global cues