/* 缘见 · 图片组件样式（前台 / 后台共用） */

/* 图片占位：有图铺满，无图渐变首字 */
.yj-pic{position:relative;display:grid;place-items:center;overflow:hidden}
.yj-pic>img{position:absolute;inset:0;width:100%;height:100%;object-fit:cover;display:block}

/* 上传控件 */
.yj-up-wrap{display:inline-flex;flex-direction:column;align-items:center;gap:6px}
.yj-up-wrap.wide{display:block;width:100%}
.yj-up{position:relative;border-radius:12px;border:1px dashed #e3d6da;background:#fcf8f9;cursor:pointer;display:grid;place-items:center;overflow:hidden;transition:.2s}
/* hover 只在支持悬停的设备生效，避免触屏上「更换」遮罩卡住不消失 */
@media (hover:hover){
  .yj-up:hover{border-color:#FF6F6F;background:#fff5f7}
}
.yj-up.circle{border-radius:50%}
.yj-up img{position:absolute;inset:0;width:100%;height:100%;object-fit:cover}
.yj-up-ph{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:4px;color:#b9a6ab;font-size:11px;line-height:1.4;text-align:center;padding:0 8px}
.yj-up-ph .plus{font-size:20px;color:#FF8FA8;font-weight:400;line-height:1}
.yj-up-mask{position:absolute;inset:0;background:rgba(0,0,0,.45);color:#fff;font-size:12px;display:grid;place-items:center;opacity:0;transition:.2s}
@media (hover:hover){ .yj-up:hover .yj-up-mask{opacity:1} }
.yj-up-loading{position:absolute;inset:0;background:rgba(255,255,255,.82);color:#E83191;font-size:12px;display:grid;place-items:center}
.yj-up-input{display:none}
.yj-up-del{font-size:11px;color:#b9a6ab;cursor:pointer}
.yj-up-del:hover{color:#E83191;text-decoration:underline}

/* 头像上传行 */
.avatar-row{display:flex;align-items:center;gap:16px;padding-bottom:14px;margin-bottom:6px;border-bottom:1px solid #f2e9eb}
.avatar-row .hint{font-size:12px;color:#a99;line-height:1.8}
.avatar-row .hint b{display:block;font-size:13px;color:#666;margin-bottom:2px;font-weight:600}

/* ================= 裁剪器 ================= */
.yj-crop-mask{position:fixed;inset:0;z-index:3200;background:rgba(20,16,24,.62);display:grid;place-items:center;padding:16px;animation:yjCropIn .16s ease-out}
@keyframes yjCropIn{from{opacity:0}to{opacity:1}}
.yj-crop-box{background:#fff;border-radius:16px;box-shadow:0 24px 70px rgba(0,0,0,.3);width:min(520px,100%);padding:16px 18px 14px;box-sizing:border-box;max-height:calc(100vh - 32px);overflow:auto}
.yj-crop-hd{display:flex;align-items:center;gap:10px;margin-bottom:12px}
.yj-crop-hd b{font-size:15px;color:#2b2b33;font-weight:700}
.yj-crop-hd .yj-crop-ratio{font-style:normal;font-size:11px;color:#c07f92;background:#fff2f5;border-radius:20px;padding:2px 9px}
.yj-crop-hd .yj-crop-x{margin-left:auto;width:26px;height:26px;border-radius:50%;display:grid;place-items:center;color:#9a9aa4;font-size:19px;line-height:1;cursor:pointer;transition:.15s}
.yj-crop-hd .yj-crop-x:hover{background:#f4f4f6;color:#555}

/* 舞台 = 裁剪框，所见即所得 */
.yj-crop-stage{position:relative;margin:0 auto;overflow:hidden;background:#f3f3f5;border-radius:10px;cursor:grab;touch-action:none;user-select:none}
.yj-crop-stage.circle{border-radius:50%}
.yj-crop-stage.dragging{cursor:grabbing}
.yj-crop-img{position:absolute;left:0;top:0;max-width:none;will-change:transform;pointer-events:none;display:block}
.yj-crop-grid{position:absolute;inset:0;pointer-events:none;opacity:0;transition:.2s}
.yj-crop-box.ready .yj-crop-grid{opacity:1}
.yj-crop-grid i{position:absolute;background:rgba(255,255,255,.42);box-shadow:0 0 1px rgba(0,0,0,.18)}
.yj-crop-grid i:nth-child(1){left:33.33%;top:0;bottom:0;width:1px}
.yj-crop-grid i:nth-child(2){left:66.66%;top:0;bottom:0;width:1px}
.yj-crop-grid i:nth-child(3){top:33.33%;left:0;right:0;height:1px}
.yj-crop-grid i:nth-child(4){top:66.66%;left:0;right:0;height:1px}

.yj-crop-tip{text-align:center;font-size:12px;color:#a7a7b0;margin:10px 0 8px}
.yj-crop-zoom{display:flex;align-items:center;gap:10px;padding:0 4px 12px}
.yj-crop-zoom span{width:22px;height:22px;border-radius:6px;background:#f6f2f4;color:#8a7c83;display:grid;place-items:center;font-size:13px;cursor:pointer;flex:none;user-select:none}
.yj-crop-zoom span:hover{background:#ffe9ef;color:#E83191}
.yj-crop-range{flex:1;appearance:none;-webkit-appearance:none;height:4px;border-radius:4px;background:#f0e4e8;outline:none}
.yj-crop-range::-webkit-slider-thumb{appearance:none;-webkit-appearance:none;width:16px;height:16px;border-radius:50%;background:#fff;border:2px solid #FF6F6F;box-shadow:0 2px 6px rgba(232,49,145,.28);cursor:pointer}
.yj-crop-range::-moz-range-thumb{width:14px;height:14px;border-radius:50%;background:#fff;border:2px solid #FF6F6F;cursor:pointer}
.yj-crop-reset{font-size:12px;color:#a99aa0;cursor:pointer;flex:none}
.yj-crop-reset:hover{color:#E83191}

.yj-crop-ft{display:flex;justify-content:flex-end;gap:10px;border-top:1px solid #f4eef0;padding-top:12px}
.yj-crop-ft button{min-width:82px;height:36px;border-radius:9px;border:1px solid #e8dfe2;background:#fff;color:#5d5560;font-size:13px;cursor:pointer;transition:.15s;font-family:inherit}
.yj-crop-ft button:hover{border-color:#f0b9c8;color:#E83191}
.yj-crop-ft button.yj-crop-ok{background:linear-gradient(135deg,#FF6F6F,#E83191);border:none;color:#fff;font-weight:600}
.yj-crop-ft button.yj-crop-ok:hover{filter:brightness(1.05);border:none;color:#fff}
.yj-crop-ft button.yj-crop-ok:disabled{opacity:.65;cursor:default;filter:none}

/* 遮罩打开时锁滚动 */
body.yj-crop-lock{overflow:hidden}

@media(max-width:560px){
  .yj-crop-box{padding:14px 12px 12px;border-radius:14px}
  .yj-crop-tip{font-size:11px}
  .yj-crop-ft button{flex:1;min-width:0}
}
