/* 页面布局。token 和基础组件在 ui.css。 */

/* ---- 登录 ---- */
/* 会话没确认前先藏住工作台，避免闪一下空首页再弹登录 */
body.booting > .side, body.booting > .topbar, body.booting > main { visibility: hidden; }
.login-gate {
  position: fixed; inset: 0; z-index: 40; display: grid; place-items: center;
  padding: 24px 16px; overflow-y: auto; background: var(--bg);
}
.login-gate.hidden { display: none; }
.login-card {
  width: min(380px, 100%); display: flex; flex-direction: column; gap: 16px;
  padding: 32px 28px 24px; background: var(--panel);
  border: 1px solid var(--line); border-radius: var(--radius-lg);
  box-shadow: 0 1px 2px rgba(22, 23, 26, .05);
}
.login-brand { display: flex; flex-direction: column; gap: 8px; margin-bottom: 8px; }
.login-brand h2 { margin: 0; color: var(--text); font-size: var(--fs-xl); font-weight: 600; letter-spacing: .01em; }
.login-brand p { margin: 0; color: var(--muted); font-size: var(--fs-md); }
.login-card .field { display: flex; flex-direction: column; gap: 8px; font-size: var(--fs-sm); color: var(--muted); }
.login-card .field > span { color: var(--text); font-weight: 500; }
.login-card .input-wrap { position: relative; display: flex; }
.login-card input { width: 100%; height: 42px; font-size: var(--fs-md); }
.login-card input[aria-invalid="true"] { border-color: var(--fail); }
.login-card .input-wrap input { padding-right: 44px; }
.login-card .pw-toggle {
  position: absolute; right: 3px; top: 3px; width: 36px; height: 36px; padding: 0;
  display: grid; place-items: center; border: 0; border-radius: 4px;
  background: transparent; color: var(--faint);
}
.login-card .pw-toggle:hover { color: var(--text); background: var(--sunk); }
.login-card .pw-toggle svg { width: 18px; height: 18px; }
.login-card .pw-toggle .eye-off { display: none; }
.login-card .pw-toggle[aria-pressed="true"] .eye { display: none; }
.login-card .pw-toggle[aria-pressed="true"] .eye-off { display: block; }
.login-err {
  margin: 0; padding: 8px 12px; border-radius: var(--radius); font-size: var(--fs-sm);
  color: var(--fail); background: var(--fail-soft);
}
.login-err[hidden] { display: none; }
.login-err.shake { animation: login-shake 320ms ease; }
@keyframes login-shake { 25%, 75% { transform: translateX(-3px); } 50% { transform: translateX(3px); } }
.login-submit {
  height: 42px; margin-top: 4px; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  text-align: center; font-size: var(--fs-md);
}
.login-submit:disabled { opacity: .75; cursor: progress; }
.login-submit .spin {
  display: none; width: 15px; height: 15px; border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, .35); border-top-color: #fff;
  animation: ui-spin .7s linear infinite;
}
.login-submit.busy .spin { display: inline-block; }
.login-foot { margin: 4px 0 0; color: var(--faint); font-size: var(--fs-xs); }
@media (max-width: 480px) { .login-card { padding: 24px 20px 20px; } }
@media (prefers-reduced-motion: reduce) { .login-err.shake { animation: none; } }

* { box-sizing: border-box; }
html, body { margin: 0; height: 100dvh; overflow: hidden; background: var(--bg); color: var(--text);
  font: 14px/1.5 var(--font); color-scheme: light; -webkit-font-smoothing: antialiased; }
body { display: flex; flex-direction: column; }
::selection { background: var(--accent-soft); }

