/* SPT 贴片工作台 —— 全局样式
   设计基线：浅色、中性灰白、优衣库红作强调色。
   与 demo 保持一致的视觉语言，但用 CSS 变量统一收口，便于后续换肤。 */

:root {
  --bg:            #f6f7f9;
  --surface:       #ffffff;
  --surface-2:     #fbfcfd;
  --border:        #e6e9ee;
  --border-strong: #d3d8e0;

  --text:          #1a1d21;
  --text-2:        #5c6470;
  --text-3:        #8d95a1;

  --accent:        #d0021b;   /* 品牌红 */
  --accent-soft:   #fdecef;
  --accent-hover:  #b00016;

  --ok:            #157f4d;
  --ok-soft:       #e7f6ee;
  --warn:          #a86400;
  --warn-soft:     #fff4e0;
  --warn-border:   #f0c675;
  --info:          #1f5fa9;
  --info-soft:     #eaf2fc;

  --radius:        10px;
  --radius-sm:     7px;
  --shadow-sm:     0 1px 2px rgba(16, 24, 40, .05);
  --shadow-md:     0 4px 16px rgba(16, 24, 40, .08);

  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
          "Hiragino Sans GB", "Microsoft YaHei", "Source Han Sans SC", sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  overflow: hidden;          /* 外壳层永不滚动，滚动收敛到 .content 内部 */
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

button, input, select, textarea { font-family: inherit; font-size: inherit; }

/* 根容器铺满视口：渲染加载态时是居中提示，渲染后由 renderShell 移除 app-boot */
#app { height: 100vh; width: 100%; overflow: hidden; }
#app.app-boot {
  display: flex; align-items: center; justify-content: center;
  padding: 40px; color: var(--text-3);
}

/* ---------------- 布局：中控台外壳 ---------------- */
.app-shell { display: flex; height: 100%; overflow: hidden; }

