/* 头像相关样式 */

.avatar-upload-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    padding: 20px;
    border: 2px dashed #e5e7eb;
    border-radius: 8px;
    background: #f9fafb;
    transition: all 0.3s ease;
}

.avatar-upload-container:hover {
    border-color: #dc2626;
    background: #fef2f2;
}

.avatar-preview {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    overflow: hidden;
    border: 3px solid #e5e7eb;
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.avatar-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.avatar-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f3f4f6;
    color: #9ca3af;
    font-size: 2rem;
}

.avatar-upload-controls {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: center;
}

.avatar-display-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 20px;
    background: #f9fafb;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
}

.avatar-display {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    overflow: hidden;
    border: 3px solid #e5e7eb;
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.avatar-display img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.avatar-placeholder-large {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f3f4f6;
    color: #9ca3af;
    font-size: 3rem;
}

.avatar-info {
    margin: 0;
    color: #6b7280;
    font-size: 14px;
    text-align: center;
}

/* 头像上传按钮样式 */
.avatar-upload-controls .btn {
    padding: 8px 16px;
    font-size: 14px;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.avatar-upload-controls .btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

/* 头像预览动画 */
.avatar-preview {
    transition: all 0.3s ease;
}

.avatar-preview:hover {
    transform: scale(1.05);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

/* 响应式设计 */
@media (max-width: 768px) {
    .avatar-upload-container {
        padding: 15px;
    }
    
    .avatar-preview,
    .avatar-display {
        width: 100px;
        height: 100px;
    }
    
    .avatar-placeholder-large {
        font-size: 2.5rem;
    }
    
    .avatar-upload-controls {
        flex-direction: column;
        width: 100%;
    }
    
    .avatar-upload-controls .btn {
        width: 100%;
    }
}

/* 头像加载状态 */
.avatar-loading {
    position: relative;
}

.avatar-loading::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.avatar-loading::before {
    content: '⏳';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 1;
    font-size: 1.5rem;
}

/* ✅ 优化：移除!important，使用高特异性选择器 */
/* 头像错误状态 */
.avatar-container .avatar-error,
.avatar-error {
    border-color: #ef4444;
    background: #fef2f2;
}

.avatar-error .avatar-placeholder {
    color: #ef4444;
}

/* 头像成功状态 */
.avatar-container .avatar-success,
.avatar-success {
    border-color: #10b981;
    background: #f0fdf4;
}

/* 头像上传进度 */
.avatar-upload-progress {
    width: 100%;
    height: 4px;
    background: #e5e7eb;
    border-radius: 2px;
    overflow: hidden;
    margin-top: 10px;
}

.avatar-upload-progress-bar {
    height: 100%;
    background: #dc2626;
    border-radius: 2px;
    transition: width 0.3s ease;
    width: 0%;
}

/* 头像工具提示 */
.avatar-tooltip {
    position: relative;
    cursor: help;
}

.avatar-tooltip::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: #1f2937;
    color: white;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 12px;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 1000;
}

.avatar-tooltip:hover::after {
    opacity: 1;
    visibility: visible;
}
