/* ============================================================
   图册后台 · 样式
   ============================================================ */
:root {
  --bg: #f6f7f9;
  --panel: #ffffff;
  --line: #e6e8ec;
  --line-2: #eef0f3;
  --text: #1c1f23;
  --text-2: #5b626c;
  --text-3: #9aa1ab;
  --brand: #3b6cf6;
  --brand-soft: #eef3ff;
  --ok: #17a673;
  --warn: #e08b1a;
  --danger: #e0474d;
  --radius: 12px;
  --radius-sm: 8px;
  --sh: 0 1px 2px rgba(16,24,40,.05), 0 1px 3px rgba(16,24,40,.06);
  --sh-lg: 0 12px 32px rgba(16,24,40,.13);
}

* { box-sizing: border-box; }

/* hidden 属性必须压过下面 .wrap{display:flex} 之类的类选择器，否则首屏会闪一下主界面 */
[hidden] { display: none !important; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  font-size: 14px;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

button, input, select, textarea { font-family: inherit; font-size: inherit; color: inherit; }
a { color: var(--brand); text-decoration: none; }

/* ---------------- 登录页 ---------------- */
.login-page {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(140deg, #2f4fd6, #5b3bd6 60%, #7b39c9);
  padding: 24px;
}
.login-card {
  background: #fff; border-radius: 20px; padding: 40px 34px 34px;
  width: 100%; max-width: 380px; box-shadow: 0 20px 50px rgba(0,0,0,.22);
  text-align: center;
}
.login-card .mark {
  width: 54px; height: 54px; margin: 0 auto 18px; border-radius: 15px;
  background: linear-gradient(135deg, #3b6cf6, #6b46e0);
  display: flex; align-items: center; justify-content: center;
}
.login-card .mark svg { width: 28px; height: 28px; stroke: #fff; }
.login-card h1 { font-size: 20px; margin: 0 0 6px; letter-spacing: .5px; }
.login-card p.sub { font-size: 13.5px; color: var(--text-3); margin: 0 0 26px; }
.login-card input {
  width: 100%; padding: 12px 15px; border: 1.5px solid var(--line);
  border-radius: 11px; outline: none; transition: border-color .15s;
  font-size: 15px; text-align: center;
}
.login-card input:focus { border-color: var(--brand); }
.login-card button {
  width: 100%; margin-top: 14px; padding: 12px; border: none; border-radius: 11px;
  background: var(--brand); color: #fff; font-weight: 600; cursor: pointer;
  transition: background .15s;
}
.login-card button:hover { background: #2f5cdd; }
.login-card button:disabled { opacity: .55; cursor: default; }
.login-err { color: var(--danger); font-size: 13px; margin-top: 12px; min-height: 18px; }

/* ---------------- 布局 ---------------- */
.wrap { display: flex; min-height: 100vh; }

.side {
  width: 236px; flex: 0 0 236px; background: #1d2028; color: #c9ced8;
  display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh;
}
.side .logo {
  padding: 20px 18px 16px; border-bottom: 1px solid rgba(255,255,255,.08);
  display: flex; align-items: center; gap: 10px;
}
.side .logo .ic {
  width: 32px; height: 32px; border-radius: 9px; flex: 0 0 32px;
  background: linear-gradient(135deg, #4b7bfd, #7a4ce8);
  display: flex; align-items: center; justify-content: center;
}
.side .logo .ic svg { width: 17px; height: 17px; stroke: #fff; }
.side .logo b { color: #fff; font-size: 14.5px; letter-spacing: .3px; }
.side .logo span { font-size: 11px; color: #7d8593; display: block; margin-top: 1px; }

.side nav { flex: 1; padding: 12px 10px; overflow-y: auto; }
.side nav .sec {
  font-size: 11px; color: #6a7280; padding: 12px 10px 6px; letter-spacing: .6px;
  text-transform: uppercase;
}
.side nav a {
  display: flex; align-items: center; gap: 9px; padding: 9px 10px;
  border-radius: 9px; color: #c9ced8; font-size: 13.5px; cursor: pointer;
  transition: background .13s, color .13s; margin-bottom: 2px;
}
.side nav a:hover { background: rgba(255,255,255,.07); color: #fff; }
.side nav a.on { background: var(--brand); color: #fff; font-weight: 500; }
.side nav a svg { width: 16px; height: 16px; flex: 0 0 16px; }
.side nav a .n {
  margin-left: auto; font-size: 11px; background: rgba(255,255,255,.13);
  padding: 1px 6px; border-radius: 20px; min-width: 20px; text-align: center;
}
.side nav a.on .n { background: rgba(255,255,255,.25); }

.side .foot {
  padding: 12px 16px 16px; border-top: 1px solid rgba(255,255,255,.08);
  font-size: 11.5px; color: #6a7280;
}
.side .foot button {
  background: none; border: none; color: #8d95a3; cursor: pointer; padding: 0;
  font-size: 11.5px; text-decoration: underline;
}
.side .foot button:hover { color: #fff; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.topbar {
  background: #fff; border-bottom: 1px solid var(--line); padding: 0 22px;
  height: 58px; display: flex; align-items: center; gap: 14px;
  position: sticky; top: 0; z-index: 30;
}
.topbar h2 { font-size: 16px; margin: 0; font-weight: 600; }
.topbar .crumb { font-size: 12.5px; color: var(--text-3); }
.topbar .spacer { flex: 1; }

.content { padding: 20px 22px 60px; flex: 1; }

/* ---------------- 通用组件 ---------------- */
.btn {
  border: 1px solid var(--line); background: #fff; padding: 8px 14px;
  border-radius: var(--radius-sm); cursor: pointer; font-size: 13.5px;
  display: inline-flex; align-items: center; gap: 6px; transition: all .13s;
  white-space: nowrap;
}
.btn:hover { border-color: #ccd2dc; background: #fafbfc; }
.btn svg { width: 15px; height: 15px; }
.btn.primary {
  background: var(--brand); border-color: var(--brand); color: #fff; font-weight: 500;
}
.btn.primary:hover { background: #2f5cdd; border-color: #2f5cdd; }
.btn.danger { color: var(--danger); border-color: #f4cdcf; }
.btn.danger:hover { background: #fef5f5; border-color: #eaa8ab; }
.btn.ghost { border-color: transparent; background: transparent; color: var(--text-2); }
.btn.ghost:hover { background: #f1f3f6; }
.btn.sm { padding: 5px 10px; font-size: 12.5px; }
.btn:disabled { opacity: .5; cursor: default; }

.card {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--sh);
}
.card-hd {
  padding: 14px 18px; border-bottom: 1px solid var(--line-2);
  display: flex; align-items: center; gap: 12px;
}
.card-hd h3 { margin: 0; font-size: 14.5px; font-weight: 600; }
.card-hd .spacer { flex: 1; }
.card-bd { padding: 18px; }

.field { margin-bottom: 15px; }
.field label {
  display: block; font-size: 12.5px; color: var(--text-2);
  margin-bottom: 6px; font-weight: 500;
}
.field .hint { font-size: 11.5px; color: var(--text-3); margin-top: 5px; line-height: 1.6; }
.input, .field input, .field select, .field textarea {
  width: 100%; padding: 9px 12px; border: 1px solid var(--line);
  border-radius: var(--radius-sm); outline: none; transition: border-color .13s, box-shadow .13s;
  background: #fff;
}
.field input:focus, .field select:focus, .field textarea:focus, .input:focus {
  border-color: var(--brand); box-shadow: 0 0 0 3px rgba(59,108,246,.11);
}
.field textarea { resize: vertical; min-height: 74px; line-height: 1.6; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.grid3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 0 16px; }

/* ---------------- 开关（switch） ----------------
 * ⚠ 选择器必须写成 `.field label.switch`，只写 `.switch` 是不够的。
 * `.field label` 的特异性是 (0,1,1)，裸 `.switch` 是 (0,1,0) —— 后者输，
 * display 被压成 block，开关行就退化成普通块级元素。
 * 那时 `.track` 回到 inline，而 inline 元素的 width/height 是无效的 →
 * 宽度塌成 0，它那个 position:absolute 的圆点便直接叠在文字上。
 */
.switch,
.field label.switch {
  display: flex; align-items: center; gap: 10px;
  cursor: pointer; user-select: none;
  margin-bottom: 0; font-weight: 400; color: var(--text);
}
/* 同样要压过 `.field input { width:100% }`，避免哪天顺序被调换后复选框又冒出来 */
.field label.switch input,
.switch input { display: none; }
.switch .track {
  width: 38px; height: 22px; border-radius: 20px; background: #d3d8e0;
  position: relative; transition: background .16s; flex: 0 0 38px;
}
.switch .track::after {
  content: ''; position: absolute; top: 2px; left: 2px; width: 18px; height: 18px;
  border-radius: 50%; background: #fff; transition: transform .16s;
  box-shadow: 0 1px 3px rgba(0,0,0,.2);
}
.switch input:checked + .track { background: var(--ok); }
.switch input:checked + .track::after { transform: translateX(16px); }
/* 文案占满剩余宽度，窄窗口下换行而不是被裁切 */
.switch .lb { font-size: 13.5px; flex: 1 1 auto; min-width: 0; line-height: 1.45; }

.tag {
  display: inline-block; padding: 2px 8px; border-radius: 20px; font-size: 11.5px;
  background: var(--brand-soft); color: var(--brand);
}
.tag.gray { background: #f0f2f5; color: var(--text-2); }
.tag.ok { background: #e8f8f1; color: var(--ok); }
.tag.warn { background: #fdf4e5; color: var(--warn); }
.tag.off { background: #f0f2f5; color: var(--text-3); }

.empty-box {
  text-align: center; padding: 56px 20px; color: var(--text-3);
}
.empty-box svg { width: 42px; height: 42px; stroke: #ccd2dc; margin-bottom: 14px; }
.empty-box b { display: block; color: var(--text-2); font-size: 14.5px; margin-bottom: 6px; }
.empty-box p { margin: 0 0 18px; font-size: 13px; }

/* ---------------- 品牌卡片列表 ---------------- */
.brand-grid {
  display: grid; gap: 16px;
  grid-template-columns: repeat(auto-fill, minmax(272px, 1fr));
}
.brand-card {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; box-shadow: var(--sh); transition: box-shadow .16s, transform .16s;
  display: flex; flex-direction: column;
}
.brand-card:hover { box-shadow: var(--sh-lg); transform: translateY(-2px); }
.brand-card .banner {
  height: 88px; position: relative; display: flex; align-items: center;
  padding: 0 16px; overflow: hidden;
}
.brand-card .banner .logo {
  height: 34px; max-width: 150px; object-fit: contain;
  background: rgba(255,255,255,.92); border-radius: 6px; padding: 4px 8px;
}
.brand-card .banner .nm {
  color: #fff; font-size: 16px; font-weight: 600; letter-spacing: .4px;
  text-shadow: 0 1px 6px rgba(0,0,0,.28);
}
.brand-card .bd { padding: 14px 16px 16px; flex: 1; display: flex; flex-direction: column; }
.brand-card .st { display: flex; gap: 16px; margin-bottom: 13px; }
.brand-card .st div { font-size: 12px; color: var(--text-3); }
.brand-card .st div b {
  display: block; font-size: 17px; color: var(--text); font-weight: 600; margin-bottom: 1px;
}
.brand-card .url {
  font-size: 11.5px; color: var(--text-3); background: #f7f8fa; padding: 6px 9px;
  border-radius: 6px; margin-bottom: 13px;
  font-family: ui-monospace, Menlo, Consolas, monospace;
  display: flex; align-items: center; gap: 6px;
}
.brand-card .url .u {
  flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
/* 中文品牌名会走自动编号，提示用户改成英文更好记 */
.brand-card .url .slugtip {
  flex: none; padding: 1px 5px; font-size: 10.5px; line-height: 1.5;
  border-radius: 4px; background: #fff3e0; color: #a35b00; cursor: help;
}
.brand-card .acts { display: flex; gap: 7px; margin-top: auto; flex-wrap: wrap; }

/* ---------------- 表格 ---------------- */
.tbl { width: 100%; border-collapse: collapse; }
.tbl th {
  text-align: left; font-size: 12px; color: var(--text-3); font-weight: 500;
  padding: 10px 12px; border-bottom: 1px solid var(--line); background: #fafbfc;
  position: sticky; top: 0; z-index: 5;
}
.tbl td { padding: 10px 12px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
.tbl tr:hover td { background: #fafbfc; }
.tbl .thumb {
  width: 46px; height: 46px; border-radius: 7px; object-fit: cover;
  background: #f2f3f5; display: block;
}
.tbl .drag {
  cursor: grab; color: #ccd2dc; display: flex; align-items: center;
}
.tbl .drag svg { width: 15px; height: 15px; }
.tbl tr.dragging { opacity: .4; }
.tbl tr.drop-t { box-shadow: inset 0 2px 0 var(--brand); }
.tbl tr.drop-b { box-shadow: inset 0 -2px 0 var(--brand); }

/* ---------------- 产品卡片网格（后台） ---------------- */
.p-grid {
  display: grid; gap: 14px;
  grid-template-columns: repeat(auto-fill, minmax(196px, 1fr));
}
.p-card {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; box-shadow: var(--sh); transition: box-shadow .15s;
  display: flex; flex-direction: column;
}
.p-card:hover { box-shadow: 0 6px 20px rgba(16,24,40,.1); }
.p-card.sel { border-color: var(--brand); box-shadow: 0 0 0 2px rgba(59,108,246,.16); }
.p-card .pic {
  aspect-ratio: 1; background: #f4f5f7; position: relative; overflow: hidden;
  display: flex; align-items: center; justify-content: center;
}
.p-card .pic img { width: 100%; height: 100%; object-fit: cover; display: block; }
.p-card .pic .ph { color: #ccd2dc; font-size: 12px; }
.p-card .pic .n {
  position: absolute; right: 7px; bottom: 7px; background: rgba(0,0,0,.62);
  color: #fff; font-size: 11px; padding: 2px 7px; border-radius: 20px;
}
.p-card .pic .fav {
  /* 原来跟左上角的勾选框 .pick 一样是 left:7 top:7，两者完全重合，
     「推荐」两个字被压掉大半 —— 而这个标记决定产品是否进首页轮播，必须看得见。
     挪到右上角：左上勾选、右上推荐、右下图数、左下分类，四角各占一个。 */
  position: absolute; right: 7px; top: 7px; background: #ff9f1c; color: #fff;
  font-size: 10.5px; padding: 2px 7px; border-radius: 20px; font-weight: 600;
}
.p-card .cat-tag {
  position: absolute; left: 7px; bottom: 7px; background: rgba(255,255,255,.92);
  color: var(--text-2); font-size: 10.5px; padding: 2px 7px; border-radius: 20px;
  max-width: calc(100% - 60px); overflow: hidden; text-overflow: ellipsis;
  white-space: nowrap;
}
.p-card .bd { padding: 11px 12px 12px; flex: 1; display: flex; flex-direction: column; }
.p-card .bd b {
  font-size: 13.5px; font-weight: 600; display: block; line-height: 1.4;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.p-card .bd span {
  font-size: 11.5px; color: var(--text-3); display: block; margin-top: 3px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.p-card .ops { display: flex; gap: 5px; margin-top: 10px; }
.p-card .ops .btn { flex: 1; justify-content: center; padding: 5px 6px; font-size: 12px; }
.p-card .pick {
  position: absolute; left: 7px; top: 7px; width: 20px; height: 20px;
  border-radius: 6px; background: rgba(255,255,255,.94); border: 1.5px solid #ccd2dc;
  display: flex; align-items: center; justify-content: center; cursor: pointer;
}
.p-card .pick.on { background: var(--brand); border-color: var(--brand); }
.p-card .pick svg { width: 12px; height: 12px; stroke: #fff; display: none; }
.p-card .pick.on svg { display: block; }

/* ---------------- 合集管理 ---------------- */
.coll-grid {
  display: grid; gap: 14px;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
}
/* 合集按分类分组（与首页一致） */
.coll-group { margin-bottom: 22px; }
.coll-group:last-child { margin-bottom: 0; }
.coll-group-hd {
  display: flex; align-items: baseline; gap: 9px; margin: 2px 2px 13px;
}
.coll-group-hd b { font-size: 15px; font-weight: 650; color: var(--text); }
.coll-group-hd span { font-size: 12px; color: var(--text-3); }
.coll-card {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; box-shadow: var(--sh); transition: box-shadow .15s;
  display: flex; flex-direction: column;
}
.coll-card:hover { box-shadow: 0 6px 20px rgba(16,24,40,.1); }
.coll-card .pic {
  aspect-ratio: 4/3; background: #f4f5f7; position: relative; overflow: hidden;
  display: flex; align-items: center; justify-content: center;
}
.coll-card .pic img { width: 100%; height: 100%; object-fit: cover; display: block; }
.coll-card .pic .ph { color: #ccd2dc; font-size: 13px; }
.coll-card .cat-tag {
  position: absolute; left: 8px; bottom: 8px; background: rgba(255,255,255,.92);
  color: var(--text-2); font-size: 11px; padding: 2px 8px; border-radius: 20px;
  max-width: calc(100% - 24px); overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.coll-card .bd { padding: 11px 12px 12px; flex: 1; display: flex; flex-direction: column; }
.coll-card .bd b {
  font-size: 13.5px; font-weight: 600; display: block; line-height: 1.4;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.coll-card .bd span { font-size: 11.5px; color: var(--text-3); margin-top: 3px; }
.coll-card .bd .ops { display: flex; gap: 6px; margin-top: 10px; align-items: center; }
.coll-card .bd .ops .btn { flex: 1; justify-content: center; }
/* 排序号输入框：数字越小越靠前，改完即存 */
.coll-card .bd .ops .ord-wrap {
  flex: none; display: flex; align-items: center; gap: 3px;
  font-size: 11.5px; color: var(--text-3); white-space: nowrap; margin: 0; font-weight: 400;
}
.coll-card .bd .ops .ord-in {
  width: 46px; padding: 5px 2px; text-align: center; font-size: 13px;
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: #fff; outline: none; font-variant-numeric: tabular-nums;
}
.coll-card .bd .ops .ord-in:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(59,108,246,.11); }

/* 封面上传行 */
.cover-row { display: flex; gap: 14px; align-items: flex-start; flex-wrap: wrap; }
.cover-prev {
  width: 132px; height: 99px; border: 1px dashed var(--line); border-radius: var(--radius-sm);
  background: #f4f5f7; overflow: hidden; flex: none;
  display: flex; align-items: center; justify-content: center;
}
.cover-prev img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cover-prev .ph { color: #ccd2dc; font-size: 12px; }
.cover-up { display: flex; flex-direction: column; gap: 7px; align-items: flex-start; }

/* 产品选择器
 * ⚠ 这两处都是 .field 里的 <label>，选择器必须带 .field 前缀压过
 *   `.field label { display:block }`（同 switch 的教训），否则选择行退化成竖排：
 *   缩略图/名称/货号/勾选框各占一行，一行撑得老高。
 */
.field .picker-hd {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  flex-wrap: wrap; margin-bottom: 8px;
}
.field .picker-hd > span:first-child {
  font-size: 13px; font-weight: 600; color: var(--text-2); margin-bottom: 0;
}
.picker-tools { display: flex; gap: 6px; align-items: center; }
.input.sm {
  padding: 5px 9px; font-size: 12.5px; border: 1px solid var(--line);
  border-radius: var(--radius-sm); background: #fff; outline: none;
}
.input.sm:focus { border-color: var(--brand); }
.pick-list {
  border: 1px solid var(--line); border-radius: var(--radius); background: #fff;
  max-height: 320px; overflow-y: auto; padding: 6px;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(232px, 1fr));
  gap: 4px; align-content: start;
}
.field .pick-row {
  display: flex; align-items: center; gap: 9px; padding: 6px 8px;
  border-radius: var(--radius-sm); cursor: pointer; user-select: none;
  margin-bottom: 0; font-weight: 400; color: var(--text); font-size: 13px;
  border: 1px solid transparent; transition: background .12s, border-color .12s;
}
.pick-row:hover { background: #f7f9fc; }
.pick-row.on { background: rgba(59,108,246,.07); border-color: rgba(59,108,246,.35); }
.pick-row .pr-pic {
  width: 40px; height: 40px; border-radius: 8px; overflow: hidden; flex: none;
  background: #f4f5f7; display: flex; align-items: center; justify-content: center;
}
.pick-row .pr-pic img { width: 100%; height: 100%; object-fit: cover; }
.pick-row .pr-pic .ph { color: #ccd2dc; font-size: 11px; }
.pick-row .pr-tx { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.pick-row .pr-tx b {
  font-size: 12.5px; font-weight: 600; line-height: 1.35;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.pick-row .pr-tx em { font-style: normal; font-size: 11px; color: var(--text-3); }
.pick-row input[type=checkbox] { width: 16px; height: 16px; accent-color: var(--brand); flex: none; margin: 0; }
.qs-empty { grid-column: 1 / -1; padding: 28px 10px; text-align: center; color: var(--text-3); font-size: 13px; }

/* ---------------- 工具栏 ---------------- */
.toolbar {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 16px;
}
.toolbar .search-in {
  position: relative; flex: 0 1 268px;
}
.toolbar .search-in input { padding-left: 34px; }
.toolbar .search-in svg {
  position: absolute; left: 11px; top: 50%; transform: translateY(-50%);
  width: 15px; height: 15px; stroke: var(--text-3); pointer-events: none;
}
.toolbar select {
  padding: 8px 12px; border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: #fff; outline: none; cursor: pointer;
}
.toolbar .spacer { flex: 1; }

.bar-note {
  background: var(--brand-soft); border: 1px solid #d8e4ff; color: #2f4fd6;
  padding: 10px 14px; border-radius: var(--radius-sm); font-size: 13px;
  margin-bottom: 16px; line-height: 1.6;
}

/* ---------------- 版本/模板 ---------------- */
.theme-row { display: flex; gap: 9px; flex-wrap: wrap; }
.theme-dot {
  width: 32px; height: 32px; border-radius: 50%; cursor: pointer;
  border: 2.5px solid transparent; transition: transform .13s;
}
.theme-dot:hover { transform: scale(1.09); }
.theme-dot.on { border-color: var(--text); }

/* ---------------- 分段选择（Logo 形状等二选一） ---------------- */
.seg {
  display: inline-flex; gap: 3px; padding: 3px;
  background: #f1f3f6; border-radius: var(--radius-sm);
}
.seg button {
  border: 0; background: transparent; cursor: pointer; font-family: inherit;
  padding: 7px 14px; border-radius: 6px; font-size: 13px; color: var(--text-2);
  display: inline-flex; align-items: center; gap: 7px; transition: background .13s, color .13s;
}
.seg button:hover { color: var(--text); }
.seg button.on {
  background: #fff; color: var(--text); font-weight: 500;
  box-shadow: 0 1px 2px rgba(16, 16, 16, .08);
}
/* 按钮里的小色块，一眼看出选的是圆的还是方的 */
.seg .shp { width: 13px; height: 13px; background: currentColor; opacity: .7; }
.seg button[data-shape="round"] .shp { border-radius: 50%; }
.seg button[data-shape="square"] .shp { border-radius: 3.5px; }

/* Logo 预览：照客户站顶栏的样子摆，切形状时一眼看出差别 */
.logo-prev {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px; background: #fff;
  border: 1px solid var(--line); border-radius: var(--radius-sm);
}
.logo-prev img {
  width: 40px; height: 40px; flex: none;
  object-fit: contain; background: #fff;
  box-shadow: 0 0 0 1px rgba(16, 16, 16, .07);
}
.logo-prev-tx { display: flex; flex-direction: column; min-width: 0; }
.logo-prev-tx b { font-size: 15px; font-weight: 600; }
.logo-prev-tx i { font-style: normal; font-size: 11.5px; color: var(--text-3); margin-top: 2px; }

.preview-box {
  background: #2b2f36; border-radius: var(--radius); padding: 20px;
  display: flex; justify-content: center;
}
.preview-box img { max-width: 100%; max-height: 220px; border-radius: 8px; }

/* 公司介绍 —— 实力数据的一行输入：左边数字短、右边说明长 */
.fact-row {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr);
  gap: 8px;
  margin-bottom: 8px;
}
.fact-row:last-child { margin-bottom: 0; }
.fact-row .fi-n { font-weight: 500; }
@media (max-width: 560px) {
  .fact-row { grid-template-columns: 1fr 1fr; }
}
.qr-holder {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px; text-align: center;
}
.qr-holder img { width: 168px; height: 168px; image-rendering: pixelated; }
.qr-holder .nm { font-size: 12.5px; color: var(--text-2); margin-top: 10px; word-break: break-all; }

/* ---------------- 图片墙 ---------------- */
.img-wall {
  display: grid; gap: 11px;
  grid-template-columns: repeat(auto-fill, minmax(132px, 1fr));
}
.img-cell {
  position: relative; border-radius: 10px; overflow: hidden; background: #f4f5f7;
  border: 1px solid var(--line); aspect-ratio: 1; cursor: grab;
}
.img-cell img { width: 100%; height: 100%; object-fit: cover; display: block; }
.img-cell.dragging { opacity: .35; }
.img-cell.drop-t { box-shadow: inset 3px 0 0 var(--brand); }
.img-cell.drop-b { box-shadow: inset -3px 0 0 var(--brand); }
.img-cell .bar {
  position: absolute; inset: auto 0 0 0; padding: 5px 7px; display: flex; gap: 5px;
  background: linear-gradient(transparent, rgba(0,0,0,.62)); opacity: 0; transition: opacity .14s;
}
.img-cell:hover .bar { opacity: 1; }
.img-cell .bar button {
  border: none; background: rgba(255,255,255,.92); border-radius: 5px;
  width: 24px; height: 24px; cursor: pointer; display: flex; align-items: center;
  justify-content: center; padding: 0;
}
.img-cell .bar button:hover { background: #fff; }
.img-cell .bar button svg { width: 13px; height: 13px; stroke: var(--text-2); }
.img-cell .bar button.del svg { stroke: var(--danger); }
.img-cell .cover-badge {
  position: absolute; left: 6px; top: 6px; background: var(--brand); color: #fff;
  font-size: 10.5px; padding: 2px 7px; border-radius: 20px; font-weight: 500;
}
.img-cell .seq {
  position: absolute; right: 6px; top: 6px; background: rgba(0,0,0,.55); color: #fff;
  font-size: 10.5px; width: 18px; height: 18px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
}
.img-add {
  border: 1.5px dashed #ccd2dc; border-radius: 10px; aspect-ratio: 1;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 7px; cursor: pointer; color: var(--text-3); font-size: 12.5px;
  background: #fff; transition: all .14s;
}
.img-add:hover { border-color: var(--brand); color: var(--brand); background: var(--brand-soft); }
.img-add svg { width: 24px; height: 24px; }

/* ---------------- 分享设置（产品级转发卡片） ----------------
 * 左边一张 1:1 的方形预览 —— 和微信转发卡片里的缩略图是同一个比例，
 * 预览什么样、客户看到的就是什么样。右边三件套：链接 / 标题 / 描述。
 * 窄窗口下自动竖排，不然输入框会被挤到只剩几十像素。
 */
.share-box {
  display: flex; gap: 14px; align-items: flex-start;
  background: #f8f9fc; border: 1px solid var(--line);
  border-radius: var(--radius); padding: 12px;
}
.sb-pic { flex: 0 0 104px; width: 104px; }
.sb-thumb {
  position: relative; width: 104px; height: 104px; border-radius: 10px;
  overflow: hidden; background: #fff; border: 1px solid var(--line);
  display: flex; align-items: center; justify-content: center;
}
.sb-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.sb-thumb.empty {
  font-size: 11px; color: var(--text-3); text-align: center;
  line-height: 1.5; padding: 8px; border-style: dashed;
}
/* 「自动取封面」这个角标很重要：不写的话，用户会以为这就是自己传的分享图 */
.sb-tag {
  position: absolute; left: 0; right: 0; bottom: 0;
  background: rgba(16,20,28,.62); color: #fff;
  font-size: 10px; text-align: center; padding: 3px 0; letter-spacing: .3px;
}
.sb-acts { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.sb-acts .btn { flex: 1 1 auto; padding: 6px 8px; font-size: 12px; white-space: nowrap; }

.sb-tx { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.sb-url { display: flex; gap: 6px; }
.sb-url input {
  flex: 1 1 auto; min-width: 0;
  font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 12px;
  color: var(--text-2); background: #fff;
}
.sb-url .btn { flex: 0 0 auto; white-space: nowrap; padding: 9px 12px; }
@media (max-width: 720px) {
  .share-box { flex-direction: column; }
  .sb-pic { flex: 0 0 auto; display: flex; gap: 12px; width: 100%; }
  .sb-acts { margin-top: 0; flex-direction: column; }
}

/* ---------------- 拖拽上传区 ---------------- */
.drop-zone {
  border: 2px dashed #ccd2dc; border-radius: var(--radius); padding: 34px 20px;
  text-align: center; cursor: pointer; transition: all .16s; background: #fff;
}
.drop-zone:hover, .drop-zone.over {
  border-color: var(--brand); background: var(--brand-soft);
}
.drop-zone svg { width: 36px; height: 36px; stroke: #b9c6e8; margin-bottom: 12px; }
.drop-zone b { display: block; font-size: 14.5px; margin-bottom: 5px; }
.drop-zone p { margin: 0; font-size: 12.5px; color: var(--text-3); line-height: 1.7; }

/* ---------------- 弹层 ---------------- */
.mask {
  position: fixed; inset: 0; background: rgba(16,20,28,.45); z-index: 100;
  opacity: 0; pointer-events: none; transition: opacity .18s, visibility .18s;
  /* visibility 必须一起切。只靠 opacity:0 藏的话，里面的控件仍然能被键盘 Tab 聚焦 ——
     用户按 Tab 会跳到看不见的按钮上，再按回车就可能误触发。
     visibility 本身也可过渡，所以淡出动画不会被切断。 */
  visibility: hidden;
  backdrop-filter: blur(2px);
}
.mask.on { opacity: 1; pointer-events: auto; visibility: visible; }
.modal {
  position: fixed; z-index: 101; left: 50%; top: 50%;
  transform: translate(-50%, -48%) scale(.97); opacity: 0; pointer-events: none;
  background: #fff; border-radius: 15px; box-shadow: 0 24px 60px rgba(0,0,0,.24);
  width: min(560px, calc(100vw - 32px)); max-height: calc(100vh - 60px);
  display: flex; flex-direction: column; transition: opacity .18s, transform .18s, visibility .18s;
  visibility: hidden;   /* 同 .mask：不让隐藏弹窗里的输入框/按钮被 Tab 聚焦 */
}
.modal.on { opacity: 1; pointer-events: auto; visibility: visible; transform: translate(-50%, -50%) scale(1); }
.modal.wide { width: min(860px, calc(100vw - 32px)); }
.modal-hd {
  padding: 17px 20px; border-bottom: 1px solid var(--line-2);
  display: flex; align-items: center; gap: 12px;
}
.modal-hd h3 { margin: 0; font-size: 15.5px; font-weight: 600; }
.modal-hd .spacer { flex: 1; }
.modal-hd .x {
  border: none; background: none; cursor: pointer; color: var(--text-3);
  padding: 4px; display: flex; border-radius: 6px;
}
.modal-hd .x:hover { background: #f1f3f6; color: var(--text); }
.modal-hd .x svg { width: 17px; height: 17px; }
.modal-bd { padding: 20px; overflow-y: auto; flex: 1; }
.modal-ft {
  padding: 14px 20px; border-top: 1px solid var(--line-2);
  display: flex; gap: 9px; justify-content: flex-end;
}

/* ---------------- 提示 ---------------- */
.toast-wrap {
  position: fixed; left: 50%; bottom: 30px; transform: translateX(-50%);
  z-index: 300; display: flex; flex-direction: column; gap: 8px;
  align-items: center; pointer-events: none;
}
.toast {
  background: #23272e; color: #fff; padding: 10px 18px; border-radius: 9px;
  font-size: 13.5px; box-shadow: 0 8px 24px rgba(0,0,0,.24);
  animation: toastIn .2s ease-out; max-width: 82vw; text-align: center;
}
.toast.ok { background: #12805c; }
.toast.err { background: #c23b40; }
@keyframes toastIn { from { opacity: 0; transform: translateY(9px); } to { opacity: 1; transform: none; } }

/* ---------------- 加载 ---------------- */
.spin {
  width: 16px; height: 16px; border: 2px solid rgba(255,255,255,.35);
  border-top-color: #fff; border-radius: 50%; animation: spin .7s linear infinite;
}
.spin.dark { border-color: #dfe3e9; border-top-color: var(--brand); }
@keyframes spin { to { transform: rotate(360deg); } }
.loading-line {
  display: flex; align-items: center; justify-content: center; gap: 9px;
  padding: 40px; color: var(--text-3); font-size: 13.5px;
}

/* ---------------- 进度 ---------------- */
.prog {
  height: 6px; background: #eef0f3; border-radius: 6px; overflow: hidden; margin-top: 10px;
}
.prog i { display: block; height: 100%; background: var(--brand); transition: width .2s; width: 0; }

/* ---------------- 响应式 ---------------- */
@media (max-width: 860px) {
  .wrap { flex-direction: column; }
  .side {
    width: 100%; flex: none; height: auto; position: static; flex-direction: row;
    align-items: center; padding: 0 10px; overflow-x: auto;
  }
  .side .logo { border: none; padding: 12px 8px; flex: 0 0 auto; }
  .side .logo .tx { display: none; }
  .side nav {
    display: flex; padding: 0; flex: 1; overflow-x: auto; gap: 4px;
  }
  .side nav .sec { display: none; }
  .side nav a { white-space: nowrap; padding: 8px 11px; }
  .side nav a .n { display: none; }
  .side .foot { display: none; }
  .content { padding: 14px 14px 50px; }
  .topbar { padding: 0 14px; height: 52px; }
  .grid2, .grid3 { grid-template-columns: 1fr; }
}

/* ---------------- 业务员 ---------------- */
.sp-list { display: flex; flex-direction: column; gap: 8px; }

.sp-row {
  display: flex; align-items: center; gap: 12px;
  padding: 8px 10px;
  border: 1px solid var(--line); border-radius: 10px;
  background: var(--panel);
}
.sp-row.off { opacity: .55; }

.sp-thumb {
  flex: none; width: 46px; height: 46px;
  border: 1px solid var(--line); border-radius: 8px;
  background: var(--bg);
  display: grid; place-items: center; overflow: hidden;
}
.sp-thumb img { width: 100%; height: 100%; object-fit: contain; }
.sp-thumb i { font-size: 10.5px; font-style: normal; color: var(--text-3); }

.sp-main { flex: 1; min-width: 0; }
.sp-main b { display: block; font-size: 13.5px; font-weight: 600; }
.sp-main > span {
  display: block; margin-top: 2px;
  font-size: 12px; color: var(--text-3);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.sp-acts { flex: none; display: flex; gap: 6px; }

@media (max-width: 860px) {
  .sp-row { flex-wrap: wrap; }
  .sp-acts { width: 100%; justify-content: flex-end; }
}
