/**
 * 人生红点自我诊断法 - 样式表
 * 提供自我诊断页面的专属样式
 */

/* 表格动画效果 */
.self-diagnosis-table {
    animation: fadeIn 0.8s ease-in-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* 表格行悬停效果 */
#redpoint-questions tbody tr:hover {
    background-color: rgba(211, 47, 47, 0.05);
    transition: background-color 0.3s ease;
}

/* 文本框字数统计 */
.char-count {
    display: block;
    text-align: right;
    font-size: 0.8rem;
    color: #999;
    margin-top: 0.5rem;
}

/* 加载动画 */
.loading-animation {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.9);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.loading-spinner {
    width: 60px;
    height: 60px;
    border: 5px solid rgba(211, 47, 47, 0.2);
    border-radius: 50%;
    border-top-color: #d32f2f;
    animation: spin 1s linear infinite;
    margin-bottom: 1.5rem;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading-text {
    font-size: 1.2rem;
    color: #333;
    font-weight: 500;
}

/* 通知样式 */
.notification {
    position: fixed;
    bottom: 30px;
    right: 30px;
    padding: 1rem 1.5rem;
    border-radius: 8px;
    color: white;
    font-weight: 500;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    transform: translateY(100px);
    opacity: 0;
    transition: transform 0.3s ease, opacity 0.3s ease;
    z-index: 1000;
}

.notification.show {
    transform: translateY(0);
    opacity: 1;
}

.notification.success {
    background-color: #4caf50;
}

.notification.error {
    background-color: #f44336;
}

/* 结果卡片动画 */
.result-redpoint-card, .analysis-section {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.5s ease, transform 0.5s ease;
}

.result-redpoint-card.animate-in, .analysis-section.animate-in {
    opacity: 1;
    transform: translateY(0);
}

/* 关键词标签动画 */
.keyword-tag {
    animation: tagAppear 0.5s ease forwards;
    opacity: 0;
    transform: scale(0.8);
}

@keyframes tagAppear {
    to { opacity: 1; transform: scale(1); }
}

.keyword-tag:nth-child(1) { animation-delay: 0.1s; }
.keyword-tag:nth-child(2) { animation-delay: 0.2s; }
.keyword-tag:nth-child(3) { animation-delay: 0.3s; }
.keyword-tag:nth-child(4) { animation-delay: 0.4s; }
.keyword-tag:nth-child(5) { animation-delay: 0.5s; }
.keyword-tag:nth-child(6) { animation-delay: 0.6s; }
.keyword-tag:nth-child(7) { animation-delay: 0.7s; }
.keyword-tag:nth-child(8) { animation-delay: 0.8s; }
.keyword-tag:nth-child(9) { animation-delay: 0.9s; }
.keyword-tag:nth-child(10) { animation-delay: 1.0s; }

/* 表格响应式设计增强 */
@media (max-width: 768px) {
    #redpoint-questions {
        font-size: 0.9rem;
    }
    
    #redpoint-questions th,
    #redpoint-questions td {
        padding: 0.8rem 0.5rem;
    }
    
    .category-cell {
        font-size: 1rem;
    }
    
    .answer-input {
        min-height: 100px;
    }
}

/* 打印样式优化 */
@media print {
    .self-diagnosis-section {
        background-color: white !important;
    }
    
    .self-diagnosis-table,
    .action-buttons,
    .site-header,
    .site-footer,
    .hero {
        display: none !important;
    }
    
    .result-container {
        padding: 0 !important;
        margin: 0 !important;
    }
    
    .result-redpoint-card, 
    .analysis-section {
        box-shadow: none !important;
        border: 1px solid #eee !important;
        break-inside: avoid !important;
        margin: 1rem 0 !important;
    }
}
