/* ============================================================
   editor.css — 前台「就地编辑模式」样式
   仅当 editor.js 注入元素时生效；所有类名以 nx- 前缀，不影响正常浏览
   ============================================================ */

/* ---------- 浮动开关按钮 ---------- */
#nxEditBtn {
  position: fixed; right: 18px; bottom: 18px; z-index: 9990;
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 18px; border-radius: 999px;
  background: #14161a; color: #fff;
  font-size: .9063rem; font-weight: 650; letter-spacing: .02em;
  box-shadow: 0 10px 28px -8px rgba(0, 0, 0, .45);
  border: 1px solid rgba(255, 255, 255, .14);
  transition: transform .2s, background .2s, box-shadow .2s;
}
#nxEditBtn svg { width: 15px; height: 15px; }
#nxEditBtn:hover { transform: translateY(-2px); background: #000; }
#nxEditBtn.is-on { background: #2457f5; border-color: rgba(255, 255, 255, .28); }
body.nx-edit #nxEditBtn { bottom: 84px; }
/* 购物车抽屉打开时隐藏编辑按钮：避免遮挡抽屉底部操作与误触 */
body.nxct-open #nxEditBtn { display: none; }

/* ---------- 底部发布条 ---------- */
#nxBar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 9989;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px max(16px, env(safe-area-inset-right)) calc(10px + env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
  background: rgba(16, 18, 20, .96);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  color: #fff; border-top: 1px solid rgba(255, 255, 255, .12);
  transform: translateY(110%);
  visibility: hidden; /* 非编辑模式彻底隐藏（含键盘 Tab 焦点） */
  transition: transform .3s cubic-bezier(.22, .61, .36, 1), visibility 0s linear .35s;
}
body.nx-edit #nxBar {
  transform: translateY(0);
  visibility: visible;
  transition: transform .3s cubic-bezier(.22, .61, .36, 1), visibility 0s;
}
#nxBar .nx-bar-status {
  font-size: .8438rem; color: rgba(255, 255, 255, .78);
  display: inline-flex; align-items: center; gap: 8px; min-width: 0;
}
#nxBar .nx-bar-status::before {
  content: ""; width: 8px; height: 8px; border-radius: 50%;
  background: #6a7078; flex: none;
}
#nxBar .nx-bar-status.has-dirty { color: #fff; }
#nxBar .nx-bar-status.has-dirty::before { background: #f59e0b; box-shadow: 0 0 0 4px rgba(245, 158, 11, .22); }

/* 发布中：按钮呼吸闪烁 + 状态点转蓝，让等待期一眼可见 */
#nxPublish.is-busy { animation: nxPubPulse 1.1s ease-in-out infinite; }
@keyframes nxPubPulse { 0%, 100% { opacity: 1; } 50% { opacity: .45; } }
#nxBar .nx-bar-actions { display: flex; gap: 8px; flex: none; }
body.nx-edit { padding-bottom: 96px; }
body.nx-edit #nxBar ~ * { /* noop keep specificity */ }

