/**
 * @copyright © 2026 易企网ERP订货系统. 保留所有权利.
 * 本文件为系统源码之一，仅供授权使用，禁止未经授权的复制、修改与分发。
 */
/* ==========================================================================
   v1.2.23 · 商户后台框架收窄层（回到用户原始要求效果）
   --------------------------------------------------------------------------
   背景：v1.2.22 的 ui22.css 把一级侧栏撑到 216px、二级撑到 186px，
   合计 402px 占位，用户反馈「左侧一级和二级占位太宽」。
   用户「原来的要求」= ui.css 里对齐 jxc.erpsap.cn 参考系统的那套：
     · 一级 92px 深色 #1a1d24 窄条、白色圆 logo 居中、图标+2 字菜单
       （1.2.14 落地值，sys_settings.ui.sidebar_width = 92）
     · 二级 152px 窄栏（@1280），本版再收到 140px
     · 顶栏 56px 纯白、页签白底蓝色下划线
   本文件最后加载，用与 ui22.css 同形式的高权重选择器覆盖框架，
   ★ 只改框架尺寸与配色，不动 x-* 组件库，不影响登录页与 JS 契约。
   ★ [hidden] 必须保留且置顶（登录遮罩铁律）。
   ========================================================================== */
[hidden], .hidden { display: none !important; }

/* ==========================================================================
   1. 一级侧栏：92px 深色窄条
   ========================================================================== */
