/* 3D 翻轉核心樣式 */
.transform-style-3d {
    transform-style: preserve-3d;
    perspective: 1000px;
}

.backface-hidden {
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
}

.rotate-y-180 {
    transform: rotateY(180deg);
}

/* 當卡片被點擊翻轉時 */
#loveCard.is-flipped {
    transform: rotateY(180deg);
}

/* 滑動切換動畫 */
@keyframes slideOutLeft {
    0% {
        transform: translateX(0) rotate(0deg);
        opacity: 1;
    }
    100% {
        transform: translateX(-150%) rotate(-15deg);
        opacity: 0;
    }
}

@keyframes slideOutRight {
    0% {
        transform: translateX(0) rotate(0deg);
        opacity: 1;
    }
    100% {
        transform: translateX(150%) rotate(15deg);
        opacity: 0;
    }
}

@keyframes slideInRight {
    0% {
        transform: translateX(150%) rotate(15deg);
        opacity: 0;
    }
    100% {
        transform: translateX(0) rotate(0deg);
        opacity: 1;
    }
}

@keyframes slideInLeft {
    0% {
        transform: translateX(-150%) rotate(-15deg);
        opacity: 0;
    }
    100% {
        transform: translateX(0) rotate(0deg);
        opacity: 1;
    }
}

.slide-out-left {
    animation: slideOutLeft 0.35s cubic-bezier(0.25, 1, 0.5, 1) forwards;
}

.slide-out-right {
    animation: slideOutRight 0.35s cubic-bezier(0.25, 1, 0.5, 1) forwards;
}

.slide-in-right {
    animation: slideInRight 0.35s cubic-bezier(0.25, 1, 0.5, 1) forwards;
}

.slide-in-left {
    animation: slideInLeft 0.35s cubic-bezier(0.25, 1, 0.5, 1) forwards;
}

/* 手機端優化：禁用雙擊縮放，並優化滾動與觸控 */
button, a, input, label {
    touch-action: manipulation;
}

/* 滾動條美化 */
#favoritesList::-webkit-scrollbar {
    width: 4px;
}

#favoritesList::-webkit-scrollbar-track {
    background: transparent;
}

#favoritesList::-webkit-scrollbar-thumb {
    background: #fecdd3;
    border-radius: 9999px;
}

#favoritesList::-webkit-scrollbar-thumb:hover {
    background: #fda4af;
}

/* 卡片陰影與微調 */
#loveCard {
    box-shadow: 0 15px 35px -5px rgba(244, 63, 94, 0.15), 0 5px 15px -5px rgba(0, 0, 0, 0.05);
}

#loveCard.is-flipped {
    box-shadow: 0 15px 35px -5px rgba(0, 0, 0, 0.08), 0 5px 15px -5px rgba(0, 0, 0, 0.04);
}

@keyframes rpCardEnter {
    0% {
        transform: translateY(18px) scale(0.96);
        opacity: 0;
    }
    100% {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
}

.rp-card-enter {
    animation: rpCardEnter 0.35s cubic-bezier(0.25, 1, 0.5, 1);
}

.rp-timer-pulse {
    animation: rpTimerPulse 1s ease-in-out infinite;
}

@keyframes rpTimerPulse {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.7;
        transform: scale(1.04);
    }
}

#secretOverlay,
#reviewModal {
    touch-action: manipulation;
}

.scale-slider {
    accent-color: #f59e0b;
    height: 6px;
}

.scale-slider::-webkit-slider-thumb {
    cursor: pointer;
}

.hex-block {
    text-align: center;
}

.hex-lines {
    display: inline-flex;
    flex-direction: column;
    gap: 6px;
    min-width: 72px;
}

.hex-line-row {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 10px;
}

.hex-yang {
    width: 56px;
    height: 6px;
    border-radius: 2px;
    background: #334155;
}

.hex-yin-seg {
    width: 22px;
    height: 6px;
    border-radius: 2px;
    background: #334155;
}

.hex-yin-gap {
    width: 12px;
}

.hex-line-changing .hex-yang,
.hex-line-changing .hex-yin-seg {
    background: #0d9488;
}

.hex-change-mark {
    position: absolute;
    right: -14px;
    font-size: 10px;
    color: #0d9488;
    font-weight: 700;
    line-height: 1;
}
