/**
 * 人生红点卡牌动画效果
 * 为专家辅助诊断系统提供流畅的动画过渡效果
 */

/* 淡入动画 */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-fade-in {
    animation: fadeIn 0.8s ease-out forwards;
}

/* 卡片翻转动画 */
@keyframes cardFlip {
    0% {
        transform: rotateY(0deg);
    }
    100% {
        transform: rotateY(180deg);
    }
}

/* 关键词标签动画 */
@keyframes tagAppear {
    0% {
        opacity: 0;
        transform: translateY(10px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

.keyword-tag {
    animation: tagAppear 0.5s ease-out forwards;
    opacity: 0;
}

/* 脉冲动画 */
@keyframes pulse {
    0% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(211, 47, 47, 0.4);
    }
    70% {
        transform: scale(1.05);
        box-shadow: 0 0 0 10px rgba(211, 47, 47, 0);
    }
    100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(211, 47, 47, 0);
    }
}

.pulse-animation {
    animation: pulse 2s infinite;
}

/* 加载动画 */
@keyframes spin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

.loading-spinner {
    width: 24px;
    height: 24px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s ease-in-out infinite;
    display: inline-block;
    margin-right: 10px;
    vertical-align: middle;
}

/* 成功消息动画 */
@keyframes slideIn {
    0% {
        transform: translateY(-100px);
        opacity: 0;
    }
    10% {
        transform: translateY(0);
        opacity: 1;
    }
    90% {
        transform: translateY(0);
        opacity: 1;
    }
    100% {
        transform: translateY(-100px);
        opacity: 0;
    }
}

.success-message {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(-100px);
    background-color: #4caf50;
    color: white;
    padding: 12px 24px;
    border-radius: 4px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    z-index: 1000;
    opacity: 0;
    display: flex;
    align-items: center;
    transition: transform 0.3s, opacity 0.3s;
}

.success-message.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

.success-message i {
    margin-right: 8px;
    font-size: 18px;
}

/* 打印消息动画 */
.print-message {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 20px 30px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    z-index: 1000;
}

/* 结果时间戳样式 */
.result-timestamp {
    text-align: center;
    color: #666;
    font-size: 0.9rem;
    margin-top: 2rem;
    padding-top: 1rem;
    border-top: 1px solid #eee;
}

.result-timestamp i {
    margin-right: 5px;
    color: #999;
}

/* 卡片悬停效果 */
.result-redpoint-card {
    transition: transform 0.3s, box-shadow 0.3s;
}

.result-redpoint-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.15);
}

/* 特性图标悬停效果 */
.characteristic-icon {
    transition: transform 0.3s, background-color 0.3s;
}

.characteristic-header:hover .characteristic-icon {
    transform: scale(1.1);
    background-color: rgba(211, 47, 47, 0.2);
}

/* 打印样式 */
@media print {
    body.printing * {
        visibility: hidden;
    }
    
    body.printing #result-container,
    body.printing #result-container * {
        visibility: visible;
    }
    
    body.printing #result-container {
        position: absolute;
        left: 0;
        top: 0;
        width: 100%;
        padding: 2rem;
    }
    
    body.printing .action-buttons,
    body.printing .navbar,
    body.printing .footer {
        display: none !important;
    }
    
    body.printing .result-redpoint-card,
    body.printing .analysis-section {
        box-shadow: none !important;
        margin: 2rem 0 !important;
        break-inside: avoid !important;
        border: 1px solid #ddd !important;
    }
}