body.merchant .app .sidebar {
  width: 92px !important;
  min-width: 92px !important;
  max-width: 92px;
  background: #1a1d24 !important;
  border-right: 0 !important;
  box-shadow: none !important;
  z-index: 12;
}
body.merchant .app .sb-brand {
  height: 58px !important;
  padding: 0 !important;
  justify-content: center !important;
  gap: 0 !important;
  background: transparent !important;
  border-bottom: 1px solid rgba(255, 255, 255, .06) !important;
}
body.merchant .app .sb-logo {
  width: 30px !important; height: 30px !important;
  border-radius: 50% !important;
  background: #fff !important;
  box-shadow: 0 2px 10px rgba(0, 0, 0, .28) !important;
  color: #1677ff !important;
}
body.merchant .app .sb-logo .ico { width: 17px !important; height: 17px !important; color: #1677ff !important; }
body.merchant .app .sb-name { display: none !important; }
body.merchant .app .sb-menu { padding: 4px 6px 6px !important; }
body.merchant .app .sb-menu-label { display: none !important; }
/* ★ v1.2.42：菜单项上下间距从 1px 放宽到 5px，高度 34→38px，缓解拥挤感 */
body.merchant .app .sb-item { margin: 0 0 5px !important; }
body.merchant .app .sb-item > a {
  height: 38px !important;
  padding: 0 6px !important;
  justify-content: flex-start !important;
  gap: 6px !important;
  border-radius: 8px !important;
  border-left: 0 !important;
  font-size: 15px !important;
  font-weight: 600 !important;
  letter-spacing: .5px !important;
  text-transform: uppercase !important;
  color: #9aa7b8 !important;
  background: transparent !important;
  box-shadow: none !important;
}
body.merchant .app .sb-item > a > span {
  display: inline !important;
  font-size: 15px !important;
  font-weight: 600 !important;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: clip;
}
body.merchant .app .sb-item > a .ico {
  width: 17px !important; height: 17px !important;
  color: #9aa7b8 !important; flex: none;
}
body.merchant .app .sb-item > a:hover { background: #232833 !important; color: #e6ecf5 !important; }
body.merchant .app .sb-item > a:hover .ico { color: #b9c4d4 !important; }
body.merchant .app .sb-item.on > a {
  background: #2b3444 !important;
  color: #fff !important;
  box-shadow: none !important;
}
body.merchant .app .sb-item.on > a .ico { color: #409eff !important; }
body.merchant .app .sb-item.on > a::before { display: none !important; }
body.merchant .app .sb-foot { display: none !important; }

/* ==========================================================================
   2. 顶栏 56px + 二级 140px 窄栏
   ========================================================================== */
body.merchant .app .topbar {
  height: 56px !important; min-height: 56px !important;
  padding: 0 18px !important;
  border-bottom: 1px solid #eef1f6 !important;
}
body.merchant .app .subnav {
  width: 140px !important; min-width: 140px !important; max-width: 140px;
  padding: 10px 6px 18px !important;
  background: #fff !important;
  border-right: 1px solid var(--x-line) !important;
  overflow-y: auto;
}
body.merchant .app .sub-group {
  padding: 8px 8px 4px !important;
  font-size: 10px !important; letter-spacing: .3px;
}
body.merchant .app .subnav a {
  height: 31px !important;
  padding: 0 9px !important;
  margin: 1px 2px !important;
  font-size: 12px !important;
  border-radius: 7px !important;
  white-space: nowrap;
}
body.merchant .app .subnav a span { overflow: hidden; text-overflow: ellipsis; }
body.merchant .app .subnav a.on::before { top: 8px; height: 15px; }
body.merchant .app .content { min-width: 0; flex: 1; }
body.merchant .app .tabs {
  height: 38px !important; min-height: 38px !important;
  padding: 0 18px !important;
}
body.merchant .app .tabs .tab { padding: 0 12px; font-size: 12.5px; }
body.merchant .app .page { padding: 16px 18px 32px !important; max-width: 1720px; }
body.merchant .app .banner { margin: 8px 18px 0 !important; }

/* 窄屏继续折叠（保持 ui.css / ui22.css 的既有行为，不反向变宽） */
@media (max-width: 980px) {
  body.merchant .app .sidebar { width: 62px !important; min-width: 62px !important; max-width: 62px; }
  body.merchant .app .sb-item > a { justify-content: center !important; padding: 0 !important; }
  body.merchant .app .sb-item > a > span { display: none !important; }
  body.merchant .app .subnav { width: 130px !important; min-width: 130px !important; max-width: 130px; }
}

/* ==========================================================================
   3. v1.2.23 合并容器（标题 + 右上角横排选项卡 + 内容区）
      ★ 用户 11-08 明确要求：细分类目放在右上角横排以选项卡样式展示
   ========================================================================== */
.x23-page { color: var(--x-ink); font-size: 13px; }
.x23-page * { box-sizing: border-box; }
.x23-head { margin-bottom: 14px !important; align-items: flex-end !important; }
.x23-head h3 { font-size: 18px !important; }
.x23-seg { flex-wrap: wrap; justify-content: flex-end; }
.x23-seg button.x23-btn {
  height: 29px; padding: 0 13px; border: 0; border-radius: 7px;
  background: transparent; color: var(--x-ink-2); font-size: 12.5px;
  cursor: pointer; white-space: nowrap; font-weight: 500;
}
.x23-seg button.x23-btn:hover { color: var(--x-primary); }
.x23-seg button.x23-btn.on {
  background: #fff; color: var(--x-primary); font-weight: 650;
  box-shadow: 0 1px 5px rgba(16, 24, 40, .10);
}
.x23-note {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  padding: 9px 13px; margin-bottom: 14px; border-radius: 9px;
  background: #f5f9ff; border: 1px solid #dbe6fb; color: #4a5a70; font-size: 12px; line-height: 1.6;
}
.x23-note b { font-weight: 600; color: #2b6cf6; }
.x23-note .x23-chip {
  display: inline-block; padding: 1px 7px; border-radius: 5px;
  background: #eaf1ff; color: #2b6cf6; font-size: 11.5px;
}
.x23-body { min-height: 180px; }
.x23-loading { padding: 36px 16px; text-align: center; color: var(--x-ink-3); font-size: 12.5px; }
.x23-tip { margin: 14px 0 0; font-size: 11.5px; color: var(--x-ink-3); line-height: 1.7; }

/* 合并容器里的旧页面（card / tabs / form）统一间距，避免像补丁拼贴 */
.x23-body > .card,
.x23-body > .mkt-page,
.x23-body > .x-page { margin-top: 0; }
.x23-body .card-title { font-size: 14px; }
@media (max-width: 1100px) {
  .x23-head { flex-direction: column; align-items: flex-start !important; }
  .x23-seg { justify-content: flex-start; }
}

/* ==========================================================================
   ★ v1.2.42 商品表单重构：布局修复 + 多规格开关 + 价格区
   ========================================================================== */
/* 根因修复：.form-item 全局 width:50% 会与 .pd-form 两列网格叠加，
   导致每个输入框只占单元格一半、右侧留大片空白。网格内的项应占满单元格。 */
body.merchant .pd-form .form-item,
body.merchant .pd-aside .form-item { width: 100% !important; margin-bottom: 12px; }
body.merchant .pd-form .form-item.full { grid-column: 1 / -1; }
/* 价格区：单规格时三列对齐（进价/售价/成本），单位与库存下限各占一格 */
body.merchant .pd-price-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px 18px; }
@media (max-width: 900px) { body.merchant .pd-price-grid { grid-template-columns: 1fr 1fr; } }
/* 多规格开关条 */
body.merchant .pd-spec-bar { display: flex; align-items: center; gap: 12px;
  padding: 6px 0 16px; border-bottom: 1px dashed var(--line, #e6ebf2); margin-bottom: 16px; }
body.merchant .pd-spec-t { font-size: 14px; color: var(--txt-1, #1f2d3d); }
body.merchant .pd-spec-hint { font-size: 12px; color: var(--txt-3, #93a1b3); }
/* SKU 行内编辑表格：输入框紧凑 */
body.merchant .pd-sku-tbl { table-layout: fixed; }
body.merchant .pd-sku-tbl th { font-size: 12px; white-space: nowrap; }
body.merchant .pd-sku-tbl .inp,
body.merchant .pd-sku-tbl .sel { height: 32px; font-size: 13px; padding: 0 8px; }
body.merchant .pd-sku-tbl td { padding: 6px 8px; }

/* ==========================================================================
   ★ v1.2.44 商品资料整页表单：两栏紧凑布局 + 图文详情编辑器
   ========================================================================== */
.pf-layout { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 14px; align-items: start; }
@media (max-width: 1100px) { .pf-layout { grid-template-columns: 1fr; } }
.pf-editor .pf-ed-tool { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.pf-editor .pf-ed-tool .x-btn { min-width: 32px; }
.pf-editor .pf-ed-body:empty::before { content: "在此输入商品图文详情，可插入图片…"; color: #b6bfcc; }
.pf-editor .pf-ed-body img { max-width: 100%; border-radius: 6px; }

/* ==========================================================================
   ★ v1.2.55 单据列表增强（采购/销售共用 docList）
   ========================================================================== */
.x-table-doc th.ta-r, .x-table-doc td.ta-r { text-align: right; }
.x-table-doc td.td-num { font-variant-numeric: tabular-nums; }
.x-tbl-sum { display: flex; gap: 18px; align-items: center; flex-wrap: wrap;
  padding: 10px 14px; border-top: 1px solid #eef2f7; background: #fafbfd;
  font-size: 13px; color: #6b7a90; }
.x-tbl-sum b { color: #1f2d3d; font-weight: 700; margin-left: 4px; }
.x-pg-info { font-size: 12px; color: #93a1b3; margin-right: 8px; }
.x-pg.off { opacity: .45; cursor: not-allowed; }

/* ==========================================================================
   ★ v1.2.57 商城基础设置（现代卡片式）+ 底部导航图标
   ========================================================================== */
.mset { display: flex; flex-direction: column; gap: 14px; max-width: 1040px; }
.mset-card { background: #fff; border: 1px solid #e6ebf2; border-radius: 10px; overflow: hidden; }
.mset-hd { padding: 15px 18px; border-bottom: 1px solid #f0f3f8; }
.mset-hd h3 { margin: 0; font-size: 15px; font-weight: 700; color: #1f2d3d; }
.mset-hd p { margin: 4px 0 0; font-size: 12px; color: #93a1b3; }
.mset-rows { padding: 2px 0; }
.mset-row { display: flex; align-items: center; gap: 24px; padding: 13px 18px; }
.mset-row + .mset-row { border-top: 1px solid #f5f8fb; }
.mset-l { flex: 1; min-width: 0; }
.mset-t { font-size: 13.5px; font-weight: 500; color: #1f2d3d; }
.mset-d { margin-top: 3px; font-size: 12px; color: #93a1b3; line-height: 1.6; }
.mset-r { flex: 0 0 auto; }
.mset-inp { width: 250px; height: 34px; padding: 0 10px; font-size: 13px; color: #1f2d3d;
  background: #fff; border: 1px solid #dfe6ef; border-radius: 6px; outline: none; box-sizing: border-box; }
.mset-inp:focus { border-color: #2b6cf6; box-shadow: 0 0 0 3px rgba(43,108,246,.12); }
.mset-sw { position: relative; display: inline-block; width: 42px; height: 24px; vertical-align: middle; }
.mset-sw input { position: absolute; width: 0; height: 0; opacity: 0; }
.mset-sw span { position: absolute; inset: 0; background: #cfd8e3; border-radius: 99px; cursor: pointer; transition: .2s; }
.mset-sw span::after { content: ""; position: absolute; left: 3px; top: 3px; width: 18px; height: 18px;
  background: #fff; border-radius: 50%; box-shadow: 0 1px 3px rgba(0,0,0,.15); transition: .2s; }
.mset-sw input:checked + span { background: #2b6cf6; }
.mset-sw input:checked + span::after { transform: translateX(18px); }
.mset-foot { display: flex; align-items: center; gap: 10px; }
.mset-note { font-size: 12px; color: #93a1b3; line-height: 1.8; }
.mset-note code { background: #f4f6fa; padding: 1px 5px; border-radius: 4px; color: #4a5a70; }

/* 顶部提示条（原红字堆叠 → 浅蓝提示） */
.x23-note { background: #f5f9ff; border: 1px solid #dbe6fb; border-radius: 8px;
  padding: 10px 14px; font-size: 12.5px; color: #4a5a70; line-height: 2; }
.x23-note b { color: #2b6cf6; font-weight: 600; margin-right: 8px; }
.x23-chip { display: inline-block; margin: 0 4px 0 0; padding: 1px 8px; font-size: 12px;
  color: #2b6cf6; background: #eaf1ff; border-radius: 20px; }
/* 选项卡 */
.x23-btn { height: 32px; padding: 0 14px; font-size: 13px; color: #5f6b7c; background: transparent;
  border: 0; border-radius: 7px; cursor: pointer; }
.x23-btn.on { background: #fff; color: #2b6cf6; font-weight: 600; box-shadow: 0 1px 4px rgba(31,45,61,.1); }

/* 底部导航图标 */
.tab-ico { width: 20px; height: 20px; object-fit: contain; border-radius: 4px; vertical-align: middle; }
.tab-ico-emo { font-size: 17px; line-height: 1; }
.tab-ico-ph { color: #d5dde8; font-size: 14px; }
.ico-grid { display: flex; flex-wrap: wrap; gap: 8px; }
.ico-pick { width: 48px; height: 48px; font-size: 22px; line-height: 1; background: #fff;
  border: 1px solid #e6ebf2; border-radius: 8px; cursor: pointer; }
.ico-pick:hover { border-color: #2b6cf6; }