/* ---- 应用外框：左侧栏（品牌 / 模块导航 / 左下角积分和账号）+ 只在窄屏和任务编辑时出现的细顶栏 ---- */
:root { --side-w: 232px; }
.side {
  position: fixed; top: 0; bottom: 0; left: 0; z-index: 30; width: var(--side-w);
  display: flex; flex-direction: column; background: var(--rail); border-right: 1px solid var(--line);
}
.side-brand {
  flex-shrink: 0; display: flex; align-items: center; gap: 8px; width: 100%; padding: 16px 20px 8px;
  border: 0; border-radius: 0; background: none; text-align: left; font-size: var(--fs-md); font-weight: 600; color: var(--text);
}
.side-brand:hover { border: 0; }
/* 标志：深墨方块里一格抠像蓝——「片子里有一段换成了 AI」 */
.side-mark { position: relative; flex-shrink: 0; width: 20px; height: 20px; border-radius: 6px; background: var(--text); }
.side-mark::after { content: ""; position: absolute; left: 8px; top: 5px; width: 4px; height: 10px; border-radius: 1px; background: var(--accent); box-shadow: -4px 0 0 rgba(255, 255, 255, .85), 4px 0 0 rgba(255, 255, 255, .85); }
.side-nav { flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; padding: 4px 12px 8px; scrollbar-width: none; }
.side-nav::-webkit-scrollbar { display: none; }
/* 菜单按模块分区：每组都有标题；整组没开通由 paintMenuGate 藏掉（.menu-group[hidden]） */
.menu-group + .menu-group { margin-top: 8px; }
.menu-title { margin: 0; padding: 4px 8px; font-size: var(--fs-xs); color: var(--faint); }
.ni { flex-shrink: 0; width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.side-nav button, .side-points {
  display: flex; align-items: center; gap: 12px; width: 100%; min-height: 32px; padding: 4px 8px;
  border: 1px solid transparent; border-radius: var(--radius); background: none;
  color: var(--muted); font-size: var(--fs-md); white-space: nowrap; text-align: left;
}
.side-nav button:hover, .side-points:hover { color: var(--text); background: rgba(22, 23, 26, .05); border-color: transparent; }
.side-nav button.on { color: var(--text); font-weight: 600; background: var(--panel); border-color: var(--line); box-shadow: 0 1px 2px rgba(22, 23, 26, .04); }
.side-nav button.on .ni { color: var(--text); }
/* 左下角：积分一行（点开控制台）+ 账号按钮（点开菜单：积分和用量、退出登录） */
.side-foot { flex-shrink: 0; display: flex; flex-direction: column; gap: 4px; padding: 8px 12px; border-top: 1px solid var(--line); }
.side-points span { flex: 1; }
.side-points b { font-weight: 600; color: var(--text); font-variant-numeric: tabular-nums; }
.side-points.off { display: none; }
.side-acct { position: relative; }
.side-me {
  display: flex; align-items: center; gap: 8px; width: 100%; min-width: 0; padding: 8px;
  border: 1px solid transparent; border-radius: var(--radius); background: none; text-align: left; color: var(--muted);
}
.side-me:hover, .side-me[aria-expanded="true"] { background: rgba(22, 23, 26, .05); border-color: transparent; }
.side-av {
  flex-shrink: 0; width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center;
  background: var(--text); color: var(--panel); font-size: var(--fs-sm); font-weight: 600;
}
.side-me-t { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.3; }
.side-me-t b, .side-me-t small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-me-t b { font-size: var(--fs-md); font-weight: 600; color: var(--text); }
.side-me-t small { font-size: var(--fs-xs); color: var(--muted); }
/* 侧栏账号菜单：ui.css 的 .menu，向上弹出 */
.side-foot .menu { top: auto; bottom: calc(100% + var(--sp-1)); left: 0; right: 0; }
.side-foot .menu > button { min-height: 36px; font-size: var(--fs-md); }
.side-scrim { display: none; }

.topbar { flex-shrink: 0; border-bottom: 1px solid var(--line); background: var(--panel); position: sticky; top: 0; z-index: 8; }
.bar-row { display: flex; align-items: center; gap: 4px; padding: 0 16px; min-height: 48px; }
.menu-btn { display: inline-flex; align-items: center; gap: 8px; width: auto; flex-shrink: 0; padding: 8px 12px; font-size: var(--fs-sm); color: var(--muted); }
.menu-btn:hover { color: var(--text); }
.bar-brand { flex-shrink: 0; margin-left: 12px; font-size: var(--fs-md); font-weight: 600; letter-spacing: .02em; }
body.task-mode .bar-brand { display: none; }

/* 宽屏不在任务里：侧栏常驻，没有顶栏；进任务编辑让出整宽，侧栏收成抽屉 */
@media (min-width: 1100px) {
  body:not(.task-mode) .topbar { display: none; }
  body:not(.task-mode) main { margin-left: var(--side-w); }
}
@media (max-width: 1099px) { .side { transform: translateX(-100%); } }
body.task-mode .side { transform: translateX(-100%); }
.side { transition: transform 200ms ease-out; }
body.side-open .side { transform: none; box-shadow: var(--shadow-pop); }
/* 窄屏是触屏：侧栏里能点的东西都给够 44px */
@media (max-width: 1099px) {
  .side-nav button, .side-points, .side-me, .side-foot .menu button, .menu-btn { min-height: 44px; }
}
body.side-open .side-scrim { display: block; position: fixed; inset: 0; z-index: 29; background: rgba(20, 20, 18, .28); }

.bar-task { flex: 1; min-width: 0; display: flex; align-items: center; gap: 12px; margin-left: 12px; }
body:not(.task-mode) .bar-task > .bar-title { display: none; }
.bar-title {
  font-size: var(--fs-md); font-weight: 600; margin: 0; min-width: 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
body.task-mode .bar-task { padding-left: 16px; border-left: 1px solid var(--line); }
.back-link {
  display: inline-flex; align-items: center; gap: 4px; flex-shrink: 0;
  padding: 4px 0; width: auto; border: 0; background: none; color: var(--muted);
}
.back-link::before { content: "‹"; font-size: var(--fs-lg); line-height: 1; margin-top: -2px; }
.back-link:hover { color: var(--text); }
#btn-home.off, body:not(.task-mode) #btn-home { display: none; }
.topbar .tag { flex-shrink: 0; align-self: center; min-width: 3.2em; text-align: center; justify-content: center; gap: var(--sp-2); }
.topbar .tag.off { display: none; }
.bar-elapsed { flex-shrink: 0; font-size: var(--fs-xs); color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.bar-elapsed.off { display: none; }

/* 裸按钮的中性重置：组件样式都在 ui.css（.btn/.seg 等），这里只管继承字体和手型。
   需要铺满宽度的地方（侧栏导航、列表项）在各自规则里写 width:100% */
button {
  font: inherit; cursor: pointer; border: 0;
  background: none; color: inherit; padding: 0; border-radius: 0;
}
/* 人物库：融合用的参考脸，每张下面写取哪部分；太像的那张标出来 */
.ppl-refs { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 8px; }
.ppl-ref { margin: 0; display: flex; flex-direction: column; gap: 4px; }
.lib-side .ppl-refs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.ppl-ref img { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; border-radius: 6px; border: 1px solid var(--line); background: #fff; }
.ppl-ref.hot img { border: 2px solid var(--run); }
.ppl-ref figcaption { font-size: var(--fs-xs); color: var(--muted); }
.ppl-ref input { width: 100%; box-sizing: border-box; font-size: var(--fs-xs); }
.ppl-warn { margin: 0 0 8px; padding: 8px 12px; border-radius: var(--radius); background: var(--run-soft); color: var(--run); font-size: var(--fs-sm); }
/* 货库：每张图右上角 ✕ 单张删 */
.lib-img { position: relative; display: block; }
.lib-img-x { position: absolute; top: 4px; right: 4px; width: 22px; height: 22px; padding: 0; text-align: center; line-height: 20px; font-size: var(--fs-xs); border-radius: 50%; background: rgba(22, 23, 26, .72); color: #fff; border: none; }
.lib-img-x:hover:not(:disabled) { background: var(--fail); }
button:disabled {
  opacity: 0.42; cursor: not-allowed; filter: none;
}
select:disabled, textarea:disabled, input:disabled {
  opacity: 0.55; cursor: not-allowed;
}
/* 抠像蓝只给「让 AI 出画面」的动作：ui.css 的 .btn-ai */
.back { width: auto; }
button:focus-visible, a:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 1px;
}
a { color: var(--accent-ink); }
.board {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(184px, 1fr));
  gap: 16px;
  align-items: start;
  max-width: 1480px;
  padding: 0 0 32px;
}
.board-tasks { display: contents; }
#home-seg { margin-left: 12px; }
/* 首页还没任务：告诉新人先去货库建货 */
.home-guide { grid-column: 1 / -1; align-self: start; max-width: 560px; padding: 20px 20px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius-lg); }
.home-guide-h { margin: 0 0 12px; font-size: var(--fs-sm); color: var(--muted); }
.home-guide ol { margin: 0; padding: 0; list-style: none; counter-reset: g; display: flex; flex-direction: column; gap: 16px; }
.home-guide li { counter-increment: g; display: grid; grid-template-columns: 26px minmax(0, 1fr) auto; grid-template-rows: auto auto; column-gap: 12px; align-items: center; }
.home-guide li::before { content: counter(g); grid-row: 1 / 3; width: 22px; height: 22px; border-radius: 50%; background: var(--text); color: #fff; font-size: var(--fs-xs); font-weight: 600; display: grid; place-items: center; }
.home-guide li b { font-size: var(--fs-md); }
.home-guide li span { grid-column: 2; font-size: var(--fs-sm); color: var(--muted); }
.home-guide li button { grid-column: 3; grid-row: 1 / 3; width: auto; padding: 8px 12px; font-size: var(--fs-sm); }
/* 每条任务一张卡：上面是片子（原片宫格；没宫格时放产品图），下面是标题、货、状态、时间 */
.tile {
  display: flex; flex-direction: column; padding: 0; text-align: left; position: relative; overflow: hidden;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius-lg); cursor: pointer; color: inherit;
  transition: border-color var(--ease), box-shadow var(--ease);
}
.tile:hover:not(:disabled) { border-color: var(--line-strong); box-shadow: 0 4px 16px rgba(22, 23, 26, .06); }
.tile.active { border-color: var(--accent); }
.tile-media { position: relative; display: block; }
.tile-cover {
  display: grid; gap: 1px; width: 100%; aspect-ratio: 3 / 4;
  background: var(--monitor); overflow: hidden; grid-template: 1fr / 1fr;
}
.tile-cover.n-2 { grid-template: 1fr 1fr / 1fr; }
.tile-cover.n-3 { grid-template: 2fr 1fr / 1fr 1fr; }
.tile-cover.n-3 img:first-child { grid-column: 1 / 3; grid-row: auto; }
.tile-cover.n-4 { grid-template: 1fr 1fr / 1fr 1fr; }
.tile-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.tile-cover.prod { background: var(--sunk); border-bottom: 1px solid var(--line); }
.tile-cover.prod img { object-fit: contain; padding: 12%; box-sizing: border-box; mix-blend-mode: multiply; }
.tile-cover.empty { place-items: center; color: rgba(255, 255, 255, .35); }
.tile-cover.empty .ni { width: 32px; height: 32px; stroke-width: 1.2; }
.tile-kind {
  position: absolute; top: 8px; left: 8px; padding: 2px 8px; border-radius: 4px;
  background: rgba(20, 21, 23, .72); color: #fff; font-size: var(--fs-xs); line-height: 20px;
}
.tile-body { display: flex; flex-direction: column; gap: 4px; padding: 12px; min-width: 0; }
.tile-title { font-size: var(--fs-md); font-weight: 600; line-height: 1.4; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tile-prod { font-size: var(--fs-sm); color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tile-meta { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 4px 8px; margin-top: 4px; font-size: var(--fs-xs); }
.tile-state { display: inline-flex; align-items: center; gap: 8px; min-width: 0; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tile-state::before { content: ""; flex-shrink: 0; width: 6px; height: 6px; border-radius: 50%; background: var(--faint); }
.tile-state.done::before { background: var(--ok); }
.tile-state.run { color: var(--run); }
.tile-state.run::before { background: var(--run); }
.tile-state.fail { color: var(--fail); }
.tile-state.fail::before { background: var(--fail); }
.tile-state:empty { display: none; }
.tile-time { flex-shrink: 0; color: var(--faint); font-variant-numeric: tabular-nums; white-space: nowrap; }
.tile-del {
  position: absolute; top: 8px; right: 8px; z-index: 2;
  width: 28px; height: 28px; border-radius: 4px; display: none;
  align-items: center; justify-content: center;
  background: rgba(20, 21, 23, .72); color: #fff; font-size: var(--fs-lg); line-height: 1;
}
.tile:hover .tile-del, .tile:focus-within .tile-del { display: inline-flex; }
@media (hover: none) { .tile-del { display: inline-flex; } }
.tile-del:hover { background: var(--fail); }
.tile-del.dim { color: rgba(255,255,255,.45); cursor: not-allowed; }
.tile-del.dim:hover { background: rgba(20, 21, 23, .72); }
/* 成片可下载：封面右下角的下载钮 */
.tile-dl {
  position: absolute; bottom: 8px; right: 8px; z-index: 2;
  min-width: 28px; height: 28px; padding: 0 8px; border-radius: 4px;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--text); color: #fff; font-size: var(--fs-md); line-height: 1; text-decoration: none;
}

.item { }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
main { overflow: auto; padding: 20px 24px 16px; min-width: 0; flex: 1; min-height: 0; }
body.task-mode main { padding: 8px 12px 12px; }

.panel { width: 100%; max-width: none; }
#view-create.panel { max-width: none; }
#view-config > label, #view-debug label { margin-bottom: 16px; }
#view-config textarea { font: 13px/1.6 var(--font); }
.hidden { display: none !important; }
h1 { font-size: var(--fs-2xl); font-weight: 600; margin: 0 0 8px; letter-spacing: .01em; }
h2 { font-size: var(--fs-md); margin: 16px 0 12px; color: var(--text); font-weight: 600; }

.lead { color: var(--muted); margin: 0 0 20px; max-width: 52ch; }
form { display: grid; gap: 16px; }
label { display: grid; gap: 8px; font-size: var(--fs-sm); color: var(--muted); }
input, textarea, select {
  font: inherit; background: #fff; color: var(--text);
  border: 1px solid var(--line); padding: 8px 12px; border-radius: var(--radius);
  transition: border-color var(--ease), box-shadow var(--ease);
}
input:hover, textarea:hover, select:hover { border-color: var(--line-strong); }
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
input::placeholder, textarea::placeholder { color: var(--faint); }
input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  display: block;
  width: 100%;
  height: 8px;
  margin: 12px 0 4px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: var(--line);
  accent-color: var(--accent);
}
input[type="range"]::-webkit-slider-runnable-track {
  height: 8px;
  border-radius: 999px;
  background: var(--line);
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 14px;
  height: 14px;
  margin-top: -4px;
  border: 0;
  border-radius: 50%;
  background: var(--text);
  cursor: pointer;
}
input[type="range"]::-moz-range-track {
  height: 8px;
  border-radius: 999px;
  background: var(--line);
}
input[type="range"]::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border: 0;
  border-radius: 50%;
  background: var(--text);
  cursor: pointer;
}
textarea { min-height: 72px; resize: vertical; }
form button[type="submit"] { width: auto; background: var(--text); color: #fff; border: 0; padding: 12px 20px; }
.drop {
  position: relative; display: grid; gap: 4px;
  padding: 20px 16px; border: 1px dashed var(--line); border-radius: var(--radius);
  background: var(--panel); color: var(--text); cursor: pointer;
  transition: border-color var(--ease), background var(--ease);
}
.drop:hover, .drop:focus-within { border-color: var(--accent-dim); }
.drop-label { font-size: var(--fs-sm); color: var(--muted); }
.drop-hint { font-size: var(--fs-xs); color: var(--muted); }

.drop input[type="file"] {
  position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; height: 100%;
  padding: 0; border: 0;
}
label.copy { color: var(--muted); }
.check { display: flex; align-items: center; gap: 8px; color: var(--text); }
.check input { width: auto; accent-color: var(--accent); }

.error { color: var(--fail); white-space: pre-wrap; }

/* 产品卡：一项一格，两列排 */
.card-form { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px 12px; }
.card-form .cf-scene { grid-column: 1 / -1; }
.card-form .card-group { grid-column: 1 / -1; margin: 8px 0 0; font-size: var(--fs-xs); color: var(--text); }
.card-form .card-f { color: var(--muted); font-size: var(--fs-xs); display: flex; flex-direction: column; gap: 4px; margin: 0; }
.card-form textarea { font-family: inherit !important; font-size: var(--fs-sm); line-height: 1.45; min-height: 0; padding: 8px 8px; }

.pcard-warn { font-style: normal; color: var(--run); font-size: var(--fs-xs); }

@media (max-width: 1100px) {
  .card-form { grid-template-columns: minmax(0, 1fr); }
  
}
.plan { background: var(--panel); border: 1px solid var(--line); padding: 12px 16px; border-radius: var(--radius); }
.plan h3 { margin: 0 0 8px; font-size: var(--fs-sm); }
.plan p { margin: 0 0 4px; font-size: var(--fs-xs); color: var(--muted); }
.plan .k { display: inline-block; min-width: 3em; color: var(--accent-ink); margin-right: 8px; }
.plan .prompt { margin: 8px 0 0; max-height: 160px; white-space: pre-wrap; word-break: break-word; }

.slots { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)) auto; gap: 12px; margin: 0 0 12px; align-items: end; }

.slots button { width: auto; white-space: nowrap; height: 38px; }
.slots label { min-width: 0; }
.slots select { width: 100%; min-width: 0; }
#cfg-keys { margin: 0 0 20px; }
.row-btns { display: flex; gap: 8px; margin: 8px 0 16px; }
.row-btns button { width: auto; }
.versions { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.versions li { border: 1px solid var(--line); padding: 8px 12px; display: flex; justify-content: space-between; gap: 8px; font-size: var(--fs-sm); border-radius: var(--radius); }
.versions li { background: var(--panel); }
.versions li.on { border-color: var(--accent); box-shadow: inset 3px 0 0 var(--accent); }
.versions button { width: auto; }

.thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(64px, 1fr)); gap: 8px; width: 100%; }
.thumbs.wide { grid-template-columns: repeat(auto-fill, minmax(72px, 1fr)); }
.thumb { display: block; position: relative; margin: 0; padding: 0; border: 1px solid var(--line); background: var(--monitor);
  color: inherit; font: inherit; cursor: pointer; text-align: left; width: 100%; border-radius: var(--radius); overflow: hidden; }
