/* =====================================================================
   三鑫 Sinwelly 质保服务系统 —— 后台样式（复刻原型视觉）
   ===================================================================== */
:root {
  --c-primary: #2563eb;
  --c-primary-d: #1d4ed8;
  --c-primary-l: #eff6ff;
  --c-dark: #1a2332;
  --c-dark2: #2d3a4f;
  --c-text: #1a2332;
  --c-text2: #374151;
  --c-text3: #6b7280;
  --c-text4: #9ca3af;
  --c-border: #e5e7eb;
  --c-border-l: #f0f0f0;
  --c-bg: #f0f2f5;
  --c-green: #059669;
  --c-orange: #d97706;
  --c-red: #ef4444;
}

* { box-sizing: border-box; }
body {
  margin: 0; background: var(--c-bg); color: var(--c-text); font-size: 14px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}
a { text-decoration: none; color: var(--c-primary); }

/* ---------------- 顶部导航 ---------------- */
.sx-topbar {
  height: 56px; background: linear-gradient(135deg, #1a2332 0%, #2d3a4f 100%);
  display: flex; align-items: center; padding: 0 24px; position: fixed; top: 0; left: 0; right: 0;
  z-index: 1000; box-shadow: 0 2px 8px rgba(0, 0, 0, .15);
}
.sx-logo-area { display: flex; align-items: center; gap: 12px; }
.sx-logo-icon {
  width: 36px; height: 36px; background: #fff; border-radius: 8px; display: flex;
  align-items: center; justify-content: center; font-weight: 900; color: #1a2332; font-size: 14px; letter-spacing: -1px;
}
.sx-logo-text .cn { color: #fff; font-size: 16px; font-weight: 700; letter-spacing: 2px; }
.sx-logo-text .en { color: #8b95a7; font-size: 10px; letter-spacing: 1px; }
.sx-topbar-right { margin-left: auto; display: flex; align-items: center; gap: 16px; color: #c0c8d4; font-size: 13px; }
.sx-user-avatar {
  width: 32px; height: 32px; border-radius: 50%; background: #f59e0b; display: flex;
  align-items: center; justify-content: center; color: #fff; font-weight: 600; font-size: 13px; cursor: pointer;
}
.sx-topbar-right .sx-link { color: #c0c8d4; cursor: pointer; }
.sx-topbar-right .sx-link:hover { color: #fff; }

/* ---------------- 布局 ---------------- */
.sx-layout { padding-top: 56px; min-height: 100vh; }
.sx-sidebar {
  width: 200px; background: #fff; border-right: 1px solid var(--c-border);
  position: fixed; top: 56px; bottom: 0; left: 0; padding: 12px 0; overflow-y: auto; z-index: 900;
}
.sx-sidebar::-webkit-scrollbar { width: 6px; }
.sx-sidebar::-webkit-scrollbar-thumb { background: #d1d5db; border-radius: 3px; }
.sx-menu-group-title {
  padding: 14px 20px 8px; font-size: 11px; color: var(--c-text4); letter-spacing: 1px;
}
.sx-menu-item {
  padding: 10px 20px; display: flex; align-items: center; gap: 10px; color: #4b5563;
  cursor: pointer; transition: all .2s; font-size: 14px; border-left: 3px solid transparent;
}
.sx-menu-item:hover { background: #f3f4f6; color: var(--c-text); }
.sx-menu-item.active { background: var(--c-primary-l); color: var(--c-primary); border-left-color: var(--c-primary); font-weight: 600; }
.sx-menu-item i { width: 18px; text-align: center; font-size: 15px; }
.sx-main { margin-left: 200px; padding: 16px 20px; }

/* ---------------- 页签 ---------------- */
.sx-tabs { display: flex; align-items: center; gap: 4px; margin-bottom: 12px; background: #fff; padding: 5px 6px; border-radius: 8px; overflow: hidden; }
.sx-tabs-scroll { flex: 1 1 auto; min-width: 0; display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; }
.sx-tabs-scroll::-webkit-scrollbar { height: 0; display: none; }
.sx-tabs-tools { flex: 0 0 auto; display: flex; gap: 2px; margin-left: 6px; padding-left: 6px; border-left: 1px solid var(--c-border-l); }
.sx-tab-tool {
  display: flex; align-items: center; gap: 4px; font-size: 12px; color: var(--c-text3);
  padding: 6px 9px; border-radius: 6px; cursor: pointer; white-space: nowrap; transition: all .15s;
}
.sx-tab-tool:hover { background: #f3f4f6; color: var(--c-text); }
.sx-tab-tool.disabled { opacity: .4; pointer-events: none; }
.sx-tab {
  flex: 0 0 auto;
  padding: 7px 16px; border-radius: 6px; cursor: pointer; font-size: 13px; color: var(--c-text3);
  font-weight: 500; white-space: nowrap; display: flex; align-items: center; gap: 6px;
}
.sx-tab:hover { color: var(--c-text); background: #f3f4f6; }
.sx-tab.active { background: var(--c-primary); color: #fff; }
.sx-tab .close { font-size: 14px; line-height: 1; opacity: .6; padding: 0 2px; border-radius: 3px; }
.sx-tab .close:hover { opacity: 1; background: rgba(0,0,0,.12); }
.sx-tab.active .close:hover { background: rgba(255,255,255,.25); }
.sx-iframe-wrap { background: #fff; border-radius: 8px; overflow: hidden; }
.sx-iframe { width: 100%; border: 0; display: block; min-height: calc(100vh - 140px); }

/* ---------------- 面包屑 ---------------- */
.sx-breadcrumb { font-size: 13px; color: var(--c-text3); margin-bottom: 14px; }
.sx-breadcrumb span { color: var(--c-text); font-weight: 500; }

/* ---------------- 卡片 ---------------- */
.sx-card { background: #fff; border-radius: 10px; box-shadow: 0 1px 3px rgba(0, 0, 0, .06); margin-bottom: 16px; overflow: hidden; }
.sx-card-header { padding: 15px 20px; border-bottom: 1px solid var(--c-border-l); display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; }
.sx-card-title { font-size: 15px; font-weight: 600; color: var(--c-text); display: flex; align-items: center; gap: 8px; }
.sx-card-title::before { content: ''; width: 3px; height: 16px; background: var(--c-primary); border-radius: 2px; }
.sx-card-body { padding: 20px; }

/* ---------------- 板块 ---------------- */
.sx-section { padding: 18px 22px; }
.sx-section + .sx-section { border-top: 2px dashed var(--c-border); }
.sx-section-title { font-size: 14px; font-weight: 700; color: var(--c-text); margin-bottom: 16px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.sx-section-title .num {
  display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px;
  background: var(--c-dark); color: #fff; border-radius: 5px; font-size: 12px;
}
.sx-section-title .tag { font-size: 12px; color: var(--c-text3); font-weight: 400; }

/* ---------------- 表单 ---------------- */
.sx-row { display: flex; gap: 18px; margin-bottom: 15px; flex-wrap: wrap; }
.sx-col { flex: 1; min-width: 0; }
.sx-col-half { flex: 0 0 calc(50% - 9px); }
.sx-col-third { flex: 0 0 calc(33.333% - 12px); }
.sx-col-full { flex: 0 0 100%; }
.sx-label { display: block; font-size: 13px; color: var(--c-text2); margin-bottom: 6px; font-weight: 600; }
.sx-label .required { color: var(--c-red); margin-right: 2px; }
.sx-label .readonly-tag {
  font-size: 10px; background: #f3f4f6; color: var(--c-text3); padding: 1px 6px;
  border-radius: 3px; margin-left: 6px; font-weight: 400;
}
.sx-input, .sx-select, .sx-textarea {
  width: 100%; height: 36px; padding: 0 12px; border: 1px solid #d1d5db; border-radius: 6px;
  font-size: 13px; color: var(--c-text); background: #fff; outline: none; transition: border-color .2s;
  font-family: inherit;
}
/* 占位文字统一为可辨识的灰，避免「看起来是空的」 */
.sx-input::placeholder, .sx-textarea::placeholder { color: #9ca3af; opacity: 1; }
.sx-select { cursor: pointer; }
.sx-input:hover, .sx-select:hover, .sx-textarea:hover { border-color: #b9c0cb; }
.sx-input:focus, .sx-select:focus, .sx-textarea:focus { border-color: var(--c-primary); box-shadow: 0 0 0 3px rgba(37, 99, 235, .1); }
.sx-input.readonly, .sx-input[readonly] { background: #f9fafb; color: var(--c-text3); cursor: not-allowed; }
.sx-textarea { height: 80px; padding: 9px 12px; resize: vertical; line-height: 1.6; }
.sx-input-suffix { position: relative; }
.sx-input-suffix .suffix { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); color: var(--c-text4); font-size: 13px; }
.sx-char-count { text-align: right; font-size: 11px; color: var(--c-text4); margin-top: 4px; }
.sx-input-sm { height: 32px !important; font-size: 12px !important; }
select.sx-select { appearance: auto; }

/* =====================================================================
   可搜索下拉选择器（SX.searchSelect —— 原生 select 增强）
   ---------------------------------------------------------------------
   结构（由 JS 生成）：
   <span class="sx-ss">
     <select …>                 <- 原生控件保留，仅作「值容器」，文字透明
     <span class="sx-ss-display">  <- 视觉层，覆盖在 select 上、接管点击
       <input class="sx-ss-input"> <- 触发框本身就是输入框：既显示已选文案，
                                      也能直接输入关键词筛选（不再多一个搜索框）
       <span class="sx-ss-clear">×</span>
       <span class="sx-ss-arrow"></span>
     </span>
   </span>
   <div class="sx-ss-panel">    <- 浮层挂在 body 下、position:fixed，不受父级裁剪
                                  （浮层内只有选项列表，没有搜索框）
   ===================================================================== */
.sx-ss { position: relative; display: block; width: 100%; max-width: 100%; }
/* select 只提供尺寸给布局：文字透明、隐藏自带箭头、不接收指针事件 */
.sx-ss > select {
  display: block;
  -webkit-appearance: none !important; -moz-appearance: none !important; appearance: none !important;
  background-image: none !important;
  color: transparent !important; text-shadow: none !important;
  pointer-events: none !important;
}
.sx-ss > select::-ms-expand { display: none; }
.sx-ss.is-disabled > select { background: #f9fafb; border-color: var(--c-border); }

/* 视觉层：与 select 完全同框 */
.sx-ss-display {
  position: absolute; left: 0; right: 0; top: 0; bottom: 0;
  display: flex; align-items: center;
  padding: 0;                          /* 内边距由内部 input 按 select 的实际值对齐 */
  font-size: 13px; color: var(--c-text);
  cursor: text; overflow: hidden; border-radius: 6px;
  outline: none;
}
/* 触发框 = 输入框：透明背景、无边框，直接坐落在原生 select 之上 */
.sx-ss-input {
  flex: 1 1 auto; min-width: 0; width: 100%; height: 100%;
  padding: 0 30px 0 12px;              /* JS 会按 select 的实际内边距覆盖 */
  border: 0; outline: none; background: transparent;
  font-family: inherit; font-size: inherit; color: inherit;
  line-height: 1.4; text-overflow: ellipsis; cursor: text;
}
.sx-ss-input::placeholder { color: #9ca3af; opacity: 1; }
.sx-ss.open .sx-ss-input { cursor: text; }
.sx-ss.is-disabled > .sx-ss-display { color: var(--c-text4); cursor: not-allowed; }
.sx-ss.is-disabled .sx-ss-input { cursor: not-allowed; color: var(--c-text4); }
.sx-ss.is-disabled > .sx-ss-display .sx-ss-arrow { border-top-color: #d1d5db; }
.sx-ss.is-disabled > .sx-ss-display .sx-ss-clear { display: none !important; }
.sx-ss-arrow {
  position: absolute; right: 11px; top: 50%; width: 0; height: 0;
  border-left: 4px solid transparent; border-right: 4px solid transparent;
  border-top: 5px solid #9ca3af;
  transform: translateY(-50%); transition: transform .15s; pointer-events: none;
}
.sx-ss.open .sx-ss-arrow { transform: translateY(-50%) rotate(180deg); border-top-color: var(--c-primary); }
.sx-ss-clear {
  display: none; position: absolute; right: 26px; top: 50%; transform: translateY(-50%);
  width: 16px; height: 16px; border-radius: 50%; background: #d1d5db; color: #fff;
  font-size: 12px; line-height: 15px; text-align: center; cursor: pointer; font-weight: 700;
}
.sx-ss-clear.show { display: block; }
.sx-ss-clear:hover { background: #9ca3af; }

/* 下拉浮层（body 级、fixed 定位）—— 只有选项列表，无搜索框 */
.sx-ss-panel {
  position: fixed; z-index: 19900000; display: none;
  background: #fff; border: 1px solid var(--c-border); border-radius: 8px;
  box-shadow: 0 12px 32px rgba(15, 23, 42, .14); overflow: hidden;
}
.sx-ss-panel.open { display: block; animation: sxSsIn .12s ease-out; }
@keyframes sxSsIn { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
.sx-ss-body { position: relative; max-height: 264px; overflow-y: auto; padding: 4px 0; }
.sx-ss-group {
  font-size: 11px; font-weight: 600; color: var(--c-text3); letter-spacing: .5px;
  padding: 7px 12px 5px; background: #f9fafb; border-top: 1px solid var(--c-border-l);
}
.sx-ss-group:first-child { border-top: none; }
.sx-ss-opt {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 12px; font-size: 13px; color: var(--c-text2); cursor: pointer;
  line-height: 1.4;
}
.sx-ss-opt:hover, .sx-ss-opt.active { background: var(--c-primary-l); color: var(--c-primary-d); }
.sx-ss-opt.selected { color: var(--c-primary); font-weight: 600; }
.sx-ss-opt.selected::after { content: '✓'; margin-left: auto; font-size: 12px; }
.sx-ss-opt.disabled { color: #c4c7ce; cursor: not-allowed; background: #fafafa; }
.sx-ss-opt.disabled:hover { background: #fafafa; color: #c4c7ce; }
.sx-ss-txt { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sx-ss-hl { font-style: normal; font-weight: 700; color: #b45309; background: #fef3c7; border-radius: 2px; }
/* 首字母角标（品牌下拉；option 上写 data-initial="W" 即出现，同时支持按字母检索） */
.sx-ss-ini { font-style: normal; flex: 0 0 auto; margin-left: 6px; font-size: 11px; line-height: 16px; color: #94a3b8; background: #f1f5f9; border-radius: 3px; padding: 0 5px; }
.sx-ss-none { display: none; padding: 18px 12px; text-align: center; font-size: 13px; color: var(--c-text4); }
.sx-ss-panel.has-none .sx-ss-none { display: block; }
.sx-ss-panel.has-none .sx-ss-body { display: none; }
.sx-ss-count { font-size: 11px; color: var(--c-text4); padding: 6px 12px 8px; text-align: right; border-top: 1px solid var(--c-border-l); background: #fafbfc; }

/* 列表筛选栏内的下拉：与 .sx-filter-item .sx-select 尺寸保持一致 */
.sx-filter-item .sx-ss { width: 165px; }
.sx-filter-item .sx-ss-input { font-size: 12px; }
.sx-filter-item .sx-ss-body { max-height: 240px; }
/* 表单行内联样式宽度由 JS 搬到外层容器后，内层 select 固定占满 */
.sx-ss > select.sx-select, .sx-ss > select.sx-form-input, .sx-ss > select.sx-input { width: 100%; }

/* 字段标签 / 必填 / 说明文字（表单通用） */
.sx-req { color: var(--c-red); margin-right: 2px; }
.sx-form-hint { font-size: 12px; color: var(--c-text4); margin-top: 6px; line-height: 1.5; }
.sx-field-label { font-size: 13px; font-weight: 600; color: var(--c-text2); }

/* ---------------- 复选 / 单选（原生控件 + 自绘样式，不依赖 layui 渲染） ---------------- */
/* 兜底：未套用 .sx-check 组件的原生控件也统一为系统主色蓝 */
input[type=checkbox], input[type=radio] { accent-color: var(--c-primary); }
.sx-check-group { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 24px; padding: 4px 0; }
.sx-check, .sx-radio {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 13px; color: var(--c-text2); line-height: 20px;
  cursor: pointer; user-select: none; padding: 4px 0;
  transition: color .15s;
}
.sx-check:hover, .sx-radio:hover { color: var(--c-primary); }
.sx-check > span, .sx-radio > span { white-space: nowrap; }
.sx-check input[type=checkbox], .sx-radio input[type=radio] {
  -webkit-appearance: none; appearance: none; box-sizing: border-box;
  flex: 0 0 auto; position: relative; width: 16px; height: 16px; margin: 0;
  border: 1px solid #cbd5e1; background: #fff; border-radius: 4px;
  cursor: pointer; outline: none;
  transition: background .15s, border-color .15s, box-shadow .15s;
}
.sx-check input[type=checkbox]:hover, .sx-radio input[type=radio]:hover { border-color: var(--c-primary); }
.sx-check input[type=checkbox]:focus-visible, .sx-radio input[type=radio]:focus-visible {
  border-color: var(--c-primary); box-shadow: 0 0 0 3px rgba(37, 99, 235, .15);
}
.sx-check input[type=checkbox]:checked { background: var(--c-primary); border-color: var(--c-primary); }
.sx-check input[type=checkbox]:checked::after {
  content: ''; position: absolute; left: 4px; top: 2px; width: 4px; height: 8px;
  border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg);
}
.sx-radio input[type=radio] { border-radius: 50%; }
.sx-radio input[type=radio]:checked { border-color: var(--c-primary); }
.sx-radio input[type=radio]:checked::after {
  content: ''; position: absolute; left: 4px; top: 4px; width: 6px; height: 6px;
  border-radius: 50%; background: var(--c-primary);
}
.sx-check input[type=checkbox]:disabled, .sx-radio input[type=radio]:disabled {
  background: #f3f4f6; border-color: var(--c-border); cursor: not-allowed;
}
.sx-check input[type=checkbox]:disabled:checked, .sx-radio input[type=radio]:disabled:checked {
  background: #cbd5e1; border-color: #cbd5e1;
}
.sx-check input[type=checkbox]:disabled:checked::after { border-color: #fff; }
/* 表格内紧凑排布 */
.ftable .sx-check-group { gap: 2px 22px; padding: 2px 0; }
.ftable .sx-check, .ftable .sx-radio { padding: 3px 0; }

/* ---------------- 属性胶囊（内容 / 分类表单的「属性」项：推荐 · 置顶 · 热门 · 屏蔽） ---------------- */
.sx-attr-group { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 2px 0 4px; }
.sx-attr {
  position: relative; display: inline-flex; align-items: center; gap: 5px;
  height: 30px; padding: 0 13px; border: 1px solid var(--c-border); border-radius: 999px;
  background: #fff; font-size: 13px; line-height: 1; color: var(--c-text2);
  cursor: pointer; user-select: none;
  transition: color .18s, background .18s, border-color .18s, box-shadow .18s, transform .1s;
}
/* 原生 checkbox / radio 只留语义，不占位 */
.sx-attr input[type=checkbox], .sx-attr input[type=radio] {
  position: absolute; width: 0; height: 0; margin: 0; opacity: 0; pointer-events: none;
}
.sx-attr .sx-attr-ico { font-size: 13px; color: #cbd5e1; transition: color .18s; }
.sx-attr:hover { border-color: #cbd5e1; background: #f9fafb; }
.sx-attr:active { transform: scale(.97); }
.sx-attr input[type=checkbox]:focus-visible + .sx-attr-ico,
.sx-attr input[type=radio]:focus-visible + .sx-attr-ico { outline: 2px solid var(--c-primary); outline-offset: 3px; border-radius: 2px; }
/* 选中态：两套规则各自独立（:has 不被支持时整条丢弃，不影响 .is-on） */
.sx-attr.is-on { border-color: transparent; color: #fff; }
.sx-attr.is-on .sx-attr-ico { color: #fff; }
.sx-attr:has(input:checked) { border-color: transparent; color: #fff; }
.sx-attr:has(input:checked) .sx-attr-ico { color: #fff; }
.sx-attr-recommend.is-on { background: linear-gradient(135deg, #fbbf24, #f59e0b); box-shadow: 0 2px 8px rgba(245, 158, 11, .35); }
.sx-attr-recommend:has(input:checked) { background: linear-gradient(135deg, #fbbf24, #f59e0b); box-shadow: 0 2px 8px rgba(245, 158, 11, .35); }
.sx-attr-top.is-on { background: linear-gradient(135deg, #60a5fa, #2563eb); box-shadow: 0 2px 8px rgba(37, 99, 235, .35); }
.sx-attr-top:has(input:checked) { background: linear-gradient(135deg, #60a5fa, #2563eb); box-shadow: 0 2px 8px rgba(37, 99, 235, .35); }
.sx-attr-hot.is-on { background: linear-gradient(135deg, #fb7185, #ef4444); box-shadow: 0 2px 8px rgba(239, 68, 68, .32); }
.sx-attr-hot:has(input:checked) { background: linear-gradient(135deg, #fb7185, #ef4444); box-shadow: 0 2px 8px rgba(239, 68, 68, .32); }
.sx-attr-screen.is-on { background: linear-gradient(135deg, #94a3b8, #64748b); box-shadow: 0 2px 8px rgba(100, 116, 139, .32); }
.sx-attr-screen:has(input:checked) { background: linear-gradient(135deg, #94a3b8, #64748b); box-shadow: 0 2px 8px rgba(100, 116, 139, .32); }
/* 单选组（属性类型 / 状态 / 可否添加…）统一走主色 */
.sx-attr-radio.is-on { background: linear-gradient(135deg, #60a5fa, #2563eb); box-shadow: 0 2px 8px rgba(37, 99, 235, .32); }
.sx-attr-radio:has(input:checked) { background: linear-gradient(135deg, #60a5fa, #2563eb); box-shadow: 0 2px 8px rgba(37, 99, 235, .32); }

/* 表单内的视频预览 */
.sx-video-preview video { display: block; max-width: 420px; max-height: 220px; margin: 2px 0 4px; border: 1px solid var(--c-border-l); border-radius: 6px; background: #000; }
.sx-video-preview .sx-video-name { font-size: 12px; }
.sx-video-preview .sx-video-name a { color: var(--c-primary); }

/* ---------------- 按钮 ---------------- */
.sx-btn {
  padding: 8px 18px; border-radius: 6px; font-size: 13px; font-weight: 500; cursor: pointer;
  border: 1px solid transparent; transition: all .2s; display: inline-flex; align-items: center; gap: 6px;
  background: #fff; color: var(--c-text2); line-height: 1.4;
}
.sx-btn:hover { opacity: .9; }
.sx-btn-primary { background: var(--c-primary); color: #fff; }
.sx-btn-primary:hover { background: var(--c-primary-d); }
.sx-btn-default { background: #fff; color: var(--c-text2); border-color: #d1d5db; }
.sx-btn-default:hover { background: #f9fafb; }
.sx-btn-warn { background: #f59e0b; color: #fff; }
.sx-btn-danger { background: var(--c-red); color: #fff; }
.sx-btn-success { background: var(--c-green); color: #fff; }
.sx-btn-sm { padding: 5px 12px; font-size: 12px; }
.sx-btn-block { width: 100%; justify-content: center; }
.sx-form-actions {
  padding: 18px 22px; background: #fafbfc; border-top: 1px solid var(--c-border-l);
  display: flex; gap: 12px; justify-content: flex-end; flex-wrap: wrap;
}

/* ---------------- 筛选栏 ---------------- */
.sx-filter-bar {
  background: #fff; border-radius: 10px; padding: 16px 20px; margin-bottom: 16px;
  display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end;
}
.sx-filter-item { display: flex; flex-direction: column; gap: 5px; }
.sx-filter-item label { font-size: 12px; font-weight: 500; color: var(--c-text2); }
.sx-filter-item .sx-input, .sx-filter-item .sx-select { height: 32px; font-size: 12px; width: 165px; }
.sx-filter-actions { margin-left: auto; display: flex; gap: 8px; }

/* ---------------- 表格 ---------------- */
.sx-table-wrap { background: #fff; border-radius: 10px; overflow: hidden; box-shadow: 0 1px 3px rgba(0, 0, 0, .06); }
.sx-table { width: 100%; border-collapse: collapse; }
.sx-table th {
  background: #f9fafb; padding: 12px 14px; text-align: left; font-size: 12px; color: var(--c-text3);
  font-weight: 600; border-bottom: 1px solid var(--c-border); white-space: nowrap;
}
.sx-table td { padding: 11px 14px; border-bottom: 1px solid var(--c-border-l); font-size: 13px; color: var(--c-text2); }
.sx-table tr:hover td { background: #f9fafb; }
.sx-table .link { color: var(--c-primary); cursor: pointer; }
.sx-table .link:hover { text-decoration: underline; }
.sx-table .link.danger { color: var(--c-red); }
.sx-table-actions { display: flex; gap: 12px; flex-wrap: wrap; }
.sx-table-actions .link { font-size: 13px; }

/* layui table 风格覆盖，贴近原型 */
.layui-table-view { border: 0; margin: 0; }
.layui-table { font-size: 13px; }
.layui-table thead tr { background: #f9fafb; }
.layui-table th { background: #f9fafb !important; font-size: 12px; color: var(--c-text3) !important; font-weight: 600; }
.layui-table td, .layui-table th { padding: 11px 14px !important; }
.layui-table tbody tr:hover { background: #f9fafb; }
.layui-table-cell { height: auto !important; line-height: 22px !important; }
.layui-table-view .layui-table-cell { height: auto; }
/* 固定列（右侧操作列）必须完整盖住下方主表内容：
   layui 只给固定列的 table 加了白底，容器层是透明的，行高一旦有偏差
   就会透出主表文字；这里补一层白底 + 行高同步兜底（见 admin.js） */
.layui-table-fixed .layui-table-body { background-color: #fff; }
.layui-table-fixed .layui-table-body tbody tr { background-color: #fff; }
.layui-table-fixed .layui-table-body tbody tr:hover { background-color: #f9fafb; }

/* ---------------- 徽章 ---------------- */
.sx-badge { display: inline-block; padding: 2px 10px; border-radius: 10px; font-size: 11px; font-weight: 500; }
.sx-status-active { background: #dcfce7; color: #16a34a; }
.sx-status-draft { background: #fef3c7; color: #d97706; }
.sx-status-void { background: #fee2e2; color: #dc2626; }
.sx-status-pending { background: #fef3c7; color: #d97706; }
.sx-status-out { background: #dbeafe; color: var(--c-primary); }
.sx-status-cancel { background: #f3f4f6; color: var(--c-text3); }
.sx-status-pass { background: #dcfce7; color: #16a34a; }
.sx-status-reject { background: #fee2e2; color: #991b1b; }
.sx-status-info { background: #dbeafe; color: #1d4ed8; }
.sx-status-warn { background: #fef3c7; color: #92400e; }

.sx-film-badge { display: inline-block; padding: 2px 8px; border-radius: 4px; font-size: 11px; }
.sx-film-heat { background: #dbeafe; color: var(--c-primary); }
.sx-film-ppf { background: #fce7f3; color: #db2777; }

.sx-level-badge { display: inline-block; padding: 2px 8px; border-radius: 4px; font-size: 11px; font-weight: 500; }
.sx-level-flagship { background: #fef3c7; color: #d97706; }
.sx-level-auth { background: #dbeafe; color: var(--c-primary); }
.sx-level-coop { background: #f3f4f6; color: var(--c-text3); }

.sx-rank-badge { display: inline-block; padding: 2px 8px; border-radius: 4px; font-size: 11px; }
.sx-rank-1 { background: #dbeafe; color: #1e40af; }
.sx-rank-2 { background: #dcfce7; color: #166534; }
.sx-rank-3 { background: #fef3c7; color: #92400e; }

.sx-visible-on { color: #16a34a; font-weight: 500; }
.sx-visible-off { color: var(--c-text4); }
.sx-stat-num { font-weight: 600; color: var(--c-primary); }
.sx-stat-low { color: var(--c-red); font-weight: 600; }

/* ---------------- 分页 ---------------- */
.sx-pagination {
  display: flex; align-items: center; justify-content: space-between; padding: 14px 20px;
  background: #fff; font-size: 13px; color: var(--c-text3); flex-wrap: wrap; gap: 10px;
}
.sx-page-nums { display: flex; gap: 4px; }
.sx-page-num {
  min-width: 28px; height: 28px; display: flex; align-items: center; justify-content: center;
  border-radius: 4px; cursor: pointer; border: 1px solid var(--c-border); padding: 0 8px; font-size: 13px;
}
.sx-page-num.active { background: var(--c-primary); color: #fff; border-color: var(--c-primary); }

/* ---------------- 提示 ---------------- */
.sx-tip {
  background: var(--c-primary-l); border-left: 3px solid var(--c-primary); padding: 10px 14px;
  border-radius: 0 6px 6px 0; font-size: 12px; color: #1e40af; margin-bottom: 16px; line-height: 1.7;
}
.sx-tip-warn { background: #fffbeb; border-left-color: #f59e0b; color: #92400e; }

/* ---------------- 子Tab ---------------- */
.sx-sub-tabs { display: flex; gap: 0; border-bottom: 2px solid var(--c-border); margin-bottom: 16px; background: #fff; padding: 0 12px; border-radius: 8px 8px 0 0; }
.sx-sub-tab {
  padding: 12px 20px; cursor: pointer; font-size: 13px; color: var(--c-text3);
  border-bottom: 2px solid transparent; margin-bottom: -2px; transition: all .2s;
}
.sx-sub-tab:hover { color: var(--c-primary); }
.sx-sub-tab.active { color: var(--c-primary); border-bottom-color: var(--c-primary); font-weight: 600; }

/* ---------------- 详情页 ---------------- */
.sx-detail-header {
  background: linear-gradient(135deg, #1a2332 0%, #2d3a4f 100%); color: #fff; padding: 22px 24px;
  border-radius: 10px; margin-bottom: 16px; display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 14px;
}
.sx-detail-header .no { font-size: 22px; font-weight: 700; letter-spacing: 1px; }
.sx-detail-header .meta { font-size: 13px; color: #8b95a7; margin-top: 6px; line-height: 1.7; }
.sx-detail-section { background: #fff; border-radius: 10px; margin-bottom: 16px; overflow: hidden; }
.sx-detail-section-title {
  padding: 13px 20px; background: #f9fafb; font-size: 14px; font-weight: 600; color: var(--c-text);
  border-bottom: 1px solid var(--c-border-l); display: flex; align-items: center; gap: 8px;
}
.sx-detail-section-title::before { content: ''; width: 3px; height: 14px; background: var(--c-primary); border-radius: 2px; }
.sx-detail-grid { display: grid; grid-template-columns: repeat(3, 1fr); }
.sx-detail-item { padding: 14px 20px; border-bottom: 1px solid #f8f8f8; }
.sx-detail-item .label { font-size: 12px; color: var(--c-text4); margin-bottom: 4px; }
.sx-detail-item .value { font-size: 14px; color: var(--c-text); font-weight: 500; word-break: break-all; }
@media (max-width: 1100px) { .sx-detail-grid { grid-template-columns: repeat(2, 1fr); } }

/* ---------------- 部位标签 ---------------- */
.sx-tag {
  display: inline-flex; align-items: center; gap: 4px; background: var(--c-primary-l); color: var(--c-primary);
  padding: 2px 8px; border-radius: 4px; font-size: 12px; margin: 2px 4px 2px 0;
}
.sx-tag .close { cursor: pointer; font-size: 14px; line-height: 1; }

/* ---------------- 多选下拉 ---------------- */
.sx-multi-select { position: relative; }
.sx-multi-trigger {
  width: 100%; min-height: 34px; padding: 3px 30px 3px 8px; border: 1px solid #d1d5db; border-radius: 6px;
  font-size: 12px; cursor: pointer; background: #fff; display: flex; flex-wrap: wrap; gap: 4px; align-items: center;
}
.sx-multi-trigger:hover { border-color: var(--c-primary); }
.sx-multi-trigger .arrow { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); color: var(--c-text4); font-size: 10px; }
.sx-multi-dropdown {
  position: absolute; top: calc(100% + 4px); left: 0; right: 0; background: #fff; border: 1px solid var(--c-border);
  border-radius: 8px; box-shadow: 0 4px 12px rgba(0, 0, 0, .1); z-index: 50; max-height: 280px;
  overflow-y: auto; display: none;
}
.sx-multi-dropdown.show { display: block; }
.sx-dropdown-group-title { padding: 6px 12px; font-size: 11px; color: var(--c-text4); font-weight: 600; background: #f9fafb; }
.sx-dropdown-option { padding: 7px 12px; display: flex; align-items: center; gap: 8px; cursor: pointer; font-size: 13px; }
.sx-dropdown-option:hover { background: #f3f4f6; }
.sx-dropdown-option.disabled { color: #d1d5db; cursor: not-allowed; }
.sx-dropdown-option.disabled .reason { font-size: 10px; color: #d1d5db; margin-left: auto; }
.sx-dropdown-option input[type="checkbox"] { accent-color: var(--c-primary); }

/* ---------------- 产品部位表格 ---------------- */
.sx-parts-table { width: 100%; border-collapse: collapse; margin-bottom: 12px; }
.sx-parts-table th { background: #f9fafb; padding: 10px 12px; text-align: left; font-size: 12px; color: var(--c-text3); font-weight: 600; border-bottom: 1px solid var(--c-border); }
.sx-parts-table td { padding: 10px 12px; border-bottom: 1px solid var(--c-border-l); vertical-align: top; }
.sx-parts-table .col-product { width: 26%; }
.sx-parts-table .col-roll { width: 22%; }
.sx-parts-table .col-parts { width: 42%; }
.sx-parts-table .col-action { width: 10%; text-align: center; }
.sx-btn-del-row { background: none; border: none; color: var(--c-red); cursor: pointer; font-size: 14px; padding: 4px 8px; border-radius: 4px; }
.sx-btn-del-row:hover { background: #fef2f2; }
.sx-btn-add-row {
  display: inline-flex; align-items: center; gap: 6px; padding: 8px 16px; background: #fff;
  border: 1px dashed var(--c-primary); color: var(--c-primary); border-radius: 6px; cursor: pointer;
  font-size: 13px; font-weight: 500;
}
.sx-btn-add-row:hover { background: var(--c-primary-l); }

/* ---------------- 搜索下拉 ---------------- */
.sx-search-wrap { position: relative; }
.sx-search-popup {
  position: absolute; top: 100%; left: 0; right: 0; background: #fff; border: 1px solid var(--c-border);
  border-radius: 6px; box-shadow: 0 4px 12px rgba(0, 0, 0, .1); max-height: 240px; overflow-y: auto;
  z-index: 800; margin-top: 4px; display: none;
}
.sx-search-item { padding: 8px 12px; font-size: 13px; color: var(--c-text2); cursor: pointer; border-bottom: 1px solid #f3f4f6; }
.sx-search-item:hover { background: var(--c-primary-l); color: var(--c-primary); }
.sx-search-item .brand-tag { font-size: 11px; color: var(--c-text3); margin-left: 8px; }

/* ---------------- 统计卡片 ---------------- */
.sx-stat-card { border-radius: 10px; padding: 16px; color: #fff; }
.sx-stat-card .stat-label { font-size: 12px; opacity: .85; margin-bottom: 8px; }
.sx-stat-card .stat-value { font-size: 26px; font-weight: 700; margin-bottom: 6px; }
.sx-stat-card .stat-trend { font-size: 11px; opacity: .85; }
.sx-stats-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 12px; margin-bottom: 16px; }
@media (max-width: 1400px) { .sx-stats-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 900px) { .sx-stats-grid { grid-template-columns: repeat(2, 1fr); } }

.sx-rank-item { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid #f3f4f6; }
.sx-rank-item:last-child { border-bottom: none; }
.sx-rank-num {
  width: 22px; height: 22px; border-radius: 50%; background: #e5e7eb; color: var(--c-text3);
  font-size: 12px; font-weight: 600; display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.sx-rank-num.n1 { background: #fbbf24; color: #fff; }
.sx-rank-num.n2 { background: #9ca3af; color: #fff; }
.sx-rank-num.n3 { background: #cd7f32; color: #fff; }
.sx-rank-name { font-size: 13px; color: var(--c-text2); width: 170px; flex-shrink: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sx-rank-bar-wrap { flex: 1; height: 8px; background: #f3f4f6; border-radius: 4px; overflow: hidden; }
.sx-rank-bar { height: 100%; border-radius: 4px; }
.sx-rank-value { font-size: 13px; font-weight: 600; color: #1f2937; width: 48px; text-align: right; flex-shrink: 0; }

.sx-timeline-item { display: flex; gap: 12px; padding: 10px 0; border-bottom: 1px solid #f3f4f6; }
.sx-timeline-item:last-child { border-bottom: none; }
.sx-timeline-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--c-primary); margin-top: 5px; flex-shrink: 0; }
.sx-timeline-title { font-size: 13px; font-weight: 600; color: #1f2937; margin-bottom: 2px; }
.sx-timeline-desc { font-size: 12px; color: var(--c-text3); margin-bottom: 2px; }
.sx-timeline-time { font-size: 11px; color: var(--c-text4); }

/* ---------------- 统计图表 ---------------- */
.sx-bar-chart { display: flex; align-items: flex-end; justify-content: space-around; height: 200px; padding: 0 20px; border-bottom: 1px solid var(--c-border); }
.sx-bar-item { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; flex: 1; }
.sx-bar { width: 40px; border-radius: 4px 4px 0 0; transition: height .4s ease; min-height: 2px; }
.sx-bar-value { font-size: 12px; font-weight: 600; color: var(--c-text2); margin-bottom: 4px; }
.sx-bar-label { font-size: 12px; color: var(--c-text3); margin-top: 8px; }
.sx-legend { display: flex; gap: 20px; margin-top: 12px; font-size: 12px; color: var(--c-text3); justify-content: center; }
.sx-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 4px; vertical-align: middle; }

.sx-donut-chart { position: relative; width: 160px; height: 160px; border-radius: 50%; }
.sx-donut-center {
  position: absolute; left: 25%; top: 25%; width: 50%; height: 50%; background: #fff; border-radius: 50%;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
}
.sx-donut-center .n { font-size: 20px; font-weight: 700; color: #1f2937; }
.sx-donut-center .t { font-size: 11px; color: var(--c-text4); }
.sx-ratio-row { display: flex; justify-content: space-between; align-items: center; padding: 6px 0; font-size: 13px; }
.sx-ratio-row .dot { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 6px; }
.sx-ratio-row .v { font-weight: 600; color: #374151; }

/* ---------------- 详情/模态 ---------------- */
.sx-modal { display: none; }
.sx-approval-section { margin-bottom: 16px; }
.sx-approval-title { font-size: 13px; font-weight: 600; color: var(--c-text2); margin-bottom: 8px; padding-bottom: 6px; border-bottom: 1px solid var(--c-border); }
.sx-approval-info { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 16px; font-size: 12px; }
.sx-approval-info .label { color: var(--c-text3); }
.sx-approval-info .value { color: #1f2937; font-weight: 500; }

/* ---------------- 上传 ---------------- */
.sx-upload-zone { border: 1px dashed #d1d5db; border-radius: 8px; padding: 8px; cursor: pointer; background: #fff; }
.sx-upload-zone:hover { border-color: var(--c-primary); background: var(--c-primary-l); }
.sx-upload-ph {
  height: 100px; border: 1px dashed var(--c-border); border-radius: 6px; display: flex;
  flex-direction: column; align-items: center; justify-content: center; color: var(--c-text4);
  font-size: 12px; gap: 4px; background: #f9fafb;
}
.sx-upload-ph img { width: 100%; height: 100%; object-fit: cover; border-radius: 6px; }

/* ---------------- 空态 ---------------- */
.sx-empty { text-align: center; color: var(--c-text4); padding: 40px 0; font-size: 13px; }

/* ---------------- 分货明细表 ---------------- */
.sx-dist-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.sx-dist-table th { background: #f3f4f6; padding: 8px; text-align: left; font-weight: 600; color: var(--c-text2); border-bottom: 1px solid var(--c-border); }
.sx-dist-table td { padding: 8px; border-bottom: 1px solid var(--c-border); }

/* 修正 layui 组件配色 */
.layui-btn-normal { background-color: var(--c-primary) !important; }
.layui-btn { border-radius: 6px; }
.layui-form-select dl dd.layui-this { background-color: var(--c-primary); }
.layui-laypage .layui-laypage-curr .layui-laypage-em { background-color: var(--c-primary); }
.layui-input:focus, .layui-textarea:focus { border-color: var(--c-primary) !important; }
