css tranaform z轴平移 但是无效

图一是hover效果

img

图二是未hover效果

img

完整代码

//代码
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        .box{
            perspective: 800px;
            border: 1px solid black;
        }
        .yy{
            width:200px;
            height: 300px;
            background: #FF0000;
            margin: 100px auto;
            transition: all 0.3s;
        }
        .yy:hover{
            box-shadow: 0 0 40px #000000;
            opacity: .2;
            transform: translate3d(0, 0, 400px);
        } 
    </style>
</head>
<body>
    <div class="box">
        <div class="yy"></div>
    </div>
</body>
</html>

这个是生效了的,只不过Z轴就是和屏幕垂直的方向,所以看不到;
写成3D的才能看到效果