.thumb img, .thumb video, .thumb .miss { width: 100%; aspect-ratio: 9/16; object-fit: cover; display: block; background: var(--monitor); }
/* 缩略图上的时间码/标签：媒体内部角标，10px 例外不换 token */
.thumb .dur { position: absolute; right: 4px; bottom: 20px; background: rgba(0,0,0,.72);
  color: #eef1f6; font-size: 10px; font-style: normal; padding: 0 4px; font-family: var(--mono); }
.thumb span { display: block; padding: 2px 4px; font-size: 10px; color: var(--muted);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.thumb.audio { padding: 8px; }
.thumb audio { width: 100%; }
.lightbox { position: fixed; inset: 0; z-index: 40; display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  background: rgba(12,14,18,.62); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
  font-family: var(--font); }
.lightbox.hidden { display: none; }
.lb-x {
  position: absolute; top: 18px; left: 18px; width: 40px; height: 40px;
  display: grid; place-items: center; padding: 0; margin: 0;
  border: 0; border-radius: 50%; background: rgba(36,38,44,.88); color: #eef1f6;
  font-size: var(--fs-xl); font-weight: 400; line-height: 1; text-align: center;
  cursor: pointer; z-index: 42;
}
.lb-x:hover { background: rgba(50,54,62,.95); }
.lb-stage { flex: 1; width: 100%; display: flex; align-items: center; justify-content: center;
  overflow: hidden; padding: 56px 24px 96px; gap: 24px; min-height: 0; }
.lightbox.split .lb-stage {
  display: grid; grid-template-columns: minmax(180px, 32%) minmax(0, 1fr);
  align-items: stretch; justify-items: stretch;
  padding: 56px 0 24px 16px; gap: 0;
}
.lb-media { display: flex; align-items: center; justify-content: center; min-width: 0; min-height: 0; }
.lightbox.split .lb-media { height: 100%; padding: 0 12px 72px 4px; }
.lb-stage img, .lb-stage video { max-width: min(86vw, 1100px); max-height: calc(100vh - 160px);
  box-shadow: 0 24px 70px rgba(0,0,0,.45); transform-origin: center center; background: #111; }
.lightbox.split .lb-stage img, .lightbox.split .lb-stage video {
  max-width: 100%; max-height: calc(100vh - 180px); width: auto; height: auto; object-fit: contain;
}

.lb-bar { position: absolute; bottom: 28px; left: 50%; transform: translateX(-50%);
  display: flex; align-items: center; gap: 2px; padding: 8px 12px; border-radius: 999px;
  background: rgba(26,29,36,.92); color: #eef1f6; backdrop-filter: blur(10px); z-index: 42; }
.lightbox.split .lb-bar {
  left: 0; width: 32%; transform: none; justify-content: center;
}
.lightbox.center .lb-stage {
  display: flex; padding: 56px 24px 96px;
}

.lightbox.center .lb-media { height: auto; padding: 0; }
.lightbox.center .lb-stage img, .lightbox.center .lb-stage video {
  max-width: min(86vw, 720px); max-height: calc(100vh - 160px);
}
.lightbox.center .lb-bar,
.lightbox.center.split .lb-bar {
  left: 50%; width: auto; transform: translateX(-50%);
}
.lightbox.center.split .lb-stage {
  display: flex; padding: 56px 24px 96px;
}

.lb-bar button, .lb-bar a { width: 36px; height: 36px; padding: 0; margin: 0; border: 0;
  border-radius: 50%; background: transparent; color: inherit; cursor: pointer;
  display: grid; place-items: center; font-size: var(--fs-lg); text-decoration: none; }
.lb-bar button:hover, .lb-bar a:hover { background: rgba(255,255,255,.08); }
.lb-bar button:disabled { opacity: .3; cursor: default; }
.lb-bar #lb-count, .lb-bar #lb-zoom { min-width: 44px; text-align: center; font-size: var(--fs-sm);
  font-variant-numeric: tabular-nums; opacity: .9; font-family: var(--mono); }
.lb-sep { width: 1px; height: 16px; margin: 0 8px; background: rgba(255,255,255,.16); }

pre { background: var(--panel); border: 1px solid var(--line); padding: 12px; overflow: auto;
  font: 12px/1.4 var(--mono); color: var(--muted); max-height: 280px; border-radius: var(--radius); }

@media (max-width: 1024px) {
  .slots { grid-template-columns: 1fr 1fr; }
  .slots button { grid-column: 1 / -1; }
  
  
}
@media (max-width: 768px) {
  .bar-row { padding-left: 12px; padding-right: 12px; }
  
  
  
  
  
  main { padding: 12px 16px 16px; }
  .lightbox.split .lb-stage { grid-template-columns: 1fr; padding: 56px 16px 96px; }
  .lightbox.split .lb-media { padding: 0 0 12px; }
  
  .lightbox.split .lb-bar { width: 100%; }
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  .slots { grid-template-columns: 1fr; }
  form button[type="submit"] { width: 100%; }
  
  
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}

/* 货库 */
body:has(#view-products:not(.hidden)) main, body:has(#view-people:not(.hidden)) main { overflow: hidden; display: flex; flex-direction: column; }
/* 分栏各自滚动要一路把高度传下去：界面换 ui.css 后中间多了一层 .page，没撑满就整页被 main 裁掉、哪儿都滚不动 */
#view-products > .page, #view-people > .page { flex: 1; min-height: 0; }
#view-products:not(.hidden), #view-people:not(.hidden) { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 16px; }
.lib { flex: 1; min-height: 0; display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 28px; }
.lib-list { display: flex; flex-direction: column; gap: 12px; overflow-y: auto; min-height: 0; padding-right: 20px; border-right: 1px solid var(--line); }
#lib-items { display: flex; flex-direction: column; gap: 2px; }
.lib-item {
  display: grid; grid-template-columns: 48px minmax(0, 1fr); gap: 12px; align-items: center; text-align: left;
  padding: 8px; border: 1px solid transparent; border-radius: var(--radius); background: transparent; color: inherit; cursor: pointer;
}
.lib-item:hover:not(:disabled) { background: var(--panel); border-color: transparent; }
.lib-item.on { background: var(--panel); border-color: var(--line); box-shadow: inset 3px 0 0 var(--text); }
.lib-item img, .lib-ph { width: 48px; height: 48px; object-fit: contain; background: #fff; border-radius: 4px; display: block; box-shadow: 0 0 0 1px var(--line); }
.lib-item span { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; min-width: 0; font-size: var(--fs-sm); }
.lib-item strong { width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lib-editor { overflow-y: auto; min-height: 0; padding-right: 4px; }
.lib-cols { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; align-items: start; }
@media (min-width: 1280px) { .lib-cols { grid-template-columns: minmax(0, 3fr) minmax(320px, 2fr); } }
.lib-side { display: flex; flex-direction: column; min-width: 0; }
/* 货库的产品图、介绍图：小方格、整张看得见（长条的详情图不裁成一截） */
.lib-thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; }
.lib-thumbs .thumb { padding: 0; border: 1px solid var(--line); border-radius: 6px; overflow: hidden; background: #fff; }
.lib-thumbs .thumb img { width: 100%; height: auto; aspect-ratio: 1; object-fit: contain; display: block; background: #fff; }
.lib-card .card-form { margin-bottom: 12px; }
.lib-card input { width: 100%; box-sizing: border-box; }
/* 货库 / 人物库的新建表单：卡片铺满右栏，宽屏两栏排，提交按钮在右下 */
.lib-new-body { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--sp-4); align-items: start; }
.lib-new-body > .wide { grid-column: 1 / -1; }
.lib-new-body > .hint { margin: 0; max-width: 72ch; }
.lib-new-body textarea { width: 100%; }
.lib-new-up { display: flex; flex-direction: column; gap: var(--sp-2); min-width: 0; }
.lib-new-up .drop { min-height: 120px; align-content: center; }
.lib-new-foot { display: flex; justify-content: flex-end; padding-top: var(--sp-2); border-top: 1px solid var(--line); }
@media (max-width: 900px) { .lib-new-body { grid-template-columns: minmax(0, 1fr); } }
.lib-picked { grid-template-columns: repeat(auto-fill, 72px); }
.lib-picked:empty { display: none; }
.lib-picked img { height: 72px; object-fit: cover; }
.card-empty textarea { border-color: var(--run); background: color-mix(in srgb, var(--run) 8%, transparent); }
@media (max-width: 900px) {
  body:has(#view-products:not(.hidden)) main, body:has(#view-people:not(.hidden)) main { overflow: auto; display: block; }
  .lib { grid-template-columns: minmax(0, 1fr); }
  .lib-list { padding-right: 0; border-right: 0; }
  .lib-cols { grid-template-columns: minmax(0, 1fr); }
}

/* 手机：海报两列，页边距收窄 */
@media (max-width: 600px) {
  main { padding: 16px 16px 12px; }
  .board { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; padding: 0 0 24px; }
  #view-home .page-head { flex-wrap: wrap; }
  #home-seg { order: 3; margin-left: 0; }
  .bar-row { padding: 0 12px; }
}

/* ---- 后台入口只给超级管理员（菜单分区显隐在 app.js paintMenuGate 按 ME.modules 算） ---- */
body:not(.is-admin) [data-debug-shot],
body:not(.is-admin) #view-create .cp-more { display: none !important; }

/* ---- 后台页共用 ----
   层级：页底棚灰 → 表格/卡片（面板 + 细线，不加阴影）→ 决定卡（加深边线 + 浅阴影，全页唯一的重点卡）
   → 弹出层（菜单、提示、说明：shadow-pop）。组件一律用 ui.css；这里只留布局和页面专属件。 */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
/* 组件类自带 display（.page/.toolbar/.card/.menu…）会盖掉浏览器对 hidden 的处理，统一补回 */
[hidden] { display: none !important; }
.page-head { margin-bottom: 16px; }

/* 行内展开表单 / 结果卡：.card + .card-body；里面要竖排间隔的加 .stack（form 元素本身已是 grid 时不用） */
.stack { display: grid; gap: var(--sp-4); }
.stack > h2 { margin: 0; font-size: var(--fs-lg); font-weight: 600; }

/* 数据表用 ui.css 的 .table；这里是表格里常用的单元件 */
.table .acts { width: 1%; text-align: right; white-space: nowrap; }
.table tr.today td { background: var(--accent-soft); }
.table tfoot td { font-weight: 600; }

/* ---- 账号页（成员 / 租户 / 用量 / 月度账单）：acct- ---- */
.acct-who { display: flex; flex-direction: column; min-width: 0; }
.acct-who b { font-weight: 600; }
.acct-who span { font-size: var(--fs-sm); color: var(--muted); overflow-wrap: anywhere; }
.acct-inline-select { max-width: 200px; margin-left: -8px; padding: 4px 8px; font-size: var(--fs-sm); background: transparent; border-color: transparent; }
.acct-inline-select:hover { border-color: var(--line); background: #fff; }
.acct-pw-edit input { width: 180px; padding: 4px 8px; font-size: var(--fs-sm); }
.acct-done { box-shadow: inset 3px 0 0 var(--ok); }

/* 用量「按天」表：每天一行合计，点开看各公司 */
.acct-dayrow { cursor: pointer; }
.acct-expand { width: auto; padding: 0; border: 0; background: none; font: inherit; color: inherit; white-space: nowrap; }
.acct-expand::before { content: ""; display: inline-block; width: 0; height: 0; margin: 0 8px 1px 0; vertical-align: middle;
  border-left: 5px solid var(--muted); border-top: 4px solid transparent; border-bottom: 4px solid transparent; transition: transform var(--ease); }
.acct-dayrow.open .acct-expand::before { transform: rotate(90deg); }
.table tr.acct-subrow td { background: var(--sunk); font-size: var(--fs-sm); color: var(--muted); }
.table tr.acct-subrow td:first-child { padding-left: 32px; color: var(--text); }

/* 租户卡：公司与 key */
.acct-platform { background: transparent; border-style: dashed; border-color: var(--line-strong); }
.card.open { border-color: var(--line-strong); }
.acct-peek { list-style: none; margin: 0; padding: var(--sp-2) var(--sp-3); display: grid; gap: var(--sp-1); font-size: var(--fs-sm); background: var(--sunk); border-radius: var(--radius); }
.acct-co-h { display: flex; flex-direction: column; gap: var(--sp-1); min-width: 0; }
.acct-co-h .row { flex-wrap: wrap; font-size: var(--fs-sm); }
.acct-peek-btn { width: auto; padding: 0; border: 0; background: none; color: var(--text); font-size: var(--fs-sm); text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--line-strong); cursor: pointer; }
.acct-peek-btn:hover { text-decoration-color: var(--text); }
.acct-co-body { display: flex; flex-direction: column; gap: var(--sp-3); }
.acct-mods { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2) var(--sp-5); margin: 0; font-size: var(--fs-sm); }
.acct-mods .check { width: auto; font-size: var(--fs-sm); color: var(--text); }
.acct-keys { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(190px, 100%), 1fr)); gap: var(--sp-2); }
.acct-keygroup { padding: var(--sp-3); border-radius: var(--radius); background: var(--sunk); min-width: 0; }
.acct-platform .acct-keygroup { background: var(--panel); }
.acct-keygroup h4 { margin: 0; font-size: var(--fs-xs); font-weight: 500; color: var(--muted); }
.acct-keygroup ul { list-style: none; margin: var(--sp-2) 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: var(--sp-1) var(--sp-3); font-size: var(--fs-sm); }
.acct-keygroup li { display: inline-flex; align-items: center; gap: var(--sp-1); color: var(--faint); }
.acct-keygroup li.on { color: var(--text); }
.acct-keygroup svg { width: 13px; height: 13px; fill: none; stroke: var(--ok); stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.acct-keygroup.bad { background: var(--fail-soft); }
.acct-warn { margin-top: var(--sp-2); color: var(--fail); }
.acct-soft { margin-top: var(--sp-2); color: var(--run); }

/* 租户卡：公司积分池 */
.acct-wallet { margin: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--sp-2); }
.acct-wallet > div { padding: var(--sp-2) var(--sp-3); border-radius: var(--radius); background: var(--sunk); }
.acct-wallet dt { font-size: var(--fs-xs); color: var(--muted); }
.acct-wallet dd { margin: var(--sp-1) 0 0; font-size: var(--fs-lg); font-weight: 600; font-variant-numeric: tabular-nums; }
.acct-grant { display: grid; grid-template-columns: 1fr 2fr auto; gap: var(--sp-2); align-items: end; padding-top: var(--sp-3); border-top: 1px solid var(--line); }
@media (max-width: 760px) {
  .acct-wallet { grid-template-columns: repeat(2, 1fr); }
  .acct-grant { grid-template-columns: 1fr; }
}

/* 月度账单 */
.acct-neg { color: var(--fail); }
.acct-pos { color: var(--ok); }
.acct-bill td, .acct-bill th { white-space: nowrap; }

/* ---- 用量图：账号页唯一的视觉重点 ---- */
.chart {
  position: relative; margin: 0; padding: var(--sp-4) var(--sp-5) var(--sp-3);
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius-lg);
}
.chart-cap { display: flex; align-items: baseline; gap: var(--sp-3); font-size: var(--fs-md); }
.chart-cap span { font-size: var(--fs-xs); color: var(--muted); }
.chart-plot { position: relative; height: 180px; margin: var(--sp-4) 0 var(--sp-6) var(--sp-8); }
.chart-grid span { position: absolute; left: 0; right: 0; border-top: 1px dashed var(--line); }
.chart-grid span[style*="bottom:0"] { border-top-style: solid; border-color: var(--line-strong); }
/* 图表刻度字：图表内部标注，11px 例外不换 token */
.chart-grid em {
  position: absolute; left: -30px; width: 24px; transform: translateY(-50%); text-align: right;
  font-style: normal; font-size: 11px; color: var(--muted); font-family: var(--mono);
}
.chart-cols { position: absolute; inset: 0; display: flex; gap: 2px; }
.chart-col { position: relative; flex: 1 1 0; min-width: 0; display: flex; }
.chart-bar {
  flex: 1; min-width: 0; padding: 0; display: flex; align-items: flex-end; justify-content: center;
  border: 0; border-radius: 3px 3px 0 0; background: transparent;
}
.chart-bar:hover:not(:disabled), .chart-bar.hot { background: var(--sunk); }
.chart-bar:focus-visible { outline: 2px solid var(--accent); outline-offset: 0; }
.chart-stack { width: min(100%, 18px); display: flex; flex-direction: column-reverse; border-radius: 2px 2px 0 0; overflow: hidden; }
.chart-stack i { display: block; min-height: 1px; }
.chart-col.empty .chart-stack { height: 2px !important; background: var(--line-strong); border-radius: 1px; }
.chart-col.today .chart-stack { box-shadow: 0 0 0 2px var(--panel), 0 0 0 4px var(--accent); }
.chart-col.today.empty .chart-stack { background: var(--accent); box-shadow: none; }
.chart-x {
  position: absolute; top: calc(100% + var(--sp-2)); left: 50%; transform: translateX(-50%);
  font-size: 11px; color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; pointer-events: none; /* 图表刻度字，11px 例外 */
}
.chart-col.today .chart-x { color: var(--accent-ink); font-weight: 600; }
.chart-legend { display: flex; flex-wrap: wrap; gap: var(--sp-2) var(--sp-5); font-size: var(--fs-sm); color: var(--muted); }
.chart-legend span { display: inline-flex; align-items: center; gap: var(--sp-2); }
.chart-legend i, .chart-tip i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; flex: none; }
.chart-legend b { color: var(--text); font-weight: 600; font-variant-numeric: tabular-nums; }
.chart-tip {
  position: absolute; z-index: 6; min-width: 200px; max-width: min(280px, calc(100% - 16px)); padding: var(--sp-3);
  font-size: var(--fs-sm); pointer-events: none;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow-pop);
}
.chart-tip-h { display: flex; justify-content: space-between; gap: var(--sp-3); margin: 0; font-weight: 600; }
.chart-tip-h span { font-weight: 400; color: var(--muted); font-variant-numeric: tabular-nums; }
.chart-tip ul { list-style: none; margin: var(--sp-2) 0 0; padding: var(--sp-2) 0 0; border-top: 1px solid var(--line); display: grid; gap: var(--sp-1); }
.chart-tip li { display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; align-items: center; gap: var(--sp-2); }
.chart-tip li span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chart-tip li b, .chart-tip li em { font-style: normal; font-variant-numeric: tabular-nums; text-align: right; }
.chart-tip li em { color: var(--muted); min-width: 4.5em; }

/* ---- 千川运营（罗盘 / 投放 / 流程 / 反馈共用） ---- */
.ops-sync { font-size: var(--fs-sm); color: var(--muted); font-variant-numeric: tabular-nums; }
.ops-sync.bad { color: var(--fail); }
.ops-acct { display: flex; align-items: baseline; flex-wrap: wrap; gap: var(--sp-1) var(--sp-3); margin: 0; font-size: var(--fs-sm); }
.ops-acct .ops-tech { flex-basis: 100%; }
.ops-tech { margin-top: var(--sp-2); }
.ops-tech summary { width: fit-content; cursor: pointer; font-size: var(--fs-xs); color: var(--muted); }
.ops-tech code {
  display: block; margin-top: var(--sp-2); padding: var(--sp-2) var(--sp-3); max-height: 160px; overflow: auto;
  white-space: pre-wrap; word-break: break-all; font-size: var(--fs-xs); color: var(--muted);
}

/* 自动投放：审批 */
.dlv-todo { display: grid; gap: var(--sp-3); }
.dlv-todo:empty { display: none; }
.dlv-todo > * { margin: 0; }
.dlv-todo > h2 { font-size: var(--fs-md); font-weight: 600; }
.dlv-decides { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(360px, 100%), 1fr)); gap: var(--sp-3); }
.dlv-decide {
  display: grid; gap: var(--sp-3); align-content: start; padding: var(--sp-4) var(--sp-5);
  background: var(--panel); border: 1px solid var(--line-strong); border-radius: var(--radius-lg);
  box-shadow: inset 3px 0 0 var(--accent), 0 1px 2px rgba(22, 23, 26, .05), 0 6px 18px rgba(22, 23, 26, .06);
}
.dlv-decide h3 { margin: 0; font-size: var(--fs-md); font-weight: 600; line-height: 1.45; }
.dlv-decide .actions { padding-top: var(--sp-1); }
.dlv-decide .actions > .hint { margin-right: auto; }
.dlv-todo-line {
  display: flex; align-items: center; gap: var(--sp-3); flex-wrap: wrap; padding: var(--sp-3) var(--sp-4); font-size: var(--fs-md);
  background: var(--panel); border-radius: var(--radius-lg);
}
.dlv-todo-line .hint { margin-left: auto; }
.dlv-history { border-top: 1px solid var(--line); padding-top: var(--sp-3); }

