/**
 * Stage Profile Card - 整合的个人档案卡片样式
 * 将欢迎区块和个人档案合并为一个现代化的卡片组件
 */

/* ========== 个人档案卡片 ========== */
.stage-profile-card {
    background: var(--color-bg-elevated);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-xl);
    margin-bottom: var(--spacing-lg);
    overflow: hidden;
    position: relative;
}

/* 卡片顶部装饰渐变条 */
.stage-profile-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--brand-primary), var(--brand-secondary), #6366f1);
    background-size: 200% 100%;
    animation: gradientShift 8s ease infinite;
}

@keyframes gradientShift {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

/* ========== 卡片头部 ========== */
.profile-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: var(--spacing-lg) var(--spacing-lg) var(--spacing-md);
    gap: var(--spacing-md);
}

.profile-card-user {
    display: flex;
    align-items: center;
    gap: var(--spacing-lg);
    flex: 1;
    min-width: 0;
}

.profile-card-avatar {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--brand-primary), var(--brand-secondary));
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: var(--font-size-2xl);
    font-weight: var(--font-weight-semibold);
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(163, 230, 53, 0.2);
}

.profile-card-welcome {
    flex: 1;
    min-width: 0;
}

.profile-card-welcome h1 {
    font-size: var(--font-size-xl);
    font-weight: var(--font-weight-semibold);
    margin-bottom: var(--spacing-xs);
    color: var(--color-text-primary);
}

.profile-card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-md);
    font-size: var(--font-size-sm);
    color: var(--color-text-secondary);
}

.profile-card-day,
.profile-card-location {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.profile-card-day .iconify,
.profile-card-location .iconify {
    color: var(--color-text-muted);
}

.profile-card-day .day-count {
    color: var(--brand-primary);
    font-weight: var(--font-weight-semibold);
}

.profile-card-actions {
    display: flex;
    gap: var(--spacing-xs);
    flex-shrink: 0;
}

.profile-card-actions .btn-ghost {
    width: 36px;
    height: 36px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-md);
    background: transparent;
    border: 1px solid transparent;
    color: var(--color-text-muted);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.profile-card-actions .btn-ghost:hover {
    background: var(--color-bg-hover);
    border-color: var(--color-border);
    color: var(--color-text-primary);
}

.profile-card-actions .btn-ghost .iconify {
    font-size: 18px;
}

/* ========== 身份信息条 ========== */
.profile-card-identity {
    display: flex;
    align-items: stretch;
    padding: var(--spacing-md) var(--spacing-lg);
    background: var(--color-bg);
    border-top: 1px solid var(--color-border);
    border-bottom: 1px solid var(--color-border);
    gap: var(--spacing-lg);
}

.identity-item {
    flex: 1;
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    min-width: 0;
}

.identity-icon {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-md);
    background: linear-gradient(135deg, rgba(163, 230, 53, 0.1), rgba(15, 118, 110, 0.1));
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.identity-icon .iconify {
    font-size: 18px;
    color: var(--brand-primary);
}

.identity-content {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.identity-label {
    font-size: var(--font-size-xs);
    color: var(--color-text-muted);
    margin-bottom: 2px;
}

.identity-value {
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-medium);
    color: var(--color-text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.identity-divider {
    width: 1px;
    background: var(--color-border);
    align-self: stretch;
    flex-shrink: 0;
}

/* ========== 底部：人格与简介 ========== */
.profile-card-footer {
    display: flex;
    align-items: flex-start;
    gap: var(--spacing-lg);
    padding: var(--spacing-md) var(--spacing-lg);
}

.profile-card-mbti {
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--spacing-xs);
}

.mbti-badge {
    min-width: 72px;
    height: 42px;
    padding: 0 var(--spacing-md);
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.1), rgba(168, 85, 247, 0.1));
    border: 1px solid rgba(99, 102, 241, 0.2);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
}

