/**
 * 云信IM - 用户资料卡片样式
 * 遵循微信最佳实践
 */

/* ========== 资料卡片容器 ========== */
.yunxin-profile-card {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10000;
    pointer-events: none;
}

.yunxin-profile-card.show {
    pointer-events: auto;
}

/* ========== 遮罩层 ========== */
.yunxin-profile-card-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0);
    transition: background 0.2s ease;
}

.yunxin-profile-card.show .yunxin-profile-card-overlay {
    background: rgba(0, 0, 0, 0.3);
}

/* ========== 卡片内容（微信风格） ========== */
.yunxin-profile-card-content {
    position: absolute;
    width: 320px;
    background: #FFFFFF;
    border-radius: 4px; /* 微信小圆角 */
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.12); /* 微信柔和阴影 */
    border: 1px solid #E0E0E0; /* 微信细边框 */
    overflow: hidden;
    opacity: 0;
    transform: scale(0.95);
    transition: opacity 0.15s ease, transform 0.15s ease; /* 微信快速动画 */
}

.yunxin-profile-card.show .yunxin-profile-card-content {
    opacity: 1;
    transform: scale(1);
}

/* ========== 头部（微信风格 - 浅色背景） ========== */
.yunxin-profile-card-header {
    position: relative;
    display: flex;
    align-items: center;
    padding: 20px;
    background: #FAFAFA; /* 微信浅灰背景 */
    border-bottom: 1px solid #E0E0E0; /* 微信分隔线 */
    color: #1A1A1A;
}

.yunxin-profile-card-avatar {
    width: 60px;
    height: 60px;
    border-radius: 4px; /* 微信小圆角 */
    object-fit: cover;
    border: 1px solid #E0E0E0; /* 微信细边框 */
    flex-shrink: 0;
}

.yunxin-profile-card-info {
    flex: 1;
    margin-left: 16px;
    min-width: 0;
}

.yunxin-profile-card-name {
    font-size: 16px; /* 微信字号 */
    font-weight: 500; /* 微信字重 */
    color: #1A1A1A; /* 微信深色文字 */
    margin-bottom: 6px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.yunxin-profile-card-status {
    display: flex;
    align-items: center;
    font-size: 12px; /* 微信小字号 */
    color: #999999; /* 微信灰色文字 */
}

.yunxin-profile-card-status-dot {
    width: 6px; /* 微信更小的点 */
    height: 6px;
    border-radius: 50%;
    margin-right: 6px;
    background: #07C160; /* 微信绿 */
}

.yunxin-profile-card-status.offline .yunxin-profile-card-status-dot {
    background: #BFBFBF; /* 微信灰 */
}

.yunxin-profile-card-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 24px;
    height: 24px;
    border: none;
    background: transparent; /* 微信透明背景 */
    border-radius: 2px; /* 微信小圆角 */
    color: #999999; /* 微信灰色 */
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
}

.yunxin-profile-card-close:hover {
    background: #E0E0E0; /* 微信悬停背景 */
    color: #333333;
}

/* ========== 详细信息（微信风格） ========== */
.yunxin-profile-card-body {
    padding: 16px 20px; /* 微信间距 */
    max-height: 300px;
    overflow-y: auto;
    background: #FFFFFF; /* 白色背景 */
}

.yunxin-profile-card-item {
    margin-bottom: 12px; /* 微信紧凑间距 */
}

.yunxin-profile-card-item:last-child {
    margin-bottom: 0;
}

.yunxin-profile-card-label {
    font-size: 12px;
    color: #999999; /* 微信灰色 */
    margin-bottom: 4px; /* 微信小间距 */
}

.yunxin-profile-card-value {
    font-size: 14px;
    color: #1A1A1A;
    word-break: break-all;
    line-height: 1.5; /* 微信行高 */
}

/* ========== 备注编辑 - 微信简约风格 ========== */
.yunxin-profile-card-remark-item {
    /* 与账号ID行保持一致的样式 */
}

.yunxin-profile-card-remark-value {
    display: flex;
    align-items: center;
    cursor: pointer;
    padding: 4px 0;
    transition: opacity 0.2s ease;
}

.yunxin-profile-card-remark-value:hover {
    opacity: 0.7;
}

.yunxin-profile-card-remark-text {
    flex: 1;
    font-size: 14px;
    color: #1A1A1A;
    word-break: break-all;
    margin-left: 0; /* 移除间距，由图标的margin-right控制 */
}

.yunxin-profile-card-remark-edit-icon {
    width: 14px; /* 微信小图标 */
    height: 14px;
    color: #999999; /* 微信灰色 */
    flex-shrink: 0;
    order: -1; /* 将图标放到最前面 */
    margin-right: 6px;
}

.yunxin-profile-card-remark-input {
    width: 100%;
    height: 32px;
    padding: 0 8px;
    border: 1px solid #07C160;
    border-radius: 4px;
    font-size: 14px;
    color: #1A1A1A;
    background: #FFFFFF;
    outline: none;
    box-shadow: 0 0 0 2px rgba(7, 193, 96, 0.1);
}

.yunxin-profile-card-remark-input::placeholder {
    color: #B0B0B0;
}

/* ========== 操作按钮（微信风格） ========== */
.yunxin-profile-card-actions {
    padding: 12px 20px 16px; /* 微信间距 */
    display: flex;
    gap: 8px; /* 微信小间距 */
    background: #FAFAFA; /* 微信浅灰背景 */
    border-top: 1px solid #E0E0E0; /* 微信分隔线 */
}

.yunxin-profile-card-btn {
    flex: 1;
    height: 36px; /* 微信按钮高度 */
    border: none;
    border-radius: 4px; /* 微信小圆角 */
    font-size: 14px;
    font-weight: 400; /* 微信常规字重 */
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px; /* 微信小间距 */
    transition: all 0.15s ease; /* 微信快速动画 */
}

.yunxin-profile-card-btn.primary {
    background: #07C160; /* 微信绿 */
    color: #FFFFFF;
}

.yunxin-profile-card-btn.primary:hover {
    background: #06AD56; /* 微信深绿 */
}

.yunxin-profile-card-btn.primary:active {
    background: #059A4C; /* 微信更深绿 */
}

.yunxin-profile-card-btn svg {
    flex-shrink: 0;
}

/* ========== 滚动条样式（微信风格） ========== */
.yunxin-profile-card-body::-webkit-scrollbar {
    width: 4px; /* 微信细滚动条 */
}

.yunxin-profile-card-body::-webkit-scrollbar-track {
    background: transparent;
}

.yunxin-profile-card-body::-webkit-scrollbar-thumb {
    background: #D0D0D0; /* 微信灰色 */
    border-radius: 2px; /* 微信小圆角 */
}

.yunxin-profile-card-body::-webkit-scrollbar-thumb:hover {
    background: #B0B0B0; /* 微信深灰 */
}

/* ========== 移动端适配 ========== */
@media (max-width: 768px) {
    .yunxin-profile-card-content {
        width: calc(100% - 40px);
        max-width: 320px;
        left: 50% !important;
        top: 50% !important;
        transform: translate(-50%, -50%) scale(0.95);
    }
    
    .yunxin-profile-card.show .yunxin-profile-card-content {
        transform: translate(-50%, -50%) scale(1);
    }
}

/* ========== 动画（微信风格 - 快速） ========== */
@keyframes profileCardFadeIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

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