/* 炫影电竞 · 管理后台样式（品牌红 #dc143c / 暗色侧栏） */
[hidden] { display: none !important; }
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--bg); color: var(--text);
}
.ic { display: inline-block; width: 1em; height: 1em; vertical-align: middle; }
.muted { color: var(--muted); font-size: 13px; }
body.modal-open { overflow: hidden; }

/* ============ 全局滚动条（细 + 跨平台一致，跟品牌风格协调） ============ */
/* Firefox */
* { scrollbar-width: thin; scrollbar-color: rgba(0,0,0,.2) transparent; }
/* WebKit / Chromium / Edge / Safari */
*::-webkit-scrollbar { width: 8px; height: 8px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb { background: rgba(0,0,0,.18); border-radius: 4px; }
*::-webkit-scrollbar-thumb:hover { background: rgba(0,0,0,.32); }
*::-webkit-scrollbar-thumb:active { background: rgba(0,0,0,.42); }
*::-webkit-scrollbar-corner { background: transparent; }
/* 暗色侧边栏：滑块用浅色，避免暗底深色对比过强 */
.sidebar, .sidebar * { scrollbar-color: rgba(255,255,255,.15) transparent; }
.sidebar ::-webkit-scrollbar-thumb, .sidebar *::-webkit-scrollbar-thumb { background: rgba(255,255,255,.15); }
.sidebar ::-webkit-scrollbar-thumb:hover, .sidebar *::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,.28); }
.sidebar ::-webkit-scrollbar-thumb:active, .sidebar *::-webkit-scrollbar-thumb:active { background: rgba(255,255,255,.4); }

:root {
  --brand: #dc143c;
  --brand-d: #a30f2e;
  --brand-l: #fef2f4;   /* 极浅红，hover/selected 背景 */
  --bg: #f6f7f9;        /* 极浅灰背景 */
  --card: #ffffff;
  --text: #1f2937;      /* 主文字（参考图深灰） */
  --text-2: #4b5563;    /* 次文字 */
  --muted: #8a8fa3;
  --ok: #10b981;
  --warn: #f59e0b;
  --danger: #ef4444;
  --border: #e5e7eb;    /* 极浅边框（参考图同色） */
  --border-d: #d1d5db;
  --side: #1c1e26;
}

/* ============ 布局 ============ */
.app-wrap { display: flex; min-height: 100vh; background: var(--bg); }
.main { flex: 1; padding: 20px 24px; overflow: auto; min-width: 0; }