/* 流程运行 */
.runs-errcell { max-width: 0; width: 34%; }
.runs-errline {
  display: block; width: 100%; padding: 0; border: 0; background: none; text-align: left;
  font-size: var(--fs-sm); color: var(--fail); overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.runs-errline.open { white-space: pre-wrap; word-break: break-word; }

@media (max-width: 860px) {
  .table thead { display: none; }
  .table, .table tbody, .table tfoot { display: block; }
  .table tr { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--sp-2) var(--sp-4); padding: var(--sp-3) var(--sp-4); border-bottom: 1px solid var(--line); }
  .table tbody tr:last-child { border-bottom: 0; }
  .table tfoot tr { border-top: 1px solid var(--line-strong); border-bottom: 0; }
  .table td, .table tfoot td { padding: 0; border: 0; min-width: 0; background: none !important; }
  .table td[data-cell="head"] { grid-column: 1 / -1; font-weight: 500; order: -2; }
  .table td[data-cell="sub"] { order: -1; }
  .table td[data-cell="sub"] { grid-column: 1 / -1; margin-top: -4px; font-size: var(--fs-sm); color: var(--muted); }
  .table td[data-label] { display: flex; flex-direction: column; gap: 1px; text-align: left; }
  .table td[data-label]::before { content: attr(data-label); font-size: var(--fs-xs); font-weight: 400; color: var(--muted); }
  .table .num { text-align: left; }
  .table .acts { grid-column: 1 / -1; width: auto; text-align: left; display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2); }
  .table .acts:empty { display: none; }
  .table tr.today { background: var(--accent-soft); }
  .table tr.acct-subrow { background: var(--sunk); }
  .table tr.acct-subrow td:first-child { padding-left: 0; }
  .table.acct-daily tr { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--sp-1) var(--sp-3); }
  .runs-errcell { max-width: none; width: auto; grid-column: 1 / -1; }
  .acct-inline-select { max-width: 100%; margin-left: 0; padding-left: 0; }
  .table .acts .menu { right: auto; left: 0; }
  .acct-pw-edit { flex: 1; }
  .acct-pw-edit input { width: auto; flex: 1; }
}
@media (max-width: 640px) {
  .chart { padding: var(--sp-3); }
  .chart-plot { height: 150px; margin-left: var(--sp-6); }
  .chart-grid em { left: -26px; width: 22px; }
  .chart-cols { gap: 1px; }
  .dlv-decide { padding: var(--sp-4); }
  .dlv-decide .actions > .hint { flex-basis: 100%; }
  .dlv-decide .actions .btn, .stack .actions .btn { flex: 1; }
}

