/* ==================== 右側中央豎排淡入淡出文字 ==================== */
.animated-text-container {
    position: fixed;
    right: 40px; /* 右側位置 */
    top: 50%; /* 垂直置中 */
    transform: translateY(-50%); /* 垂直置中對齊 */
    height: auto;
    width: auto;
    max-height: 80vh; /* 限制最大高度 */
    display: flex;
    flex-direction: column; /* 改為垂直排列 */
    align-items: center;
    justify-content: center;
    margin: 0;
    z-index: 10;
    pointer-events: none;
}

.animated-text-item {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 20px;
    font-weight: 700;
    text-align: center;
    opacity: 0;
    transition: all 1.2s ease-in-out;
    
    /* 豎排設定 */
    writing-mode: vertical-rl; /* 改為豎排 */
    text-orientation: mixed;
    line-height: 1.8; /* 增加行高適應豎排 */
    letter-spacing: 0.1em; /* 增加字距適應豎排 */
    white-space: nowrap;
    
    /* 強制標楷體 */
    font-family: "標楷體", "BiauKai", "DFKai-SB", "KaiTi", "KaiTi TC", "STKaiti", serif;
    
    text-shadow: 0 2px 10px rgba(255, 107, 203, 0.3);
    /* 刪除所有背景和邊框設定 */
}

.animated-text-item.active {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

.animated-text-item.fade-out {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.9);
}

/* 分別處理文字和表情符號 */
.animated-text-item .text {
    /* 文字使用漸變色 */
    background: linear-gradient(135deg, #ff6bcb 0%, #ff8cd9 25%, #ffa8a8 50%, #ffd166 75%, #8bd3ff 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
}

.animated-text-item .emoji {
    /* 表情符號保持原色 */
    background: none !important;
    -webkit-text-fill-color: initial !important;
    color: inherit !important;
    display: inline-block;
}

/* 手機適配 - 改為豎排 */
@media (max-width: 768px) {
    .animated-text-container {
        right: 20px; /* 手機上右側位置稍小 */
        max-height: 70vh;
    }
    
    .animated-text-item {
        font-size: 16px;
        padding: 8px 6px; /* 調整內邊距適應豎排 */
        
        /* 確保保持豎排 */
        writing-mode: vertical-rl !important;
        text-orientation: mixed !important;
        line-height: 1.6;
    }
}

@media (max-width: 480px) {
    .animated-text-container {
        right: 15px;
    }
    
    .animated-text-item {
        font-size: 14px;
        padding: 6px 4px;
    }
}