/**
 * 个性化学习诊断报告 - 卡片样式
 * 用于打造高潮体验的精致卡片设计
 */

/* 报告容器 */
.summary-report {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 16px 0;
    animation: fadeInUp 0.6s ease-out;
}

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

/* 卡片基础样式 */
.summary-card {
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    border-radius: 16px;
    padding: 20px;
    box-shadow: 
        0 4px 6px rgba(0, 0, 0, 0.05),
        0 10px 15px rgba(0, 0, 0, 0.08);
    border: 1px solid rgba(99, 102, 241, 0.1);
    animation: cardFadeIn 0.5s ease-out backwards;
}

@keyframes cardFadeIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* 卡片标题 */
.summary-card-title {
    font-size: 18px;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.summary-card-title .icon {
    font-size: 24px;
}

/* 庆祝卡片 - 特殊高亮 */
.summary-card.celebration {
    background: linear-gradient(135deg, #fef3c7 0%, #fef9e7 100%);
    border: 2px solid #fbbf24;
    box-shadow: 
        0 0 20px rgba(251, 191, 36, 0.3),
        0 4px 6px rgba(0, 0, 0, 0.05);
    animation: celebration 1s ease-out;
}

@keyframes celebration {
    0% { transform: scale(0.9); opacity: 0; }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); opacity: 1; }
}

.celebration .summary-card-title {
    color: #b45309;
    font-size: 20px;
}

.celebration .card-content {
    font-size: 16px;
    line-height: 1.6;
    color: #78350f;
}

/* ==================== 学习路径地图卡片 - 紧凑列表样式 ==================== */

