/**
 * SX 统一图片上传组件样式（全站公共）
 * 规格来源：2026-12-04 前端规范任务书（任务一）
 * 单图槽位 140×140；未上传虚线占位；已上传悬浮磨砂操作条（更换/删除）
 */

/* ===== 单图槽位 ===== */
.sx-up{position:relative;width:140px;height:140px;border-radius:8px;overflow:hidden;
    border:1px dashed #cbd5e1;background:#f8fafc;cursor:pointer;flex:0 0 auto;
    transition:border-color .2s,background .2s;-webkit-tap-highlight-color:transparent}
.sx-up:hover{border-color:#3b82f6;background:#f0f7ff}
.sx-up>img{position:absolute;inset:0;width:100%;height:100%;object-fit:cover;display:block}

/* 尺寸/形状变体 */
.sx-up--sm{width:96px;height:96px;border-radius:9px}
.sx-up--lg{width:160px;height:160px;border-radius:12px}
.sx-up--avatar{width:76px;height:76px;border-radius:18px}
.sx-up--wide{width:240px;height:120px}

/* 占位态：图片 SVG + 文字 */
.sx-up-ph{position:absolute;inset:0;display:flex;flex-direction:column;align-items:center;
    justify-content:center;gap:7px;color:#94a3b8;font-size:12.5px;font-weight:500;pointer-events:none}
.sx-up-ph svg{width:26px;height:26px;color:#94a3b8;transition:color .2s;
    fill:none;stroke:currentColor;stroke-width:1.5;stroke-linecap:round;stroke-linejoin:round}
.sx-up:hover .sx-up-ph{color:#3b82f6}
.sx-up:hover .sx-up-ph svg{color:#3b82f6}

/* 已上传悬浮操作条：深色磨砂，左侧铅笔更换、右侧垃圾桶删除 */
.sx-up-bar{position:absolute;left:50%;bottom:8px;transform:translate(-50%,10px);
    display:flex;align-items:center;gap:2px;padding:3px;border-radius:6px;
    background:rgba(30,41,59,.85);-webkit-backdrop-filter:blur(8px);backdrop-filter:blur(8px);
    opacity:0;transition:opacity .25s cubic-bezier(.4,0,.2,1),transform .25s cubic-bezier(.4,0,.2,1);
    z-index:2}
.sx-up:hover .sx-up-bar,.sx-up:focus-within .sx-up-bar{opacity:1;transform:translate(-50%,0)}
.sx-up-bar button{width:30px;height:30px;border:none;border-radius:6px;background:transparent;
    color:#cbd5e1;cursor:pointer;display:flex;align-items:center;justify-content:center;
    padding:0;transition:background .2s,color .2s}
.sx-up-bar button:hover{background:rgba(255,255,255,.16);color:#fff}
.sx-up-bar button.is-del:hover{background:rgba(248,113,113,.22);color:#fca5a5}
.sx-up-bar svg{width:15px;height:15px;stroke:currentColor;fill:none;stroke-width:2;
    stroke-linecap:round;stroke-linejoin:round;pointer-events:none}

/* ===== 多图网格变体（意见反馈等，最多 N 张） ===== */
.sx-up-grid{display:flex;flex-wrap:wrap;gap:10px}
.sx-up-grid .sx-up{width:104px;height:104px;border-radius:8px}
.sx-up-grid .sx-up-bar button{width:28px;height:28px}
.sx-up-grid .sx-up-bar svg{width:14px;height:14px}

/* 手机端适配：槽位收窄不截断 */
@media (max-width:640px){
    .sx-up{width:120px;height:120px}
    .sx-up--wide{width:100%;max-width:240px}
    .sx-up-bar button{width:32px;height:32px}   /* 触控热区 */
    .sx-up-grid .sx-up{width:31%;min-width:96px;height:auto;aspect-ratio:1/1}
}

/* 无障碍：键盘焦点可见 */
.sx-up:focus-visible{outline:2px solid #3b82f6;outline-offset:2px}