.mbti-badge .mbti-type {
    font-size: var(--font-size-lg);
    font-weight: var(--font-weight-bold);
    background: linear-gradient(135deg, #6366f1, #a855f7);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.mbti-badge .mbti-name {
    font-size: var(--font-size-xs);
    font-weight: normal;
    color: var(--color-text-muted);
    margin-left: var(--spacing-xs);
    -webkit-text-fill-color: var(--color-text-muted);
}

.mbti-test-link {
    font-size: var(--font-size-xs);
    color: var(--color-text-muted);
    display: flex;
    align-items: center;
    gap: 4px;
    text-decoration: none;
    transition: color var(--transition-fast);
}

.mbti-test-link:hover {
    color: var(--brand-primary);
}

.profile-card-bio {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: center;
    padding: var(--spacing-sm) var(--spacing-md);
    background: var(--color-bg);
    border-radius: var(--radius-md);
    min-height: 42px;
}

.bio-text {
    font-size: var(--font-size-sm);
    color: var(--color-text-secondary);
    line-height: 1.6;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.bio-text.empty {
    color: var(--color-text-muted);
    font-style: italic;
}

/* ========== 进度条 ========== */
.profile-card-progress {
    padding: var(--spacing-md) var(--spacing-lg);
    background: linear-gradient(180deg, transparent, rgba(163, 230, 53, 0.03));
    border-top: 1px dashed var(--color-border);
}

.progress-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--spacing-sm);
    gap: var(--spacing-md);
}

.progress-label {
    font-size: var(--font-size-sm);
    color: var(--color-text-secondary);
}

.progress-label strong {
    color: var(--brand-primary);
}

.progress-count {
    font-size: var(--font-size-xs);
    color: var(--color-text-muted);
    flex-shrink: 0;
}

.progress-track {
    height: 6px;
    background: var(--color-bg-hover);
    border-radius: var(--radius-full);
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--brand-primary), var(--brand-secondary));
    border-radius: var(--radius-full);
    transition: width 0.5s ease;
    width: 0%;
}

/* ========== 响应式设计 ========== */
@media (max-width: 768px) {
    .profile-card-header {
        flex-direction: column;
        align-items: stretch;
    }
    
    .profile-card-user {
        flex-direction: column;
        text-align: center;
    }
    
    .profile-card-avatar {
        width: 64px;
        height: 64px;
        font-size: var(--font-size-xl);
    }
    
    .profile-card-meta {
        justify-content: center;
    }
    
    .profile-card-actions {
        justify-content: center;
        padding-top: var(--spacing-sm);
    }
    
    .profile-card-identity {
        flex-direction: column;
        gap: var(--spacing-sm);
    }
    
    .identity-divider {
        display: none;
    }
    
    .identity-item {
        padding: var(--spacing-xs) 0;
    }
    
    .profile-card-footer {
        flex-direction: column;
        align-items: stretch;
    }
    
    .profile-card-mbti {
        flex-direction: row;
        justify-content: center;
        gap: var(--spacing-md);
    }
    
    .progress-info {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--spacing-xs);
    }
}

@media (max-width: 480px) {
    .profile-card-welcome h1 {
        font-size: var(--font-size-lg);
    }
    
    .profile-card-meta {
        flex-direction: column;
        gap: var(--spacing-xs);
    }
}

/* ========== Skeleton Loading States (LCP 优化) ========== */
@keyframes skeletonPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* 骨架屏文本占位 */
.skeleton-text {
    background: linear-gradient(90deg, var(--color-bg-hover) 25%, var(--color-border) 50%, var(--color-bg-hover) 75%);
    background-size: 200% 100%;
    animation: skeletonPulse 1.5s ease-in-out infinite;
    color: transparent !important;
    border-radius: var(--radius-sm);
    min-width: 60px;
    display: inline-block;
}

.skeleton-text-title {
    min-width: 150px;
    height: 1.3em;
}

/* 骨架屏头像 */
.skeleton-avatar {
    background: linear-gradient(135deg, var(--color-bg-hover), var(--color-border));
    animation: skeletonPulse 1.5s ease-in-out infinite;
}

.skeleton-avatar::after {
    content: '';
}

/* 骨架屏徽章 */
.skeleton-badge {
    animation: skeletonPulse 1.5s ease-in-out infinite;
}

/* 移除骨架状态 - 当数据加载完成时 */
.skeleton-loaded .skeleton-text,
.skeleton-loaded .skeleton-avatar,
.skeleton-loaded .skeleton-badge {
    animation: none;
    background: none;
}

.skeleton-loaded .skeleton-text {
    color: inherit !important;
    min-width: auto;
}

.skeleton-loaded .skeleton-avatar {
    background: linear-gradient(135deg, var(--brand-primary), var(--brand-secondary));
}

.skeleton-loaded .skeleton-badge {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.1), rgba(168, 85, 247, 0.1));
}