/* 左侧深色侧栏 */
.sidebar {
  width: 224px; flex: 0 0 224px;
  background: #0F1419; color: #C9CDD4;
  display: flex; flex-direction: column;
  padding: 18px 14px;
}
.sidebar .brand { display: flex; align-items: center; gap: 10px; padding: 6px 8px 18px; }
.sidebar .brand .logo {
  width: 30px; height: 30px; border-radius: 8px;
  background: linear-gradient(135deg, #2F6BFF, #7AA2FF);
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 700; font-size: 15px;
}
.sidebar .brand .name { font-size: 15px; font-weight: 600; color: #fff; line-height: 1.2; }
.sidebar .brand .sub { font-size: 11px; color: #7C8595; letter-spacing: .5px; }

.sidebar .nav { display: flex; flex-direction: column; gap: 3px; margin-top: 6px; }
.sidebar .nav-item {
  display: flex; align-items: center; gap: 11px;
  padding: 9px 11px; border-radius: 8px;
  color: #AEB4BE; font-size: 13.5px; transition: .15s; font-weight: 500;
  text-decoration: none;
}
.sidebar .nav-item:hover { background: rgba(255,255,255,.05); color: #E6E9ED; }
.sidebar .nav-item.on { background: rgba(47,107,255,.16); color: #fff; }
.sidebar .nav-item .ic { width: 18px; height: 18px; flex: 0 0 18px; opacity: .9; }

/* —— 侧栏底部账号区（v0.38，用户 9/19：「登录还有登录之后的头像，都放在这里啊，左边 tab 栏的最下面」）——
   未登录 = 灰「未登录 + 登录」；登录后 = 头像 + 名字 + 角色 + 退出登录。
   `margin-top: auto` 把它推到侧栏底部（侧栏本身是 flex column）。
   ★ 原来这里还有一段 `.side-foot`（v0.36 之前的「操作人脚注」）—— 那是给人手填姓名的输入框，
     早已删掉；现在这块是**当前登录账号**，所以另起类名 `.side-account`，别把两个概念焊在一起。 */
.side-account {
  margin-top: auto; padding-top: 14px;
  display: flex; flex-direction: column; gap: 8px;
  border-top: 1px solid rgba(255,255,255,.07);
}
.side-who {
  display: flex; align-items: center; gap: 9px; padding: 6px;
  border-radius: 8px; color: #C9CDD4; text-decoration: none; min-width: 0;
}
a.side-who:hover { background: rgba(255,255,255,.05); }
.side-who .avatar { width: 28px; height: 28px; font-size: 12.5px; }
.side-who-txt { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.side-who-nm {
  font-size: 13px; font-weight: 600; color: #E6E9ED;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.side-who-role {
  font-size: 10.5px; color: #7C8595;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.side-logout, .side-login {
  height: 32px; display: flex; align-items: center; justify-content: center;
  border-radius: 8px; border: 1px solid rgba(255,255,255,.14);
  background: transparent; color: #C9CDD4;
  font: inherit; font-size: 12.5px; text-decoration: none; cursor: pointer;
}
.side-logout:hover, .side-login:hover {
  background: rgba(255,255,255,.07); color: #fff; border-color: rgba(255,255,255,.26);
}

/* 右侧主区：顶栏 + 内容 */
.main { flex: 1; display: flex; flex-direction: column; overflow: hidden; }
.topbar {
  height: 56px; flex: 0 0 56px;
  background: var(--surface); border-bottom: 1px solid var(--border);
  display: flex; align-items: center;
  gap: 16px; padding: 0 24px;
}
.topbar .crumb { font-size: 14px; color: var(--text-2); }
.topbar .crumb b { color: var(--text); font-weight: 600; }
.topbar .spacer { flex: 1; }
.topbar .hint { color: var(--text-3); font-size: 12.5px; }
/* v0.38（9/19 需求 2+5）：顶栏插槽 —— 模板详情把「模板名 + 状态徽标 + 历史 / 发布 / ← 模板列表」
   并到**最上面这一行**（原来另占一行，且面包屑在详情页里写死成「模板列表」）。
   位置：`.topbar-crumbs` 是 `flex:1`，所以它会占满剩余空间、把插槽顶到右侧
   —— 左侧是「模板管理 › 模板名」，右侧是这些操作，正好是用户要的样子。 */
.topbar-extra { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; }
.topbar-extra .hint { white-space: nowrap; }
.content { flex: 1; overflow: auto; }

/* 页内容容器（视图用） */
.page { max-width: 1240px; margin: 0 auto; padding: 24px 22px 64px; }

/* 宽幅页（贴片编辑器用）：三列布局需要更宽，同时保证文字不贴左 */
.page-wide { max-width: 1680px; padding: 24px 32px 64px; }

/* 画布页（贴片编辑器 / 模板设计器）：贴片是 3.32:1 的横幅，**宽度就是可读性** ——
   用户 9/17：「宽度撑满，让画布可以大一点，看清楚点」。
   宽屏下再放开一档（1680 → 2400），否则画布在中大屏上永远只有一半宽。 */
.page-wide.page-canvas { max-width: 2400px; }

/* 品名管理 · 官网链接 icon（v0.4） */
.web-link {
  display: inline-flex; align-items: center; justify-content: center;
  width: 28px; height: 28px; border-radius: 6px;
  color: var(--text-2);
  transition: .12s;
}
.web-link:hover { background: var(--accent-soft); color: var(--accent); }

/* 满幅页（滚动收敛到内容块，header/pager 固定）：品名管理等列表页用
   .content 不滚，.page 撑满，内部 #body(表格) 单独滚 */
.page-fill {
  height: 100%; display: flex; flex-direction: column;
  overflow: hidden; padding-bottom: 20px;
}
.page-fill > .page-head { flex: 0 0 auto; }
.page-fill > .panel { flex: 0 0 auto; }
.page-fill > #body { flex: 1 1 auto; min-height: 0; overflow: auto; }
.page-fill > #pager { flex: 0 0 auto; }
.page-fill #body .table-wrap { height: 100%; overflow: auto; }
/* v0.26：page-fill 内的通用滚动区——头部常驻，只有它滚（素材详情页 / 贴片编辑器用） */
.page-fill > .page-scroll { flex: 1 1 auto; min-height: 0; overflow: auto; }
/* 统计卡行是固定内容，别被 flex 压扁 */
.page-fill > .stat-row { flex: 0 0 auto; }
/* 贴片编辑器：顶部 page-head 固定，警告条 + 编辑区整体进滚动区 */
.page-fill > .ed-scroll { flex: 1 1 auto; min-height: 0; overflow: auto; }

/* ★ v0.3：场次详情 page-fill：警告窗/工具栏在顶部固定，单品列表单独 box 占满剩余空间（页面整体不滚） */
.session-detail-page > .alert { flex: 0 0 auto; margin-bottom: 14px; }
.session-detail-page > .list-toolbar { flex: 0 0 auto; margin-bottom: 12px; }
.session-detail-page > .table-wrap { flex: 1 1 auto; min-height: 0; overflow: auto; }

.page-head {
  display: flex; align-items: flex-end; gap: 16px;
  margin-bottom: 20px; flex-wrap: wrap;
}
.page-head h1 { font-size: 21px; margin: 0; font-weight: 650; letter-spacing: .2px; }

/* 顶栏面包屑 */
.topbar-crumbs { flex: 1 1 auto; min-width: 0; }
.breadcrumb { display: flex; align-items: center; gap: 6px; font-size: 14px; }
.crumb-item { color: var(--text-2); text-decoration: none; padding: 3px 6px; border-radius: 5px; }
.crumb-item:hover { color: var(--accent); background: var(--surface-2); }
.crumb-item.on { color: var(--text); font-weight: 600; cursor: default; background: transparent; }
.crumb-sep { color: var(--text-3); font-size: 12px; }
.page-head .sub { color: var(--text-2); font-size: 13px; }

/* ---------------- 通用组件 ---------------- */
.btn {
  display: inline-flex; align-items: center; gap: 7px;
  height: 34px; padding: 0 14px;
  border: 1px solid var(--border-strong);
  background: var(--surface); color: var(--text);
  border-radius: var(--radius-sm);
  cursor: pointer; font-weight: 500;
  transition: background .14s, border-color .14s, opacity .14s;
  white-space: nowrap;
}
/* v0.20：hover 必须排除 disabled，否则禁用按钮仍会跟着变底色，看不出被禁用 */
.btn:hover:not(:disabled) { background: var(--surface-2); border-color: var(--text-3); }
.btn:disabled { opacity: .5; cursor: not-allowed; background: var(--surface-2); border-color: var(--border); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary:hover:not(:disabled) { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn-ghost { border-color: transparent; background: transparent; color: var(--text-2); }
.btn-ghost:hover:not(:disabled) { background: rgba(0,0,0,.04); border-color: transparent; }
.btn-sm { height: 28px; padding: 0 10px; font-size: 13px; }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

.panel { padding: 18px; }

.field { margin-bottom: 14px; }
.field > label {
  display: block; font-size: 12.5px; color: var(--text-2);
  margin-bottom: 6px; font-weight: 500;
}
.input, select.input {
  width: 100%; height: 36px; padding: 0 11px;
  border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--text); outline: none;
}
.input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }

.hint { font-size: 12.5px; color: var(--text-3); line-height: 1.6; }
.code { font-family: var(--mono); font-size: 12px; background: #f1f3f6; padding: 1px 5px; border-radius: 4px; }

.badge {
  display: inline-flex; align-items: center; gap: 5px;
  height: 22px; padding: 0 9px; border-radius: 11px;
  font-size: 12px; font-weight: 500; white-space: nowrap;
  background: #f1f3f6; color: var(--text-2);
}
.badge-ok   { background: var(--ok-soft);   color: var(--ok); }
.badge-warn { background: var(--warn-soft); color: var(--warn); }
.badge-info { background: var(--info-soft); color: var(--info); }
.badge-accent { background: var(--accent-soft); color: var(--accent); }

/* 素材列表「特点」列：不足 3 张标黄（v0.10） */
.num-warn { color: var(--warn); font-weight: 700; }
.num-warn + .tag { margin-left: 4px; }

/* ---------------- 警示条 ---------------- */
.alert {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 11px 14px 11px 14px; border-radius: var(--radius-sm);
  border: 1px solid transparent; font-size: 13px; margin-bottom: 16px;
  position: relative;
}
.alert-warn { background: var(--warn-soft); border-color: var(--warn-border); color: #6d4200; }
.alert-warn b { color: #6d4200; }
.alert .ico { flex: none; margin-top: 1px; }
.alert-close {
  position: absolute; top: 8px; right: 8px;
  width: 22px; height: 22px; display: inline-flex; align-items: center; justify-content: center;
  border: none; background: transparent; border-radius: 50%; cursor: pointer;
  color: inherit; opacity: .6;
}
.alert-close:hover { opacity: 1; background: rgba(0,0,0,.05); }
.alert > div { flex: 1; padding-right: 28px; }   /* 给关闭按钮留位 */

/* ★ v0.3：标题右侧感叹号按钮（警告窗关闭时显示，点击重新打开） */
.warn-toggle {
  display: inline-flex; align-items: center; justify-content: center;
  width: 26px; height: 26px; margin-left: 8px;
  border: 1px solid var(--warn-border); background: var(--warn-soft);
  color: #6d4200; border-radius: 50%; cursor: pointer;
  font-size: 14px; vertical-align: middle; padding: 0;
}
.warn-toggle:hover { background: var(--warn-border); }

/* ---------------- 场次卡片 ---------------- */
.session-grid {
  display: grid; gap: 14px;
  grid-template-columns: repeat(auto-fill, minmax(288px, 1fr));
}
.session-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 16px 16px 14px;
  cursor: pointer; transition: box-shadow .16s, border-color .16s, transform .16s;
  display: flex; flex-direction: column; gap: 10px; min-height: 132px;
}
.session-card:hover { box-shadow: var(--shadow-md); border-color: var(--border-strong); transform: translateY(-1px); }
.session-card .title { font-size: 15px; font-weight: 600; line-height: 1.4; }
.session-card .meta { color: var(--text-2); font-size: 12.5px; display: flex; gap: 12px; flex-wrap: wrap; }
.session-card .foot { margin-top: auto; display: flex; align-items: center; justify-content: space-between; }
.session-card .count { font-size: 12.5px; color: var(--text-3); }
/* v0.32：卡片上标「这一场用哪个版式」—— 用户 9/18「列表里也没看到」 */
.session-card .tpl-tag {
  display: inline-flex; align-items: center; gap: 5px;
  max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  height: 20px; padding: 0 8px; border-radius: 10px;
  background: var(--surface-2); border: 1px solid var(--border);
  color: var(--text-2); font-size: 12px;
}

/* ---------------- 版式模板下拉（场次详情标题栏，v0.32） ----------------
   ★ 必须覆盖 .input 的 width:100% / height:36px —— 不覆盖的话它会在
     flex 行里抢满宽度，把「← 场次列表 / 导入选品 Excel / 编辑贴片」挤到下一行。 */
.tpl-pick { display: inline-flex; align-items: center; gap: 8px; flex: 0 0 auto; }
.tpl-pick .tpl-pick-lb { color: var(--text-2); font-size: 12.5px; white-space: nowrap; }
.tpl-pick .tpl-pick-sel {
  width: auto; min-width: 132px; max-width: 220px;
  height: 34px; padding: 0 8px; font-size: 13px;
}
.tpl-pick .hint { white-space: nowrap; }

/* ---------------- 单品模板下拉（贴片编辑工具栏，v0.34 需求 8） ----------------
   ★ 同一类坑：.input 是 width:100%/height:36px，用在 flex 行里必须自己给宽度，
     否则它会抢满整行，把右边的「应用到素材库模板」挤下去。 */
.item-tpl { display: inline-flex; align-items: center; gap: 6px; flex: 0 0 auto; }
.item-tpl .item-tpl-lb { color: var(--text-2); font-size: 12.5px; white-space: nowrap; }
.item-tpl .item-tpl-sel {
  width: auto; min-width: 120px; max-width: 190px;
  height: 30px; padding: 0 6px; font-size: 12.5px;
}
/* 「单独指定」标记：一眼看出这一款没跟场次走（列表列上也是同一个语义） */
.item-tpl .item-tpl-tag {
  padding: 0 6px; height: 19px; line-height: 19px; border-radius: 9px;
  background: rgba(63,74,138,.10); border: 1px solid rgba(63,74,138,.35);
  color: #3F4A8A; font-size: 11px; white-space: nowrap;
}

/* v0.35 需求 8：已导出场次 = 版式冻结快照，换模板不会立刻改画面 —— 必须说清楚，
   否则用户只会以为「切了没生效 / 色卡间距还是错的」 */
.item-tpl .item-tpl-frozen {
  padding: 0 6px; height: 19px; line-height: 19px; border-radius: 9px;
  background: rgba(214,158,46,.14); border: 1px solid rgba(214,158,46,.45);
  color: #8A5A00; font-size: 11px; white-space: nowrap; cursor: help;
}

/* 场次详情列表的「当前模板」列（v0.34 需求 7） */
.cell-tpl { display: flex; align-items: center; gap: 6px; min-width: 0; }
.cell-tpl .tpl-name {
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font-size: 13px; color: var(--text);
}
.cell-tpl .tpl-tag-mini {
  flex: 0 0 auto; padding: 0 5px; height: 18px; line-height: 18px; border-radius: 9px;
  background: rgba(63,74,138,.10); border: 1px solid rgba(63,74,138,.35);
  color: #3F4A8A; font-size: 10.5px; white-space: nowrap;
}
/* 卡片上的「N 款单独指定」（v0.34 需求 8） */
.session-card .tpl-tag .tpl-tag-more {
  flex: 0 0 auto; padding: 0 5px; border-radius: 8px;
  background: rgba(63,74,138,.12); color: #3F4A8A; font-size: 10.5px;
}

/* ---------------- v0.37 场次状态 + 日历视图 ---------------- */
/* 卡片状态行：开播状态（按日期自动算）+ 设计完成（人工标记，可点） */
.session-card .state-row { align-items: center; gap: 8px; }
/* 「设计完成」是可点徽标 —— 浏览器默认 button 样式会把它撑成大方块，逐项压回去。
   ★ 只加 `.badge-btn` 自己的边框，不覆盖 .badge 的配色（已完成=绿、未完成=灰）。 */
.badge-btn {
  cursor: pointer; font-family: inherit; font-size: 12px; font-weight: 500;
  border: 1px solid transparent; border-radius: 11px;
}
.badge-btn:hover { border-color: var(--border-strong); }
.badge-btn:disabled { opacity: .55; cursor: default; }

.cal { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 14px 14px; }
.cal-bar { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.cal-title { font-size: 15px; font-weight: 600; min-width: 104px; text-align: center; }
.cal-legend { margin-left: auto; display: flex; align-items: center; gap: 6px; color: var(--text-3); font-size: 12px; }
.cal-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; margin-left: 8px; }
.cal-dot.live { background: var(--accent); }
.cal-dot.done { background: var(--ok); }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.cal-wd { text-align: center; color: var(--text-3); font-size: 12px; padding-bottom: 4px; }
.cal-cell {
  min-height: 84px; border: 1px solid var(--border); border-radius: 8px;
  background: var(--surface-2); padding: 6px; display: flex; flex-direction: column; gap: 4px;
}
/* 今天：红框 + 浅红底（与「开播中」徽标同一套语义色） */
.cal-cell.today { border-color: var(--accent); background: var(--accent-soft); }
.cal-hd { display: flex; align-items: center; justify-content: space-between; }
.cal-num { font-size: 13px; font-weight: 600; color: var(--text-2); }
.cal-cell.today .cal-num { color: var(--accent); }
.cal-count { font-size: 11px; color: var(--text-3); }
.cal-items { display: flex; flex-direction: column; gap: 3px; }
.cal-item {
  display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font-size: 12px; line-height: 18px; padding: 0 6px; border-radius: 5px;
  background: var(--surface); border: 1px solid var(--border);
  color: var(--text); text-decoration: none;
}
.cal-item:hover { border-color: var(--border-strong); }
.cal-item.live { border-color: var(--accent); color: var(--accent); }
.cal-item.done { background: var(--ok-soft); border-color: rgba(21,127,77,.35); color: var(--ok); }

/* ---------------- KV 上的系列 logo（v0.34 需求 3） ---------------- */
.logo-slots { display: flex; gap: 10px; flex-wrap: wrap; }
.logo-slot {
  position: relative; width: 104px; height: 72px; border-radius: 8px;
  border: 1.5px dashed var(--border-strong); background: var(--surface-2);
  display: flex; align-items: center; justify-content: center; cursor: pointer;
  overflow: hidden;
}
.logo-slot.filled { border-style: solid; border-color: var(--border); background: #fff; cursor: default; }
.logo-slot img { max-width: 92px; max-height: 60px; object-fit: contain; }
.logo-slot .slot-ph { font-size: 11px; color: var(--text-3); }
.logo-slot .ord {
  position: absolute; left: 4px; top: 3px; font-size: 10.5px; color: var(--text-3);
}
.logo-slot .x {
  position: absolute; right: 3px; top: 2px; width: 18px; height: 18px; line-height: 17px;
  text-align: center; border-radius: 50%; background: rgba(0,0,0,.06);
  color: var(--text-2); font-size: 13px; cursor: pointer;
}
.logo-slot .x:hover { background: rgba(220,60,60,.14); color: #c0392b; }
.logo-count-row { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
/* 槽位 = 缩略图 + 下方选图下拉（一列一组，别把 select 塞进 104×72 的框里，会被 overflow:hidden 吃掉） */
.logo-slot-col { width: 104px; display: flex; flex-direction: column; gap: 6px; }
.logo-slot-col select { width: 104px; height: 28px; font-size: 11px; padding: 0 4px; }
.cell-tpl .tpl-follow { color: var(--text-3); font-size: 12px; }
/* 场次详情整体放宽（v0.34 需求 7，用户 9/18：「整体宽度宽一点」）
   ★ 改的是**页容器**的 max-width，不是表格 width —— 表格本来就是 width:100%，
     真正卡住它的是 `.page { max-width: 1240px }`。只盯表格等于白改（铁律：先找约束在哪一层）。 */
.session-detail-page { max-width: 1720px; }

.empty {
  border: 1.5px dashed var(--border-strong); border-radius: var(--radius);
  padding: 46px 20px; text-align: center; color: var(--text-3); background: var(--surface-2);
}
.empty .big { font-size: 15px; color: var(--text-2); margin-bottom: 6px; }

/* ---------------- 表格 ---------------- */
.table-wrap { overflow: auto; border-radius: var(--radius); border: 1px solid var(--border); background: var(--surface); }
table.data { width: 100%; border-collapse: collapse; font-size: 13px; }
table.data th, table.data td { padding: 9px 12px; text-align: left; border-bottom: 1px solid var(--border); vertical-align: middle; }
table.data th {
  background: var(--surface-2); color: var(--text-2); font-weight: 600; font-size: 12.5px;
  position: sticky; top: 0; z-index: 1; white-space: nowrap;
}
table.data tbody tr:hover { background: #fafbfc; }
table.data tbody tr:last-child td { border-bottom: none; }
table.data td.num { text-align: right; font-variant-numeric: tabular-nums; }
table.data .seq {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 34px; height: 24px; padding: 0 7px; border-radius: 12px;
  background: #eef1f5; color: var(--text-2); font-weight: 600; font-size: 12.5px;
  font-variant-numeric: tabular-nums;
}

/* 序号图标底色：官网查不到(8.20 结论) / 特点图缺省(v0.12) 时变黄示警。
   ★ 用 table.data .seq.seq-warn 提升特异度：否则会被上方 table.data .seq(背景/文字) 覆盖，
     只剩 box-shadow 描边，黄底黄字失效（如 486629/485318/486175）。 */
table.data .seq.seq-warn {
  background: var(--warn-soft); color: var(--warn); box-shadow: inset 0 0 0 1px var(--warn-border);
}

/* ---------------- 列表工具条（品号搜索） ---------------- */
.list-toolbar {
  display: flex; align-items: center; gap: 14px;
  margin-bottom: 12px;
}
.search-box {
  position: relative; display: flex; align-items: center;
  width: 300px; max-width: 100%;
  border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  background: var(--surface); overflow: hidden;
  transition: border-color .15s, box-shadow .15s;
}
.search-box:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.search-box .ic {
  position: absolute; left: 10px; width: 15px; height: 15px;
  color: var(--text-3); pointer-events: none;
}
.search-box .input {
  flex: 1; border: none; background: transparent; outline: none;
  height: 34px; padding: 0 38px 0 32px; font-size: 13px; color: var(--text);
}
.search-box .btn { margin: 3px 4px 3px 0; height: 26px; padding: 0 8px; }
/* 搜索框内置 X 按钮（清空文本，不立即执行搜索） */
.search-clear {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  width: 22px; height: 22px; display: none; align-items: center; justify-content: center;
  border: none; background: transparent; border-radius: 50%; cursor: pointer;
  color: var(--text-3); padding: 0;
}
.search-clear:hover { background: var(--surface-2); color: var(--text); }
.search-clear svg { width: 12px; height: 12px; }
.search-box.has-text .search-clear { display: inline-flex; }
.search-hint { font-size: 12.5px; color: var(--text-3); }

/* 表头排序按钮（问题3） */
.th-sort {
  background: none; border: 0; padding: 0; margin: 0;
  font: inherit; color: inherit; cursor: pointer;
  display: inline-flex; align-items: center; gap: 4px;
}
.th-sort:hover { color: var(--accent); }
.th-sort.active { color: var(--accent); }
.th-sort .sort-arrow {
  font-size: 10px; min-width: 10px;
  display: inline-block; line-height: 1;
}
#itemTable thead th { user-select: none; }

/* 搜索结果命中行高亮 */
#itemBody tr.hit { background: #fff9e6; box-shadow: inset 0 2px 0 var(--accent); }
#itemBody tr.row-warn .seq { background: var(--warn-soft); color: var(--warn); }

/* ---------------- 系列列：品牌 logo 占位 ---------------- */
.series-logo {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 64px; height: 26px; padding: 0 10px;
  border: 1px dashed var(--border-strong); border-radius: 6px;
  color: var(--text-3); font-size: 11px; letter-spacing: .5px;
  background: var(--surface-2);
}

/* ---------------- 特殊标记列（多标签） ---------------- */
.mark-cell { display: inline-flex; flex-wrap: wrap; gap: 4px; }
.mark-cell .badge { white-space: nowrap; }

/* ---------------- 场次详情：复选框 + 批量上传下载 ---------------- */
/* 勾选状态行底色 */
#itemBody tr:has(input.sel:checked) { background: #f2f7ff; }
#itemBody tr:has(input.sel:checked) .seq { background: var(--info-soft); color: var(--info); }
/* ★ 必须限定 input：.sel 是通用状态类，.kv-pick-item / .shot-item 也用「.sel=当前选中」。
   裸 .sel{15px} 会把那两个网格卡片压成 15×15（v0.19 KV 选图变小的真凶）。 */
input.sel { width: 15px; height: 15px; accent-color: var(--accent); cursor: pointer; }

.batch-bar {
  display: flex; align-items: center; gap: 16px;
  padding: 10px 14px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
/* ★ v0.3：场次详情批量条右侧固定浮动，滚动时一直在视野内 */
.batch-floating {
  position: fixed; right: 24px; top: 50%; transform: translateY(-50%);
  flex-direction: column; align-items: stretch; min-width: 168px;
  z-index: 40;
  box-shadow: var(--shadow-md, 0 6px 20px rgba(16,24,40,.12));
}
.batch-floating .batch-actions { flex-direction: column; }
.batch-floating .batch-actions .btn { width: 100%; justify-content: center; }
.batch-info { font-size: 13px; color: var(--text-2); }
.batch-info b { color: var(--accent); font-weight: 650; }
.batch-actions { display: flex; align-items: center; gap: 8px; }
.batch-actions .btn { display: inline-flex; align-items: center; gap: 5px; }
/* v0.3：删 .batch-help / .batch-help-item / .batch-tip（用户要求去掉介绍浮窗） */

/* ---------------- 缩略图悬浮放大浮窗 ---------------- */
.stk-pop {
  position: fixed; z-index: 500; display: none;
  width: 560px; max-width: 92vw; padding: 8px 10px 10px;
  background: #fff; border: 1px solid var(--border-strong); border-radius: var(--radius);
  box-shadow: 0 12px 40px rgba(16,24,40,.22);
}
.stk-pop.show { display: block; }
.stk-pop-title {
  font-size: 12px; color: var(--text-2); margin-bottom: 6px; font-weight: 600;
}
.stk-pop svg { width: 100%; height: auto; display: block; }
.stk-pop-empty { padding: 20px; text-align: center; color: var(--text-3); }

/* ---------------- 品名管理列表 ---------------- */
.item-name-table tr.has-history { cursor: pointer; }
.item-name-table .tbody-toggle { text-align: center; }
.item-name-table .row-toggle {
  width: 22px; height: 22px; border: none; background: transparent;
  color: var(--text-3); font-size: 13px; cursor: pointer; border-radius: 4px;
  transition: background .14s, color .14s;
}
.item-name-table .row-toggle:hover { background: rgba(0,0,0,.05); color: var(--text); }
.item-name-table .row-toggle.open { color: var(--accent); }
.item-name-table .global-name { color: var(--text-2); }
.item-name-table .local-name { font-weight: 500; }
.item-name-table .history-row td.history-cell {
  background: var(--surface-2); border-bottom: 1px solid var(--border);
  padding: 8px 12px 12px;
}
.hist-wrap { padding: 4px 6px; }
.hist-title { font-size: 12px; color: var(--text-3); font-weight: 600; margin-bottom: 8px; }
.hist-table { font-size: 12.5px; }
.hist-table th, .hist-table td { padding: 6px 10px; }
.hist-table thead th { background: #f1f3f6; }
.hist-table tr:last-child td { border-bottom: none; }

/* ---------------- 抽屉 ---------------- */
.overlay {
  position: fixed; inset: 0; background: rgba(16, 24, 40, .38);
  opacity: 0; pointer-events: none; transition: opacity .18s; z-index: 40;
}
.overlay.show { opacity: 1; pointer-events: auto; }
.drawer {
  position: fixed; top: 0; right: 0; height: 100%; width: min(560px, 96vw);
  background: var(--surface); box-shadow: var(--shadow-md);
  transform: translateX(100%); transition: transform .22s cubic-bezier(.3,.8,.4,1);
  z-index: 50; display: flex; flex-direction: column;
}
.drawer.show { transform: none; }
.drawer-head { padding: 18px 20px 14px; border-bottom: 1px solid var(--border); display: flex; align-items: flex-start; gap: 12px; }
.drawer-head .t { font-size: 16px; font-weight: 620; }
.drawer-head .s { font-size: 12.5px; color: var(--text-3); margin-top: 3px; }
.drawer-body { padding: 18px 20px; overflow: auto; flex: 1; }
.drawer-foot { padding: 14px 20px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 10px; }
.x-btn { margin-left: auto; border: none; background: transparent; font-size: 22px; line-height: 1; color: var(--text-3); cursor: pointer; padding: 0 4px; }
.x-btn:hover { color: var(--text); }

.dropzone {
  border: 1.5px dashed var(--border-strong); border-radius: var(--radius);
  padding: 26px; text-align: center; color: var(--text-3); cursor: pointer; transition: .15s;
}
.dropzone:hover, .dropzone.over { border-color: var(--accent); background: var(--accent-soft); }

.kv { display: grid; grid-template-columns: auto 1fr; gap: 7px 14px; font-size: 13px; }
.kv .k { color: var(--text-3); }
.kv .v { color: var(--text); font-weight: 500; }

/* ---------------- Toast ---------------- */
.toast-host { position: fixed; left: 50%; bottom: 34px; transform: translateX(-50%); z-index: 90; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.toast {
  background: #1a1d21; color: #fff; padding: 9px 16px; border-radius: 20px;
  font-size: 13px; box-shadow: var(--shadow-md); animation: toast-in .2s ease;
  max-width: 80vw;
}
.toast.err { background: var(--accent); }
.toast.ok  { background: #157f4d; }
.toast.warn { background: #a8620a; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ---------------- 编辑器布局 ----------------
 * ⚠️ editor.css 后加载，会覆盖下面的部分样式。这里只放"不管 editor.css
 * 是否生效都安全"的边距/间距兜底；具体外观优先看 editor.css。
 */
.editor {
  display: grid;
  /* ★ 这里这份是「兜底」，实际生效的是 editor.css 里的同名规则（它后加载）。
     **列数只在 editor.css 里维护**（两列：清单 + .edit-main），改这里没用、只会误导。 */
  grid-template-columns: 264px 1fr;
  gap: 18px;
  align-items: start;
  /* 与 .page 顶部留点呼吸距离，避免贴住 page-head 下沿 */
  margin-top: 4px;
}
.prod-list {
  max-height: 620px; overflow: auto;
  border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface);
  /* 兜底：万一 editor.css 没生效，也保证列表有内边距 */
  padding: 4px;
}
.prod-list .pi {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px;
  border-radius: 6px;
  border-bottom: 1px solid var(--border); cursor: pointer;
  transition: background .12s;
}
.prod-list .pi:last-child { border-bottom: none; }
.prod-list .pi:hover { background: var(--surface-2); }
.prod-list .pi.active { background: var(--accent-soft); box-shadow: inset 3px 0 0 var(--accent); }
.prod-list .pi .seq {
  width: 26px; height: 26px; border-radius: 50%; background: var(--text); color: #fff;
  display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 600; flex: 0 0 26px;
}
.prod-list .pi.warn .seq { background: #F59E0B; box-shadow: 0 0 0 2px #FDE68A; }
.prod-list .pi .nm { font-size: 13px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* 中间列：工具条 / 预览 / 控件（上下堆叠）——三块之间留出呼吸 */
.edit-main {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
  /* 兜底：万一 .edit-main 里嵌了未带 padding 的卡片，左右也不贴边 */
  padding: 2px;
}
.ed-head { align-items: center; }
/* 标题行：贴片编辑 + 「有提示被关闭」的感叹号（v0.27 需求8） */
.ed-title { display: flex; align-items: center; }

/* ==================== v0.27 需求9：画面固定，只有控件区滚动 ====================
   改前：.ed-scroll 是 overflow:auto 的**整体**滚动容器 —— 往下翻控件时贴片画面被滚出视野，
         改描述 / 选图时看不到画面变化（需求原文：「画面固定，改成只有红框范围内滚动」）。
   改后：.ed-scroll 自己**不再整体滚动**（变成竖 flex 容器）；.sticker-stage flex:0 0 auto 钉住；
         .edit-side flex:1 + overflow:auto 独立滚；左栏清单同样在栏内滚。
   注意：editor.css 给 .prod-list / .edit-side 写了 position:sticky + max-height:calc(100vh-190px)，
         那是为「整页滚动」设计的，在 flex 内滚的布局下必须撤掉，否则会顶出容器。 */
.page-fill > .ed-scroll { display: flex; flex-direction: column; overflow: hidden; }
.ed-scroll > #warnZone { flex: 0 0 auto; max-height: 26vh; overflow-y: auto; }
/* 警告条紧凑化（只作用于编辑器警告区，不动场次详情页的 .alert）：
   原 padding 11/16 + 两行文字，3 条就吃掉 240px —— 画面固定之后这些高度全是控件区的。 */
.ed-scroll > #warnZone .alert { padding: 8px 12px; margin-bottom: 10px; }
.ed-scroll > #warnZone .alert:last-child { margin-bottom: 0; }
.ed-scroll > #warnZone .alert > div { font-size: 12.5px; line-height: 1.5; }

.ed-scroll > .editor {
  flex: 1 1 auto; min-height: 0;
  align-items: stretch;      /* 覆盖 editor.css 的 align-items:start：两列等高才能各自内滚 */
}
.ed-scroll .prod-list {
  position: static; top: auto; max-height: none; min-height: 0; overflow: auto;
}
.ed-scroll .edit-main { min-height: 0; overflow: hidden; }
.ed-scroll .edit-toolbar { flex: 0 0 auto; }
.ed-scroll .sticker-stage { flex: 0 0 auto; }
.ed-scroll .edit-side {
  position: static; top: auto; max-height: none;
  min-height: 0; flex: 1 1 auto; overflow: auto;
}

/* 右侧控件区（总览 / 分区编辑共用容器） */
.edit-side {
  display: flex;
  flex-direction: column;
  gap: 12px;
  /* 兜底 padding：editor.css 已经给了 14px 水平，留 4px 上 / 12px 下保兜底；
     万一 editor.css 没加载，控件块也不会贴到容器边缘 */
  padding: 4px 14px 12px;
}
.edit-side .zone-detail { margin-top: 0; }

/* 工具条 + 模式切换：左右再多一点呼吸，避免 mode-hint 贴左边 */
.edit-toolbar {
  display: flex; justify-content: space-between; align-items: center; gap: 14px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 10px 16px;
}
.seg { display: inline-flex; background: var(--surface-2); border-radius: 8px; padding: 3px; gap: 2px; }
.seg-btn {
  background: transparent; border: none; padding: 7px 14px; border-radius: 6px;
  font-size: 13px; color: var(--text-2); cursor: pointer; font-weight: 500;
}
.seg-btn.on { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); font-weight: 600; }
/* v0.25：分区面板里的小号模式切换（塞在 .field 里，比工具栏那颗小一号） */
.seg.sm .seg-btn { padding: 5px 12px; font-size: 12.5px; }
.seg-btn:hover:not(.on) { color: var(--text); }
.toolbar-right { display: flex; align-items: center; gap: 12px; }
.mode-hint { font-size: 12px; color: var(--text-3); padding: 0 4px; }
.stage-bar { display: flex; align-items: center; gap: 10px; padding: 0 4px; }

/* 贴片预览 —— SVG 内嵌，透明底棋盘格 */
.sticker-stage {
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: 16px;
  display: flex; flex-direction: column; align-items: stretch; gap: 12px; background: var(--surface);
}
.sticker-host { width: 100%; display: block; }
.sticker-host svg {
  width: 100%; height: auto; display: block; border-radius: 6px; box-shadow: var(--shadow-sm);
  background-image: linear-gradient(45deg,#e6e8eb 25%,transparent 25%),linear-gradient(-45deg,#e6e8eb 25%,transparent 25%),linear-gradient(45deg,transparent 75%,#e6e8eb 75%),linear-gradient(-45deg,transparent 75%,#e6e8eb 75%);
  background-size: 20px 20px; background-position: 0 0,0 10px,10px -10px,-10px 0;
}
.frame { font-family: "PingFang SC","Microsoft YaHei","Hiragino Sans GB","Noto Sans CJK SC",system-ui,sans-serif; }
.stage-note { font-size: 12px; color: var(--text-3); text-align: center; padding: 0 6px; }

/* 控件（总览模式）：上下左右都给 padding，避免输入框贴 ctrl 边缘 */
.ctrl {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 14px 16px;
}
.ctrl + .ctrl { /* 兜底：万一父容器 gap 失效，ctrl 之间也至少有 10px */ }
.ctrl .lab {
  font-size: 12.5px; color: var(--text-3); font-weight: 600;
  margin-bottom: 10px;
  display: flex; justify-content: space-between; align-items: center;
  gap: 10px;
}
.ctrl .lab-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.ctrl .dim { color: var(--text-3); font-weight: 400; }
/* ctrl 内输入框：左右再撑 1px，避免边框贴住 ctrl 内边距边缘（视觉柔和一点） */
.ctrl input[type=text], .ctrl input[type=number], .ctrl select, .ctrl textarea {
  width: 100%; padding: 8px 10px;
  border: 1px solid var(--border-strong); border-radius: 7px;
  background: var(--surface-2); outline: none; font-family: inherit;
}
/* 多输入框纵向排列时（如三个 cap）：上下间距 */
.ctrl input[type=text] + input[type=text],
.ctrl input[type=text] + input[type=number],
.ctrl input[type=number] + input[type=text] {
  margin-top: 8px;
}
.ctrl input:focus, .ctrl select:focus, .ctrl textarea:focus {
  border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); background: var(--surface);
}
.ctrl textarea { resize: vertical; min-height: 54px; }
/* hint 与上方元素拉开一点，避免紧贴 */
.ctrl .hint { margin-top: 8px; }
.ctrl .lab + input,
.ctrl .lab + textarea,
.ctrl .lab + .swatch-row,
.ctrl .lab + .swatch-ops { margin-top: 0; }
.note-block { background: #F8FAFC; border-color: var(--border); color: var(--text-2); font-size: 12.5px; }

/* 开关 */
.switch { position: relative; display: inline-block; width: 40px; height: 22px; flex: 0 0 40px; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch .slider {
  position: absolute; cursor: pointer; inset: 0; background: #d3d8e0; border-radius: 22px; transition: .2s;
}
.switch .slider::before {
  content: ""; position: absolute; height: 16px; width: 16px; left: 3px; top: 3px;
  background: #fff; border-radius: 50%; transition: .2s; box-shadow: 0 1px 2px rgba(0,0,0,.2);
}
.switch input:checked + .slider { background: var(--accent); }
.switch input:checked + .slider::before { transform: translateX(18px); }

/* 色卡 */
.swatch-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.swatch {
  width: 34px; height: 34px; border-radius: 7px; border: 1px solid rgba(0,0,0,.1);
  position: relative; display: flex; align-items: center; justify-content: center; cursor: pointer;
}
.swatch.pattern { background-image: repeating-linear-gradient(45deg,#d9d9d9 0 5px,#fff 5px 10px); }
.swatch .x {
  position: absolute; top: -6px; right: -6px; width: 16px; height: 16px; border-radius: 50%;
  background: var(--accent); color: #fff; font-size: 10px; display: none; align-items: center; justify-content: center;
}
.swatch:hover .x { display: flex; }
.swatch-ops { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }

/* 分区编辑详情区 */
.zone-bar {
  display: flex; justify-content: space-between; align-items: center;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 10px 14px;
}
.zone-bar .zone-title { display: flex; flex-direction: column; gap: 2px; }
.zone-bar .zone-name { font-size: 15px; font-weight: 600; color: var(--text); }
.zone-bar .zone-hint { font-size: 12px; color: var(--text-3); }
.zone-nav { display: flex; gap: 8px; }
.zone-detail {
  display: grid; grid-template-columns: 1fr 1fr; gap: 14px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; min-height: 280px;
}
.zone-left {
  background: var(--surface-2); border: 1px solid var(--border); border-radius: 8px; padding: 18px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; text-align: center;
}
.zone-right { background: var(--surface-2); border: 1px solid var(--border); border-radius: 8px; padding: 18px; display: flex; flex-direction: column; gap: 14px; }
/* v0.52h：分区编辑右栏的文本输入框撑满栏宽 —— 默认 ~180px 太窄（品名框用户点名要加长） */
.zone-right .field input[type=text] { width: 100%; }
.zone-empty { color: var(--text-3); text-align: center; }
.zone-empty > div:first-child { margin-bottom: 8px; }
.zv-big { font-size: 96px; font-weight: 800; color: #E5484D; line-height: 1; }
.zv-cap { font-size: 12px; color: var(--text-3); }
.zv-img {
  background: linear-gradient(150deg,#E9EDF2,#CFD6DF); border: 1px solid var(--border); border-radius: 8px;
  width: 100%; max-width: 480px; display: flex; align-items: center; justify-content: center; color: var(--text-3);
  overflow: hidden;
}
.zv-img img { max-width: 100%; max-height: 100%; object-fit: contain; }
.zv-colors { display: flex; flex-direction: column; gap: 8px; }
.zv-color {
  width: 80px; height: 60px; border-radius: 8px; border: 1px solid rgba(0,0,0,.1);
  position: relative; display: flex; align-items: flex-end; justify-content: flex-end; padding: 4px;
}
.zv-color .ci { background: rgba(0,0,0,.4); color: #fff; font-size: 11px; padding: 1px 6px; border-radius: 3px; }
.zw-color { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.zw-color .swatch { flex: 0 0 34px; }
.zw-color-list { max-height: 260px; overflow: auto; }
.zw-color-info { flex: 1; display: flex; align-items: center; gap: 8px; min-width: 0; }
.zw-color-name {
  flex: 1; font-size: 13px; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  padding: 6px 8px; background: var(--surface-2); border-radius: 6px;
}
.zw-color-tag {
  flex: 0 0 auto; font-size: 11px; color: var(--text-3); padding: 2px 7px; border-radius: 4px;
  background: var(--surface-2); border: 1px solid var(--border);
}

/* 贴片缩略图（选品表） */
.stk-thumb {
  width: 180px; height: 54px; border: 1px solid var(--border); border-radius: 6px; background: #fff;
  overflow: hidden; display: flex; align-items: center; justify-content: center; position: relative;
}
.stk-thumb svg { width: 100%; height: 100%; display: block; }
.stk-thumb.pending { background: repeating-linear-gradient(45deg,#F4F6F8 0 6px,#FAFBFC 6px 12px); border-style: dashed; }
.stk-thumb.pending .ph { font-size: 11px; color: var(--text-3); }
/* v0.26：懒渲染占位——SVG 注入前先占住 180×54，避免行高跳动 */
.stk-thumb.lazy {
  background: linear-gradient(90deg,#f1f4f8 25%,#f8fafc 37%,#f1f4f8 63%);
  background-size: 400% 100%; animation: sk 1.3s ease infinite;
}

/* ---------------- 杂项 ---------------- */
.row { display: flex; align-items: center; gap: 10px; }
.row.wrap { flex-wrap: wrap; }
.muted { color: var(--text-3); }
.sep { width: 1px; height: 22px; background: var(--border); }
.skeleton { background: linear-gradient(90deg, #eef1f5 25%, #f6f8fa 37%, #eef1f5 63%); background-size: 400% 100%; animation: sk 1.3s ease infinite; border-radius: 6px; }
@keyframes sk { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }

/* ============ v0.5 素材管理 ============ */
.stat-row { display: flex; gap: 12px; margin: 0 0 14px; flex-wrap: wrap; }
.stat-card {
  flex: 1 1 150px; min-width: 130px; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: 12px 14px;
}
.stat-num { font-size: 20px; font-weight: 650; margin-top: 4px; color: var(--text); }
.stat-num.warn { color: var(--warn); }

.asset-row { cursor: pointer; }
.asset-row:hover { background: var(--surface-2); }
td .cell-main { font-weight: 550; }
td .cell-sub { font-size: 12px; color: var(--text-3); margin-top: 2px; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }

.tag {
  display: inline-block; padding: 2px 8px; border-radius: 999px;
  font-size: 12px; line-height: 1.6; border: 1px solid transparent;
}
.tag-ok { background: var(--ok-soft); color: var(--ok); border-color: #bfe5d1; }
.tag-warn { background: var(--warn-soft); color: var(--warn); border-color: var(--warn-border); }

.asset-sec { margin-bottom: 22px; }
.asset-sec-head {
  display: flex; align-items: baseline; gap: 10px;
  margin-bottom: 10px; padding-bottom: 6px;
  border-bottom: 1px solid var(--border);
}
.asset-sec-head b { font-size: 14px; }

/* 色卡宫格：图 + 色名 + 色号 */
.chip-grid {
  display: grid; gap: 12px;
  grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
}
.chip-item {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 10px 8px; text-align: center;
}
.chip-img {
  width: 100%; height: 54px; display: flex;
  align-items: center; justify-content: center; margin-bottom: 6px;
}
.chip-img img {
  max-width: 100%; max-height: 54px;
  border: 1px solid var(--border); border-radius: 4px;
  image-rendering: auto;
}
.chip-name { font-size: 12.5px; font-weight: 550; color: var(--text); }
.chip-no { font-size: 11px; color: var(--text-3); margin-top: 2px; }

.img-grid {
  display: grid; gap: 12px;
}
.img-grid.main-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.img-grid.sku-grid  { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.img-item {
  position: relative;      /* v0.56：⋯ 按钮 / 菜单相对卡片定位 */
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-sm); overflow: hidden;
  display: flex; flex-direction: column; min-width: 0;
}
.img-item .img-full {
  aspect-ratio: 1 / 1;                /* v0.14：1:1 cell，原图比例完整显示（横/竖/方通用） */
  display: flex; cursor: zoom-in;
  background: var(--surface-2);
}
.img-item .img-full img {
  width: 100%; height: 100%; object-fit: contain;   /* 不裁剪，竖图被 letterbox */
}
.img-cap {
  font-size: 12px; color: var(--text-2); padding: 5px 8px;
  border-top: 1px solid var(--border); white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis;
  margin-top: auto;   /* v0.15：文字永远压到卡片最底部（同行图高不一时对齐） */
}
.img-item .img-full { align-items: center; justify-content: center; }   /* v0.15：图在 cell 内上下左右居中 */

/* v0.56：4 个图片区共用的末尾「＋ 上传」虚线槽 */
.asset-add {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 8px; min-height: 140px; padding: 8px; text-align: center;
  background: var(--surface); color: var(--warn); cursor: pointer;
  border: 1px dashed var(--warn-border); border-radius: var(--radius-sm);
  transition: border-color .12s, background .12s;
}
.asset-add:hover { border-color: var(--warn); background: var(--warn-soft); }
.asset-add-plus {
  width: 36px; height: 36px; border-radius: 50%;
  border: 2px dashed var(--warn); display: inline-flex;
  align-items: center; justify-content: center;
  font-size: 20px; font-weight: 700; line-height: 1; flex: none;
}
.asset-add-text { font-size: 12px; font-weight: 600; color: var(--text-2); }

/* v0.56：商品主图 / 各色商品图 右上角 ⋯ 菜单（严格只在这两个区出现） */
.img-more {
  position: absolute; right: 6px; top: 6px; z-index: 2;
  width: 26px; height: 26px; border-radius: 6px;
  display: inline-flex; align-items: center; justify-content: center;
  background: rgba(255, 255, 255, .92); border: 1px solid var(--border);
  color: var(--text-2); font-size: 16px; line-height: 1; cursor: pointer;
  opacity: .9; transition: opacity .12s, border-color .12s;
}
.img-item:hover .img-more, .img-more.on { opacity: 1; }
.img-more:hover, .img-more.on { border-color: var(--primary, #0f6efd); color: var(--primary, #0f6efd); }
.img-menu {
  position: absolute; left: 6px; right: 6px; top: 38px; z-index: 5;
  padding: 4px; background: var(--surface);
  border: 1px solid var(--border); border-radius: 6px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, .14);
}
.img-menu[hidden] { display: none; }   /* 折叠区块：hidden 必须显式压过默认 display */
.img-menu button {
  display: block; width: 100%; text-align: left;
  padding: 7px 8px; font-size: 12px; color: var(--text);
  background: transparent; border: 0; border-radius: 4px; cursor: pointer;
  white-space: nowrap;
}
.img-menu button:hover { background: var(--surface-2); color: var(--primary, #0f6efd); }

/* 商品特点：官网同构（features-item = 图上/文下，两列排布；图为 1000×1000 正方形）
   ⚠️ 类名用 feat-*：.shot-item 已被编辑器产品图选图格占用（editor.css 晚加载会覆盖） */
/* v0.56：5 列 + 文字完整显示（不截断）→ align-items:start 让卡片按内容高度，不拉伸 */
.feat-list { display: grid; gap: 12px; grid-template-columns: repeat(5, minmax(0, 1fr)); align-items: start; }
.feat-item {
  display: flex; flex-direction: column; gap: 6px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 8px;
  min-width: 0;
}
.feat-item img {
  width: 100%; aspect-ratio: 1 / 1; object-fit: contain;   /* v0.14：原图比例 + 填满 cell */
  border-radius: 0; background: var(--surface-2); display: block; flex: none;   /* v0.18：去圆角 */
}
.feat-imgwrap {
  position: relative; display: flex; flex: none; cursor: zoom-in;
  width: 100%; aspect-ratio: 1 / 1; background: var(--surface-2); border-radius: 0;
  overflow: hidden;
}
.feat-imgwrap img { width: 100%; height: 100%; object-fit: contain; }
/* v0.13：特点图勾选/上传移到图下方一行，不遮挡图片 */
.feat-controls {
  display: flex; align-items: center; gap: 12px; min-height: 24px;
}
/* v0.12：特点图列表末尾「＋ 上传」空槽（虚线框，点击选本地上传） */
.feat-item.feat-add {
  justify-content: center; align-items: center;
  border-style: dashed; border-color: var(--warn-border);
  cursor: pointer; min-height: 140px;
  transition: border-color .12s, background .12s;
}
.feat-item.feat-add:hover { border-color: var(--warn); background: var(--warn-soft); }
.feat-add-box {
  display: inline-flex; flex-direction: column; align-items: center; gap: 8px;
  color: var(--warn); padding: 18px 10px;
}
.feat-add-plus {
  width: 40px; height: 40px; border-radius: 50%;
  border: 2px dashed var(--warn); display: inline-flex;
  align-items: center; justify-content: center;
  font-size: 22px; font-weight: 700; line-height: 1;
}
.feat-add-text { font-size: 12px; font-weight: 600; color: var(--text-2); }
/* 勾选框：贴图下方，选中 = 主色背景 + 白色对勾（用 inline SVG 不用 iconfont） */
.feat-pick {
  display: inline-flex; align-items: center; justify-content: center;
  width: 22px; height: 22px; cursor: pointer;
  background: var(--surface-2); border: 1px solid var(--border); border-radius: 4px;
  transition: background 0.12s;
}
.feat-pick input { position: absolute; opacity: 0; pointer-events: none; }
.feat-pick-box {
  width: 14px; height: 14px; border-radius: 3px;
  border: 1.5px solid #fff; background: transparent; position: relative;
  transition: all 0.12s;
}
.feat-pick input:checked + .feat-pick-box {
  background: var(--primary, #0f6efd); border-color: var(--primary, #0f6efd);
}
.feat-pick input:checked + .feat-pick-box::after {
  content: ''; position: absolute; left: 3px; top: 0px; width: 5px; height: 9px;
  border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg);
}
.feat-pick:hover { background: #eef1f5; border-color: var(--primary, #0f6efd); }
.shot-desc { font-size: 11.5px; color: var(--text-2); line-height: 1.5; min-width: 0; }
.shot-long { word-break: break-all; }
.shot-short {
  margin-top: 2px; padding: 2px 6px; display: inline-flex; align-items: center; gap: 4px;
  font-size: 11px; color: var(--text);
  background: var(--surface-2); border: 1px dashed var(--border);
  border-radius: 999px; cursor: text; user-select: none;
}
.shot-short:hover { border-style: solid; border-color: var(--primary, #0f6efd); }
.shot-short.editing { padding: 2px 4px; cursor: text; }
.shot-short-input {
  font-size: 12px; padding: 1px 4px; border: 1px solid var(--primary, #0f6efd);
  border-radius: 6px; background: #fff; color: var(--text); width: 130px; outline: none;
}
.shot-short-edit { color: var(--text-3); font-size: 11px; opacity: 0.6; }

/* v0.11：素材库特点区 长标题编辑 + 上传/替换 + 添加入口 */
.shot-long { cursor: text; }
.shot-long:hover .shot-long-edit, .shot-long.editing .shot-long-edit { opacity: 1; }
.shot-long-edit { color: var(--text-3); font-size: 11px; opacity: 0.45; margin-left: 4px; }
.shot-long.editing { display: inline-flex; align-items: center; gap: 4px; }
.shot-long-input {
  font-size: 12.5px; padding: 2px 6px; border: 1px solid var(--primary, #0f6efd);
  border-radius: 6px; background: #fff; color: var(--text); width: 100%; max-width: 320px; outline: none;
}
.feat-up {
  display: inline-flex; align-items: center; justify-content: center;
  width: 22px; height: 22px; font-size: 13px; line-height: 1; cursor: pointer;
  background: var(--surface-2); color: var(--text-2); border-radius: 4px;
  border: 1px solid var(--border); transition: background 0.12s;
}
.feat-up:hover { background: #eef1f5; border-color: var(--primary, #0f6efd); }
.feat-foot { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.feat-foot .hint { font-size: 12px; }

/* ==================== v0.13：KV 图（模特图）双行布局 ====================
   Row 1 = 当前选中 KV 的 1:1 大图（cropURL 优先，否则默认居中裁剪 CSS 效果）
   Row 2 = 所有 KV 缩略图 + 单选 radio
   ★ 用户 9/9 要求：缩略图点 = 选中+刷新 row1；row1 大图点 = 放大大图再裁剪 */
.kv-active-row {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 18px;
  display: flex; align-items: center; justify-content: center; gap: 22px;
  margin-bottom: 14px;
}
.kv-active-crop, .kv-orig-tile {
  position: relative; width: 240px; height: 240px; flex: 0 0 240px;
  overflow: hidden; background: var(--surface-2);
  border: 1px solid var(--border); cursor: zoom-in;
}
.kv-active-crop img, .kv-orig-tile img {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: contain;          /* v0.18：双图均完整显示原图比例 */
  background: #fff;
}
.kv-tile-label {
  position: absolute; left: 0; top: 0; z-index: 1;
  padding: 2px 9px; font-size: 11px; font-weight: 600;
  background: rgba(0, 0, 0, 0.45); color: #fff;
}
.kv-tile-label-edit { background: var(--primary, #0f6efd); }
/* v0.20：KV 溯源栏（放在「原图」左侧）—— View Type + 来源网址 */
.kv-active-row [data-kv-src] {
  flex: 0 0 200px; width: 200px; align-self: stretch;
  display: flex; align-items: center;
  border-right: 1px dashed var(--border);
}
.kv-src-col { display: flex; flex-direction: column; gap: 12px; min-width: 0; width: 100%; }
.kv-src-item { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.kv-src-k { font-size: 11px; font-weight: 600; color: var(--text-3); letter-spacing: 0.02em; }
.kv-src-vt { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.kv-src-vt b { font-size: 14px; font-weight: 600; color: var(--text); }
.kv-src-vt i {
  font-style: normal; font-size: 11px; color: var(--text-3); line-height: 1.45; word-break: break-all;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
.kv-src-link {
  font-size: 11.5px; color: var(--info, #0f6efd); text-decoration: none; line-height: 1.55;
  word-break: break-all; display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden;
}
.kv-src-link:hover { text-decoration: underline; }
.kv-src-none { font-size: 12px; color: var(--text-3); }

/* ===== v0.24：溯源栏补 NoPublish 红标 + [i] 图库详情入口 ===== */
.kv-src-linkrow { display: flex; align-items: flex-start; gap: 6px; min-width: 0; }
.kv-src-linkrow .kv-src-link { flex: 1 1 auto; min-width: 0; }
.kv-src-i {
  flex: 0 0 20px; width: 20px; height: 20px; margin-top: 1px;
  border: 0; border-radius: 50%; cursor: pointer;
  background: var(--text); color: var(--surface);
  display: inline-flex; align-items: center; justify-content: center;
  font: italic 700 12px/1 Georgia, "Times New Roman", serif;
  transition: background .12s, box-shadow .12s;
}
.kv-src-i:hover { background: var(--accent); }
.kv-src-i.on { background: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
/* NoPublish 红标：与图库里的红标同色语义（品牌红） */
.kv-np-chip {
  align-self: flex-start; display: inline-flex; align-items: center;
  padding: 2px 8px; border-radius: 3px;
  background: var(--accent); color: #fff;
  font-size: 11px; font-weight: 700; letter-spacing: .02em;
}
.kv-np-chip.sm { padding: 1px 7px; }
.kv-np-ribbon {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  z-index: 2; padding: 3px 12px; border-radius: 2px;
  background: var(--accent); color: #fff;
  font-size: 12px; font-weight: 700; letter-spacing: .04em; pointer-events: none;
}
.kv-thumb-np {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  padding: 2px 8px; border-radius: 2px;
  background: var(--accent); color: #fff;
  font-size: 10.5px; font-weight: 700; letter-spacing: .04em; pointer-events: none;
}
/* v0.25：加工图文件丢失（服务端已自愈回退原图）—— 琥珀色提示，避免用户以为「按钮坏了」 */
.kv-proc-lost {
  align-self: flex-start; display: inline-flex; align-items: center;
  padding: 1px 7px; border-radius: 3px;
  background: var(--warn-soft, #fff4e5); color: #9a5b00;
  border: 1px solid #f0c98a;
  font-size: 11px; font-weight: 600;
}

/* ===== v0.24：[i] 图库详情面板（对照图库资产信息弹层） ===== */
.kv-info-pop {
  position: fixed; z-index: 900; width: 460px; max-width: calc(100vw - 24px);
  max-height: min(72vh, 640px); overflow: auto;
  padding: 16px 18px 14px;
  background: var(--surface); border: 1px solid var(--border-strong);
  border-radius: var(--radius); box-shadow: var(--shadow-md);
}
.kv-info-close {
  position: absolute; right: 8px; top: 8px;
  width: 24px; height: 24px; border: 0; border-radius: 50%; cursor: pointer;
  background: transparent; color: var(--text-3); font-size: 13px; line-height: 1;
}
.kv-info-close:hover { background: var(--surface-2); color: var(--text); }
.kv-info-head { padding-right: 26px; margin-bottom: 10px; }
.kv-info-name { font-size: 13px; font-weight: 600; color: var(--text); line-height: 1.5; word-break: break-all; }
.kv-info-url {
  display: inline-block; margin-top: 3px; font-size: 11px; line-height: 1.5;
  color: var(--info); text-decoration: none; word-break: break-all;
}
.kv-info-url:hover { text-decoration: underline; }
.kv-info-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.kv-info-table th {
  width: 158px; padding: 6px 10px 6px 0; vertical-align: top;
  text-align: left; font-weight: 600; color: var(--text-2);
}
.kv-info-table td { padding: 6px 0; color: var(--text); word-break: break-word; }
.kv-info-table tr + tr th, .kv-info-table tr + tr td { border-top: 1px solid var(--border); }
.kv-info-dash { color: var(--text-3); }
.kv-info-ok { color: var(--ok); font-weight: 600; }
.kv-info-note { margin-left: 8px; font-size: 11.5px; color: var(--text-3); }
.kv-info-none { font-size: 12.5px; color: var(--text-3); line-height: 1.75; }
.kv-info-none code {
  font-family: var(--mono); font-size: 11.5px;
  background: var(--surface-2); border: 1px solid var(--border); border-radius: 3px; padding: 1px 5px;
}
.kv-info-items { margin-top: 12px; padding-top: 10px; border-top: 1px dashed var(--border); }
.kv-info-items-h { margin-bottom: 6px; font-size: 11px; font-weight: 600; color: var(--text-3); }
.kv-info-item { display: flex; align-items: baseline; gap: 8px; padding: 3px 0; font-size: 12px; }
.kv-info-item b { font-family: var(--mono); font-weight: 600; color: var(--text); }
.kv-info-item span { color: var(--text-2); }
.kv-info-item i { font-style: normal; font-size: 11.5px; color: var(--text-3); }
.kv-info-item em {
  margin-left: auto; font-style: normal; font-size: 10.5px; font-weight: 700;
  color: var(--ok); background: var(--ok-soft); border-radius: 999px; padding: 1px 7px;
}
.kv-info-item.is-main b { color: var(--accent); }
.kv-active-meta { display: flex; flex-direction: column; gap: 6px; min-width: 0; max-width: 560px; }
.kv-active-meta .kv-active-cap { font-size: 14px; font-weight: 600; color: var(--text); }
.kv-active-meta .kv-active-hint { font-size: 12.5px; color: var(--text-3); line-height: 1.6; }
.kv-active-tag {
  display: inline-flex; align-items: center; gap: 4px; align-self: flex-start;
  padding: 2px 8px; font-size: 11.5px; border-radius: 999px; font-weight: 600;
}
.kv-active-tag.tag-cropped { background: var(--info-soft); color: var(--info); }
.kv-active-tag.tag-default { background: var(--surface-2); color: var(--text-3); border: 1px solid var(--border); }
.kv-active-empty {
  font-size: 13px; color: var(--text-3); padding: 24px;
}

.kv-thumbs-row {
  display: grid; gap: 10px;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
}
.kv-thumb {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-sm); overflow: hidden;
  display: flex; flex-direction: column; min-width: 0;
  cursor: pointer; transition: border-color .12s, box-shadow .12s;
}
.kv-thumb.is-sel {
  border-color: var(--primary, #0f6efd);
  box-shadow: 0 0 0 1px var(--primary, #0f6efd);
}
.kv-thumb-imgwrap {
  position: relative; cursor: pointer; background: var(--surface-2);
  aspect-ratio: 1 / 1; display: flex; align-items: center; justify-content: center;
}
.kv-thumb-imgwrap img { width: 100%; height: 100%; object-fit: contain; }
.kv-thumb-tag {
  position: absolute; right: 4px; top: 4px; z-index: 2;
  padding: 1px 6px; font-size: 10.5px; color: #fff; font-weight: 600;
  background: var(--info); border-radius: 999px; opacity: .9;
}
.kv-thumb-controls {
  display: flex; align-items: center; gap: 6px; padding: 5px 8px;
  border-top: 1px solid var(--border);
  margin-top: auto;   /* v0.15：radio+文字压到卡片最底部（同行图高不一时对齐） */
}
.kv-thumb-radio {
  display: inline-flex; align-items: center; justify-content: center;
  width: 18px; height: 18px; flex: none; cursor: pointer;
}
.kv-thumb-radio input { position: absolute; opacity: 0; pointer-events: none; }
.kv-thumb-radio-box {
  width: 13px; height: 13px; border-radius: 50%;
  border: 1.5px solid var(--text-3); background: transparent; position: relative;
  transition: all 0.12s;
}
.kv-thumb-radio input:checked + .kv-thumb-radio-box { background: var(--primary, #0f6efd); border-color: var(--primary, #0f6efd); }
.kv-thumb-radio input:checked + .kv-thumb-radio-box::after {
  content: ''; position: absolute; left: 3px; top: 0px; width: 4px; height: 8px;
  border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg);
}
.kv-thumb-cap {
  font-size: 12px; color: var(--text-2); min-width: 0;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* v0.15：权益标签（Digital/Website + 北半球有效期），悬停看完整权益 */
.kv-rights {
  display: inline-block; margin-left: 5px; padding: 0 5px;
  font-size: 10.5px; font-weight: 600; border-radius: 999px; vertical-align: 1px;
}
.kv-rights.tag-digital { background: var(--info-soft, #e7f0ff); color: var(--info, #0f6efd); }
.kv-rights.tag-website { background: #fff4e0; color: #b26a00; }

/* 兼容旧 kv-grid / kv-item（v0.13 残留），保留类以便老测试不爆 */
.kv-grid, .kv-item { display: none; }

/* ==================== v0.13：灯箱（点图看大图） ==================== */
.lb-overlay {
  position: fixed; inset: 0; z-index: 9999;
  background: rgba(0, 0, 0, 0.82);
  display: flex; align-items: center; justify-content: center;
}
.lb-stage { position: relative; width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; }
/* v0.20 需求1：图区加「棋盘格」底。
   原来 overlay 是 0.82 黑、裁剪框外再叠 0.55 黑 → 图片范围外几乎纯黑；
   而 AI 抠底后的 PNG 透明区在黑底上也是黑，深色衣物（黑裤子）直接消失在背景里，
   看不出图的实际边界。改为专业图片工具的棋盘格，一眼分清「透明」与「页面背景」。 */
.lb-view {
  position: relative; max-width: 92vw; max-height: 88vh;
  display: flex; align-items: center; justify-content: center;
  background-color: #2b2f36;
  background-image:
    linear-gradient(45deg, #3a3f47 25%, transparent 25%),
    linear-gradient(-45deg, #3a3f47 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #3a3f47 75%),
    linear-gradient(-45deg, transparent 75%, #3a3f47 75%);
  background-size: 20px 20px;
  background-position: 0 0, 0 10px, 10px -10px, -10px 0;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.14);
}
.lb-img { display: block; max-width: 92vw; max-height: 88vh; object-fit: contain; }
.lb-close {
  position: absolute; top: 16px; right: 22px; z-index: 2;
  width: 36px; height: 36px; background: rgba(255, 255, 255, 0.12); color: #fff;
  border: 0; border-radius: 50%; font-size: 18px; cursor: pointer;
}
.lb-close:hover { background: rgba(255, 255, 255, 0.25); }
.lb-cap {
  position: absolute; left: 0; right: 0; bottom: 18px; z-index: 2;
  text-align: center; color: #fff; font-size: 13px; opacity: 0.85; padding: 0 24px;
}

/* ==================== v0.14：1:1 裁剪 · v0.16 改为直接盖在大图上 ==================== */
.lb-actions { position: absolute; top: 16px; right: 70px; z-index: 2; display: inline-flex; gap: 8px; }
/* v0.18：撤回/重做 —— 顶部居中（需求5：中间偏上） */
.lb-history {
  position: absolute; top: 16px; left: 50%; transform: translateX(-50%); z-index: 2;
  display: inline-flex; gap: 8px;
}
.lb-undo, .lb-redo {
  height: 36px; padding: 0 14px; background: rgba(255, 255, 255, 0.14); color: #fff;
  border: 0; border-radius: 999px; font-size: 13px; cursor: pointer;
  display: inline-flex; align-items: center; gap: 6px;
}
.lb-undo:hover:not(:disabled), .lb-redo:hover:not(:disabled) { background: rgba(255, 255, 255, 0.26); }
.lb-undo:disabled, .lb-redo:disabled { opacity: 0.35; cursor: default; }
.lb-crop-toggle, .lb-ext-toggle, .lb-trans-toggle, .lb-notext, .lb-eye, .lb-reset {
  height: 36px; padding: 0 14px; background: rgba(255, 255, 255, 0.14); color: #fff;
  border: 0; border-radius: 999px; font-size: 13px; cursor: pointer;
  display: inline-flex; align-items: center; gap: 6px;
}
.lb-crop-toggle:hover, .lb-ext-toggle:hover, .lb-trans-toggle:hover, .lb-notext:hover, .lb-eye:hover, .lb-reset:hover { background: rgba(255, 255, 255, 0.26); }
.lb-ext-toggle:disabled, .lb-trans-toggle:disabled, .lb-notext:disabled { opacity: 0.55; cursor: default; }
/* v0.17 需求5：已裁剪图的弱虚线裁剪框（弱 = 低透明度白虚线，不抢视线） */
.lb-crop-mark {
  position: absolute; z-index: 2; pointer-events: none;
  border: 1.5px dashed rgba(255, 255, 255, 0.38);
  border-radius: 2px;
}
.lb-eye { padding: 0 10px; }
/* 裁剪层：精确盖在 .lb-img 的显示区域上（选区坐标即层内坐标） */
.lb-crop-layer { position: absolute; z-index: 3; cursor: move; }
.lb-crop-square {
  position: absolute; border: 2px solid #fff; cursor: move; touch-action: none;
  box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.55);   /* 框外半透明黑遮罩 */
}
.lb-crop-square::before { content: ''; position: absolute; inset: 0; background: rgba(255, 255, 255, 0.06); }
.lb-crop-handle {
  position: absolute; right: -7px; bottom: -7px; width: 16px; height: 16px;
  background: #fff; border: 2px solid var(--primary, #0f6efd); border-radius: 3px;
  cursor: nwse-resize; touch-action: none;
}
/* v0.17 需求6：取消/确认按钮固定在顶部居中，不再压在图片上 */
.lb-crop-bar {
  position: absolute; left: 0; right: 0; top: 16px; z-index: 4;
  display: flex; align-items: center; justify-content: center; gap: 14px;
}
.lb-btn {
  padding: 8px 20px; border-radius: 8px; border: 1px solid rgba(255, 255, 255, 0.3);
  background: rgba(255, 255, 255, 0.12); color: #fff; font-size: 14px; cursor: pointer;
}
.lb-btn:hover { background: rgba(255, 255, 255, 0.24); }
.lb-btn-primary { background: var(--primary, #0f6efd); border-color: var(--primary, #0f6efd); }
.lb-btn-primary:hover { background: #0b5cd6; }
.lb-btn-primary:disabled { opacity: 0.6; cursor: default; }
.lb-crop-size { color: #fff; font-size: 13px; opacity: 0.9; font-variant-numeric: tabular-nums; }

/* 商品详情（注意事项区数据源） */
.dt-body {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 12px 16px;
  font-size: 13px; color: var(--text); line-height: 1.7;
}
.dt-body .dt-u {
  display: block; margin: 10px 0 4px; font-weight: 600;
  text-decoration: underline; text-underline-offset: 3px;
}
.dt-body .dt-u:first-child { margin-top: 0; }
.dt-body .dt-line { display: block; }
.dt-body .dt-line::before { content: '- '; }
.dt-body .dt-p { display: block; margin-top: 2px; }

/* ==================== v0.27 需求6：单品详情「注意事项」块 ====================
   位置：商品详情**后面**。两类来源用不同底色徽章区分（男女同款=信息蓝，*说明=警示黄）。 */
.cau-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.cau-item { display: flex; gap: 10px; align-items: flex-start; font-size: 13px; line-height: 1.65; }
.cau-badge {
  flex: 0 0 auto; margin-top: 2px; padding: 2px 8px; border-radius: 3px;
  font-size: 11px; font-weight: 700; letter-spacing: .02em; white-space: nowrap;
}
.cau-mixed { background: var(--info-soft); color: var(--info); border: 1px solid var(--info-border, #cfe0f7); }
.cau-star { background: var(--warn-soft); color: var(--warn); border: 1px solid var(--warn-border); }
.cau-text { color: var(--text); word-break: break-word; }

/* 列表页色卡缩略：≤5 个居中一行；6-10 个两行（每行 5 个）；>10 截断 +N */
.cell-chips {
  display: flex; flex-wrap: wrap; gap: 4px; align-items: center;
  width: 158px;                     /* 5×28 + 4×4 = 156，恰好每行 5 个 */
  margin: 0 auto;
}
.cell-chips.few { justify-content: center; }
.cell-chip {
  width: 28px; height: 28px; object-fit: cover;
  border: 1px solid var(--border); border-radius: 4px;
  background: var(--surface-2); display: block;
}
.cell-chip-more {
  font-size: 11px; color: var(--text-3); line-height: 1; padding: 2px 2px;
}

/* ==================== v0.20 需求2：素材管理列表美化 ====================
   ★ 根因：该表格原写 class="tbl"，而全站表格样式全挂在 table.data 上
     → 它一条规则都没吃到，padding / 行高 / 分隔线全用浏览器默认值，所以挤。
   这里统一用 table.data.asset-table 提高特异度，避免被上面 table.data 的
   padding:9px 12px / td.num 右对齐 覆盖掉。 */
table.data.asset-table { font-size: 13px; }
table.data.asset-table th,
table.data.asset-table td { padding: 13px 16px; }
table.data.asset-table thead th {
  background: #f7f8fa; color: var(--text-2);
  font-size: 12px; letter-spacing: .04em; font-weight: 600;
}
table.data.asset-table tbody tr + tr td { border-top: 1px solid var(--border); }
table.data.asset-table .asset-code {
  color: var(--text-2); font-size: 12.5px; white-space: nowrap;
}
table.data.asset-table .asset-name .cell-main { font-size: 13.5px; font-weight: 600; }
table.data.asset-table .asset-name .cell-sub { font-size: 11.5px; margin-top: 3px; }
/* 特点 / 主图：数字居中，比右对齐更好扫读 */
table.data.asset-table td.num { text-align: center; font-size: 14px; padding-left: 12px; padding-right: 12px; }
table.data.asset-table th.th-center { text-align: center; }
table.data.asset-table .asset-kv,
table.data.asset-table .asset-op { text-align: center; }
/* KV 列的 NoPublish 计数芯片（v0.24）：紧跟在「有/缺」后面 */
table.data.asset-table .asset-kv .kv-np-chip { margin-left: 6px; vertical-align: middle; }
table.data.asset-table .asset-op .btn { padding: 0 12px; }
/* 色卡列：撑满列宽，chip 略放大到 30px；204 列宽 - 32 padding = 172 ≥ 5×30+4×5
   ★ v0.27：列宽不再固定写死（品名列收窄后剩余宽度会摊到各列，实测色卡列涨到 244px
     → 一行塞下 6 个，破坏 v0.20 定下的「每行 5 个 · 两行放满 10 个」）。
     所以改成**给 chips 容器封顶 172px 并居中** —— 不管列多宽都稳定 5 个一行。 */
table.data.asset-table .cell-chips { width: 100%; max-width: 172px; margin: 0 auto; gap: 5px; }
table.data.asset-table .cell-chip { width: 30px; height: 30px; border-radius: 5px; }
table.data.asset-table .cell-chip-more { margin-left: 2px; }

/* ==================== v0.27 需求1-5：单品列表列改造 ====================
   需求1（不要空这么大）：品名列此前是表里**唯一没有宽度**的列，浏览器把 1310px 表格的
     剩余宽度全塞给它（实测 614px，内容只占 ~200px）。现在 thead 每列都写明宽度，
     剩余宽度按比例摊到各列，品名列自己再兜一层 max-width + 省略号。 */
table.data.asset-table .asset-name { max-width: 240px; }
table.data.asset-table .asset-name .cell-main,
table.data.asset-table .asset-name .cell-sub {
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
/* 需求2：序号列（入库序）+ 需求5 问题标黄
   收紧左右 padding：表格是 auto 布局，列宽受 min-content 牵制，
   16px 左右内边距会把「序号」列顶到 78px（一个小圆徽不该占这么宽）。 */
table.data.asset-table .asset-seq { text-align: center; padding-left: 4px; padding-right: 4px; }
table.data.asset-table .asset-seq .seq { font-size: 12px; }

/* 需求3：KV / 特点列的「状态」竖排换行（原来「0 补3」「有 NP1」挤在一行）
   ★ 限定在 asset-table 内：这是通用名字，放开会在别处捡到同名元素 */
table.data.asset-table .cell-state {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  line-height: 1; font-variant-numeric: tabular-nums;
}

/* 需求4：KV 列最多 3 张缩略图
   ★ 类名必须用 kv-mini* 而不是 kv-thumb*：详情页 KV 网格已经用了 .kv-thumb /
     .kv-thumbs-row（1033 行起），重名会双向污染（MEMORY「类名冲突双向」坑）。 */
table.data.asset-table .kv-mini-row { display: flex; gap: 5px; justify-content: center; margin-bottom: 7px; }
table.data.asset-table .kv-mini {
  position: relative; display: block; width: 44px; height: 44px;
  border: 1px solid var(--border); border-radius: 5px;
  overflow: hidden; background: var(--surface-2); flex: 0 0 auto;
}
table.data.asset-table .kv-mini img { width: 100%; height: 100%; object-fit: cover; display: block; }
/* 加载失败（KV 文件缺失）→ 斜纹占位，不再是浏览器裂图图标 */
table.data.asset-table .kv-mini.bad {
  background: repeating-linear-gradient(45deg, #eef1f5, #eef1f5 5px, #e2e6ec 5px, #e2e6ec 10px);
}
table.data.asset-table .kv-mini.cross::after {
  content: '搭'; position: absolute; left: 0; top: 0;
  background: rgba(0, 0, 0, .62); color: #fff;
  font-size: 10px; line-height: 1; padding: 2px 3px;
  border-bottom-right-radius: 4px;
}
table.data.asset-table .kv-mini.proc::before {
  content: '加'; position: absolute; right: 0; top: 0;
  background: rgba(63, 74, 138, .85); color: #fff;
  font-size: 10px; line-height: 1; padding: 2px 3px;
  border-bottom-left-radius: 4px;
}
table.data.asset-table .kv-mini-more { align-self: center; font-size: 11px; color: var(--text-3); padding: 0 2px; }
/* NP 芯片已换到独立一行 → 去掉左外边距；
   ★ 还要覆盖 align-self：.kv-np-chip 全局带 align-self:flex-start（941 行），
     在 .cell-state 这个 column flex 里会把它顶到最左，与居中的「有/缺」错开。 */
table.data.asset-table .asset-kv .kv-np-chip { margin-left: 0; align-self: center; }

.kv-empty {
  background: var(--warn-soft); border: 1px solid var(--warn-border);
  border-radius: var(--radius-sm); padding: 14px 16px;
  font-size: 13px; color: var(--warn);
}
.empty.sm { padding: 14px; font-size: 13px; color: var(--text-3); }

/* ==================== v0.19：加工图边界虚线 + KV 模特图选择器 ====================
   需求2：背景透明 / 背景扩展后的图边界看不出来 → 加工图加 1px 细虚线 outline；
   需求3：眼睛按钮改为常驻（显隐边界虚线 / 裁剪框）。 */
.proc-outline {
  outline: 1px dashed rgba(148, 158, 178, 0.95);
  outline-offset: -1px;
}

/* 编辑器「模特图（KV）」当前图缩略 */
.kv-cur-row { display: flex; gap: 12px; align-items: flex-start; }
.kv-cur-thumb {
  width: 96px; height: 96px; flex: none;
  border: 1px solid var(--border); background: var(--surface-2);
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
}
.kv-cur-thumb img { width: 100%; height: 100%; object-fit: contain; }
.kv-cur-empty { font-size: 11px; color: var(--text-3); padding: 6px; text-align: center; }
.kv-pick-wrap { margin-top: 10px; }

/* KV 选择网格（总览 / 分区共用） */
.kv-pick-grid {
  display: grid; gap: 8px;
  grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
}
.kv-pick-item {
  position: relative; aspect-ratio: 1 / 1; cursor: pointer;
  border: 1px solid var(--border); background: var(--surface-2);
  overflow: hidden;
}
.kv-pick-item:hover { border-color: var(--primary, #0f6efd); }
.kv-pick-item.sel {
  border-color: var(--primary, #0f6efd);
  box-shadow: 0 0 0 1px var(--primary, #0f6efd);
}
.kv-pick-item img { width: 100%; height: 100%; object-fit: contain; display: block; }
.kv-pick-tag {
  position: absolute; left: 4px; bottom: 4px;
  padding: 1px 6px; font-size: 10px; font-weight: 600; border-radius: 999px;
}
.kv-pick-tag.ok { background: var(--ok-soft); color: var(--ok); }
.kv-pick-tag.warn { background: var(--warn-soft); color: var(--warn); }
.kv-pick-cur {
  position: absolute; right: 4px; top: 4px;
  padding: 1px 6px; font-size: 10px; font-weight: 700; border-radius: 999px;
  background: var(--primary, #0f6efd); color: #fff;
}
/* v0.24：编辑器 KV 网格上的 NoPublish 红标（选贴片主图前要能一眼看见） */
.kv-pick-np {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  padding: 2px 8px; border-radius: 2px;
  background: var(--accent); color: #fff;
  font-size: 10.5px; font-weight: 700; letter-spacing: .04em; pointer-events: none;
}
/* v0.49：KV 网格上的「抠底」按钮 —— 只在未抠底的图上出现。
   （v0.49 起选中 KV 不再自动抠底，抠底改为用户显式点这个按钮） */
.kv-pick-cut {
  position: absolute; right: 4px; bottom: 4px;
  padding: 2px 8px; font-size: 10px; font-weight: 600; line-height: 1.5;
  border: 1px solid var(--border); border-radius: 999px;
  background: rgba(255, 255, 255, .92); color: var(--text, #1a1d21); cursor: pointer;
}
.kv-pick-cut:hover {
  background: var(--primary, #0f6efd); color: #fff; border-color: var(--primary, #0f6efd);
}
.kv-pick-cut:disabled { opacity: .55; cursor: default; }

/* ==================== v0.25 素材管理 tab（单品管理 / 系列管理） ==================== */
.asset-tabs {
  display: flex; gap: 2px;
  border-bottom: 1px solid var(--border);
  margin: 2px 0 14px;
}
.asset-tab {
  padding: 8px 16px; margin-bottom: -1px;
  font-size: 13.5px; color: var(--text-2); text-decoration: none;
  border-bottom: 2px solid transparent;
}
.asset-tab:hover { color: var(--text); background: var(--surface-2); }
.asset-tab.on { color: var(--accent); border-bottom-color: var(--accent); font-weight: 600; }

/* v0.26：素材管理顶栏 = tab（左）+ 页面级操作（右），取代原「素材管理 + 描述」大标题行。
   它是 .page-fill 的 flex 子项，滚动只发生在 #body，所以天然常驻不被滚走。 */
.asset-top {
  flex: 0 0 auto;
  display: flex; align-items: flex-end; gap: 16px;
  border-bottom: 1px solid var(--border);
  margin: 0 0 14px;
}
/* 顶栏自带分割线，tab 自身的线让位，避免双线 */
.asset-top .asset-tabs { border-bottom: 0; margin: 0; }
.asset-top .asset-tab { margin-bottom: 0; }
.asset-top-right { margin-left: auto; display: flex; align-items: center; gap: 8px; }

/* ==================== v0.25 系列管理 ==================== */
.series-sec { margin-top: 20px; }
.series-sec:first-child { margin-top: 4px; }
/* ★ 9/18 需求 7：分区头加了右侧「＋ 上传图片」按钮 → 改成 flex 两端布局 */
.series-sec-head { margin-bottom: 10px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.series-sec-title { font-size: 14px; font-weight: 700; color: var(--text); }
.series-sec-n {
  display: inline-block; margin-left: 6px; padding: 0 7px;
  border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border);
  font-size: 11.5px; font-weight: 600; color: var(--text-2);
}
.series-grid {
  display: grid; gap: 12px;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
}
.series-card {
  display: grid; grid-template-columns: 120px 1fr; gap: 12px;
  padding: 10px; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius-sm);
}
.series-card:hover { border-color: var(--border-strong); box-shadow: var(--shadow-sm); }
/* 系列图多是透明 PNG：中性深底 + 斜纹棋盘格，避免白字/黑字 logo 融进背景 */
.series-thumb {
  width: 120px; height: 120px; overflow: hidden;
  display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  background-color: #2b2f36;
  background-image:
    linear-gradient(45deg, rgba(255,255,255,.06) 25%, transparent 25%, transparent 75%, rgba(255,255,255,.06) 75%),
    linear-gradient(45deg, rgba(255,255,255,.06) 25%, transparent 25%, transparent 75%, rgba(255,255,255,.06) 75%);
  background-size: 16px 16px;
  background-position: 0 0, 8px 8px;
}
.series-thumb img { max-width: 100%; max-height: 100%; object-fit: contain; display: block; }
.series-fields {
  display: grid; grid-template-columns: 52px 1fr; gap: 6px 8px;
  align-items: center; align-content: start;
}
.series-fields label { font-size: 11.5px; color: var(--text-3); }
.series-fields .input { width: 100%; min-width: 0; }
.series-path {
  grid-column: 1 / -1;
  font-family: var(--mono); font-size: 10.5px; color: var(--text-3);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.series-ops {
  grid-column: 1 / -1;
  display: flex; gap: 8px; justify-content: flex-end;
}
.empty.sm { padding: 18px; font-size: 12.5px; color: var(--text-3); }

/* v0.25：编辑器里选系列图 / 合作 logo 的网格（复用灯箱那套中性深底棋盘格，
   透明 PNG 的白字 logo 才不会融进背景） */
.series-pick-grid {
  display: grid; gap: 8px; margin-top: 8px;
  grid-template-columns: repeat(auto-fill, minmax(104px, 1fr));
}
.series-pick-item {
  position: relative; height: 76px; cursor: pointer;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center; padding: 6px;
  background-color: #2b2f36;
  background-image:
    linear-gradient(45deg, rgba(255,255,255,.06) 25%, transparent 25%, transparent 75%, rgba(255,255,255,.06) 75%),
    linear-gradient(45deg, rgba(255,255,255,.06) 25%, transparent 25%, transparent 75%, rgba(255,255,255,.06) 75%);
  background-size: 14px 14px;
  background-position: 0 0, 7px 7px;
}
.series-pick-item:hover { border-color: var(--border-strong); }
.series-pick-item.sel {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent);
}
.series-pick-item img { max-width: 100%; max-height: 100%; object-fit: contain; display: block; }

/* ==================== v0.29 模板管理 ====================
   ★ 同样踩过 table.data 的坑（见 v0.20 注释）：这里的表格样式必须挂
     table.data.font-table 提高特异度，否则会被上面 table.data 的通用规则吃掉，
     表现为「padding/行高全用浏览器默认值，看起来挤成一团」。
   ★ 类作用域：.font-* / .tpl-note* 都是本页专属，为了安全一律顶格写（不复用
     别处的 .sec/.head 之类通用名，防止跨页互啃 —— v0.27 的 .sel 教训）。 */

/* 规则条：字体规定的「为什么」讲清楚，否则设计师会以为能随便换 */
.font-note {
  padding: 12px 14px; margin-bottom: 14px;
  border: 1px solid var(--warn-border); border-radius: var(--radius-sm);
  background: var(--warn-soft); color: var(--text-2);
  font-size: 12.5px; line-height: 1.75;
}
.font-note b { color: var(--text); }
.font-note code {
  font-family: var(--mono); font-size: 12px;
  padding: 1px 5px; border-radius: 4px;
  background: rgba(0, 0, 0, .05); color: var(--text);
}
.font-note .hint { display: block; margin-top: 4px; }

/* 上传条：折叠式，点「＋ 上传字体」才展开（默认不占版面）
   ★ 必须显式写 [hidden]{display:none}：作者样式里的 display:flex 会压过
     UA 样式表的 [hidden]，结果是页面上留一个 24px 高的空白红框（截图里一眼就看到）。 */
.font-upload-bar {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px;
  padding: 12px 14px; margin-bottom: 14px;
  border: 1px solid var(--accent); border-radius: var(--radius-sm);
  background: var(--accent-soft);
}
.font-upload-bar[hidden] { display: none; }
.fu-field { display: flex; align-items: center; gap: 6px; }
.fu-field label { font-size: 12.5px; color: var(--text-2); white-space: nowrap; }
.fu-field .input { height: 30px; }
.fu-field .input#fuFamily { width: 200px; }

/* 分区：英数 / 中文 */
.font-sec { margin-bottom: 22px; }
.font-sec:first-child { margin-top: 4px; }
.font-sec-head { margin-bottom: 10px; padding-bottom: 6px; border-bottom: 1px solid var(--border); }
.font-sec-title { font-size: 14px; font-weight: 700; color: var(--text); }
.font-sec-n {
  display: inline-block; margin-left: 6px; padding: 0 7px;
  border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border);
  font-size: 11.5px; font-weight: 600; color: var(--text-2);
}

/* 表格本体 */
table.data.font-table { font-size: 13px; }
table.data.font-table th,
table.data.font-table td { padding: 10px 14px; vertical-align: middle; }
table.data.font-table thead th {
  background: #f7f8fa; color: var(--text-2);
  font-size: 12px; letter-spacing: .04em; font-weight: 600;
  position: sticky; top: 0; z-index: 1;
}
table.data.font-table tbody tr + tr td { border-top: 1px solid var(--border); }
table.data.font-table th.th-center { text-align: center; }
table.data.font-table td.num { text-align: center; font-size: 13px; font-variant-numeric: tabular-nums; }
table.data.font-table .asset-op { text-align: right; white-space: nowrap; }
table.data.font-table .asset-op .btn { padding: 0 10px; }
table.data.font-table .asset-op .btn + .btn { margin-left: 6px; }

/* 族名列：就地编辑的输入框撑满列宽 */
table.data.font-table .font-fam .input { width: 100%; height: 30px; }
table.data.font-table td.num select.input { height: 30px; }

/* 文件列：主行文件名 + 副行 URL（URL 长了不能把列撑爆） */
table.data.font-table .font-file .cell-main,
table.data.font-table .font-file .cell-sub {
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 280px;
}
table.data.font-table .font-file .cell-sub { font-family: var(--mono); font-size: 11px; }

/* 「自传」标记：区分用户上传与内置播种（内置的可删但会提示只删登记） */
table.data.font-table .font-self {
  display: inline-block; margin-left: 4px; padding: 0 5px;
  border-radius: 3px; background: var(--info-soft); color: var(--info);
  font-size: 10.5px; font-weight: 700; letter-spacing: .02em;
}

/* 停用行：整行压暗，但**不能**用 opacity 让控件不可点 —— 要能勾回来 */
table.data.font-table tr.fv-off { background: var(--surface-2); }
table.data.font-table tr.fv-off .font-fam,
table.data.font-table tr.fv-off .cell-main { color: var(--text-3); }

/* 改动未保存的行：左侧一条红竖线 + 把「保存」点亮。
   14 行表格里逐个改元数据，没有这个提示根本记不住哪行没存（v0.29 补）。 */
table.data.font-table tr.dirty .font-fam { box-shadow: inset 3px 0 0 var(--accent); }
table.data.font-table tr.dirty [data-save] {
  background: var(--accent); border-color: var(--accent); color: #fff;
}
table.data.font-table tr.dirty [data-save]:hover:not(:disabled) {
  background: var(--accent-hover); border-color: var(--accent-hover);
}

/* ==================== v0.29 模板（列表 + 详情/设计器） ====================
 *
 * 用户 9/17 反馈：「区块字体不要做成一张平铺的配置表，应该是**选中某个区块之后**
 * 自主切换字体」→ 编辑入口从字体管理页挪到模板详情，交互改成「画布点区块 → 右侧改」。
 * 区块框是 getBBox() 实测出来的（views/template-detail.js），不是写死的坐标。
 */

/* —— 模板列表 —— */
.tpl-list-body { margin-top: 14px; }
table.data.tpl-table { font-size: 13px; }
table.data.tpl-table th,
table.data.tpl-table td { padding: 10px 14px; vertical-align: middle; }
table.data.tpl-table thead th {
  font-size: 12px; color: var(--text-3); font-weight: 600;
  background: var(--surface-2); border-bottom: 1px solid var(--border);
}
table.data.tpl-table tbody tr + tr td { border-top: 1px solid var(--border); }
/* 缩略图：150×45 正好是 3000:903 的等比缩放，贴片不会被拉变形。
   棋盘格底 —— 贴片是透明 PNG，白底上看不出边界 */
table.data.tpl-table .tpl-thumb-box {
  width: 150px; height: 45px; border-radius: 6px; overflow: hidden;
  border: 1px solid var(--border);
  background-color: #fbfcfd;
  background-image:
    linear-gradient(45deg, #eceff3 25%, transparent 25%, transparent 75%, #eceff3 75%),
    linear-gradient(45deg, #eceff3 25%, transparent 25%, transparent 75%, #eceff3 75%);
  background-size: 16px 16px;
  background-position: 0 0, 8px 8px;
}
table.data.tpl-table .tpl-thumb-box svg { display: block; width: 100%; height: 100%; }
table.data.tpl-table .tpl-name .cell-main { font-weight: 600; }
table.data.tpl-table .tpl-scope { color: var(--text-2); line-height: 1.6; }
table.data.tpl-table .asset-op { text-align: right; white-space: nowrap; }
table.data.tpl-table .badge { margin-left: 6px; }

/* —— 详情/设计器：**画布整行撑满** + 下方「属性 / 元素清单」两栏 ——
   ★ 必须写成 `.page-fill > #body.tpl-designer`：通用规则是 `.page-fill > #body`，
     只写 `#body.tpl-designer` 虽然同特异度、但一旦顺序被挪动就会失效。
   9/17 用户反馈：「画布横向撑满，区块列表往下移到红框位置，和属性区齐高」——
   改前是左（画布+属性）/ 右（清单）两列，贴片在半宽里只有 924px 宽（高 278px），看不清元素。 */
/* ★ 9/18（需求 2）：**整页高度钉死**，只有属性区与元素清单各自内部滚。
   改前 #body 自己 `overflow:auto` —— 16 个元素 + 一整块属性面板一撑，
   整页就滚起来了，画布被顶出视野，调版式时看不到贴片。 */
/* ★ v0.31（需求 1）：舞台**不再上下滚动** —— 滚轮 = 缩放、中键拖 = 平移。
   ★ 这里从 grid 换成 flex，是被实测逼出来的（三种 grid 写法都不对，都验证过：
     · `auto` 行 → 空间不够时缩到 min-content，而 `.tpl-stage{min-height:0}`
       把 min-content 拉成 0 ⇒ 1600×1000 下实测舞台只有 405px（贴片要 509px），
       100% 视野下贴片被裁一截 —— 只看 overflow:hidden 是发现不了这个的；
     · `max-content` 行 → 永不缩，矮屏把下面两栏压成 0（实测 0 / 1078 / 0）；
     · `minmax(0, max-content)` → 实测还是只长到 min-content（295 / 295 / 220）。
   flex 能精确表达「舞台保住自然高度，剩余给下面两栏，但下面不低于 260px」：
     · 舞台 `flex: 0 1 auto` —— base = 自然高度（贴片完整可见）
     · 下面 `flex: 1 1 0; min-height: 260px` —— 吃剩余空间；矮屏被压到 260 后
       剩下的压缩量才回到舞台（那时把缩放调小看，而不是去滚画布）。 */
.page-fill > #body.tpl-designer {
  display: flex; flex-direction: column;
  gap: 16px; overflow: hidden; min-height: 0; padding-bottom: 4px;
}

/* 画布：独占一整行，宽度撑满 ⇒ 高度按 3000:903 等比放大。
   `flex: 0 1 auto` = 不主动长，但空间不够时可以让（让的时候贴片被裁，靠缩放看全）。 */
.tpl-stage { flex: 0 1 auto; min-width: 0; min-height: 0; display: flex; flex-direction: column; }
/* v0.38（9/19 需求 1）：工具条 = **舞台内部顶部居中的浮层**，可整条拖拽。
   改动的意义是让出原来那一整行（~56px）给舞台与下方属性区。
   · `position:absolute` 相对 `.tpl-board`；默认 `left:50% + translateX(-50%)` = 顶部居中
   · 拖拽时 JS 会写 left/top 并显式 `transform:none`（见 template-detail.js: placeTopbar）
   · 越界由 `.tpl-board` 的 `overflow:hidden` 裁掉 —— 所以 JS 一律把位置夹在舞台内 */
.tpl-topbar {
  position: absolute;
  top: 8px; left: 50%; transform: translateX(-50%);
  z-index: 6;
  display: flex; align-items: center; justify-content: center;
  max-width: calc(100% - 16px);
}
/* 拖动中：给一点浮起感，并禁止选中文本（拖快了会把工具条文字选中一片） */
.tpl-topbar.dragging { cursor: grabbing; user-select: none; }
.tpl-topbar.dragging .tpl-bar { box-shadow: 0 6px 22px rgba(15, 20, 25, .18); }
.tpl-topbar .tpl-bar {
  display: flex; align-items: center; gap: 8px;
  padding: 4px 6px 4px 4px; border-radius: 8px;
  background: var(--surface);
  border: 1px solid var(--border); box-shadow: var(--shadow-sm);
}
.tpl-bar { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; }
/* 抓手：唯一的「这是可拖的」视觉线索（按钮/输入框上按下不触发拖动） */
.tpl-bar-grip {
  display: flex; align-items: center; padding: 0 4px; height: 30px;
  color: var(--text-3); font-size: 12px; letter-spacing: -1px;
  cursor: grab; user-select: none;
}
.tpl-bar-grip:hover { color: var(--accent); }
/* v0.42 需求 2：撤回 / 恢复的箭头图标（逆时针 ↺ / 顺时针 ↻）。
   ★ 用文字箭头而不是 SVG：就这么两个 14px 的小记号，塞两份 svg path 反而更难读。 */
.tpl-bar .bar-ico { display: inline-block; margin-right: 4px; font-size: 14px; line-height: 1; }
.tpl-bar .hint { min-width: 92px; text-align: right; color: var(--accent); font-weight: 600; white-space: nowrap; }
.tpl-bar .btn { height: 30px; padding: 0 12px; font-size: 12.5px; }
/* 边距标线开关的「打开」态（9/18 需求 5）—— 与 .tpl-zhelp.on 同一套高亮语言 */
.tpl-bar .btn.on { background: var(--accent); color: #fff; border-color: var(--accent); }

/* 字体面板的加粗开关（9/19 需求 7「加粗按钮 ui 美化」）。
   原来借的是 `.btn.btn-sm`（灰底 + 靠 `font-family:serif` 装粗体），开关态只有描边色差，
   看不出开还是关。现在做成独立的方形 toggle 按钮：
   · 常态：白底细边，`B` 用真字重 800 渲染（不再靠 serif 假装粗）
   · 打开（加粗）：实心 accent 底 + 白字 + 轻微内阴影，一眼可辨
   · `aria-pressed` 同步，键盘/读屏也拿得到状态 */
.tpl-bold {
  width: 34px; height: 32px; padding: 0; flex: 0 0 auto;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 8px; cursor: pointer;
  background: var(--surface); border: 1px solid var(--border); color: var(--text);
  transition: background .14s, color .14s, border-color .14s, box-shadow .14s;
}
.tpl-bold b { font-size: 15px; font-weight: 800; line-height: 1; font-family: inherit; }
.tpl-bold:hover { border-color: var(--accent); color: var(--accent); }
.tpl-bold.on {
  background: var(--accent); border-color: var(--accent); color: #fff;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, .18);
}
.tpl-bold.on:hover { color: #fff; filter: brightness(1.06); }
/* v0.52n：KV文本文案框右侧的**局部加粗**按钮 —— 选中文字才出现，状态跟选区走。
   ★ 用 relative 包住输入框把按钮贴在右沿内；[hidden] 必须显式 display:none
     （否则下面的 inline-flex 会压过 UA 的 hidden）。 */
.tpl-bold-sel-wrap { position: relative; display: block; }
.tpl-bold-sel {
  position: absolute; top: 50%; right: 6px; transform: translateY(-50%);
  width: 24px; height: 24px; padding: 0; z-index: 1;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 6px; cursor: pointer;
  background: var(--accent); border: 1px solid var(--accent); color: #fff;
  box-shadow: 0 1px 3px rgba(0,0,0,.2);
}
.tpl-bold-sel[hidden] { display: none; }
.tpl-bold-sel b { font-size: 13px; font-weight: 800; line-height: 1; font-family: inherit; }
.tpl-bold-sel:hover { filter: brightness(1.08); }
.tpl-bold-sel.on { background: #fff; color: var(--accent); }
.tpl-bold-sel.on::after { content: ''; position: absolute; right: 3px; top: 3px; width: 4px; height: 4px; border-radius: 50%; background: var(--accent); }
.tpl-bold-sel-wrap > .tpl-sim-in:has(+ .tpl-bold-sel:not([hidden])) { padding-right: 36px; }
/* 舞台：**裁剪盒**（不再 `overflow:auto`）—— 放大后超出部分由视野平移看，不出现滚动条。
   `position:relative` 是右上角视野浮层的定位基准。 */
.tpl-board {
  flex: 0 1 auto; min-height: 0; overflow: hidden; position: relative;
  display: flex; align-items: center; justify-content: center;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 14px;
}
/* ★ `flex: 0 1 auto`（而不是 `0 0 auto`）是必须的：矮屏时舞台会被压缩，
   若这里不跟着缩，舞台里的画布就会**溢出到下面属性区之上**（实测 1440×700 下
   画布底 544 压在属性区顶 416 上）—— `#body` 的 overflow:hidden 拦不住，
   因为溢出的是内层元素。缩下来之后画布自己裁剪，用户靠缩放看全。 */
/* 贴片 3000×903 ≈ 3.32:1（v0.29 定稿基线），铺满宽度 = 100% 视野。
   ★ `transform-origin:center center` 是缩放锚点公式的前提（舞台中心 = 贴片中心）；
     加过渡的话中键拖动会「追不上手」，所以**不加 transition**。 */
.tpl-host { width: 100%; flex: 0 0 auto; transform-origin: center center; }
.tpl-board.pan-on, .tpl-board.pan-on .tpl-host svg { cursor: grabbing; }

/* 视野控制器（浮在画布右上角，不占画布宽度） */
.tpl-zoom {
  position: absolute; right: 10px; top: 10px; z-index: 3;
  display: flex; align-items: center; gap: 4px;
  padding: 4px; border-radius: 8px;
  background: var(--surface);
  border: 1px solid var(--border); box-shadow: var(--shadow-sm);
}
.tpl-zbtn {
  height: 24px; min-width: 24px; padding: 0 7px;
  font-size: 12.5px; line-height: 1; color: var(--text-2);
  background: transparent; border: 1px solid transparent; border-radius: 6px; cursor: pointer;
}
.tpl-zbtn:hover { background: var(--surface-2, rgba(0,0,0,.05)); color: var(--text); }
.tpl-zreset { border-color: var(--border); }
.tpl-zpct {
  min-width: 46px; text-align: center; font-size: 12.5px; font-weight: 600;
  color: var(--text-2); font-variant-numeric: tabular-nums;
}
/* v0.33：百分比改成**可填**数字框（100~200）。
   ★ `.input { width:100%; height:36px }` 是全站默认，这里必须逐条盖掉 ——
     不盖的话数字框会把整条视野控制器撑成 36px 高、并把「视野复原」挤出去。 */
.tpl-zfield { display: inline-flex; align-items: center; gap: 1px; }
.tpl-zin {
  width: 46px; height: 24px; padding: 0 2px 0 6px;
  font-size: 12.5px; font-weight: 600; font-variant-numeric: tabular-nums;
  color: var(--text); text-align: right;
  background: var(--surface-2, rgba(0,0,0,.04));
  border: 1px solid var(--border); border-radius: 6px;
  -moz-appearance: textfield;                 /* Firefox 去掉数字框自带的上下箭头 */
}
.tpl-zin::-webkit-outer-spin-button,
.tpl-zin::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.tpl-zin:focus { outline: none; border-color: var(--accent); background: var(--surface); }
.tpl-zunit { font-size: 12px; color: var(--text-2); padding-right: 2px; }
/* 「?」说明按钮 + 说明卡 */
.tpl-zhelp { border-color: var(--border); border-radius: 50%; font-weight: 700; }
.tpl-zhelp.on { background: var(--accent); color: #fff; border-color: var(--accent); }
.tpl-zpop {
  position: absolute; right: 0; top: calc(100% + 8px); z-index: 4;
  width: 320px; padding: 10px 12px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow, 0 8px 24px rgba(0,0,0,.14));
  font-size: 12.5px; line-height: 1.75; color: var(--text-2); text-align: left;
}
/* ★ 折叠区块写 display:flex 必补 `[hidden]{display:none}` —— 不然 hidden 属性被 display 盖掉，
   说明卡一进页面就是展开的（老坑）。 */
.tpl-zpop[hidden] { display: none; }
/* v0.52b：品名角标插入小面板（原内联 display:inline-flex 压过 hidden 属性 →
   面板永远摊开、点「⁺ 插入角标」看起来没反应 —— 同一个坑，铁律 12 再实锤）。 */
.tpl-simfn {
  display: inline-flex; gap: 8px; align-items: center;
  margin-left: 8px; flex-wrap: wrap; vertical-align: middle;
}
.tpl-simfn[hidden] { display: none; }
/* v0.52g：贴片编辑器品名角标小面板（品名框聚焦出现、焦点离开收起）。
   ★ 同 v0.52b .tpl-simfn 的坑：display:flex 内联写会压过 hidden → 面板常驻摊开。 */
.stk-fnbox {
  display: flex; gap: 10px; align-items: center;
  margin-top: 6px; flex-wrap: wrap;
}
.stk-fnbox[hidden] { display: none; }
.tpl-zpop-hd { font-weight: 700; color: var(--text); margin-bottom: 4px; }
.tpl-zpop-ul { margin: 0; padding-left: 18px; }
.tpl-zpop-ul b { color: var(--text); }
.tpl-zpop-ft {
  margin-top: 6px; padding-top: 6px; border-top: 1px dashed var(--border);
  font-size: 12px; color: var(--text-2);
}
/* （9/18 需求 2）tpl-stage-note 说明卡已删，规则一并移除。 */

/* 下方两栏：左＝选中元素的属性（吃掉剩余宽度），右＝元素清单（固定宽）。
   align-items:stretch ⇒ 两张卡片**等高**（用户要的「和属性区齐高」）；
   ★ min-height:0 是内滚的前提 —— flex 子项默认 min-height:auto 会被内容顶开，
     写了 overflow:auto 也不会滚，而是把整页撑高（老坑）。 */
/* flex-basis 0 + grow 1：基准高度当 0 看，剩余空间全给它（不是按内容算）。
   `min-height: 180px` 是**给舞台让路的下限** —— 实测 1366×800（很常见的笔记本）
   下限取 260 时舞台只剩 273px（贴片要 315px）→ 100% 视野就被裁；
   取 180 时舞台拿到 333px，贴片完整可见。面板再矮也能内部滚，画布裁了就调不了版式。 */
.tpl-lower { flex: 1 1 0; min-height: 180px; display: flex; align-items: stretch; gap: 16px; min-width: 0; }
.tpl-prop-sec { flex: 1 1 auto; min-width: 0; min-height: 0; overflow: auto; }
.tpl-panel {
  flex: 0 0 340px; min-width: 0; min-height: 0;
  display: flex; flex-direction: column; gap: 14px;
}
/* 清单 16 项比属性区高 —— 它自己内部滚 */
.tpl-panel > .tpl-panel-sec { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; }
.tpl-panel .tpl-blocklist { flex: 1 1 auto; min-height: 0; overflow: auto; }
.tpl-panel-sec {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow-sm);
  padding: 14px 16px;
}
.tpl-panel-head { font-size: 14px; font-weight: 700; color: var(--text); margin-bottom: 10px; }
.tpl-panel-head .hint { font-weight: 400; margin-left: 6px; }

/* 元素清单：点选导航。画布上没有这个元素时（非新品 / 非 UNISEX / 占位图只在缺素材时出现）压暗但仍可选 */
.tpl-blocklist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.tpl-blk {
  display: flex; align-items: center; gap: 9px;
  padding: 6px 9px; border-radius: var(--radius-sm); border: 1px solid transparent;
  font-size: 13px; color: var(--text-2); cursor: pointer;
}
.tpl-blk:hover { background: var(--surface-2); color: var(--text); }
.tpl-blk.on {
  background: var(--accent-soft); border-color: var(--accent);
  color: var(--accent); font-weight: 600;
}
.tpl-blk-no {
  flex: 0 0 auto; width: 20px; height: 20px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: var(--border); color: var(--text-2); font-size: 11px; font-weight: 700;
}
.tpl-blk.on .tpl-blk-no { background: var(--accent); color: #fff; }
.tpl-blk-nm { flex: 1 1 auto; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* 「已单独指定字体」的小圆点。★ 不要给它写 display —— 会压过 [hidden] 的 UA 样式 */
.tpl-blk-dot { flex: 0 0 auto; width: 7px; height: 7px; border-radius: 50%; background: var(--info); }
.tpl-blk-off .tpl-blk-nm { color: var(--text-3); }
.tpl-blk-off .tpl-blk-no { opacity: .45; }

/* —— v0.30（需求 8/9）：功能分组 + 二级元素 ——
   · `.tpl-blk-child` 二级元素：缩进 + 左侧竖线，一眼看出「它属于上面那一行」
   · `.tpl-blk-anc`  选中二级元素时，它的**祖先**也点亮（面包屑的镜像，告诉你停在哪一组）
   · `.tpl-blk-ov`   这个元素改过（版式 或 字体）—— 扫一眼就知道哪几处动过 */
.tpl-blk-child { margin-left: 20px; padding-left: 9px; border-left: 2px solid var(--border); border-radius: 0 6px 6px 0; }
.tpl-blk-anc { background: var(--surface-2); color: var(--text); }
.tpl-blk-anc .tpl-blk-no { background: var(--border-strong, var(--border)); }
.tpl-blk-ov .tpl-blk-nm { font-weight: 600; }
.tpl-blk-ov .tpl-blk-nm::after {
  content: ''; display: inline-block; width: 6px; height: 6px; border-radius: 50%;
  background: var(--accent); margin-left: 7px; vertical-align: 1px;
}
/* 变体标签（两种模式 / 按数量变）—— 说明这个区块不只一种长相 */
.tpl-blk-var {
  flex: 0 0 auto; font-size: 10.5px; font-weight: 600; padding: 1px 7px; border-radius: 20px;
  background: var(--surface-2); border: 1px solid var(--border); color: var(--text-3);
}

/* 区块 0：背景参考图。在清单最上方，和真实元素用同一套行高，但 subtly 区分 */
.tpl-blk-bg .tpl-blk-no { background: var(--surface-3); color: var(--text-3); }
.tpl-blk-bg.on .tpl-blk-no { background: var(--accent); color: #fff; }

/* 分组小标题（9 个功能组）。它是一个 li，但不是可选项 ——
   点击处理器按 `.tpl-blk` 找目标，所以这里天然不会被选中 */
.tpl-grp {
  display: flex; align-items: baseline; gap: 8px;
  margin: 11px 0 4px; padding: 0 9px;
  font-size: 11.5px; font-weight: 700; color: var(--text-3); letter-spacing: .5px;
}
.tpl-grp:first-child { margin-top: 0; }
.tpl-grp .hint { font-weight: 400; letter-spacing: 0; }

/* —— 选中元素的属性（在画布下方，宽度富余 → 横排）—— */
.tpl-prop-head { display: flex; align-items: center; gap: 10px; margin-bottom: 9px; }
.tpl-prop-head .tpl-blk-no { width: 24px; height: 24px; font-size: 12px; background: var(--accent); color: #fff; }
.tpl-prop-nm { font-size: 14.5px; font-weight: 700; color: var(--text); }
.tpl-prop-key { font-family: var(--mono); font-size: 11px; color: var(--text-3); margin-top: 1px; }
/* v0.41 需求 4 + 5：右上角从「元素类型徽标」换成「显示该元素」开关。
   类型徽标已撤（类型在那行小字里写着，占右上角不值）；开关放这里最顺手。 */
.tpl-prop-right {
  margin-left: auto; flex: 0 0 auto;
  display: flex; align-items: center; gap: 6px;
}
.tpl-prop-right .tpl-geo { margin: 0; }

/* v0.41 需求 6：描述性文案一律**悬浮才弹**（面板上不再铺整段）。
   ★ 用子元素气泡而不是 `title` 属性：原生 tooltip 要等 1 秒、还不能换行，
     帮助文案是长句子，那样根本读不了。 */
.tpl-tip {
  position: relative; display: inline-flex; align-items: center;
  margin-left: 5px; vertical-align: middle; cursor: help;
}
.tpl-tip > i {
  display: inline-flex; align-items: center; justify-content: center;
  width: 14px; height: 14px; border-radius: 50%;
  background: var(--surface-2); border: 1px solid var(--border);
  color: var(--text-3); font-size: 9.5px; font-style: normal; font-weight: 700;
  line-height: 1; letter-spacing: 0;
}
/* ★ "i" 走伪元素：字写进 DOM 会混进标题的 textContent（"UNISEX 英文i"），污染回归断言 */
.tpl-tip > i::before { content: 'i'; }
.tpl-tip > em {
  /* 气泡：默认不显示，hover / 键盘聚焦才弹。
     ★ v0.42 需求 9：`position: fixed` —— 原来是 absolute，会被属性区那条
       `overflow: auto` 的滚动容器**裁掉**（用户看到的「显示不全」）。
       fixed 元素不受祖先 overflow 裁剪，坐标由 `placeTip()` 按触发器的视口位置算，
       并且**上方放不下就翻到下方**、左右夹在视口内。 */
  display: none; position: fixed; left: 0; top: 0; z-index: 4000;
  width: 268px; max-width: 60vw; padding: 9px 11px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 9px; box-shadow: 0 8px 22px rgba(0, 0, 0, .14);
  color: var(--text-2); font-size: 12px; font-style: normal; font-weight: 400;
  line-height: 1.65; text-align: left; letter-spacing: 0; white-space: normal;
}
.tpl-tip:hover > em, .tpl-tip:focus-visible > em { display: block; }

/* —— 面包屑（需求 9）：选中二级元素时显示「父级 › 当前」，点任一级跳回去 ——
   ★ v0.38（9/19 需求 6）**废弃**：属性区里这条「父 › 子」与下方「层级」两排说的是同一件事，
     用户明确只要「层级」。要恢复请回滚这一个提交（`.tpl-crumbs` / `.tpl-crumb` 两族类
     已无人使用，此处只留注释，不再保留死样式）。 */
/*.tpl-crumbs { … } .tpl-crumb { … } */

/* —— 属性区的分段小标题（变体 / 内部参数 / 二级元素）—— */
.tpl-sub { margin-bottom: 14px; }
.tpl-sub-h {
  display: flex; align-items: baseline; gap: 8px; flex-wrap: nowrap;
  font-size: 12.5px; font-weight: 600; color: var(--text-2); margin-bottom: 8px;
}
/* ★ v0.42 需求 10：这段说明**只占一行**（原来在窄面板里折成 3 行，把下面的切换条挤下去）。
   一行放不下就截尾（ellipsis）—— 完整文案在悬浮提示里还有一份，不会丢信息。 */
.tpl-sub-h .hint { font-weight: 400; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* 层级切换条（需求 9；v0.33 改成**上下两排**：整组一排、组内一排，父与子同时显示） */
.tpl-chiprow { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.tpl-chip {
  font-size: 12px; padding: 5px 11px; border-radius: 20px; cursor: pointer;
  background: var(--surface-2); border: 1px solid var(--border); color: var(--text-2);
}
.tpl-chip:hover { color: var(--accent); border-color: var(--accent); background: var(--accent-soft); }
.tpl-chip.off { opacity: .55; }
/* ★ 当前项高亮 —— 三块同时显示却看不出停在哪一块，等于没改（用户要的「任意切换」得看得见当前态） */
.tpl-chip.on {
  background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600;
}
.tpl-chip.on:hover { color: #fff; background: var(--accent); }
.tpl-chiprow-up, .tpl-chiprow-down { margin-bottom: 6px; }
.tpl-hier-tag {
  flex: 0 0 auto; min-width: 34px; font-size: 11.5px; color: var(--text-2);
  opacity: .75; letter-spacing: .5px;
}
/* —— v0.38 需求 4：字间距格 ——
   数字框 + 常驻 `px` 后缀（后缀用绝对定位，不占输入宽度）。
   被改过（≠ 该区块的定稿基线）时描边高亮：一屏里那么多字体控件，得一眼看出哪一块没跟随基线。 */
.tpl-field-track { width: 126px; }
.tpl-track-wrap { position: relative; display: block; }
.tpl-field-track input.input { width: 100%; height: 32px; padding-right: 32px; }
.tpl-track-unit {
  position: absolute; right: 9px; top: 50%; transform: translateY(-50%);
  font-size: 11.5px; color: var(--text-3); pointer-events: none;
}
.tpl-track-wrap.on input.input { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); }

/* v0.33 模拟文案：和模拟色号同一套语义（只改预览、不落库） */
.tpl-sim .tpl-sim-ta { height: auto; min-height: 62px; padding: 6px 8px; line-height: 1.7; resize: vertical; }
.tpl-simrow { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.tpl-simrow > span {
  flex: 0 0 auto; width: 16px; text-align: center;
  font-size: 12px; color: var(--text-2); opacity: .8;
}
.tpl-sim-foot {
  display: flex; align-items: center; gap: 10px; margin-top: 8px;
  padding-top: 8px; border-top: 1px dashed var(--border);
}
.tpl-sim-info {
  flex: 1 1 auto; font-size: 12px; color: var(--text-2);
  font-variant-numeric: tabular-nums;
}
.tpl-sim-reset { height: 28px; padding: 0 10px; font-size: 12px; }

/* 未选中任何元素（需求 1：点画布空白处取消聚焦）——
   ★ 别留空面板：空白会被当成「页面坏了」 */
.tpl-prop-empty { padding: 6px 2px; }
.tpl-prop-empty-t { font-size: 14px; font-weight: 700; color: var(--text); margin-bottom: 8px; }
.tpl-prop-empty .hint { display: block; line-height: 1.85; }
.tpl-prop-empty-h {
  margin-top: 12px; padding-top: 10px; border-top: 1px dashed var(--border);
  font-size: 12px; color: var(--text-3);
}

/* 字体字段：画布下方这一栏有 800+px，两个下拉并排就够，不必竖着堆 */
.tpl-fields { display: flex; flex-wrap: wrap; gap: 14px; align-items: end; }
.tpl-field { display: flex; flex-direction: column; gap: 4px; min-width: 0; width: 240px; }
.tpl-field > span { font-size: 12px; color: var(--text-2); }
.tpl-field select.input { width: 100%; height: 32px; }
.tpl-field-wide { grid-column: 1 / -1; max-width: 420px; }
/* v0.45：合作 logo「下拉 + 上传自定义图」一行（.tpl-field 竖排布局里嵌一行横排） */
.tpl-logo-row .tpl-logo-controls { display: flex; gap: 8px; align-items: center; width: 100%; }
.tpl-logo-row .tpl-logo-controls select.input { flex: 1; width: auto; min-width: 0; }
.tpl-logo-row .tpl-logo-controls .tpl-logo-up { flex: none; white-space: nowrap; }

/* 图形元素：没有文字 → 不显示字体字段，写清楚为什么 + 什么时候能调 */
.tpl-nofont {
  font-size: 12.5px; color: var(--text-2); line-height: 1.75;
  background: var(--surface-2); border: 1px dashed var(--border);
  border-radius: var(--radius-sm); padding: 10px 13px;
}
.tpl-nofont b { color: var(--text); }

.tpl-actions { display: flex; align-items: center; gap: 8px; margin-top: 14px; }
.tpl-actions .hint { margin-left: auto; }
/* 有未保存改动：左边缘一条品牌色竖线（同字体管理页的脏行提示，一处都不用新概念） */
.tpl-panel-sec.dirty { box-shadow: inset 3px 0 0 var(--accent), var(--shadow-sm); }

/* 位置与尺寸（图形元素可改；文字区块仍是实测只读）。
   语义：改「距右 / 距下」= 平移（宽高不动），所以六格都是 px 输入框。 */
.tpl-meta { margin-top: 15px; padding-top: 12px; border-top: 1px dashed var(--border); }
.tpl-meta-head { font-size: 12.5px; font-weight: 600; color: var(--text-2); margin-bottom: 9px; }
.tpl-meta-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px; max-width: 820px; }
/* 内部参数（数量 / 间距 / 单块尺寸…）：格子少且长短不一 → 4 列自适应，不硬凑 6 列 */
.tpl-extra { grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); max-width: 620px; }

/* 区块 0：背景参考图面板 */
.tpl-bg-panel { display: flex; flex-direction: column; gap: 10px; align-items: flex-start; max-width: 620px; }
.tpl-bg-panel .hint { margin: 0; }
.tpl-bg-panel .tpl-geo-row-chk { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.tpl-bg-name { font-size: 12px; color: var(--text-2); word-break: break-all; max-width: 100%; }
.tpl-bg-panel .btn-danger { background: var(--danger); color: #fff; border-color: var(--danger); }
/* 舞台上的参考图：在最底层，不影响元素命中；默认半透明一点，避免压住设计元素 */
.tpl-stage-bg { opacity: .95; pointer-events: none; }

/* 模拟色号（v0.31 需求 3）：n 个色 = n 个颜色输入框。
   ★ 圆角方块 + 编号，直接对标画布上那一条色卡列，一眼能对上第几块。 */
.tpl-sws { display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-start; }
.tpl-sw { display: flex; flex-direction: column; align-items: center; gap: 2px; cursor: pointer; }
.tpl-sw > span { font-size: 10.5px; color: var(--text-3); font-variant-numeric: tabular-nums; }
.tpl-sw-in {
  width: 38px; height: 38px; padding: 0; cursor: pointer;
  border: 1px solid var(--border); border-radius: 6px; background: none;
}
.tpl-sw-in::-webkit-color-swatch-wrapper { padding: 2px; }
.tpl-sw-in::-webkit-color-swatch { border: none; border-radius: 4px; }
.tpl-geo { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
/* v0.46（用户需求 4/5）：标题统一在**输入框上方**、左对齐，ⓘ 紧跟标题右侧。
   原来 `.tpl-geo > span` 是「标题在下面居中」，与「排列方式」那类标题在上的排法打架。 */
.tpl-geo > span { font-size: 11px; color: var(--text-3); text-align: left; }
.tpl-geo-lb { display: flex; align-items: center; gap: 4px; font-size: 11px; color: var(--text-3); text-align: left; min-height: 16px; }
.tpl-field .tpl-geo-lb { font-size: 12px; color: var(--text-2); }
/* 勾选型内部参数（合作 logo 显隐）：横排，别做成 120px 的窄框 */
.tpl-geo-wide {
  flex-direction: row; align-items: center; gap: 8px;
  grid-column: 1 / -1; padding: 6px 0;
}
.tpl-geo-wide > span { font-size: 12.5px; color: var(--text-2); text-align: left; }
.tpl-geo-chk { width: 16px; height: 16px; accent-color: var(--accent); cursor: pointer; }
/* v0.50：文字块背景 —— 拾色器 + 「显示」开关同一行（tpl-field 是竖排，里面嵌横排） */
.tpl-field .tpl-bg-on {
  display: flex; align-items: center; gap: 6px;
  font-size: 12px; color: var(--text-2); cursor: pointer; user-select: none;
}
.tpl-field .tpl-bg-on:hover { color: var(--text-1, var(--text-2)); }
/* v0.39：拾色器（背景卡底色 / 描边色 / 投影色 / 竖线色）。
   ★ 高度必须和 .tpl-geo-in 对齐（34px）—— 它们同处一个网格，差几 px 整行就歪。 */
.tpl-geo-color {
  width: 100%; height: 34px; padding: 2px; cursor: pointer;
  border: 1px solid var(--line, rgba(0, 0, 0, .14)); border-radius: 6px;
  background: transparent;
}
.tpl-geo-color::-webkit-color-swatch-wrapper { padding: 0; }
.tpl-geo-color::-webkit-color-swatch { border: none; border-radius: 4px; }
.tpl-geo.off .tpl-geo-color { cursor: not-allowed; }
.tpl-geo-in {
  width: 100%; height: 34px; text-align: center;
  font-size: 14px; font-weight: 600; font-variant-numeric: tabular-nums;
}
/* 不可编辑的轴（如色卡的距上/距下、文字区块的宽/高）：压暗 + 禁用 + title 说明原因 */
.tpl-geo.off { opacity: .5; }
/* 文字区块的「字号 + 文案」行：文案是长文本，给足宽度（2 列：字号窄 / 文案宽） */
.tpl-textrow { grid-template-columns: 140px minmax(0, 1fr); margin-bottom: 10px; }
.tpl-geo-text .tpl-geo-in { text-align: left; font-weight: 500; padding: 0 10px; }
.tpl-geo-text > span { text-align: left; }
.tpl-geo.off .tpl-geo-in { cursor: not-allowed; }
/* （模板名现在走顶栏面包屑 `模板管理 › 模板名`，这里的 .tpl-name-inline 已随
   v0.38 的顶栏合并一起删掉 —— 同一个名字在两处各显示一遍是噪音。） */

/* —— 画布上的区块框（SVG 内，3000px 画布坐标；随 SVG 等比缩放）——
   v0.37：改成贴边蓝框，与边距示意框同源，不再用带 padding 的红虚线。 */
.blk-frame {
  fill: rgba(47, 111, 237, .08);
  stroke: #2f6fed; stroke-width: 5;
}
.blk-badge { fill: #2f6fed; }
.blk-badge-tx { fill: #fff; font-size: 32px; font-weight: 700; }

/* —— v0.29 阶段 2-D：拖拽 + 取景式边距 HUD ——
   拖动元素时在贴片上画**四条引导虚线 + 四边距离数字**（画布 px），像取景镜；
   中心十字压到画布中线（±8px）变绿 = 已对齐；和其它元素重叠 → 整层转红并提示「松手将撤销」。
   ★ 这些坐标是 **3000px 画布坐标**（跟着 SVG viewBox 一起缩放），别按屏幕 px 的直觉写数值。
   ★ `cursor` 只能加在容器上：SVG 会被整块重建，挂它自己会一次次丢掉 class。 */
.tpl-host.can-drag svg { cursor: move; }
.tpl-host.drag-on svg { cursor: grabbing; }
.tpl-host.drag-on { user-select: none; }
.tpl-hud { pointer-events: none; }
.tpl-hud-line { fill: none; stroke: #2f6fed; stroke-width: 3; stroke-dasharray: 14 10; }
.tpl-hud-line.on { stroke: #12a150; stroke-width: 5; stroke-dasharray: none; }
.tpl-hud-cross { fill: none; stroke: #2f6fed; stroke-width: 3; }
.tpl-hud-cross.on { stroke: #12a150; stroke-width: 5; }
.tpl-hud-box { fill: none; stroke: #2f6fed; stroke-width: 3; }
/* 数字用「白描边 + 彩色填充」（paint-order）—— 免得被贴片上的图压得看不清 */
.tpl-hud-tx {
  fill: #2f6fed; font-size: 36px; font-weight: 700;
  paint-order: stroke; stroke: #fff; stroke-width: 7px; stroke-linejoin: round;
}
.tpl-hud-tx.on { fill: #12a150; }
.tpl-hud-warn-bg { fill: #d0021b; }
.tpl-hud-warn-tx { fill: #fff; font-size: 32px; font-weight: 700; }
.tpl-hud.is-bad .tpl-hud-line,
.tpl-hud.is-bad .tpl-hud-cross,
.tpl-hud.is-bad .tpl-hud-box { stroke: #d0021b; }
.tpl-hud.is-bad .tpl-hud-tx { fill: #d0021b; }

/* —— 原型线框图：v0.32 已整块移除（用户 9/18「用不到，先去了」）——
   原 `.wire-canvas / .wire-box / .wire-no / .wire-lb / .wire-sub` 五条规则
   随 engine/wireframe.js 一起删掉。要恢复请用 git 回滚这一个提交。 */

/* —— 模板列表底部说明卡：v0.34 整块移除（用户 9/18「这个去掉」）——
   原 `.tpl-note / -title / -sub / -list` 五条规则随之删掉。
   教训：那张卡当年是当「诚实占位」用的（阶段 2 前告诉用户还差哪几步），
   阶段做完之后它就变成了一份没人维护的规格说明书 —— 内容越长越像文档，越像文档越没人看。 */

/* ==================== v0.36 登录体系 / 我的 / 用户管理 / 回收站 ==================== */

/* —— 登录页 —— */
.auth-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: var(--bg); padding: 24px; }
.auth-card { width: 380px; background: var(--surface); border: 1px solid var(--border);
  border-radius: 14px; box-shadow: 0 10px 40px rgba(15, 20, 25, .08); padding: 28px 26px 22px; }
.auth-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; }
.auth-brand .logo { width: 38px; height: 38px; border-radius: 9px; background: var(--accent); color: #fff;
  display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 19px; }
.auth-brand .name { font-size: 15px; font-weight: 600; }
.auth-brand .sub { font-size: 11px; color: var(--text-3); letter-spacing: .06em; }
.auth-tabs { display: flex; gap: 6px; margin-bottom: 14px; border-bottom: 1px solid var(--border); }
.auth-tab { border: 0; background: none; padding: 8px 12px; font-size: 13px; color: var(--text-2);
  cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.auth-tab.on { color: var(--text); font-weight: 600; border-bottom-color: var(--accent); }
.auth-err { background: var(--accent-soft); color: var(--accent); border-radius: var(--radius-sm);
  padding: 8px 10px; font-size: 12.5px; margin: 4px 0 10px; }
.auth-foot { margin-top: 12px; text-align: center; font-size: 12px; }

/* —— 通用小件（v0.36 新增页面共用） —— */
.fld { display: flex; flex-direction: column; gap: 5px; font-size: 12.5px; color: var(--text-2); }
.form-grid { display: flex; flex-direction: column; gap: 12px; padding: 4px 0; }
.form-actions { display: flex; gap: 8px; }
.btn-block { width: 100%; justify-content: center; }
.input.sm { height: 28px; font-size: 12.5px; padding: 0 6px; }
.empty-sm { padding: 14px; text-align: center; color: var(--text-3); font-size: 12.5px; }
.danger-text { color: var(--accent); font-weight: 600; }
.role-tag { display: inline-block; padding: 1px 7px; border-radius: 999px; font-size: 11.5px;
  background: var(--info-soft); color: var(--info); border: 1px solid rgba(31, 95, 169, .18); }
.role-tag.warn { background: var(--warn-soft); color: var(--warn); border-color: var(--warn-border); }
.notice { padding: 10px 12px; border-radius: var(--radius-sm); font-size: 13px; margin-bottom: 12px;
  background: var(--ok-soft); color: var(--ok); border: 1px solid rgba(21, 127, 77, .2); }
.notice.warn { background: var(--warn-soft); color: var(--warn); border-color: var(--warn-border); }
.pwd-cell { background: var(--surface-2); border: 1px solid var(--border); border-radius: 5px;
  padding: 1px 6px; font-size: 12.5px; user-select: all; }
.kv-rows { display: flex; flex-direction: column; gap: 7px; margin-top: 12px; font-size: 12.5px; }
.kv-rows > div { display: flex; justify-content: space-between; color: var(--text-2); }
.kv-rows b { color: var(--text); font-weight: 600; }

/* —— 头像（v0.38）：底座终于补上了 ——
   原来只有 `.avatar.sm / .lg` 两个**尺寸修饰**，没有任何底色 / 圆角 / 居中，
   于是顶栏那个头像与「我的」页渲染出来都是一个裸字符。现在补上圆形底座，
   尺寸修饰照旧覆盖宽高。 */
.avatar {
  width: 34px; height: 34px; border-radius: 50%; flex: 0 0 auto;
  background: linear-gradient(135deg, #2F6BFF, #7AA2FF); color: #fff;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 600; line-height: 1; user-select: none;
}
.avatar.sm { width: 22px; height: 22px; font-size: 11px; }
.avatar.lg { width: 46px; height: 46px; font-size: 19px; }

/* （v0.38 已删）顶栏胶囊用户区 `.who-chip`：账号区整个挪到了左侧栏底部 `.side-account`，
   顶栏右上角从此只放页面级操作。要恢复的话，把这段加回来 + 在 shell.js 的顶栏里
   重新渲染 `<a class="who-chip" href="#/me">` 即可。
.who-chip { display: flex; align-items: center; gap: 7px; padding: 3px 10px 3px 4px;
  border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border);
  color: inherit; text-decoration: none; font-size: 12.5px; }
.who-chip:hover { border-color: var(--border-strong); }
*/

/* —— 【我的】 —— */
.me-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.me-who { display: flex; align-items: center; gap: 12px; }
.me-name { font-size: 15px; font-weight: 600; }

/* —— 动作记录 —— */
.act-panel { margin-top: 14px; }
.act-table td { font-size: 12.5px; }
.act-time { color: var(--text-3); }
.act-who { color: var(--text-2); }
.act-detail { color: var(--text-3); }
.act-tag { display: inline-block; padding: 1px 7px; border-radius: 5px; background: var(--surface-2);
  border: 1px solid var(--border); margin-right: 6px; }

/* ★ 危险按钮：`.danger` 是**独立类**（不是 .btn-danger 的变体）—— 用户管理里
   「删除」要跟同行的「重置密码」明显区分开，红色描边 + 红字，不填满。 */
.btn.danger { color: var(--accent); border-color: rgba(208, 2, 27, .35); background: var(--surface); }
.btn.danger:hover { background: var(--accent-soft); border-color: var(--accent); }

/* ===== v0.53 UI 试点（.ui-v2）：只作用于 4 个试点页，其余视图零影响 =====
   只新增规则、不改任何旧规则；不动 display/position/flex/width/height/overflow/transform。 */
/* 1) 文案清空后不留空洞；JS 写入内容时 :empty 自动失效、照常显示 */
.ui-v2 .hint:empty,
.ui-v2 .sub:empty,
.ui-v2 .dim:empty,
.ui-v2 .zone-hint:empty,
.ui-v2 .tpl-sub-h .hint:empty { display: none; }
/* 2) 次要说明收敛到同一层级，减少字号 / 颜色噪音 */
.ui-v2 .hint,
.ui-v2 .sub,
.ui-v2 .dim { font-size: 12px; line-height: 1.5; color: var(--text-3); }
.ui-v2 .ctrl .hint { margin-top: 6px; }
/* 3) 去掉一层装饰：卡片阴影 + 底部说明块的灰底 */
.ui-v2 .card { box-shadow: none; }
.ui-v2 .note-block { background: transparent; }

/* v0.53 折叠预览：.sticker-stage 自身是 display:flex，会盖掉 UA 的 [hidden] 规则，
   必须显式补一条（否则点了「收起预览」画面不动）。 */
.sticker-stage[hidden] { display: none; }

/* ===== #/me「我的角色」专属美化（作用域锁死 #rolePanel，其余视图零影响） =====
   根因：原表写 class="table"，但全站表格样式挂在 table.data 上 → 整张表裸奔。
   只新增 #rolePanel 作用域规则，不改任何旧规则、不动其他容器布局属性。 */
#rolePanel .role-who { margin: 6px 0 14px; }
#rolePanel .role-who .avatar { width: 42px; height: 42px; font-size: 17px; }
#rolePanel .role-who .me-name { font-size: 16px; }
#rolePanel .role-table { font-size: 13px; }
#rolePanel .role-table th:first-child { width: 108px; }
#rolePanel .role-table td { padding: 11px 12px; }
#rolePanel .role-table td:first-child { white-space: nowrap; }
#rolePanel .role-row.is-current { background: var(--accent-soft); }
#rolePanel .role-row.is-current td:first-child { box-shadow: inset 3px 0 0 var(--accent); }
#rolePanel .role-chip {
  display: inline-block; padding: 2px 9px; border-radius: 999px;
  font-size: 12.5px; font-weight: 600; white-space: nowrap;
  background: var(--surface-2); color: var(--text-2); border: 1px solid var(--border);
}
#rolePanel .role-row.is-current .role-chip {
  background: #fff; color: var(--accent); border-color: rgba(208, 2, 27, .28);
}
#rolePanel .role-can { color: var(--text-2); line-height: 1.6; }
#rolePanel .role-note {
  margin-top: 12px; padding: 9px 12px; border-radius: var(--radius-sm);
  font-size: 12.5px; line-height: 1.6; color: var(--text-2);
  background: var(--surface-2); border: 1px solid var(--border);
  border-left: 3px solid var(--border-strong);
}
