However only the line background is changed. Is that possible to change the background color of the whole code block? Even including the head and tail markers (```)
Not with syntax highlighting. That only provides inline styling. It would be possible to write a separate extension that, based on the parse tree, styles some lines with a background. (Do make sure to use a partially-transparent background, or you’ll hide the selection on those lines.)