/**
 * 用户中心弹窗样式
 */

/* 遮罩层 */
.user-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.user-modal-overlay.show {
    opacity: 1;
    visibility: visible;
}

/* 弹窗容器 */
.user-modal-container {
    width: 60%;
    max-width: 800px;
    height: 70vh;
    background: white;
    border-radius: 20px;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
    transform: scale(0.8) translateY(50px);
    opacity: 0;
    transition: transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.5s ease;
    position: relative;
    overflow: hidden;
}

.user-modal-overlay.show .user-modal-container {
    transform: scale(1) translateY(0);
    opacity: 1;
}

/* 从下往上的涟漪动画效果 */
.user-modal-container::before {
    content: '';
    position: absolute;
    bottom: -50%;
    left: 50%;
    width: 0;
    height: 0;
    background: radial-gradient(circle at center bottom, rgba(196, 69, 54, 0.15) 0%, transparent 60%);
    border-radius: 50%;
    transform: translateX(-50%);
    transition: width 0.8s ease, height 0.8s ease, bottom 0.8s ease;
    pointer-events: none;
    z-index: 0;
}

.user-modal-overlay.show .user-modal-container::before {
    width: 300%;
    height: 300%;
    bottom: -100%;
}

/* 弹窗头部 */
.user-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid #f0f0f0;
    background: linear-gradient(135deg, #fff5f5 0%, #ffffff 100%);
    position: relative;
    z-index: 1;
}

.user-modal-title {
    font-size: 20px;
    font-weight: 600;
    color: #333;
    margin: 0;
}

.user-modal-close {
    width: 36px;
    height: 36px;
    border: none;
    background: #c44536;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    color: white;
    font-size: 16px;
}

.user-modal-close:hover {
    background: #a33a2d;
    transform: rotate(90deg);
}

/* 弹窗内容区 */
.user-modal-content {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
    position: relative;
    z-index: 1;
}

/* 滚动条样式 */
.user-modal-content::-webkit-scrollbar {
    width: 6px;
}

.user-modal-content::-webkit-scrollbar-track {
    background: #f5f5f5;
    border-radius: 3px;
}

.user-modal-content::-webkit-scrollbar-thumb {
    background: #ddd;
    border-radius: 3px;
}

.user-modal-content::-webkit-scrollbar-thumb:hover {
    background: #ff2442;
}

/* ============ 个人信息页面 ============ */
.profile-section {
    margin-bottom: 24px;
}

.profile-header {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 20px;
    background: linear-gradient(135deg, #fff5f5 0%, #ffffff 100%);
    border-radius: 12px;
    margin-bottom: 24px;
}

.profile-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid #ff2442;
    box-shadow: 0 4px 15px rgba(255, 36, 66, 0.2);
}

.profile-basic-info {
    flex: 1;
}

.profile-name {
    font-size: 20px;
    font-weight: 600;
    color: #333;
    margin-bottom: 4px;
}

.profile-uid {
    font-size: 14px;
    color: #999;
    font-family: monospace;
}

.profile-info-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

.profile-info-item {
    padding: 16px;
    background: #f9f9f9;
    border-radius: 10px;
    transition: all 0.3s ease;
}

.profile-info-item:hover {
    background: #fff5f5;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 36, 66, 0.1);
}

.profile-info-label {
    font-size: 12px;
    color: #999;
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.profile-info-value {
    font-size: 15px;
    color: #333;
    font-weight: 500;
}

.profile-bio {
    grid-column: 1 / -1;
    padding: 16px;
    background: #f9f9f9;
    border-radius: 10px;
}

.profile-bio-text {
    font-size: 14px;
    color: #666;
    line-height: 1.6;
}

/* 账号安全区域 */
.security-section {
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid #f0f0f0;
}

.security-title {
    font-size: 16px;
    font-weight: 600;
    color: #333;
    margin-bottom: 16px;
}

.security-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px;
    background: #f9f9f9;
    border-radius: 10px;
    margin-bottom: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.security-item:hover {
    background: #fff5f5;
}

.security-item-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.security-item-icon {
    width: 40px;
    height: 40px;
    background: white;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ff2442;
    font-size: 18px;
}

.security-item-info h4 {
    font-size: 14px;
    font-weight: 600;
    color: #333;
    margin-bottom: 2px;
}

.security-item-info p {
    font-size: 12px;
    color: #999;
}

.security-item-arrow {
    color: #ccc;
    font-size: 14px;
}

/* ============ 关注列表页面 ============ */
.following-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.following-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    background: #f9f9f9;
    border-radius: 12px;
    transition: all 0.3s ease;
}

