.product-media-trigger{
  width:100%;max-width:100%;min-width:0;padding:0;appearance:none;-webkit-appearance:none;
  isolation:isolate;border:0!important;outline:0;background:#fff!important;font-size:0;line-height:1;cursor:pointer
}
.product-media-trigger:not(.is-image-error)::before,.product-media-trigger::after{display:none!important;content:none!important}
.cards-grid{grid-template-columns:repeat(auto-fit,minmax(min(286px,100%),1fr))!important;align-items:stretch;gap:16px}
.product-card{display:flex;flex-direction:column;width:100%;max-width:100%;min-width:0;height:100%;overflow:hidden}
.product-media-trigger{flex:0 0 auto;height:auto!important;min-height:0;max-height:none;aspect-ratio:6/5;overflow:hidden;padding:0!important}
.product-media-trigger img{position:absolute;inset:16px;z-index:0;display:block;width:calc(100% - 32px)!important;height:calc(100% - 32px)!important;max-width:none!important;max-height:none!important;padding:0!important;object-fit:contain!important;background:#fff}
.product-thumb .sku{z-index:3;display:block;width:max-content;max-width:calc(100% - 28px);overflow:hidden;color:#5f686c!important;font-size:10px;line-height:1.2;text-overflow:ellipsis;white-space:nowrap;pointer-events:none}
.product-thumb:has(.media-chip) .sku{max-width:calc(100% - 122px)}
.product-thumb .media-chip{z-index:3!important;max-width:96px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;pointer-events:none}
.product-media-trigger.is-image-error::before{position:absolute;z-index:1;inset:16px;display:grid!important;content:'暂无图片'!important;place-items:center;border:1px dashed #d9dfdc;border-radius:10px;background:#f7f9f8;color:#8a9290;font-size:12px;font-weight:600;letter-spacing:.04em}
.product-media-trigger.is-image-error img{visibility:hidden}
.product-media-hint{position:absolute;right:14px;bottom:14px;z-index:2;display:grid!important;width:34px;height:34px;padding:0!important;place-items:center;border:1px solid rgba(255,255,255,.82);border-radius:11px;background:rgba(10,18,32,.78);color:#fff;font-size:0!important;line-height:1;box-shadow:0 7px 20px rgba(9,18,31,.16);backdrop-filter:blur(8px);opacity:0;transform:translateY(5px) scale(.94);pointer-events:none;transition:opacity .2s ease,transform .2s ease}
.product-media-trigger:hover .product-media-hint,.product-media-trigger:focus-visible .product-media-hint{opacity:1;transform:translateY(0) scale(1)}
.product-media-trigger:hover img{transform:scale(1.018)}
.product-body,.product-foot,.product-actions{min-width:0;max-width:100%}
.product-body{display:flex;flex:1;flex-direction:column;padding:16px}
.product-name,.product-meta{display:-webkit-box;overflow:hidden;overflow-wrap:anywhere;-webkit-box-orient:vertical}
.product-name{-webkit-line-clamp:2;line-height:1.45}
.product-meta{min-height:2.9em;-webkit-line-clamp:2;line-height:1.45}
.product-foot{display:grid!important;grid-template-columns:minmax(0,1fr);align-items:start!important;gap:12px;margin-top:auto}
.product-actions{display:grid;width:100%;grid-template-columns:repeat(auto-fit,minmax(78px,1fr));gap:7px;margin-left:0}
.product-actions .btn{width:100%;min-width:0;margin-left:0!important;padding-inline:8px;white-space:nowrap}
@media(hover:none){.product-media-hint{display:none!important}}
@media(prefers-reduced-motion:reduce){.product-media-trigger img,.product-media-hint{transition:none!important;transform:none!important}}

.detail-overlay .detail-dialog{width:min(1040px,calc(100vw - 48px));max-width:100%;max-height:calc(100vh - 48px)}
.detail-overlay .detail-body{min-width:0;max-width:100%;overflow-x:hidden}
.detail-overlay .detail-grid{grid-template-columns:repeat(auto-fit,minmax(min(220px,100%),1fr))}

.form-drawer,.resource-form,.drawer-body,.form-grid,.form-field{min-width:0;max-width:100%}
.resource-form{overflow:hidden}
.drawer-body{overflow-x:hidden}
.media-uploader,.media-uploader *{box-sizing:border-box}
.media-uploader-multiple{
  display:grid!important;grid-template-columns:minmax(0,1fr)!important;align-items:stretch!important;
  width:100%;max-width:100%;min-width:0;gap:12px!important;padding:14px;
  border:1px solid #dfe5e2;border-radius:14px;background:#fbfcfa
}
.media-uploader-multiple>input[type="file"]{
  position:absolute!important;width:1px!important;height:1px!important;margin:-1px!important;padding:0!important;
  overflow:hidden!important;clip:rect(0 0 0 0)!important;clip-path:inset(50%)!important;
  border:0!important;opacity:0!important;white-space:nowrap!important;pointer-events:none!important
}
.media-uploader-summary{display:flex;align-items:flex-start;justify-content:space-between;gap:14px;min-width:0}
.media-uploader-summary>div{min-width:0}
.media-uploader-summary strong{display:block;color:#28302f;font-size:12px;line-height:1.45}
.media-uploader-summary small{display:block;margin-top:4px;color:#838b89;font-size:11px;line-height:1.45;overflow-wrap:anywhere}
.media-uploader-summary>[data-media-count]{
  flex:0 0 auto;padding:4px 8px;border-radius:999px;background:#eef6f4;color:#357a73;
  font-size:10px;font-weight:700;white-space:nowrap
}
.media-uploader .media-preview{
  width:100%;max-width:100%;min-width:0;min-height:132px;height:auto;padding:0;border:0;background:transparent;
  overflow:visible
}
.media-uploader .media-preview.media-gallery{
  display:grid;grid-template-columns:repeat(auto-fit,minmax(min(118px,100%),1fr));gap:10px;align-items:start
}
.media-uploader .media-preview.media-gallery.is-empty{
  display:flex;min-height:132px;align-items:center;justify-content:center;padding:20px;
  border:1px dashed #cbd6d2;border-radius:12px;background:#f7faf8
}
.media-placeholder{display:grid;gap:5px;justify-items:center;max-width:100%;color:#89918f;text-align:center}
.media-placeholder>span{color:#1aa6a3;font-size:28px;line-height:1}
.media-placeholder>strong{color:#68716f;font-size:12px}
.media-placeholder>small{font-size:11px}
.media-tile{
  position:relative;min-width:0;max-width:100%;aspect-ratio:1;overflow:hidden;
  border:1px solid #dfe5e2;border-radius:11px;background:#eff3f1;box-shadow:0 2px 8px rgba(18,31,29,.04)
}
.media-tile-preview{display:block;width:100%;height:100%;padding:0;border:0;background:#eef2f0;cursor:zoom-in}
.media-tile-preview img,.media-tile-preview video{display:block;width:100%;height:100%;object-fit:cover}
.media-tile-preview:focus-visible,.detail-media-item:focus-visible{outline:3px solid rgba(22,172,177,.35);outline-offset:-3px}
.media-remove-action{
  position:absolute;z-index:3;right:6px;top:6px;width:28px;height:28px;padding:0;border:1px solid rgba(255,255,255,.3);
  border-radius:50%;background:rgba(14,20,24,.78);color:#fff;font-size:18px;line-height:25px;cursor:pointer
}
.media-cover-badge,.media-video-badge,.media-cover-action{
  position:absolute;z-index:2;left:6px;bottom:6px;max-width:calc(100% - 12px);padding:4px 7px;border:0;border-radius:7px;
  background:rgba(12,92,84,.86);color:#fff;font-size:10px;line-height:1.2;white-space:nowrap
}
.media-video-badge{background:rgba(15,19,31,.78)}
.media-cover-action{cursor:pointer;background:rgba(15,19,31,.78)}
.media-cover-action:hover{background:#117e75}
.media-tile button:disabled{cursor:wait;opacity:.65}
.media-uploader-footer{display:flex;align-items:center;gap:10px;min-width:0}
.media-uploader .upload-trigger{display:flex!important;align-items:center;justify-content:center;flex:0 0 auto;gap:6px;margin:0;line-height:1;white-space:nowrap}
.media-uploader .upload-trigger svg{display:block;flex:0 0 auto}
.media-uploader .upload-trigger.is-disabled{pointer-events:none;opacity:.52}
.media-upload-status{min-width:0;color:#7b8381;font-size:11px;line-height:1.45;overflow-wrap:anywhere}
.media-upload-status[data-status="progress"]{color:#177e83}
.media-upload-status[data-status="success"]{color:#177d65}
.media-upload-status[data-status="error"]{color:#b34c48}
.media-uploader.is-uploading{border-color:#a9dcd7;background:#f7fcfb}
.media-uploader.is-uploading .media-preview{opacity:.84}

.detail-media-section{width:100%;max-width:100%;min-width:0;margin:0 0 18px;padding:18px;border:1px solid #e3e8e4;border-radius:14px;background:#f9fbf9;overflow:hidden}
.detail-media-section .detail-history-head{margin-bottom:12px}
.detail-media-stage{position:relative;display:grid;place-items:center;width:min(100%,var(--media-max-width,100%));max-width:100%;min-width:0;height:auto;min-height:0;max-height:680px;aspect-ratio:var(--media-aspect,16/9);margin-inline:auto;overflow:hidden;border:1px solid #dfe5e2;border-radius:13px;background:#eef1ef;transition:width .24s ease,aspect-ratio .24s ease}
.detail-media-stage>.detail-media-main{display:block;width:100%;height:100%;padding:0;border:0;background:transparent;cursor:zoom-in}
.detail-media-stage img,.detail-media-stage video{display:block;width:100%;height:100%;max-width:100%;max-height:100%;padding:clamp(12px,2.2vw,24px);object-fit:contain;background:#fff}
.detail-media-stage>i{position:absolute;right:10px;bottom:10px;padding:5px 8px;border-radius:7px;background:rgba(12,18,25,.72);color:#fff;font-size:10px;font-style:normal}
.detail-media-thumbs{display:grid;grid-template-columns:repeat(auto-fill,minmax(min(88px,100%),1fr));gap:9px;margin-top:10px;min-width:0}
.detail-media-thumb{position:relative;display:block;width:100%;min-width:0;aspect-ratio:4/3;overflow:hidden;padding:0;border:2px solid transparent;border-radius:10px;background:#eef2f0;cursor:pointer}
.detail-media-thumb.active{border-color:#19a6a5;box-shadow:0 0 0 2px rgba(25,166,165,.12)}
.detail-media-thumb img,.detail-media-thumb video{display:block;width:100%;height:100%;object-fit:cover}
.detail-media-thumb>span{position:absolute;left:5px;bottom:5px;max-width:calc(100% - 10px);overflow:hidden;padding:3px 6px;border-radius:6px;background:rgba(12,18,25,.72);color:#fff;font-size:9px;line-height:1;text-overflow:ellipsis;white-space:nowrap}

html.media-lightbox-open,body.media-lightbox-open{overflow:hidden!important}
.media-lightbox[hidden]{display:none!important}
.media-lightbox{
  position:fixed;z-index:120;inset:0;display:grid;place-items:center;padding:24px;background:rgba(7,10,15,.82);backdrop-filter:blur(7px)
}
.media-lightbox-dialog{
  position:relative;display:grid;grid-template-columns:minmax(0,1fr);grid-template-rows:54px minmax(0,1fr);
  width:min(1240px,calc(100vw - 48px));height:min(860px,calc(100vh - 48px));min-width:0;overflow:hidden;
  border:1px solid rgba(255,255,255,.15);border-radius:18px;background:#11151a;box-shadow:0 28px 80px rgba(0,0,0,.38)
}
.media-lightbox-head{grid-column:1;grid-row:1;display:flex;align-items:center;justify-content:space-between;height:54px;padding:0 14px 0 20px;color:#d9dede;font-size:12px}
.media-lightbox-head button{width:36px;height:36px;padding:0;border:0;border-radius:10px;background:rgba(255,255,255,.1);color:#fff;font-size:24px;cursor:pointer}
.media-lightbox-content{grid-column:1;grid-row:2;display:grid;place-items:center;width:100%;height:100%;min-width:0;min-height:0;overflow:hidden;padding:18px 66px 24px}
.media-lightbox.is-single .media-lightbox-content{padding-inline:24px}
.media-lightbox-content img,.media-lightbox-content video{display:block;width:auto;height:auto;max-width:100%;max-height:min(740px,calc(100vh - 160px));object-fit:contain;border-radius:10px}
.media-lightbox-nav{position:absolute;z-index:2;top:calc(50% + 27px);width:44px;height:58px;margin-top:-29px;padding:0;border:0;border-radius:12px;background:rgba(255,255,255,.09);color:#fff;font-size:35px;cursor:pointer}
.media-lightbox-nav.prev{left:14px}.media-lightbox-nav.next{right:14px}
.media-lightbox-nav[hidden]{display:none!important}
.media-lightbox-nav:hover,.media-lightbox-head button:hover{background:rgba(255,255,255,.17)}

@media(max-width:680px){
  .media-uploader-multiple{padding:12px}
  .media-uploader-summary{display:grid;gap:7px}
  .media-uploader-summary>[data-media-count]{justify-self:start}
  .media-uploader-footer{align-items:stretch;flex-direction:column}
  .media-uploader .upload-trigger{width:100%;justify-content:center}
  .detail-media-section{padding:12px}
  .detail-overlay .detail-dialog{width:calc(100vw - 20px);max-height:calc(100vh - 20px)}
  .detail-media-stage{width:min(100%,var(--media-mobile-max-width,100%));height:auto;min-height:0;max-height:520px;aspect-ratio:var(--media-aspect,4/3)}
  .detail-media-thumbs{grid-template-columns:repeat(3,minmax(0,1fr))}
  .media-lightbox{padding:10px}
  .media-lightbox-dialog{width:calc(100vw - 20px);height:calc(100vh - 20px);border-radius:14px}
  .media-lightbox-content{padding:10px 46px 16px}
  .media-lightbox.is-single .media-lightbox-content{padding-inline:10px}
  .media-lightbox-nav{width:34px;height:48px;font-size:30px}
  .media-lightbox-nav.prev{left:6px}.media-lightbox-nav.next{right:6px}
}
@media(max-width:360px){
  .media-uploader .media-preview.media-gallery{grid-template-columns:minmax(0,1fr)}
  .detail-media-thumbs{grid-template-columns:repeat(2,minmax(0,1fr))}
  .drawer-footer{gap:7px;padding-left:12px;padding-right:12px}
  .drawer-footer .btn{min-width:0;flex:1;padding-left:10px;padding-right:10px}
}
@media(prefers-reduced-motion:reduce){.media-lightbox *{scroll-behavior:auto!important}}
