这个hover移出时没有动画怎么解决呀

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
</head>
<style>
* {}
.mainBox {
background: url(./img/01.jpg);
width: 590px;
height: 470px;
position: relative;
/* overflow: hidden; */
}
.mainBox::after {
content: "买家电上京东,政府补贴,最高20%";
font-size: 20px;
color: aliceblue;
background: #069aa6;
width: 100%;
position: absolute;
bottom: -9%;
text-align: center;
display: block;
padding: 10px 0;
transition: bottom 1s;
}
.mainBox:hover::after {
transition: bottom 1s;
animation: loopShow .5s ease-out;
animation-fill-mode: forwards;
opacity: 1;
transition: bottom 1s;
/* bottom: 0; */
}
@keyframes loopShow {
from {
bottom: -9%;
}
to {
bottom: 0;
}
}
</style>
<body>
<div class="mainBox">
<!-- <p>买家电上京东,政府补贴,最高20%</p> -->
</div>
</body>
</html>