[hidden] { display: none !important; }

:root {
  --primary: #0d9488;
  --primary-dark: #0f766e;
  --primary-light: #f0fdfa;
  --bg: #f6f8f7;
  --card: #ffffff;
  --text: #1f2937;
  --text-sub: #6b7280;
  --border: #e5e7eb;
  --danger: #dc2626;
  --radius: 12px;
  --shadow: 0 4px 20px rgba(0,0,0,.05);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
body {
  font-family: 'PingFang SC', 'Microsoft YaHei', 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
}
button, input, select, textarea { font-family: inherit; }
img { max-width: 100%; display: block; }

/* 登录 */
/* ===== 登录页（v20260907b 独立设计：左品牌展示 + 右登录表单） ===== */
.admin-login {
  min-height: 100vh;
  display: flex;
  background: #f4f7fc;
}
.login-hero {
  position: relative;
  flex: 1.15;
  min-width: 0;
  display: flex;
  align-items: center;
  background: linear-gradient(160deg, #14306e 0%, #1d4ed8 55%, #0ea5e9 130%);
  overflow: hidden;
  color: #fff;
}
.hero-blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(50px);
  opacity: .5;
  pointer-events: none;
}
.hero-blob.hb1 { width: 420px; height: 420px; left: -140px; top: -120px; background: #60a5fa; }
.hero-blob.hb2 { width: 360px; height: 360px; right: -120px; bottom: -140px; background: #22d3ee; }
.hero-blob.hb3 { width: 240px; height: 240px; right: 18%; top: 8%; background: #3b82f6; opacity: .35; }
.hero-inner {
  position: relative;
  padding: 56px 64px;
  max-width: 560px;
}
.hero-brand { display: flex; align-items: center; gap: 14px; margin-bottom: 44px; }
.hero-logo {
  width: 56px; height: 56px;
  display: flex; align-items: center; justify-content: center;
}
.hero-logo img {
  width: 100%; height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 6px 16px rgba(2,20,60,.35));
}
.hero-name { font-size: 20px; font-weight: 700; letter-spacing: 2px; }
.hero-en { font-size: 11px; letter-spacing: 3px; opacity: .65; margin-top: 3px; }
.hero-title { font-size: 34px; line-height: 1.4; font-weight: 800; margin: 0 0 16px; letter-spacing: 1px; }
.hero-desc { font-size: 14px; line-height: 1.9; opacity: .78; margin: 0 0 30px; }
.hero-feats { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 14px; }
.hero-feats li {
  display: flex; align-items: center; gap: 12px;
  font-size: 14px;
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 12px;
  padding: 11px 16px;
  backdrop-filter: blur(4px);
}
.hero-feats span { font-size: 16px; }
.hero-foot { margin-top: 46px; font-size: 12px; opacity: .5; }
.hero-foot a { color: inherit; text-decoration: none; }
.hero-foot a:hover { opacity: .8; }

.login-panel {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px;
}
.login-card {
  width: 100%;
  max-width: 380px;
  background: #fff;
  border-radius: 20px;
  box-shadow: 0 20px 60px rgba(30,58,138,.10), 0 2px 8px rgba(30,58,138,.05);
  padding: 44px 38px 30px;
  text-align: center;
}
.login-card h1 { font-size: 26px; margin-bottom: 8px; color: #0f172a; letter-spacing: 1px; }
.login-card .login-desc { color: #64748b; font-size: 14px; margin: 0 0 28px; }
.login-card form { display: flex; flex-direction: column; gap: 16px; text-align: left; }
.login-field { display: flex; flex-direction: column; gap: 7px; }
.lf-label { font-size: 13px; font-weight: 600; color: #334155; }
.lf-box {
  position: relative;
  display: flex;
  align-items: center;
}
.lf-icon {
  position: absolute; left: 13px;
  font-size: 14px;
  pointer-events: none;
  opacity: .55;
}
.lf-box input {
  width: 100%;
  padding: 13px 44px 13px 40px;
  border: 1.5px solid #dbe3ef;
  border-radius: 12px;
  font-size: 14px;
  color: #0f172a;
  background: #f8fafc;
  outline: none;
  transition: border-color .2s, box-shadow .2s, background .2s;
  box-sizing: border-box;
}
.lf-box input::placeholder { color: #a8b3c5; }
.lf-box input:focus {
  border-color: var(--primary);
  background: #fff;
  box-shadow: 0 0 0 4px rgba(37,99,235,.12);
}
.lf-eye {
  position: absolute; right: 8px;
  border: none;
  background: none;
  font-size: 15px;
  cursor: pointer;
  padding: 6px;
  border-radius: 8px;
  opacity: .6;
}
.lf-eye:hover { opacity: 1; background: #eef2f9; }
.login-card button[type="submit"] {
  width: 100%;
  padding: 13px;
  background: linear-gradient(90deg, #2563eb, #0ea5e9);
  color: #fff;
  border: none;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 8px;
  text-indent: 8px;
  cursor: pointer;
  margin-top: 6px;
  box-shadow: 0 10px 24px rgba(37,99,235,.30);
  transition: transform .15s, box-shadow .2s, filter .2s;
}
.login-card button[type="submit"]:hover {
  filter: brightness(1.06);
  transform: translateY(-1px);
  box-shadow: 0 12px 28px rgba(37,99,235,.38);
}
.login-card button:disabled { opacity: .6; cursor: not-allowed; transform: none; }
.login-tip { color: #dc2626; font-size: 13px; margin-top: 12px; min-height: 18px; }
.login-foot { margin-top: 22px; font-size: 12px; color: #94a3b8; }
@media (max-width: 880px) {
  .login-hero { display: none; }
  .login-panel { background: linear-gradient(180deg, #eef3fb 0%, #f4f7fc 100%); }
}

/* 后台布局 */
.admin-app { display: flex; min-height: 100vh; }
.admin-sidebar {
  width: 220px;
  background: #fff;
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 22px 16px;
}
.admin-brand { font-size: 18px; font-weight: 700; margin-bottom: 28px; color: var(--text); }
.admin-brand span { color: var(--primary); }
.admin-nav { display: flex; flex-direction: column; gap: 8px; flex: 1; }
.nav-item {
  background: transparent;
  border: none;
  text-align: left;
  padding: 12px 14px;
  border-radius: 8px;
  color: var(--text-sub);
  font-size: 15px;
  cursor: pointer;
}
.nav-item:hover { background: var(--primary-light); color: var(--primary); }
.nav-item.active { background: var(--primary); color: #fff; }
.admin-user { border-top: 1px solid var(--border); padding-top: 14px; font-size: 13px; color: var(--text-sub); }
.admin-welcome { margin-bottom: 8px; font-weight: 500; }
.admin-user a { color: var(--primary); display: block; margin-top: 4px; }
.admin-user .btn-sm { margin-top: 8px; width: 100%; }

.admin-main { flex: 1; display: flex; flex-direction: column; }
.admin-topbar {
  background: #fff;
  border-bottom: 1px solid var(--border);
  padding: 18px 28px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.admin-topbar h2 { font-size: 20px; }

.admin-content { padding: 24px 28px; }

/* ===== 商品维护：分类面板 + 商品列表 ===== */
.products-layout { display: flex; gap: 20px; align-items: flex-start; }
.cat-panel {
  width: 220px;
  flex-shrink: 0;
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 14px 10px;
  position: sticky;
  top: 20px;
}
.cat-panel-title { font-size: 13px; color: var(--text-sub); padding: 0 10px 10px; border-bottom: 1px solid var(--border); margin-bottom: 8px; font-weight: 600; }
.cat-item {
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 12px; border-radius: 8px; font-size: 14px;
  cursor: pointer; color: var(--text);
}
.cat-item:hover { background: var(--primary-light); color: var(--primary); }
.cat-item.active { background: var(--primary); color: #fff; }
.cat-item em { font-style: normal; font-size: 12px; background: rgba(0,0,0,.06); border-radius: 10px; padding: 1px 8px; }
.cat-item.active em { background: rgba(255,255,255,.25); }
/* 超管商品维护：左侧分类面板按公司分组折叠（公司 → 分类 两级） */
.cat-company-group { margin: 2px 0; }
.cat-company-head {
  display: flex; align-items: center; gap: 6px;
  padding: 9px 10px; border-radius: 8px; font-size: 14px; font-weight: 600;
  cursor: pointer; color: var(--text); user-select: none;
}
.cat-company-head:hover { background: var(--primary-light); color: var(--primary); }
.cat-company-head.open { background: var(--primary-light); color: var(--primary-dark); }
.cat-company-head .cat-chev {
  font-size: 10px; color: var(--text-sub); transition: transform .15s;
  display: inline-block; width: 10px; text-align: center;
}
.cat-company-head.open .cat-chev { transform: rotate(90deg); }
.cat-company-head em {
  font-style: normal; font-size: 12px; background: rgba(0,0,0,.06);
  border-radius: 10px; padding: 1px 8px; margin-left: auto;
}
.cat-company-head.open em { background: rgba(13,148,136,.12); color: var(--primary-dark); }
/* 选中公司行 = 「该公司全部分类商品」分权展示（常驻高亮，色值与 .cat-item.active 一致） */
.cat-company-head.active { background: var(--primary); color: #fff; }
.cat-company-head.active .cat-chev { color: rgba(255,255,255,.85); }
.cat-company-head.active em { background: rgba(255,255,255,.25); color: #fff; }
.cat-company-body { display: flex; flex-direction: column; gap: 1px; padding: 2px 0 4px 8px; }
.cat-company-body .cat-item { padding: 8px 10px 8px 14px; font-size: 13px; }
.cat-empty { font-size: 12px; color: var(--text-sub); padding: 8px 10px 8px 16px; }
.products-panel { flex: 1; min-width: 0; }
.empty-tip { color: var(--text-sub); text-align: center; padding: 60px 0; font-size: 14px; }
/* 左栏点击分类项 → 右侧定位行的短暂高亮 */
.list-row.flash { outline: 2px solid var(--primary); outline-offset: -2px; transition: outline-color .2s; }

/* ===== 规格价格编辑器 ===== */
.spec-section { border: 1px solid var(--border); border-radius: 10px; padding: 14px; margin-top: 4px; }
.spec-section-title { font-weight: 600; font-size: 14px; display: flex; justify-content: space-between; align-items: center; margin-bottom: 4px; }
.spec-hint { font-size: 12px; color: var(--text-sub); margin-bottom: 12px; }
.spec-block { border: 1px dashed var(--border); border-radius: 8px; padding: 10px 12px; margin-bottom: 12px; }
.spec-head { display: flex; gap: 10px; align-items: center; margin-bottom: 10px; }
.spec-head .spec-name { flex: 1; }
/* 「前端显示标题」勾选：控制详情页是否展示该规格名标题（默认勾选） */
.spec-show-name-label { display: inline-flex; align-items: center; gap: 5px; font-size: 13px; font-weight: normal; white-space: nowrap; cursor: pointer; flex: none; }
/* 专属页「详情区域」配置：显示名 / 标题行显示 / 整个板块显示 三列（五行固定区块；勾选列纯 checkbox 居中） */
.ex-sections-head, .ex-section-row { display: grid; grid-template-columns: 1fr 92px 92px; gap: 8px; align-items: center; margin-bottom: 6px; }
.ex-sections-head { font-size: 12px; color: var(--text-sub); padding-right: 4px; }
.ex-sections-head span:nth-child(2), .ex-sections-head span:nth-child(3) { text-align: center; }
.ex-section-row .ex-sec-label { width: 100%; min-width: 0; }
.ex-section-row label { display: inline-flex; gap: 5px; align-items: center; justify-content: center; font-size: 13px; white-space: nowrap; cursor: pointer; }
.spec-opts { display: flex; flex-direction: column; gap: 8px; margin-bottom: 10px; }
/* 规格选项列头 + 行：第一列选项，其后三个数值列依次为 成本价 / 价格 / 销售价格（均为「直接填写的最终值」） */
.spec-opt-head {
  display: grid;
  grid-template-columns: 22px 1fr 110px 110px 110px 30px; /* v20260923a：首列 = 选项拖动手柄 */
  gap: 8px;
  font-size: 12px;
  color: var(--text-sub);
  padding: 0 2px 4px;
}
.spec-opt-row {
  display: grid;
  grid-template-columns: 22px 1fr 110px 110px 110px 30px; /* v20260923a：首列 = 选项拖动手柄 */
  gap: 8px;
  align-items: center;
}
.spec-opt-row .opt-drag { cursor: grab; color: var(--text-sub); font-size: 15px; line-height: 1; text-align: center; user-select: none; -webkit-user-select: none; touch-action: none; }
.spec-opt-row .opt-drag:active { cursor: grabbing; }
.spec-opt-row.opt-dragging { opacity: .45; }
.spec-opt-row input { width: 100%; min-width: 0; box-sizing: border-box; }
.spec-opt-row .opt-label { min-width: 0; }
/* 基本信息（动态键值对）行：行首 ⠿ 拖动手柄 + 顺序号可调整展示顺序 */
.info-row { display: flex; gap: 8px; align-items: center; margin-bottom: 8px; }
.info-row .info-drag { flex: 0 0 auto; cursor: grab; color: var(--text-sub); font-size: 15px; line-height: 1; padding: 4px 3px; user-select: none; -webkit-user-select: none; touch-action: none; }
.info-row .info-drag:active { cursor: grabbing; }
.info-row .info-ord { flex: 0 0 56px; width: 56px; text-align: center; padding-left: 2px; padding-right: 2px; }
.info-row .info-name { flex: 0 0 190px; }
.info-row .info-val { flex: 1; min-width: 0; }
.info-row.info-dragging { opacity: .45; }
.spec-empty { font-size: 13px; color: var(--text-sub); padding: 4px 0; }

/* ===== 促销活动编辑器 ===== */
.dt-presets { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--text-sub); margin-bottom: 12px; flex-wrap: wrap; }
.pp-search { width: 100%; margin-bottom: 8px; }

/* ===== 图片上传控件 ===== */
.upload-field { margin: 12px 0; }
.upload-label { font-size: 13px; color: var(--text-sub); margin-bottom: 6px; }
.upload-box { display: flex; gap: 12px; align-items: stretch; }
.upload-preview {
  width: 96px; height: 96px; object-fit: cover;
  border-radius: 8px; border: 1px solid var(--border);
  background: #fff; flex-shrink: 0;
}
.upload-preview-empty {
  display: flex; align-items: center; justify-content: center;
  color: #b6bcc4; font-size: 12px; background: var(--bg);
}
.upload-controls { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 8px; justify-content: center; }
.upload-controls input { width: 100%; }
.upload-btns { display: flex; gap: 8px; }
/* 上传字段文件名行：界面只显示文件名，不显示 URL 原文 */
.upload-fileinfo { display: flex; align-items: center; gap: 8px; min-width: 0; }
.upload-fname { flex: 1; min-width: 0; font-size: 13px; color: var(--text); background: var(--bg); border: 1px solid var(--border); border-radius: 6px; padding: 6px 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.upload-fname em { color: #9aa3ad; font-style: normal; }
.img-fileline { display: flex; align-items: center; min-width: 0; }
.img-fname { flex: 1; min-width: 0; font-size: 12px; color: var(--text-sub); background: var(--bg); border: 1px solid var(--border); border-radius: 6px; padding: 4px 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.img-fname em { color: #9aa3ad; font-style: normal; }

/* 展示图片（图集）行 */
.img-row { display: flex; gap: 8px; align-items: center; margin-bottom: 8px; }
.img-thumb {
  width: 52px; height: 52px; object-fit: cover;
  border-radius: 8px; border: 1px solid var(--border);
  background: #fff; flex-shrink: 0;
}
.img-fields { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.img-fields .img-url,
.img-fields .img-title { width: 100%; }

.spec-actions { display: flex; gap: 8px; align-items: center; }
.pp-list {
  max-height: 240px;
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 4px 8px;
  margin-bottom: 12px;
}
.pp-item { display: flex; align-items: center; gap: 10px; padding: 6px 4px; font-size: 13px; cursor: pointer; border-bottom: 1px dashed var(--border); }
.pp-item:last-child { border-bottom: none; }
.pp-item:hover { background: rgba(0,0,0,.02); }
.pp-item input { flex: none; }
.pp-item .pp-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pp-item .pp-id { font-size: 12px; color: var(--text-sub); }
.coupon-row { display: flex; gap: 8px; align-items: center; margin-bottom: 8px; }
.coupon-row .c-label { flex: 1; }
.coupon-row .c-threshold { width: 100px; }
.coupon-row .c-amount { width: 110px; }

/* 促销状态徽标 */
.badge {
  display: inline-block;
  font-size: 12px;
  font-weight: 500;
  border-radius: 10px;
  padding: 1px 10px;
  margin-left: 8px;
  vertical-align: middle;
}
.badge-active { background: #dcfce7; color: #15803d; }
.badge-upcoming { background: #dbeafe; color: #1d4ed8; }
.badge-ended { background: #f1f5f9; color: #64748b; }
.badge-off { background: #fee2e2; color: #b91c1c; }

/* 按钮 */
.btn-primary {
  background: var(--primary);
  color: #fff;
  padding: 8px 18px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  border: none;
}
.btn-primary:hover { background: var(--primary-dark); }
.btn-primary:disabled { opacity: .45; cursor: not-allowed; }
.btn-primary:disabled:hover { background: var(--primary); }
.btn-ghost {
  background: #fff;
  color: var(--text);
  border: 1px solid var(--border);
  padding: 8px 18px;
  border-radius: 8px;
  font-size: 14px;
  cursor: pointer;
}
.btn-ghost:hover { border-color: var(--primary); color: var(--primary); }
.btn-sm { padding: 6px 12px; font-size: 13px; }
.btn-danger { background: #fee2e2; color: var(--danger); }
.btn-danger:hover { background: #fecaca; }

/* 列表 */
.list-card { display: flex; flex-direction: column; gap: 12px; }
.list-row {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 14px 18px;
  display: flex;
  align-items: center;
  gap: 16px;
}
.list-row > img { width: 56px; height: 56px; object-fit: cover; border-radius: 8px; background: var(--bg); }
.list-info { flex: 1; min-width: 0; }
.list-title { font-weight: 600; font-size: 15px; margin-bottom: 4px; }
.list-meta { color: var(--text-sub); font-size: 13px; }
.list-actions { display: flex; gap: 8px; }
#exclusiveList .list-row { position: relative; cursor: grab; }
#exclusiveList .list-row.dragging { opacity: 0.5; }
#exclusiveList .list-row.drag-over { box-shadow: inset 0 0 0 2px var(--primary); }
#exclusiveList .list-sort-handle { position: absolute; left: 4px; top: 50%; transform: translateY(-50%); color: var(--text-sub); cursor: grab; font-size: 18px; line-height: 1; user-select: none; }
#exclusiveList .list-info { padding-left: 22px; }
#exclusiveList .list-row { position: relative; cursor: grab; }
#exclusiveList .list-row.dragging { opacity: 0.5; }
#exclusiveList .list-row.drag-over { box-shadow: inset 0 0 0 2px var(--primary); }
#exclusiveList .list-sort-handle { position: absolute; left: 4px; top: 50%; transform: translateY(-50%); color: var(--text-sub); cursor: grab; font-size: 18px; line-height: 1; user-select: none; }
#exclusiveList .list-info { padding-left: 22px; }

/* 编辑器弹窗（普通弹窗 + v2.8 右侧大表单共用外壳） */
.modal-mask {
  position: fixed;
  inset: 0;
  background: rgba(15,23,42,.42);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.modal-mask[hidden] { display: none; }

/* ===== 修改密码弹窗（v20260907） ===== */
.pwd-modal {
  position: relative;
  max-width: 420px;
  padding: 24px 26px 20px;
  gap: 0;
}
.pwd-modal .modal-close { position: absolute; top: 12px; right: 12px; }
.pwd-title { margin: 0 0 16px; font-size: 17px; }
.pwd-form { display: flex; flex-direction: column; gap: 12px; }
.pwd-form label { font-size: 13px; color: var(--text-sub); display: flex; flex-direction: column; gap: 6px; }
.pwd-form input {
  height: 38px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  outline: none;
}
.pwd-form input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37,99,235,.12); }
.pwd-tip { margin: 4px 0 0; font-size: 12px; line-height: 1.7; color: #b45309; background: #fffbeb; border: 1px solid #fde68a; border-radius: 8px; padding: 8px 10px; }
.pwd-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; }

.modal {
  background: var(--card);
  border-radius: var(--radius);
  width: 100%;
  max-width: 640px;
  max-height: 92vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* ===== v2.8 右侧大表单（泛微风格）：当前区域右侧 60%-80% 宽面板 ===== */
.drawer-mask {
  position: fixed;
  inset: 0; /* 遮罩仍全屏（编辑时左侧导航不可点，避免误操作），但用左内边距把面板推到「商品分类」右侧 */
  /* v20260921b：面板左边缘 = 左侧导航(220) + 内容内边距(28) + 商品分类面板(220) + 约 30px 间隙 = 498px；
     40vw 起随屏幕自适应，大屏上面板约占 60%（原来的半屏观感，略放大） */
  padding-left: max(498px, 40vw);
  background: rgba(15,23,42,.24);
  z-index: 220;
  display: flex;
  justify-content: flex-end;
}
@media (max-width: 880px) {
  .drawer-mask { padding-left: 0; } /* 窄屏侧栏转为横向条，面板回到全屏 */
}
/* 视频「清空」按钮：弱化样式，避免误认为主操作 */
.upload-btns .upload-clear { color: var(--text-sub); }
.drawer-mask[hidden] { display: none; }
.editor-drawer {
  width: 100%; /* v20260921b：填满遮罩区（遮罩已按上方的左侧偏移收窄，视觉上约 55%-60% 宽） */
  max-width: none;
  min-width: 0;
  height: 100%;
  background: var(--card);
  box-shadow: -16px 0 40px rgba(15,23,42,.18);
  display: flex;
  flex-direction: column;
  animation: drawer-in .22s ease;
}
@media (max-width: 1100px) {
  .editor-drawer { width: 100%; min-width: 0; }
}
@media (max-width: 860px) {
  .editor-drawer { width: 100%; min-width: 0; max-width: none; }
}
@keyframes drawer-in {
  from { transform: translateX(60px); opacity: .4; }
  to { transform: translateX(0); opacity: 1; }
}
.editor-drawer .editor-topbar { border-bottom: 1px solid var(--border); }
.drawer-actions {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 22px;
  border-top: 1px solid var(--border);
  background: var(--card);
}
.drawer-actions .btn-ghost { margin-left: auto; }

/* 拖拽排序把手 */
.list-row .list-sort-handle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  flex: 0 0 26px;
  color: var(--text-sub);
  cursor: grab;
  border-radius: 6px;
  font-size: 13px;
  user-select: none;
}
.list-row .list-sort-handle:hover { background: var(--primary-light); color: var(--primary); }
.list-row.drag-over { outline: 2px dashed var(--primary); outline-offset: -2px; }
.list-row.dragging { opacity: .55; }
.list-row .list-sort-handle:active { cursor: grabbing; }
.list-hint { font-size: 12px; color: var(--text-sub); display: flex; align-items: center; gap: 6px; }
.editor-topbar {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 20px 22px 14px;
  border-bottom: 1px solid var(--border);
  flex: 0 0 auto;
}
.editor-title-wrap { flex: 1; min-width: 0; }
.editor-topbar h3 { font-size: 18px; line-height: 1.4; }
.editor-hint { font-size: 12px; color: var(--text-sub); margin-top: 5px; line-height: 1.6; }
.modal-close {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--bg);
  border: none;
  color: var(--text-sub);
  cursor: pointer;
  flex: 0 0 auto;
  font-size: 15px;
}
.modal-close:hover { background: #fee2e2; color: var(--danger); }
/* 弹窗排版优化（2026-09-18）：标题不顶边角，与表单内容留出呼吸感 */
.modal h3 { margin: 0; padding: 18px 22px 0; font-size: 17px; }
.modal .editor-form { padding-top: 12px; }
.editor-form {
  flex: 1;
  min-height: 0;
  padding: 18px 22px 20px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.editor-form label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 14px;
  color: var(--text);
}
.editor-form input,
.editor-form select,
.editor-form textarea {
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
}
.editor-form textarea { resize: vertical; }
.editor-form input[type="checkbox"] { width: auto; align-self: flex-start; }
/* 新品/热门/状态一行水平排列（2026-09-17）：check-row 容器 + check-inline 单项水平 */
.check-row { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.editor-form label.check-row { flex-direction: row; align-items: center; }
.ex-company-checks { gap: 12px; }
.ex-company-checks .check-inline { gap: 4px; }
.ex-company-checks { gap: 12px; }
.ex-company-checks .check-inline { gap: 4px; }
.editor-form label.check-inline { flex-direction: row; align-items: center; gap: 8px; white-space: nowrap; }
.editor-form label.check-inline input[type="checkbox"] { align-self: center; }
.editor-form label.check-inline select { width: auto; min-width: 96px; flex: 0 0 auto; }
/* 只读字段（如分类 ID 自动生成）：灰底置灰，鼠标禁用态 */
.editor-form input[readonly] {
  background: var(--bg);
  color: var(--text-sub);
  cursor: not-allowed;
  border-style: dashed;
}
/* 必填字段红色星号（泛微风格，2026-09-18）：必填控件内部右侧显示红色 *，多行文本域显示在右上角 */
.editor-form input[required]:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="hidden"]),
.editor-form select[required] {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='16'%3E%3Ctext x='6' y='13' text-anchor='middle' fill='%23e34d59' font-size='15' font-weight='bold'%3E*%3C/text%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
  padding-right: 24px;
}
.editor-form textarea[required] {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='16'%3E%3Ctext x='6' y='13' text-anchor='middle' fill='%23e34d59' font-size='15' font-weight='bold'%3E*%3C/text%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px top 10px;
}
/* 分类图标快选（2026-09-18）：现有分类图标缩略图一行排布，点击填入 */
.icon-quick-pick { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 10px; }
.icon-quick-tip { font-size: 12px; color: var(--text-sub); }
.icon-quick-item { width: 38px; height: 38px; padding: 3px; border: 1px solid var(--border); border-radius: 8px; background: #fff; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.icon-quick-item img { max-width: 100%; max-height: 100%; object-fit: contain; }
.icon-quick-item:hover { border-color: var(--primary); box-shadow: 0 0 0 2px rgba(37, 99, 235, .12); }
/* 自定义确认弹窗（2026-09-18）：替代 window.confirm，去掉浏览器顶部的「域名 显示」字样 */
/* v20260921d：确认框层级（300）须高于编辑面板遮罩（220），否则在编辑表单里点「取消/关闭」时确认框被压在面板下，表现为点不动 */
.app-confirm-mask { z-index: 300; }
.app-confirm-modal { max-width: 380px; padding: 22px 24px 18px; }
.app-confirm-msg { font-size: 14px; line-height: 1.7; color: var(--text); white-space: pre-line; word-break: break-all; }
.app-confirm-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; }
.app-confirm-actions button { min-width: 76px; }
/* 分类图标：列表/面板内统一按系统小图标尺寸缩放显示（上传大图也不撑破布局） */
.cat-ico-img {
  width: 20px; height: 20px; object-fit: contain;
  vertical-align: -4px; border-radius: 4px;
}
/* 分类/面板内的图标+名称统一单行：flex 横向居中，禁止换行，过长自动省略 */
.cat-title {
  display: inline-flex; align-items: center; gap: 6px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
/* 左栏分类项中的标题：允许随面板宽度收缩并省略 */
.cat-item .cat-title { flex: 0 1 auto; min-width: 0; }
/* 右列表分类标题：占满 list-info，防止超长撑破列表行 */
.list-title .cat-title { display: flex; width: 100%; }
.cat-icon-preview { object-fit: contain; }
.upload-field .cat-icon-preview {
  display: flex; align-items: center; justify-content: center;
  font-size: 40px; color: var(--text); background: #fff;
}
.upload-field .cat-icon-preview.upload-preview-empty { font-size: 30px; color: #cdd3d9; }
.form-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 10px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
  position: sticky;
  bottom: 0;
  background: var(--card);
}
.form-actions .editor-autosave-tip { margin-right: auto; font-size: 12px; color: var(--text-sub); align-self: center; }
.mono { font-family: 'Consolas', 'Monaco', monospace; }
.code-hint {
  background: var(--bg);
  padding: 10px;
  border-radius: 8px;
  font-size: 12px;
  color: var(--text-sub);
  overflow-x: auto;
  margin-top: 8px;
}

/* 提示 */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(31,41,55,.92);
  color: #fff;
  padding: 10px 22px;
  border-radius: 24px;
  font-size: 14px;
  z-index: 300;
}

/* ---------- 显示设置 ---------- */
.settings-card { max-width: 640px; padding: 24px 28px; }
.settings-title { font-size: 16px; margin-bottom: 6px; }
.settings-page-tip { font-size: 12px; color: var(--text-sub); line-height: 1.7; margin: 0 0 8px; }
.settings-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 18px 0;
  border-bottom: 1px solid var(--border);
}
.settings-row:last-child { border-bottom: none; }
.settings-name { font-size: 14px; font-weight: 600; }
.settings-desc { font-size: 12px; color: var(--text-sub); margin-top: 4px; }
.settings-site-input { display: flex; align-items: center; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.settings-site-input input {
  flex: 1;
  min-width: 240px;
  max-width: 420px;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 13px;
  background: #fff;
  color: var(--text-main, #1f2430);
}
.settings-site-input input::placeholder { color: var(--text-sub, #98a2b3); }
.settings-site-input .btn-primary { flex-shrink: 0; }
.settings-row-site { align-items: flex-start; }
.settings-desc code, .settings-page-tip code {
  font-size: 12px;
  padding: 2px 6px;
  border-radius: 5px;
  background: var(--bg, #f5f6f8);
  border: 1px solid var(--border);
  color: var(--primary, #c8a86e);
  word-break: break-all;
}

/* 开关 */
.switch { position: relative; display: inline-block; width: 46px; height: 26px; flex-shrink: 0; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch .slider {
  position: absolute;
  inset: 0;
  background: #cbd5e1;
  border-radius: 26px;
  transition: background .2s;
  cursor: pointer;
}
.switch .slider::before {
  content: "";
  position: absolute;
  width: 20px;
  height: 20px;
  left: 3px;
  top: 3px;
  background: #fff;
  border-radius: 50%;
  transition: transform .2s;
  box-shadow: 0 1px 3px rgba(0,0,0,.25);
}
.switch input:checked + .slider { background: var(--primary); }
.switch input:checked + .slider::before { transform: translateX(20px); }

@media (max-width: 768px) {
  .admin-app { flex-direction: column; }
  .admin-sidebar { width: auto; }
  .form-row { grid-template-columns: 1fr; }
  .list-row { flex-direction: column; align-items: flex-start; }
}

/* ============ 公司管理（分权） ============ */
.role-badge {
  display: inline-block;
  margin-left: 8px;
  padding: 2px 8px;
  border-radius: 10px;
  background: var(--primary-light);
  color: var(--primary-dark);
  font-size: 12px;
  font-weight: 600;
}
.company-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 14px;
  box-shadow: var(--shadow);
}
.company-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.company-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 16px;
}
.company-logo {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: var(--primary-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  overflow: hidden;
}
.company-logo img { width: 100%; height: 100%; object-fit: cover; }
.company-actions { display: flex; gap: 8px; }
.company-meta {
  margin-top: 10px;
  color: var(--text-sub);
  font-size: 13px;
}
.company-stats {
  margin-top: 8px;
  display: flex;
  gap: 18px;
  font-size: 13px;
  color: var(--text-sub);
}
.company-stats span::before { content: "· "; color: var(--primary); }
.admin-panel {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px dashed var(--border);
}
.admin-panel-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--primary-dark);
  margin-bottom: 10px;
}
.admin-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-bottom: 8px;
  background: #fafbfa;
}
.admin-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 13px;
}
.admin-info span { color: var(--text-sub); font-size: 12px; }
.admin-add {
  display: flex;
  gap: 8px;
  margin-top: 10px;
  flex-wrap: wrap;
}
.admin-add input {
  flex: 1;
  min-width: 140px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 13px;
}
.admin-add .btn-primary { flex-shrink: 0; }

/* ============ 专属页管理 ============ */
.page-url-code {
  font-family: Consolas, monospace;
  font-size: 12px;
  color: var(--primary-dark);
  background: var(--primary-light);
  padding: 2px 6px;
  border-radius: 5px;
  word-break: break-all;
}
.list-meta code.page-url-code { margin-right: 6px; }

/* ============ v2.9 数据库与备份（数据管理） ============ */
.system-stack { display: flex; flex-direction: column; gap: 16px; max-width: 1080px; }
.system-stack .company-card { margin-bottom: 0; }
.sys-card-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  flex-wrap: wrap;
}
.sys-card-title .tag {
  font-size: 11px;
  font-weight: 600;
  border-radius: 10px;
  padding: 2px 10px;
  background: var(--primary-light);
  color: var(--primary-dark);
  border: 1px solid #ccfbf1;
}
.sys-card-title .tag.warn { background: #fffbeb; color: #b45309; border-color: #fde68a; }
.sys-card-tip { font-size: 12px; color: var(--text-sub); line-height: 1.7; margin: 6px 0 4px; }
.sys-card-tip code { font-family: Consolas, monospace; background: var(--bg); border: 1px solid var(--border); border-radius: 5px; padding: 1px 5px; word-break: break-all; }
/* 状态信息栅格 */
.sys-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 10px;
  margin-top: 12px;
}
.sys-stat {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
}
.sys-stat .k { font-size: 11px; color: var(--text-sub); margin-bottom: 4px; }
.sys-stat .v { font-size: 13px; font-weight: 600; word-break: break-all; }
.sys-stat .v.mono { font-weight: 500; font-size: 12px; }
.sys-stat .v.path { font-size: 11px; font-weight: 500; line-height: 1.5; }
/* 表单行 */
.sys-form-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 10px;
}
.sys-form-row label { font-size: 13px; color: var(--text); display: inline-flex; align-items: center; gap: 6px; }
.sys-form-row input[type="text"],
.sys-form-row input[type="number"],
.sys-form-row input[type="time"],
.sys-form-row select {
  padding: 7px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 13px;
  background: #fff;
  color: var(--text);
}
.sys-form-row input[type="number"] { width: 84px; }
.sys-form-row input[type="time"] { width: 116px; }
.sys-form-row .field { display: flex; align-items: center; gap: 6px; }
.sys-form-row .field > span { font-size: 12px; color: var(--text-sub); }
.sys-actions { margin-top: 14px; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
/* 备份历史表 */
.sys-table { width: 100%; border-collapse: collapse; font-size: 13px; margin-top: 10px; }
.sys-table th, .sys-table td {
  text-align: left;
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.sys-table th { color: var(--text-sub); font-weight: 600; font-size: 12px; background: var(--bg); }
.sys-table .mono { font-size: 12px; }
.sys-empty { color: var(--text-sub); font-size: 13px; padding: 14px 0; text-align: center; }
.sys-kind {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  border-radius: 5px;
  padding: 1px 7px;
  background: #e0f2fe; color: #0369a1;
}
.sys-kind.json { background: #fef3c7; color: #b45309; }
/* 连接列表 */
.sys-conn-row {
  display: flex;
  align-items: center;
  gap: 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 14px;
  margin-bottom: 8px;
  background: #fafbfa;
  flex-wrap: wrap;
}
.sys-conn-row .conn-name { font-weight: 600; font-size: 14px; display: flex; align-items: center; gap: 8px; }
.sys-conn-row .conn-detail { font-size: 12px; color: var(--text-sub); flex: 1; min-width: 180px; word-break: break-all; }
.sys-conn-row .conn-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.sys-conn-type {
  font-size: 11px;
  border-radius: 5px;
  padding: 1px 8px;
  font-weight: 700;
  background: #dcfce7; color: #15803d;
}
.sys-conn-type.mysql { background: #fef3c7; color: #b45309; }
.sys-conn-type.postgres { background: #e0e7ff; color: #4338ca; }
/* 连接编辑器 */
.sys-editor {
  border: 1px dashed var(--primary);
  background: var(--primary-light);
  border-radius: 10px;
  padding: 14px 16px;
  margin: 10px 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.sys-editor .ed-row { display: flex; gap: 10px; flex-wrap: wrap; }
.sys-editor label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--text-sub); }
.sys-editor input, .sys-editor select {
  padding: 7px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 13px;
  background: #fff;
  color: var(--text);
  min-width: 120px;
}
.sys-editor label.grow { flex: 1; min-width: 200px; }
.sys-editor label.grow input { width: 100%; }
.sys-editor .ed-actions { display: flex; gap: 8px; }
/* 操作按钮组 */
.link-act { background: none; border: none; color: var(--primary); cursor: pointer; font-size: 13px; padding: 2px 4px; }
.link-act:hover { text-decoration: underline; }
.link-act.danger { color: var(--danger); }
.link-act.armed { background: var(--danger); color: #fff; border-radius: 6px; padding: 3px 8px; }

/* ---------- 右侧列表分页条（商品/分类/轮播/公司/专属页，10 条/页） ---------- */
.list-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 6px;
  padding: 14px 0 6px;
}
.list-pagination .page-btn {
  min-width: 32px;
  padding: 5px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  font-size: 13px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.list-pagination .page-btn:hover:not(:disabled) { background: var(--primary-soft, #eef7ff); }
.list-pagination .page-btn.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
  cursor: default;
}
.list-pagination .page-btn:disabled { opacity: 0.45; cursor: not-allowed; }
.list-pagination .page-info { font-size: 12px; color: var(--text-sub); margin-left: 8px; }

/* 商品列表名称快速筛选栏 */
.prod-filter-bar { display: flex; gap: 8px; align-items: center; margin-bottom: 10px; }
.prod-filter-bar input {
  flex: 1;
  max-width: 360px;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 13px;
  background: #fff;
  color: var(--text);
}
.prod-filter-bar input:focus { outline: none; border-color: var(--primary); }
.list-pagination .page-size-label { font-size: 12px; color: var(--text-sub); display: inline-flex; align-items: center; gap: 6px; margin-left: 8px; }
.list-pagination .page-size-select {
  padding: 4px 6px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 12px;
  background: #fff;
  color: var(--text);
  cursor: pointer;
}

/* ===== 专属页「价格展示」一行三勾选框（v20260907c） ===== */
.price-cols-row {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #f8fafc;
}
.price-cols-row .price-cols-label { font-size: 13px; font-weight: 600; color: var(--text); }
.price-cols-row .price-cols-label em { color: #dc2626; font-style: normal; margin-left: 2px; }
.price-cols-row label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--text);
  cursor: pointer;
  margin: 0;
}
.price-cols-row label input { margin: 0; }

/* ===== 复制商品弹窗（v20260916）：超管可改目标公司/分类 ===== */
.copy-modal {
  position: relative;
  max-width: 460px;
  padding: 24px 26px 20px;
  gap: 0;
}
.copy-modal .modal-close { position: absolute; top: 12px; right: 12px; }
.copy-modal .pwd-form label { display: block; margin: 12px 0 0; font-size: 13px; color: var(--text); }
.copy-modal .pwd-form select {
  width: 100%;
  margin-top: 6px;
  padding: 9px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  background: #fff;
}
.copy-modal .pwd-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; }

/* ---------- 个人中心（v20260919）：公司资料 + 修改密码 ---------- */
#profileSection { border-bottom: 1px dashed #e5e5e5; padding-bottom: 10px; margin-bottom: 12px; }
.pwd-subtitle { margin: 2px 0 10px; font-size: 13px; font-weight: 600; color: #333; }
.pf-logo-row { display: flex; align-items: center; gap: 10px; }
.pf-logo-preview { width: 56px; height: 56px; object-fit: contain; border: 1px solid #e5e5e5; border-radius: 6px; background: #fafafa; }
.pwd-form textarea { width: 100%; padding: 8px 10px; border: 1px solid #d9d9d9; border-radius: 6px; font: inherit; color: inherit; resize: vertical; }