.following-item:hover {
    background: #fff5f5;
    transform: translateX(4px);
}

.following-avatar {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #fff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.following-info {
    flex: 1;
}

.following-name {
    font-size: 16px;
    font-weight: 600;
    color: #333;
    margin-bottom: 4px;
}

.following-uid {
    font-size: 12px;
    color: #999;
    font-family: monospace;
    margin-bottom: 6px;
}

.following-tags {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.following-tag {
    padding: 2px 8px;
    background: #ff2442;
    color: white;
    font-size: 11px;
    border-radius: 10px;
}

.following-unfollow-btn {
    padding: 8px 16px;
    background: white;
    border: 1px solid #ff2442;
    color: #ff2442;
    border-radius: 20px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.following-unfollow-btn:hover {
    background: #ff2442;
    color: white;
}

/* ============ 消息列表页面 ============ */
.message-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.message-item {
    display: flex;
    gap: 12px;
    padding: 16px;
    background: #f9f9f9;
    border-radius: 12px;
    transition: all 0.3s ease;
    cursor: pointer;
}

.message-item:hover {
    background: #fff5f5;
}

.message-item.unread {
    background: #fff5f5;
    border-left: 3px solid #ff2442;
}

.message-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
}

.message-content {
    flex: 1;
}

.message-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}

.message-sender {
    font-size: 14px;
    font-weight: 600;
    color: #333;
}

.message-time {
    font-size: 12px;
    color: #999;
}

.message-text {
    font-size: 13px;
    color: #666;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ============ 空状态 ============ */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    text-align: center;
}

.empty-state-icon {
    font-size: 64px;
    margin-bottom: 16px;
    opacity: 0.5;
}

.empty-state-title {
    font-size: 16px;
    color: #666;
    margin-bottom: 8px;
}

.empty-state-desc {
    font-size: 14px;
    color: #999;
}

/* ============ 修改密码页面 ============ */
.password-form {
    max-width: 400px;
    margin: 0 auto;
    padding: 20px 0;
}

.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    font-size: 14px;
    color: #333;
    margin-bottom: 8px;
    font-weight: 500;
}

.form-input {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    font-size: 14px;
    transition: all 0.3s ease;
    box-sizing: border-box;
}

.form-input:focus {
    outline: none;
    border-color: #ff2442;
    box-shadow: 0 0 0 3px rgba(255, 36, 66, 0.1);
}

.form-input::placeholder {
    color: #ccc;
}

.code-input-group {
    display: flex;
    gap: 12px;
}

.code-input-group .form-input {
    flex: 1;
}

.btn-send-code {
    padding: 12px 20px;
    background: #ff2442;
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.btn-send-code:hover {
    background: #e02040;
}

.btn-send-code:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.btn-submit {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, #ff2442 0%, #ff4d6d 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 10px;
}

.btn-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(255, 36, 66, 0.3);
}

/* ============ 头像编辑 ============ */
.profile-avatar-wrapper {
    position: relative;
    cursor: pointer;
    display: inline-block;
}

.profile-avatar-wrapper:hover .avatar-overlay {
    opacity: 1;
}

.avatar-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    color: white;
    font-size: 12px;
}

.avatar-overlay i {
    font-size: 20px;
    margin-bottom: 4px;
}

/* ============ 昵称编辑 ============ */
.profile-name-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
}

.edit-icon {
    font-size: 14px;
    color: #999;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.edit-icon:hover {
    color: #ff2442;
    background: #fff5f5;
}

.edit-nickname-input {
    font-size: 20px;
    font-weight: 600;
    color: #333;
    border: 2px solid #ff2442;
    border-radius: 8px;
    padding: 4px 12px;
    outline: none;
    width: 200px;
}

/* ============ 个性签名编辑 ============ */
.edit-bio-icon {
    font-size: 12px;
    color: #999;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: all 0.3s ease;
    margin-left: 8px;
}

.edit-bio-icon:hover {
    color: #ff2442;
    background: #fff5f5;
}

