﻿.card-container {
    perspective: 1000px; /* 关键：为 3D 翻转提供透视 */
    width: 300px;
    height: 400px;
    margin: 50px auto;
}
.card {
    position: relative;
    width: 100%;
    height: 100%;
    transition: transform 0.6s;
    transform-style: preserve-3d;
    cursor: pointer;
}
.card.flipped {
    transform: rotateY(180deg); /* 翻转 180 度 */
}
.card-face {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden; /* 隐藏背面 */
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    border-radius: 16px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    padding: 20px;
    text-align: center;
    font-family: sans-serif;
    box-sizing: border-box; /* 确保 padding 不撑大尺寸 */
}
.card-front {
    background: #f0f4ff;
    color: #1a1a1a;
}
.card-back {
    background: #e0f7fa;
    color: #006064;
    transform: rotateY(180deg); /* 背面预先翻转 */
}
.controls {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 20px;
}
button {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    background: #007bff;
    color: white;
    cursor: pointer;
    font-size: 16px;
}
button:hover { background: #0056b3; }