/* ---------- 小按钮体系（编辑 UI 通用） ---------- */
.nxb {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 9px 16px; border-radius: 8px;
  font-size: .875rem; font-weight: 620; white-space: nowrap;
  transition: background .2s, border-color .2s, transform .15s;
  cursor: pointer;
}
.nxb:active { transform: scale(.97); }
.nxb--primary { background: #2457f5; color: #fff; }
.nxb--primary:hover { background: #1c49d6; }
.nxb--primary:disabled { opacity: .55; cursor: default; }
.nxb--dark { background: #14161a; color: #fff; }
.nxb--dark:hover { background: #000; }
.nxb--ghost { border: 1px solid rgba(255, 255, 255, .32); color: inherit; background: transparent; }
.nxb--ghost:hover { border-color: currentColor; }
.nxb--light { border: 1px solid #e6e6e2; background: #fff; color: #14161a; }
.nxb--light:hover { border-color: #14161a; }
.nxb--danger { background: #fee2e2; color: #b91c1c; }
.nxb--danger:hover { background: #fecaca; }

/* ---------- 编辑模式：可编辑高亮 ---------- */
body.nx-edit [data-i18n],
body.nx-edit [data-i18n-html],
body.nx-edit [data-site-text] { position: relative; }
body.nx-edit [data-i18n]:not(.nx-editing):hover,
body.nx-edit [data-i18n-html]:not(.nx-editing):hover,
body.nx-edit [data-site-text]:not(.nx-editing):hover {
  outline: 2px dashed rgba(36, 87, 245, .55);
  outline-offset: 3px;
  border-radius: 3px;
  cursor: text;
}
.nx-editing {
  outline: 2px solid #2457f5 !important;
  outline-offset: 3px;
  border-radius: 3px;
  background: rgba(36, 87, 245, .07);
  cursor: text;
}
body.nx-edit a { cursor: default; }
body.nx-edit .product-card { cursor: pointer; }

/* ---------- 产品卡片上的编辑角标 ---------- */
body.nx-edit .product-card { position: relative; }
.nx-card-tools {
  position: absolute; top: 10px; right: 10px; z-index: 5;
  pointer-events: none;
}
.nx-tool-chip {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 6px 11px; border-radius: 999px;
  background: rgba(20, 22, 26, .88); color: #fff;
  font-size: .75rem; font-weight: 640; letter-spacing: .02em;
  box-shadow: 0 6px 18px -6px rgba(0, 0, 0, .5);
}
body.nx-edit .product-card:hover .nx-tool-chip { background: #2457f5; }

/* 新增产品卡片 */
.nx-add-card {
  min-height: 300px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px;
  border: 2px dashed rgba(36, 87, 245, .5); border-radius: 16px;
  background: rgba(36, 87, 245, .04);
  color: #2457f5; font-size: 1rem; font-weight: 650;
  transition: background .2s, border-color .2s;
  cursor: pointer;
}
.nx-add-card:hover { background: rgba(36, 87, 245, .09); border-color: #2457f5; }

/* ---------- 详情页工具条 ---------- */
.nx-detail-tools { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 12px; }
.nx-detail-tools .nxb--ghost { border-color: #d9d9d4; color: #2a2d33; }
.nx-detail-tools .nxb--ghost:hover { border-color: #14161a; }

/* 主图上的“图片管理”按钮 */
.nx-img-manage {
  position: absolute; top: 12px; right: 12px; z-index: 4;
  padding: 9px 14px; border-radius: 999px;
  background: rgba(20, 22, 26, .88); color: #fff;
  font-size: .8125rem; font-weight: 640;
  box-shadow: 0 6px 18px -6px rgba(0, 0, 0, .5);
}
.nx-img-manage:hover { background: #2457f5; }
.detail-media { position: relative; }

/* 缩略图上的删除角标与添加块 */
.gallery-thumb { position: relative; }
.nx-g-del {
  position: absolute; top: 3px; right: 3px; z-index: 3;
  width: 22px; height: 22px; border-radius: 50%;
  display: grid; place-items: center;
  background: rgba(20, 22, 26, .82); color: #fff;
  font-size: .6875rem; line-height: 1;
}
.nx-g-del:hover { background: #dc2626; }
.gallery-thumb.nx-g-add {
  display: grid; place-items: center;
  border-style: dashed; border-color: rgba(36, 87, 245, .6);
  color: #2457f5; font-size: 1.375rem; font-weight: 400;
  background: rgba(36, 87, 245, .05);
}
.gallery-thumb.nx-g-add:hover { background: rgba(36, 87, 245, .12); border-color: #2457f5; }

/* 视频上的删除角标 + 添加视频卡片 */
.nx-v-del {
  position: absolute; top: 10px; right: 10px; z-index: 6;
  width: 30px; height: 30px; border-radius: 50%;
  display: grid; place-items: center;
  background: rgba(20, 22, 26, .82); color: #fff;
  font-size: .875rem;
}
.nx-v-del:hover { background: #dc2626; }
.nx-add-video {
  aspect-ratio: 16 / 9;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
  border: 2px dashed rgba(36, 87, 245, .5); border-radius: 16px;
  background: rgba(36, 87, 245, .04);
  color: #2457f5; font-size: .9688rem; font-weight: 640;
  cursor: pointer; transition: background .2s, border-color .2s;
}
.nx-add-video:hover { background: rgba(36, 87, 245, .09); border-color: #2457f5; }

/* 图片（主视觉/工厂图）上的“更换图片”按钮 */
.nx-img-btn {
  position: absolute; top: 12px; right: 12px; z-index: 5;
  padding: 9px 14px; border-radius: 999px;
  background: rgba(20, 22, 26, .88); color: #fff;
  font-size: .8125rem; font-weight: 640;
  box-shadow: 0 6px 18px -6px rgba(0, 0, 0, .5);
}
.nx-img-btn:hover { background: #2457f5; }

/* ============================================================
   弹窗体系
   ============================================================ */
.nx-modal-mask {
  position: fixed; inset: 0; z-index: 9995;
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  background: rgba(10, 12, 15, .55);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  opacity: 0; transition: opacity .22s ease;
}
.nx-modal-mask.is-open { opacity: 1; }
.nx-modal-card {
  width: 100%; max-width: 560px; max-height: min(88vh, 900px);
  display: flex; flex-direction: column;
  background: #fff; border-radius: 16px; overflow: hidden;
  box-shadow: 0 32px 80px -24px rgba(0, 0, 0, .5);
  transform: translateY(14px) scale(.985);
  transition: transform .24s cubic-bezier(.22, .61, .36, 1);
  color: #14161a;
}
.nx-modal-mask.is-open .nx-modal-card { transform: none; }
.nx-modal--wide .nx-modal-card { max-width: 680px; }
.nx-modal--narrow .nx-modal-card { max-width: 440px; }

.nxm-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 16px 20px; border-bottom: 1px solid #e6e6e2; flex: none;
}
.nxm-head b { font-size: 1.0625rem; font-weight: 700; }
.nxm-x {
  width: 34px; height: 34px; border-radius: 8px;
  display: grid; place-items: center; font-size: .9375rem; color: #6a7078;
}
.nxm-x:hover { background: #f6f6f4; color: #14161a; }
.nxm-body { padding: 18px 20px; overflow-y: auto; flex: 1; }
.nxm-foot {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 14px 20px; border-top: 1px solid #e6e6e2;
  background: #fafaf8; flex: none;
}
.nxm-spacer { flex: 1; }
.nxm-foot .nxb--ghost { border-color: #d9d9d4; color: #2a2d33; }
.nxm-foot .nxb--ghost:hover { border-color: #14161a; }

.nxm-sec { margin-bottom: 22px; }
.nxm-sec:last-child { margin-bottom: 4px; }
.nxm-sec h4 {
  font-size: .9063rem; font-weight: 700; margin-bottom: 4px;
  display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap;
}
.nxm-note { font-size: .7813rem; font-weight: 500; color: #6a7078; }
.nxm-row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.nxm-sec label { display: block; margin-top: 12px; }
.nxm-sec label > span { display: block; font-size: .8125rem; font-weight: 620; color: #2a2d33; margin-bottom: 6px; }
.nxm-sec input[type="text"], .nxm-sec input[type="number"], .nxm-sec textarea, .nxm-urladd input, .nxp-url {
  width: 100%; padding: 11px 13px;
  border: 1px solid #e6e6e2; border-radius: 9px;
  font-size: .9375rem; background: #fff; outline: none;
  transition: border-color .2s, box-shadow .2s;
}
.nxm-sec input[type="text"]:focus, .nxm-sec input[type="number"]:focus, .nxm-sec textarea:focus, .nxm-urladd input:focus {
  border-color: #2457f5; box-shadow: 0 0 0 3px rgba(36, 87, 245, .12);
}
.nxm-sec textarea { resize: vertical; min-height: 76px; }
select.nxm-cat { width: 100%; padding: 11px 13px; border: 1px solid #e6e6e2; border-radius: 9px; font-size: .9375rem; background: #fff; }

/* 所属分类（多分类）：主分类 + 附加分类标签 + 「添加分类」 */
.nxm-cats-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 10px; }
.nxm-cats { flex: 1; min-width: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.nxm-chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 10px; border-radius: 999px;
  font-size: .8125rem; color: #14161a;
  background: #f6f6f4; border: 1px solid #e2e2dd;
}
.nxm-chip.is-main { background: rgba(36, 87, 245, .08); border-color: #b9c7f5; color: #2457f5; }
.nxm-chip.is-main i {
  font-style: normal; font-size: .6875rem; font-weight: 650;
  color: #fff; background: #2457f5; border-radius: 999px; padding: 1px 7px;
}
.nxm-chip--empty { color: #6a7078; border-style: dashed; }
.nxm-chip-x {
  width: 18px; height: 18px; padding: 0; margin-right: -3px;
  display: grid; place-items: center; font-size: .6875rem; line-height: 1; color: #6a7078;
  background: transparent; border: 0; border-radius: 50%; cursor: pointer;
}
.nxm-chip-x:hover { color: #d92d20; background: rgba(217, 45, 32, .08); }
.nxb--sm { padding: 7px 12px; font-size: .8125rem; }
.nxm-cats-tip { margin: 8px 0 0; font-size: .7813rem; line-height: 1.65; color: #6a7078; }

/* 「添加分类」多选弹窗 */
.nxm-cp-body .nxm-cats-tip { margin: 0 0 12px; }
.nxm-cp-group { margin-bottom: 10px; }
.nxm-cp-group--main { padding: 10px 12px; background: rgba(36, 87, 245, .06); border: 1px solid #b9c7f5; border-radius: 10px; }
/* 分组头 = 收起/展开按钮（▾/▸ + 名称 + 已选数徽标）；h 版新增 */
.nxm-cp-parent {
  display: flex; align-items: center; gap: 8px; width: 100%;
  margin: 0 0 4px; padding: 7px 9px;
  background: #f6f6f4; border: 0; border-radius: 8px;
  font-size: .8125rem; font-weight: 700; color: #6a7078; text-align: left; cursor: pointer;
}
.nxm-cp-parent:active { background: #ececea; }
.nxm-cp-caret { flex: none; width: 14px; font-size: .625rem; transition: transform .18s ease; }
.nxm-cp-group.is-collapsed .nxm-cp-caret { transform: rotate(-90deg); }
.nxm-cp-name { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nxm-cp-count { flex: none; font-size: .6563rem; font-weight: 650; color: #fff; background: #2457f5; border-radius: 999px; padding: 1px 8px; }
.nxm-cp-count[hidden] { display: none; }
.nxm-cp-group--main .nxm-cp-parent {
  display: block; margin: 0 0 6px; padding: 0; background: transparent;
  font-size: .7813rem; color: #2457f5; cursor: default; pointer-events: none;
}
.nxm-cp-list { padding: 2px 0 2px 2px; }
.nxm-cp-group.is-collapsed .nxm-cp-list { display: none; }
.nxm-cp-kid {
  display: flex; align-items: center; gap: 9px;
  margin: 0 !important; padding: 7px 9px; border-radius: 8px;
  font-size: .9063rem; cursor: pointer;
}
.nxm-cp-kid:hover { background: #f6f6f4; }
.nxm-cp-kid.is-main { cursor: default; padding: 4px 0; }
.nxm-cp-kid input { width: 16px; height: 16px; flex: none; accent-color: #2457f5; }
.nxm-cp-kid span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nxm-cp-tag {
  flex: none; margin-left: auto;
  font-style: normal; font-size: .6875rem; font-weight: 650;
  color: #fff; background: #2457f5; border-radius: 999px; padding: 1px 8px;
}
/* 工具行：已选计数 + 全部收起/展开（h 版新增） */
.nxm-cp-tools {
  display: flex; align-items: center; gap: 10px;
  margin: 0 0 12px; padding: 7px 10px;
  background: #fafaf8; border: 1px solid #e6e6e2; border-radius: 10px;
  font-size: .75rem; color: #6a7078;
}
.nxm-cp-tools b { color: #14161a; }
.nxm-cp-allbtn {
  flex: none; margin-left: auto;
  padding: 6px 12px; border-radius: 8px;
  border: 1px solid #d9d9d4; background: #fff;
  font-size: .75rem; font-weight: 650; color: #14161a; cursor: pointer;
}
.nxm-cp-allbtn:active { background: #f6f6f4; }
.nxm-cp-empty { padding: 18px 0; text-align: center; font-size: .8438rem; color: #6a7078; }
/* 手机：触控行加高（≥44px） */
@media (max-width: 640px) {
  .nxm-cp-parent { min-height: 44px; }
  .nxm-cp-kid { min-height: 44px; padding: 11px 9px; }
}

/* 产品描述（富文本编辑器） */
.nxm-rt-switch { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 10px; }
.nxm-rt-switch .nxb.is-on { background: #2457f5; border-color: #2457f5; color: #fff; }
/* 段距选择（段与段之间的间距；编辑器内即时预览，保存后前台同口径） */
.nxm-gap { display: inline-flex; align-items: center; gap: 6px; font-size: .7813rem; color: #6a7078; }
.nxm-gap select {
  height: 32px; padding: 0 6px;
  font: inherit; font-size: .7813rem; color: #14161a;
  background: #fff; border: 1px solid #e6e6e2; border-radius: 8px;
}
.nxm-rt-editor { margin-top: 10px; --pgap: .8em; }
.nxm-rt-editor.nxm-rt-gap-compact { --pgap: .42em; }
.nxm-rt-editor.nxm-rt-gap-loose { --pgap: 1.7em; }
.nxm-rt-editor .ql-toolbar.ql-snow {
  border: 1px solid #e6e6e2; border-bottom: 0;
  border-radius: 10px 10px 0 0; background: #fafaf8;
}
.nxm-rt-editor .ql-container.ql-snow {
  border: 1px solid #e6e6e2; border-radius: 0 0 10px 10px;
  font-family: inherit; font-size: .9375rem;
}
/* 描述超长时在框内滚动：弹窗体不再跟着变高，工具栏保持可见（与后台编辑器同口径） */
.nxm-rt-editor .ql-editor { min-height: 220px; max-height: 50vh; overflow-y: auto; line-height: 1.7; }
/* 段落间距 = 与前台 .prose 同口径（--pgap：标准 / 紧凑 / 宽松 由上方下拉切换） */
.nxm-rt-editor .ql-editor p { margin: 0 0 var(--pgap); }
.nxm-rt-editor .ql-editor h1, .nxm-rt-editor .ql-editor h2, .nxm-rt-editor .ql-editor h3, .nxm-rt-editor .ql-editor h4 { margin: calc(var(--pgap) * 1.45) 0 calc(var(--pgap) * .5); }
.nxm-rt-editor .ql-editor ul, .nxm-rt-editor .ql-editor ol { margin: 0 0 var(--pgap); }
.nxm-rt-editor .ql-editor blockquote { margin: calc(var(--pgap) * 1.15) 0; }
.nxm-rt-editor .ql-editor hr { border: 0; border-top: 1px solid #e6e6e2; margin: calc(var(--pgap) * 1.8) 0; }
.nxm-rt-editor .ql-editor img { width: 800px; max-width: 100%; height: auto; border-radius: 8px; margin: var(--pgap) auto; display: block; }
.nxm-rt-editor .ql-editor.ql-blank::before { font-style: normal; color: #98a2b3; }
.nx-rt-ta {
  width: 100%; min-height: 220px; margin-top: 10px;
  padding: 12px 13px; font-size: .9375rem; line-height: 1.7; font-family: inherit;
  border: 1px solid #e6e6e2; border-radius: 9px; outline: none; resize: vertical;
}
.nx-rt-ta:focus { border-color: #2457f5; box-shadow: 0 0 0 3px rgba(36, 87, 245, .12); }

/* 图片管理网格 */
.nxm-imgs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 10px; }
.nxm-img {
  position: relative; aspect-ratio: 4 / 3; border-radius: 10px;
  overflow: hidden; border: 1px solid #e6e6e2; background: #f6f6f4;
}
.nxm-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.nxm-img .cover-badge {
  position: absolute; top: 6px; left: 6px;
  padding: 3px 8px; border-radius: 999px;
  background: #2457f5; color: #fff; font-size: .6875rem; font-weight: 650;
}
.nxm-img .img-ops {
  position: absolute; left: 0; right: 0; bottom: 0;
  display: flex; gap: 4px; justify-content: flex-end;
  padding: 6px;
  background: linear-gradient(transparent, rgba(10, 12, 15, .72));
}
.nxm-img .img-ops button {
  width: 30px; height: 30px; border-radius: 7px;
  display: grid; place-items: center;
  background: rgba(255, 255, 255, .92); color: #14161a;
  font-size: .8125rem;
}
.nxm-img .img-ops button:hover { background: #fff; }
.nxm-img .img-ops button:disabled { opacity: .4; }
.nxm-img .img-ops button.danger:hover { background: #dc2626; color: #fff; }
.nxm-imgadd { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 12px; }
.nxm-imgadd .nxb--ghost { border-color: #d9d9d4; color: #2a2d33; }
.nxm-imgadd .nxb--ghost:hover { border-color: #2457f5; color: #2457f5; }
.nxm-urladd { display: flex; gap: 8px; flex: 1; min-width: 220px; }
.nxm-urladd input { flex: 1; min-width: 0; }

/* 视频管理行 */
.nxm-vid {
  display: grid; grid-template-columns: 1fr 1fr auto auto; gap: 8px; align-items: center;
  margin-top: 10px;
}
.nxm-vid input {
  width: 100%; padding: 10px 12px; min-width: 0;
  border: 1px solid #e6e6e2; border-radius: 9px; font-size: .875rem;
  outline: none; transition: border-color .2s, box-shadow .2s;
}
.nxm-vid input:focus { border-color: #2457f5; box-shadow: 0 0 0 3px rgba(36, 87, 245, .12); }
.nxm-vid .v-plat {
  font-size: .75rem; font-weight: 640; color: #2457f5;
  white-space: nowrap; min-width: 56px; text-align: center;
}
.nxm-vid .v-plat.is-unknown { color: #b45309; }
.nxm-vid .v-del {
  width: 32px; height: 32px; border-radius: 7px;
  display: grid; place-items: center; color: #6a7078; font-size: .875rem;
}
.nxm-vid .v-del:hover { background: #fee2e2; color: #b91c1c; }
/* 视频排序：上移 / 下移 / 删除 一组箭头按钮 */
.nxm-vid .vid-ops { display: inline-flex; gap: 4px; }
.nxm-vid .vid-ops button {
  width: 32px; height: 32px; border-radius: 7px; border: 1px solid #e6e6e2;
  display: grid; place-items: center; color: #6a7078; font-size: .9375rem; background: #fff;
}
.nxm-vid .vid-ops button:hover { background: #eef1f6; color: #14161a; }
.nxm-vid .vid-ops button:disabled { opacity: .4; cursor: default; }
.nxm-vid .vid-ops button.danger:hover { background: #fee2e2; color: #b91c1c; border-color: #fecaca; }

/* 资料管理行 */
.nxm-file {
  display: grid; grid-template-columns: 1.15fr 1fr auto auto; gap: 8px; align-items: center;
  margin-top: 10px;
}
.nxm-file input {
  width: 100%; padding: 10px 12px; min-width: 0;
  border: 1px solid #e6e6e2; border-radius: 9px; font-size: .875rem;
  outline: none; transition: border-color .2s, box-shadow .2s;
}
.nxm-file input:focus { border-color: #2457f5; box-shadow: 0 0 0 3px rgba(36, 87, 245, .12); }
.nxm-file .f-ext {
  font-size: .75rem; font-weight: 640; color: #2457f5;
  white-space: nowrap; min-width: 56px; text-align: center;
}
.nxm-file .f-del {
  width: 32px; height: 32px; border-radius: 7px;
  display: grid; place-items: center; color: #6a7078; font-size: .875rem;
}
.nxm-file .f-del:hover { background: #fee2e2; color: #b91c1c; }

/* 详情页资料区：编辑模式删除按钮与添加块 */
body.nx-edit .dl-item { position: relative; padding-right: 58px; }
.nx-f-del {
  position: absolute; top: 50%; right: 14px; transform: translateY(-50%); z-index: 6;
  width: 32px; height: 32px; border-radius: 8px;
  display: grid; place-items: center;
  background: rgba(20, 22, 26, .06); color: #6a7078; font-size: .875rem;
}
.nx-f-del:hover { background: #dc2626; color: #fff; }
.nx-add-file {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  padding: 18px 16px;
  border: 2px dashed rgba(36, 87, 245, .5); border-radius: 12px;
  background: rgba(36, 87, 245, .04);
  color: #2457f5; font-size: .9375rem; font-weight: 640;
  cursor: pointer; transition: background .2s, border-color .2s;
}
.nx-add-file:hover { background: rgba(36, 87, 245, .09); border-color: #2457f5; }

/* 图片选择器 */
.nxm-imgpick { display: grid; gap: 14px; margin-top: 8px; }
.nxp-prev {
  width: 100%; max-height: 240px; object-fit: contain;
  border-radius: 10px; border: 1px solid #e6e6e2; background: #f6f6f4;
}
.nx-uploading { opacity: .6; pointer-events: none; }

/* 确认弹窗 */
.nxm-confirm p { font-size: .9063rem; color: #2a2d33; line-height: 1.65; margin: 2px 0 0; }

/* 登录弹窗 */
.nxm-login .nxm-body { padding-top: 8px; }
.nxm-login input[type="password"] {
  width: 100%; padding: 12px 14px; margin-top: 8px;
  border: 1px solid #e6e6e2; border-radius: 9px; font-size: 1rem; outline: none;
}
.nxm-login input[type="password"]:focus { border-color: #2457f5; box-shadow: 0 0 0 3px rgba(36, 87, 245, .12); }
.nxm-login .login-msg { margin-top: 10px; font-size: .8438rem; color: #b91c1c; }
.nxm-login .login-foot { margin-top: 12px; font-size: .7813rem; color: #6a7078; }

/* ---------- Toast ---------- */
#nxToastRoot {
  position: fixed; top: 18px; left: 50%; transform: translateX(-50%);
  z-index: 9999; display: flex; flex-direction: column; align-items: center; gap: 8px;
  pointer-events: none; width: min(92vw, 460px);
}
.nx-toast {
  padding: 11px 18px; border-radius: 10px;
  background: rgba(16, 18, 20, .94); color: #fff;
  font-size: .875rem; font-weight: 560; line-height: 1.5;
  box-shadow: 0 12px 32px -10px rgba(0, 0, 0, .5);
  opacity: 0; transform: translateY(-8px);
  transition: opacity .25s, transform .25s;
  text-align: center;
}
.nx-toast.is-show { opacity: 1; transform: none; }
.nx-toast.is-out { opacity: 0; }
.nx-toast.is-err { background: #b91c1c; }

/* ---------- 移动端适配 ---------- */
@media (max-width: 640px) {
  .nx-modal-mask { padding: 0; align-items: flex-end; }
  .nx-modal-card {
    max-width: 100% !important; max-height: 94vh;
    border-radius: 18px 18px 0 0;
  }
  .nx-modal-mask.is-open .nx-modal-card { transform: none; }
  .nxm-row2 { grid-template-columns: 1fr; }
  .nxm-imgs { grid-template-columns: repeat(2, 1fr); }
  .nxm-vid { grid-template-columns: 1fr auto; }
  .nxm-vid input.v-t { grid-column: 1 / -1; }
  .nxm-file { grid-template-columns: 1fr auto; }
  .nxm-file input.f-u { grid-column: 1 / -1; }
  .nx-edit-btn-text { display: none; }
  #nxEditBtn { padding: 12px 15px; }
  #nxBar .nx-bar-status { font-size: .7813rem; }
}

/* ---------- 编辑模式下隐藏购物与支付交互（避免与就地编辑冲突） ---------- */
body.nx-edit .nxct-btn { display: none !important; }
body.nx-edit .card-cart { display: none !important; }
body.nx-edit .detail-buy { display: none !important; }
body.nx-edit .nxqa-root { display: none !important; }
body.nx-edit .nxct,
body.nx-edit .nxct-mask { display: none !important; }

/* ---------- 价签编辑行（产品弹窗 · 多规格） ---------- */
.nxm-tag {
  display: grid; grid-template-columns: 1fr 1fr; gap: 8px 10px;
  padding: 10px; margin-top: 8px;
  background: #fafaf8;
  border: 1px solid #e6e6e2; border-radius: 10px;
}
.nxm-tag label { margin-top: 0; min-width: 0; }
.nxm-tag-del { grid-column: 1 / -1; justify-self: start; }
@media (max-width: 640px) {
  .nxm-tag { grid-template-columns: 1fr; }
}

/* 价格 ▾ 控件（议价选项）：文本输入 + 右侧下拉箭头，替代数字增减箭头 */
.nxm-tag-price { margin-top: 0; min-width: 0; }
.nxm-tag-price-lb { display: block; font-size: .8125rem; font-weight: 620; color: #2a2d33; margin-bottom: 6px; }
.nxm-tag-price-lb .nxm-note { font-weight: 500; }
.nxm-price-ctl { position: relative; display: flex; }
.nxm-price-ctl input { padding-right: 30px !important; }
.nxm-price-ctl.is-neg input {
  color: #b45309; background: #fffdf7; border-color: #f2d9ad; font-weight: 650;
}
.nxm-price-btn {
  position: absolute; top: 2px; right: 2px; bottom: 2px; width: 26px;
  display: grid; place-items: center; padding: 0;
  color: #6a7078; background: transparent;
  border: 0; border-left: 1px solid #e6e6e2;
  border-radius: 0 8px 8px 0; font-size: 11px; line-height: 1; cursor: pointer;
}
.nxm-price-btn:hover { color: #2457f5; background: #f6f6f4; }
.nxm-price-ctl.is-neg .nxm-price-btn { color: #b45309; border-left-color: #f2d9ad; }
.nxm-price-menu {
  position: fixed; z-index: 4000;
  min-width: 212px;
  padding: 4px;
  background: #fff;
  border: 1px solid #e2e2dd;
  border-radius: 10px;
  box-shadow: 0 10px 30px rgba(16, 24, 40, .16);
}
.nxm-price-menu .nxm-pm-item {
  display: block; width: 100%; text-align: left; white-space: nowrap;
  padding: 10px 11px; border-radius: 7px;
  font-size: .875rem; color: #14161a;
  background: transparent; border: 0; cursor: pointer;
}
.nxm-price-menu .nxm-pm-item:hover { background: #f6f6f4; color: #2457f5; }

/* ---------- 价签图片（产品弹窗内：素材库选图 / 上传 / 清除） ---------- */
.nxm-tag-img {
  grid-column: 1 / -1;
  display: flex; gap: 10px; align-items: flex-start;
  padding: 8px 10px;
  border: 1px dashed #d9d9d4; border-radius: 10px;
  background: #fff;
}
.nxm-tag-thumb {
  flex: none; width: 56px; height: 56px; border-radius: 8px; overflow: hidden;
  display: grid; place-items: center;
  border: 1px solid #e6e6e2; background: #f6f6f4;
  color: #98a2b3; font-size: .75rem;
}
.nxm-tag-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.nxm-tag-imgops { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; min-width: 0; }
.nxm-tag-imgops .nxm-note { flex-basis: 100%; }

/* ---------- 副价签「不可搭配主体」chips（g 版） ---------- */
.nxm-tag-no {
  grid-column: 1 / -1;
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px;
}
.nxm-tag-no-lb { font-size: .75rem; color: #6a7078; flex: none; }
.nxm-tag-no-chip {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: .75rem; color: #14161a;
  background: #fff; border: 1px solid #d9d9d4; border-radius: 999px;
  padding: 2px 9px; cursor: pointer; user-select: none;
}
.nxm-tag-no-chip input { margin: 0; width: 13px; height: 13px; accent-color: #d92d20; }
.nxm-tag-no-chip:hover { border-color: #98a2b3; }
.nxm-tag-no-chip:has(input:checked) { border-color: #d92d20; color: #d92d20; background: #fef3f2; }

/* ---------- 素材库选择弹窗（编辑器内 libPickModal）：左目录树 + 右文件 ---------- */
.nxm-lib { display: flex; flex-direction: column; }
.nxm-lib-bar { flex: none; display: flex; align-items: baseline; margin-bottom: 10px; min-height: 22px; }
.nxm-lib-body { min-height: 160px; }
.nxm-lib-count { font-size: .8125rem; color: #6a7078; margin-right: 4px; }
.nxlp-wrap { display: grid; grid-template-columns: 172px minmax(0, 1fr); gap: 12px; }
.nxlp-tree { max-height: 48vh; overflow: auto; padding-right: 8px; border-right: 1px solid #e6e6e2; }
.nxlp-row {
  display: flex; align-items: center; gap: 5px;
  min-height: 34px; padding: 0 6px;
  border-radius: 7px; cursor: pointer; user-select: none;
}
.nxlp-row:hover { background: #f6f6f4; }
.nxlp-row.is-on { background: rgba(36, 87, 245, .08); color: #2457f5; }
.nxlp-row.is-on .nxlp-rn { color: #2457f5; }
.nxlp-caret { flex: none; width: 12px; font-size: .625rem; color: #98a2b3; text-align: center; }
.nxlp-caret.is-bt { cursor: pointer; }
.nxlp-caret.is-bt:hover { color: #14161a; }
.nxlp-rname { flex: 1; min-width: 0; font-size: .8438rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nxlp-rn { flex: none; font-size: .7188rem; color: #98a2b3; font-variant-numeric: tabular-nums; }
.nxlp-l1 { padding-left: 6px; }
.nxlp-l2 { padding-left: 19px; }
.nxlp-l3 { padding-left: 32px; }
.nxlp-top { font-weight: 600; }
.nxlp-div { border-top: 1px solid #e6e6e2; margin: 6px 2px; }
.nxlp-bc { font-size: .8438rem; font-weight: 650; }
.nxlp-bc-n { margin-left: 8px; font-size: .75rem; color: #98a2b3; }
.nxlp-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.nxlp-item {
  position: relative; text-align: left;
  border: 2px solid transparent; border-radius: 12px;
  padding: 5px; background: #f6f6f4; cursor: pointer;
  transition: border-color .2s, box-shadow .2s;
}
.nxlp-item:hover { border-color: #d9d9d4; }
.nxlp-item.is-on { border-color: #2457f5; box-shadow: 0 0 0 3px rgba(36, 87, 245, .14); }
.nxlp-thumb {
  display: block; aspect-ratio: 1 / 1; border-radius: 8px; overflow: hidden;
  background: #fff;
}
.nxlp-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.nxlp-name {
  display: block; font-size: .75rem; color: #2a2d33; line-height: 1.4;
  padding: 6px 3px 2px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.nxlp-check {
  position: absolute; top: 9px; right: 9px;
  width: 22px; height: 22px; border-radius: 50%;
  display: none; place-items: center;
  background: #2457f5; color: #fff; font-size: .75rem; font-weight: 700;
}
.nxlp-item.is-on .nxlp-check { display: grid; }
@media (max-width: 640px) {
  .nxlp-wrap { grid-template-columns: 1fr; }
  .nxlp-tree { max-height: 140px; border-right: 0; border-bottom: 1px solid #e6e6e2; padding: 0 0 8px; }
  .nxlp-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ---------- 上传方式弹窗（nlu：按大小 / 按尺寸 / 原图） ---------- */
.nlu-opts { display: flex; flex-direction: column; gap: 9px; margin-top: 10px; }
.nlu-opt {
  display: flex; gap: 11px; align-items: flex-start;
  padding: 11px 13px;
  background: #fff;
  border: 1.5px solid #e6e6e2;
  border-radius: 10px;
  cursor: pointer;
  transition: border-color .2s, background .2s;
}
.nlu-opt:hover { border-color: #d9d9d4; }
.nlu-opt.is-sel { border-color: #2457f5; background: rgba(36, 87, 245, .05); }
.nlu-rd { flex: none; width: 18px; height: 18px; margin-top: 2px; border: 2px solid #d9d9d4; border-radius: 50%; background: #fff; position: relative; }
.nlu-opt.is-sel .nlu-rd { border-color: #2457f5; }
.nlu-opt.is-sel .nlu-rd::after { content: ""; position: absolute; inset: 3px; border-radius: 50%; background: #2457f5; }
.nlu-tx { min-width: 0; }
.nlu-tx b { display: block; font-size: .9375rem; font-weight: 650; }
.nlu-tx i { display: block; font-style: normal; font-size: .7813rem; color: #6a7078; margin-top: 1px; line-height: 1.5; }
.nlu-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.nlu-chip {
  min-height: 32px; padding: 0 12px;
  font-size: .7813rem; font-weight: 600;
  color: #6a7078; background: #fff;
  border: 1px solid #d9d9d4; border-radius: 999px;
}
.nlu-chip.is-on { color: #fff; background: #14161a; border-color: #14161a; }

/* ---------- 上传重名询问弹窗（n 版：文件名清单，单列、限高可滚） ---------- */

.nxm-dup-list {
  margin: 8px 0 12px; padding: 7px 12px;
  max-height: 132px; overflow-y: auto; overscroll-behavior: contain;
  background: #f7f8f9; border: 1px solid #e6e6e2; border-radius: 10px;
}
.nxm-dup-name { padding: 3.5px 0; font-size: .8125rem; color: #14161a; word-break: break-all; }
.nxm-dup-name + .nxm-dup-name { border-top: 1px dashed #e6e6e2; }
.nxm-dup-more { color: #6a7078; }