/* ---- 部署后提示刷新 ---- */
.reload-bar {
  position: fixed; top: 12px; left: 50%; transform: translateX(-50%); z-index: 60;
  display: flex; align-items: center; gap: 12px; max-width: calc(100vw - 32px);
  padding: 8px 12px 8px 16px; border-radius: var(--radius-lg);
  background: var(--text); color: var(--ink); font-size: var(--fs-sm); box-shadow: var(--shadow-pop);
  white-space: nowrap;
}
.reload-bar button {
  flex: none; width: auto; border: 0; border-radius: var(--radius); padding: 4px 12px; cursor: pointer;
  background: #fff; color: var(--text); font: inherit;
}

/* ---- 产品图体检/整理状态块（imgprep.js，货库和任务页共用） ---- */
.ip { margin: 12px 0 4px; font-size: var(--fs-xs); }
.ip-list { display: flex; flex-direction: column; gap: 8px; }
.ip-item { display: flex; gap: 8px; align-items: flex-start; }
.ip-item > .thumb { flex: none; width: 64px; }
.ip-item > .thumb img { display: block; width: 100%; }
.ip-m { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; min-width: 0; }
.ip-issue { font-style: normal; color: var(--muted); }
.ip-miss { margin: 0 0 8px; padding: 8px 8px; border-radius: var(--radius); background: var(--run-soft); color: var(--run); font-size: var(--fs-xs); }
.ip-need { margin: 0 0 8px; padding: 8px 8px; border-radius: var(--radius); background: var(--fail-soft); color: var(--fail); font-size: var(--fs-xs); line-height: 1.5; }
.ip-need.mism { background: var(--run-soft); color: var(--run); }
.ip-up { width: auto; padding: 2px 8px; font-size: var(--fs-xs); }
.aw-prep { margin-top: 8px; }