/* 侧边栏（暗色） */
.sidebar {
  width: 230px; flex-shrink: 0;
  background: linear-gradient(180deg, #23262f, #191b22);
  color: #cfd2dc; display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 20px 20px 16px; color: #fff; font-weight: 700; font-size: 17px; }
.brand .ic { color: var(--brand); width: 24px; height: 24px; }
.brand em { margin-left: auto; font-style: normal; font-size: 11px; padding: 2px 8px; border-radius: 20px; background: rgba(220,20,60,.16); color: var(--brand); }
.sidebar nav { flex: 1; padding: 6px 12px; overflow: auto; }
.nav-btn {
  display: flex; align-items: center; gap: 11px; width: 100%; text-align: left;
  padding: 12px 14px; margin-bottom: 4px; border: none; background: transparent;
  border-radius: 10px; color: #b9bdc9; font-size: 14px; cursor: pointer; transition: .15s;
}
.nav-btn .ic { width: 18px; height: 18px; color: #7e8290; }
.nav-btn:hover { background: rgba(255,255,255,.05); color: #fff; }
.nav-btn.active { background: linear-gradient(135deg, var(--brand), var(--brand-d)); color: #fff; font-weight: 600; }
.nav-btn.active .ic { color: #fff; }
/* 侧边栏分组（集合）：可折叠 */
.nav-group { margin-bottom: 4px; }
.nav-group-title {
  display: flex; align-items: center; gap: 11px; width: 100%; text-align: left;
  padding: 12px 14px; border: none; background: transparent; cursor: pointer;
  border-radius: 10px; color: #cfd2db; font-size: 14px; font-weight: 600; transition: .15s;
}
.nav-group-title .ic { width: 18px; height: 18px; color: #8b909e; }
.nav-group-title:hover { background: rgba(255,255,255,.05); color: #fff; }
.nav-group-title .caret {
  margin-left: auto; width: 8px; height: 8px; border-right: 2px solid #8b909e; border-bottom: 2px solid #8b909e;
  transform: rotate(45deg); transition: transform .2s; opacity: .8;
}
.nav-group.collapsed .caret { transform: rotate(-45deg); }
.nav-group-body { padding-left: 14px; overflow: hidden; transition: max-height .25s ease; }
.nav-group.collapsed .nav-group-body { max-height: 0 !important; }
.nav-group:not(.collapsed) .nav-group-body { max-height: 600px; }
.nav-group-body .nav-btn { padding-left: 18px; font-size: 13.5px; }
.side-foot { display: flex; justify-content: space-between; align-items: center; padding: 14px 20px; border-top: 1px solid rgba(255,255,255,.07); font-size: 13px; color: #9aa0ad; }
.side-foot #meName { display: inline-flex; align-items: center; gap: 6px; min-width: 0; }
.side-foot .me-role { font-style: normal; font-size: 11px; padding: 1px 8px; border-radius: 4px; background: rgba(220,20,60,.16); color: var(--brand); white-space: nowrap; }

/* 移动端抽屉 */
.menu-toggle { display: none; }
.sidebar-backdrop { display: none; }
@media (max-width: 860px) {
  .sidebar { position: fixed; left: 0; top: 0; bottom: 0; z-index: 60; transform: translateX(-100%); transition: transform .25s; width: 230px; }
  .app-wrap.nav-open .sidebar { transform: translateX(0); }
  .sidebar-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 55; }
  .app-wrap.nav-open .sidebar-backdrop { display: block; }
  .menu-toggle {
    display: inline-flex; position: fixed; left: 14px; bottom: 18px; z-index: 58;
    width: 48px; height: 48px; border-radius: 50%; border: none; background: var(--brand);
    color: #fff; align-items: center; justify-content: center;
    box-shadow: 0 8px 20px rgba(220,20,60,.4); cursor: pointer;
  }
  .menu-toggle .ic { width: 24px; height: 24px; }
  .main { padding: 18px 16px; }
}

/* ============ 头部 / 工具条 ============ */
.view-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; gap: 12px; flex-wrap: wrap; }
.view-head h3 { margin: 0; font-size: 16px; font-weight: 600; color: var(--text); }
.view-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.toolbar { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; flex-wrap: wrap; }
.toolbar .search { flex: 1; min-width: 180px; height: 32px; padding: 0 10px; border: 1px solid var(--border); border-radius: 5px; font-size: 13px; font-family: inherit; box-sizing: border-box; background: #fff; }
.toolbar .search::placeholder { color: #b0b5bc; }
.toolbar .search:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(220,20,60,.1); }
.count { margin-left: auto; font-size: 12px; color: var(--muted); }

/* ============ 下拉框（统一） ============ */
/* 自定义箭头 + 高度对齐按钮 + focus 高亮；覆盖 toolbar 筛选/排序、表单 select、分类选择 */
.toolbar select, .field-ctrl select, select.cat-select, select.sub-select {
  appearance: none; -webkit-appearance: none; -moz-appearance: none;
  border: 1px solid var(--border); border-radius: 5px;
  font-size: 13px; font-family: inherit; color: var(--text); background-color: #fff;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238a8fa3' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center; background-size: 12px;
  cursor: pointer; box-sizing: border-box; padding-right: 28px;
}
.toolbar select { height: 32px; padding-left: 10px; }
.toolbar select:hover { border-color: #d5d8e2; }
.toolbar select:focus, .field-ctrl select:focus, select.cat-select:focus, select.sub-select:focus {
  outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(220,20,60,.1);
}

/* ============ 自定义下拉 CustomSelect（跨平台一致，跟品牌主色协调） ============ */
.cs-host { position: relative; display: inline-block; vertical-align: middle; }
.cs-host.block { display: block; width: 100%; }
.cs-host.block .cs-trigger { width: 100%; }
.cs-trigger {
  display: inline-flex; align-items: center; justify-content: space-between; gap: 8px;
  height: 36px; padding: 0 12px; border: 1px solid var(--border); border-radius: 6px;
  background: #fff; color: var(--text); font-size: 14px; font-family: inherit;
  cursor: pointer; transition: .15s; box-sizing: border-box; line-height: 1;
}
.cs-trigger:hover { border-color: #d5d8e2; }
.cs-trigger:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(220,20,60,.1); }
.cs-trigger.is-disabled { background: #f6f7f9; color: var(--muted); cursor: not-allowed; opacity: .7; }
.cs-trigger .cs-label { flex: 1; text-align: left; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cs-trigger .cs-label.placeholder { color: var(--muted); }
.cs-trigger .cs-arrow { color: #8a8fa3; flex-shrink: 0; transition: transform .15s; }
/* 打开态：边框/阴影弱化（红色边太抢眼），箭头变红提示展开 */
.cs-host.open .cs-trigger { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(220,20,60,.06); }
.cs-host.open .cs-arrow { transform: rotate(180deg); color: var(--brand); }
.cs-panel {
  position: absolute; top: calc(100% + 4px); left: 0; min-width: 100%; max-width: 320px;
  max-height: 280px; overflow-y: auto; background: #fff; border: 1px solid var(--border);
  border-radius: 6px; box-shadow: 0 8px 24px rgba(0,0,0,.12); z-index: 95; padding: 4px;
  box-sizing: border-box;
}
.cs-host.cs-right .cs-panel { left: auto; right: 0; }
.cs-opt {
  display: flex; align-items: center; justify-content: space-between; gap: 6px;
  padding: 7px 10px; border-radius: 4px; font-size: 13px; color: var(--text); cursor: pointer;
  white-space: nowrap; line-height: 1.4;
}
.cs-opt:hover { background: var(--brand-l); color: var(--brand); }
.cs-opt.active { color: var(--brand); font-weight: 500; background: var(--brand-l); }
.cs-opt .cs-check { color: var(--brand); flex-shrink: 0; }
.cs-empty { padding: 16px; text-align: center; color: var(--muted); font-size: 13px; }

/* ============ 按钮 ============ */
/* 极简扁平：统一 32px、小圆角 5px、纯色实心（无渐变无阴影），跟品牌主色协调。 */
.btn-primary, .btn-ghost, .btn-soft, .btn-sm, .btn-danger, .btn-retry {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 5px; line-height: 1; white-space: nowrap; box-sizing: border-box;
  font-family: inherit; cursor: pointer; transition: .15s;
}
.btn-primary {
  background: var(--brand); color: #fff; border: 1px solid var(--brand);
  height: 32px; padding: 0 14px; border-radius: 5px; font-size: 13px; font-weight: 500;
}
.btn-primary:hover { background: var(--brand-d); border-color: var(--brand-d); }
.btn-ghost {
  background: #fff; border: 1px solid var(--border); color: var(--text);
  height: 32px; padding: 0 14px; border-radius: 5px; font-size: 13px;
}
.btn-ghost:hover { border-color: var(--brand); color: var(--brand); }
.btn-ghost.danger { color: var(--danger); border-color: var(--danger); }
.btn-ghost.danger:hover { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn-soft {
  background: #fff; border: 1px solid var(--border); color: var(--text-2);
  height: 32px; padding: 0 12px; border-radius: 5px; font-size: 13px;
}
.btn-soft:hover { border-color: var(--brand); color: var(--brand); }
.btn-sm {
  border: 1px solid var(--border); background: #fff; color: var(--text-2);
  height: 26px; padding: 0 10px; border-radius: 4px; font-size: 12px;
}
.btn-sm.del { color: var(--danger); border-color: var(--danger); }
.btn-sm.del:hover { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn-sm.warn { color: #b45309; border-color: #f59e0b; }
.btn-sm.warn:hover { background: #f59e0b; border-color: #f59e0b; color: #fff; }
.btn-retry {
  height: 32px; padding: 0 12px; border-radius: 5px; font-size: 13px;
  border: 1px solid var(--border); background: #fff; color: var(--text);
}
.btn-retry:hover { border-color: var(--brand); color: var(--brand); }
.link { background: none; border: none; color: var(--brand); cursor: pointer; font-size: 13px; padding: 0; display: inline-flex; align-items: center; gap: 4px; }
.btn-primary:disabled, .btn-ghost:disabled, .btn-soft:disabled, .btn-sm:disabled, .btn-danger:disabled, .btn-retry:disabled { opacity: .55; cursor: not-allowed; pointer-events: none; }
.btn-primary:focus-visible, .btn-ghost:focus-visible, .btn-soft:focus-visible, .btn-sm:focus-visible, .btn-danger:focus-visible, .btn-retry:focus-visible { outline: 2px solid rgba(220,20,60,.3); outline-offset: 1px; }
.btn-primary.block { width: 100%; display: inline-flex; justify-content: center; align-items: center; gap: 5px; }
.is-busy { opacity: .85; }

/* ============ 表格 ============ */
.table-wrap { background: var(--card); border: 1px solid var(--border); border-radius: 6px; overflow: hidden; }
.tbl { width: 100%; border-collapse: collapse; }
.tbl th, .tbl td { padding: 11px 12px; text-align: left; font-size: 13px; border-bottom: 1px solid var(--border); }
.tbl th { background: #f9fafb; color: var(--text-2); font-weight: 500; font-size: 12.5px; white-space: nowrap; }
.tbl tr:last-child td { border-bottom: none; }
.tbl td { vertical-align: middle; color: var(--text); }
.tbl tbody tr:hover td { background: #fafbfc; }
.tbl .col-check { width: 40px; text-align: center; padding-left: 12px; padding-right: 6px; }
.tbl .th-sort { display: inline-flex; align-items: center; gap: 3px; cursor: pointer; user-select: none; }
.tbl .th-sort:hover { color: var(--brand); }
.tbl .th-sort .sort-ic { color: #c0c5cf; font-size: 11px; }
.tbl .th-sort.is-active { color: var(--brand); }
.tbl .th-sort.is-active .sort-ic { color: var(--brand); }
.row-check, .head-check { width: 15px; height: 15px; vertical-align: middle; cursor: pointer; accent-color: var(--brand); }
.mini-img { border-radius: 4px; overflow: hidden; flex-shrink: 0; background: #f0f2f7; display: inline-flex; }
.mini-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.tag { font-weight: 500; padding: 2px 8px; border-radius: 4px; font-size: 12px; background: #f1f3f5; color: var(--text-2); }
.tag-on { color: var(--ok); background: rgba(16,185,129,.1); }
.tag-off { color: var(--warn); background: rgba(245,158,11,.1); }
.tag-status { color: var(--brand); background: rgba(220,20,60,.08); }
.chip { display: inline-block; padding: 1px 8px; border-radius: 4px; background: rgba(220,20,60,.08); color: var(--brand); font-size: 12px; }
.op-group { display: flex; gap: 6px; flex-wrap: wrap; }

/* ============ 表单字段 ============ */
.field { display: block; margin-bottom: 16px; }
.field-label { display: block; font-size: 13px; color: var(--text-2); margin-bottom: 8px; font-weight: 500; }
/* 文本输入兜底：显式 type、隐式 type（无 type 属性）、password 全覆盖，避免漏网成原生样式 */
.field-ctrl input[type=text], .field-ctrl input[type=number], .field-ctrl input[type=password], .field-ctrl input:not([type]) {
  width: 100%; height: 36px; padding: 0 12px; border: 1px solid var(--border); border-radius: 6px;
  font-size: 14px; font-family: inherit; background: #fff; box-sizing: border-box; color: var(--text);
}
.field-ctrl input[type=text], .field-ctrl input[type=number], .field-ctrl input[type=password], .field-ctrl input:not([type]) { padding: 0 11px; }
.field-ctrl select { padding: 0 28px 0 11px; }
.field-ctrl textarea {
  width: 100%; padding: 9px 11px; border: 1px solid var(--border); border-radius: 5px;
  font-size: 13px; font-family: inherit; background: #fff; box-sizing: border-box; resize: vertical; color: var(--text);
}
/* ============ 富文本编辑器（richtext.js，SKU 商品详情） ============ */
.rt-wrap { border: 1px solid var(--border); border-radius: 6px; overflow: hidden; background: #fff; }
.rt-toolbar {
  display: flex; align-items: center; flex-wrap: wrap; gap: 4px;
  padding: 6px 8px; background: #fafbfc; border-bottom: 1px solid var(--border);
}
.rt-btn {
  min-width: 30px; height: 28px; padding: 0 8px; border: 1px solid transparent; border-radius: 4px;
  background: none; color: var(--text); font-size: 13px; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap: 4px; line-height: 1;
}
.rt-btn:hover { background: #eef0f3; border-color: var(--border); }
.rt-btn b, .rt-btn i, .rt-btn u { font-size: 14px; }
.rt-sep { width: 1px; height: 16px; background: var(--border); margin: 0 4px; flex-shrink: 0; }
.rt-sel {
  height: 28px; padding: 0 24px 0 8px; border: 1px solid var(--border); border-radius: 4px;
  font-size: 12px; color: var(--text); background: #fff; cursor: pointer; max-width: 130px;
}
.rt-color-wrap {
  display: inline-flex; align-items: center; gap: 4px; height: 28px; padding: 0 6px;
  border: 1px solid var(--border); border-radius: 4px; background: #fff; cursor: pointer;
}
.rt-color-label { font-size: 13px; font-weight: 600; text-decoration: underline; color: #e63226; }
.rt-color { width: 26px; height: 22px; padding: 0; border: none; background: none; cursor: pointer; }
.rt-color::-webkit-color-swatch-wrapper { padding: 0; }
.rt-color::-webkit-color-swatch { border: none; border-radius: 3px; }
.rt-editor {
  min-height: 160px; max-height: 420px; overflow-y: auto; padding: 10px 12px;
  font-size: 14px; line-height: 1.7; color: var(--text); outline: none;
}
.rt-editor:focus { box-shadow: inset 0 0 0 2px rgba(220,20,60,.08); }
.rt-editor img { max-width: 100%; height: auto; border-radius: 4px; margin: 4px 0; }
.rt-editor img[src^="cloud://"] { min-width: 60px; min-height: 40px; background: #f0f1f3; }
.rt-editor:empty::before { content: attr(data-placeholder); color: #aab0b8; pointer-events: none; }
/* 字段下方说明 hint（控件下方的小字提示，见 crud.js _controlHTML） */
.field-hint {
  font-size: 11px;
  color: var(--muted);
  margin-top: 4px;
  line-height: 1.4;
}
.field-ctrl input[type=text]:focus, .field-ctrl input[type=number]:focus, .field-ctrl input[type=password]:focus, .field-ctrl input:not([type]):focus, .field-ctrl textarea:focus, .field-ctrl select:focus {
  outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(220,20,60,.1);
}
/* 通用 promptDialog 输入框（label.field 直包 input，无 field-ctrl） */
.dialog-modal .field input[data-role="input"] {
  width: 100%; height: 36px; padding: 0 11px; margin-top: 6px;
  border: 1px solid var(--border); border-radius: 5px; font-size: 13px;
  font-family: inherit; background: #fff; box-sizing: border-box; color: var(--text);
}
.dialog-modal .field input[data-role="input"]:focus {
  outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(220,20,60,.1);
}
/* dispatch 提现/白名单表单：row-inline 布局 + input 统一样式 */
.row-inline { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.row-inline input {
  height: 32px; padding: 0 10px; border: 1px solid var(--border); border-radius: 5px;
  font-size: 13px; font-family: inherit; background: #fff; box-sizing: border-box;
  color: var(--text); min-width: 0;
}
.row-inline input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(220,20,60,.1); }
.card-soft { background: #fff; border: 1px solid var(--border); border-radius: 6px; padding: 14px 16px; }
.card-soft-title { font-size: 13px; color: var(--text-2); font-weight: 500; margin-bottom: 10px; }

/* ============ 图片上传组件 ============ */
.img-upload { margin-top: 4px; display: flex; align-items: flex-start; gap: 12px; flex-wrap: wrap; }
.img-upload .iu-preview { width: 88px; height: 88px; min-width: 88px; min-height: 88px; flex-shrink: 0; border-radius: 5px; object-fit: contain; border: 1px solid var(--border); background: #fafbfc; }
.img-upload .iu-bar { display: flex; align-items: center; gap: 8px; }
.img-upload .iu-pick { background: var(--brand); color: #fff; border: 1px solid var(--brand); height: 36px; padding: 0 14px; border-radius: 6px; font-size: 14px; cursor: pointer; display: inline-flex; align-items: center; gap: 5px; }
.img-upload .iu-pick:hover { background: var(--brand-d); border-color: var(--brand-d); }
.img-upload .iu-status { font-size: 12px; color: var(--muted); display: inline-block; max-width: 360px; word-break: break-all; vertical-align: middle; }
.img-upload .iu-status.ok { color: var(--ok); }
.img-upload .iu-status.err { color: var(--danger); }
.img-upload.drag { border-color: var(--brand); }
.img-upload.uploading { opacity: .7; }

/* ============ 弹窗 ============ */
.modal { position: fixed; inset: 0; background: rgba(15,18,30,.45); display: flex; align-items: center; justify-content: center; z-index: 80; padding: 16px; }
.modal-box { background: #fff; width: 600px; max-width: 100%; max-height: 90vh; border-radius: 10px; display: flex; flex-direction: column; overflow: visible; box-shadow: 0 20px 60px rgba(0,0,0,.18); }
/* 编辑弹窗加宽（字段多时更舒展）；SKU/类目选择弹窗保持专属宽度 */
.modal:not(.sku-editor):not(.cp-modal) .modal-box { width: 760px; }
.modal-head { display: flex; justify-content: space-between; align-items: center; padding: 14px 20px; border-bottom: 1px solid var(--border); flex-shrink: 0; }
.modal-head h3 { margin: 0; font-size: 15px; font-weight: 600; }
.modal-x { background: none; border: none; color: #9aa0ad; cursor: pointer; display: inline-flex; padding: 4px; }
.modal-x .ic { width: 18px; height: 18px; }
.modal-x:hover { color: var(--brand); }
.modal-body { padding: 16px 20px; overflow: auto; flex: 1; min-height: 0; }
.modal.locked .modal-foot .btn-primary { opacity: .5; cursor: not-allowed; }
/* 业务约束：无分类时新建 SKU 的禁用横幅 */
.form-lock-banner {
  display: flex; align-items: flex-start; gap: 10px;
  background: var(--brand-l); border: 1px solid #f3c2c2; color: var(--brand-d);
  border-radius: 6px; padding: 12px 14px; margin-bottom: 16px; font-size: 13px; line-height: 1.6;
}
.form-lock-banner .ic { width: 16px; height: 16px; flex-shrink: 0; margin-top: 2px; }
.form-lock-banner b { color: var(--brand); }
.modal.locked .modal-body .field { opacity: .55; }
.modal.locked .modal-body .field input,
.modal.locked .modal-body .field select,
.modal.locked .modal-body .field textarea { pointer-events: none; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 20px; border-top: 1px solid var(--border); flex-shrink: 0; background: #fafbfc; }
.dialog-box { width: 420px; }
.dialog-msg { margin: 6px 0 0; color: var(--text-2); }

/* ============ 陪玩登录码弹窗 ============ */
.invite-modal { width: 420px; }
.invite-tip { margin: 0 0 14px; color: var(--text-2); font-size: 13px; line-height: 1.6; }
.invite-tip b { color: var(--brand); }
.invite-code-wrap { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 22px; background: #fafbfc; border: 1px solid var(--border); border-radius: 6px; }
.invite-code { font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace; font-size: 32px; font-weight: 700; letter-spacing: 6px; color: var(--text); padding-left: 6px; user-select: all; }
.invite-expire { margin: 12px 0 0; color: var(--muted); font-size: 12px; text-align: center; }

/* ============ 价格档位编辑器 ============ */
.tiers-editor { margin-top: 4px; }
.tiers-head { display: flex; justify-content: space-between; align-items: center; font-size: 13px; color: var(--text-2); margin-bottom: 8px; }
.tier-row { display: flex; gap: 8px; margin-bottom: 8px; align-items: center; }
.tier-row input { flex: 1; height: 30px; padding: 0 10px; border: 1px solid var(--border); border-radius: 5px; font-size: 12px; box-sizing: border-box; font-family: inherit; color: var(--text); }
.tier-row input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(220,20,60,.1); }
.tier-row .del-tier { background: none; border: none; color: var(--danger); font-size: 18px; cursor: pointer; line-height: 1; padding: 0 6px; }
.tiers-actions { display: inline-flex; gap: 12px; align-items: center; }

/* ============ 价格档位编辑器 · 规格类型化（SKU 规格：上类型/下档位矩阵，v4 上下结构） ============ */
.sku-spec-editor { display: flex; flex-direction: column; gap: 18px; margin-top: 4px; }
.sku-spec-left, .sku-spec-right { border: 1px solid var(--border); border-radius: 8px; padding: 14px; background: #fcfdfe; }
.sku-spec-title { font-size: 12.5px; font-weight: 600; color: var(--text-2); margin-bottom: 10px; }
.spec-type-list { display: flex; flex-direction: column; gap: 10px; margin-bottom: 10px; }
.spec-type { border: 1px solid var(--border); border-radius: 8px; padding: 12px 14px; background: #fff;
  display: flex; flex-direction: column; gap: 10px; }
.spec-type-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.spec-type-idx { flex: 0 0 auto; width: 22px; height: 22px; border-radius: 50%; background: var(--brand); color: #fff;
  font-size: 12px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; }
.spec-type-head .st-name { width: 180px; height: 32px; padding: 0 10px; border: 1px solid var(--border);
  border-radius: 4px; font-size: 13px; font-family: inherit; color: var(--text); background: #fff; }
.spec-type-head .st-name:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(220,20,60,.1); }
.spec-type-actions { margin-left: auto; display: flex; gap: 6px; align-items: center; }
.spec-type-actions button { font-size: 12px; padding: 4px 10px; border: 1px solid var(--border); background: #fff;
  border-radius: 4px; color: var(--text-2); cursor: pointer; font-family: inherit; }
.spec-type-actions button:hover { color: var(--brand); border-color: var(--brand); }
.spec-type-actions .del-type-btn { color: var(--danger); border-color: var(--danger); }
.spec-type-actions .del-type-btn:hover { background: var(--danger); color: #fff; }
.spec-type-values { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.sv-row { display: flex; align-items: center; gap: 2px; }
.sv-row .sv-input { width: 150px; height: 32px; padding: 0 10px; border: 1px solid var(--border); border-radius: 4px;
  font-size: 13px; font-family: inherit; color: var(--text); background: #fff; }
.sv-row .sv-input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(220,20,60,.1); }
.sv-row .sv-x { background: none; border: none; color: var(--muted); cursor: pointer; font-size: 16px;
  padding: 2px 6px; line-height: 1; }
.sv-row .sv-x:hover { color: var(--danger); }
.st-empty { color: var(--muted); font-size: 12px; }
.spec-type .add-value { font-size: 12.5px; padding: 4px 12px; border: 1px dashed var(--border); border-radius: 4px;
  color: var(--brand); background: #fff; cursor: pointer; font-family: inherit; align-self: flex-start; }
.spec-type .add-value:hover { border-color: var(--brand); color: var(--brand); background: #fff5f6; }
.sku-spec-left > .link { font-size: 12.5px; }

.spec-matrix { display: flex; flex-wrap: wrap; gap: 10px; }
.matrix-warn { background: #fff7e6; border: 1px solid #f5c76b; color: #8a5a00; border-radius: 6px;
  padding: 8px 12px; font-size: 12px; line-height: 1.5; margin-bottom: 4px; flex-basis: 100%; }
.matrix-head { display: none; }
.matrix-row { position: relative; display: flex; flex-direction: column; gap: 8px;
  border: 1px solid var(--border); border-radius: 6px; padding: 12px 14px; background: #fff;
  min-width: 220px; flex: 1 1 240px; max-width: 300px; }
.m-combo { min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.m-name { font-size: 13px; font-weight: 600; color: var(--text); word-break: break-all; padding-right: 20px; }
.m-specs { display: flex; flex-wrap: wrap; gap: 4px; }
.m-spec { display: inline-flex; align-items: center; gap: 4px; background: #f1f3f5; border-radius: 4px;
  padding: 1px 6px; font-size: 11px; color: var(--text-2); }
.m-spec b { font-weight: 600; color: var(--muted); }
.m-price { width: 100%; height: 30px; padding: 0 10px; border: 1px solid var(--border); border-radius: 4px;
  font-size: 12.5px; font-family: inherit; color: var(--text); box-sizing: border-box; }
.m-price:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(220,20,60,.1); }
.m-price.m-price-missing { border-color: var(--danger); background: #fff5f5; }
.matrix-row .del-tier { position: absolute; top: 8px; right: 8px; background: none; border: none;
  color: var(--danger); font-size: 16px; cursor: pointer; line-height: 1; padding: 2px 6px; }
.matrix-empty { color: var(--muted); font-size: 12.5px; padding: 14px 2px; text-align: center; flex-basis: 100%; }
@media (max-width: 720px) {
  .sku-spec-editor { grid-template-columns: 1fr; }
}

/* SKU 编辑器模态框加宽（crud.js openEditor 给 .modal 加 .sku-editor 类） */
.sku-editor .modal-box { width: 1100px; max-width: 96vw; }
.sku-editor .modal-body { padding: 18px 22px; }
.sku-migrate-note { background: #fff7e6; border: 1px solid #f5c76b; color: #8a5a00; border-radius: 6px;
  padding: 8px 12px; font-size: 12px; line-height: 1.6; margin-bottom: 10px; }

/* ============ 导出 ============ */
.export-grid { display: flex; gap: 12px; margin: 8px 0 18px; flex-wrap: wrap; }
.export-card { flex: 1; min-width: 160px; background: var(--card); border: 1px solid var(--border); border-radius: 6px; padding: 22px; display: flex; flex-direction: column; align-items: center; gap: 6px; cursor: pointer; color: var(--text); font-size: 14px; font-weight: 500; transition: .15s; }
.export-card .ic { width: 28px; height: 28px; color: var(--brand); }
.export-card:hover { border-color: var(--brand); color: var(--brand); background: var(--brand-l); }

/* ============ 分类 ============ */
.cat-list { background: var(--card); border: 1px solid var(--border); border-radius: 6px; padding: 4px 0; }
.cat-item { padding: 12px 16px; border-bottom: 1px solid var(--border); }
.cat-item:last-child { border-bottom: none; }
.cat-title { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; font-size: 14px; }
.cat-title strong { font-weight: 600; }
.cat-title .cat-name { color: var(--text); }
.cat-title .cat-meta { color: var(--muted); font-size: 12px; font-weight: 400; }
.cat-title .cat-ops { margin-left: auto; display: inline-flex; gap: 4px; }
.cat-title .cat-ops .btn-sm { height: 24px; padding: 0 8px; font-size: 11.5px; border-radius: 4px; }
.cat-title .cat-ops .btn-sm.edit { color: #2563eb; border-color: #93c5fd; }
.cat-title .cat-ops .btn-sm.edit:hover { background: #2563eb; color: #fff; }
.sub-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.sub-tag {
  display: inline-flex; align-items: center; gap: 4px;
  background: #f1f3f5; border-radius: 4px; padding: 3px 8px 3px 10px; font-size: 12px; color: var(--text-2);
  position: relative;
}
.sub-tag.muted { background: transparent; color: #aab; font-style: italic; padding-left: 0; }
.sub-tag .sub-tag-name { padding-right: 2px; }
.sub-tag .sub-tag-ops { display: none; gap: 2px; margin-left: 2px; }
.sub-tag:hover .sub-tag-ops { display: inline-flex; }
.sub-tag .sub-op {
  border: none; background: transparent; cursor: pointer; padding: 0;
  width: 20px; height: 20px; line-height: 18px; border-radius: 50%;
  font-size: 11px; color: #6b7280;
}
.sub-tag .sub-op:hover { color: #fff; }
.sub-tag .sub-op.edit:hover { background: #2563eb; }
.sub-tag .sub-op.del:hover { background: var(--danger); }
.add-sub-row { display: flex; gap: 8px; margin-top: 8px; }
.add-sub-row .sub-input { flex: 1; height: 28px; padding: 0 10px; border: 1px solid var(--border); border-radius: 4px; font-size: 12px; box-sizing: border-box; font-family: inherit; }
.add-row { display: flex; gap: 8px; margin-top: 14px; }
.add-row input { flex: 1; height: 32px; padding: 0 11px; border: 1px solid var(--border); border-radius: 5px; font-size: 13px; box-sizing: border-box; font-family: inherit; color: var(--text); }
.add-row input:focus, .add-sub-row .sub-input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(220,20,60,.1); }
.cat-loading, .cat-empty, .cat-error { padding: 22px; color: var(--muted); text-align: center; }

/* ============ 骨架屏 / 旋转 ============ */
.sk-bar { display: inline-block; height: 9px; width: 80%; background: linear-gradient(90deg, #f0f1f5, #e6e8ef, #f0f1f5); background-size: 200% 100%; animation: sk 1.2s infinite; border-radius: 3px; }
@keyframes sk { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }
.sk-row td { padding: 9px 12px; }
.spinner { width: 12px; height: 12px; border: 2px solid rgba(255,255,255,.5); border-top-color: #fff; border-radius: 50%; display: inline-block; animation: spin .7s linear infinite; vertical-align: middle; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ============ Toast ============ */
.toast-host { position: fixed; top: 18px; right: 18px; z-index: 200; display: flex; flex-direction: column; gap: 8px; align-items: flex-end; }
.toast { display: flex; align-items: center; gap: 8px; background: #1f2330; color: #fff; padding: 9px 14px; border-radius: 6px; font-size: 13px; box-shadow: 0 8px 24px rgba(0,0,0,.2); opacity: 0; transform: translateY(-8px); transition: .25s; max-width: 360px; }
.toast.in { opacity: 1; transform: translateY(0); }
.toast .ic { width: 16px; height: 16px; flex-shrink: 0; }
.toast-success { background: var(--ok); }
.toast-error { background: var(--brand); }
.toast-info { background: #1f2330; }

/* ============ 登录 ============ */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg, #23262f, #191b22); }
.login-card { background: #fff; padding: 36px 32px; border-radius: 10px; width: 340px; max-width: 92vw; box-shadow: 0 16px 48px rgba(0,0,0,.25); text-align: center; }
.login-logo { display: flex; justify-content: center; color: var(--brand); margin-bottom: 6px; }
.login-logo .ic { width: 48px; height: 48px; }
.login-card h2 { margin: 8px 0 4px; font-size: 20px; }
.login-sub { color: var(--muted); font-size: 12.5px; margin-bottom: 20px; }
.login-field { display: block; text-align: left; font-size: 13px; color: var(--text-2); margin-bottom: 12px; }
.login-field input { width: 100%; height: 38px; padding: 0 12px; margin-top: 6px; border: 1px solid var(--border); border-radius: 5px; font-size: 13.5px; font-family: inherit; box-sizing: border-box; }
.login-field input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(220,20,60,.1); }
.login-card > button { width: 100%; height: 38px; border: none; border-radius: 5px; background: var(--brand); color: #fff; font-size: 14px; font-weight: 500; cursor: pointer; transition: .15s; }
.login-card > button:hover { background: var(--brand-d); }
.login-tip { color: var(--muted); font-size: 12px; margin-top: 12px; }
.err { color: var(--danger); font-size: 13px; min-height: 16px; margin: 6px 0 0; }

/* ===== 资金流水金额（国内财务习惯：入账红、出账绿） ===== */
.amt-in { color: #dc143c; font-weight: 600; font-variant-numeric: tabular-nums; }
.amt-out { color: #17a34a; font-weight: 600; font-variant-numeric: tabular-nums; }

/* ============================================================
   数据仪表盘（dashboard.js）
   布局铁律：等宽多列用 flex-wrap + 子项百分比宽度，间距靠子项 padding，
   不用 gap / grid，避免 rounding 溢出。
   ============================================================ */
.kpi-grid { display: flex; flex-wrap: wrap; margin: 0 -6px 16px; }
.kpi-card { width: 25%; box-sizing: border-box; padding: 0 6px 12px; }
.kpi-card > .kpi-val,
.kpi-card > .kpi-label { display: block; background: var(--card); border: 1px solid var(--border); }
.kpi-card > .kpi-val { border-radius: 6px 6px 0 0; padding: 14px 14px 2px; font-size: 22px; font-weight: 600; color: var(--text); font-variant-numeric: tabular-nums; letter-spacing: -.3px; border-bottom: none; }
.kpi-card > .kpi-label { border-radius: 0 0 6px 6px; padding: 0 14px 12px; font-size: 12px; color: var(--muted); border-top: 1px solid var(--border); }
.kpi-card.kpi-brand > .kpi-val { color: var(--brand); }
.kpi-card.kpi-warn > .kpi-val { color: var(--warn); }
.kpi-card.sk > .kpi-val,
.kpi-card.sk > .kpi-label { min-height: 20px; }

@media (max-width: 1200px) { .kpi-card { width: 33.333%; } }
@media (max-width: 900px)  { .kpi-card { width: 50%; } }
@media (max-width: 560px)  { .kpi-card { width: 100%; } }

.dash-row { display: flex; flex-wrap: wrap; margin: 0 -6px 16px; }
.dash-row > .panel { width: 100%; box-sizing: border-box; padding: 0 6px; margin-bottom: 12px; }
.dash-row-2 > .panel { width: 50%; }
@media (max-width: 900px) { .dash-row-2 > .panel { width: 100%; } }

.panel > .panel-head,
.panel > .panel-body { background: var(--card); border: 1px solid var(--border); }
.panel > .panel-head { border-radius: 6px 6px 0 0; border-bottom: none; padding: 11px 14px; font-size: 14px; font-weight: 600; color: var(--text); }
.panel > .panel-head em { font-style: normal; font-weight: 400; font-size: 12px; color: var(--muted); margin-left: 8px; }
.panel > .panel-body { border-radius: 0 0 6px 6px; border-top: none; padding: 12px 14px 14px; }

.trend-svg { width: 100%; height: auto; display: block; }

.mini-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.mini-table th { text-align: left; font-weight: 500; color: var(--muted); font-size: 12px; padding: 6px 8px; border-bottom: 1px solid var(--border); }
.mini-table td { padding: 9px 8px; border-bottom: 1px solid #f4f4f8; color: var(--text); }
.mini-table tr:last-child td { border-bottom: none; }
.mini-table .ell { max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.sk-block { height: 160px; border-radius: 6px; background: linear-gradient(90deg, #f1f2f6 25%, #e8e9f0 37%, #f1f2f6 63%); background-size: 400% 100%; animation: sk 1.2s ease infinite; }
.sk-block.sm { height: 110px; }

/* ============ 子账号管理（accounts.js） ============ */
.acc-roles { display: flex; flex-wrap: wrap; }
.acc-roles > button { margin: 0 8px 8px 0; }
.acc-modules { display: flex; flex-wrap: wrap; }
.acc-check {
  width: 33.333%; box-sizing: border-box; padding: 5px 8px 5px 0;
  display: flex; align-items: center; font-size: 13px; color: var(--text); cursor: pointer;
}
.acc-check input { margin-right: 6px; }
@media (max-width: 560px) { .acc-check { width: 50%; } }

/* ===== 陪玩接单详情弹层（adminCompanionDetail） ===== */
.cdetail-modal { max-width: 800px; }
.cd-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding-bottom: 12px; border-bottom: 1px solid var(--border); margin-bottom: 14px; }
.cd-name { font-size: 16px; font-weight: 600; color: var(--text); }
.cd-stats { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.cd-stat { flex: 1 1 96px; min-width: 96px; background: #fafbfc; border: 1px solid var(--border); border-radius: 6px; padding: 10px 8px; text-align: center; }
.cd-stat b { display: block; font-size: 17px; color: var(--brand); }
.cd-stat .cd-rank { color: #6a46c9; }
.cd-stat span { display: block; font-size: 12px; color: var(--muted); margin-top: 4px; }
.cd-table-title { font-weight: 600; color: var(--text-2); margin-bottom: 8px; font-size: 13px; }
.empty-td { text-align: center; color: #bbb; padding: 24px 0 !important; }

/* ===== VIP 管理（vip.js） ===== */
.vip-tip { background: #fff8e6; border: 1px solid #f0e0b8; color: #8a6d1a; padding: 10px 12px; border-radius: 6px; margin-bottom: 14px; font-size: 13px; line-height: 1.6; }
.vip-rules { width: 100%; box-sizing: border-box; border: 1px solid var(--border); border-radius: 5px; padding: 9px 11px; font-size: 13px; font-family: inherit; color: var(--text); min-height: 72px; resize: vertical; background: #fff; }
.vip-rules:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(220,20,60,.1); }
.vip-input { border: 1px solid var(--border); border-radius: 5px; padding: 0 10px; height: 30px; font-size: 13px; color: var(--text); width: 90%; box-sizing: border-box; font-family: inherit; background: #fff; }
.vip-input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(220,20,60,.1); }

/* ============ 确认框视觉升级 + 空状态修复（2026-08-06） ============ */
.btn-danger {
  background: var(--danger); color: #fff; border: 1px solid var(--danger);
  height: 32px; padding: 0 16px; border-radius: 5px;
  font-size: 13px; font-weight: 500; cursor: pointer;
}
.btn-danger:hover { background: #dc2626; border-color: #dc2626; }
.dialog-box { width: 420px; border-radius: 8px; }
.dialog-box .modal-head h3 { font-size: 15px; }
.dialog-box .modal-head { padding: 14px 20px; }
.dialog-msg { margin: 8px 0 4px; color: var(--text-2); font-size: 13.5px; line-height: 1.7; white-space: pre-line; }
.dialog-box .modal-foot { padding: 12px 20px; }
.dialog-box .modal-foot .btn-ghost { min-width: 80px; }
.dialog-box .modal-foot .btn-danger { min-width: 100px; }

/* 空状态 / 错误态（列表 0 条时，避免图标撑爆） */
.state { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; padding: 32px 20px; text-align: center; }
.state svg { width: 36px; height: 36px; stroke: #c8cdd4; stroke-width: 1.4; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.state p { margin: 0; font-size: 13px; color: var(--muted); }
.state span { font-size: 12px; color: #b0b5bc; }
.state-err svg { stroke: #f0a0a0; }
.state-err p { color: var(--danger); }

/* ============ 分类管理升级（2026-08-06） ============ */
.add-cat-input { height: 32px; padding: 0 11px; border: 1px solid var(--border); border-radius: 5px; font-size: 13px; width: 180px; outline: none; transition: border-color .15s; box-sizing: border-box; font-family: inherit; }
.add-cat-input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(220,20,60,.1); }
.cat-tip { font-size: 12px; margin: 12px 4px 0; }
.add-sub-inline { display: inline-flex; align-items: center; gap: 6px; margin-left: 6px; }
.cat-loading { padding: 24px 20px; text-align: center; color: var(--muted); font-size: 12.5px; }
.cat-loading svg { width: 14px; height: 14px; }
.cat-item .cat-check { margin-right: 4px; }

/* 多级类目表格（最多 4 级，参考电商后台树状表格）
   视觉优化：一级品牌红层级色块 / 空单元格「—」弱化 + 连续合并 / 行高紧凑 */
.cat-toolbar { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.cat-toolbar .search { height: 32px; padding: 0 10px; border: 1px solid var(--border); border-radius: 5px; font-size: 13px; font-family: inherit; width: 240px; box-sizing: border-box; background: #fff; }
.cat-toolbar .search:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(220,20,60,.1); }
/* 容器：白底 + 细边框 + 圆角 + 轻微投影 */
.cat-table-wrap { background: #fff; border: 1px solid var(--border-d); border-radius: 8px; overflow: hidden; box-shadow: 0 1px 4px rgba(0,0,0,.06); }
.cat-grid { width: 100%; font-size: 13px; border-collapse: collapse; table-layout: auto; }
.cat-grid thead { background: #f3f4f6; }
.cat-grid th { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding: 10px 12px; text-align: left; border: 1px solid #e5e7eb; border-bottom: 2px solid #d1d5db; color: #374151; }
/* 行高紧凑：8px 10px；rowspan 合并后不再用斑马纹（会制造割裂感），改 hover 浅灰反馈 */
.cat-grid td { vertical-align: middle; padding: 8px 10px; border: 1px solid #e5e7eb; cursor: pointer; transition: background .12s; }
.cat-grid tbody tr:hover td { background: #f3f4f6; }
.cat-grid tbody tr:last-child td { border-bottom: 1px solid #e5e7eb; }
/* 整行被上方 rowspan 完全覆盖时的占位行：保底行高，避免表格塌陷 */
.cat-grid tr.cat-span-row { height: 34px; }
/* L1：品牌红浅底 + 左侧 3px 品牌红竖条 + 加粗，让「独占多行」成为有意义的层级色块 */
.cat-grid td.cat-l1-cell {
  font-weight: 700; color: var(--text);
  background: rgba(220,20,60,.06);
  border-left: 3px solid var(--brand);
}
.cat-grid tbody tr:hover td.cat-l1-cell { background: rgba(220,20,60,.09); }
.cat-cell-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* 分类主图：节点内缩略图 + 「主图」编辑按钮（2026-08-09） */
.cat-node-main { display: inline-flex; align-items: center; gap: 6px; max-width: 100%; }
.cat-ic-thumb {
  width: 20px; height: 20px; min-width: 20px; border-radius: 4px; overflow: hidden;
  background: #f0f2f7; border: 1px solid var(--border);
  display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.cat-ic-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cat-ic-thumb-default .ic { width: 12px; height: 12px; color: #c0c5cf; }
.cat-ic-edit {
  display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0;
  width: 22px; height: 22px; padding: 0; border: 1px solid var(--border); border-radius: 4px;
  background: #fff; color: var(--muted); cursor: pointer; transition: .15s;
}
.cat-ic-edit:hover { border-color: var(--brand); color: var(--brand); background: var(--brand-l); }
.cat-ic-edit .ic { width: 13px; height: 13px; }
.cat-icon-modal .cat-ic-ctx { margin: 0 0 12px; }
.cat-icon-modal .cat-ic-ctx b { color: var(--text); font-weight: 600; }
/* 空单元格「—」：浅灰小字，弱化视觉噪音 */
.cat-empty-cell {
  color: rgba(0,0,0,.28);
  text-align: center;
  font-size: 12px;
  font-style: normal;
  letter-spacing: .4px;
  background: #fcfcfd;
}
.cat-grid tbody tr:hover td.cat-empty-cell { background: #f3f4f6; }
/* 树状单选器（新增类目弹窗用）：层级缩进 + 单选高亮 */
.tree-picker { background: #fff; border: 1px solid var(--border); border-radius: 5px; padding: 4px 0; max-height: 220px; overflow-y: auto; }
.tree-pick-node { display: flex; align-items: center; gap: 6px; padding: 6px 8px; cursor: pointer; font-size: 13px; color: var(--text); border-radius: 4px; margin: 0 4px; transition: background .12s; }
.tree-pick-node:hover { background: #fafbfc; }
.tree-pick-node.selected { background: var(--brand-l); color: var(--brand); font-weight: 500; }
.tree-pick-node .tree-radio { width: 12px; height: 12px; border-radius: 50%; border: 1.5px solid var(--border-d); flex-shrink: 0; box-sizing: border-box; position: relative; }
.tree-pick-node.selected .tree-radio { border-color: var(--brand); }
.tree-pick-node.selected .tree-radio::after { content: ''; position: absolute; left: 50%; top: 50%; width: 6px; height: 6px; border-radius: 50%; background: var(--brand); transform: translate(-50%, -50%); }
.tree-pick-node .tree-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* SKU 表单类目字段（树状选择） */
.cat-pick-field { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.cat-pick-val { font-size: 13px; color: var(--muted); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ============ 通用类目选择器（catpicker.js，参考电商后台 4 列级联） ============ */
.cp-modal .modal-box { width: 880px; max-width: 96vw; }
.cp-body { display: flex; flex-direction: column; gap: 10px; padding: 14px 16px; }
.cp-toolbar { display: flex; align-items: center; gap: 10px; }
.cp-toolbar .cp-search { flex: 1; height: 32px; padding: 0 10px; border: 1px solid var(--border); border-radius: 5px; font-size: 13px; font-family: inherit; background: #fff; box-sizing: border-box; }
.cp-toolbar .cp-search:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(220,20,60,.1); }
.cp-toolbar .cp-hint { font-size: 12px; }
.cp-cols { display: flex; gap: 0; border: 1px solid var(--border); border-radius: 6px; overflow: hidden; min-height: 320px; max-height: 60vh; }
.cp-col { flex: 1; border-right: 1px solid var(--border); display: flex; flex-direction: column; min-width: 0; background: #fff; }
.cp-col:last-of-type { border-right: 1px solid var(--border); }
.cp-selected-col { width: 170px; flex-shrink: 0; display: flex; flex-direction: column; background: #fafbfc; }
.cp-col-title { padding: 8px 10px; font-size: 12px; color: var(--muted); background: #f9fafb; border-bottom: 1px solid var(--border); flex-shrink: 0; }
.cp-col-body { flex: 1; display: flex; flex-direction: column; overflow: hidden; }
.cp-col-list { flex: 1; overflow-y: auto; padding: 4px; }
.cp-empty { padding: 22px 10px; text-align: center; color: var(--muted); font-size: 12.5px; }
.cp-node { display: flex; align-items: center; gap: 4px; padding: 7px 8px; border-radius: 4px; cursor: pointer; font-size: 13px; color: var(--text); transition: background .12s; }
.cp-node:hover { background: #f4f5f8; }
.cp-node.active { background: var(--brand-l); color: var(--brand); font-weight: 500; }
.cp-node.picked { color: var(--brand); }
.cp-node.picked .cp-check { color: var(--brand); font-weight: 700; }
.cp-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cp-arrow { color: #c0c5cf; flex-shrink: 0; }
.cp-check { color: var(--brand); flex-shrink: 0; }
.cp-edit-ops { display: none; gap: 2px; flex-shrink: 0; }
.cp-node:hover .cp-edit-ops { display: inline-flex; }
.cp-op { width: 18px; height: 18px; padding: 0; display: inline-flex; align-items: center; justify-content: center; border: none; background: transparent; color: var(--muted); border-radius: 3px; cursor: pointer; }
.cp-op:hover { color: var(--brand); background: #fff; }
.cp-op.del:hover { color: var(--danger); }
.cp-op .ic { width: 12px; height: 12px; }
.cp-selected { flex: 1; overflow-y: auto; padding: 6px; }
.cp-picked { display: flex; align-items: center; gap: 4px; padding: 5px 8px; border: 1px solid var(--border); border-radius: 4px; background: #fff; margin-bottom: 6px; font-size: 12.5px; }
.cp-picked-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cp-rename-input { flex: 1; min-width: 40px; height: 24px; padding: 0 6px; border: 1px solid var(--brand); border-radius: 4px; font-size: 12.5px; font-family: inherit; outline: none; box-shadow: 0 0 0 3px rgba(220,20,60,.1); box-sizing: border-box; }
/* 每列底部新增输入框 */
/* 新增框：跟在该列最后一个类目下面，随列表流式排列（不吸底） */
.cp-add-row { padding: 2px 0 6px; background: transparent; }
.cp-add-input { width: 100%; height: 30px; padding: 0 8px; border: 1px dashed var(--border); border-radius: 4px; background: transparent; font-size: 12.5px; font-family: inherit; color: var(--text); box-sizing: border-box; outline: none; transition: border-color .15s, background .15s; }
.cp-add-input::placeholder { color: #b0b5bc; }
.cp-add-input:hover { border-color: var(--border-d); background: #fff; }
.cp-add-input:focus { border-color: var(--brand); border-style: solid; background: #fff; box-shadow: 0 0 0 3px rgba(220,20,60,.1); }
.cp-add-input:disabled { background: #f3f4f6; color: #b0b5bc; cursor: not-allowed; border-style: dashed; }
.cp-op.ren:hover { color: var(--brand); }


/* ============ 订单管理：状态标签 + 多条件筛选面板 ============ */
.order-status-tabs { display: flex; flex-wrap: wrap; gap: 8px; padding: 12px 16px; background: #fff; border: 1px solid var(--border-d); border-bottom: none; border-radius: 6px 6px 0 0; }
.order-status-tabs:empty { display: none; }
.order-tab { display: inline-flex; align-items: center; gap: 5px; padding: 6px 14px; border: 1px solid var(--border); border-radius: 4px; background: #fff; font-size: 13px; color: var(--text-2); cursor: pointer; transition: all .12s; }
.order-tab:hover { border-color: var(--brand); color: var(--brand); }
.order-tab.active { background: var(--brand-l); border-color: var(--brand); color: var(--brand); font-weight: 500; }
.order-tab em { font-style: normal; font-size: 12px; color: var(--muted); background: #f3f4f6; padding: 1px 5px; border-radius: 8px; }
.order-tab.active em { color: var(--brand); background: #fff; }

.order-filter-panel { background: #fff; border: 1px solid var(--border-d); border-top: 1px solid var(--border-d); padding: 16px; border-radius: 0 0 6px 6px; margin-bottom: 14px; }
.order-filter-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px 18px; }
.of-field { display: flex; flex-direction: column; gap: 6px; }
.of-field > span { font-size: 12.5px; color: var(--text-2); }
.of-field input[type="text"],
.of-field input[type="date"] { height: 34px; padding: 0 10px; border: 1px solid var(--border); border-radius: 5px; font-size: 13px; font-family: inherit; background: #fff; outline: none; transition: border-color .15s, box-shadow .15s; }
.of-field input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(220,20,60,.08); }
.of-field .cs-auto { min-height: 34px; }
.of-range-inputs { display: flex; align-items: center; gap: 8px; }
.of-range-inputs input { flex: 1; min-width: 0; }
.of-range-inputs i { color: var(--muted); font-style: normal; font-size: 12px; }

.order-filter-actions { display: flex; align-items: center; gap: 10px; margin-top: 16px; padding-top: 14px; border-top: 1px dashed var(--border); }
.order-filter-actions .count { margin-left: auto; }

.order-tbl .tag-status { font-size: 12px; padding: 2px 8px; border-radius: 4px; background: #f3f4f6; color: var(--text-2); }

/* ============ 福利中心（顶部聚合 tab 内的子 tab 切换） ============ */
.wf-tabs { display: flex; gap: 8px; margin-bottom: 14px; flex-wrap: wrap; }
.wf-tab {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 7px 16px; border: 1px solid var(--border); border-radius: 6px;
  background: #fff; font-size: 13px; color: var(--text-2); cursor: pointer;
  transition: all .12s; font-family: inherit;
}
.wf-tab:hover { border-color: var(--brand); color: var(--brand); }
.wf-tab.active { background: var(--brand-l); border-color: var(--brand); color: var(--brand); font-weight: 500; }
.wf-panel[hidden] { display: none; }

/* ============ 经营罗盘（compass.js） ============ */
.cmp-range { display: inline-flex; border: 1px solid var(--border); border-radius: 999px; overflow: hidden; background: #fff; }
.cmp-range button { border: none; background: transparent; padding: 6px 14px; font-size: 12.5px; color: var(--text-2);
  cursor: pointer; font-family: inherit; transition: all .15s; }
.cmp-range button + button { border-left: 1px solid var(--border); }
.cmp-range button:hover { color: var(--brand); }
.cmp-range button.on { background: var(--brand); color: #fff; font-weight: 500; }
/* 时段分布柱状图 */
.cmp-hour-chart { display: flex; align-items: flex-end; height: 150px; gap: 3px; padding: 4px 2px 0; }
.cmp-hour-col { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; min-width: 0; }
.cmp-hour-bar { width: 100%; max-width: 16px; background: linear-gradient(180deg, rgba(220,20,60,.85), rgba(220,20,60,.45));
  border-radius: 3px 3px 0 0; min-height: 1px; transition: height .3s; }
.cmp-hour-col:hover .cmp-hour-bar { background: var(--brand); }
.cmp-hour-label { font-size: 10px; color: var(--muted); margin-top: 4px; height: 12px; }
/* 横向条形排行（商品 Top / 通用） */
.cmp-bar-list { display: flex; flex-direction: column; gap: 8px; padding: 2px 0; }
.cmp-bar-row { display: flex; align-items: center; gap: 8px; min-width: 0; }
.cmp-bar-rank { flex: 0 0 18px; height: 18px; border-radius: 50%; background: #f1f3f5; color: var(--text-2);
  font-size: 11px; font-weight: 600; display: inline-flex; align-items: center; justify-content: center; }
.cmp-rank-top { background: var(--brand); color: #fff; }
.cmp-bar-name { flex: 0 0 32%; max-width: 240px; font-size: 12.5px; color: var(--text); }
.cmp-bar-track { flex: 1; height: 10px; background: #f1f3f5; border-radius: 999px; overflow: hidden; min-width: 40px; }
.cmp-bar-track i { display: block; height: 100%; border-radius: 999px; transition: width .3s; }
.cmp-bar-val { flex: 0 0 auto; font-size: 12.5px; font-weight: 600; color: var(--text); min-width: 72px; text-align: right; }
/* 环形图（支付 / 状态占比） */
.cmp-donut-wrap { display: flex; align-items: center; gap: 16px; padding: 4px 2px; }
.cmp-donut { flex: 0 0 auto; width: 128px; }
.cmp-donut-svg { width: 100%; height: auto; color: var(--text); }
.cmp-legend { flex: 1; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.cmp-legend-item { display: flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--text-2); }
.cmp-legend-item i { flex: 0 0 auto; width: 10px; height: 10px; border-radius: 3px; }
.cmp-legend-item span { flex: 1; min-width: 0; }
.cmp-legend-item b { font-weight: 600; color: var(--text); font-size: 12.5px; }

/* ============ 图片大图预览（lightbox，ui.js previewImage / initImageZoom） ============ */
.js-zoom { cursor: zoom-in; }
.lightbox { padding: 24px; }
/* box 必须有最小占位尺寸（否则 src 加载失败/未完成时 box 收缩到 0，
   close 按钮 absolute 负偏移跑到屏幕中心，造成「只看到一个 ×」的假象） */
.lightbox-box { position: relative; min-width: 360px; min-height: 240px;
  max-width: 94vw; max-height: 92vh; display: flex; align-items: center; justify-content: center;
  background: #fff; border-radius: 10px; box-shadow: 0 24px 70px rgba(0,0,0,.5); overflow: hidden; }
.lightbox-box img { display: block; width: 100%; max-width: 92vw; max-height: 84vh;
  object-fit: contain; background: #fafbfc; }
.lightbox-box .lightbox-fallback { padding: 24px; color: #8a8f99; font-size: 13px;
  display: flex; flex-direction: column; align-items: center; gap: 8px; max-width: 320px; text-align: center; }
.lightbox-box .lightbox-fallback .lf-ic { width: 36px; height: 36px; opacity: .5; }
/* close 按钮改在 box 内（不再用 -16px 负偏移，避免 box 收缩时按钮脱离 box 跑到中心） */
.lightbox-close { position: absolute; top: 8px; right: 8px; width: 36px; height: 36px;
  border: none; border-radius: 50%; background: rgba(15,18,30,.72); color: #fff; font-size: 18px;
  line-height: 1; cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: background .15s; z-index: 2; }
.lightbox-close:hover { background: rgba(15,18,30,.9); }

/* ============ 热词管理（hotkeywords.js） ============ */
.hk-edit-row { display: flex; gap: 10px; margin-bottom: 12px; }
.hk-edit-row input { flex: 1; height: 36px; padding: 0 12px; border: 1px solid var(--border); border-radius: 6px; font-size: 13px; outline: none; font-family: inherit; }
.hk-edit-row input:focus { border-color: var(--brand); }
.hk-list-inner { display: flex; flex-wrap: wrap; gap: 8px; }
.hk-tag { display: inline-flex; align-items: center; gap: 6px; background: #f4f5f8; border: 1px solid var(--border);
  border-radius: 999px; padding: 5px 6px 5px 12px; font-size: 13px; color: var(--text); }
.hk-del { border: none; background: transparent; color: #9aa0ad; cursor: pointer; font-size: 14px; line-height: 1; padding: 0 4px; border-radius: 50%; }
.hk-del:hover { color: var(--danger); background: #f1f1f4; }
.hk-cloud { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 14px; padding: 8px 2px; }
.hk-cloud-chip { cursor: pointer; color: var(--brand); line-height: 1.3; transition: opacity .15s; }
.hk-cloud-chip:hover { opacity: .55; text-decoration: line-through; }

/* ============ 个性标签（tag-select） ============ */
.tag-select .ts-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 8px; }
.ts-chip { display: inline-flex; align-items: center; padding: 5px 14px; border: 1px solid var(--border);
  border-radius: 999px; font-size: 13px; color: var(--text-2); background: #fafbfc; cursor: pointer; user-select: none; transition: .15s; }
.ts-chip:hover { border-color: var(--brand-l); color: var(--brand); }
.ts-chip.on { background: var(--brand-l); border-color: var(--brand); color: var(--brand-d); font-weight: 500; }
.ts-custom { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ts-custom input { flex: 1; min-width: 180px; height: 32px; padding: 0 10px; border: 1px solid var(--border);
  border-radius: 6px; font-size: 13px; outline: none; font-family: inherit; }
.ts-custom input:focus { border-color: var(--brand); }
.ts-custom-tags { display: flex; flex-wrap: wrap; gap: 8px; }
.ts-chip.ts-custom-chip.on { background: var(--brand-l); }

/* ============ 语音条（audio-upload） ============ */
.audio-upload { display: flex; flex-direction: column; gap: 4px; }
.audio-upload .au-player { width: 100%; max-width: 320px; height: 36px; }

/* ============ 照片墙（img-wall） ============ */
.img-wall .iw-grid { display: flex; flex-wrap: wrap; gap: 8px; }
.img-wall .iw-item { position: relative; width: 76px; height: 76px; border: 1px solid var(--border); border-radius: 6px; overflow: hidden; }
.img-wall .iw-img { width: 100%; height: 100%; object-fit: cover; display: block; }
.img-wall .iw-del { position: absolute; top: 2px; right: 2px; width: 20px; height: 20px; border: none; border-radius: 50%;
  background: rgba(0,0,0,.55); color: #fff; font-size: 14px; line-height: 1; cursor: pointer; padding: 0; display: flex; align-items: center; justify-content: center; }
.img-wall .iw-del:hover { background: rgba(220,20,60,.85); }
.img-wall .iw-add { display: flex; align-items: center; gap: 10px; margin-top: 8px; }
.img-wall .iw-pick { height: 32px; padding: 0 12px; border: 1px dashed var(--border); background: #fafbfc; border-radius: 6px;
  font-size: 13px; color: var(--text-2); cursor: pointer; }
.img-wall .iw-pick:hover { border-color: var(--brand); color: var(--brand); }

/* ============ 列表列多图缩略 ============ */
.mini-imgs { display: flex; gap: 4px; align-items: center; }

/* 录音按钮 */
.au-rec { border: 1px solid var(--border); background: #fff; color: var(--text-2); }
.au-rec:hover { border-color: var(--brand); color: var(--brand); }
.au-rec.rec-on { background: var(--danger); border-color: var(--danger); color: #fff; }

/* ============ 编辑表单双列排版 ============ */
.crud-form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 24px; align-items: start; }
.crud-form-grid .field.full { grid-column: 1 / -1; }
.crud-form-grid .field { margin-bottom: 16px; min-width: 0; }

/* ============ 陪玩管理（合并「陪玩」+「陪玩调度」的单一主 tab） ============ */
/* 顶部下拉选择器：按业务分组（陪玩 / 订单调度 / 入驻与邀请 / 资金结算）切换子页面 */
.cmg-bar { display: flex; align-items: center; gap: 10px; margin: 14px 0 10px; flex-wrap: wrap; }
.cmg-label { font-size: 13px; color: var(--text-2); }
.cmg-select {
  min-width: 240px; height: 34px; padding: 0 10px;
  border: 1px solid var(--border); border-radius: 5px; background: #fff;
  font-size: 13px; font-family: inherit; color: var(--text); cursor: pointer;
}
.cmg-select:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(220,20,60,.1); }
.cmg-panel { margin-top: 8px; }
.cmg-panel[hidden] { display: none; }
/* 分组子 tab 形态（若宿主改用分组子 tab 而非下拉，可复用以下样式） */
.cmg-group-title {
  font-size: 12px; font-weight: 600; color: var(--text-2);
  margin: 18px 0 6px; padding-left: 8px; border-left: 3px solid var(--brand);
}
.sub-tabs .sub-tab.group-sep { margin-left: 14px; }