.edit-bio-textarea {
    width: 100%;
    min-height: 80px;
    padding: 12px;
    border: 2px solid #ff2442;
    border-radius: 10px;
    font-size: 14px;
    color: #666;
    resize: vertical;
    outline: none;
    font-family: inherit;
    box-sizing: border-box;
}

.edit-bio-textarea:focus {
    box-shadow: 0 0 0 3px rgba(255, 36, 66, 0.1);
}

.edit-bio-save {
    margin-top: 12px;
    padding: 8px 20px;
    background: #ff2442;
    color: white;
    border: none;
    border-radius: 20px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.edit-bio-save:hover {
    background: #e02040;
    transform: translateY(-2px);
}

.edit-bio-save i {
    margin-right: 4px;
}

/* ============ 头像裁剪弹窗 ============ */
.avatar-cropper-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.avatar-cropper-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
}

.avatar-cropper-container {
    background: white;
    border-radius: 16px;
    padding: 24px;
    max-width: 500px;
    width: 90%;
    position: relative;
}

.avatar-cropper-container h3 {
    margin: 0 0 8px 0;
    font-size: 18px;
    color: #333;
    text-align: center;
}

.cropper-hint {
    text-align: center;
    font-size: 12px;
    color: #999;
    margin-bottom: 16px;
}

.avatar-cropper-area {
    position: relative;
    width: 300px;
    height: 300px;
    margin: 0 auto;
    overflow: hidden;
    border-radius: 8px;
    background: #333;
    cursor: grab;
    touch-action: none;
}

.avatar-cropper-area:active {
    cursor: grabbing;
}

.cropper-image-wrapper {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    transform-origin: center center;
    will-change: transform;
}

.cropper-image-wrapper img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    pointer-events: none;
    user-select: none;
    -webkit-user-drag: none;
}

.cropper-frame {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 200px;
    height: 200px;
    border: 3px solid #ff2442;
    border-radius: 50%;
    pointer-events: none;
    box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.6);
    z-index: 10;
}

.cropper-frame::before {
    content: '';
    position: absolute;
    top: -5px;
    left: -5px;
    right: -5px;
    bottom: -5px;
    border: 1px dashed rgba(255, 255, 255, 0.5);
    border-radius: 50%;
}

/* 缩放控制 */
.cropper-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin: 20px 0;
    padding: 0 20px;
}

.zoom-btn {
    width: 36px;
    height: 36px;
    border: none;
    background: #f5f5f5;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    color: #666;
    font-size: 14px;
}

.zoom-btn:hover {
    background: #ff2442;
    color: white;
}

.zoom-slider {
    flex: 1;
    max-width: 200px;
    height: 6px;
    -webkit-appearance: none;
    appearance: none;
    background: #e0e0e0;
    border-radius: 3px;
    outline: none;
}

.zoom-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    background: #ff2442;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
}

.zoom-slider::-webkit-slider-thumb:hover {
    transform: scale(1.2);
    box-shadow: 0 2px 8px rgba(255, 36, 66, 0.3);
}

.zoom-slider::-moz-range-thumb {
    width: 18px;
    height: 18px;
    background: #ff2442;
    border-radius: 50%;
    cursor: pointer;
    border: none;
    transition: all 0.3s ease;
}

.avatar-cropper-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    margin-top: 20px;
}

.avatar-cropper-actions .btn-cancel {
    padding: 10px 24px;
    background: #f5f5f5;
    color: #666;
    border: none;
    border-radius: 20px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.avatar-cropper-actions .btn-cancel:hover {
    background: #e8e8e8;
}

.avatar-cropper-actions .btn-confirm {
    padding: 10px 24px;
    background: #ff2442;
    color: white;
    border: none;
    border-radius: 20px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.avatar-cropper-actions .btn-confirm:hover {
    background: #e02040;
    transform: translateY(-2px);
}

/* 响应式适配 */
@media (max-width: 768px) {
    .user-modal-container {
        width: 90%;
        height: 80vh;
    }
    
    .profile-info-grid {
        grid-template-columns: 1fr;
    }
    
    .following-item {
        flex-wrap: wrap;
    }
    
    .following-unfollow-btn {
        width: 100%;
        margin-top: 10px;
    }
    
    .avatar-cropper-area {
        width: 280px;
        height: 280px;
    }
    
    .cropper-frame {
        width: 180px;
        height: 180px;
    }
    
    .cropper-controls {
        padding: 0 10px;
    }
    
    .zoom-slider {
        max-width: 150px;
    }
}
