One-dimensional CdSxSe1−x nanoribbons for high-performance rigid and flexible photodetectors