* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: "Microsoft YaHei", sans-serif;
}

body {
    background-color: #f0f4f8;
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 800px;
    margin: 0 auto;
}

.game-title {
    text-align: center;
    color: #2d3748;
    margin: 20px 0;
    font-size: 2.5rem;
}

.game-desc {
    background-color: white;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
    margin-bottom: 20px;
    line-height: 1.6;
    color: #4a5568;
}

.game-desc h3 {
    color: #2b6cb0;
    margin-bottom: 8px;
}

.game-stats {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: white;
    padding: 15px 25px;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
    margin-bottom: 25px;
    flex-wrap: wrap;
    gap: 15px;
}

.stat-item {
    font-size: 1.2rem;
    font-weight: 600;
    color: #2d3748;
}

.restart-btn {
    background-color: #2b6cb0;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.restart-btn:hover {
    background-color: #2c5282;
}

/* 卡片网格布局 */
.card-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
    perspective: 1000px;
}

/* 卡片3D翻转效果 */
.card {
    aspect-ratio: 1;
    position: relative;
    cursor: pointer;
    transform-style: preserve-3d;
    transition: transform 0.6s;
}

.card.flipped {
    transform: rotateY(180deg);
}

.card.matched {
    pointer-events: none;
    opacity: 0.8;
}

.card-face {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
}

.card-front {
    background-color: #2b6cb0;
    color: white;
}

.card-back {
    background-color: white;
    transform: rotateY(180deg);
}

/* 胜利弹窗 */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.6);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal.show {
    display: flex;
}

.modal-content {
    background-color: white;
    padding: 40px 60px;
    border-radius: 16px;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

.modal-content h2 {
    color: #2d3748;
    margin-bottom: 20px;
    font-size: 2rem;
}

.modal-content p {
    font-size: 1.2rem;
    color: #4a5568;
    margin-bottom: 10px;
}

.modal-content .restart-btn {
    margin-top: 20px;
    padding: 12px 30px;
    font-size: 1.1rem;
}

/* 电脑浏览器适配 */
@media (max-width: 768px) {
    .card-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    .card-face {
        font-size: 2rem;
    }
    .game-title {
        font-size: 2rem;
    }
}