/* 公司管理员只读看成员任务 */
.ro-banner { margin: 0; padding: 8px 16px; background: var(--run-soft); color: var(--run); font-size: var(--fs-sm); border-bottom: 1px solid #e9c98f; }

/* 产品图「样子」区：每种样子一块，挑中的照片大图 + 同样子其他照片小图 */
/* 货库产品图：按样子分格，每格挑中一张放大，同样子的其他照片一排小图 */
.lib-head-acts { display: flex; gap: var(--sp-2); }
.lib-ana { display: flex; flex-direction: column; gap: var(--sp-4); }
.lib-ana > p { margin: 0; }
.pforms { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: var(--sp-4); }
.pform { display: flex; flex-direction: column; gap: var(--sp-2); min-width: 0; }
.pform-h { display: flex; align-items: baseline; justify-content: space-between; gap: var(--sp-2); font-size: var(--fs-md); }
.pform-h > span { font-size: var(--fs-xs); color: var(--muted); }
.pform .lib-img .thumb { display: block; width: 100%; aspect-ratio: 1; padding: 0; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: #fff; }
.pform .lib-img .thumb img { width: 100%; height: 100%; aspect-ratio: auto; object-fit: contain; display: block; background: #fff; }
.pform-alts { display: flex; gap: var(--sp-1); overflow-x: auto; }
.pform-alt { flex: none; width: 40px; height: 40px; padding: 0; border: 1px solid var(--line); border-radius: 4px; overflow: hidden; background: #fff; cursor: pointer; }
.pform-alt:hover { border-color: var(--text); }
.pform-alt img { width: 100%; height: 100%; object-fit: contain; display: block; }
.pform-ph { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: var(--sp-3); aspect-ratio: 1; padding: var(--sp-4); border: 1px dashed var(--line-strong); border-radius: var(--radius); background: var(--sunk); color: var(--muted); font-size: var(--fs-sm); text-align: center; cursor: pointer; }
.pform-ph:hover { border-color: var(--text); color: var(--text); }
.lib-shelved { border-top: 1px solid var(--line); padding-top: var(--sp-3); }
.lib-shelved > summary { cursor: pointer; font-size: var(--fs-sm); color: var(--muted); }
.lib-shelved > summary:hover { color: var(--text); }
.lib-shelved-body { display: grid; grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); gap: var(--sp-3); margin-top: var(--sp-3); }
.lib-shelved-it { display: flex; flex-direction: column; gap: var(--sp-1); min-width: 0; }
.lib-shelved-it .thumb { display: block; width: 100%; aspect-ratio: 1; padding: 0; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: #fff; }
.lib-shelved-it .thumb img { width: 100%; height: 100%; aspect-ratio: auto; object-fit: contain; display: block; background: #fff; opacity: .72; }
.lib-shelved-why { font-size: var(--fs-xs); color: var(--muted); }
.lib-img-cell { width: 100%; height: var(--ctl-h-sm); padding: 0 var(--sp-2); font-size: var(--fs-xs); }
/* 产品卡底部：定稿是主按钮，删除放最右 */
.lib-card .step-run { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.lib-card .step-run button { width: auto; padding: 8px 16px; }
.lib-card .step-run [data-lib-del] { margin-left: auto; color: var(--fail); }

/* 找爆款 */
.card-head h2 { margin: 0 0 2px; }
.scout-doing { color: var(--run); font-size: var(--fs-sm); white-space: nowrap; }
.scout-filters { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: var(--sp-3); }
.scout-flags { display: flex; flex-wrap: wrap; gap: var(--sp-2) var(--sp-4); margin-top: var(--sp-3); font-size: var(--fs-sm); }
.scout-flags label { display: inline-flex; align-items: center; gap: var(--sp-2); }
.scout-table td { vertical-align: top; }
.scout-table .num { white-space: nowrap; }
.scout-pick { width: 32px; }
.scout-video { min-width: 280px; }
.scout-name { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; color: var(--text); text-decoration: none; line-height: 1.5; }
.scout-name:hover { text-decoration: underline; }
.scout-meta { display: flex; flex-wrap: wrap; gap: var(--sp-1) var(--sp-3); margin-top: var(--sp-1); font-size: var(--fs-xs); color: var(--muted); }
.scout-prod { width: 22%; min-width: 160px; }
.scout-prod span { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font-size: var(--fs-sm); color: var(--muted); line-height: 1.5; }
