/* ===== 通用樣式 ===== */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* 背景：線性漸層 */
body {
    height: 100vh;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: sans-serif;
    background: linear-gradient(90deg, #fec5e5, #b3f4d8, #b3d4f4);
}

/*
  為了電腦版(橫向螢幕)也能完整呈現名片，
  並保持長寬比例一致，新增兩個媒體查詢：
    - 螢幕 寬/高 >= 664/1129 (較寬): 以高度為主
    - 否則(較窄): 以寬度為主
*/
.card-container {
    max-width: 664px;
    max-height: 1129px;
    width: 70vw;
    height: auto;
}

@media (min-aspect-ratio: 664/1129) {
    .card-container {
        width: auto;
        height: 90vh;
    }
}

.card-container {
    /* 保持名片比例 */
    aspect-ratio: 664 / 1129;
    perspective: 1000px;
    position: relative;
    overflow: visible;
}

.card {
    width: 100%;
    height: 100%;
    transform-style: preserve-3d;
    /* 一開始顯示正面 */
    transform: rotateY(0deg) scale(1);
    transition: transform 0.5s ease;
    user-select: none;

    /* 外框或陰影 */
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4);
    border-radius: 10px;
    background-color: #fff;
}

.card-side {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    backface-visibility: hidden;
    border-radius: 10px;
}

/* 正面 */
.front {
    transform: rotateY(0deg);
}

/* 背面 (預設水平翻) */
.back {
    transform: rotateY(180deg);
}

.card-side img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 10px;
    -webkit-user-drag: none;
    user-drag: none;
}

/* Toast 樣式 */
.toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    background-color: rgba(0, 0, 0, 0.7);
    color: #fff;
    padding: 10px 15px;
    border-radius: 6px;
    opacity: 1;
    transition: opacity 0.5s ease;
    pointer-events: none; /* 避免遮擋點擊 */
    text-align: center;
    width: 250px;
}
