* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    transition: 1s;
    user-select: none;
}

.box {
    /* margin: 50px auto; */

    position: relative;
    perspective: 500px;
    /* margin-bottom: 20px;
    max-width: 400px; */
}

img {
    width: 100%;
    height: 100%;
    display: block;
    border-radius: 10px;
}

.box .front {
    width: 100%;
    height: 100%;
    position: absolute;
    transform-style: preserve-3d;
    backface-visibility: hidden;

    /* z-index: 999; */
}

.box .front div {
    height: 50%;
    text-align: center;
    position: absolute;
    /* width: 100%; */
    color: aliceblue;
    left: 50%;
    backface-visibility: hidden;

    transform: translate3d(-50%, 0, 60px);

}

.box .front div:nth-child(1) {
    border-bottom: 2px solid rgba(255, 255, 255, 0.5);
    padding-top: 30%;
    font-size: 25px;
    color: rgb(255, 255, 255);
    font-weight: bold;
}

.box .front div:nth-child(2) {
    top: 50%;
    padding-top: 15px;
    color: rgb(255, 255, 255);
    font-weight: bold;
}

.box .back {
    width: 100%;
    height: 100%;
    background: linear-gradient(35deg, rgb(205, 231, 227), rgb(87, 103, 105));
    border-radius: 10px;
    transform: rotateY(180deg);
    transform-style: preserve-3d;
    backface-visibility: hidden;
}

.box .back div {
    transform: translateZ(60px);
    backface-visibility: hidden;
    padding: 20px 60px;
    color: aliceblue;
}

/* 桌面：鼠标悬停翻转 */
@media (hover: hover) and (pointer: fine) {
    .box:hover .front {
        transform: rotateY(-180deg);
    }

    .box:hover .back {
        transform: rotateY(0deg);
    }
}

/* 手机/触摸：点击后由 JS 加上 is-flipped */
.box.is-flipped .front {
    transform: rotateY(-180deg);
}

.box.is-flipped .back {
    transform: rotateY(0deg);
}

@media (max-width: 768px) {
    .box {
        height: 300px;
    }
    .box .front div:nth-child(1) {
        border-bottom: 2px solid rgba(255, 255, 255, 0.5);
        padding-top: 100px;
        font-size: 25px;
    }
}