.summary-card.learning-path {
    background: linear-gradient(135deg, #dbeafe 0%, #eff6ff 100%);
    border: 2px solid #3b82f6;
    position: relative;
    overflow: hidden;
}

/* 背景装饰 */
.learning-path::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: 
        radial-gradient(circle at 20% 30%, rgba(96, 165, 250, 0.08) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
}

.learning-path .card-content {
    position: relative;
    z-index: 1;
}

/* 路径标题 */
.learning-path .path-title {
    font-size: 18px;
    font-weight: 700;
    color: #1e40af;
    margin-bottom: 16px;
    text-align: center;
}

/* 步骤列表容器 */
.step-list {
    display: flex;
    flex-direction: column;
    gap: 0;
}

/* 单个步骤项 */
.step-item {
    display: flex;
    gap: 12px;
    padding: 8px 0;
    animation: stepFadeIn 0.3s ease-out backwards;
}

@keyframes stepFadeIn {
    from {
        opacity: 0;
        transform: translateX(-10px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* 左侧标记区（序号+连接线） */
.step-marker {
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 32px;
}

/* 步骤序号徽章 */
.step-number-badge {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 700;
    color: white;
    flex-shrink: 0;
}

/* 连接线 */
.step-line {
    width: 2px;
    flex: 1;
    min-height: 24px;
    background: linear-gradient(180deg, #3b82f6 0%, #60a5fa 100%);
    margin: 4px 0;
}

/* 右侧信息区 */
.step-info {
    flex: 1;
    min-width: 0;
    padding: 4px 0;
}

.step-info .step-title {
    font-size: 14px;
    font-weight: 600;
    line-height: 1.4;
    color: #1e293b;
    margin-bottom: 4px;
}

.step-info .step-status-inline {
    font-size: 12px;
    color: #64748b;
    display: flex;
    align-items: center;
    gap: 4px;
}

/* ==================== 不同状态的样式 ==================== */

/* 通关状态 (pass) */
.step-item.pass .step-number-badge {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    box-shadow: 0 0 8px rgba(16, 185, 129, 0.3);
}

.step-item.pass .step-title {
    color: #047857;
}

/* 重复挑战状态 (retry) */
.step-item.retry .step-number-badge {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    box-shadow: 0 0 8px rgba(245, 158, 11, 0.3);
    animation: retryPulse 2s ease-in-out infinite;
}

@keyframes retryPulse {
    0%, 100% { box-shadow: 0 0 8px rgba(245, 158, 11, 0.3); }
    50% { box-shadow: 0 0 12px rgba(245, 158, 11, 0.5); }
}

.step-item.retry .step-title {
    color: #b45309;
}

/* 跳过状态 (skip) */
.step-item.skip .step-number-badge {
    background: linear-gradient(135deg, #94a3b8 0%, #64748b 100%);
}

.step-item.skip .step-title,
.step-item.skip .step-status-inline {
    color: #94a3b8;
}

.step-item.skip {
    opacity: 0.7;
}

/* ==================== 响应式设计 ==================== */

@media (max-width: 768px) {
    .learning-path .path-title {
        font-size: 16px;
        margin-bottom: 12px;
    }
    
    .step-item {
        padding: 6px 0;
    }
    
    .step-marker {
        width: 28px;
    }
    
    .step-number-badge {
        width: 28px;
        height: 28px;
        font-size: 12px;
    }
    
    .step-info .step-title {
        font-size: 13px;
    }
    
    .step-info .step-status-inline {
        font-size: 11px;
    }
}

/* ==================== 动画延迟 ==================== */

.step-item:nth-child(1) { animation-delay: 0s; }
.step-item:nth-child(2) { animation-delay: 0.1s; }
.step-item:nth-child(3) { animation-delay: 0.2s; }
.step-item:nth-child(4) { animation-delay: 0.3s; }
.step-item:nth-child(5) { animation-delay: 0.4s; }

/* 掌握度分析卡片 */
.summary-card.mastery {
    background: linear-gradient(135deg, #dcfce7 0%, #f0fdf4 100%);
    border: 1px solid #4ade80;
}

.mastery .summary-card-title {
    color: #15803d;
}

.mastery .section-title {
    font-size: 16px;
    font-weight: 600;
    color: #166534;
    margin-top: 12px;
    margin-bottom: 8px;
}

.mastery .card-content ul {
    margin: 0;
    padding-left: 20px;
}

.mastery .card-content li {
    margin: 6px 0;
    color: #14532d;
    line-height: 1.5;
}

/* 推荐内容卡片 */
.summary-card.recommendations {
    background: linear-gradient(135deg, #fce7f3 0%, #fef3f9 100%);
    border: 1px solid #f472b6;
}

.recommendations .summary-card-title {
    color: #be185d;
}

.recommendation-item {
    background: white;
    border-radius: 12px;
    padding: 16px;
    margin: 12px 0;
    border: 1px solid rgba(244, 114, 182, 0.2);
    transition: all 0.3s ease;
}

.recommendation-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(244, 114, 182, 0.2);
}

.recommendation-item .item-type {
    font-size: 16px;
    font-weight: 600;
    color: #be185d;
    margin-bottom: 8px;
}

.recommendation-item .item-title {
    font-size: 15px;
    font-weight: 500;
    color: #9f1239;
    margin-bottom: 6px;
}

.recommendation-item .item-meta {
    font-size: 13px;
    color: #9ca3af;
    margin-bottom: 8px;
}

.recommendation-item .item-description {
    font-size: 14px;
    color: #831843;
    line-height: 1.5;
}

/* 鼓励卡片 */
.summary-card.encouragement {
    background: linear-gradient(135deg, #e0e7ff 0%, #eef2ff 100%);
    border: 1px solid #a5b4fc;
    text-align: center;
}

.encouragement .summary-card-title {
    color: #4338ca;
    justify-content: center;
}

.encouragement .card-content {
    font-size: 15px;
    line-height: 1.6;
    color: #3730a3;
    font-style: italic;
}

/* 卡片内容通用样式 */
.card-content {
    font-size: 14px;
    line-height: 1.6;
    color: #334155;
    white-space: pre-line;
    
    /* 公式超长时支持卡片内横向滑动 */
    overflow-x: auto; /* 横向超出时可滚动 */
    overflow-y: visible; /* 纵向完全展示，不滚动 */
    
    /* 滚动条样式优化 */
    scrollbar-width: thin;
    scrollbar-color: #ddd transparent;
}

/* Webkit 浏览器（Chrome, Safari）滚动条样式 */
.card-content::-webkit-scrollbar {
    height: 6px;
}

.card-content::-webkit-scrollbar-track {
    background: transparent;
}

.card-content::-webkit-scrollbar-thumb {
    background: #ddd;
    border-radius: 3px;
}

.card-content::-webkit-scrollbar-thumb:hover {
    background: #bbb;
}

.card-content strong {
    font-weight: 600;
    color: #1e293b;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .summary-card {
        padding: 16px;
        border-radius: 12px;
    }
    
    .summary-card-title {
        font-size: 16px;
    }
    
    .card-content {
        font-size: 13px;
    }
    
    .recommendation-item {
        padding: 12px;
    }
}

/* 动画延迟，让卡片依次出现 */
.summary-card:nth-child(1) { animation-delay: 0s; }
.summary-card:nth-child(2) { animation-delay: 0.1s; }
.summary-card:nth-child(3) { animation-delay: 0.2s; }
.summary-card:nth-child(4) { animation-delay: 0.3s; }
.summary-card:nth-child(5) { animation-delay: 0.4s; }

/* 高亮动画（用于庆祝卡片） */
@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.8; }
}

.celebration .summary-card-title {
    animation: pulse 2s ease-in-out infinite;
}


/* ==================== 多问题目样式 ==================== */

/* 多问题目列表容器 */
.sub-question-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 12px;
}

/* 单个小问卡片 */
.sub-question-item {
    background: linear-gradient(135deg, #f0f9ff 0%, #ffffff 100%);
    border-left: 3px solid #3b82f6;
    padding: 12px 16px;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.sub-question-item:hover {
    transform: translateX(4px);
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.15);
}

/* 小问标题 */
.sub-q-header {
    font-size: 15px;
    font-weight: 600;
    color: #1e40af;
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 6px;
}

/* 小问摘要 */
.sub-q-summary {
    font-size: 14px;
    color: #475569;
    line-height: 1.5;
}

/* 小问分隔线 */
.sub-q-divider {
    height: 1px;
    background: linear-gradient(90deg, 
        transparent 0%, 
        #cbd5e1 50%, 
        transparent 100%);
    margin: 4px 0;
}

/* 多问统计信息 */
.multi-q-stats {
    background: linear-gradient(135deg, #fefce8 0%, #fef9c3 100%);
    border: 1px solid #fbbf24;
    border-radius: 12px;
    padding: 16px;
    margin-top: 16px;
    font-size: 14px;
    line-height: 1.7;
    color: #78350f;
}

.multi-q-stats strong {
    color: #92400e;
    font-weight: 600;
}

/* 学习路径提示（单问和多问通用） */
.path-hint {
    background: linear-gradient(135deg, #faf5ff 0%, #f3e8ff 100%);
    border: 1px solid #c084fc;
    border-radius: 10px;
    padding: 12px 16px;
    margin-top: 12px;
    font-size: 14px;
    color: #7c3aed;
    text-align: center;
    font-weight: 500;
}

/* 多问题目的学习路径卡片特殊样式 */
.learning-path.multi-question {
    background: linear-gradient(135deg, #dbeafe 0%, #e0f2fe 100%);
    border: 2px solid #3b82f6;
}

.learning-path.multi-question .path-title {
    color: #1e40af;
}

/* 单问题目的学习路径卡片 */
.learning-path.single-question {
    /* 保持原有样式 */
}

/* 响应式调整 */
@media (max-width: 768px) {
    .sub-question-item {
        padding: 10px 12px;
    }
    
    .sub-q-header {
        font-size: 14px;
    }
    
    .sub-q-summary {
        font-size: 13px;
    }
    
    .multi-q-stats {
        padding: 12px;
        font-size: 13px;
    }
    
    .path-hint {
        padding: 10px 12px;
        font-size: 13px;
    }
}

/* 动画增强 */
.sub-question-item {
    animation: slideInRight 0.5s ease-out backwards;
}

.sub-question-item:nth-child(1) { animation-delay: 0.1s; }
.sub-question-item:nth-child(2) { animation-delay: 0.2s; }
.sub-question-item:nth-child(3) { animation-delay: 0.3s; }
.sub-question-item:nth-child(4) { animation-delay: 0.4s; }
.sub-question-item:nth-child(5) { animation-delay: 0.5s; }

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

