/* ============================================================
   views.css — 工作台面板样式（视频制作等）
   ============================================================ */

/* 工作区两栏：左表单 + 右队列 */
.studio-grid { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: var(--sp-5); align-items: start; }
@media (max-width: 1280px) { .studio-grid { grid-template-columns: 1fr; } }

/* 表单分区卡 */
.fs-card { padding: var(--sp-5); margin-bottom: var(--sp-4); }
.fs-card .fs-head { display: flex; align-items: center; gap: var(--sp-3); margin-bottom: var(--sp-4); cursor: pointer; }
.fs-card .fs-head .no {
  display: flex; align-items: center; justify-content: center; flex: none;
  width: 24px; height: 24px; border-radius: 8px;
  font-size: var(--fs-caption); font-weight: 700; color: #fff;
  background: var(--brand-grad); box-shadow: 0 2px 8px rgba(99, 102, 241, 0.35);
}
.fs-card .fs-head h3 { font-size: 15px; }
.fs-card .fs-head .hint { margin-left: auto; font-size: var(--fs-caption); color: var(--text-tertiary); }
.fs-card .fs-head .more {
  margin-left: auto; height: 26px; padding: 0 10px;
  font-size: var(--fs-caption); color: var(--brand-400);
  background: transparent; border: none; border-radius: var(--r-sm); cursor: pointer;
}
.fs-card .fs-head .more:hover { background: var(--brand-soft); }
.fs-card .fs-collapse {
  margin-left: auto; flex: none;
  width: 26px; height: 26px; border-radius: 50%;
  border: none; background: transparent; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--text-tertiary); font-size: 12px; line-height: 1;
  transition: background var(--dur-fast), color var(--dur-fast);
}
.fs-card .fs-collapse:hover { background: var(--brand-soft); color: var(--brand-500); }
.fs-card .fs-body {
  max-height: 10000px; overflow: hidden;
  transition: max-height 0.35s ease;
}
.fs-card .fs-body.is-collapsed { max-height: 0; }

.chip-row { display: flex; flex-wrap: wrap; gap: var(--sp-2); }
.chip-row + .chip-row { margin-top: var(--sp-2); }
.chip-row .row-label { width: 100%; font-size: var(--fs-caption); color: var(--text-tertiary); margin-top: var(--sp-2); }

/* ---------- AI 室内设计：局部修改基图信息行与「返回整图改造」入口 ---------- */
.int-edit-base { display: flex; align-items: center; gap: var(--sp-3); }
.int-exit { margin-left: auto; flex: none; border: none; background: none; cursor: pointer;
  font-size: var(--fs-caption); color: var(--brand-400); padding: 2px 0; }
.int-exit:hover { text-decoration: underline; }
.int-edit-base .ref-thumb { flex: none; width: 84px; }
.int-edit-info { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.int-edit-info b { font-size: var(--fs-caption); font-weight: 650; color: var(--text-primary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.int-edit-info .s { font-size: 11px; color: var(--text-tertiary); line-height: 1.35; }

/* ---------- AI 服装设计：对话式需求框 + 使用说明弹层 ---------- */
.fs-chat { min-height: 132px; max-height: 260px; }
.fs-refs { margin-top: var(--sp-2); }
.fs-refs .cb-asset-add { width: 56px; height: 56px; }
.fs-refs .cb-asset-add .plus { font-size: 18px; line-height: 1; }
.fs-refs .cb-asset-thumb .idx {
  position: absolute; left: 2px; bottom: 2px; padding: 0 5px; height: 15px; line-height: 15px;
  font-size: 10px; font-weight: 700; color: #fff; border-radius: 7px;
  background: rgba(8, 10, 20, .68); backdrop-filter: blur(2px);
}
.fs-refs .cb-asset-thumb.is-base { border-color: var(--brand-500); }
.fs-refs .cb-asset-thumb .ai-tag {
  position: absolute; right: 2px; top: 2px; width: 20px; height: 20px; padding: 0;
  border: none; border-radius: 5px; background: rgba(8, 10, 20, .62); color: #fff;
  font-size: 10px; font-weight: 700; line-height: 20px; cursor: pointer;
}
.fs-refs .cb-asset-thumb .ai-tag:hover { background: var(--brand-500); }
.fs-refs .cb-asset-thumb .ai-tag[disabled] { opacity: .5; cursor: default; }
.fs-at-btn { flex: none; }
.fs-at-btn[disabled] { opacity: .45; cursor: not-allowed; }
.fs-at-wrap { position: relative; flex: none; }
.fs-at-pop {
  position: absolute; left: 0; bottom: calc(100% + 6px); z-index: 20; min-width: 190px; max-height: 216px; overflow-y: auto;
  padding: 6px; background: var(--bg-surface); border: 1px solid var(--border-strong);
  border-radius: var(--r-md); box-shadow: var(--shadow-lg);
}
.fs-at-pop .row {
  display: flex; align-items: center; gap: 8px; width: 100%; padding: 4px 6px;
  background: none; border: none; border-radius: var(--r-sm); cursor: pointer; text-align: left;
  font-size: var(--fs-caption); color: var(--text-primary);
}
.fs-at-pop .row:hover { background: var(--bg-elevated); }
.fs-at-pop .row img { width: 26px; height: 26px; object-fit: cover; border-radius: 4px; flex: none; }
.fs-at-pop .row .n { color: var(--brand-400); font-weight: 700; flex: none; }
.fs-at-pop .row .t { color: var(--text-tertiary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* 使用说明：标题右侧问号图标 + 弹层（沿用后台字段说明的交互：点开、点外关闭） */
.fs-help { position: relative; display: inline-flex; align-items: center; margin-left: 6px; }
.fs-help .hq {
  width: 16px; height: 16px; border-radius: 50%; border: 1px solid var(--border-strong);
  font-size: 11px; line-height: 14px; text-align: center; color: var(--text-tertiary);
  cursor: pointer; user-select: none; font-style: normal;
}
.fs-help .hq:hover { border-color: var(--brand-500); color: var(--brand-400); background: var(--brand-soft); }
.fs-help .hp-pop {
  position: absolute; left: -6px; top: calc(100% + 8px); z-index: 30; width: min(340px, 78vw);
  padding: 10px 12px; font-size: var(--fs-caption); line-height: 1.7; font-weight: 400; color: var(--text-secondary);
  background: var(--bg-surface); border: 1px solid var(--border-strong); border-radius: var(--r-md); box-shadow: var(--shadow-lg);
}
.fs-help .hp-pop b { color: var(--brand-400); }
.fs-help .hp-mask { position: fixed; inset: 0; z-index: 25; background: transparent; }

/* ---------- 制图「选风格 / 选模板」：触发卡与弹窗（三个子工具共用，结构见 js/style-picker.js） ---------- */

/* ---------- 制图「风格来源」页签 + AI 拆解面板（三个子工具共用，结构见 js/style-analyze.js） ---------- */
.ss-tabs { display: flex; align-items: center; gap: 6px; margin-top: var(--sp-3); }
.ss-tabs .s { margin-left: auto; font-size: 11px; color: var(--text-tertiary); text-align: right; }
.ss-tab { flex: none; height: 28px; padding: 0 12px; border: 1px solid var(--border-strong); border-radius: var(--r-md);
  background: var(--bg-surface); color: var(--text-secondary); font-size: var(--fs-caption); cursor: pointer;
  transition: color var(--dur-fast) ease, border-color var(--dur-fast) ease, background var(--dur-fast) ease; }
.ss-tab:hover { color: var(--text-primary); border-color: var(--brand-500); }
.ss-tab.is-on { color: #fff; border-color: transparent; background: var(--brand-grad); }

.sa-panel { display: flex; flex-direction: column; gap: 10px; margin-top: var(--sp-3); }
.sa-drop { display: flex; align-items: center; gap: 8px; width: 100%; padding: 10px 12px; cursor: pointer;
  border: 1px dashed var(--border-strong); border-radius: var(--r-md); background: var(--bg-surface);
  color: var(--text-tertiary); font-size: var(--fs-caption); transition: border-color var(--dur-fast) ease; }
.sa-drop:hover, .sa-drop.is-drag { border-color: var(--brand-500); color: var(--text-secondary); }
.sa-drop .ic { flex: none; width: 22px; height: 22px; display: grid; place-items: center; border-radius: 50%;
  border: 1px solid var(--border-strong); font-size: 14px; line-height: 1; }
.sa-drop .t { min-width: 0; }
.sa-ref .ref-thumb { width: 104px; }
.sa-sum { font-size: var(--fs-caption); color: var(--text-secondary); line-height: 1.5; }
.sa-layout { margin-top: 10px; padding: 8px 10px; border-radius: var(--r-md);
  border: 1px solid var(--border); background: var(--bg-surface);
  display: flex; flex-direction: column; gap: 4px; font-size: var(--fs-caption); color: var(--text-secondary); line-height: 1.55; }
.sa-layout b { color: var(--text-primary); font-weight: 650; }
.sa-link { align-self: flex-start; border: none; background: none; padding: 0; cursor: pointer;
  font-size: var(--fs-caption); color: var(--brand-400); }
.sa-link:hover { text-decoration: underline; }

/* ---------- 制图「挑模板」触发卡（选中后主页面直接摊开封面，结构见 js/style-picker.js 的 pickedCardHtml） ---------- */
.tp-card { display: flex; align-items: center; gap: 10px; width: 100%; margin-top: var(--sp-3); padding: 8px 10px;
  font: inherit; color: inherit; text-align: left; cursor: pointer; -webkit-appearance: none; appearance: none;
  border: 1px dashed var(--border-strong); border-radius: var(--r-md);
  background: var(--bg-inset); transition: border-color var(--dur-fast) ease, background var(--dur-fast) ease; }
.tp-card:hover { border-color: var(--brand-500); background: var(--bg-hover); }
.tp-card:focus-visible { outline: 2px solid var(--brand-400); outline-offset: 2px; }
.tp-card.is-on { border-style: solid; border-color: var(--brand-400); background: var(--brand-soft); }
.tp-card.is-on:hover { border-color: var(--brand-500); }
.tp-card.is-err { border-style: solid; border-color: var(--warning); background: var(--warning-soft); }

.tp-ph { flex: none; width: 30px; height: 30px; display: grid; place-items: center; border-radius: var(--r-sm);
  border: 1px dashed var(--border-strong); color: var(--text-tertiary); font-size: 16px; line-height: 1; }
.tp-ic { flex: none; width: 30px; height: 30px; display: grid; place-items: center; border-radius: 50%;
  background: var(--warning); color: var(--bg-page); font-size: 15px; font-weight: 700; line-height: 1; }
.tp-art { flex: none; width: 56px; height: 42px; overflow: hidden; border-radius: var(--r-sm);
  border: 1px solid var(--border); background: var(--bg-surface); }
.tp-art img { display: block; width: 100%; height: 100%; object-fit: cover; }
.tp-grad { display: grid; place-items: center; width: 100%; height: 100%; color: #fff; font-size: 13px; font-weight: 700;
  background: linear-gradient(135deg, hsl(var(--h1) 62% 46%) 0%, hsl(var(--h2) 58% 30%) 100%); }

.tp-main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.tp-main b { font-size: var(--fs-caption); font-weight: 650; color: var(--text-primary);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tp-main .s { font-size: 11px; color: var(--text-tertiary); line-height: 1.35;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tp-act { flex: none; margin-left: auto; font-size: 11px; color: var(--brand-400); }
.tp-x { flex: none; width: 22px; height: 22px; display: grid; place-items: center; border-radius: 50%; cursor: pointer;
  color: var(--text-tertiary); font-size: 15px; line-height: 1; }
.tp-x:hover { background: var(--bg-active); color: var(--text-primary); }

.sp-modal { position: fixed; inset: 0; z-index: 60; display: none; align-items: center; justify-content: center;
  padding: var(--sp-4); background: rgba(8, 8, 14, .62); backdrop-filter: blur(3px); }
.sp-modal.is-open { display: flex; }
.sp-box { width: min(1000px, 100%); max-height: 88vh; display: flex; flex-direction: column; overflow: hidden;
  background: var(--bg-elevated); border: 1px solid var(--border-strong); border-radius: var(--r-lg); box-shadow: var(--shadow-lg);
  animation: sp-in var(--dur-base) var(--ease-out); }
@keyframes sp-in { from { opacity: 0; transform: translateY(10px) scale(.985); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .sp-box { animation: none; } }

.sp-head { display: flex; align-items: center; gap: var(--sp-3); padding: var(--sp-4) var(--sp-5);
  border-bottom: 1px solid var(--border); }
.sp-head h3 { margin: 0; font-size: var(--fs-h3); font-weight: 650; color: var(--text-primary); }
.sp-head .s { font-size: var(--fs-caption); color: var(--text-tertiary); }
.sp-x { margin-left: auto; flex: none; width: 28px; height: 28px; border: none; border-radius: var(--r-sm);
  background: none; color: var(--text-secondary); font-size: 18px; line-height: 1; cursor: pointer; }
.sp-x:hover { background: var(--bg-hover); color: var(--text-primary); }

/* 工具条：分类胶囊横向可滚（滚到底也不撑破弹窗），搜索框固定在右侧 */
.sp-bar { display: flex; align-items: center; gap: var(--sp-3); padding: var(--sp-3) var(--sp-5);
  border-bottom: 1px solid var(--border); background: var(--bg-surface); }
.sp-catsw { flex: 1 1 auto; min-width: 0; display: flex; align-items: center; gap: 2px; }
.sp-catsw.is-off { display: none; }
.sp-nav { flex: none; width: 22px; height: 26px; padding: 0; border: 1px solid var(--border-strong);
  border-radius: 999px; background: none; color: var(--text-tertiary); font-size: 16px; line-height: 23px;
  text-align: center; cursor: pointer; transition: color var(--dur-fast) var(--ease-out), border-color var(--dur-fast) var(--ease-out); }
.sp-nav:hover { color: var(--brand-400); border-color: var(--brand-500); }
.sp-nav[hidden] { display: none; }
.sp-cats { flex: 1 1 auto; min-width: 0; display: flex; gap: 6px; overflow-x: auto; padding: 2px 0;
  scrollbar-width: none; }
.sp-cats:empty { display: none; }
.sp-cats::-webkit-scrollbar { display: none; }
.sp-tab { flex: none; display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 12px;
  font-size: var(--fs-caption); font-weight: 600; white-space: nowrap; color: var(--text-secondary);
  background: none; border: 1px solid var(--border-strong); border-radius: 999px; cursor: pointer;
  transition: color var(--dur-fast) var(--ease-out), border-color var(--dur-fast) var(--ease-out), background var(--dur-fast) var(--ease-out); }
.sp-tab:hover { color: var(--text-primary); border-color: var(--brand-500); }
.sp-tab.is-on { color: #fff; border-color: transparent; background: var(--brand-grad); }
.sp-tab b { font-size: 11px; font-weight: 700; opacity: .68; font-variant-numeric: tabular-nums; }
.sp-tab.is-on b { opacity: .9; }
.sp-search { flex: 0 1 210px; min-width: 120px; display: inline-flex; align-items: center; gap: 6px; height: 30px;
  padding: 0 10px; border: 1px solid var(--border-strong); border-radius: 999px;
  background: var(--bg-inset); color: var(--text-tertiary); transition: border-color var(--dur-fast) var(--ease-out); }
.sp-search svg { width: 14px; height: 14px; flex: none; }
.sp-search:focus-within { border-color: var(--border-focus); color: var(--brand-400); }
.sp-search input { width: 100%; min-width: 0; border: none; outline: none; background: none;
  font-size: var(--fs-caption); color: var(--text-primary); }
.sp-search input::placeholder { color: var(--text-tertiary); }

.sp-body { flex: 1 1 auto; overflow-y: auto; padding: var(--sp-4) var(--sp-5); }
.sp-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(152px, 1fr)); gap: var(--sp-4) var(--sp-3); }

/* 一张卡 = 图位 + 一行说明；图位比例由 --sp-aspect 决定（服装/海报竖图，室内横图） */
.sp-card { position: relative; display: block; padding: 0; border: none; background: none; text-align: left; cursor: pointer; }
.sp-art { position: relative; display: block; width: 100%; aspect-ratio: var(--sp-aspect, 3 / 4); overflow: hidden;
  border: 1px solid var(--border); border-radius: var(--r-md); background: var(--bg-inset);
  transition: transform var(--dur-base) var(--ease-out), border-color var(--dur-fast) var(--ease-out), box-shadow var(--dur-base) var(--ease-out); }
.sp-img { width: 100%; height: 100%; object-fit: cover; display: block;
  transition: transform var(--dur-slow) var(--ease-out); }
.sp-card:hover .sp-art { border-color: var(--brand-500); box-shadow: var(--shadow-md); transform: translateY(-2px); }
.sp-card:hover .sp-img { transform: scale(1.05); }
.sp-card:focus-visible { outline: none; }
.sp-card:focus-visible .sp-art { outline: 2px solid var(--border-focus); outline-offset: 2px; }
.sp-card.is-on .sp-art { border-color: var(--brand-500); box-shadow: 0 0 0 2px var(--brand-soft), var(--shadow-md); }
/* 后台没传参考图时：按模板 Code 稳定算出的双色渐变底 + 居中大字风格名（同一条永远同一个色） */
.sp-ph { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; padding: 10% 8%;
  text-align: center; font-size: var(--fs-body); font-weight: 700; line-height: 1.34; color: #fff;
  letter-spacing: .3px; text-shadow: 0 1px 12px rgba(6, 8, 14, .32);
  background: linear-gradient(140deg, hsl(var(--h1, 220) 66% 54%) 0%, hsl(var(--h2, 260) 58% 32%) 100%); }
.sp-ph::after { content: ""; position: absolute; inset: 0;
  background: radial-gradient(120% 84% at 18% 10%, rgba(255, 255, 255, .22), transparent 62%); }
.sp-scrim { position: absolute; inset: auto 0 0 0; height: 54%;
  background: linear-gradient(to top, rgba(6, 8, 14, .84), transparent); }
.sp-name { position: absolute; left: 10px; right: 10px; bottom: 8px; font-size: var(--fs-caption); font-weight: 650;
  color: #fff; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sp-tag { position: absolute; left: 8px; top: 8px; z-index: 1; padding: 2px 7px; font-size: 10px; font-weight: 600;
  color: #fff; white-space: nowrap; max-width: calc(100% - 60px); overflow: hidden; text-overflow: ellipsis;
  background: rgba(8, 10, 18, .5); border: 1px solid rgba(255, 255, 255, .18); border-radius: 999px;
  backdrop-filter: blur(4px); }
.sp-tick { position: absolute; right: 8px; top: 8px; z-index: 2; width: 20px; height: 20px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; font-size: 12px; color: #fff;
  background: var(--brand-grad); box-shadow: 0 2px 8px rgba(6, 8, 14, .4); }
.sp-desc { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  margin-top: 6px; font-size: var(--fs-caption); line-height: 1.35; color: var(--text-secondary); }
.sp-desc:empty { display: none; }

.sp-foot { display: flex; align-items: center; gap: var(--sp-3); padding: var(--sp-3) var(--sp-5);
  border-top: 1px solid var(--border); background: var(--bg-surface); }
.sp-sum { font-size: var(--fs-caption); color: var(--text-tertiary); font-variant-numeric: tabular-nums; }
.sp-acts { margin-left: auto; display: inline-flex; gap: var(--sp-2); }

.sp-empty { grid-column: 1 / -1; display: flex; flex-direction: column; align-items: center; gap: var(--sp-3);
  padding: var(--sp-7) 0 var(--sp-6); text-align: center; font-size: var(--fs-caption); color: var(--text-tertiary); }
.sp-reset { height: 28px; padding: 0 14px; font-size: var(--fs-caption); font-weight: 600; color: var(--brand-400);
  background: var(--brand-soft); border: 1px solid transparent; border-radius: 999px; cursor: pointer; }
.sp-reset:hover { border-color: var(--brand-500); }

@media (max-width: 720px) {
  .sp-modal { padding: var(--sp-2); }
  .sp-head, .sp-bar, .sp-body, .sp-foot { padding-left: var(--sp-4); padding-right: var(--sp-4); }
  .sp-bar { flex-wrap: wrap; }
  .sp-search { flex: 1 1 100%; }
  .sp-grid { grid-template-columns: repeat(auto-fill, minmax(124px, 1fr)); gap: var(--sp-3) var(--sp-2); }
}

/* 模型选择卡横排 */
.model-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--sp-3); }
@media (max-width: 640px) { .model-row { grid-template-columns: 1fr; } }
.model-row .option-card h4 { font-size: var(--fs-body); font-weight: 650; }
.model-row .option-card .m-desc { font-size: var(--fs-caption); color: var(--text-tertiary); margin-top: 4px; min-height: 32px; }
.model-row .option-card .m-price { margin-top: var(--sp-2); font-size: var(--fs-caption); color: var(--text-secondary); }
.model-row .option-card .m-price b { color: var(--brand-400); font-size: 15px; }

/* 输出参数行 */
.out-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--sp-4); }
.out-grid .field-label { margin-bottom: var(--sp-2); display: block; }
@media (max-width: 640px) { .out-grid { grid-template-columns: 1fr; } }

/* 高级参数折叠 */
.fs-adv { border: 1px dashed var(--border-strong); border-radius: var(--r-md); padding: var(--sp-3) var(--sp-4); }
.fs-adv summary {
  display: flex; align-items: center; gap: var(--sp-2);
  font-size: var(--fs-sm); font-weight: 600; color: var(--text-secondary);
  cursor: pointer; list-style: none; user-select: none; padding: var(--sp-1) 0;
}
.fs-adv summary::-webkit-details-marker { display: none; }
.fs-adv summary svg { width: 14px; height: 14px; transition: transform var(--dur-base) var(--ease-out); }
.fs-adv[open] summary svg { transform: rotate(90deg); }
.fs-adv .adv-body { padding: var(--sp-4) 0 var(--sp-2); display: flex; flex-direction: column; gap: var(--sp-4); }

/* 配音行 */
.dub-row { display: flex; align-items: center; gap: var(--sp-3); }
.dub-row .dub-label { font-size: var(--fs-sm); font-weight: 600; color: var(--text-secondary); }
.dub-row .dub-sub { font-size: var(--fs-caption); color: var(--text-tertiary); margin-top: 2px; }

/* 底部操作条 */
.action-bar {
  position: sticky; bottom: 0; z-index: 5;
  display: flex; align-items: center; gap: var(--sp-4);
  padding: var(--sp-4) var(--sp-5);
  background: linear-gradient(transparent, var(--bg-page) 24%);
  margin: 0 calc(var(--sp-5) * -1) calc(var(--sp-6) * -1);
  padding-left: calc(var(--sp-5) + 4px);
}
.action-bar .price-est { display: flex; align-items: baseline; gap: 6px; }
.action-bar .price-est b { font-size: 24px; font-weight: 750; }
.action-bar .price-est .u { font-size: var(--fs-caption); color: var(--text-tertiary); }
.action-bar .btn { margin-left: auto; min-width: 180px; height: 46px; border-radius: 12px; font-size: 15px; }

/* 右列：生成队列 */
.queue-col { position: sticky; top: calc(var(--shell-topbar-h) + var(--sp-5)); display: flex; flex-direction: column; gap: var(--sp-4); }
.queue-sec-title { display: flex; align-items: center; justify-content: space-between; font-size: var(--fs-sm); font-weight: 650; color: var(--text-secondary); padding: 0 var(--sp-1); }
.queue-sec-title a { font-size: var(--fs-caption); font-weight: 500; color: var(--brand-400); }

.q-task { padding: var(--sp-4); }
.q-task .q-top { display: flex; align-items: center; gap: var(--sp-3); margin-bottom: var(--sp-3); }
.q-task .q-icon {
  width: 34px; height: 34px; border-radius: 10px; flex: none;
  display: flex; align-items: center; justify-content: center;
  color: #fff; background: var(--brand-grad);
}
.q-task .q-icon svg { width: 16px; height: 16px; }
.q-task .q-name { font-size: var(--fs-sm); font-weight: 600; }
.q-task .q-sub { font-size: var(--fs-caption); color: var(--text-tertiary); margin-top: 2px; }
.q-task .q-pct { margin-left: auto; font-size: var(--fs-body); font-weight: 700; color: var(--brand-400); }
.q-task .progress { margin: var(--sp-2) 0 var(--sp-3); }
.q-task .q-foot { display: flex; align-items: center; justify-content: space-between; font-size: var(--fs-caption); color: var(--text-tertiary); }
.q-task .q-foot button { border: none; background: transparent; color: var(--text-tertiary); font-size: var(--fs-caption); cursor: pointer; }
.q-task .q-foot button:hover { color: var(--error); }

.q-item { display: flex; gap: var(--sp-3); padding: var(--sp-3); align-items: center; }
.q-item .thumb {
  width: 86px; height: 56px; border-radius: var(--r-sm); flex: none; overflow: hidden;
  background: linear-gradient(145deg, rgba(124,124,255,0.14), rgba(168,85,247,0.08));
  border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center; color: var(--text-tertiary);
}
.q-item .thumb svg { width: 18px; height: 18px; }
.q-item .t { font-size: var(--fs-sm); font-weight: 550; }
.q-item .s { font-size: var(--fs-caption); color: var(--text-tertiary); margin-top: 4px; display: flex; align-items: center; gap: 6px; }
.q-item .badge { height: 18px; font-size: 11px; padding: 0 6px; }

/* 面板通用：占位 hero 区 */
.panel-hero {
  position: relative; overflow: hidden;
  padding: var(--sp-7) var(--sp-6); margin-bottom: var(--sp-5);
  border-radius: var(--r-lg);
  background:
    radial-gradient(600px 240px at 18% 0%, rgba(124, 124, 255, 0.16), transparent 70%),
    radial-gradient(500px 220px at 85% 20%, rgba(34, 211, 238, 0.08), transparent 70%),
    var(--bg-surface);
  border: 1px solid var(--border);
}
.panel-hero h1 { font-size: 26px; font-weight: 750; }
.panel-hero p { margin-top: var(--sp-2); color: var(--text-secondary); font-size: var(--fs-sm); max-width: 640px; }

/* 功能入口三卡（AI 制图域首页） */
.tri-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--sp-4); }
@media (max-width: 1024px) { .tri-grid { grid-template-columns: 1fr; } }
.tri-card { padding: var(--sp-6) var(--sp-5); cursor: pointer; transition: all var(--dur-base) var(--ease-out); }
.tri-card:hover { transform: translateY(-4px); box-shadow: var(--glow-brand); border-color: var(--brand-500); }
.tri-card .icon {
  width: 44px; height: 44px; border-radius: 12px; margin-bottom: var(--sp-4);
  display: flex; align-items: center; justify-content: center; color: #fff;
  background: var(--brand-grad);
}
.tri-card:nth-child(2) .icon { background: linear-gradient(135deg, #0EA5E9, #22D3EE); }
.tri-card:nth-child(3) .icon { background: linear-gradient(135deg, #EC4899, #F472B6); }
.tri-card .icon svg { width: 20px; height: 20px; }
.tri-card h3 { font-size: 16px; margin-bottom: var(--sp-2); }
.tri-card p { font-size: var(--fs-sm); color: var(--text-secondary); line-height: 1.65; min-height: 44px; }
.tri-card .go { display: inline-flex; align-items: center; gap: 4px; margin-top: var(--sp-4); font-size: var(--fs-sm); font-weight: 600; color: var(--brand-400); }
.tri-card .go svg { width: 14px; height: 14px; }

/* tab 行（作品/资产/画廊） */
.tab-row { display: flex; gap: var(--sp-2); margin-bottom: var(--sp-5); flex-wrap: wrap; }
.works-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: var(--sp-4); }
.work-card { overflow: hidden; cursor: pointer; transition: all var(--dur-base) var(--ease-out); }
.work-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.work-card .cover { aspect-ratio: 16 / 10; background: linear-gradient(145deg, rgba(124,124,255,0.12), rgba(168,85,247,0.06)); display: flex; align-items: center; justify-content: center; color: var(--text-tertiary); position: relative; }
.work-card .cover svg { width: 28px; height: 28px; opacity: 0.6; }
.work-card .cover .badge { position: absolute; top: var(--sp-3); left: var(--sp-3); }
.work-card .body { padding: var(--sp-3) var(--sp-4) var(--sp-4); }
.work-card .t { font-size: var(--fs-sm); font-weight: 600; }
.work-card .s { font-size: var(--fs-caption); color: var(--text-tertiary); margin-top: 4px; }

/* 上传拖拽区（爆款复刻/资产） */
.drop-zone {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: var(--sp-3); padding: var(--sp-8) var(--sp-5); text-align: center;
  border: 1.5px dashed var(--border-strong); border-radius: var(--r-lg);
  background: var(--bg-surface); cursor: pointer;
  transition: all var(--dur-fast) ease;
}
.drop-zone:hover, .drop-zone.is-drag { border-color: var(--brand-500); background: var(--brand-soft); }
.drop-zone .icon {
  width: 56px; height: 56px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: var(--brand-soft); color: var(--brand-400);
}
.drop-zone .icon svg { width: 24px; height: 24px; }
.drop-zone .t { font-size: var(--fs-body); font-weight: 600; }
.drop-zone .s { font-size: var(--fs-caption); color: var(--text-tertiary); }

/* ---------- 爆款复刻上传区（科技感：网格底纹 + 渐变光晕 + 双光环图标 + 格式徽章） ---------- */
.drop-zone.hr-up {
  position: relative; overflow: hidden;
  gap: 10px; padding: var(--sp-7) var(--sp-5);
  border: 1.5px dashed rgba(124, 108, 255, 0.45);
  background:
    radial-gradient(90% 120% at 50% -20%, rgba(124, 108, 255, 0.12), transparent 60%),
    var(--bg-surface);
}
.drop-zone.hr-up::before {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background-image:
    linear-gradient(rgba(124, 108, 255, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(124, 108, 255, 0.06) 1px, transparent 1px);
  background-size: 20px 20px;
  mask-image: radial-gradient(85% 90% at 50% 40%, #000 30%, transparent 100%);
  -webkit-mask-image: radial-gradient(85% 90% at 50% 40%, #000 30%, transparent 100%);
}
.drop-zone.hr-up > * { position: relative; z-index: 1; }
.drop-zone.hr-up:hover, .drop-zone.hr-up.is-drag {
  border-color: var(--brand-400); background: radial-gradient(90% 120% at 50% -20%, rgba(124, 108, 255, 0.2), transparent 60%), var(--brand-soft);
  box-shadow: 0 0 0 4px rgba(124, 108, 255, 0.1), inset 0 0 24px rgba(124, 108, 255, 0.08);
}
.drop-zone.hr-up.is-drag { border-style: solid; transform: scale(1.008); }
.hr-up-icon {
  position: relative; width: 64px; height: 64px; border-radius: 20px;
  display: flex; align-items: center; justify-content: center;
  color: var(--brand-300);
  background: linear-gradient(160deg, rgba(124, 108, 255, 0.22), rgba(124, 108, 255, 0.06));
  border: 1px solid rgba(124, 108, 255, 0.4);
  box-shadow: 0 6px 20px rgba(99, 102, 241, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.12);
  transition: transform var(--dur-base) var(--ease-out);
}
.drop-zone.hr-up:hover .hr-up-icon, .drop-zone.hr-up.is-drag .hr-up-icon { transform: translateY(-3px) scale(1.04); }
.hr-up-icon svg { position: relative; z-index: 1; filter: drop-shadow(0 0 8px rgba(124, 108, 255, 0.65)); }
.hr-up-icon .ring {
  position: absolute; inset: -7px; border-radius: 24px;
  border: 1.5px solid rgba(124, 108, 255, 0.35); opacity: 0;
  animation: hrUpRing 2.6s ease-out infinite;
}
.hr-up-icon .ring.r2 { animation-delay: 1.3s; }
@keyframes hrUpRing { 0% { opacity: 0.75; transform: scale(0.92); } 70%, 100% { opacity: 0; transform: scale(1.22); } }
.hr-up-title { font-size: 15px; font-weight: 700; color: var(--text-primary); }
.hr-up-title span {
  color: var(--brand-300); text-decoration: underline; text-underline-offset: 3px;
  text-decoration-color: rgba(124, 108, 255, 0.5); cursor: pointer;
}
.hr-up-sub { font-size: var(--fs-caption); color: var(--text-tertiary); }
.hr-up-meta { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin-top: 6px; }
.hr-up-chip {
  font-size: 10.5px; font-weight: 650; letter-spacing: 0.3px; color: var(--brand-300);
  padding: 3px 9px; border-radius: var(--r-full);
  background: rgba(124, 108, 255, 0.1); border: 1px solid rgba(124, 108, 255, 0.28);
}

/* ============================================================
   创作首页（home）：中央对话框 + 灵感瀑布流
   ============================================================ */

/* 顶部问候 */
.home-greet { text-align: center; margin: var(--sp-4) 0 var(--sp-5); }
.home-greet h1 { font-size: 26px; font-weight: 780; letter-spacing: -0.01em; }
.home-greet h1 .grad-text { background: var(--brand-grad-hi); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.home-greet p { margin-top: var(--sp-2); font-size: var(--fs-sm); color: var(--text-tertiary); }

/* ---------- AI 视频：类型选择卡片墙 ---------- */
.vsp-wrap { max-width: 1280px; margin: 0 auto; padding: var(--sp-6) var(--sp-6) var(--sp-8); }
.vsp-head { margin-bottom: var(--sp-5); }
.vsp-head h1 { font-size: 24px; font-weight: 750; letter-spacing: -0.01em; }
.vsp-head .sub { margin-top: 6px; font-size: var(--fs-sm); color: var(--text-tertiary); }
.vsp-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--sp-4); }
.vsp-card {
  position: relative; display: flex; flex-direction: column; justify-content: flex-end;
  aspect-ratio: 16 / 10.6; padding: var(--sp-4);
  border-radius: var(--r-lg); overflow: hidden; cursor: pointer;
  background: var(--bg-elevated); border: 1px solid var(--border);
  text-align: left; transition: transform var(--dur-base) var(--ease-out), box-shadow var(--dur-base) ease, border-color var(--dur-base) ease;
}
.vsp-card:hover { transform: translateY(-4px); border-color: var(--border-strong); box-shadow: var(--shadow-lg); }
.vsp-card video, .vsp-card .vsp-poster, .vsp-card .v-fallback {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: 0;
}
.vsp-card .v-fallback { z-index: 0; }
.vsp-card .vsp-poster { background: var(--bg-inset) center/cover no-repeat; z-index: 1; }
.vsp-card video { z-index: 2; background: transparent; }
.vsp-card::after {
  content: ""; position: absolute; inset: 0; z-index: 3;
  background: linear-gradient(180deg, rgba(6, 8, 14, 0) 34%, rgba(6, 8, 14, 0.66) 78%, rgba(6, 8, 14, 0.88) 100%);
  pointer-events: none;
}
.vsp-card .v-info { position: relative; z-index: 4; width: 100%; display: flex; align-items: flex-end; gap: var(--sp-2); }
.vsp-card .v-t { font-size: 15px; font-weight: 680; color: #fff; text-shadow: 0 1px 8px rgba(0, 0, 0, 0.5); }
.vsp-card .v-d {
  margin-top: 4px; font-size: 12px; line-height: 1.5; color: rgba(255, 255, 255, 0.78);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.vsp-card .v-go {
  margin-left: auto; flex: none; width: 28px; height: 28px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: #fff; background: rgba(255, 255, 255, 0.14); backdrop-filter: blur(6px);
  transition: all var(--dur-fast) ease;
}
.vsp-card .v-go svg { width: 14px; height: 14px; }
.vsp-card:hover .v-go { background: var(--brand-600); transform: translateX(2px); }
.vsp-badge {
  position: absolute; top: 12px; left: 12px; z-index: 4;
  padding: 3px 10px; font-size: 11px; font-weight: 650; color: #fff;
  background: rgba(8, 10, 18, 0.55); border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: var(--r-full); backdrop-filter: blur(6px);
}
/* 内容形态小图标（后台上传）：卡片右上角，与左上「推荐」标错开 */
.vsp-card .v-icon {
  position: absolute; top: 12px; right: 12px; z-index: 4;
  width: 26px; height: 26px; object-fit: contain; border-radius: var(--r-sm);
  background: rgba(8, 10, 18, 0.5); backdrop-filter: blur(6px);
  padding: 3px; box-sizing: content-box;
}
@media (max-width: 1180px) { .vsp-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 880px) { .vsp-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .vsp-grid { grid-template-columns: 1fr; } }

/* ---------- AI 视频步骤2：脚本列表（旧版布局：工具栏 + 卡片 + 结算条） ---------- */
.vs-left-wide { min-height: 0; }

/* 顶部工具栏右侧：合计预估 + 批量设置 */
.sc-toolbar-right { margin-left: auto; display: flex; align-items: center; gap: 10px; flex: none; }
.sc-total { font-size: 12px; color: var(--text-secondary); white-space: nowrap; }
.sc-total b { color: #FBBF24; font-weight: 700; }
.sc-batch { position: relative; }
.sc-batch-btn {
  display: flex; align-items: center; gap: 5px; padding: 6px 12px; font-size: 12px; font-weight: 600;
  color: var(--text-primary); background: var(--bg-surface); border: 1px solid var(--border);
  border-radius: 999px; cursor: pointer; transition: all .15s ease; white-space: nowrap;
}
.sc-batch-btn:hover { border-color: rgba(124, 108, 255, .5); background: rgba(124, 108, 255, .08); }
.sc-batch-btn i { font-style: normal; font-size: 10px; color: var(--text-tertiary); }

/* 脚本卡片：行1 标题+价格+生成按钮 / 行2 参数chips / 折叠编辑 / 行3 操作 */
.sc-card { display: flex; flex-direction: column; gap: 10px; padding: 14px 16px; border: 1px solid var(--border); border-radius: var(--r-md); background: var(--bg-surface); transition: border-color .18s ease, box-shadow .18s ease; }
.sc-row1 { display: flex; align-items: center; gap: 10px; }
.sc-title { flex: 1; min-width: 0; font-size: 14px; font-weight: 700; color: var(--text-primary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; cursor: pointer; }
.sc-row1-ops { display: flex; align-items: center; gap: 8px; flex: none; }
.sc-price {
  display: flex; align-items: center; gap: 4px; padding: 5px 12px; font-size: 13px; font-weight: 700;
  color: #FBBF24; background: rgba(251, 191, 36, .1); border: 1px solid rgba(251, 191, 36, .3); border-radius: 999px;
}
.sc-price i { font-style: normal; font-size: 11px; }
.sc-gen-btn {
  display: flex; align-items: center; gap: 5px; padding: 7px 16px; font-size: 12px; font-weight: 700;
  color: #fff; background: var(--brand-grad, linear-gradient(135deg, #7C6CFF, #5B8DFF));
  border: none; border-radius: 999px; cursor: pointer; transition: all .15s ease; white-space: nowrap;
}
.sc-gen-btn:hover:not([disabled]) { filter: brightness(1.12); }
.sc-gen-btn[disabled] { opacity: .55; cursor: wait; }
.sc-fold {
  width: 24px; height: 24px; display: flex; align-items: center; justify-content: center;
  font-size: 11px; color: var(--text-tertiary); background: transparent;
  border: 1px solid var(--border); border-radius: 50%; cursor: pointer; transition: all .15s ease;
}
.sc-fold:hover { color: var(--text-primary); border-color: var(--border-strong); }
.sc-chips { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.sc-chip {
  display: inline-flex; align-items: center; gap: 5px; padding: 5px 12px; font-size: 11.5px;
  color: var(--text-secondary); background: var(--bg-inset);
  border: 1px solid var(--border); border-radius: 999px; white-space: nowrap;
}
.sc-chip svg { width: 12px; height: 12px; }
.sc-chip-style { color: #A78BFA; border-color: rgba(167, 139, 250, .4); background: rgba(167, 139, 250, .1); }
.sc-chip-hint { margin-left: auto; font-size: 11px; color: var(--text-tertiary); white-space: nowrap; }
/* 可点击参数 chip（点击弹窗修改，旧版 pchip 同款交互） */
.sc-chip-btn { cursor: pointer; font-family: inherit; transition: all .15s ease; }
.sc-chip-btn:hover { color: var(--brand-300, #A99BFF); border-color: rgba(124, 108, 255, .55); background: rgba(124, 108, 255, .1); }
.sc-chip-accent { color: #A78BFA; border-color: rgba(167, 139, 250, .45); background: rgba(167, 139, 250, .1); }
/* 卡片主体：默认收起（hidden 属性控制），展开后纵向排布 */
.sc-body { display: flex; flex-direction: column; gap: 10px; }
.sc-body[hidden], .sc-foldarea[hidden], .sc-content-collapse[hidden] { display: none; }
.sc-edit {
  width: 100%; padding: 10px 12px; font-size: 12px; line-height: 1.75; color: var(--text-primary);
  font-family: inherit; background: color-mix(in srgb, var(--bg-primary) 65%, transparent);
  border: 1px solid rgba(124, 108, 255, .5); border-radius: 10px; resize: vertical; min-height: 120px;
}
.sc-edit:focus { outline: none; border-color: var(--brand-500, #7C6CFF); }
.sc-content-collapse .sc-content { margin: 0; font-size: 12px; line-height: 1.75; color: var(--text-secondary); white-space: pre-wrap; max-height: 132px; overflow-y: auto; padding: 10px 12px; border-radius: 10px; background: color-mix(in srgb, var(--bg-primary) 65%, transparent); border: 1px solid var(--border); scrollbar-width: thin; scrollbar-color: var(--border-strong) transparent; }
/* L3 脚本卡：结构化展示（sePretty），限高滚动，避免长 JSON 撑爆列表 */
.sc-content-collapse .sc-pretty { max-height: 320px; overflow-y: auto; padding: 4px 2px; scrollbar-width: thin; scrollbar-color: var(--border-strong) transparent; }
.sc-content-collapse .sc-pretty .se-sec { padding: 10px 12px; }
.sc-content-collapse .sc-pretty .se-tip-bar { display: none; }
/* 解析兜底警示条（疑似 JSON 但无法解析） */
.se-parse-hint { padding: 12px 14px; border-radius: 10px; font-size: 12px; line-height: 1.7; color: #B45309; background: rgba(245, 158, 11, .1); border: 1px solid rgba(245, 158, 11, .35); }
.sc-ops { display: flex; justify-content: flex-end; gap: 8px; }

/* ---------- 视频参数弹窗（旧版 paramModal 同款交互） ---------- */
.pm-modal { width: min(560px, 92vw); max-width: min(560px, 92vw); max-height: 80vh; display: flex; flex-direction: column; padding: 0; }
.pm-modal .modal-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: var(--sp-4) var(--sp-5); border-bottom: 1px solid var(--border); flex: none;
}
.pm-modal .modal-head h3 { display: flex; align-items: center; gap: 8px; font-size: 15px; font-weight: 700; color: var(--text-primary); }
.pm-modal .modal-close {
  width: 28px; height: 28px; display: flex; align-items: center; justify-content: center;
  color: var(--text-tertiary); background: transparent; border: none; border-radius: 8px; cursor: pointer; font-size: 14px;
}
.pm-modal .modal-close:hover { color: var(--text-primary); background: var(--bg-hover); }
.pm-modal .modal-body { overflow-y: auto; padding: var(--sp-4) var(--sp-5); min-height: 0; flex: 1; }
.pm-scope { font-size: 12px; font-weight: 500; color: var(--text-tertiary); }
/* 模型/参数网格：等宽栅格（flex 换行会被长模型名撑破对齐），子列按内容自适应列数 */
.pm-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; }
.pm-grid-3 { grid-template-columns: repeat(3, 1fr); display: grid; }
.pm-grid-4 { grid-template-columns: repeat(4, 1fr); display: grid; }
.pm-cell {
  display: flex; flex-direction: column; align-items: flex-start; gap: 3px;
  padding: 10px 14px; text-align: left; cursor: pointer;
  color: var(--text-secondary); background: var(--bg-inset);
  border: 1px solid var(--border); border-radius: var(--r-md, 10px);
  transition: all .15s ease;
}
.pm-cell b { font-size: 13px; font-weight: 700; color: var(--text-primary); }
.pm-cell span { font-size: 11px; color: var(--text-tertiary); }
/* 模型卡片 logo：行内小图与文字同排，选不中时 onerror 隐藏退化原布局 */
.pm-cell .pm-logo { width: 24px; height: 24px; border-radius: 6px; padding: 2px; background: var(--bg-elevated); object-fit: contain; align-self: center; margin-bottom: 2px; }
.pm-cell:hover { border-color: rgba(124, 108, 255, .55); background: rgba(124, 108, 255, .08); }
.pm-cell.is-on { border-color: var(--brand-500, #7C6CFF); background: rgba(124, 108, 255, .12); box-shadow: 0 0 0 3px rgba(124, 108, 255, .12); }
.pm-cell.is-on b { color: var(--brand-300, #A99BFF); }
.pm-grid-3 .pm-cell, .pm-grid-4 .pm-cell { align-items: center; text-align: center; }
/* 比例图标：以高度为基准按真实比例算宽（16:9 宽扁 / 9:16 竖长 / 1:1 方），禁止 max-height 压扁比例 */
.pm-ratio-ico { display: block; height: 22px; width: auto; aspect-ratio: 16 / 9; border: 1.5px solid currentColor; border-radius: 3px; opacity: .75; margin-bottom: 2px; }
/* 模型卡两行显示：第一行 logo+名称（长名省略号），第二行备注；卡片等宽不互相撑破 */
.pm-cell-model { align-items: stretch; text-align: left; }
.pm-cell-model .pm-top { display: flex; align-items: center; gap: 7px; min-width: 0; }
.pm-cell-model .pm-top b { flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pm-cell-model .pm-top .pm-logo { align-self: center; margin-bottom: 0; }
.pm-cell-model .pm-sub { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pm-modal .modal-foot {
  padding: var(--sp-3) var(--sp-5); border-top: 1px solid var(--border);
  display: flex; align-items: center; gap: 8px; flex: none;
}

/* ============================================================
   AI 制图工作台（套图 / A+ 详情页 / 商图智绘）
   布局完全复用视频工作台 vs-* 一屏体系：
   .vs-head 吸顶 / .vs-work 锁一屏 / 左 .vs-form 独立滚动 + .vs-gen-bar 固定 /
   右 .vs-tabs 恒顶 + .vs-scroll 独立滚动 —— 页面级（.view）不出现滚动条
   ============================================================ */
/* 左栏生成条：主色渐变大按钮（制图专属，比例与视频版一致） */
.imgstudio .btn-gen {
  width: 100%; height: 46px; border: none; border-radius: 14px; cursor: pointer;
  font-size: 15px; font-weight: 700; color: #fff; font-family: inherit;
  background: var(--brand-grad); transition: all .18s ease;
  box-shadow: 0 6px 18px rgba(99, 102, 241, .35);
}
.imgstudio .btn-gen:hover:not(:disabled) { filter: brightness(1.08); transform: translateY(-1px); }
.imgstudio .btn-gen:disabled { background: var(--bg-inset); color: var(--text-tertiary); box-shadow: none; cursor: not-allowed; }
.imgstudio .gen-hint { margin-top: 8px; text-align: center; font-size: 11.5px; color: var(--text-tertiary); }
/* 参考图缩略（上传中旋转光圈 + 完成闪烁边） */
.ref-thumbs { display: flex; flex-wrap: wrap; gap: 10px; }
.ref-thumbs:not(:empty) { margin-bottom: 12px; }
.ref-thumb {
  position: relative; width: 86px; aspect-ratio: 1; border-radius: 12px; overflow: hidden;
  border: 1px solid var(--border); background: var(--bg-inset);
}
.ref-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ref-thumb .x {
  position: absolute; top: 5px; right: 5px; width: 20px; height: 20px; border-radius: 50%;
  border: none; cursor: pointer; background: rgba(0, 0, 0, .65); color: #fff; font-size: 12px; line-height: 1;
}
.ref-thumb.uploading::after {
  content: ''; position: absolute; inset: 0;
  background: rgba(10, 10, 20, .45);
}
.ref-thumb .ref-spin {
  position: absolute; left: 50%; top: 50%; z-index: 2; width: 20px; height: 20px; margin: -10px 0 0 -10px;
  border-radius: 50%; border: 2px solid rgba(124, 108, 255, .3); border-top-color: #A99BFF;
  animation: igRotate .9s linear infinite;
}
.ref-thumb.done { border-color: rgba(99, 224, 154, .6); box-shadow: 0 0 0 2px rgba(99, 224, 154, .18); }
@keyframes igRotate { to { transform: rotate(360deg); } }
/* 制图工具上传区：横排紧凑版式（图标 + 文案列），避免竖排大内边距把左栏撑高 */
.drop-zone.is-up {
  flex-direction: row; align-items: center; gap: var(--sp-4);
  padding: 14px 16px; text-align: left;
  border: 1.5px dashed rgba(124, 124, 255, .32); border-radius: var(--r-md);
  background:
    radial-gradient(130% 190% at 0% 0%, rgba(124, 124, 255, .1), transparent 58%),
    var(--bg-inset);
}
.drop-zone.is-up:hover {
  border-color: var(--brand-500);
  background:
    radial-gradient(130% 190% at 0% 0%, rgba(124, 124, 255, .18), transparent 58%),
    var(--brand-soft);
}
.drop-zone.is-up.is-drag {
  border-style: solid; border-color: var(--brand-400);
  box-shadow: 0 0 0 3px rgba(124, 124, 255, .14);
}
.drop-zone.is-up .icon {
  width: 44px; height: 44px; flex: none; border-radius: 13px;
  background: rgba(124, 124, 255, .14); color: var(--brand-400);
  border: 1px solid rgba(124, 124, 255, .26);
  transition: transform var(--dur-fast) var(--ease-out);
}
.drop-zone.is-up .icon svg { width: 20px; height: 20px; }
.drop-zone.is-up:hover .icon { transform: translateY(-2px); }
.drop-zone.is-up .t { font-size: var(--fs-sm); font-weight: 600; color: var(--text-primary); }
.drop-zone.is-up .s { font-size: var(--fs-caption); color: var(--text-tertiary); line-height: 1.45; }
/* 文案列：标题 / 说明 / 商品库入口纵向堆叠，窄栏下不换行错位 */
.dz-main { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; min-width: 0; }
/* 商品库入口：品牌色描边胶囊，hover 实心 */
.dz-lib {
  display: inline-flex; align-items: center; gap: 5px; margin-top: 4px;
  padding: 5px 11px; border-radius: var(--r-full); cursor: pointer;
  font-family: inherit; font-size: 11.5px; font-weight: 600; line-height: 1.3;
  color: var(--brand-400); background: rgba(124, 124, 255, .1);
  border: 1px solid rgba(124, 124, 255, .3);
  transition: all var(--dur-fast) ease;
}
.dz-lib:hover {
  background: var(--brand-500); border-color: var(--brand-500); color: #fff;
  box-shadow: 0 2px 12px rgba(124, 124, 255, .35);
}
.dz-lib:active { transform: translateY(1px); }
/* 尺寸 chips（复用旧版视觉：比例小矩形图标） */
.size-chips { display: flex; flex-wrap: wrap; gap: 10px; }
.size-chip {
  display: inline-flex; align-items: center; gap: 7px; padding: 9px 14px;
  font-size: 12.5px; color: var(--text-secondary); cursor: pointer;
  background: var(--bg-inset); border: 1px solid var(--border); border-radius: 12px;
  transition: all .15s ease; font-family: inherit;
}
.size-chip:hover { border-color: rgba(124, 108, 255, .5); }
.size-chip.on { border-color: var(--brand-500); background: rgba(124, 108, 255, .1); color: var(--brand-300); font-weight: 600; }
.size-ico { width: 18px; height: 12px; flex: none; }
.size-ico rect { fill: none; stroke: currentColor; stroke-width: 1.4; }
.size-chip.on .size-ico rect { fill: rgba(124, 108, 255, .25); }
/* 风格卡网格 */
.ig-style-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(124px, 1fr)); gap: 10px; }
.ig-style-card {
  position: relative; padding: 12px 10px; border-radius: 12px; border: 1px solid var(--border);
  background: var(--bg-inset); cursor: pointer; transition: all .15s; text-align: center;
}
.ig-style-card:hover { border-color: rgba(124, 108, 255, .5); transform: translateY(-1px); }
.ig-style-card.on { border-color: var(--brand-500); background: rgba(124, 108, 255, .08); }
.ig-style-card .ico { font-size: 20px; display: block; margin-bottom: 5px; }
.ig-style-card b { font-size: 12.5px; display: block; color: var(--text-primary); }
.ig-style-card .d { font-size: 10.5px; color: var(--text-tertiary); display: block; margin-top: 2px; }
.ig-style-card .ck { position: absolute; top: 6px; right: 8px; color: var(--brand-400); font-size: 12px; font-weight: 700; }
/* 套图结构：模式行 + 类型行 + 步进器 */
.mode-row {
  display: flex; gap: 12px; align-items: flex-start; padding: 13px 14px; border-radius: 12px;
  border: 1px solid var(--border); cursor: pointer; transition: all .2s; margin-bottom: 10px;
}
.mode-row:hover { border-color: rgba(124, 108, 255, .4); }
.mode-row.on { border-color: rgba(124, 108, 255, .5); background: rgba(124, 108, 255, .07); }
.mode-row .dot { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--border); flex: none; margin-top: 2px; position: relative; }
.mode-row.on .dot { border-color: var(--brand-500); }
.mode-row.on .dot::after { content: ''; position: absolute; inset: 3px; border-radius: 50%; background: var(--brand-500); }
.mode-row .m-t { font-size: 13px; font-weight: 700; color: var(--text-primary); }
.mode-row .m-d { font-size: 11.5px; color: var(--text-tertiary); margin-top: 3px; }
.ig-total-bar {
  display: flex; align-items: center; gap: 8px; padding: 9px 14px; margin: 4px 0 10px;
  border-radius: 10px; font-size: 12.5px; font-weight: 700; color: #E0B84D;
  background: rgba(224, 184, 77, .1); border: 1px solid rgba(224, 184, 77, .4);
}
.ig-total-bar b { font-size: 14px; }
.ig-total-bar .cap { margin-left: auto; font-weight: 500; font-size: 11.5px; opacity: .85; }
.ig-total-bar.warn { color: #E5484D; background: rgba(229, 72, 77, .1); border-color: rgba(229, 72, 77, .5); }
.type-row {
  display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 12px;
  border: 1px solid var(--border); margin-bottom: 9px; transition: all .2s;
}
.type-row.on { border-color: rgba(124, 108, 255, .35); background: rgba(124, 108, 255, .04); }
.type-row .cbx {
  width: 18px; height: 18px; border-radius: 5px; border: 1.5px solid var(--border); flex: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center; font-size: 11px; color: transparent; transition: all .15s;
}
.type-row.on .cbx { background: var(--brand-500); border-color: var(--brand-500); color: #fff; }
.type-row .t-name { font-size: 13px; font-weight: 700; cursor: pointer; display: flex; align-items: center; gap: 7px; color: var(--text-primary); }
.type-row .t-desc { font-size: 11px; color: var(--text-tertiary); margin-top: 2px; }
.ai-tag {
  font-size: 10px; font-weight: 700; padding: 2px 8px; border-radius: 999px;
  background: var(--text-primary); color: var(--bg-surface); letter-spacing: .5px;
}
.step { display: flex; align-items: center; gap: 2px; margin-left: auto; flex: none; border: 1px solid var(--border); border-radius: 999px; overflow: hidden; }
.step button {
  width: 30px; height: 28px; border: none; cursor: pointer; background: transparent;
  color: var(--text-secondary); font-size: 14px; transition: all .15s; font-family: inherit;
}
.step button:hover:not(:disabled) { color: var(--brand-300); background: rgba(124, 108, 255, .12); }
.step button:disabled { opacity: .3; cursor: not-allowed; }
.step b { min-width: 26px; text-align: center; font-size: 13px; }
/* A+ 优化项网格 */
.ig-opt-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.ig-opt-item {
  display: flex; gap: 9px; align-items: flex-start; padding: 11px 12px; cursor: pointer;
  border: 1px solid var(--border); border-radius: 12px; background: var(--bg-inset); transition: all .15s;
}
.ig-opt-item:hover { border-color: rgba(124, 108, 255, .45); }
.ig-opt-item.on { border-color: rgba(124, 108, 255, .5); background: rgba(124, 108, 255, .07); }
.ig-opt-item .cbx {
  width: 16px; height: 16px; border-radius: 5px; border: 1.5px solid var(--border); flex: none; margin-top: 1px;
  display: flex; align-items: center; justify-content: center; font-size: 10px; color: transparent; transition: all .15s;
}
.ig-opt-item.on .cbx { background: var(--brand-500); border-color: var(--brand-500); color: #fff; }
.ig-opt-item .o-n { font-size: 12.5px; font-weight: 700; color: var(--text-primary); }
.ig-opt-item .o-d { font-size: 10.5px; color: var(--text-tertiary); margin-top: 2px; }
/* 右栏：结果 / 历史 / 示例 */
/* 示例 hero：渐变大标题 + 紫色辉光，底部淡出分隔 */
.is-demo-hero {
  text-align: center; padding: 22px 24px 26px; margin-bottom: 16px; border-radius: 16px;
  background:
    radial-gradient(60% 100% at 50% 0%, rgba(124, 108, 255, .12), transparent 70%),
    var(--bg-inset);
  border: 1px solid var(--border);
}
.is-demo-hero h2 {
  font-size: 24px; font-weight: 800; letter-spacing: 2px;
  background: linear-gradient(120deg, #F5F6FC 20%, #A99BFF 60%, #7C6CFF);
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 0 14px rgba(124, 108, 255, .35));
}
.is-demo-hero p { font-size: 12.5px; color: var(--text-tertiary); margin-top: 8px; }
.is-empty {
  border: 1.5px dashed var(--border); border-radius: 14px; padding: 46px 20px;
  text-align: center; color: var(--text-tertiary); font-size: 13px; line-height: 1.9;
  background: repeating-linear-gradient(45deg, rgba(255, 255, 255, .012) 0 10px, transparent 10px 20px);
}
.prog-card {
  border: 1px solid rgba(124, 108, 255, .3); background: rgba(124, 108, 255, .05);
  border-radius: 12px; padding: 14px 16px; margin-bottom: 12px;
}
.prog-head { display: flex; justify-content: space-between; align-items: center; font-size: 12.5px; margin-bottom: 9px; gap: 10px; }
.prog-head b { color: var(--text-primary); display: flex; align-items: center; gap: 8px; }
.prog-head span { color: var(--text-tertiary); font-weight: 700; flex: none; }
.prog-bar { height: 8px; border-radius: 99px; background: rgba(124, 108, 255, .15); overflow: hidden; }
.prog-bar i { display: block; height: 100%; border-radius: 99px; background: var(--brand-grad); transition: width .45s ease; }
.ig-result-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.ig-cell {
  position: relative; border-radius: 12px; overflow: hidden; aspect-ratio: 1;
  border: 1px solid var(--border); background: var(--bg-inset);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 8px; padding: 12px; font-size: 12px; color: var(--text-tertiary); text-align: center;
}
.ig-cell.has-img { cursor: zoom-in; }
.ig-cell.has-img img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform .25s ease; }
.ig-cell.has-img:hover img { transform: scale(1.04); }
.ig-cell.has-img .r-label {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 2; padding: 18px 10px 7px;
  font-size: 11px; color: #fff; background: linear-gradient(transparent, rgba(0, 0, 0, .72));
}
.ig-cell .dl {
  position: absolute; top: 7px; right: 7px; z-index: 2; width: 26px; height: 26px; border-radius: 8px;
  border: none; cursor: pointer; background: rgba(0, 0, 0, .55); color: #fff; font-size: 12px;
  opacity: 0; transition: opacity .15s;
}
.ig-cell.has-img:hover .dl { opacity: 1; }
.ig-cell .dl:hover { background: var(--brand-500); }
.ig-cell.is-fail { border-color: rgba(229, 72, 77, .4); }
.ig-cell .r-sub { font-size: 10.5px; color: var(--text-tertiary); }
.ig-cell .r-label { font-size: 11px; color: var(--text-secondary); }
.ig-spin {
  display: inline-block; width: 15px; height: 15px; border-radius: 50%;
  border: 2px solid rgba(124, 108, 255, .28); border-top-color: #A99BFF;
  animation: igRotate .9s linear infinite;
}
.slot-prog { width: 80%; height: 5px; border-radius: 99px; background: rgba(124, 108, 255, .15); overflow: hidden; }
.slot-prog i { display: block; height: 100%; background: var(--brand-grad); transition: width .4s ease; }
/* 软文结果卡 */
.article-card { background: var(--bg-inset); border: 1px solid var(--border); border-radius: 14px; padding: 16px 18px; }
.art-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.art-head b { font-size: 14px; color: var(--text-primary); }
.art-body { font-size: 13px; line-height: 1.9; color: var(--text-secondary); white-space: pre-wrap; word-break: break-word; }
/* 历史行 */
.his-list { display: flex; flex-direction: column; }
.his-row { display: flex; align-items: center; gap: 12px; padding: 12px 4px; border-bottom: 1px solid var(--border); font-size: 12.5px; }
.his-row:last-child { border-bottom: none; }
.his-row .h-meta { color: var(--text-tertiary); min-width: 0; }
.his-row .h-cost { margin-left: auto; color: #E0B84D; font-weight: 700; flex: none; }
.his-status { font-size: 11px; font-weight: 700; padding: 2px 9px; border-radius: 999px; flex: none; }
.his-status.ok { background: rgba(46, 174, 96, .12); color: #34C77B; }
.his-status.part { background: rgba(224, 138, 0, .12); color: #E0A03C; }
.his-status.bad { background: rgba(224, 68, 68, .12); color: #E5484D; }
.his-status.run { background: rgba(124, 108, 255, .12); color: #A99BFF; }

/* ---------- 制图历史：订单式布局（沿用旧版 image-history 口径）+ 搜索 ---------- */
.his-filter {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 14px 16px; background: var(--bg-surface);
  border: 1px solid var(--border); border-radius: 14px; margin-bottom: 14px;
}
.his-filter .f-kw { flex: 1; min-width: 180px; max-width: 320px; }
.his-filter .f-date { flex: 0 0 150px; }
.his-filter .f-sep { color: var(--text-tertiary); font-size: 12px; }
.his-filter .f-btn {
  padding: 8px 14px; height: 36px; border-radius: 10px; border: 1px solid var(--border);
  background: var(--bg-inset); color: var(--text-secondary); font-size: 13px; cursor: pointer;
  transition: all .15s ease;
}
.his-filter .f-btn:hover { border-color: var(--brand-400); color: var(--brand-300); }
.his-filter .f-btn.on { background: var(--brand-grad); color: #fff; border-color: transparent; box-shadow: 0 4px 12px rgba(99, 102, 241, .28); }

.empty-box {
  border: 1.5px dashed var(--border-strong); border-radius: 16px; padding: 60px 20px;
  text-align: center; color: var(--text-tertiary); font-size: 13px;
}
.empty-box a { color: var(--brand-300); font-weight: 700; cursor: pointer; }

/* ---------- 商图智绘历史：软文记录表（旧版 commerce-history 口径，V2 暗色主题） ---------- */
.ch-count { font-size: 13px; font-weight: 700; color: var(--text-secondary); margin-bottom: 10px; }
.ch-table { width: 100%; border-collapse: collapse; font-size: 12.5px; background: var(--bg-surface); border: 1px solid var(--border); border-radius: 14px; overflow: hidden; }
.ch-table th { text-align: left; color: var(--text-tertiary); font-weight: 600; padding: 9px 12px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.ch-table td { padding: 10px 12px; border-bottom: 1px solid var(--border); color: var(--text-secondary); }
.ch-table tbody tr:last-child td { border-bottom: none; }
.ch-table tbody tr:hover td { background: rgba(124, 108, 255, .06); }
.ch-table .nowrap { white-space: nowrap; }
.ch-table .right { text-align: right; }
.ch-table .dim { color: var(--text-tertiary); }
.ch-thumb { width: 42px; height: 42px; border-radius: 8px; object-fit: cover; border: 1px solid var(--border); display: block; cursor: zoom-in; }
.ch-btn {
  border: 1px solid var(--border); background: var(--bg-inset); color: var(--text-secondary);
  border-radius: 999px; padding: 6px 14px; font-size: 12px; font-weight: 700; cursor: pointer; transition: all .15s;
}
.ch-btn:hover { border-color: rgba(124, 108, 255, .6); color: var(--brand-300); }
.ch-mask { position: fixed; inset: 0; z-index: 9000; background: rgba(8, 10, 22, .55); backdrop-filter: blur(3px); display: flex; align-items: center; justify-content: center; padding: 20px; }
.ch-dialog { width: min(860px, 94vw); max-height: 86vh; overflow-y: auto; background: var(--bg-surface); border: 1px solid var(--border); border-radius: 16px; padding: 22px 24px; box-shadow: 0 24px 70px rgba(0, 0, 0, .4); }
.ch-dlg-head { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; flex-wrap: wrap; }
.ch-dlg-title { font-size: 14px; font-weight: 700; color: var(--text-primary); }
.ch-extra { font-size: 12.5px; color: var(--text-tertiary); margin-bottom: 10px; }
.ch-article { font-size: 13px; color: var(--text-secondary); white-space: pre-wrap; line-height: 1.9; max-height: 340px; overflow-y: auto; }
.ch-sub { font-size: 13px; font-weight: 700; color: var(--text-secondary); margin: 16px 0 10px; }
.ch-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; }
.ch-cell { position: relative; border-radius: 10px; overflow: hidden; border: 1px solid var(--border); background: var(--bg-inset); }
.ch-cell img { width: 100%; aspect-ratio: 1; object-fit: cover; display: block; cursor: zoom-in; }
.ch-zoom {
  position: absolute; left: 8px; bottom: 8px; font-size: 10.5px; font-weight: 700;
  padding: 3px 9px; border-radius: 999px; color: #fff; background: rgba(0, 0, 0, .45);
  backdrop-filter: blur(6px); opacity: 0; transition: opacity .18s; pointer-events: none;
}
.ch-cell:hover .ch-zoom { opacity: 1; }

.order-list { display: flex; flex-direction: column; gap: 12px; }
.order-card {
  background: var(--bg-surface); border: 1px solid var(--border); border-radius: 14px;
  overflow: hidden; transition: all .18s ease;
}
.order-card:hover { border-color: rgba(124, 108, 255, .35); }
.order-card.open { box-shadow: 0 8px 24px rgba(0, 0, 0, .22); }

.order-head {
  display: flex; align-items: center; gap: 12px; padding: 12px 16px; cursor: pointer;
  transition: background .15s ease;
}
.order-head:hover { background: rgba(124, 108, 255, .05); }
.o-cover {
  width: 56px; height: 56px; flex: none; border-radius: 12px; overflow: hidden;
  background: var(--bg-inset); border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center; color: var(--text-tertiary);
}
.wk-cover-image img { width: 100%; height: 100%; object-fit: cover; }

/* 制图卡片瀑布流：封面按原图比例自适应列高（不再固定 16:10、不拼子图条） */
.wk-grid.is-masonry .wk-cover-image { aspect-ratio: auto; }
.wk-grid.is-masonry .wk-cover-image img { position: static; height: auto; }
.wk-grid.is-masonry .wk-cover-image.is-empty { aspect-ratio: 16 / 10; }
/* 张数角标：封面右下角 */
.wk-img-count {
  position: absolute; right: 10px; bottom: 10px; z-index: 2;
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 11px; font-weight: 700; color: #fff;
  padding: 3px 9px; border-radius: var(--r-full);
  background: rgba(8, 10, 18, 0.6); border: 1px solid rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(6px);
}
.wk-img-count svg { width: 12px; height: 12px; }
.o-cover .ph { display: block; }
.o-title { font-size: 14px; font-weight: 600; color: var(--text-primary); line-height: 1.4; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.o-sub { font-size: 11.5px; color: var(--text-tertiary); margin-top: 3px; }
.o-right { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: flex-end; margin-left: auto; min-width: 0; }
.o-cost { color: #E0B84D; font-weight: 700; font-size: 13px; }
.o-arrow { color: var(--text-tertiary); font-size: 11px; flex: none; }
.o-batch {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 12px; border-radius: 10px; border: 1px solid var(--border);
  background: var(--bg-inset); color: var(--text-secondary);
  font-size: 12px; font-weight: 500; cursor: pointer; transition: all .15s ease;
}
.o-batch:hover { border-color: var(--brand-400); color: var(--brand-300); }
.o-batch:disabled { opacity: .55; cursor: not-allowed; }

.kind-tag {
  font-size: 11px; font-weight: 600; padding: 3px 10px; border-radius: 999px; flex: none;
}
.kind-tag.k-set { background: rgba(124, 108, 255, .12); color: #A99BFF; }
.kind-tag.k-detail { background: rgba(55, 196, 171, .12); color: #3FCEB1; }
.kind-tag.k-comm { background: rgba(255, 138, 76, .12); color: #FF8A4C; }

.order-body {
  padding: 4px 16px 16px;
  border-top: 1px solid var(--border);
  margin-top: 0;
  background: rgba(255, 255, 255, .015);
}

/* 结果网格（制图历史展开 / 生成结果） */
.result-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.result-card {
  position: relative; border-radius: 12px; overflow: hidden; aspect-ratio: 1;
  border: 1px solid var(--border); background: var(--bg-inset);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  transition: all .15s ease;
}
.result-card:hover { border-color: rgba(124, 108, 255, .45); transform: translateY(-2px); box-shadow: 0 8px 20px rgba(0, 0, 0, .25); }
.result-card img { width: 100%; height: 100%; object-fit: cover; display: block; cursor: zoom-in; }
.r-dl {
  position: absolute; top: 8px; right: 8px;
  width: 28px; height: 28px; border-radius: 50%;
  background: rgba(22, 22, 31, .7); color: #fff; border: 1px solid rgba(255, 255, 255, .1);
  display: none; align-items: center; justify-content: center; cursor: pointer;
  backdrop-filter: blur(4px); font-size: 13px;
}
.result-card:hover .r-dl { display: flex; }
.r-dl:hover { background: var(--brand-grad); border-color: transparent; }
.r-label {
  position: absolute; left: 0; right: 0; bottom: 0;
  padding: 6px 10px; font-size: 11px; font-weight: 500; color: #fff;
  background: linear-gradient(180deg, transparent, rgba(0, 0, 0, .75));
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.r-state {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  color: var(--text-tertiary); font-size: 12px; text-align: center; padding: 0 10px;
}
.r-state .spinner { width: 20px; height: 20px; border-color: var(--border-strong); border-top-color: var(--brand-400); }
.r-sub { font-size: 11px; color: var(--text-tertiary); }

/* 分页 */
.pager {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  margin-top: 18px; font-size: 12px; color: var(--text-tertiary);
}
.pager button {
  padding: 6px 12px; border-radius: 8px; border: 1px solid var(--border);
  background: var(--bg-surface); color: var(--text-secondary); cursor: pointer;
  transition: all .15s ease;
}
.pager button:hover:not(:disabled) { border-color: var(--brand-400); color: var(--brand-300); }
.pager button:disabled { opacity: .45; cursor: not-allowed; }

/* spinner 基础（与 wf 同款） */
.spinner {
  width: 16px; height: 16px; display: inline-block;
  border: 2px solid rgba(255, 255, 255, .1); border-top-color: var(--brand-400);
  border-radius: 50%; animation: sp 0.9s linear infinite;
}
@keyframes sp { to { transform: rotate(360deg); } }

/* 进行中进度卡（制图结果面板 hero） */
.prog-card {
  background: var(--bg-surface); border: 1px solid var(--border); border-radius: 16px;
  padding: 18px 20px;
}
.prog-card .prog-head {
  display: flex; align-items: center; justify-content: space-between;
  font-size: 14px; font-weight: 600; color: var(--text-primary);
}
.prog-card .prog-head > b { display: inline-flex; align-items: center; gap: 10px; }
.prog-card .prog-bar {
  margin-top: 14px; height: 8px; border-radius: 999px; background: var(--bg-inset); overflow: hidden;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .03);
}
.prog-card .prog-bar > i {
  display: block; height: 100%; width: 0%;
  background: var(--brand-grad);
  box-shadow: 0 0 12px rgba(124, 108, 255, .5);
  transition: width .4s cubic-bezier(.4,0,.2,1);
}
.prog-card .prog-sub { margin-top: 10px; font-size: 11.5px; color: var(--text-tertiary); }
/* 示例卡 */
.demo-note { font-size: 12px; color: var(--text-tertiary); margin-bottom: 14px; }
.demo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.demo-card {
  border: 1px solid var(--border); border-radius: 14px; overflow: hidden; background: var(--bg-inset);
  transition: all .18s ease;
}
.demo-card:hover { border-color: rgba(124, 108, 255, .45); transform: translateY(-2px); }
.demo-card .ph {
  aspect-ratio: 1; display: flex; align-items: center; justify-content: center; color: var(--text-tertiary);
  background:
    radial-gradient(70% 90% at 50% 0%, rgba(124, 108, 255, .1), transparent 65%),
    repeating-linear-gradient(45deg, rgba(255, 255, 255, .015) 0 10px, transparent 10px 20px);
}
.demo-card .t { display: block; padding: 9px 12px 0; font-size: 12px; font-weight: 700; color: var(--text-secondary); }
.demo-card .s { display: block; padding: 2px 12px 11px; font-size: 10.5px; color: var(--text-tertiary); }
.sc-btn {
  border: 1px solid var(--border); background: transparent; color: var(--text-secondary);
  font-size: 12px; padding: 5px 14px; border-radius: 999px; cursor: pointer; transition: all .15s ease;
}
.sc-btn:hover:not([disabled]) { color: var(--text-primary); border-color: rgba(124, 108, 255, .5); background: rgba(124, 108, 255, .08); }
.sc-btn[disabled] { opacity: .5; cursor: wait; }

/* 底部结算条（旧版同款：说明+总价+大按钮） */
.sc-settle { gap: 12px; }
.sc-settle-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.sc-settle-note { font-size: 12px; color: var(--text-secondary); line-height: 1.6; }
.sc-settle-sub { font-size: 11px; color: var(--text-tertiary); }
.sc-settle-price { display: flex; align-items: baseline; gap: 4px; font-size: 14px; font-weight: 700; color: #FBBF24; white-space: nowrap; }
.sc-settle-price i { font-style: normal; font-size: 15px; }
.sc-settle-price b { font-size: 22px; font-weight: 800; }
.sc-submit { background: var(--brand-grad, linear-gradient(135deg, #7C6CFF, #5B8DFF)); }

.inline-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.rec-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 16px; }
.rec-item { display: flex; justify-content: space-between; gap: 12px; font-size: 12px; padding: 7px 10px; border-radius: 8px; background: color-mix(in srgb, var(--bg-primary) 55%, transparent); }
.rec-item span { color: var(--text-tertiary); flex: none; }
.rec-item b { color: var(--text-primary); font-weight: 600; text-align: right; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.price-note { margin-top: 12px; font-size: 11px; color: var(--text-tertiary); text-align: center; }
/* 脚本生成遮罩 */
.gen-mask-modal { max-width: 320px; text-align: center; padding: 34px 30px 28px; }
.gm-ring {
  width: 84px; height: 84px; margin: 0 auto 16px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: conic-gradient(var(--acc) var(--p, 0%), rgba(124, 108, 255, .12) 0);
  position: relative; animation: gmSpin 1.2s linear infinite;
}
.gm-ring::before { content: ''; position: absolute; inset: 5px; border-radius: 50%; background: var(--bg-surface); }
.gm-ring .num { position: relative; z-index: 1; font-size: 16px; font-weight: 800; }
@keyframes gmSpin { to { transform: rotate(360deg); } }
.gm-title { font-size: 15px; font-weight: 700; color: var(--text-primary); margin-bottom: 6px; }
.gm-phase { font-size: 12px; color: var(--text-secondary); margin-bottom: 10px; }
.gm-count { font-size: 11px; color: var(--text-tertiary); letter-spacing: 1px; }

/* ---------- AI 视频：左右工作区 ---------- */
.vs-back {
  display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 12px;
  font-size: var(--fs-sm); color: var(--text-secondary);
  background: var(--bg-surface); border: 1px solid var(--border); border-radius: var(--r-full);
  cursor: pointer; transition: all var(--dur-fast) ease;
}
.vs-back:hover { color: var(--text-primary); border-color: var(--border-strong); }
.vs-back svg { width: 14px; height: 14px; }
.vs-head h1 { font-size: 20px; font-weight: 720; }
.vs-head .sub { font-size: var(--fs-sm); color: var(--text-tertiary); margin-left: 2px; }
/* 头部内容形态徽章（形态在 L1 卡片墙已选定，这里仅展示） */
.vs-form-tag {
  display: inline-flex; align-items: center; gap: 5px; height: 26px; padding: 0 11px;
  font-size: 11px; font-weight: 650; color: var(--brand-300);
  background: var(--brand-soft); border: 1px solid rgba(124, 108, 255, 0.35); border-radius: var(--r-full);
}
.vs-form-tag svg { width: 12px; height: 12px; }
.vs-form-tag .v-tag-ico { width: 13px; height: 13px; object-fit: contain; border-radius: 3px; }
.vs-work {
  /* 双栏各自独立滚动：高度锁定为一屏，页面级（.view）不出现滚动 */
  display: grid; grid-template-columns: minmax(400px, 472px) minmax(0, 1fr); gap: var(--sp-5);
  height: calc(100vh - 208px);   /* 顶栏 56 + .view-pad 上下 padding 72 + 头部 56 + 余量 */
  transition: grid-template-columns .28s ease, gap .28s ease;
}
/* 左侧整列最小化：grid 改为 0 + 1fr，右侧面板占满宽度 */
.vs-work.is-collapsed-left {
  grid-template-columns: 0 minmax(0, 1fr);
  gap: 0;
}
.vs-work.is-collapsed-left .vs-left {
  overflow: hidden; width: 0; min-width: 0; border: none;
}
.vs-work.is-collapsed-left .fs-card { margin: 0; }

.vs-side-panel-wrap {
  display: none;
  flex-direction: column;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg-surface);
  overflow: hidden;
  height: auto;
  position: sticky; top: 0;
  /* 与左侧脚本区对齐：占满 grid 行高，不再用 fit-content 自适应内容 */
  max-height: calc(100vh - 220px);
  align-self: stretch;
}
/* 默认：vs-scroll 里 side-panel 始终隐藏，只有左侧最小化 + script tab 激活时并排 */
.vs-work.is-collapsed-left
  .vs-scroll:has(.vs-pane[data-pane="script"].is-active)
  .vs-side-panel-wrap {
  display: flex;
}
/* 左侧最小化 + script tab → .vs-scroll 变 grid 双列 */
.vs-work.is-collapsed-left
  .vs-scroll:has(.vs-pane[data-pane="script"].is-active) {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  grid-template-rows: minmax(0, 1fr);
  gap: var(--sp-4);
  overflow: hidden;
}
.vs-work.is-collapsed-left
  .vs-scroll:has(.vs-pane[data-pane="script"].is-active)
  .vs-pane[data-pane="script"] {
  grid-column: 1;
  overflow-y: auto;
  max-height: calc(100vh - 220px);
  min-height: 0;
}
.vs-work.is-collapsed-left
  .vs-scroll:has(.vs-pane[data-pane="script"].is-active)
  .vs-side-panel-wrap {
  grid-column: 2;
}
/* 非 script tab（进行中/历史/教学区）→ vs-scroll 保持单列滚动，active pane 占全宽 */
.vs-work.is-collapsed-left
  .vs-scroll:not(:has(.vs-pane[data-pane="script"].is-active)) {
  display: block !important;
  overflow-y: auto !important;
}
.vs-work.is-collapsed-left
  .vs-scroll:not(:has(.vs-pane[data-pane="script"].is-active))
  .vs-pane.is-active {
  grid-column: 1 / -1;
}
.vs-side-head {
  display: flex; align-items: center; gap: 0;
  border-bottom: 1px solid var(--border);
  background: var(--bg-surface-2);
}
.vs-side-tabs { display: flex; flex: 1; }
.vs-side-tab {
  padding: 10px 16px; font-size: 13px; cursor: pointer;
  color: var(--text-tertiary); border-bottom: 2px solid transparent;
  background: transparent; border-top: none; border-left: none; border-right: none;
  transition: color .15s ease, border-color .15s ease;
}
.vs-side-tab:hover { color: var(--text-primary); }
.vs-side-tab.is-on { color: var(--brand-400); border-bottom-color: var(--brand-500); background: var(--bg-base); }
.vs-side-mini {
  padding: 8px 14px; cursor: pointer; color: var(--text-tertiary);
  background: transparent; border: none; border-left: 1px solid var(--border);
  font-size: 14px;
}
.vs-side-mini:hover { color: var(--brand-400); }
.vs-side-body {
  max-height: 0; overflow: hidden;
  transition: max-height .28s ease;
  display: flex; flex-direction: column;
}
/* 展开态：用 flex:1 撑满 side-panel-wrap 剩余高度，与左侧脚本区对齐；max-height 仅作动画上限 */
.vs-side-body.is-open {
  max-height: calc(100vh - 220px);
  overflow: hidden;
  flex: 1;
  min-height: 0;
}
.sp-chat { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.sp-chat-log {
  flex: 1; overflow-y: auto; padding: 12px 14px;
  background: var(--bg-base); min-height: 120px;
  display: flex; flex-direction: column; gap: 8px;
}
.sp-chat-empty { text-align: center; color: var(--text-tertiary); padding: 30px 20px; font-size: 13px; }
.sp-msg { max-width: 85%; padding: 7px 11px; border-radius: 10px; font-size: 13px; line-height: 1.5; white-space: pre-wrap; word-break: break-word; }
.sp-msg-user { align-self: flex-end; background: var(--brand-grad); color: #fff; border-bottom-right-radius: 2px; }
.sp-msg-ai { align-self: flex-start; background: var(--bg-surface); border: 1px solid var(--border); border-bottom-left-radius: 2px; color: var(--text-primary); max-width: 100%; }
.sp-msg-ai .sp-msg-title { font-size: 11px; color: var(--text-tertiary); margin-bottom: 3px; font-weight: 600; }

/* AI 气泡内：聊天内容 */
.sp-msg-chat {
  font-size: 13px; line-height: 1.5; margin: 6px 0 8px 0;
  color: var(--text-primary);
  padding-bottom: 8px; border-bottom: 1px dashed var(--border);
}

/* AI 气泡内：diff 预览 */
.sp-msg-diff { margin-top: 6px; }
.sp-msg-diff-h {
  font-size: 10.5px; color: var(--text-tertiary); font-weight: 600;
  letter-spacing: .3px; margin-bottom: 5px;
}
.sp-msg-diff-body {
  font-family: 'SF Mono', Consolas, 'Courier New', monospace;
  font-size: 11.5px; line-height: 1.45;
  background: var(--bg-base); border: 1px solid var(--border); border-radius: 6px;
  padding: 6px 8px;
  max-height: 200px; overflow-y: auto;
}
.sp-msg-diff-body > div { white-space: pre-wrap; word-break: break-all; padding: 1px 2px; border-radius: 3px; }
.sp-diff-del { background: rgba(239,68,68,.18); color: #fca5a5; text-decoration: line-through; }
.sp-diff-add { background: rgba(34,197,94,.15); color: #86efac; }
.sp-diff-eq { color: var(--text-tertiary); font-size: 10.5px; }
.sp-diff-empty { color: var(--text-tertiary); font-size: 11px; font-style: italic; }

/* AI 气泡内：重构概览 */
.sp-msg-rewrite { margin-top: 6px; }
.sp-msg-rewrite-body {
  font-size: 12px; line-height: 1.5;
  background: rgba(99,102,241,.1); border: 1px solid rgba(99,102,241,.25);
  border-radius: 6px; padding: 8px 10px;
  color: var(--brand-300);
}
.sp-chat-input { padding: 10px 14px; border-top: 1px solid var(--border); background: var(--bg-surface); }
.sp-chat-input textarea {
  width: 100%; padding: 8px 10px; border-radius: 6px;
  background: var(--bg-input); border: 1px solid var(--border);
  color: var(--text-primary); font-size: 13px; resize: vertical;
  font-family: inherit; min-height: 56px;
}
.sp-chat-row { display: flex; align-items: center; justify-content: space-between; gap: 0; margin-top: 6px; }
.sp-chat-price { font-size: 12px; color: var(--text-tertiary); }
#spChatSend { flex: none; }
.sp-mode-switch { display: flex; gap: 0; margin-bottom: 8px; }
.sp-mode-switch button {
  padding: 4px 10px; font-size: 12px; border: 1px solid var(--border);
  background: var(--bg-base); color: var(--text-tertiary); cursor: pointer;
}
.sp-mode-switch button:first-child { border-radius: 4px 0 0 4px; }
.sp-mode-switch button:last-child { border-radius: 0 4px 4px 0; }
.sp-mode-switch button.is-on { background: var(--brand-soft); color: var(--brand-400); border-color: var(--brand-500); }
.sp-history { padding: 12px 14px; max-height: 55vh; overflow-y: auto; }
.sp-ver-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 10px; border-radius: 6px;
  border: 1px solid transparent;
  transition: background .15s ease, border-color .15s ease;
}
.sp-ver-item + .sp-ver-item { margin-top: 6px; }
.sp-ver-item:hover { background: var(--bg-base); border-color: var(--border); }
.sp-ver-no { font-weight: 700; font-size: 13px; color: var(--brand-400); min-width: 28px; }
.sp-ver-badge {
  font-size: 11px; padding: 2px 7px; border-radius: 10px;
  background: var(--bg-surface-2); color: var(--text-tertiary);
}
.sp-ver-badge.tweak { background: rgba(99,102,241,.12); color: var(--brand-400); }
.sp-ver-badge.rewrite { background: rgba(244,114,182,.15); color: #ec4899; }
.sp-ver-badge.manual { background: rgba(34,197,94,.12); color: #22c55e; }
.sp-ver-badge.initial { background: rgba(251,191,36,.15); color: #f59e0b; }
.sp-ver-sum { flex: 1; font-size: 12px; color: var(--text-secondary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sp-ver-time { font-size: 11px; color: var(--text-tertiary); flex: none; }
.sp-ver-del {
  background: transparent; border: none; color: var(--text-tertiary);
  cursor: pointer; padding: 2px 6px; border-radius: 4px; font-size: 13px;
}
.sp-ver-del:hover { color: #ef4444; background: rgba(239,68,68,.1); }
.sp-ver-diff {
  background: transparent; border: none; color: var(--text-tertiary);
  cursor: pointer; padding: 2px 6px; border-radius: 4px; font-size: 13px;
}
.sp-ver-diff:hover { color: var(--brand-400); background: var(--brand-soft); }
.vs-side-panel-wrap.is-mini { align-self: start; height: fit-content; max-height: none; }
.vs-side-panel-wrap.is-mini .vs-side-body { display: none; }
.vs-side-panel-wrap.is-mini .vs-side-mini { transform: rotate(180deg); }

/* 左侧最小化后的「展开」抓手：吸附在侧边导航栏右边沿（shell-sidebar-w: 240px，mini 态 68px） */
.vs-expand-grip {
  position: fixed;
  left: var(--shell-sidebar-w, 240px);
  top: 50%; transform: translateY(-50%) translateX(-100%);
  width: 24px; height: 80px;
  background: var(--bg-surface); color: var(--text-secondary);
  border: 1px solid var(--border); border-left: none;
  border-radius: 0 8px 8px 0; cursor: pointer; z-index: 40;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  font-size: 11px; font-weight: 700;
  transition: transform .28s ease, color .2s ease, background .2s ease, box-shadow .2s ease, opacity .2s ease;
  box-shadow: 4px 0 18px -6px rgba(0,0,0,.25);
  padding: 8px 0;
  /* 默认完全透明且不响应事件：translateX(-100%) 仅让其贴在侧边栏右沿后方，但因 z-index 高于侧栏会露出，
     故用 opacity+pointer-events 双重保险，确保展开态下完全不可见 */
  opacity: 0;
  pointer-events: none;
}
.vs-expand-grip::before, .vs-expand-grip::after {
  content: ''; width: 10px; height: 2px; border-radius: 1px;
  background: currentColor; opacity: .75;
}
.vs-expand-grip:hover {
  color: var(--brand-500); background: var(--brand-soft);
}
.vs-expand-grip:hover::before, .vs-expand-grip:hover::after { opacity: 1; }
.vs-expand-grip.is-visible {
  transform: translateY(-50%) translateX(0);
  opacity: 1;
  pointer-events: auto;
}
/* 侧边栏 mini 态（68px）：抓手贴在新的右边沿 */
.shell.is-mini .vs-expand-grip { left: var(--shell-sidebar-w-mini, 68px); }
@media (max-width: 980px) { .vs-expand-grip { display: none; } }
@media (max-width: 980px) { .vs-work { grid-template-columns: 1fr; height: auto; } }
/* 左列：表单滚动 + 底部按钮固定（列本身不动，视觉上恒在底部） */
.vs-left { display: flex; flex-direction: column; min-height: 0; }
.vs-form {
  flex: 1; min-height: 0;
  display: flex; flex-direction: column; gap: var(--sp-4);
  overflow-y: auto;
  padding-right: 6px; padding-bottom: var(--sp-2);
  scrollbar-width: thin; scrollbar-color: var(--border-strong) transparent;
}
.vs-form::-webkit-scrollbar { width: 6px; }
.vs-form::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 3px; }
.vs-form::-webkit-scrollbar-track { background: transparent; }
/* 生成按钮：左列底部固定（无浮出卡片背景，纯按钮） */
.vs-gen-bar { flex: none; margin-top: var(--sp-3); }
.vs-gen-bar .btn[disabled] { opacity: 0.45; cursor: not-allowed; filter: grayscale(0.4); }
.vs-gen-hint { margin-top: 7px; text-align: center; font-size: 11px; color: var(--text-tertiary); }
/* 头部导航：滚动时吸顶 + 浮起效果（毛玻璃+投影+渐变过渡） */
.vs-head {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: var(--sp-3);
  margin: calc(var(--sp-6) * -1) calc(var(--sp-6) * -1) var(--sp-4);  /* 抵消 view-pad，实现真吸顶 */
  padding: var(--sp-3) var(--sp-6);
  background: linear-gradient(180deg, var(--bg-primary) 82%, transparent);
  transition: box-shadow var(--dur-base) ease, background-color var(--dur-base) ease;
}
.vs-head.is-floated {
  background: color-mix(in srgb, var(--bg-primary) 86%, transparent);
  backdrop-filter: blur(12px);
  box-shadow: 0 10px 24px -14px rgba(0, 0, 0, 0.5), 0 2px 0 rgba(255, 255, 255, 0.03);
}
@media (max-width: 980px) { .vs-head { margin: 0 calc(var(--sp-4) * -1) var(--sp-4); padding: var(--sp-2) var(--sp-4); } }
/* 右列：头部 TAB 吸顶不滚动，下方内容独立滚动，整列自身无页面级滚动 */
.vs-right { min-width: 0; display: flex; flex-direction: column; min-height: 0; }
.vs-right .vs-tabs {
  flex: none; position: sticky; top: 0; z-index: 6;
  background: var(--bg-surface);
  box-shadow: 0 6px 14px -8px rgba(0, 0, 0, 0.35);
}
.vs-right .vs-scroll {
  flex: 1; min-height: 0; overflow-y: auto; margin-top: var(--sp-3);
  padding-right: 6px;
  scrollbar-width: thin; scrollbar-color: var(--border-strong) transparent;
}
.vs-right .vs-scroll::-webkit-scrollbar { width: 6px; }
.vs-right .vs-scroll::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 3px; }
.vs-right .vs-scroll::-webkit-scrollbar-track { background: transparent; }
@media (max-width: 980px) { .vs-right .vs-scroll { overflow: visible; } }

/* 右侧：tabs + 面板 */
.vs-tabs { display: flex; gap: 2px; padding: 4px; background: var(--bg-surface); border: 1px solid var(--border); border-radius: 12px; margin-bottom: var(--sp-4); }
.vs-tabs button {
  flex: 1; height: 36px; display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  font-size: var(--fs-sm); font-weight: 600; color: var(--text-tertiary);
  background: transparent; border: none; border-radius: 9px; cursor: pointer;
  transition: all var(--dur-fast) ease;
}
.vs-tabs button svg { width: 15px; height: 15px; }
.vs-tabs button:hover { color: var(--text-primary); }
.vs-tabs button.is-active { color: var(--text-primary); background: var(--bg-elevated); box-shadow: var(--shadow-sm), var(--ring-edge); }
.vs-tabs button .n {
  min-width: 18px; height: 18px; padding: 0 5px;
  font-size: 10px; font-weight: 700; line-height: 18px; text-align: center;
  color: #fff; background: var(--brand-grad); border-radius: var(--r-full);
}
.vs-pane { display: none; }
.vs-pane.is-active { display: block; animation: viewIn var(--dur-base) var(--ease-out); }
/* 脚本创作面板：与进行中大卡同区域，美化板块内嵌展示 */
.vs-script-view { padding: 0; }
.sc-view-head {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 16px; border-bottom: 1px solid var(--border); position: sticky; top: 0;
  background: var(--bg-surface); z-index: 2;
}
.sc-view-back {
  display: inline-flex; align-items: center; gap: 4px; height: 30px; padding: 0 12px;
  font-size: 12.5px; color: var(--text-secondary);
  background: var(--bg-surface); border: 1px solid var(--border); border-radius: var(--r-full);
  cursor: pointer; transition: all var(--dur-fast) ease; flex-shrink: 0;
}
.sc-view-back:hover { color: var(--text-primary); border-color: var(--border-strong); background: var(--bg-hover); }
/* 头部左侧操作组：返回 + 手动保存 并排 */
.sc-view-head-left { display: inline-flex; align-items: center; gap: 8px; flex-shrink: 0; }
.sc-view-save {
  display: inline-flex; align-items: center; gap: 4px; height: 30px; padding: 0 12px;
  font-size: 12.5px; font-weight: 600; color: var(--brand-500);
  background: var(--brand-soft); border: 1px solid transparent; border-radius: var(--r-full);
  cursor: pointer; transition: all var(--dur-fast) ease; flex-shrink: 0;
}
.sc-view-save svg { width: 13px; height: 13px; }
.sc-view-save:hover { color: #fff; background: var(--brand-grad); box-shadow: 0 2px 6px rgba(99,102,241,0.3); }
.sc-view-save:disabled { opacity: .6; cursor: not-allowed; }
.sc-view-title { font-size: 14px; font-weight: 700; color: var(--text-primary); flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sc-view-edit {
  border: 1px solid var(--brand-500); background: var(--brand-soft); color: var(--brand-500);
  font-size: 12px; font-weight: 600; padding: 5px 12px; border-radius: var(--r-full);
  cursor: pointer; white-space: nowrap; transition: all .14s ease;
}
.sc-view-edit:hover { background: var(--brand-grad); color: #fff; }
.sc-view-body { padding: 14px 16px; display: flex; flex-direction: column; gap: 12px; }
/* 内嵌板块防 flex 压缩：让每个 se-sec 保持内容高度 */
.sc-view-body > * { flex-shrink: 0; min-height: auto; }
/* 内嵌时板块卡间距更紧凑 */
.sc-view-body .se-sec { margin: 0; }
.sc-view-body .se-two { gap: 10px; }
/* 脚本创作面板底部操作区（L2 内嵌用：创建视频大按钮） */
.sc-view-foot {
  flex: none; padding: 12px 16px 16px; border-top: 1px solid var(--border);
  background: linear-gradient(180deg, transparent, var(--bg-surface) 40%);
  display: flex; gap: 10px;
}
/* 脚本创作面板为空/未生成时的引导态 */
.vs-pane[data-pane="script"] .vs-empty {
  padding: 0px 20px; text-align: center; color: var(--text-tertiary);
  font-size: 13px; line-height: 1.8;
}
/* 进行中任务：双列视频卡片 */
.vs-prog-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--sp-3); }
@media (max-width: 760px) { .vs-prog-grid { grid-template-columns: 1fr; } }
.pcard {
  border-radius: var(--r-md); overflow: hidden; cursor: pointer;
  background: var(--bg-elevated); border: 1px solid var(--border);
  transition: all var(--dur-fast) ease;
}
.pcard:hover { border-color: var(--border-strong); transform: translateY(-2px); box-shadow: var(--shadow-md); }
.pcard .pc-cover {
  aspect-ratio: 16/9; position: relative;
  display: flex; align-items: center; justify-content: center;
  color: rgba(255, 255, 255, 0.55);
}
.pcard .pc-cover svg { width: 34px; height: 34px; }
.pcard .pc-pct {
  position: absolute; top: 10px; right: 10px;
  padding: 2px 9px; font-size: 12px; font-weight: 700; color: #fff;
  background: rgba(8, 10, 18, 0.6); border-radius: var(--r-full); backdrop-filter: blur(6px);
}
.pcard .pc-bar {
  position: absolute; left: 0; right: 0; bottom: 0; height: 4px;
  background: rgba(8, 10, 18, 0.5);
}
.pcard .pc-bar i { display: block; height: 100%; background: var(--brand-grad); transition: width var(--dur-slow) ease; }
.pcard .pc-meta { padding: 10px 12px 12px; }
.pcard .pc-t { font-size: var(--fs-sm); font-weight: 600; color: var(--text-primary); }
.pcard .pc-s { margin-top: 6px; display: flex; align-items: center; flex-wrap: wrap; gap: 4px 8px; font-size: 11px; color: var(--text-tertiary); white-space: normal; }
.pcard .pc-s .badge { flex: none; }
.vs-empty { padding: var(--sp-8) 0; text-align: center; color: var(--text-tertiary); font-size: var(--fs-sm); }
.vs-empty.vs-more { display: block; width: 100%; background: none; border: none; cursor: pointer; }
.vs-empty.vs-more:hover { color: var(--text-secondary); }
.w-card .w-kind {
  position: absolute; top: 10px; left: 10px;
  padding: 2px 9px; font-size: 11px; font-weight: 650; color: #fff;
  background: rgba(8, 10, 18, 0.6); border-radius: var(--r-full); backdrop-filter: blur(6px);
}
/* 历史作品 */
.vs-works { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--sp-3); }
@media (max-width: 640px) { .vs-works { grid-template-columns: 1fr; } }
.w-card { position: relative; border-radius: var(--r-md); overflow: hidden; background: var(--bg-elevated); border: 1px solid var(--border); cursor: pointer; transition: all var(--dur-fast) ease; }
.w-card:hover { border-color: var(--border-strong); transform: translateY(-2px); box-shadow: var(--shadow-md); }
.w-card .w-cover { aspect-ratio: 16/9; display: flex; align-items: center; justify-content: center; color: var(--text-tertiary); background: var(--bg-inset); position: relative; }
.w-card .w-cover svg { width: 30px; height: 30px; opacity: 0.5; }
.w-card .w-play {
  position: absolute; width: 38px; height: 38px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: #fff; background: rgba(10, 12, 20, 0.55); backdrop-filter: blur(4px);
}
.w-card .w-play svg { width: 15px; height: 15px; opacity: 1; }
.w-card .w-meta { padding: 10px 12px 12px; }
.w-card .w-t { font-size: var(--fs-sm); font-weight: 600; color: var(--text-primary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.w-card .w-s { margin-top: 6px; display: flex; align-items: center; gap: 8px; font-size: 11px; color: var(--text-tertiary); }
/* 教学区 */
.vs-tuts { display: flex; flex-direction: column; gap: var(--sp-3); }
.tut-card { display: flex; gap: var(--sp-3); padding: var(--sp-3); align-items: center; }
.tut-card .t-thumb {
  width: 132px; aspect-ratio: 16/9; flex: none; border-radius: 10px; overflow: hidden; position: relative;
  display: flex; align-items: center; justify-content: center;
  color: rgba(255,255,255,0.85); background:
    linear-gradient(135deg, rgba(99, 102, 241, 0.35), rgba(168, 85, 247, 0.22)), var(--bg-inset);
}
.tut-card .t-thumb svg { width: 22px; height: 22px; }
.tut-card .t-thumb .t-dur {
  position: absolute; right: 6px; bottom: 6px; padding: 1px 6px;
  font-size: 10px; font-weight: 650; color: #fff; background: rgba(0, 0, 0, 0.6); border-radius: 4px;
}
.tut-card .t-body { min-width: 0; }
.tut-card .t-t { font-size: var(--fs-sm); font-weight: 650; color: var(--text-primary); }
.tut-card .t-d { margin-top: 5px; font-size: var(--fs-caption); color: var(--text-tertiary); line-height: 1.55; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
/* 教程播放页（单视频待播放） */
.tut-stage {
  border-radius: var(--r-md); overflow: hidden;
  background: var(--bg-elevated); border: 1px solid var(--border);
}
.tut-stage video {
  display: block; width: 100%; aspect-ratio: 16/9; object-fit: cover;
  background: #000;
}
.tut-stage-meta { padding: var(--sp-4); }
.tut-stage-meta .t-t { font-size: 15px; font-weight: 650; color: var(--text-primary); }
.tut-stage-meta .t-d { margin-top: 8px; font-size: var(--fs-sm); color: var(--text-tertiary); line-height: 1.6; }

/* ---------- v1 同款：脚本素材与创作表单 ---------- */
.fs-card .field { margin-top: var(--sp-4); }
.fs-card .field-label .req { color: #F87171; margin-left: 2px; }
/* 素材图片：左操作右展示 */
.src-layout { display: grid; grid-template-columns: 170px minmax(0, 1fr); gap: var(--sp-3); }
@media (max-width: 640px) { .src-layout { grid-template-columns: 1fr; } }
.src-left { display: flex; flex-direction: column; gap: var(--sp-2); }
/* 上传按钮：沿用旧版 hr-up 紫色光晕 + 网格底纹 + 双光环呼吸特效 */
.upload-box {
  position: relative; overflow: hidden;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px;
  padding: var(--sp-5) 10px; font-size: var(--fs-sm); color: var(--text-secondary); line-height: 1.5;
  background:
    radial-gradient(90% 120% at 50% -20%, rgba(124, 108, 255, 0.12), transparent 60%),
    var(--bg-inset);
  border: 1.5px dashed rgba(124, 108, 255, 0.45);
  border-radius: var(--r-lg);
  cursor: pointer; transition: all var(--dur-base) ease; text-align: center;
}
.upload-box::before {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background-image:
    linear-gradient(rgba(124, 108, 255, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(124, 108, 255, 0.06) 1px, transparent 1px);
  background-size: 20px 20px;
  mask-image: radial-gradient(85% 90% at 50% 40%, #000 30%, transparent 100%);
  -webkit-mask-image: radial-gradient(85% 90% at 50% 40%, #000 30%, transparent 100%);
}
.upload-box > * { position: relative; z-index: 1; }
.upload-box:hover {
  border-color: var(--brand-400);
  background:
    radial-gradient(90% 120% at 50% -20%, rgba(124, 108, 255, 0.2), transparent 60%),
    var(--brand-soft);
  color: var(--brand-300);
  box-shadow: 0 0 0 4px rgba(124, 108, 255, 0.1), inset 0 0 24px rgba(124, 108, 255, 0.08);
}
.upload-box.is-drag { border-style: solid; transform: scale(1.008); }
.upload-box .upload-ico {
  position: relative; width: 56px; height: 56px; border-radius: 18px;
  display: flex; align-items: center; justify-content: center;
  color: var(--brand-300);
  background: linear-gradient(160deg, rgba(124, 108, 255, 0.22), rgba(124, 108, 255, 0.06));
  border: 1px solid rgba(124, 108, 255, 0.4);
  box-shadow: 0 6px 20px rgba(99, 102, 241, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.12);
  transition: transform var(--dur-base) var(--ease-out);
  font-size: 22px;
}
.upload-box:hover .upload-ico { transform: translateY(-3px) scale(1.04); }
.upload-box .upload-ico .ring {
  position: absolute; inset: -6px; border-radius: 22px;
  border: 1.5px solid rgba(124, 108, 255, 0.35); opacity: 0;
  animation: hrUpRing 2.6s ease-out infinite;
}
.upload-box .upload-ico .ring.r2 { animation-delay: 1.3s; }
@keyframes hrUpRing { 0% { opacity: 0.75; transform: scale(0.92); } 70%, 100% { opacity: 0; transform: scale(1.22); } }

/* 上传中态：复用素材位特效（紫色网格底纹+扫描线+旋转光圈+文案），由 .is-uploading 类驱动 */
.upload-box.is-uploading {
  pointer-events: none; opacity: 0.92;
  border-style: solid; border-color: rgba(124, 108, 255, 0.7);
}
.upload-box.is-uploading::after {
  content: ''; position: absolute; inset: 0; pointer-events: none; z-index: 2;
  background-image:
    linear-gradient(rgba(124, 108, 255, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(124, 108, 255, 0.08) 1px, transparent 1px);
  background-size: 20px 20px;
  animation: hrSlotGrid 2.4s linear infinite;
}
.upload-box.is-uploading .upload-scan {
  position: absolute; left: 0; right: 0; height: 30%; z-index: 3; pointer-events: none;
  background: linear-gradient(180deg, transparent, rgba(124, 108, 255, 0.18), transparent);
  animation: hrSlotScan 1.15s ease-in-out infinite;
}
.upload-box.is-uploading .upload-rot {
  position: absolute; top: 10px; right: 10px; z-index: 3; pointer-events: none;
  width: 22px; height: 22px; border-radius: 50%;
  border: 2px solid transparent; border-top-color: var(--brand-300); border-right-color: var(--brand-300);
  animation: hrSlotRotate 0.9s linear infinite;
  box-shadow: 0 0 8px rgba(124, 108, 255, 0.55);
}
.upload-box.is-uploading .upload-label {
  position: relative; z-index: 4;
  color: var(--brand-300); font-weight: 700; letter-spacing: 1px; font-size: 13px;
  text-shadow: 0 0 8px rgba(124, 108, 255, 0.55);
}

.src-lib-btn {
  display: flex; align-items: center; gap: 9px; padding: 12px 12px; text-align: left;
  font-size: var(--fs-sm); color: var(--text-secondary); line-height: 1.45;
  background: var(--bg-surface); border: 1px solid var(--border); border-radius: var(--r-md);
  cursor: pointer; transition: all var(--dur-fast) ease;
}
.src-lib-btn:hover { border-color: var(--brand-500); box-shadow: 0 4px 12px rgba(124, 108, 255, 0.14); }
.src-lib-btn i { font-style: normal; font-size: 11px; color: var(--text-tertiary); }
.field-hint { font-size: 11px; color: var(--text-tertiary); line-height: 1.6; }
.src-right { min-height: 120px; display: flex; align-items: stretch; }
.src-empty {
  flex: 1; display: flex; align-items: center; justify-content: center; padding: var(--sp-4);
  font-size: var(--fs-caption); color: var(--text-tertiary); text-align: center;
  background: var(--bg-inset); border-radius: var(--r-md);
}
.ref-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--sp-2); width: 100%; }
.ref-item .ref-img { position: relative; aspect-ratio: 1; border-radius: 8px; overflow: hidden; background: var(--bg-inset); }
.ref-item .ref-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ref-item .ref-x {
  position: absolute; top: 4px; right: 4px; width: 20px; height: 20px;
  font-size: 10px; color: #fff; background: rgba(0, 0, 0, 0.55); border: none; border-radius: 50%; cursor: pointer;
}
.ref-item .ref-label { margin-top: 5px; font-size: 11px; padding: 4px 6px; }
/* 商品图转传中遮罩（旋转光圈，转传完成后由 renderRefs 移除） */
.ref-item .ref-up {
  position: absolute; inset: 0; z-index: 1; display: flex; align-items: center; justify-content: center;
  background: rgba(10, 10, 20, 0.55); backdrop-filter: blur(1px);
}
.ref-item .ref-up i {
  width: 18px; height: 18px; border-radius: 50%;
  border: 2px solid rgba(124, 108, 255, 0.35); border-top-color: #A78BFA;
  animation: refUpSpin 0.9s linear infinite;
}
@keyframes refUpSpin { to { transform: rotate(360deg); } }
/* 脚本分类选择器 */
.cat-picker-box {
  display: flex; align-items: center; gap: var(--sp-3); padding: 10px 12px;
  background: var(--bg-inset); border: 1px solid var(--border); border-radius: var(--r-md);
  cursor: pointer; transition: border-color var(--dur-fast) ease;
}
.cat-picker-box:hover { border-color: var(--brand-500); }
.cat-picker-box .cat-picker-chips { flex: 1; display: flex; flex-wrap: wrap; gap: 6px; min-width: 0; }
.cat-picker-placeholder { font-size: var(--fs-caption); color: var(--text-tertiary); }
.cat-picker-action { display: flex; align-items: center; gap: 10px; flex: none; }
.cat-picker-badge { font-size: 11px; font-weight: 600; color: #F87171; }
.cat-picker-count { font-size: 11px; color: var(--text-tertiary); }
.cat-picker-arrow { font-size: 12px; color: var(--text-tertiary); transition: transform var(--dur-fast) ease; }
.chip-group { font-style: normal; font-size: 10px; opacity: 0.75; margin-right: 4px; }
/* 已选分类 chip 的 ✕ 删除按钮 */
.chip .chip-x {
  flex: none; width: 15px; height: 15px; margin-left: 2px; padding: 0;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 9px; line-height: 1; color: inherit;
  background: transparent; border: 1px solid transparent; border-radius: 50%;
  cursor: pointer; opacity: 0.6; transition: all var(--dur-fast) ease;
}
.chip .chip-x:hover {
  opacity: 1; color: var(--error);
  background: var(--error-soft); border-color: rgba(248, 113, 113, 0.35);
}
/* 分类弹窗：旧版同款左右分栏（左组列表 + 右子项卡片网格） */
.cat-modal { width: min(880px, 94vw); max-width: min(880px, 94vw); max-height: 80vh; display: flex; flex-direction: column; padding: 0; }
.cat-modal .modal-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: var(--sp-4) var(--sp-5); border-bottom: 1px solid var(--border); flex: none;
}
.cat-modal .modal-title { display: flex; align-items: center; font-size: 16px; font-weight: 700; color: var(--text-primary); }
.cat-modal .modal-title .small { font-size: var(--fs-caption); color: var(--text-tertiary); }
.cat-modal .modal-head .modal-close { flex: none; margin-left: var(--sp-4); }
.cat-modal-body { padding: 14px 22px 20px; overflow: hidden; min-height: 0; }
.cat-modal-foot {
  padding: var(--sp-3) var(--sp-5); border-top: 1px solid var(--border);
  display: flex; align-items: center; justify-content: flex-end; gap: var(--sp-2); flex: none;
}
.cat-picker { display: grid; grid-template-columns: 200px 1fr; gap: 0; height: 460px; }
.cat-side { border-right: 1px solid var(--border); padding: 4px 10px; overflow-y: auto; display: flex; flex-direction: column; gap: 4px; }
.cat-group-item {
  position: relative; padding: 9px 12px; border-radius: 10px; cursor: pointer; font-size: 13px;
  color: var(--text-secondary); display: flex; align-items: center; gap: 6px; transition: background 0.15s;
}
.cat-group-item:hover { background: var(--bg-hover); }
.cat-group-item.active { background: var(--brand-soft); color: var(--text-primary); font-weight: 600; }
.cat-group-item.active::before {
  content: ''; position: absolute; left: 2px; top: 22%; bottom: 22%; width: 3px;
  border-radius: 2px; background: var(--brand-grad);
}
.cat-req {
  flex: none; font-size: 10px; padding: 1px 6px; border-radius: 999px;
  background: var(--error-soft); color: var(--error); border: 1px solid rgba(248, 113, 113, 0.3);
}
.cat-gname { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cat-gsel { margin-left: auto; flex: none; font-size: 11px; color: var(--accent2); max-width: 72px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cat-main { padding: 2px 4px 2px 18px; overflow-y: auto; }
.cat-main-head { margin-bottom: 14px; }
.cat-main-title { font-size: 14.5px; font-weight: 700; color: var(--text-primary); display: flex; align-items: center; gap: 8px; }
.cat-main-desc { font-size: var(--fs-caption); color: var(--text-tertiary); margin-top: 5px; line-height: 1.7; }
.cat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.cat-card {
  position: relative; padding: 11px 34px 11px 14px; border-radius: var(--r-md); cursor: pointer;
  background: var(--bg-inset); border: 1px solid var(--border); transition: all 0.16s;
}
.cat-card:hover { border-color: var(--border-focus); transform: translateY(-1px); }
.cat-card.selected { background: var(--brand-soft); border-color: var(--border-focus); }
.cat-name { font-size: 13px; font-weight: 600; color: var(--text-primary); }
.cat-card.selected .cat-name { color: var(--brand-400); }
.cat-desc { font-size: 11.5px; color: var(--text-tertiary); margin-top: 3px; line-height: 1.65; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.cat-check {
  position: absolute; top: 8px; right: 8px; width: 18px; height: 18px; border-radius: 50%;
  background: var(--brand-grad); color: #fff; font-size: 10px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 2px 8px rgba(124, 124, 255, 0.5);
}
.cat-empty { padding: 40px 0; text-align: center; color: var(--text-tertiary); font-size: 13px; }
.cat-count { margin-right: auto; font-size: 12.5px; color: var(--text-secondary); }
/* 弹窗内必选徽标 / 触发框已选 chip */
.cat-modal .chip-danger {
  flex: none; font-size: 10.5px; padding: 2px 8px; border-radius: 999px;
  background: var(--error-soft); color: var(--error); border: 1px solid rgba(248, 113, 113, 0.3); font-weight: 600;
}
.chip-accent { color: var(--accent2); border-color: rgba(155, 155, 255, 0.45); background: var(--brand-soft); }
/* AI 制图表单两列参数行：模型+清晰度 / 类目+平台 / 群体+年龄 / 数量+篇幅 等 */
.duo { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 640px) { .duo { grid-template-columns: 1fr; } }
@media (max-width: 700px) {
  .cat-picker { grid-template-columns: 1fr; height: auto; }
  .cat-side { flex-direction: row; flex-wrap: wrap; border-right: none; border-bottom: 1px solid var(--border); padding: 0 0 10px; margin-bottom: 12px; }
  .cat-main { padding: 0; max-height: 320px; }
  .cat-grid { grid-template-columns: repeat(2, 1fr); }
}
/* 行三选 */
.inline-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--sp-3); margin-top: var(--sp-4); }
.inline-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--sp-3); margin-top: var(--sp-4); }
@media (max-width: 640px) { .inline-2, .inline-3 { grid-template-columns: 1fr; } }
/* 高级设置折叠面板 */
.adv-panel { margin-top: var(--sp-4); border: 1px solid var(--border); border-radius: var(--r-md); background: var(--bg-inset); }
.adv-head {
  display: flex; align-items: center; gap: 10px; padding: 12px 14px; cursor: pointer; user-select: none;
}
.adv-title { font-size: var(--fs-sm); font-weight: 650; color: var(--text-primary); }
.adv-hint { flex: 1; font-size: 11px; color: var(--text-tertiary); }
.adv-arrow { font-size: 13px; color: var(--text-tertiary); transition: transform var(--dur-base) var(--ease-out); }
.adv-arrow.open { transform: rotate(180deg); }
.adv-body { padding: 4px 14px 14px; }
.adv-body .inline-3 { margin-top: 0; }
.switch-row { display: inline-flex; align-items: center; gap: 9px; font-size: var(--fs-sm); color: var(--text-secondary); cursor: pointer; }

/* ---------- 创作对话框 ---------- */
.create-box {
  max-width: 860px; margin: 0 auto var(--sp-7);
  padding: var(--sp-5);
  background:
    radial-gradient(420px 180px at 50% -40px, rgba(124, 124, 255, 0.12), transparent 75%),
    var(--bg-surface);
  border: 1px solid var(--border-strong);
  border-radius: 20px;
  box-shadow: var(--ring-edge), var(--shadow-md);
}

/* 模式切换胶囊（视频/图片） */
.cb-modes { display: flex; justify-content: center; gap: var(--sp-2); margin-bottom: var(--sp-4); }
.cb-mode {
  display: inline-flex; align-items: center; gap: 7px;
  height: 38px; padding: 0 20px;
  font-size: var(--fs-sm); font-weight: 650; color: var(--text-secondary);
  background: transparent; border: 1px solid transparent; border-radius: var(--r-full);
  cursor: pointer; transition: all var(--dur-fast) var(--ease-out);
}
.cb-mode svg { width: 15px; height: 15px; }
.cb-mode:hover { color: var(--text-primary); background: var(--bg-hover); }
.cb-mode.is-active {
  color: var(--brand-400);
  background: var(--brand-soft);
  border-color: rgba(124, 124, 255, 0.35);
  box-shadow: 0 2px 12px rgba(99, 102, 241, 0.2);
}

/* 想法输入 */
.cb-input {
  width: 100%; min-height: 160px; max-height: 320px; padding: var(--sp-4);
  font-size: 15px; line-height: 1.65; resize: none;
  background: var(--bg-inset); border: 1px solid var(--border); border-radius: var(--r-md);
}
.cb-input:focus { border-color: var(--border-focus); box-shadow: 0 0 0 3px var(--brand-soft); }

/* 素材上传行 */
.cb-assets { display: flex; align-items: center; gap: var(--sp-2); margin-top: var(--sp-3); flex-wrap: wrap; }
.cb-asset-thumb {
  position: relative; width: 56px; height: 56px; flex: none;
  border-radius: var(--r-sm); overflow: hidden;
  background: linear-gradient(145deg, rgba(124,124,255,0.16), rgba(168,85,247,0.08));
  border: 1px solid var(--border-strong);
  display: flex; align-items: center; justify-content: center; color: var(--text-tertiary);
}
.cb-asset-thumb svg { width: 18px; height: 18px; }
/* 真实上传素材：图片缩略图 + 上传中遮罩 */
.cb-asset-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cb-asset-thumb .up-mask {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  background: rgba(8, 10, 20, 0.55); backdrop-filter: blur(1px);
}
.cb-asset-thumb .up-mask .spinner { width: 16px; height: 16px; border-color: rgba(255,255,255,0.35); border-top-color: #fff; }
.cb-asset-thumb .x {
  position: absolute; top: 2px; right: 2px;
  width: 16px; height: 16px; border: none; border-radius: 50%;
  background: rgba(0, 0, 0, 0.55); color: #fff;
  font-size: 10px; line-height: 16px; text-align: center; cursor: pointer; padding: 0;
}
/* 参数栏布局优化：模型/分辨率(清晰度)下拉（公共组件 select.js）与更多参数 trigger 同行等高 */
.cb-param-bar {
  margin-top: var(--sp-3);
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
}
.cb-selects { display: flex; align-items: center; gap: 8px; flex: 1 1 240px; min-width: 0; flex-wrap: wrap; }
/* 模型名称较长占更宽，分辨率/清晰度文本较短占更窄；max-width 防大屏过度拉伸 */
.cb-selects .cs-field:nth-child(1) { flex: 1 1 220px; min-width: 0; max-width: 340px; }
.cb-selects .cs-field:nth-child(2) { flex: 1 1 150px; min-width: 0; max-width: 220px; }
.cb-selects .cs-field select { width: 100%; min-width: 0; }
.cb-asset-tip .tip-tag { color: var(--brand-300); font-weight: 700; }
.cb-asset-add {
  width: 56px; height: 56px; flex: none;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  font-size: 10px; color: var(--text-tertiary);
  background: transparent; border: 1px dashed var(--border-strong); border-radius: var(--r-sm);
  cursor: pointer; transition: all var(--dur-fast) ease;
}
.cb-asset-add:hover { color: var(--brand-400); border-color: var(--brand-500); background: var(--brand-soft); }
.cb-asset-add svg { width: 15px; height: 15px; }
.cb-asset-tip { font-size: var(--fs-caption); color: var(--text-tertiary); margin-left: var(--sp-1); }

/* 参数摘要 chip + 参数弹窗 */
.cb-trigger {
  display: inline-flex; align-items: center; gap: 8px;
  height: 36px; padding: 0 14px; font-size: var(--fs-caption); font-weight: 600; color: var(--text-secondary);
  background: var(--bg-inset); border: 1px solid var(--border); border-radius: var(--r-full);
  cursor: pointer; transition: all var(--dur-fast) ease;
}
.cb-trigger:hover { color: var(--text-primary); border-color: var(--brand-500); background: var(--brand-soft); }
.dd-ico { display: flex; align-items: center; color: var(--brand-400); }
.dd-ico i { display: block; border: 1.5px solid currentColor; border-radius: 3px; opacity: 0.85; }
.dd-val { max-width: 320px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tg-caret { width: 11px; height: 11px; color: var(--text-tertiary); }

/* 参数弹窗（居中模态） */
.cb-modal-mask {
  position: fixed; inset: 0; z-index: 100;
  display: flex; align-items: center; justify-content: center; padding: 24px;
  background: rgba(4, 6, 12, 0.62); backdrop-filter: blur(8px);
  opacity: 0; pointer-events: none; transition: opacity var(--dur-base) ease;
}
.cb-modal-mask.is-open { opacity: 1; pointer-events: auto; }
.cb-modal {
  width: 500px; max-width: 100%; max-height: min(660px, 88vh);
  display: flex; flex-direction: column;
  background:
    radial-gradient(360px 140px at 50% -30px, rgba(124, 124, 255, 0.14), transparent 70%),
    var(--bg-surface);
  border: 1px solid var(--border-strong); border-radius: 18px;
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.55), var(--ring-edge);
  transform: translateY(16px) scale(0.97); transition: transform var(--dur-base) var(--ease-out);
}
.cb-modal-mask.is-open .cb-modal { transform: none; }
.cb-modal-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: var(--sp-4) var(--sp-5); border-bottom: 1px solid var(--border); flex: none;
}
.cb-modal-title { font-size: 15px; font-weight: 720; letter-spacing: 0.01em; }
.cb-modal-close {
  width: 30px; height: 30px; display: flex; align-items: center; justify-content: center;
  border: none; border-radius: 50%; font-size: 14px; color: var(--text-tertiary);
  cursor: pointer; transition: all var(--dur-fast) ease;
}
.cb-modal-close:hover { background: var(--bg-hover); color: var(--text-primary); transform: rotate(90deg); }
.cb-modal-body { padding: var(--sp-4) var(--sp-5); overflow-y: auto; }
.cb-modal-foot {
  display: flex; align-items: center; gap: var(--sp-4);
  padding: var(--sp-4) var(--sp-5); border-top: 1px solid var(--border); flex: none;
}
.cb-modal-foot .est { font-size: var(--fs-caption); color: var(--text-tertiary); }
.cb-modal-foot .est b { font-size: 17px; color: var(--brand-400); font-weight: 750; margin: 0 2px; }
.cb-modal-foot .btn { margin-left: auto; min-width: 112px; height: 38px; border-radius: 10px; }

/* 弹窗内参数分组 */
.cbp-group + .cbp-group { margin-top: var(--sp-4); }
.cbp-label { font-size: var(--fs-caption); font-weight: 650; color: var(--text-secondary); margin-bottom: var(--sp-2); }
.cbp-grid { display: grid; gap: 8px; }
.cbp-grid.cols-2 { grid-template-columns: repeat(2, 1fr); }
.cbp-grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
.cbp-grid.cols-4 { grid-template-columns: repeat(4, 1fr); }
.cbp-grid button {
  min-width: 0; height: 36px; padding: 0 8px; font-size: var(--fs-caption); color: var(--text-secondary);
  background: var(--bg-inset); border: 1px solid var(--border); border-radius: 10px;
  cursor: pointer; transition: all var(--dur-fast) ease;
}
.cbp-grid button:hover { color: var(--text-primary); border-color: var(--border-strong); }
.cbp-grid button.is-active {
  color: var(--brand-300); border-color: var(--brand-500); background: var(--brand-soft);
  box-shadow: inset 0 0 0 1px var(--brand-500);
}
/* 模型卡（名称 + 单价） */
.cbp-grid .cb-model-chip {
  height: auto; padding: 9px 12px;
  display: flex; flex-direction: column; align-items: flex-start; gap: 2px; text-align: left;
}
.cbp-grid .cb-model-chip b { font-weight: 650; font-size: var(--fs-caption); }
.cbp-grid .cb-model-chip .pr { color: var(--brand-400); font-weight: 600; font-size: 11px; }
/* 画幅卡（比例示意 + 文案） */
.cbp-grid .ratio-card {
  height: auto; padding: 8px 4px 7px;
  display: flex; flex-direction: column; align-items: center; gap: 5px;
}
.ratio-card .r-ico { height: 22px; display: flex; align-items: center; justify-content: center; }
.ratio-card .r-ico i { display: block; border: 1.5px solid currentColor; border-radius: 3px; opacity: 0.85; }
.ratio-card .r-txt { font-size: 11px; }

/* 底部操作行 */
.cb-actions {
  display: flex; align-items: center; gap: var(--sp-4);
  margin-top: var(--sp-5); padding-top: var(--sp-4);
  border-top: 1px solid var(--border);
}
.cb-actions .est { font-size: var(--fs-caption); color: var(--text-tertiary); }
.cb-actions .est b { font-size: 17px; color: var(--brand-400); font-weight: 750; margin: 0 2px; }
.cb-actions .btn { margin-left: auto; min-width: 168px; height: 44px; border-radius: 12px; }

/* ---------- 灵感瀑布流（全宽） ---------- */
.inspire-head {
  display: flex; align-items: center; justify-content: space-between;
  margin: 0 0 var(--sp-4); padding: 0 var(--sp-1);
}
.inspire-head .t { font-size: 17px; font-weight: 700; }
.inspire-head .tabs { display: flex; gap: var(--sp-2); }
.inspire-head .chip { height: 30px; font-size: var(--fs-caption); }

.waterfall { width: 100%; column-count: 6; column-gap: var(--sp-4); }
@media (max-width: 1500px) { .waterfall { column-count: 5; } }
@media (max-width: 1200px) { .waterfall { column-count: 4; } }
@media (max-width: 900px)  { .waterfall { column-count: 3; } }
@media (max-width: 620px)  { .waterfall { column-count: 2; } }

.wf-item {
  break-inside: avoid; margin-bottom: var(--sp-4);
  border-radius: var(--r-md); overflow: hidden; cursor: pointer;
  background: var(--bg-surface); border: 1px solid var(--border);
  transition: transform var(--dur-base) var(--ease-out), box-shadow var(--dur-base) ease, border-color var(--dur-base) ease;
  animation: wfIn var(--dur-slow) var(--ease-out) both;
  animation-delay: var(--d, 0s);
}
@keyframes wfIn { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
.wf-item:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); border-color: var(--brand-500); }
.wf-item .wf-cover { position: relative; width: 100%; overflow: hidden; background: linear-gradient(145deg, rgba(124,124,255,0.1), rgba(168,85,247,0.05)); }
.wf-item .wf-cover img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform 0.5s var(--ease-out); }
.wf-item:hover .wf-cover img { transform: scale(1.05); }
.wf-item .wf-cover .kind {
  position: absolute; top: 10px; left: 10px;
  height: 22px; padding: 0 9px; display: inline-flex; align-items: center; gap: 4px;
  font-size: 11px; font-weight: 650; color: #fff;
  background: rgba(8, 10, 18, 0.55); backdrop-filter: blur(6px);
  border-radius: var(--r-full);
}
.wf-item .wf-cover .kind svg { width: 11px; height: 11px; }
.wf-item .wf-body { padding: var(--sp-3) var(--sp-3) var(--sp-4); }
.wf-item .wf-t { font-size: var(--fs-sm); font-weight: 600; }
.wf-item .wf-s { font-size: var(--fs-caption); color: var(--text-tertiary); margin-top: 4px; display: flex; align-items: center; justify-content: space-between; }
.wf-item .wf-s button {
  border: none; background: transparent; padding: 3px 9px;
  font-size: 11px; font-weight: 600; color: var(--brand-400);
  border-radius: var(--r-full); cursor: pointer;
  transition: all var(--dur-fast) ease;
}
.wf-item .wf-s button:hover { background: var(--brand-soft); }

/* 瀑布流空态 / 加载态 / 错误态（创作首页 · 发现灵感） */
.wf-empty { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 48px 0 24px; color: var(--text-tertiary); font-size: var(--fs-sm); }
.wf-empty .spinner { width: 22px; height: 22px; border-color: var(--border-strong); border-top-color: var(--brand-400); }
.wf-err { color: var(--error); font-size: var(--fs-sm); }
.wf-retry .btn { border-color: var(--border-strong); }
.wf-eol-inline { padding: 40px 0 16px; text-align: center; color: var(--text-tertiary); font-size: var(--fs-sm); }
.wf-eol { padding: var(--sp-6) 0; text-align: center; color: var(--text-tertiary); font-size: var(--fs-caption); }

/* ============================================================
   发现灵感（inspire.js）：insp- 前缀
   ============================================================ */
/* ---------- 运营 Banner 轮播 ---------- */
.insp-banner { position: relative; border-radius: var(--r-lg); overflow: hidden; margin-bottom: var(--sp-5); border: 1px solid var(--border); box-shadow: var(--shadow-md); }
.insp-banner .ib-viewport { position: relative; height: 172px; }
.ib-slide {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: space-between;
  gap: 32px; padding: 0 36px; animation: ibFade .5s var(--ease-out);
}
@keyframes ibFade { from { opacity: 0; transform: translateX(24px); } to { opacity: 1; transform: none; } }
.ib-slide::before {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background:
    radial-gradient(42% 72% at 10% 0%, rgba(255, 255, 255, 0.14), transparent 70%),
    radial-gradient(50% 80% at 95% 100%, rgba(0, 0, 0, 0.3), transparent 70%);
}
.ib-text { position: relative; z-index: 1; color: #fff; min-width: 0; }
.ib-tag {
  display: inline-flex; align-items: center; padding: 3px 11px; border-radius: var(--r-full);
  font-size: 11px; font-weight: 700; letter-spacing: 1.2px;
  background: rgba(255, 255, 255, 0.16); border: 1px solid rgba(255, 255, 255, 0.28);
}
.ib-text h2 { font-size: 22px; font-weight: 800; margin: 10px 0 6px; letter-spacing: -0.3px; }
.ib-text p { margin: 0; font-size: 13px; color: rgba(255, 255, 255, 0.78); max-width: 560px; line-height: 1.6; }
.ib-cta {
  display: inline-block; margin-top: 14px; padding: 8px 20px; border-radius: var(--r-full);
  background: #fff; color: #141926; font-size: 13px; font-weight: 700;
  transition: transform .2s var(--ease-out), box-shadow .2s;
}
.ib-cta:hover { transform: translateY(-2px); box-shadow: 0 10px 24px rgba(0, 0, 0, 0.3); }
.ib-poster {
  position: relative; z-index: 1; height: 130px; border-radius: 12px; flex: none;
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.4); object-fit: cover;
  animation: ibFloat 6s ease-in-out infinite alternate;
}
@keyframes ibFloat { from { transform: translateY(0) rotate(2deg); } to { transform: translateY(-8px) rotate(2deg); } }
.ib-dots { position: absolute; left: 50%; bottom: 10px; transform: translateX(-50%); display: flex; gap: 7px; z-index: 2; }
.ib-dots i { width: 20px; height: 4px; border-radius: 2px; background: rgba(255, 255, 255, 0.32); cursor: pointer; transition: background .2s, width .2s; }
.ib-dots i.on { width: 32px; background: #fff; }
@media (max-width: 720px) {
  .insp-banner .ib-viewport { height: 190px; }
  .ib-poster { display: none; }
  .ib-text h2 { font-size: 18px; }
}

/* ---------- 分类筛选 / 状态区 ---------- */
.insp-tabs { display: flex; gap: var(--sp-2); margin-bottom: var(--sp-5); }
.insp-tabs .chip { height: 32px; padding: 0 16px; font-size: var(--fs-sm); }
.insp-state { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 80px 0; color: var(--text-tertiary); font-size: var(--fs-sm); }
.insp-state .spinner { width: 18px; height: 18px; }
.insp-empty { text-align: center; color: var(--text-tertiary); padding: 48px 0; }
.insp-empty .ie-ico { color: var(--brand-400); margin-bottom: 12px; display: flex; justify-content: center; }
.insp-empty div { font-size: var(--fs-body); font-weight: 600; color: var(--text-secondary); }
.insp-empty p { margin: 8px auto 0; max-width: 420px; font-size: var(--fs-caption); line-height: 1.7; }
.insp-err { display: flex; flex-direction: column; align-items: center; gap: 12px; }

/* ---------- 瀑布流（flex 最短列分发，列数随容器宽度） ---------- */
.insp-masonry { display: flex; gap: var(--sp-3); align-items: flex-start; width: 100%; }
.insp-col { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; gap: var(--sp-3); }
.insp-card {
  position: relative; border-radius: var(--r-md); overflow: hidden; cursor: pointer;
  background: var(--bg-surface); border: 1px solid var(--border);
  transition: transform var(--dur-base) var(--ease-out), box-shadow var(--dur-base) ease, border-color var(--dur-base) ease;
  animation: wfIn var(--dur-slow) var(--ease-out) both;
  animation-delay: var(--d, 0s);
}
.insp-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); border-color: var(--brand-500); }
.insp-cover { position: relative; width: 100%; overflow: hidden; background: linear-gradient(145deg, rgba(124, 124, 255, 0.1), rgba(168, 85, 247, 0.05)); }
.insp-cover .insp-poster { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform .55s var(--ease-out); }
.insp-card:hover .insp-poster { transform: scale(1.05); }
.insp-cover .insp-video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; background: #000; opacity: 0; transition: opacity .35s ease; }
.insp-cover .insp-video.is-on { opacity: 1; }
.insp-shade { position: absolute; inset: 0; pointer-events: none; background: linear-gradient(transparent 45%, rgba(6, 8, 15, 0.72)); }
.insp-badge {
  position: absolute; top: 9px; left: 9px; z-index: 2;
  display: inline-flex; align-items: center; gap: 4px; height: 22px; padding: 0 9px;
  border-radius: var(--r-full); font-size: 11px; font-weight: 650; color: #fff;
  background: rgba(8, 10, 18, 0.55); backdrop-filter: blur(6px); border: 1px solid rgba(255, 255, 255, 0.18);
}
.insp-badge svg { width: 11px; height: 11px; }
.insp-script {
  position: absolute; top: 9px; right: 9px; z-index: 2;
  padding: 3px 9px; border-radius: var(--r-full); font-size: 10.5px; font-weight: 700; color: #fff;
  background: linear-gradient(90deg, rgba(16, 150, 105, 0.92), rgba(52, 211, 153, 0.85));
  border: 1px solid rgba(134, 239, 172, 0.5);
  box-shadow: 0 4px 12px rgba(16, 150, 105, 0.35);
}
.insp-cap { position: absolute; left: 11px; right: 11px; bottom: 9px; z-index: 2; pointer-events: none; }
.insp-t { font-size: var(--fs-sm); font-weight: 700; color: #fff; text-shadow: 0 1px 8px rgba(0, 0, 0, 0.55); }
.insp-meta { font-size: 11px; color: rgba(255, 255, 255, 0.72); margin-top: 3px; text-shadow: 0 1px 6px rgba(0, 0, 0, 0.5); }
.insp-make {
  position: absolute; right: 9px; bottom: 9px; z-index: 3;
  display: inline-flex; align-items: center; gap: 5px;
  padding: 6px 13px; border: none; border-radius: var(--r-full); cursor: pointer;
  background: var(--brand-grad); color: #fff; font-size: 11.5px; font-weight: 700;
  opacity: 0; transform: translateY(6px);
  transition: opacity .22s ease, transform .22s ease, box-shadow .2s ease;
  box-shadow: 0 6px 18px rgba(99, 102, 241, 0.45);
}
.insp-card:hover .insp-make { opacity: 1; transform: none; }
.insp-make:hover { box-shadow: 0 8px 22px rgba(99, 102, 241, 0.6); }
.insp-make svg { width: 12px; height: 12px; }

/* ---------- 主页签（精选作品 / 风格模板）：下划线式 ---------- */
.insp-maintabs { display: flex; gap: 24px; margin-bottom: var(--sp-4); border-bottom: 1px solid var(--border); }
.insp-maintabs button { position: relative; margin-bottom: -1px; padding: 9px 2px; border: none; background: none; cursor: pointer;
  display: inline-flex; align-items: center; gap: 6px; font-size: var(--fs-body); font-weight: 650;
  color: var(--text-secondary); transition: color var(--dur-fast) var(--ease-out); }
.insp-maintabs button:hover { color: var(--text-primary); }
.insp-maintabs button.is-active { color: var(--brand-400); }
.insp-maintabs button.is-active::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 2px;
  border-radius: 2px; background: var(--brand-grad); }

/* ---------- 风格模板页签：大分类胶囊 → 二级分类条 + 搜索 + 计数 ---------- */
.tpl-scenes { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2); margin: var(--sp-4) 0 12px; }
.tpl-scenes .chip { height: 32px; padding: 0 14px; font-size: var(--fs-sm); }
.tpl-scenes .chip b { margin-left: 5px; font-size: 11px; opacity: .65; font-variant-numeric: tabular-nums; }
.tpl-bar { display: flex; align-items: center; gap: var(--sp-3); margin-bottom: var(--sp-4); }
.tpl-bar .sp-catsw { flex: 1 1 auto; }
.tpl-sum { flex: none; font-size: var(--fs-caption); color: var(--text-tertiary); font-variant-numeric: tabular-nums; }
/* 模板卡：图位底色取与制图弹窗同源的 Code 稳定渐变（图片加载失败也留同色底）；说明允许两行 */
#tplGrid .insp-cover { background: linear-gradient(140deg, hsl(var(--h1, 220) 66% 54%) 0%, hsl(var(--h2, 260) 58% 32%) 100%); }
#tplGrid .insp-meta { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; white-space: normal; }
.tpl-cat { left: auto; right: 8px; }

/* ---------- 作品详情弹窗：左媒体 + 右参数/提示词 ---------- */
.insp-mask {
  position: fixed; inset: 0; z-index: var(--z-modal);
  background: rgba(4, 6, 14, 0.78); backdrop-filter: blur(10px);
  display: none; align-items: center; justify-content: center; padding: 24px;
}
.insp-mask.is-open { display: flex; animation: ibFade .25s ease; }
.insp-modal {
  position: relative; display: flex; width: min(1080px, 94vw); max-height: 86vh;
  border-radius: var(--r-lg); overflow: hidden;
  background: var(--bg-elevated); border: 1px solid var(--border-strong);
  box-shadow: var(--shadow-lg);
  animation: inspPop .34s var(--ease-spring);
}
@keyframes inspPop { from { opacity: 0; transform: translateY(22px) scale(0.97); } to { opacity: 1; transform: none; } }
.insp-modal-x {
  position: absolute; top: 12px; right: 12px; z-index: 5;
  width: 32px; height: 32px; border-radius: 50%; border: 1px solid rgba(255, 255, 255, 0.25);
  background: rgba(8, 10, 18, 0.55); color: #fff; cursor: pointer; font-size: 13px;
  display: flex; align-items: center; justify-content: center; transition: background .2s;
}
.insp-modal-x:hover { background: rgba(8, 10, 18, 0.85); }
.insp-modal-media {
  flex: 1 1 auto; min-width: 0; background: #05060C;
  display: flex; align-items: center; justify-content: center; overflow: hidden;
}
.insp-modal-media.is-video video { width: 100%; height: 100%; object-fit: contain; background: #000; display: block; }
.insp-modal-media.is-img { padding: 12px; }
.insp-modal-media.is-img img { max-width: 100%; max-height: 80vh; object-fit: contain; border-radius: 10px; display: block; }
.insp-modal-side {
  width: 320px; flex: none; display: flex; flex-direction: column; gap: 13px;
  padding: 22px; overflow-y: auto;
  border-left: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(124, 108, 255, 0.08), transparent 150px), var(--bg-elevated);
}
.insp-modal-tag {
  align-self: flex-start; font-size: 11px; font-weight: 700; letter-spacing: 0.8px;
  padding: 4px 11px; border-radius: var(--r-full); color: #fff; background: var(--brand-grad);
}
.insp-modal-title { font-size: 17px; font-weight: 750; line-height: 1.5; color: var(--text-primary); }
.insp-modal-chips { display: flex; gap: 7px; flex-wrap: wrap; }
.insp-modal-chips span {
  font-size: 11.5px; padding: 4px 11px; border-radius: var(--r-full);
  background: var(--bg-hover); color: var(--text-secondary); border: 1px solid var(--border);
}
.insp-modal-chips span.script {
  background: var(--success-soft); border-color: rgba(52, 211, 153, 0.4); color: var(--success); font-weight: 700;
}
.im-lbl { font-size: 11px; font-weight: 700; letter-spacing: 1px; color: var(--text-tertiary); margin-bottom: 7px; }
.insp-modal-prompt {
  font-size: 12.5px; line-height: 1.8; color: var(--text-secondary);
  white-space: pre-wrap; word-break: break-word; max-height: 260px; overflow-y: auto;
  padding: 12px 14px; border-radius: var(--r-md);
  background: var(--bg-inset); border: 1px solid var(--border);
}
.insp-modal-actions { margin-top: auto; display: flex; gap: 10px; padding-top: 8px; }
.insp-modal-actions .btn-primary { flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
@media (max-width: 860px) {
  .insp-modal { flex-direction: column; width: min(560px, 94vw); max-height: 90vh; overflow-y: auto; }
  .insp-modal-media.is-video video { max-height: 44vh; }
  .insp-modal-side { width: auto; border-left: none; border-top: 1px solid var(--border); }
}

/* ============================================================
   爆款复刻（hot-remake.js）：hr- 前缀
   ============================================================ */
/* 上传已选态：视频预览 + 文件信息 */
.hr-picked { display: grid; grid-template-columns: minmax(0, 1fr) 150px; gap: var(--sp-4); align-items: center; text-align: left; }
@media (max-width: 640px) { .hr-picked { grid-template-columns: 1fr; } }
.hr-picked video { width: 100%; max-height: 200px; border-radius: 10px; background: #000; display: block; }
.hr-picked-info { min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.hr-picked-info .n { font-size: var(--fs-sm); font-weight: 650; color: var(--text-primary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hr-picked-info .s { font-size: var(--fs-caption); color: var(--text-tertiary); line-height: 1.6; }

/* 工作台：原片预览 */
.hr-src-video { width: 100%; max-height: 300px; border-radius: 10px; background: #000; display: block; }

/* 素材位网格 */
.hr-slot-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: var(--sp-3); }
.hr-slot-card { border: 1px solid var(--border); border-radius: var(--r-md); background: var(--bg-surface); overflow: hidden; transition: border-color var(--dur-fast) ease; }
.hr-slot-card.has { border-color: rgba(124, 108, 255, 0.55); }
.hr-slot-head { display: flex; align-items: center; gap: 6px; padding: 7px 9px; }
.hr-slot-tag {
  flex: none; min-width: 24px; height: 20px; padding: 0 6px;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 10.5px; font-weight: 750; color: var(--brand-300);
  background: var(--brand-soft); border: 1px solid rgba(124, 108, 255, 0.35); border-radius: 6px;
}
.hr-slot-hint { min-width: 0; font-size: 10.5px; color: var(--text-tertiary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hr-slot-body {
  position: relative; aspect-ratio: 1; margin: 0 9px; border-radius: 9px; overflow: hidden;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg-inset); border: 1px dashed var(--border-strong);
  cursor: pointer; transition: all var(--dur-fast) ease;
}
.hr-slot-card.has .hr-slot-body { border-style: solid; }
.hr-slot-body:hover { border-color: var(--brand-500); }
/* 素材位上传中：复用遮罩抽离的网格 + 扫描线动画语言（与 hr-mask 视觉同源） */
.hr-slot-body.uploading { cursor: wait; border-color: rgba(124, 108, 255, 0.55); }
.hr-slot-body.uploading::before {
  content: ''; position: absolute; inset: 0; z-index: 1;
  background-image:
    linear-gradient(rgba(124, 108, 255, 0.1) 1px, transparent 1px),
    linear-gradient(90deg, rgba(124, 108, 255, 0.1) 1px, transparent 1px);
  background-size: 16px 16px;
  animation: hrSlotGrid 2.4s linear infinite;
}
.hr-slot-body.uploading::after {
  content: ''; position: absolute; left: 0; right: 0; top: -45%; height: 38%; z-index: 1;
  background: linear-gradient(180deg, transparent, rgba(124, 108, 255, 0.4) 55%, transparent);
  animation: hrSlotScan 1.15s ease-in-out infinite;
}
@keyframes hrSlotGrid { to { background-position: 16px 16px; } }
@keyframes hrSlotScan { from { top: -45%; } to { top: 110%; } }
.hr-slot-spin {
  position: absolute; inset: 0; z-index: 2;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 7px;
  font-size: 10.5px; font-weight: 650; color: #C9BCFF;
  background: rgba(10, 10, 18, 0.32);
}
.hr-slot-spin i {
  width: 22px; height: 22px; border-radius: 50%;
  border: 2px solid rgba(124, 108, 255, 0.28); border-top-color: #A99BFF;
  animation: hrSlotRotate 0.9s linear infinite;
}
@keyframes hrSlotRotate { to { transform: rotate(360deg); } }
.hr-slot-body img { width: 100%; height: 100%; object-fit: cover; display: block; }
.hr-slot-empty { display: flex; flex-direction: column; align-items: center; gap: 5px; font-size: 18px; color: var(--text-tertiary); text-align: center; }
.hr-slot-empty i { font-style: normal; font-size: 10.5px; line-height: 1.5; }
.hr-slot-clear {
  position: absolute; top: 5px; right: 5px; width: 20px; height: 20px;
  display: flex; align-items: center; justify-content: center;
  font-size: 10px; color: #fff; background: rgba(8, 10, 18, 0.66);
  border: none; border-radius: 50%; cursor: pointer; backdrop-filter: blur(4px);
}
.hr-slot-clear:hover { background: rgba(220, 60, 60, 0.85); }
.hr-slot-foot { display: flex; gap: 6px; padding: 7px 9px 9px; }
.hr-slot-foot button {
  flex: 1; height: 26px; font-size: 10.5px; color: var(--text-secondary);
  background: transparent; border: 1px solid var(--border); border-radius: 7px;
  cursor: pointer; transition: all var(--dur-fast) ease;
}
.hr-slot-foot button:hover { color: var(--text-primary); border-color: rgba(124, 108, 255, 0.5); background: rgba(124, 108, 255, 0.08); }

/* 脚本预览（@素材位 高亮） */
.hr-script-ok {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: 10px;
  font-size: 12px; color: var(--text-secondary); line-height: 1.6;
  background: color-mix(in srgb, var(--bg-primary) 55%, transparent); border: 1px solid var(--border);
}
.hr-script-ok .ok {
  flex: none; width: 20px; height: 20px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 800; color: #fff; background: var(--success);
}
.hr-script-ok .txt { flex: 1; min-width: 0; }
.hr-script-ok.pending { border-style: dashed; border-color: var(--border-strong); color: var(--text-tertiary); }
.hr-script-ok .btn { flex: none; }

/* 配音旁白：子级选项（主开关已选「有旁白」时展开） */
.hr-audio-sub { margin-top: 10px; padding: 10px 12px 11px; border-radius: 10px; background: color-mix(in srgb, var(--bg-primary) 50%, transparent); border: 1px solid var(--border); }
.hr-sub-label { font-size: 11px; font-weight: 650; color: var(--text-secondary); margin-bottom: 8px; }
.hr-audio-extra { display: grid; grid-template-columns: 1fr; gap: 8px; margin-top: 9px; }
.hr-audio-extra[hidden] { display: none; }

/* 右列条目（我的专属复刻 / 复刻历史） */
.hr-item-list { display: flex; flex-direction: column; gap: var(--sp-3); }
.hr-item {
  display: grid; grid-template-columns: 96px minmax(0, 1fr) auto; gap: 12px; align-items: center;
  padding: 10px; border: 1px solid var(--border); border-radius: var(--r-md); background: var(--bg-elevated);
  transition: all var(--dur-fast) ease;
}
.hr-item.clickable { cursor: pointer; }
.hr-item.clickable:hover { border-color: rgba(124, 108, 255, 0.5); transform: translateY(-1px); box-shadow: var(--shadow-md); }
.hr-item.has-video { grid-template-columns: 96px minmax(0, 1fr); cursor: pointer; }
.hr-item.has-video:hover { border-color: var(--border-strong); }
.hr-thumb {
  width: 96px; aspect-ratio: 16/10; border-radius: 9px; overflow: hidden; position: relative;
  display: flex; align-items: center; justify-content: center;
  color: rgba(255, 255, 255, 0.55); background: var(--bg-inset);
}
.hr-thumb svg { width: 22px; height: 22px; }
.hr-thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.hr-meta { min-width: 0; display: flex; flex-direction: column; gap: 5px; }
.hr-meta .t { font-size: var(--fs-sm); font-weight: 650; color: var(--text-primary); }
.hr-meta .s { font-size: 11px; color: var(--text-tertiary); display: flex; align-items: center; flex-wrap: wrap; gap: 4px 8px; }
.hr-meta .badge { flex: none; }
.hr-bar { height: 4px; border-radius: 2px; background: rgba(124, 108, 255, 0.16); overflow: hidden; margin-top: 3px; }
.hr-bar i { display: block; height: 100%; background: var(--brand-grad); transition: width var(--dur-slow) ease; }
.hr-err { font-size: 10.5px; color: #F87171; line-height: 1.5; }
.hr-go { flex: none; color: var(--brand-400); }
.hr-go svg { width: 16px; height: 16px; }

/* ---------- 进行中：全区域大卡（追踪最新任务，完成原位变播放器） ---------- */
.vs-pane[data-pane="prog"].is-active { display: flex; flex-direction: column; min-height: 100%; }
.vs-pane[data-pane="prog"] #progList { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.hr-hero {
  flex: 1; display: flex; flex-direction: column; gap: 10px;
  padding: var(--sp-4); border: 1px solid var(--border); border-radius: var(--r-lg);
  background:
    radial-gradient(120% 90% at 85% -10%, rgba(124, 108, 255, 0.12), transparent 55%),
    var(--bg-elevated);
}
.hr-hero-head { display: flex; align-items: center; gap: 10px; }
.hr-hero-head .t { flex: 1; min-width: 0; font-size: 15px; font-weight: 700; color: var(--text-primary); }
.hr-hero-meta { font-size: 11px; color: var(--text-tertiary); }
/* ---------- 进行中：科技感进度区（网格底 + 扫描线 + 发光进度 + 步骤清单） ---------- */
.hr-hero.is-running { position: relative; overflow: hidden; }
.hr-hero-progress {
  position: relative; flex: 1; display: flex; flex-direction: column; justify-content: center;
  gap: 14px; padding: var(--sp-4); margin: 0 calc(var(--sp-4) * -1) calc(var(--sp-4) * -1);
  border-radius: 0 0 var(--r-lg) var(--r-lg); overflow: hidden;
  background:
    radial-gradient(120% 100% at 50% 115%, rgba(124, 108, 255, 0.14), transparent 60%),
    color-mix(in srgb, var(--bg-primary) 45%, transparent);
}
/* 网格底纹（缓慢平移） */
.hr-hero-progress::before {
  content: ''; position: absolute; inset: 0; z-index: 0; pointer-events: none;
  background-image:
    linear-gradient(rgba(124, 108, 255, 0.09) 1px, transparent 1px),
    linear-gradient(90deg, rgba(124, 108, 255, 0.09) 1px, transparent 1px);
  background-size: 18px 18px;
  animation: hrHeroGrid 2.6s linear infinite;
  mask-image: radial-gradient(120% 100% at 50% 100%, #000 45%, transparent 100%);
  -webkit-mask-image: radial-gradient(120% 100% at 50% 100%, #000 45%, transparent 100%);
}
@keyframes hrHeroGrid { to { background-position: 18px 18px; } }
/* 扫描线上下巡扫 */
.hr-hero-progress::after {
  content: ''; position: absolute; left: 0; right: 0; top: -40%; height: 34%; z-index: 0; pointer-events: none;
  background: linear-gradient(180deg, transparent, rgba(124, 108, 255, 0.13) 55%, transparent);
  animation: hrHeroScan 3.2s ease-in-out infinite;
}
@keyframes hrHeroScan { from { top: -40%; } to { top: 110%; } }
.hr-hero-progress > * { position: relative; z-index: 1; }
.hr-hero-nums { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; }
.hr-hero-pct {
  font-size: 46px; font-weight: 800; line-height: 0.9; letter-spacing: -0.02em;
  background: var(--brand-grad); -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 0 14px rgba(124, 108, 255, 0.45));
}
.hr-hero-pct span { font-size: 22px; font-weight: 700; }
.hr-hero-stepnow {
  font-size: 11px; font-weight: 650; letter-spacing: 0.4px; color: var(--brand-300);
  padding: 4px 9px; border-radius: var(--r-full); white-space: nowrap;
  background: rgba(124, 108, 255, 0.1); border: 1px solid rgba(124, 108, 255, 0.32);
  text-shadow: 0 0 10px rgba(124, 108, 255, 0.6);
}
/* 六步执行清单 */
.hr-hero-steps { display: flex; flex-direction: column; gap: 2px; }
.hstep {
  display: flex; align-items: center; gap: 9px;
  padding: 6px 9px; border-radius: 8px;
  font-size: 11.5px; color: var(--text-tertiary);
  border: 1px solid transparent; transition: all var(--dur-base) ease;
}
.hstep-idx { flex: none; font-size: 10px; font-weight: 750; color: var(--text-tertiary); opacity: 0.7; transition: color var(--dur-base) ease; }
.hstep-txt { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hstate { flex: none; width: 6px; height: 6px; border-radius: 50%; background: var(--border-strong); transition: all var(--dur-base) ease; }
.hstep.is-done { color: var(--text-secondary); }
.hstep.is-done .hstep-idx { color: var(--success); opacity: 1; }
.hstep.is-done .hstate { background: var(--success); box-shadow: 0 0 6px rgba(74, 222, 128, 0.7); }
.hstep.is-active {
  color: var(--text-primary); font-weight: 650;
  background: rgba(124, 108, 255, 0.1); border-color: rgba(124, 108, 255, 0.35);
}
.hstep.is-active .hstep-idx { color: var(--brand-300); opacity: 1; text-shadow: 0 0 8px rgba(124, 108, 255, 0.8); }
.hstep.is-active .hstate { background: var(--brand-400); box-shadow: 0 0 8px rgba(124, 108, 255, 0.9); animation: hrHeroPulse 1.1s ease-in-out infinite; }
@keyframes hrHeroPulse { 50% { transform: scale(1.7); opacity: 0.55; } }
.hr-hero-bar {
  position: relative; height: 8px; border-radius: 4px; overflow: hidden;
  background: rgba(124, 108, 255, 0.12);
  box-shadow: inset 0 0 0 1px rgba(124, 108, 255, 0.18);
}
.hr-hero-bar i {
  display: block; height: 100%; border-radius: 4px; width: 0;
  background: var(--brand-grad); position: relative; overflow: hidden;
  box-shadow: 0 0 12px rgba(124, 108, 255, 0.65);
  transition: width 0.35s linear;
}
.hr-hero-bar i::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
  animation: hrHeroShine 1.5s linear infinite;
}
@keyframes hrHeroShine { from { transform: translateX(-100%); } to { transform: translateX(100%); } }
.hr-hero-tip { font-size: 11px; color: var(--text-tertiary); line-height: 1.6; }
.hr-hero-tip.ok { color: var(--success); }
.hr-hero-video { border-radius: 12px; overflow: hidden; background: #000; border: 1px solid var(--border); }
.hr-hero-video video { display: block; width: 100%; max-height: 52vh; background: #000; }
.hr-hero-err {
  font-size: 12px; color: #F87171; line-height: 1.7; padding: 10px 12px; border-radius: 10px;
  background: rgba(248, 113, 113, 0.08); border: 1px solid rgba(248, 113, 113, 0.25);
}
.hero-empty { margin: auto 0; }

/* ---------- 我的专属复刻：一行 4 个卡片网格 ---------- */
.hr-mine-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--sp-3); }
@media (max-width: 1400px) { .hr-mine-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 1080px) { .hr-mine-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.hr-mine-card {
  overflow: hidden; cursor: default;
  border: 1px solid var(--border); border-radius: var(--r-md); background: var(--bg-elevated);
  transition: all var(--dur-fast) ease;
}
.hr-mine-card.clickable { cursor: pointer; }
.hr-mine-card.clickable:hover { border-color: rgba(124, 108, 255, 0.5); box-shadow: var(--shadow-md); transform: translateY(-2px); }
.hr-mine-card .mc-cover { position: relative; aspect-ratio: 16/10; background: var(--bg-inset); overflow: hidden; }
.hr-mine-card .mc-cover img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.hr-mine-card .mc-video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity var(--dur-fast) ease; pointer-events: none; }
.hr-mine-card:hover .mc-video.is-on { opacity: 1; }
.hr-mine-card .mc-ph { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: var(--text-tertiary); }
.hr-mine-card .mc-ph svg { width: 28px; height: 28px; }
.hr-mine-card .mc-badge { position: absolute; left: 8px; top: 8px; }
.hr-mine-card .mc-badge .badge { font-size: 10px; padding: 2px 8px; backdrop-filter: blur(4px); }
.hr-mine-card .mc-go {
  position: absolute; right: 8px; bottom: 8px;
  width: 26px; height: 26px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: #fff; background: rgba(8, 10, 18, 0.55); backdrop-filter: blur(4px);
  opacity: 0; transform: translateX(-4px); transition: all var(--dur-fast) ease;
}
.hr-mine-card .mc-go svg { width: 14px; height: 14px; }
.hr-mine-card.clickable:hover .mc-go { opacity: 1; transform: translateX(0); }
.hr-mine-card .mc-spin {
  position: absolute; right: 8px; bottom: 8px; width: 16px; height: 16px;
  border-radius: 50%; border: 2px solid rgba(124, 108, 255, 0.3); border-top-color: #A99BFF;
  animation: hrSlotRotate 0.9s linear infinite;
}
/* 专属复刻删除按钮：封面右上角，悬停浮现；避开左上徽章（badge）与右下角标 */
.hr-mine-card .mc-del {
  position: absolute; right: 8px; top: 8px; z-index: 2;
  width: 24px; height: 24px; border: none; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; line-height: 1; color: #fff;
  background: rgba(8, 10, 18, 0.55); backdrop-filter: blur(4px);
  cursor: pointer; opacity: 0; transform: scale(0.8);
  transition: all var(--dur-fast) ease;
}
.hr-mine-card:hover .mc-del { opacity: 1; transform: scale(1); }
.hr-mine-card .mc-del:hover { background: var(--error); }
.hr-mine-card .mc-del:disabled { opacity: 0.4; cursor: wait; }
.hr-mine-card .mc-info { padding: 9px 11px 11px; display: flex; flex-direction: column; gap: 4px; }
.hr-mine-card .mc-info .t { font-size: var(--fs-sm); font-weight: 650; color: var(--text-primary); }
.hr-mine-card .mc-info .s { font-size: 11px; color: var(--text-tertiary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------- 复刻历史：搜索框 + 瀑布流 ---------- */
.hr-search { position: relative; margin-bottom: var(--sp-3); }
.hr-search .input { width: 100%; height: 34px; padding-left: 30px; font-size: var(--fs-sm); }
.hr-search > svg {
  position: absolute; left: 10px; top: 50%; translate: 0 -50%;
  width: 14px; height: 14px; color: var(--text-tertiary); pointer-events: none;
}
.hr-wf { columns: 2; column-gap: var(--sp-3); }
@media (max-width: 1180px) { .hr-wf { columns: 1; } }
.hr-wf-card {
  break-inside: avoid; margin-bottom: var(--sp-3); overflow: hidden;
  border: 1px solid var(--border); border-radius: var(--r-md); background: var(--bg-elevated);
  transition: all var(--dur-fast) ease;
}
.hr-wf-card.has-video { cursor: pointer; }
.hr-wf-card.has-video:hover { border-color: rgba(124, 108, 255, 0.5); box-shadow: var(--shadow-md); transform: translateY(-1px); }
.hr-wf-card .wf-cover { position: relative; aspect-ratio: 16/10; background: var(--bg-inset); overflow: hidden; }
.hr-wf-card .wf-cover video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.hr-wf-card .wf-play {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  color: #fff; background: rgba(8, 10, 18, 0.14); transition: background var(--dur-fast) ease;
}
.hr-wf-card .wf-play svg {
  width: 34px; height: 34px; padding: 9px; box-sizing: content-box; border-radius: 50%;
  background: rgba(8, 10, 18, 0.55); backdrop-filter: blur(3px);
}
.hr-wf-card.has-video:hover .wf-play { background: rgba(8, 10, 18, 0.04); }
.hr-wf-card.is-playing .wf-play { display: none; }
.hr-wf-card .wf-cover.ph { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 9px; color: var(--text-tertiary); }
.hr-wf-card .wf-cover.ph svg { width: 26px; height: 26px; }
.hr-wf-card .wf-cover.ph.err { color: rgba(248, 113, 113, 0.7); }
.hr-wf-card .wf-pct { font-size: 12px; font-weight: 700; color: var(--brand-300); }
.hr-bar.big { width: 56%; height: 5px; margin-top: 0; }
.hr-wf-card .wf-info { padding: 9px 11px 11px; display: flex; flex-direction: column; gap: 5px; }
.hr-wf-card .wf-info .t { font-size: var(--fs-sm); font-weight: 650; color: var(--text-primary); }
.hr-wf-card .wf-info .s { font-size: 11px; color: var(--text-tertiary); display: flex; align-items: center; flex-wrap: wrap; gap: 4px 8px; }

/* ---------- 脚本创作遮罩（旧版同款动画：脉冲渐变光球 + 卡片 + 流光进度条；与爆款拆解 hr-mask 区分） ---------- */
.gen-mask {
  position: fixed; inset: 0; z-index: 1300;
  display: flex; align-items: center; justify-content: center; padding: 24px;
  background: rgba(5, 6, 12, 0.84); backdrop-filter: blur(8px);
  animation: genMaskFade .22s ease;
}
@keyframes genMaskFade { from { opacity: 0; } to { opacity: 1; } }
.gen-box {
  position: relative;
  width: 440px; max-width: calc(100vw - 48px); padding: 40px 36px; text-align: center;
  color: var(--text);
  background: var(--card); border: 1px solid var(--line2);
  border-radius: 20px; box-shadow: var(--shadow-lg);
  animation: genBoxIn .28s cubic-bezier(.3, .7, .4, 1);
}
@keyframes genBoxIn { from { opacity: 0; transform: translateY(14px) scale(.97); } to { opacity: 1; transform: none; } }
.gen-orb {
  width: 72px; height: 72px; margin: 0 auto 22px; border-radius: 50%;
  background: linear-gradient(135deg, #7C6CFF 0%, #4EA1FF 100%);
  animation: genOrb 1.5s ease-in-out infinite;
  box-shadow: 0 0 40px rgba(124, 108, 255, 0.55);
}
@keyframes genOrb { 0%, 100% { transform: scale(1); opacity: 1; } 50% { transform: scale(.7); opacity: .75; } }
.gen-title { font-size: 17px; font-weight: 700; margin-bottom: 6px; color: var(--text); }
.gen-sub { font-size: 12.5px; color: var(--sub); margin-bottom: 22px; line-height: 1.6; }
.gen-meta { display: flex; justify-content: space-between; align-items: center; margin: 12px 0 7px; font-size: 12px; }
.gen-phase { color: var(--sub); letter-spacing: .3px; }
.gen-pct { font-weight: 700; color: var(--text2); font-variant-numeric: tabular-nums; }
.gen-progress { height: 8px; border-radius: 99px; background: rgba(255, 255, 255, 0.06); box-shadow: inset 0 1px 3px rgba(0, 0, 0, .35); overflow: hidden; }
.gen-progress .bar {
  position: relative; height: 100%; min-width: 0; border-radius: 99px;
  background: linear-gradient(90deg, #7C6CFF, #4EA1FF, #7C6CFF); background-size: 200% 100%;
  animation: genFlow 2.4s linear infinite;
  box-shadow: 0 0 10px rgba(124, 108, 255, .55), 0 0 22px rgba(78, 161, 255, .25);
  transition: width .45s cubic-bezier(.3, .7, .4, 1); overflow: hidden;
}
/* 扫描高光：一道白光随流光循环扫过条体 */
.gen-progress .bar::after {
  content: ''; position: absolute; inset: 0; border-radius: inherit;
  background: linear-gradient(100deg, transparent 32%, rgba(255, 255, 255, 0.5) 50%, transparent 68%);
  background-size: 200% 100%; animation: genSweep 2.4s linear infinite;
}
@keyframes genFlow { to { background-position: -200% 0; } }
@keyframes genSweep { from { background-position: 160% 0; } to { background-position: -160% 0; } }
.gen-count { margin-top: 14px; font-size: 13px; color: var(--text2); font-variant-numeric: tabular-nums; }

/* ---------- 高科技遮罩（分析拆解 / 脚本改写共用 hr-mask，视频生成用 hr-submit） ---------- */
.hr-mask, .hr-submit {
  position: fixed; inset: 0; z-index: 1300;
  display: flex; align-items: center; justify-content: center; padding: 24px;
  background: rgba(6, 7, 14, 0.88); backdrop-filter: blur(8px);
}
.hr-grid-bg {
  position: absolute; inset: -50%;
  background-image:
    linear-gradient(rgba(124, 108, 255, 0.07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(124, 108, 255, 0.07) 1px, transparent 1px);
  background-size: 44px 44px;
  animation: hrGridMove 9s linear infinite;
}
@keyframes hrGridMove { to { transform: translate(44px, 44px); } }
.hr-scanline {
  position: absolute; left: 0; right: 0; top: 10%; height: 2px; pointer-events: none;
  background: linear-gradient(90deg, transparent 4%, rgba(124, 108, 255, 0.75) 50%, transparent 96%);
  opacity: 0.75; animation: hrScan 3.4s ease-in-out infinite;
}
@keyframes hrScan { 0%, 100% { top: 9%; } 50% { top: 90%; } }

/* 分析遮罩中心盒：轨道光点 + 流光进度 */
.hr-box {
  position: relative; width: min(400px, 100%); padding: 30px 30px 26px; text-align: center;
  background: rgba(14, 15, 26, 0.92); border: 1px solid rgba(124, 108, 255, 0.32); border-radius: 18px;
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(255, 255, 255, 0.03) inset;
}
.hr-orbit { position: relative; width: 74px; height: 74px; margin: 0 auto 16px; }
.hr-orbit .ring { position: absolute; inset: 0; border-radius: 50%; border: 1.5px solid rgba(124, 108, 255, 0.4); animation: hrSpin 2.6s linear infinite; }
.hr-orbit .sat { position: absolute; top: -4px; left: 50%; width: 8px; height: 8px; margin-left: -4px; border-radius: 50%; background: #A99BFF; box-shadow: 0 0 12px rgba(148, 128, 255, 0.95); }
.hr-orbit .core {
  position: absolute; inset: 22px; border-radius: 50%;
  background: radial-gradient(circle at 38% 34%, #B7A8FF 0%, #7C6CFF 52%, #4B3FBF 100%);
  box-shadow: 0 0 22px rgba(124, 108, 255, 0.65); animation: hrPulse 1.8s ease-in-out infinite;
}
@keyframes hrSpin { to { transform: rotate(360deg); } }
@keyframes hrPulse { 0%, 100% { transform: scale(1); opacity: 0.92; } 50% { transform: scale(1.08); opacity: 1; } }
.hr-title { font-size: 15.5px; font-weight: 750; color: #F2F3FB; letter-spacing: 0.02em; }
.hr-sub { margin-top: 6px; font-size: 12px; color: #9BA0C0; line-height: 1.6; }
.hr-mask-meta { display: flex; justify-content: space-between; align-items: center; margin: 15px 0 8px; font-size: 11.5px; }
.hr-phase { color: #9BA0C0; letter-spacing: 0.02em; }
.hr-pct { font-weight: 750; color: #C9BCFF; font-variant-numeric: tabular-nums; }
.hr-progress { height: 8px; border-radius: 5px; background: rgba(124, 108, 255, 0.14); overflow: hidden; }
.hr-progress .bar {
  position: relative; height: 100%; border-radius: 5px; width: 0;
  background: linear-gradient(90deg, #6D5DF6, #9D8BFF 55%, #C7BAFF);
  transition: width 0.16s linear;
}
.hr-progress .bar::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(100deg, transparent 30%, rgba(255, 255, 255, 0.45) 50%, transparent 70%);
  background-size: 200% 100%; animation: hrShine 1.4s linear infinite;
}
@keyframes hrShine { from { background-position: 160% 0; } to { background-position: -160% 0; } }
.hr-tip { margin-top: 15px; font-size: 11px; color: #767B9E; }

/* 提交遮罩：扫描环 + 假进度 + 友好提醒 */
.hr-card {
  position: relative; width: min(430px, 100%); max-height: calc(100vh - 48px); overflow-y: auto;
  padding: 30px 30px 24px; text-align: center;
  background: rgba(14, 15, 26, 0.92); border: 1px solid rgba(124, 108, 255, 0.32); border-radius: 18px;
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(255, 255, 255, 0.03) inset;
}
.hr-scanner { position: relative; width: 78px; height: 78px; margin: 0 auto 16px; }
.hr-scanner .ring { position: absolute; inset: 0; border-radius: 50%; border: 1.5px solid rgba(124, 108, 255, 0.35); animation: hrSpin 2.8s linear infinite; }
.hr-scanner .ring.r2 { inset: 9px; border-color: rgba(124, 108, 255, 0.55); animation-duration: 2s; animation-direction: reverse; }
.hr-scanner .ring.r3 { inset: 18px; border-color: rgba(199, 186, 255, 0.65); animation-duration: 1.4s; }
.hr-scanner .core {
  position: absolute; inset: 28px; border-radius: 50%;
  background: radial-gradient(circle at 38% 34%, #B7A8FF 0%, #7C6CFF 52%, #4B3FBF 100%);
  box-shadow: 0 0 22px rgba(124, 108, 255, 0.65); animation: hrPulse 1.8s ease-in-out infinite;
}
.hr-step { margin-top: 6px; font-size: 12px; color: #9BA0C0; line-height: 1.6; min-height: 19px; }
.hr-track { position: relative; height: 9px; margin-top: 15px; border-radius: 5px; background: rgba(124, 108, 255, 0.14); overflow: hidden; }
.hr-fill {
  position: relative; height: 100%; width: 0; border-radius: 5px;
  background: linear-gradient(90deg, #6D5DF6, #9D8BFF 55%, #C7BAFF);
  transition: width 0.18s linear;
}
.hr-shine {
  position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(100deg, transparent 30%, rgba(255, 255, 255, 0.4) 50%, transparent 70%);
  background-size: 200% 100%; animation: hrShine 1.4s linear infinite;
}
.hr-submit .hr-pct { margin-top: 9px; font-size: 13px; font-weight: 750; color: #C9BCFF; }
.hr-video { margin-top: 14px; }
.hr-video video { width: 100%; max-height: 240px; border-radius: 12px; background: #000; display: block; }
.hr-hint { margin-top: 14px; font-size: 11.5px; color: #8B90B4; line-height: 1.75; }
.hr-actions { display: flex; gap: 10px; margin-top: 16px; }
.hr-actions .btn { flex: 1; height: 40px; }

/* ============================================================
   商品库（product-lib.js）：pl- 前缀
   ============================================================ */
.pl-bar { display: flex; align-items: center; gap: 12px; margin: 20px 0 16px; flex-wrap: wrap; }
.pl-tabs { display: flex; gap: 8px; flex-wrap: wrap; }
.pl-search {
  position: relative; margin-left: auto; max-width: 280px; flex: 1 1 200px; min-width: 160px;
}
.pl-search svg { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); width: 14px; height: 14px; color: var(--text-tertiary); pointer-events: none; }
.pl-search input {
  width: 100%; padding: 8px 12px 8px 34px; border-radius: var(--r-md); font-size: 13px; color: var(--text-primary);
  background: var(--bg-inset); border: 1px solid var(--border); outline: none; transition: border-color var(--dur-fast) ease;
}
.pl-search input:focus { border-color: var(--brand-500); }
.pl-search input::placeholder { color: var(--text-tertiary); }

/* 商品卡片网格 */
.pl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; }
.pl-card {
  border-radius: var(--r-md); overflow: hidden; cursor: pointer;
  background: var(--bg-surface); border: 1px solid var(--border);
  transition: all var(--dur-fast) var(--ease-out);
}
.pl-card:hover { border-color: rgba(124, 124, 255, 0.5); transform: translateY(-3px); box-shadow: var(--shadow-md); }
.pl-cover { position: relative; aspect-ratio: 1; background: var(--bg-inset); overflow: hidden; }
.pl-cover img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform var(--dur-base) ease; }
.pl-card:hover .pl-cover img { transform: scale(1.05); }
.pl-cover-ph { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; color: var(--text-tertiary); opacity: 0.4; }
.pl-badge {
  position: absolute; top: 10px; left: 10px; font-size: 11px; font-weight: 700; padding: 3px 10px;
  border-radius: var(--r-full); backdrop-filter: blur(6px); background: rgba(8, 10, 18, 0.6); color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.15);
}
.pl-badge.badge-success { background: rgba(52, 211, 153, 0.85); border-color: rgba(52, 211, 153, 0.5); }
.pl-badge.badge-warning { background: rgba(251, 191, 36, 0.85); border-color: rgba(251, 191, 36, 0.5); color: #1a1a2e; }
.pl-badge.badge-error { background: rgba(248, 113, 113, 0.85); border-color: rgba(248, 113, 113, 0.5); }
/* 生成中转圈 */
.pl-spin { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; background: rgba(8, 10, 18, 0.35); }
.pl-spin i { width: 28px; height: 28px; border-radius: 50%; border: 3px solid rgba(124, 124, 255, 0.25); border-top-color: var(--brand-400); animation: plSpin .9s linear infinite; display: block; }
.pl-spin.lg i { width: 40px; height: 40px; border-width: 4px; }
.pl-spin.lg { flex-direction: column; gap: 10px; }
.pl-spin.lg span { font-size: 12px; color: var(--text-secondary); }
@keyframes plSpin { to { transform: rotate(360deg); } }
/* 失败遮罩 */
.pl-fail-mask { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; padding: 16px; background: rgba(248, 113, 113, 0.12); }
.pl-fail-msg { font-size: 11.5px; color: var(--error); text-align: center; line-height: 1.5; word-break: break-word; }

.pl-body { padding: 10px 12px; }
.pl-name { font-size: 14px; font-weight: 650; color: var(--text-primary); }
.pl-cat { font-size: 12px; color: var(--text-tertiary); margin-top: 3px; }
.pl-sps { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.pl-sp { font-size: 10.5px; padding: 2px 8px; border-radius: var(--r-full); background: var(--brand-soft); color: var(--brand-400); border: 1px solid rgba(124, 124, 255, 0.2); }
.pl-foot { display: flex; align-items: center; justify-content: space-between; padding: 8px 12px 10px; border-top: 1px solid var(--border); }
.pl-credits { font-size: 12px; font-weight: 650; color: var(--brand-400); }
.pl-time { font-size: 11px; color: var(--text-tertiary); }

/* 空态/错误 */
.pl-state { padding: 60px 20px; text-align: center; color: var(--text-tertiary); font-size: 14px; }
.pl-empty { text-align: center; padding: 50px 20px; }
.pl-empty-ico { color: var(--text-tertiary); opacity: 0.35; margin-bottom: 12px; }
.pl-empty > div { font-size: 15px; font-weight: 600; color: var(--text-secondary); }
.pl-empty p { font-size: 12.5px; color: var(--text-tertiary); margin-top: 8px; line-height: 1.7; }
.pl-err { display: flex; flex-direction: column; align-items: center; gap: 12px; }
.pl-err svg { color: var(--error); }

/* 分页 */
.pl-pager { display: flex; align-items: center; justify-content: center; gap: 14px; margin-top: 24px; }
.pl-pager button { width: 36px; height: 36px; border-radius: var(--r-md); font-size: 18px; cursor: pointer;
  background: var(--bg-surface); border: 1px solid var(--border); color: var(--text-secondary); transition: all var(--dur-fast) ease; }
.pl-pager button:hover:not(:disabled) { border-color: var(--brand-500); color: var(--brand-400); background: var(--brand-soft); }
.pl-pager button:disabled { opacity: 0.3; cursor: not-allowed; }
.pl-page-ind { font-size: 13px; font-weight: 700; color: var(--text-secondary); font-variant-numeric: tabular-nums; min-width: 56px; text-align: center; }

/* 弹窗（复用 .pl-mask） */
.pl-mask {
  position: fixed; inset: 0; z-index: var(--z-modal);
  background: rgba(4, 6, 14, 0.78); backdrop-filter: blur(10px);
  display: none; align-items: center; justify-content: center; padding: 24px;
}
.pl-mask.is-open { display: flex; animation: ibFade .25s ease; }

/* 添加商品弹窗 */
.pl-modal {
  width: min(520px, 94vw); max-height: 86vh; display: flex; flex-direction: column;
  border-radius: var(--r-lg); overflow: hidden;
  background: var(--bg-elevated); border: 1px solid var(--border-strong); box-shadow: var(--shadow-lg);
  animation: inspPop .34s var(--ease-spring);
}
.pl-modal .modal-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.pl-modal .modal-head h3 { display: flex; align-items: center; gap: 8px; font-size: 16px; font-weight: 700; color: var(--text-primary); }
.pl-modal .modal-close { width: 30px; height: 30px; border-radius: 50%; border: none; cursor: pointer; background: var(--bg-hover); color: var(--text-secondary); font-size: 14px; transition: all var(--dur-fast) ease; }
.pl-modal .modal-close:hover { background: var(--bg-active); color: var(--text-primary); }
.pl-modal .modal-body { flex: 1; overflow-y: auto; padding: 20px; }
.pl-modal .modal-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 14px 20px; border-top: 1px solid var(--border); }
.pl-modal .modal-foot .btn { min-width: 90px; }

/* 上传区 */
.pl-upload-zone {
  border: 2px dashed var(--border-strong); border-radius: var(--r-md); padding: 32px 20px;
  text-align: center; cursor: pointer; transition: all var(--dur-fast) ease; background: var(--bg-inset);
}
.pl-upload-zone:hover, .pl-upload-zone.is-drag { border-color: var(--brand-500); background: var(--brand-soft); }
.pl-drop-icon { color: var(--text-tertiary); margin-bottom: 8px; display: flex; justify-content: center; }
.pl-upload-zone:hover .pl-drop-icon, .pl-upload-zone.is-drag .pl-drop-icon { color: var(--brand-400); }
.pl-drop-t { font-size: 14px; font-weight: 650; color: var(--text-secondary); }
.pl-drop-s { font-size: 12px; color: var(--text-tertiary); margin-top: 4px; }

/* 已上传参考图 */
.pl-refs { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 14px; }
.pl-ref { position: relative; width: 100px; height: 100px; border-radius: var(--r-sm); overflow: hidden; border: 1px solid var(--border-strong); }
.pl-ref img { width: 100%; height: 100%; object-fit: cover; }
.pl-ref-x { position: absolute; top: 4px; right: 4px; width: 20px; height: 20px; border-radius: 50%; border: none; cursor: pointer; background: rgba(0, 0, 0, 0.65); color: #fff; font-size: 11px; line-height: 1; }
.pl-ref-x:hover { background: var(--error); }

.pl-note { margin-top: 16px; }
.pl-lbl { font-size: 12px; font-weight: 700; letter-spacing: 0.5px; color: var(--text-tertiary); margin-bottom: 7px; display: block; }
.pl-note textarea {
  width: 100%; padding: 10px 12px; border-radius: var(--r-md); font-size: 13px; color: var(--text-primary); line-height: 1.6;
  background: var(--bg-inset); border: 1px solid var(--border); outline: none; resize: vertical; transition: border-color var(--dur-fast) ease;
  font-family: inherit;
}
.pl-note textarea:focus { border-color: var(--brand-500); }
.pl-price-hint { margin-top: 14px; padding: 10px 14px; border-radius: var(--r-md); font-size: 12px; color: var(--text-secondary); background: var(--brand-soft); border: 1px solid rgba(124, 124, 255, 0.2); }

/* 详情弹窗（更宽） */
.pl-detail {
  width: min(960px, 94vw); max-height: 86vh; display: flex; flex-direction: column;
  border-radius: var(--r-lg); overflow: hidden;
  background: var(--bg-elevated); border: 1px solid var(--border-strong); box-shadow: var(--shadow-lg);
  animation: inspPop .34s var(--ease-spring);
}
.pl-detail .modal-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.pl-detail .modal-head h3 { font-size: 16px; font-weight: 700; color: var(--text-primary); }
.pl-detail .modal-close { width: 30px; height: 30px; border-radius: 50%; border: none; cursor: pointer; background: var(--bg-hover); color: var(--text-secondary); font-size: 14px; transition: all var(--dur-fast) ease; }
.pl-detail .modal-close:hover { background: var(--bg-active); color: var(--text-primary); }
.pl-detail .modal-body { flex: 1; overflow-y: auto; padding: 20px; }
.pl-detail .modal-foot { display: flex; align-items: center; gap: 10px; padding: 14px 20px; border-top: 1px solid var(--border); }
.pl-detail .modal-foot .btn { min-width: 80px; }
.pl-detail .modal-foot .pl-del { margin-right: auto; color: var(--error); }
.pl-detail .modal-foot .pl-del:hover:not(:disabled) { background: var(--error-soft); }
.pl-detail .modal-foot .pl-del:disabled { opacity: 0.4; cursor: not-allowed; }

.pl-detail-loading { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 60px 20px; color: var(--text-tertiary); }

.pl-detail-grid { display: grid; grid-template-columns: 300px 1fr; gap: 24px; }
@media (max-width: 760px) { .pl-detail-grid { grid-template-columns: 1fr; } }

.pl-detail-media { display: flex; flex-direction: column; gap: 16px; }
.pl-six { aspect-ratio: 1; border-radius: var(--r-md); overflow: hidden; background: var(--bg-inset); border: 1px solid var(--border); }
.pl-six img { width: 100%; height: 100%; object-fit: contain; display: block; }
.pl-six-ph { width: 100%; height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; color: var(--text-tertiary); opacity: 0.5; }
.pl-refs-thumbs { }
.pl-refs-row { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.pl-refs-row img { width: 56px; height: 56px; object-fit: cover; border-radius: 6px; border: 1px solid var(--border); }

.pl-detail-form { display: flex; flex-direction: column; gap: 14px; }
.pl-form-row { display: flex; flex-direction: column; gap: 4px; }
.pl-form-row input[type="text"], .pl-form-row textarea {
  width: 100%; padding: 8px 12px; border-radius: var(--r-sm); font-size: 13px; color: var(--text-primary);
  background: var(--bg-inset); border: 1px solid var(--border); outline: none; transition: border-color var(--dur-fast) ease;
  font-family: inherit;
}
.pl-form-row input[type="text"]:focus, .pl-form-row textarea:focus { border-color: var(--brand-500); }
.pl-form-row textarea { resize: vertical; line-height: 1.6; }
.pl-readonly { font-size: 12.5px; color: var(--text-secondary); padding: 8px 12px; border-radius: var(--r-sm); background: var(--bg-inset); border: 1px solid var(--border); line-height: 1.6; }

.pl-meta-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; font-size: 12px; color: var(--text-tertiary); padding-top: 4px; }
.pl-error-msg { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--error); padding: 8px 12px; border-radius: var(--r-sm); background: var(--error-soft); border: 1px solid rgba(248, 113, 113, 0.25); }

/* 规格 KV 编辑 */
.pl-specs, .pl-sps-edit { display: flex; flex-direction: column; gap: 6px; }
.pl-spec-row { display: flex; gap: 6px; }
.pl-spec-k, .pl-spec-v { flex: 1; padding: 6px 10px; border-radius: var(--r-sm); font-size: 12.5px; color: var(--text-primary); background: var(--bg-inset); border: 1px solid var(--border); outline: none; }
.pl-spec-k { flex: 0 0 100px; }
.pl-spec-del, .pl-sp-del { width: 28px; flex: none; border-radius: var(--r-sm); border: 1px solid var(--border); background: var(--bg-hover); color: var(--text-tertiary); cursor: pointer; font-size: 11px; transition: all var(--dur-fast) ease; }
.pl-spec-del:hover, .pl-sp-del:hover { color: var(--error); border-color: var(--error); background: var(--error-soft); }
.pl-add-spec, .pl-add-sp { align-self: flex-start; padding: 6px 12px; border-radius: var(--r-sm); font-size: 12px; color: var(--brand-400); background: var(--brand-soft); border: 1px solid rgba(124, 124, 255, 0.25); cursor: pointer; transition: all var(--dur-fast) ease; margin-top: 2px; }
.pl-add-spec:hover, .pl-add-sp:hover { color: #fff; background: var(--brand-grad); border-color: transparent; }

.pl-sp-row { display: flex; gap: 6px; }
.pl-sp-input { flex: 1; padding: 6px 10px; border-radius: var(--r-sm); font-size: 12.5px; color: var(--text-primary); background: var(--bg-inset); border: 1px solid var(--border); outline: none; }
.pl-sp-input:focus { border-color: var(--brand-500); }

.pl-empty-tag { font-size: 12px; color: var(--text-tertiary); padding: 8px 0; }

/* ============================================================
   积分中心 / 充值页（recharge.js）：rc- 前缀
   ============================================================ */
/* 当前会员状态卡 */
.rc-status { margin-bottom: 24px; min-height: 60px; }
.rc-status-card {
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
  padding: 24px 28px; border-radius: var(--r-lg); overflow: hidden;
  background: linear-gradient(135deg, rgba(124, 124, 255, 0.12) 0%, rgba(168, 85, 247, 0.08) 100%), var(--bg-surface);
  border: 1px solid rgba(124, 124, 255, 0.25);
}
.rc-status-card.is-member {
  background: linear-gradient(135deg, rgba(251, 191, 36, 0.12) 0%, rgba(245, 158, 11, 0.06) 100%), var(--bg-surface);
  border-color: rgba(251, 191, 36, 0.3);
}
.rc-status-left { display: flex; align-items: center; gap: 28px; }
.rc-level-badge {
  display: flex; align-items: center; gap: 8px; font-size: 16px; font-weight: 750; color: var(--brand-400);
  padding: 8px 16px; border-radius: var(--r-full); background: var(--brand-soft); border: 1px solid rgba(124, 124, 255, 0.3);
}
.is-member .rc-level-badge { color: var(--warning); background: rgba(251, 191, 36, 0.1); border-color: rgba(251, 191, 36, 0.3); }
.rc-credits { display: flex; flex-direction: column; }
.rc-credits-num { font-size: 32px; font-weight: 800; color: var(--text-primary); line-height: 1; font-variant-numeric: tabular-nums; }
.rc-credits-lbl { font-size: 12px; color: var(--text-tertiary); margin-top: 4px; }
.rc-status-right { display: flex; flex-direction: column; gap: 8px; min-width: 200px; }
.rc-status-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: 13px; color: var(--text-secondary); }
.rc-status-row b { font-size: 14px; color: var(--text-primary); font-variant-numeric: tabular-nums; }
.rc-status-row .rc-warn { color: var(--warning); }
.rc-status-hint { font-size: 12px; color: var(--text-tertiary); line-height: 1.6; }
@media (max-width: 640px) {
  .rc-status-card { flex-direction: column; align-items: flex-start; gap: 16px; }
  .rc-status-left { flex-wrap: wrap; gap: 16px; }
}

/* 区块通用 */
.rc-section { margin-bottom: 32px; }
.rc-section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.rc-section-head h2 { display: flex; align-items: center; gap: 8px; font-size: 17px; font-weight: 750; color: var(--text-primary); }
.rc-section-head h2 svg { color: var(--brand-400); }
.rc-section-head p { font-size: 13px; color: var(--text-tertiary); margin-top: 4px; }
.rc-tabs { display: flex; gap: 6px; }

/* 套餐卡片 */
.rc-packages { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; }
.rc-pkg {
  display: flex; flex-direction: column; gap: 10px;
  padding: 20px; border-radius: var(--r-md);
  background: var(--bg-surface); border: 2px solid var(--border);
  transition: all var(--dur-base) var(--ease-out); position: relative; overflow: hidden;
}
.rc-pkg:hover { border-color: rgba(124, 124, 255, 0.5); transform: translateY(-3px); box-shadow: var(--shadow-md); }
.rc-pkg.is-current { border-color: var(--brand-500); background: linear-gradient(180deg, var(--brand-soft), var(--bg-surface) 120px); }
.rc-pkg-head { display: flex; align-items: center; justify-content: space-between; }
.rc-pkg-name { font-size: 16px; font-weight: 700; color: var(--text-primary); }
.rc-pkg-tag { font-size: 11px; font-weight: 700; padding: 2px 10px; border-radius: var(--r-full); color: #fff; background: var(--brand-grad); }
.rc-pkg-price { display: flex; align-items: baseline; gap: 4px; }
.rc-pkg-amount { font-size: 28px; font-weight: 800; color: var(--brand-400); font-variant-numeric: tabular-nums; }
.rc-pkg-duration { font-size: 13px; color: var(--text-tertiary); }
.rc-pkg-credits { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text-secondary); }
.rc-pkg-credits svg { color: var(--warning); }
.rc-pkg-desc { font-size: 12px; line-height: 1.7; color: var(--text-tertiary); }
.rc-pkg-btn { margin-top: auto; height: 40px; }

/* 积分流水 */
.rc-orders { min-height: 60px; }
.rc-order-list { display: flex; flex-direction: column; gap: 2px; }
.rc-order-row {
  display: flex; align-items: center; gap: 14px;
  padding: 12px 16px; border-radius: var(--r-sm); background: var(--bg-surface);
  border: 1px solid var(--border); transition: background var(--dur-fast) ease;
}
.rc-order-row:hover { background: var(--bg-elevated); }
.rc-order-icon {
  width: 32px; height: 32px; flex: none; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 15px; font-weight: 700;
}
.rc-order-icon.in { background: var(--success-soft); color: var(--success); }
.rc-order-icon.out { background: var(--error-soft); color: var(--error); }
.rc-order-main { flex: 1; min-width: 0; }
.rc-order-title { font-size: 14px; font-weight: 600; color: var(--text-primary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rc-order-sub { font-size: 12px; color: var(--text-tertiary); margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rc-order-amt { font-size: 16px; font-weight: 700; font-variant-numeric: tabular-nums; }
.rc-order-amt.in { color: var(--success); }
.rc-order-amt.out { color: var(--error); }
.rc-order-bal { font-size: 12px; color: var(--text-tertiary); min-width: 100px; text-align: right; font-variant-numeric: tabular-nums; }
@media (max-width: 640px) {
  .rc-order-row { flex-wrap: wrap; }
  .rc-order-bal { width: 100%; text-align: left; }
}

/* 分页 */
.rc-pager { display: flex; align-items: center; justify-content: center; gap: 8px; margin-top: 16px; flex-wrap: wrap; }
.rc-pager button { padding: 6px 14px; border-radius: var(--r-md); font-size: 13px; cursor: pointer; background: var(--bg-surface); border: 1px solid var(--border); color: var(--text-secondary); transition: all var(--dur-fast) ease; font-variant-numeric: tabular-nums; }
.rc-pager button:hover:not(:disabled) { border-color: var(--brand-500); color: var(--brand-400); }
.rc-pager button:disabled { opacity: 0.3; cursor: not-allowed; }
/* 可点击页码：等宽方块，当前页实心紫渐变（纯色底 + 白字，避免半透明叠加透色） */
.rc-pager .rc-pg { min-width: 34px; padding: 6px 8px; text-align: center; }
.rc-pager .rc-pg.is-active { background: var(--brand-grad); border-color: transparent; color: #fff; font-weight: 700; box-shadow: 0 4px 14px rgba(99, 102, 241, 0.35); }
.rc-pager .rc-pg.is-active:hover:not(:disabled) { color: #fff; }
.rc-dots { font-size: 13px; color: var(--text-tertiary); padding: 0 2px; user-select: none; }

/* 客服 */
.rc-contact {
  display: flex; align-items: center; gap: 24px; padding: 20px 24px;
  border-radius: var(--r-md); background: var(--bg-surface); border: 1px solid var(--border); margin-top: 8px;
}
.rc-contact-text h3 { font-size: 15px; font-weight: 700; color: var(--text-primary); }
.rc-contact-text p { font-size: 12.5px; color: var(--text-tertiary); margin-top: 6px; line-height: 1.6; }
.rc-qr img { width: 120px; height: 120px; object-fit: contain; border-radius: var(--r-sm); border: 1px solid var(--border); }
@media (max-width: 560px) { .rc-contact { flex-direction: column; } }

/* 通用空态/错误 */
.rc-empty { padding: 40px 20px; text-align: center; color: var(--text-tertiary); font-size: 14px; }
.rc-err { padding: 20px; text-align: center; color: var(--error); font-size: 13px; }

/* 支付结果遮罩 */
.rc-pay-mask {
  position: fixed; inset: 0; z-index: 1300;
  display: flex; align-items: center; justify-content: center;
  background: rgba(4, 6, 14, 0.82); backdrop-filter: blur(12px);
}
.rc-pay-modal {
  display: flex; flex-direction: column; align-items: center; gap: 12px;
  padding: 36px 40px; border-radius: var(--r-lg);
  background: var(--bg-elevated); border: 1px solid var(--border-strong);
  box-shadow: var(--shadow-lg); max-width: 380px; text-align: center;
}
.rc-pay-spin {
  width: 56px; height: 56px; display: flex; align-items: center; justify-content: center;
  border-radius: 50%; background: var(--brand-soft);
}
.rc-pay-spin i {
  width: 28px; height: 28px; border-radius: 50%;
  border: 3px solid rgba(124, 124, 255, 0.25); border-top-color: var(--brand-400);
  animation: plSpin .9s linear infinite; display: block;
}
.rc-pay-spin.done { background: var(--success-soft); }
.rc-pay-spin.done svg { color: var(--success); }
.rc-pay-spin.fail { background: var(--error-soft); font-size: 24px; font-weight: 700; color: var(--error); }
.rc-pay-t { font-size: 17px; font-weight: 700; color: var(--text-primary); }
.rc-pay-s { font-size: 13px; color: var(--text-secondary); line-height: 1.6; }
.rc-pay-actions { display: flex; gap: 10px; margin-top: 10px; }
.rc-pay-actions .btn { min-width: 80px; }

/* ============================================================
   个人资料中心（profile.js）：pf- 前缀
   ============================================================ */
.pf-layout { display: grid; grid-template-columns: 260px 1fr; gap: 24px; align-items: start; }
@media (max-width: 760px) { .pf-layout { grid-template-columns: 1fr; } }

/* 左列用户卡片 */
.pf-side { display: flex; flex-direction: column; gap: 12px; position: sticky; top: 20px; }
@media (max-width: 760px) { .pf-side { position: static; } }

.pf-user-card {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  padding: 28px 20px; border-radius: var(--r-md);
  background: linear-gradient(180deg, var(--brand-soft) 0%, var(--bg-surface) 140px), var(--bg-surface);
  border: 1px solid var(--border); text-align: center;
}
.pf-avatar {
  width: 64px; height: 64px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-size: 28px; font-weight: 700; color: #fff; background: var(--brand-grad);
  box-shadow: 0 4px 16px rgba(124, 124, 255, 0.35); margin-bottom: 4px;
}
.pf-user-name { font-size: 17px; font-weight: 700; color: var(--text-primary); }
.pf-user-phone { display: flex; align-items: center; gap: 5px; font-size: 13px; color: var(--text-tertiary); }
.pf-user-divider { width: 100%; height: 1px; background: var(--border); margin: 10px 0; }
.pf-user-stats { display: flex; align-items: center; justify-content: center; gap: 32px; }
.pf-stat { display: flex; flex-direction: column; align-items: center; }
.pf-stat-v { font-size: 16px; font-weight: 700; color: var(--text-primary); }
.pf-stat-l { font-size: 11px; color: var(--text-tertiary); margin-top: 2px; }
.pf-user-expire { font-size: 12px; color: var(--warning); margin-top: 6px; }
.pf-user-joined { font-size: 11.5px; color: var(--text-tertiary); margin-top: 2px; }

.pf-logout { width: 100%; height: 42px; color: var(--error); border-color: rgba(248, 113, 113, 0.25); }
.pf-logout:hover { background: var(--error-soft); border-color: var(--error); }
/* 推广中心入口（邀请好友） */
.pf-share { width: 100%; height: 42px; color: var(--brand-400); border-color: rgba(124, 108, 255, 0.3); margin-bottom: 10px; }
.pf-share:hover { background: rgba(124, 108, 255, 0.12); border-color: var(--brand-400); }

/* 右列主体 */
.pf-main { display: flex; flex-direction: column; gap: 24px; }
.pf-section {
  border-radius: var(--r-md); background: var(--bg-surface); border: 1px solid var(--border); overflow: hidden;
}
.pf-section-head { padding: 16px 20px; border-bottom: 1px solid var(--border); }
.pf-section-head h2 { display: flex; align-items: center; gap: 8px; font-size: 15px; font-weight: 700; color: var(--text-primary); }
.pf-section-head h2 svg { color: var(--brand-400); }

/* 表单 */
.pf-form, .pf-pwd-form { padding: 20px; display: flex; flex-direction: column; gap: 16px; }
.pf-form-row { display: flex; flex-direction: column; gap: 6px; }
.pf-lbl { display: flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 700; letter-spacing: 0.5px; color: var(--text-tertiary); }
.pf-lbl svg { color: var(--text-tertiary); }
.pf-form-row input, .pf-pwd-form input {
  width: 100%; padding: 10px 14px; border-radius: var(--r-sm); font-size: 14px; color: var(--text-primary);
  background: var(--bg-inset); border: 1px solid var(--border); outline: none; transition: border-color var(--dur-fast) ease;
  font-family: inherit;
}
.pf-form-row input:focus, .pf-pwd-form input:focus { border-color: var(--brand-500); }
.pf-form-row input:disabled { opacity: 0.6; cursor: not-allowed; }
.pf-form-row input::placeholder, .pf-pwd-form input::placeholder { color: var(--text-tertiary); }

.pf-gender { display: flex; gap: 8px; }

.pf-form-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 4px; }
.pf-form-actions .btn { min-width: 100px; }

/* 改密提示 */
.pf-pwd-hint { font-size: 12.5px; min-height: 18px; color: var(--text-tertiary); }
.pf-pwd-hint.warn { color: var(--warning); }

/* 登录记录 */
.pf-logs { padding: 8px 12px; }
.pf-log-list { display: flex; flex-direction: column; gap: 2px; }
.pf-log-row {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: var(--r-sm);
  transition: background var(--dur-fast) ease;
}
.pf-log-row:hover { background: var(--bg-hover); }
.pf-log-idx { min-width: 36px; }
.pf-log-tag { font-size: 10px; font-weight: 700; padding: 2px 8px; border-radius: var(--r-full); color: #fff; background: var(--success); }
.pf-log-main { flex: 1; display: flex; align-items: center; justify-content: space-between; }
.pf-log-client { font-size: 13.5px; font-weight: 600; color: var(--text-primary); }
.pf-log-time { font-size: 12px; color: var(--text-tertiary); font-variant-numeric: tabular-nums; }

.pf-empty { padding: 40px 20px; text-align: center; color: var(--text-tertiary); font-size: 14px; }
.pf-err { padding: 20px; text-align: center; color: var(--error); font-size: 13px; }

/* 登录记录分页 */
.pf-pager { display: flex; align-items: center; justify-content: center; gap: 14px; padding: 12px; border-top: 1px solid var(--border); }
.pf-pager button { padding: 6px 14px; border-radius: var(--r-md); font-size: 13px; cursor: pointer; background: var(--bg-inset); border: 1px solid var(--border); color: var(--text-secondary); transition: all var(--dur-fast) ease; }
.pf-pager button:hover:not(:disabled) { border-color: var(--brand-500); color: var(--brand-400); }
.pf-pager button:disabled { opacity: 0.3; cursor: not-allowed; }
#pfPageInd { font-size: 13px; font-weight: 700; color: var(--text-secondary); min-width: 56px; text-align: center; }

/* ============================================================
   我的作品库（works.js）：wk- 前缀
   ============================================================ */
/* 一级分组条：视频作品 / 图片作品 / 3D 模型。清单与条数由 /api/works/tabs 下发，
   这里只给三种状态（默认 / 悬停 / 选中），不在页面里写死分组 */
.wk-groups { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.wk-gtab {
  display: inline-flex; align-items: center; gap: 8px;
  height: 38px; padding: 0 16px;
  font-size: 13.5px; font-weight: 600; color: var(--text-secondary);
  background: var(--bg-surface); border: 1px solid var(--border); border-radius: var(--r-md);
  cursor: pointer; white-space: nowrap; transition: all var(--dur-fast) var(--ease-out);
}
.wk-gtab:hover { color: var(--text-primary); border-color: var(--border-strong); transform: translateY(-1px); }
.wk-gtab.is-active { color: var(--brand-400); background: var(--brand-soft); border-color: var(--brand-500); }
.wk-gtab svg { color: currentColor; }
/* 条数角标：非衬线等宽数字，避免各组数字宽度不同导致整条左右抖动 */
.wk-gtab em {
  font-style: normal; font-size: 12px; color: var(--text-tertiary);
  font-variant-numeric: tabular-nums;
}
.wk-gtab.is-active em { color: var(--brand-400); }

/* 二级业务条：组内按业务筛（该组只有一条业务时 JS 不渲染，:empty 兜底不留空白间距） */
.wk-bizs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.wk-bizs:empty { display: none; }
.wk-bchip em {
  font-style: normal; font-size: 11.5px; color: var(--text-tertiary);
  font-variant-numeric: tabular-nums;
}
.wk-bchip.is-active em { color: inherit; }

/* 搜索栏 */
.wk-search {
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
  margin-bottom: 16px; padding: 14px 18px;
  background: var(--bg-surface); border: 1px solid var(--border);
  border-radius: var(--r-md);
}
.wk-search-input {
  display: flex; align-items: center; gap: 10px; flex: 1; min-width: 240px;
  padding: 8px 14px; border-radius: var(--r-full);
  background: var(--bg-inset); border: 1px solid var(--border);
  transition: border-color var(--dur-fast) ease;
}
.wk-search-input:focus-within { border-color: var(--border-focus); }
.wk-search-input svg { width: 16px; height: 16px; color: var(--text-tertiary); flex: none; }
.wk-search-input input {
  flex: 1; min-width: 0; border: none; outline: none; background: transparent;
  font-size: 13.5px; color: var(--text-primary);
}
.wk-search-input input::placeholder { color: var(--text-tertiary); }
.wk-filter-chips { display: flex; gap: 8px; flex-wrap: wrap; }
#wkRefresh.is-spinning svg { animation: plSpin .8s linear infinite; }
.wk-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 16px; }
/* 视频成片/爆款复刻 Tab：真瀑布流（JS 按封面比例逐张放入最短列，列数随容器宽度；
   封面比例由卡片内联 aspect-ratio 锁定，加载前后高度稳定，无同行对齐空隙） */
.wk-grid.is-masonry { display: flex; gap: 16px; align-items: flex-start; }
.wk-grid.is-masonry .wk-mcol { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; gap: 16px; }
.wk-grid.is-masonry .wk-card { margin-bottom: 0; }
.wk-card {
  border-radius: var(--r-md); overflow: hidden; cursor: pointer;
  background: var(--bg-surface); border: 1px solid var(--border);
  transition: all var(--dur-fast) var(--ease-out);
}
.wk-card:hover { border-color: rgba(124, 124, 255, 0.5); transform: translateY(-3px); box-shadow: var(--shadow-md); }
.wk-cover { position: relative; aspect-ratio: 16 / 10; background: var(--bg-inset); overflow: hidden; }
.wk-cover img, .wk-cover video { width: 100%; height: 100%; object-fit: cover; display: block; }
.wk-cover video { background: #000; }
.wk-cover.is-empty .wk-cover-ph { display: flex; }
.wk-cover-ph {
  position: absolute; inset: 0; display: none; align-items: center; justify-content: center;
  color: var(--text-tertiary); opacity: 0.35;
}
.wk-cover.is-empty img, .wk-cover.is-empty video { display: none; }
.wk-featured-poster { position: absolute; inset: 0; }
.wk-badge {
  position: absolute; top: 10px; left: 10px; font-size: 11px; font-weight: 700; padding: 3px 10px;
  border-radius: var(--r-full); backdrop-filter: blur(6px); background: rgba(8, 10, 18, 0.6); color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.15); z-index: 2;
}
.wk-badge.badge-success { background: rgba(52, 211, 153, 0.85); border-color: rgba(52, 211, 153, 0.5); }
.wk-badge.badge-warning { background: rgba(251, 191, 36, 0.88); border-color: rgba(251, 191, 36, 0.5); color: #1a1a2e; }
.wk-badge.badge-error { background: rgba(248, 113, 113, 0.88); border-color: rgba(248, 113, 113, 0.5); }
.wk-badge.badge-info { background: rgba(124, 124, 255, 0.88); border-color: rgba(124, 124, 255, 0.5); }
.wk-play {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  background: rgba(8, 10, 18, 0.28); color: #fff; opacity: 0; transition: opacity var(--dur-base) ease;
}
.wk-card:hover .wk-play { opacity: 1; }
.wk-play svg { filter: drop-shadow(0 2px 8px rgba(0,0,0,0.5)); }
/* 下载按钮：封面右下角，悬停浮现 */
.wk-down, .wk-down3d {
  position: absolute; right: 10px; bottom: 10px; z-index: 3;
  width: 32px; height: 32px; border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(8, 10, 18, 0.55); color: #fff;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  opacity: 0; transform: translateY(4px);
  transition: opacity var(--dur-base) ease, transform var(--dur-base) ease, background var(--dur-fast) ease;
  backdrop-filter: blur(6px);
}
.wk-card:hover .wk-down, .wk-card:hover .wk-down3d { opacity: 1; transform: translateY(0); }
.wk-down:hover, .wk-down3d:hover { background: var(--brand-500); border-color: var(--brand-400); }

/* AI 视频创作历史卡（hr-wf-card）：封面右上角悬浮下载钮（与 .wk-down 同视觉） */
.wf-dl {
  position: absolute; top: 10px; right: 10px; z-index: 3;
  width: 30px; height: 30px; border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(8, 10, 18, 0.55); color: #fff;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  opacity: 0; transform: translateY(4px);
  transition: opacity var(--dur-base) ease, transform var(--dur-base) ease, background var(--dur-fast) ease;
  backdrop-filter: blur(6px);
}
.wf-dl svg { width: 14px; height: 14px; }
.hr-wf-card:hover .wf-dl { opacity: 1; transform: translateY(0); }
.wf-dl:hover { background: var(--brand-500); border-color: var(--brand-400); }

/* 进行中 hero 完成播放区：内联「下载文件」按钮 */
.hr-hero-dl {
  display: inline-flex; align-items: center; gap: 5px; margin-left: 10px;
  padding: 5px 14px; border-radius: var(--r-full);
  border: 1px solid var(--brand-400); background: var(--brand-500); color: #fff;
  font-size: 12px; font-weight: 600; cursor: pointer; vertical-align: middle;
  transition: filter var(--dur-fast) ease, transform var(--dur-fast) ease;
}
.hr-hero-dl svg { width: 13px; height: 13px; }
.hr-hero-dl:hover { filter: brightness(1.1); transform: translateY(-1px); }
.wk-down svg, .wk-down3d svg { filter: drop-shadow(0 2px 4px rgba(0,0,0,0.5)); }
/* 删除按钮：封面右上角（避开右下下载/左下错误信息），悬停浮现，hover 变红警示 */
.wk-trash {
  position: absolute; right: 10px; top: 10px; z-index: 3;
  width: 30px; height: 30px; border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(8, 10, 18, 0.55); color: #fff;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  opacity: 0; transform: translateY(-4px);
  transition: opacity var(--dur-base) ease, transform var(--dur-base) ease, background var(--dur-fast) ease;
  backdrop-filter: blur(6px);
}
.wk-card:hover .wk-trash { opacity: 1; transform: translateY(0); }
.wk-trash:hover { background: var(--error); border-color: var(--error); }
.wk-trash:disabled { opacity: 0.5; cursor: not-allowed; }
.wk-trash svg { filter: drop-shadow(0 2px 4px rgba(0,0,0,0.5)); }
.wk-spin { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; background: rgba(8, 10, 18, 0.35); }
.wk-spin i { width: 26px; height: 26px; border-radius: 50%; border: 3px solid rgba(124, 124, 255, 0.25); border-top-color: var(--brand-400); animation: plSpin .9s linear infinite; display: block; }
.wk-cover-err {
  position: absolute; left: 10px; right: 10px; bottom: 10px; font-size: 11px; line-height: 1.5;
  color: var(--error); padding: 6px 10px; border-radius: var(--r-sm);
  background: rgba(248, 113, 113, 0.14); border: 1px solid rgba(248, 113, 113, 0.3);
  overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
}
.wk-body { padding: 10px 12px; }
.wk-name { font-size: 13.5px; font-weight: 650; color: var(--text-primary); }
.wk-meta { font-size: 12px; color: var(--text-tertiary); margin-top: 3px; }
.wk-foot { display: flex; align-items: center; justify-content: space-between; margin-top: 8px; }
.wk-credits { font-size: 12px; font-weight: 650; color: var(--brand-400); }
.wk-time { font-size: 11px; color: var(--text-tertiary); }

.wk-state { padding: 60px 20px; text-align: center; color: var(--text-tertiary); font-size: 14px; }
.wk-empty { text-align: center; padding: 50px 20px; }
.wk-empty-ico { color: var(--text-tertiary); opacity: 0.35; margin-bottom: 12px; }
.wk-empty > div { font-size: 15px; font-weight: 600; color: var(--text-secondary); }
.wk-empty p { font-size: 12.5px; color: var(--text-tertiary); margin-top: 8px; }
.wk-err { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.wk-err svg { color: var(--error); }

.wk-pager { display: flex; align-items: center; justify-content: center; gap: 14px; margin-top: 24px; }
.wk-pager button { padding: 6px 16px; border-radius: var(--r-md); font-size: 13px; cursor: pointer; background: var(--bg-surface); border: 1px solid var(--border); color: var(--text-secondary); transition: all var(--dur-fast) ease; }
.wk-pager button:hover:not(:disabled) { border-color: var(--brand-500); color: var(--brand-400); }
.wk-pager button:disabled { opacity: 0.3; cursor: not-allowed; }
#wkPageInd { font-size: 13px; font-weight: 700; color: var(--text-secondary); min-width: 56px; text-align: center; }

/* 预览弹窗 */
.wk-mask {
  position: fixed; inset: 0; z-index: var(--z-modal);
  background: rgba(4, 6, 14, 0.82); backdrop-filter: blur(10px);
  display: none; align-items: center; justify-content: center; padding: 24px;
}
.wk-mask.is-open { display: flex; animation: ibFade .25s ease; }
.wk-modal {
  width: min(820px, 94vw); max-height: 88vh; display: flex; flex-direction: column;
  border-radius: var(--r-lg); overflow: hidden;
  background: var(--bg-elevated); border: 1px solid var(--border-strong); box-shadow: var(--shadow-lg);
  animation: inspPop .34s var(--ease-spring);
}
.wk-modal .modal-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 20px; border-bottom: 1px solid var(--border); }
.wk-modal .modal-head h3 { font-size: 15px; font-weight: 700; color: var(--text-primary); }
.wk-modal .modal-close { width: 30px; height: 30px; border-radius: 50%; border: none; cursor: pointer; background: var(--bg-hover); color: var(--text-secondary); font-size: 14px; }
.wk-modal .modal-close:hover { background: var(--bg-active); color: var(--text-primary); }
.wk-modal-body { flex: 1; overflow-y: auto; padding: 16px 20px; }
/* 底部按钮：窄屏放不下三个时必须换行。不换行的话 justify-content:flex-end 会把超出的部分
   顶到弹窗左边界外面（420 视口下 3D 预览的「打开 3D 演示」实测越界 17px） */
.wk-modal .modal-foot { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 10px; padding: 12px 20px; border-top: 1px solid var(--border); }
.wk-player { background: #000; border-radius: var(--r-md); overflow: hidden; }
.wk-player video { width: 100%; max-height: 60vh; display: block; }
.wk-modal-meta { display: flex; flex-wrap: wrap; gap: 8px 18px; margin-top: 14px; font-size: 12.5px; color: var(--text-tertiary); }
.wk-modal-empty { padding: 60px 20px; text-align: center; color: var(--text-tertiary); font-size: 14px; }

/* ============================================================
   消息中心弹窗（messages.js）：msg- 前缀
   ============================================================ */
.msg-mask {
  position: fixed; inset: 0; z-index: 1300;
  background: rgba(4, 6, 14, 0.78); backdrop-filter: blur(10px);
  display: none; align-items: center; justify-content: center; padding: 24px;
}
.msg-mask.is-open { display: flex; animation: ibFade .25s ease; }
.msg-modal {
  width: min(560px, 94vw); height: min(700px, 88vh); display: flex; flex-direction: column;
  border-radius: var(--r-lg); overflow: hidden;
  background: var(--bg-elevated); border: 1px solid var(--border-strong); box-shadow: var(--shadow-lg);
  animation: inspPop .34s var(--ease-spring);
}
.msg-modal .modal-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.msg-modal .modal-head h3 { font-size: 16px; font-weight: 700; color: var(--text-primary); }
.msg-head-actions { display: flex; align-items: center; gap: 10px; }
.msg-read-all {
  border: none; background: none; cursor: pointer; font-size: 12.5px; color: var(--brand-400);
  padding: 4px 8px; border-radius: var(--r-sm); transition: background var(--dur-fast) ease;
}
.msg-read-all:hover { background: var(--brand-soft); }
.msg-modal .modal-close { width: 30px; height: 30px; border-radius: 50%; border: none; cursor: pointer; background: var(--bg-hover); color: var(--text-secondary); font-size: 14px; }
.msg-modal .modal-close:hover { background: var(--bg-active); color: var(--text-primary); }
.msg-modal .modal-body { flex: 1; overflow-y: auto; position: relative; }

.msg-list { display: flex; flex-direction: column; }
.msg-item {
  display: flex; align-items: flex-start; gap: 12px; width: 100%; text-align: left;
  padding: 14px 20px; border: none; border-bottom: 1px solid var(--border);
  background: transparent; cursor: pointer; transition: background var(--dur-fast) ease; position: relative;
}
.msg-item:hover { background: var(--bg-hover); }
.msg-item.is-unread { background: rgba(124, 124, 255, 0.06); }
.msg-item.is-unread:hover { background: rgba(124, 124, 255, 0.1); }
.msg-cat {
  flex: none; font-size: 11px; font-weight: 700; padding: 3px 9px; border-radius: var(--r-full);
  margin-top: 2px; color: var(--text-secondary); background: var(--bg-active); border: 1px solid var(--border);
}
.msg-cat-ann { color: var(--warning); background: var(--warning-soft); border-color: rgba(251, 191, 36, 0.3); }
.msg-cat-upd { color: var(--brand-400); background: var(--brand-soft); border-color: rgba(124, 124, 255, 0.3); }
.msg-cat-tip { color: var(--success); background: var(--success-soft); border-color: rgba(52, 211, 153, 0.3); }
.msg-item-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.msg-item-title { font-size: 14px; font-weight: 650; color: var(--text-primary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.msg-item.is-unread .msg-item-title { color: var(--text-primary); }
.msg-item-summary { font-size: 12.5px; color: var(--text-tertiary); line-height: 1.6; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.msg-item-time { flex: none; font-size: 11.5px; color: var(--text-tertiary); font-variant-numeric: tabular-nums; margin-top: 2px; }
.msg-dot {
  position: absolute; top: 18px; right: 16px; width: 8px; height: 8px; border-radius: 50%;
  background: var(--brand-500); box-shadow: 0 0 8px rgba(124, 124, 255, 0.6);
}
.msg-empty, .msg-loading { padding: 60px 20px; text-align: center; color: var(--text-tertiary); font-size: 14px; }

/* 详情视图 */
.msg-back {
  border: none; background: none; cursor: pointer; font-size: 13px; color: var(--brand-400);
  padding: 12px 20px 0; display: block;
}
.msg-back:hover { text-decoration: underline; }
.msg-detail { padding: 12px 24px 28px; }
.msg-detail-cat {
  display: inline-block; font-size: 11px; font-weight: 700; padding: 3px 10px; border-radius: var(--r-full);
  color: var(--text-secondary); background: var(--bg-active); border: 1px solid var(--border); margin-bottom: 12px;
}
.msg-detail-title { font-size: 19px; font-weight: 750; color: var(--text-primary); line-height: 1.4; }
.msg-detail-time { font-size: 12.5px; color: var(--text-tertiary); margin-top: 8px; padding-bottom: 16px; border-bottom: 1px solid var(--border); }
.msg-detail-content { margin-top: 18px; font-size: 14px; line-height: 1.9; color: var(--text-secondary); overflow-x: auto; }
.msg-detail-content img { max-width: 100%; border-radius: var(--r-sm); margin: 10px 0; }
.msg-detail-content p { margin: 10px 0; }
.msg-detail-content h1, .msg-detail-content h2, .msg-detail-content h3 { color: var(--text-primary); margin: 18px 0 8px; }
.msg-detail-content a { color: var(--brand-400); }

/* ============================================================
   设置浮动层（顶栏齿轮下方 popover，settings.js）
   ============================================================ */
.st-pop { top: calc(100% + 8px); right: 0; width: 360px; padding: 0; }
/* 客服浮动层：锚定头部客服按钮下方，二维码固定取 config.kefuQrCode（与设置弹层同体系） */

/* 分享 · 提现 tab 客服区块 */
.sh-cs-block {
  display: flex; gap: 24px; align-items: flex-start;
  padding: 20px 22px; margin-bottom: 18px;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(91,141,255,.06), rgba(124,108,255,.06));
  border: 1px solid rgba(124,108,255,.2);
}
.sh-cs-left { flex-shrink: 0; }
.sh-cs-qr {
  width: 140px; height: 140px; object-fit: contain;
  border-radius: 10px; background: #fff;
  border: 1px solid var(--border);
  padding: 4px;
}
.sh-cs-right h4 {
  font-size: 15px; font-weight: 700; color: var(--text-primary);
  margin-bottom: 4px;
}
.sh-cs-right p {
  font-size: 12.5px; color: var(--text-secondary);
  margin-bottom: 8px; line-height: 1.6;
}
.sh-cs-right ul {
  margin: 0; padding-left: 16px;
  font-size: 12px; color: var(--text-tertiary); line-height: 1.8;
}
.sh-cs-right ul li::marker { color: #7C6CFF; }
@media (max-width: 560px) { .sh-cs-block { flex-direction: column; align-items: center; text-align: center; } .sh-cs-right ul { text-align: left; } }
.kefu-pop { top: calc(100% + 8px); right: 0; width: 240px; padding: 20px 20px 16px; text-align: center; }
.kefu-title { font-size: 14px; font-weight: 700; color: var(--text-primary); }
.kefu-qr {
  width: 180px; height: 180px; margin: 14px auto 0;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg-inset); border: 1px solid var(--border); border-radius: var(--r-sm); overflow: hidden;
}
.kefu-qr img { width: 100%; height: 100%; object-fit: contain; }
.kefu-qr .spinner { width: 22px; height: 22px; }
.kefu-empty { font-size: 12.5px; color: var(--text-tertiary); padding: 0 12px; line-height: 1.6; }
.kefu-tip { margin-top: 12px; font-size: 12px; color: var(--text-tertiary); letter-spacing: .02em; }
.st-body { max-height: min(640px, calc(100vh - 120px)); overflow-y: auto; padding: 18px; }
.st-loading { padding: 40px 0; text-align: center; color: var(--text-tertiary); font-size: 13px; display: flex; flex-direction: column; align-items: center; gap: 12px; }

/* 用户头卡：头像 + 昵称 + 等级徽章 + ID 复制 */
.st-user { display: flex; align-items: center; gap: 14px; padding-bottom: 14px; border-bottom: 1px solid var(--border); }
.st-avatar {
  width: 44px; height: 44px; flex: none; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; font-weight: 700; color: #fff;
  background: var(--brand-grad); box-shadow: 0 4px 16px var(--brand-glow, rgba(124, 92, 255, 0.35));
}
.st-user-main { min-width: 0; }
.st-user-name { display: flex; align-items: center; gap: 8px; font-size: 15px; font-weight: 700; color: var(--text-primary); }
.st-lvl {
  flex: none; padding: 2px 8px; font-size: 11px; font-weight: 650; border-radius: var(--r-full);
  color: var(--text-tertiary); background: var(--bg-active);
}
.st-lvl.is-member { color: #fff; background: var(--brand-grad); }
.st-uid {
  display: inline-flex; align-items: center; gap: 5px; margin-top: 5px;
  border: none; background: none; cursor: pointer; padding: 0;
  font-size: 12px; color: var(--text-tertiary); font-family: inherit;
}
.st-uid:hover { color: var(--brand-400); }
.st-uid svg { width: 12px; height: 12px; }

/* 信息行 */
.st-rows { display: flex; flex-direction: column; padding: 6px 0 14px; border-bottom: 1px solid var(--border); }
.st-row { display: flex; align-items: center; gap: 12px; padding: 11px 0; }
.st-row + .st-row { border-top: 1px solid var(--border); }
.st-lbl { flex: none; width: 76px; font-size: 13px; color: var(--text-tertiary); }
.st-val { flex: 1; min-width: 0; font-size: 13.5px; color: var(--text-primary); text-align: right; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.st-coin { color: var(--warn, #f5a623); font-size: 15px; }
.st-num { color: var(--brand-400); }
.st-act {
  flex: none; padding: 4px 12px; font-size: 12px; font-weight: 600; font-family: inherit;
  color: var(--brand-400); background: var(--brand-soft);
  border: 1px solid transparent; border-radius: var(--r-full); cursor: pointer;
  transition: all var(--dur-fast) ease;
}
.st-act:hover { background: var(--brand-grad); color: #fff; }

/* 快捷入口宫格 */
.st-sec-title { margin: 16px 0 10px; font-size: 13px; font-weight: 650; color: var(--text-secondary); }
.st-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.st-cell {
  display: flex; flex-direction: column; align-items: flex-start; gap: 3px;
  padding: 13px 14px; text-align: left; font-family: inherit;
  background: var(--bg-hover); border: 1px solid var(--border); border-radius: var(--r-md);
  cursor: pointer; transition: all var(--dur-fast) ease;
}
.st-cell:hover { border-color: var(--brand-400); background: var(--brand-soft); }
.st-cell svg { width: 18px; height: 18px; color: var(--brand-400); margin-bottom: 4px; }
.st-cell span { font-size: 13.5px; font-weight: 650; color: var(--text-primary); }
.st-cell i { font-style: normal; font-size: 11.5px; color: var(--text-tertiary); }
.st-cell.is-danger svg { color: var(--danger, #ff5c7a); }
.st-cell.is-danger:hover { border-color: var(--danger, #ff5c7a); background: rgba(255, 92, 122, 0.08); }
.st-cell.is-danger span { color: var(--danger, #ff5c7a); }

/* ============================================================
   share.js — 邀请好友 / 推广中心 专用样式
   ============================================================ */
/* 两栏栅格：左业务介绍 + 右申请表单 */
.sh-grid { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr); gap: 20px; align-items: start; }
@media (max-width: 900px) { .sh-grid { grid-template-columns: 1fr; } }

/* 通用卡片（与项目其它页面卡风格一致） */
.sh-card {
  background: var(--bg-surface); border: 1px solid var(--border);
  border-radius: 14px; padding: 20px 22px;
}
.sh-card h2 { font-size: 16px; font-weight: 700; color: var(--text-primary); margin-bottom: 8px; display: flex; align-items: center; gap: 8px; }
.sh-card h3 { font-size: 14px; font-weight: 700; color: var(--text-primary); margin-bottom: 12px; }
.sh-hint { font-size: 12px; color: var(--text-tertiary); line-height: 1.7; margin-bottom: 14px; }

/* ── 业务介绍卡 ── */
.sh-intro { display: flex; flex-direction: column; gap: 16px; }
.sh-intro-hero {
  padding: 22px 24px; border-radius: 16px;
  background:
    radial-gradient(80% 100% at 0% 0%, rgba(124, 108, 255, .22), transparent 65%),
    radial-gradient(60% 100% at 100% 100%, rgba(55, 196, 171, .12), transparent 60%),
    var(--bg-surface);
  border: 1px solid rgba(124, 108, 255, .35);
}
.sh-hero-tag {
  display: inline-block; font-size: 11px; font-weight: 700; padding: 3px 10px; border-radius: 999px;
  color: #A99BFF; background: rgba(124, 108, 255, .15); margin-bottom: 10px; letter-spacing: .5px;
}
.sh-hero-title {
  font-size: 22px; font-weight: 800;
  background: linear-gradient(120deg, #FFF 20%, #A99BFF 60%, #7C6CFF);
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.sh-hero-sub { font-size: 12.5px; color: var(--text-tertiary); margin-top: 6px; }
.sh-benefits { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
@media (max-width: 720px) { .sh-benefits { grid-template-columns: 1fr; } }
.sh-benefit {
  padding: 14px 16px; border-radius: 12px;
  background: var(--bg-surface); border: 1px solid var(--border);
  transition: all .15s ease;
}
.sh-benefit:hover { border-color: rgba(124, 108, 255, .45); transform: translateY(-1px); }
.sh-ben-ico { font-size: 20px; margin-bottom: 6px; }
.sh-ben-k { font-size: 13px; font-weight: 700; color: var(--text-primary); margin-bottom: 3px; }
.sh-ben-v { font-size: 11.5px; color: var(--text-tertiary); line-height: 1.6; }
.sh-steps {
  display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-radius: 12px;
  background: var(--bg-surface); border: 1px solid var(--border);
}
.sh-step { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--text-secondary); font-weight: 600; white-space: nowrap; }
.sh-step-num {
  width: 22px; height: 22px; border-radius: 50%;
  background: linear-gradient(135deg, #7C6CFF, #5B8DFF);
  color: #fff; font-size: 11px; font-weight: 800;
  display: flex; align-items: center; justify-content: center; flex: none;
}
.sh-step-line {
  flex: 1; height: 2px; background: linear-gradient(90deg, rgba(124, 108, 255, .5), rgba(124, 108, 255, .12));
  min-width: 16px;
}
.sh-rate-info {
  display: flex; align-items: center; gap: 8px; padding: 12px 16px; border-radius: 12px;
  background: rgba(224, 184, 77, .08); border: 1px solid rgba(224, 184, 77, .3);
  font-size: 12px; color: var(--text-secondary);
}
.sh-rate-info b { font-size: 16px; font-weight: 800; color: #E0B84D; }

/* ── 申请表单 ── */
.sh-apply .sh-form { display: flex; flex-direction: column; gap: 4px; }
.sh-apply label {
  font-size: 12px; font-weight: 600; color: var(--text-secondary);
  margin-top: 14px; margin-bottom: 6px; display: block;
}
.sh-apply label:first-of-type { margin-top: 0; }
.sh-apply input[type=text],
.sh-apply textarea {
  width: 100%; padding: 10px 14px; font-size: 13px; font-family: inherit;
  color: var(--text-primary); background: var(--bg-inset);
  border: 1px solid var(--border); border-radius: 10px; transition: all .15s ease;
}
.sh-apply input[type=text]:focus,
.sh-apply textarea:focus {
  outline: none; border-color: rgba(124, 108, 255, .6);
  box-shadow: 0 0 0 3px rgba(124, 108, 255, .15);
}
.sh-apply textarea { resize: vertical; min-height: 70px; }
.sh-apply .sh-req { color: #F87171; }
.sh-form-actions { margin-top: 18px; }

/* ── 状态卡（pending/rejected/revoked 共用） ── */
.sh-status-card {
  padding: 40px 30px; border-radius: 16px; text-align: center;
  background: var(--bg-surface); border: 1px solid var(--border);
}
.sh-status-ico { font-size: 54px; margin-bottom: 14px; }
.sh-status-title { font-size: 20px; font-weight: 700; color: var(--text-primary); margin-bottom: 8px; }
.sh-status-sub { font-size: 13px; color: var(--text-tertiary); margin-bottom: 24px; }
.sh-status-card.sh-pending { border-color: rgba(224, 163, 74, .3); background: linear-gradient(180deg, rgba(224, 163, 74, .06), var(--bg-surface)); }
.sh-status-card.sh-rejected { border-color: rgba(248, 113, 113, .3); background: linear-gradient(180deg, rgba(248, 113, 113, .06), var(--bg-surface)); }
.sh-status-card.sh-revoked  { border-color: rgba(156, 163, 175, .3); background: linear-gradient(180deg, rgba(156, 163, 175, .06), var(--bg-surface)); }
.sh-app-detail {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px 16px;
  padding: 16px 20px; margin: 0 auto 24px; max-width: 480px;
  background: var(--bg-inset); border-radius: 12px; border: 1px solid var(--border);
}
.sh-detail-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; font-size: 12px; }
.sh-detail-row span { color: var(--text-tertiary); flex: none; }
.sh-detail-row b { color: var(--text-primary); font-weight: 600; text-align: right; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sh-reject-reason {
  max-width: 480px; margin: 0 auto 16px; padding: 14px 18px;
  background: rgba(248, 113, 113, .08); border: 1px solid rgba(248, 113, 113, .3);
  border-radius: 12px; text-align: left;
}
.sh-reject-label {
  display: flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; color: #F87171;
  margin-bottom: 6px;
}
.sh-reject-text { font-size: 13px; color: var(--text-secondary); line-height: 1.6; white-space: pre-wrap; word-break: break-word; }

/* ── 推广中心：顶部指标卡 ── */
.sh-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 20px; }
@media (max-width: 900px) { .sh-stats { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 480px) { .sh-stats { grid-template-columns: 1fr; } }
.sh-stat-card {
  display: flex; align-items: center; gap: 14px; padding: 16px 18px;
  background: var(--bg-surface); border: 1px solid var(--border); border-radius: 14px;
  transition: all .15s ease;
}
.sh-stat-card:hover { border-color: var(--border-strong); }
.sh-stat-ico {
  width: 44px; height: 44px; border-radius: 12px; flex: none;
  display: flex; align-items: center; justify-content: center; color: #fff;
}
.sh-stat-ico svg { width: 22px; height: 22px; }
.sh-stat-info { flex: 1; min-width: 0; }
.sh-stat-v { font-size: 18px; font-weight: 800; color: var(--text-primary); font-variant-numeric: tabular-nums; }
.sh-stat-l { font-size: 11.5px; color: var(--text-tertiary); margin-top: 2px; }
.sh-copy-btn { flex: none; }

/* ── Tab 切换 ── */
.sh-tabs {
  display: flex; gap: 2px; padding: 4px; margin-bottom: 16px;
  background: var(--bg-surface); border: 1px solid var(--border); border-radius: 12px;
}
.sh-tab {
  flex: 1; height: 38px; border: none; background: transparent; border-radius: 9px;
  font-size: 13px; font-weight: 600; color: var(--text-tertiary); font-family: inherit;
  cursor: pointer; transition: all .15s ease;
}
.sh-tab:hover { color: var(--text-primary); }
.sh-tab.is-active {
  color: var(--text-primary); background: var(--bg-elevated);
  box-shadow: 0 1px 0 rgba(255,255,255,.04), inset 0 0 0 1px var(--border);
}

/* ── Tab 内容：邀请码/链接/比例 三卡 ── */
.sh-tab-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
@media (max-width: 900px) { .sh-tab-grid { grid-template-columns: 1fr; } }

.sh-code-box {
  font-size: 28px; font-weight: 800; letter-spacing: 4px; color: var(--brand-300);
  padding: 16px 20px; border-radius: 12px; text-align: center;
  background: rgba(124, 108, 255, .08); border: 1px solid rgba(124, 108, 255, .35);
  margin-bottom: 10px; font-family: 'Consolas', 'Menlo', monospace;
}
.sh-url-box {
  font-size: 12px; color: var(--text-secondary); padding: 12px 14px; border-radius: 10px;
  background: var(--bg-inset); border: 1px solid var(--border); margin-bottom: 10px;
  word-break: break-all; line-height: 1.6;
}
.sh-rate-box { text-align: center; padding: 14px; }
.sh-rate-main { font-size: 40px; font-weight: 800; color: #E0B84D; line-height: 1; }
.sh-rate-main span { font-size: 18px; }
.sh-rate-tag {
  display: inline-block; margin-top: 8px; padding: 2px 10px; font-size: 11px; font-weight: 700;
  border-radius: 999px; background: rgba(124, 108, 255, .15); color: #A99BFF;
}
.sh-rate-tag.sh-default { background: rgba(156, 163, 175, .15); color: var(--text-tertiary); }

/* 短码链接：等宽 + 高亮域名色 */
.sh-url-box.sh-short {
  font-family: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
  font-size: 13px; font-weight: 600;
  background: linear-gradient(135deg, rgba(124,108,255,.08), rgba(91,141,255,.08));
  border-color: rgba(124,108,255,.25);
  color: #7C6CFF;
  letter-spacing: .3px;
}

/* 推广文案预览框 */
.sh-copy-box {
  font-size: 12.5px; line-height: 1.75; color: var(--text-secondary);
  padding: 16px 18px; border-radius: 12px;
  background: linear-gradient(135deg, rgba(224,184,77,.06), rgba(124,108,255,.06));
  border: 1px solid rgba(224,184,77,.2);
  white-space: pre-wrap; word-break: break-word;
}

/* 文案风格切换 tabs */
.sh-copy-tabs {
  display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px;
}
.sh-copy-tab {
  font-size: 12px; font-weight: 500; padding: 6px 14px;
  border-radius: 999px; cursor: pointer; border: 1px solid var(--border);
  background: transparent; color: var(--text-tertiary);
  transition: all .15s ease;
}
.sh-copy-tab:hover { color: var(--text-secondary); border-color: rgba(124,108,255,.35); }
.sh-copy-tab.is-active {
  background: linear-gradient(135deg, #7C6CFF, #5B8DFF);
  color: #fff; border-color: transparent;
  box-shadow: 0 4px 12px rgba(124,108,255,.3);
}

/* ── 表格 ── */
.sh-table {
  background: var(--bg-surface); border: 1px solid var(--border); border-radius: 14px; overflow: hidden;
  font-size: 12.5px;
}
.sh-table-head {
  display: grid; gap: 12px; padding: 10px 16px; font-size: 11.5px; font-weight: 600;
  color: var(--text-tertiary); background: var(--bg-inset); border-bottom: 1px solid var(--border);
  text-transform: uppercase; letter-spacing: .5px;
}
.sh-table-head, .sh-table-row { grid-template-columns: 1.4fr 1fr 1fr 1fr 1fr 0.8fr; }
@media (max-width: 900px) { .sh-table-head, .sh-table-row { grid-template-columns: 1.4fr 1fr 1fr 1fr; } .sh-table-head > div:nth-child(n+5), .sh-table-row > div:nth-child(n+5) { display:none; } }
.sh-table-row {
  display: grid; gap: 12px; padding: 12px 16px;
  border-bottom: 1px solid var(--border); color: var(--text-secondary);
  align-items: center;
}
.sh-table-row:last-child { border-bottom: none; }
.sh-table-row:hover { background: rgba(124, 108, 255, .04); }
.sh-right { text-align: right; justify-self: end; }
.sh-coin { color: #E0B84D; font-weight: 700; font-variant-numeric: tabular-nums; }
.sh-neg { color: #F87171; font-weight: 600; font-variant-numeric: tabular-nums; }

/* ── 状态标签 ── */
.sh-tag {
  display: inline-block; padding: 2px 9px; font-size: 11px; font-weight: 600; border-radius: 999px;
}
.sh-tag.sh-green { background: rgba(52, 199, 123, .15); color: #34C77B; }
.sh-tag.sh-blue  { background: rgba(124, 108, 255, .15); color: #A99BFF; }
.sh-tag.sh-gray  { background: rgba(156, 163, 175, .15); color: var(--text-tertiary); }
.sh-tag.sh-red   { background: rgba(248, 113, 113, .15); color: #F87171; }

/* ── 空态 ── */
.sh-empty {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 12px; padding: 60px 20px; text-align: center;
  color: var(--text-tertiary); font-size: 13px;
  border: 1.5px dashed var(--border-strong); border-radius: 14px;
  background: repeating-linear-gradient(45deg, rgba(255, 255, 255, .01) 0 10px, transparent 10px 20px);
}
.sh-empty svg { width: 32px; height: 32px; opacity: .5; }

/* ============================================================
   share.js 新增：弹窗 + 好友详情 + 提现
   ============================================================ */
/* 遮罩 */
.sh-modal-mask {
  position: fixed; inset: 0; z-index: 9999;
  background: rgba(0,0,0,.55);
  display: flex; align-items: center; justify-content: center;
  animation: shFadeIn .18s ease;
}
@keyframes shFadeIn { from { opacity: 0 } to { opacity: 1 } }
@keyframes shPop { from { opacity: 0; transform: translateY(16px) scale(.98) } to { opacity: 1; transform: none } }

.sh-modal-inner {
  width: min(560px, 92vw); max-height: 84vh;
  background: var(--bg-surface); border-radius: 14px;
  border: 1px solid var(--border);
  display: flex; flex-direction: column;
  overflow: hidden;
  box-shadow: 0 24px 60px rgba(0,0,0,.35);
  animation: shPop .22s ease;
}
.sh-modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px; border-bottom: 1px solid var(--border);
  flex: none;
}
.sh-modal-header h3 { font-size: 15px; font-weight: 700; color: var(--text-primary); display: flex; align-items: center; gap: 8px; margin: 0; }
.sh-modal-close {
  width: 28px; height: 28px; border: none; background: transparent; border-radius: 8px;
  color: var(--text-tertiary); cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: all .15s;
}
.sh-modal-close:hover { background: var(--bg-inset); color: var(--text-primary); }
.sh-modal-body { flex: 1; overflow-y: auto; padding: 20px; }

/* 好友详情 */
.sh-detail-header {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 16px; border-radius: 12px;
  background: var(--bg-inset); border: 1px solid var(--border);
  margin-bottom: 12px;
}
.sh-detail-avatar {
  width: 44px; height: 44px; border-radius: 12px; flex: none;
  background: linear-gradient(135deg, #7C6CFF, #5B8DFF);
  color: #fff; font-weight: 800; font-size: 18px;
  display: flex; align-items: center; justify-content: center;
}
.sh-detail-name { font-size: 15px; font-weight: 700; color: var(--text-primary); }
.sh-detail-sub { font-size: 12px; color: var(--text-tertiary); margin-top: 2px; }
.sh-detail-stats {
  display: flex; gap: 10px; margin-bottom: 14px;
}
.sh-detail-stats > div {
  flex: 1; padding: 10px 14px; border-radius: 10px;
  background: var(--bg-surface); border: 1px solid var(--border);
  text-align: center;
}
.sh-detail-stats b { display: block; font-size: 18px; font-weight: 800; color: var(--text-primary); font-variant-numeric: tabular-nums; }
.sh-detail-stats span { font-size: 11px; color: var(--text-tertiary); }

.sh-detail-table {
  border-radius: 10px; overflow: hidden;
  border: 1px solid var(--border);
}
.sh-detail-table-head, .sh-detail-row {
  display: grid; grid-template-columns: 1.6fr 2fr 1fr 1fr; gap: 12px;
  padding: 10px 14px; font-size: 12px;
}
.sh-detail-table-head {
  background: var(--bg-inset); color: var(--text-tertiary);
  font-weight: 600; letter-spacing: .4px; text-transform: uppercase;
  border-bottom: 1px solid var(--border);
}
.sh-detail-row {
  border-bottom: 1px solid var(--border); color: var(--text-secondary);
  align-items: center;
}
.sh-detail-row:last-child { border-bottom: none; }
.sh-detail-row:hover { background: rgba(124,108,255,.04); }

/* 提现弹窗 */
.sh-withdraw-info {
  display: flex; gap: 12px; margin-bottom: 16px;
  padding: 12px 14px; border-radius: 10px;
  background: rgba(224,184,77,.08); border: 1px solid rgba(224,184,77,.25);
}
.sh-withdraw-info > div { flex: 1; text-align: center; }
.sh-withdraw-info span { font-size: 11px; color: var(--text-tertiary); display: block; margin-bottom: 3px; }
.sh-withdraw-info b { font-size: 18px; font-weight: 800; color: var(--text-primary); font-variant-numeric: tabular-nums; }

.sh-form select, .sh-form input[type="text"], .sh-form input[type="number"] {
  width: 100%; padding: 10px 14px; font-size: 13px; font-family: inherit;
  color: var(--text-primary); background: var(--bg-inset);
  border: 1px solid var(--border); border-radius: 10px; transition: all .15s ease;
}
.sh-form select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2398A2B3' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 34px; }
.sh-form input:focus, .sh-form select:focus {
  outline: none; border-color: rgba(124,108,255,.6);
  box-shadow: 0 0 0 3px rgba(124,108,255,.15);
}

/* 提现记录顶部小统计 */
.sh-mini-stat {
  flex: none; padding: 8px 14px; border-radius: 10px;
  background: var(--bg-inset); border: 1px solid var(--border);
  display: flex; flex-direction: column; align-items: center; justify-content: center; min-width: 120px;
}
.sh-mini-stat b { font-size: 16px; font-weight: 800; color: var(--text-primary); font-variant-numeric: tabular-nums; }
.sh-mini-stat span { font-size: 10.5px; color: var(--text-tertiary); margin-top: 1px; }

/* 统计卡上的按钮（与 btn-sm 结合） */
.sh-stat-card .btn { flex: none; white-space: nowrap; }

/* ================= 脚本工作室（se = script editor studio） ================= */
/* hidden 属性兜底：以下元素 CSS 使用了 display:flex，必须显式压过 UA 的 [hidden]，否则初始隐藏失效 */
.se-overlay[hidden], .se-preview-bar[hidden], .se-diff-bar[hidden] { display: none; }

.se-modal {
  width: 92vw; max-width: 1180px; height: 86vh; max-height: 820px;
  display: flex; flex-direction: column; overflow: hidden; position: relative;
}
.se-head {
  flex: none; display: flex; align-items: center; justify-content: space-between;
  gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(124,124,255,.06), transparent);
}
.se-head-l { display: flex; align-items: center; gap: 10px; min-width: 0; }
.se-head-back {
  display: inline-flex; align-items: center; gap: 4px; height: 28px; padding: 0 10px;
  font-size: 12.5px; color: var(--text-secondary);
  background: var(--bg-surface); border: 1px solid var(--border); border-radius: var(--r-full);
  cursor: pointer; transition: all var(--dur-fast) ease;
  white-space: nowrap; flex-shrink: 0;
}
.se-head-back:hover { color: var(--text-primary); border-color: var(--border-strong); background: var(--bg-hover); }
.se-head-l h3 { margin: 0; font-size: 17px; font-weight: 800; color: var(--text-primary); white-space: nowrap; }
.se-cur-badge { font-size: 12px; color: var(--text-secondary); display: inline-flex; align-items: center; gap: 6px; }
.se-cur-badge > span {
  font-size: 11px; padding: 1px 8px; border-radius: var(--r-full);
  background: var(--brand-soft); color: var(--brand-400); font-weight: 700;
}
.se-head-r { display: flex; align-items: center; gap: 10px; flex: none; }
.se-viewswitch, .se-seg { display: inline-flex; background: var(--bg-inset); border: 1px solid var(--border); border-radius: var(--r-full); padding: 2px; }
.se-viewswitch button, .se-seg button {
  border: none; background: transparent; color: var(--text-secondary);
  font-size: 12.5px; font-weight: 600; padding: 5px 14px; border-radius: var(--r-full);
  cursor: pointer; transition: all .15s ease; white-space: nowrap;
}
.se-viewswitch button.is-on, .se-seg button.is-on {
  background: var(--brand-grad); color: #fff; box-shadow: 0 2px 10px rgba(99,102,241,.35);
}
.se-head .modal-close {
  width: 30px; height: 30px; border-radius: 50%; border: none; cursor: pointer;
  background: var(--bg-hover); color: var(--text-secondary); font-size: 14px; flex: none;
}
.se-head .modal-close:hover { background: var(--bg-active); color: var(--text-primary); }

.se-body {
  flex: 1; min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  grid-template-rows: minmax(0, 1fr);
}

/* 主区 */
.se-main { min-width: 0; min-height: 0; display: flex; flex-direction: column; border-right: 1px solid var(--border); }
.se-view { flex: 1; min-height: 0; overflow-y: auto; padding: 18px 20px; display: flex; flex-direction: column; gap: 14px; }
/* Flex item 防压缩：让每个板块保持内容高度，由 se-view 的 overflow-y: auto 出滚动条 */
.se-view > * { flex-shrink: 0; min-height: auto; }
.se-preview-bar, .se-diff-bar {
  flex: none; display: flex; align-items: center; gap: 10px;
  margin: 14px 20px 0; padding: 9px 14px; border-radius: var(--r-md);
  background: var(--warning-soft); border: 1px solid rgba(251,191,36,.3);
  color: var(--warning); font-size: 12.5px;
}
.se-diff-bar { background: var(--accent-cyan-soft); border-color: rgba(34,211,238,.3); color: var(--accent-cyan); justify-content: space-between; }
.se-apply-top { margin-left: auto; padding: 5px 14px !important; font-size: 12.5px !important; }

/* 美化板块卡 */
.se-sec {
  border: 1px solid var(--border); border-radius: var(--r-md);
  background: var(--bg-surface); overflow: hidden;
}
.se-sec-h {
  padding: 9px 14px; font-size: 12.5px; font-weight: 700; color: var(--text-secondary);
  letter-spacing: .02em; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 6px;
  background: var(--bg-inset);
}
.se-sec-b { padding: 13px 15px; }
.se-sec-b p { margin: 0; font-size: 13.5px; line-height: 1.85; color: var(--text-primary); word-break: break-word; overflow-wrap: break-word; }
.se-two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; align-items: start; }
.se-two .se-sec { min-width: 0; overflow: hidden; word-break: break-word; }
.se-two .se-sec-b { overflow: hidden; }
.se-sec-title .se-sec-h { color: var(--brand-400); }
.se-titles { display: flex; flex-direction: column; gap: 8px; }
.se-title {
  display: flex; align-items: center; gap: 10px; font-size: 14px; font-weight: 700;
  color: var(--text-primary); padding: 8px 12px; border-radius: var(--r-sm);
  background: var(--brand-soft);
}
.se-title i { font-style: normal; color: var(--brand-400); flex: none; font-size: 13px; }
/* 主标题（单一条目，强调展示） */
.se-title-main {
  font-size: 16px; font-weight: 800; color: var(--brand-400);
  padding: 10px 14px; border-radius: 8px;
  background: linear-gradient(135deg, rgba(99,102,241,.14), rgba(168,85,247,.12));
  letter-spacing: .5px;
}
/* 底部双击编辑提示条 */
.se-tip-bar {
  margin-top: 10px; padding: 8px 14px;
  border-radius: 8px;
  background: rgba(99,102,241,.08);
  border: 1px dashed rgba(99,102,241,.35);
  color: var(--brand-400); font-size: 12px;
  text-align: center; line-height: 1.6;
  user-select: none; pointer-events: none;
}
.se-sec-hook { border-left: 3px solid var(--warning); }
.se-sec-hook .se-sec-h { color: var(--warning); }
.se-sec-ending { border-left: 3px solid var(--success); }
.se-sec-ending .se-sec-h { color: var(--success); }
.se-sec-style .se-sec-h { color: var(--accent-cyan); }

/* 时间线表格 */
.se-table-wrap { overflow-x: auto; }
.se-table { width: 100%; border-collapse: collapse; table-layout: fixed; font-size: 12.5px; min-width: 560px; }
.se-table th {
  text-align: left; padding: 8px 10px; color: var(--text-tertiary); font-weight: 700;
  font-size: 11px; text-transform: uppercase; letter-spacing: .04em;
  border-bottom: 1px solid var(--border-strong); white-space: nowrap;
}
.se-table td { padding: 10px; vertical-align: top; line-height: 1.7; color: var(--text-primary); border-bottom: 1px solid var(--border); word-break: break-word; }
.se-table tbody tr:last-child td { border-bottom: none; }
.se-table tbody tr { transition: background .12s ease; }
.se-table tbody tr:hover { background: var(--bg-hover); }
.se-col-n { width: 40px; text-align: center; }
.se-col-dur { width: 64px; text-align: center; }
.se-table th:nth-child(3), .se-shot-shot { width: 120px; }
.se-table th:nth-child(4), .se-shot-vis { width: auto; }
.se-table th:nth-child(5), .se-shot-line { width: 200px; }
.se-shot-n {
  text-align: center; font-weight: 800; color: var(--brand-400);
  font-variant-numeric: tabular-nums;
  background: var(--brand-soft);
}
.se-shot-dur { white-space: nowrap; color: var(--warning); font-weight: 700; font-variant-numeric: tabular-nums; text-align: center; }
.se-shot-shot { color: var(--accent-cyan); white-space: nowrap; }
.se-shot-vis { }
.se-shot-line { color: var(--text-secondary); }
.se-none { color: var(--text-tertiary); font-size: 11px; }
.se-story-note { font-size: 12px; color: var(--text-tertiary); margin-bottom: 10px; line-height: 1.7; }
.se-raw {
  margin: 0; white-space: pre-wrap; word-break: break-word;
  font-size: 13px; line-height: 1.9; color: var(--text-primary);
  font-family: inherit;
}

/* 手动编辑 */
.se-editor {
  width: 100%; flex: 1; min-height: 320px; resize: vertical;
  background: var(--bg-inset); border: 1px solid var(--border); border-radius: var(--r-md);
  color: var(--text-primary); font-size: 13px; line-height: 1.9; padding: 14px;
  font-family: inherit;
}
.se-editor:focus { outline: none; border-color: var(--border-focus); }
.se-edit-ops { display: flex; justify-content: flex-end; gap: 10px; margin-top: 10px; }

/* diff */
.se-diff { margin: 0; font-size: 12.5px; line-height: 1.85; font-family: inherit; white-space: pre-wrap; word-break: break-word; }
.se-diff > div { padding: 1px 10px; border-radius: 4px; }
.se-diff-eq { color: var(--text-secondary); }
.se-diff-del { background: var(--error-soft); color: var(--error); }
.se-diff-add { background: var(--success-soft); color: var(--success); }

/* 底部对话区 */
.se-chat { flex: none; border-top: 1px solid var(--border); padding: 12px 20px 16px; background: var(--bg-surface); }
.se-chat-top { display: flex; align-items: center; gap: 12px; margin-bottom: 9px; }
.se-mode-hint { font-size: 11.5px; color: var(--text-tertiary); }
.se-quick { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 10px; }
.se-chip {
  border: 1px solid var(--border); background: var(--bg-inset); color: var(--text-secondary);
  font-size: 11.5px; padding: 4px 11px; border-radius: var(--r-full); cursor: pointer;
  transition: all .14s ease;
}
.se-chip:hover { border-color: var(--border-focus); color: var(--brand-400); background: var(--brand-soft); }
.se-inputrow { display: flex; gap: 10px; align-items: stretch; }
.se-inputrow textarea {
  flex: 1; resize: none; background: var(--bg-inset); border: 1px solid var(--border);
  border-radius: var(--r-md); color: var(--text-primary); font-size: 13px; line-height: 1.7;
  padding: 10px 12px; font-family: inherit;
}
.se-inputrow textarea:focus { outline: none; border-color: var(--border-focus); }
.se-send {
  flex: none; min-width: 108px; display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: 1px; line-height: 1.2;
}
.se-send:disabled { opacity: .6; cursor: wait; }
.se-send-t { font-size: 13.5px; font-weight: 700; }
.se-price { font-size: 11px; font-style: normal; opacity: .92; }

/* 右栏版本历史 */
.se-aside { display: flex; flex-direction: column; min-height: 0; background: var(--bg-surface); }
.se-aside-h {
  flex: none; padding: 13px 16px; font-size: 12.5px; font-weight: 700;
  color: var(--text-secondary); border-bottom: 1px solid var(--border);
}
.se-aside-h span { color: var(--text-tertiary); font-weight: 500; }
.se-ver-list { flex: 1; overflow-y: auto; padding: 10px; display: flex; flex-direction: column; gap: 8px; }
.se-loading { font-size: 12px; color: var(--text-tertiary); text-align: center; padding: 24px 0; }
.se-ver {
  border: 1px solid var(--border); border-radius: var(--r-md);
  background: var(--bg-inset); padding: 10px 11px; cursor: pointer;
  transition: border-color .14s ease, background .14s ease;
}
.se-ver:hover { border-color: var(--border-strong); }
.se-ver.is-active { border-color: var(--brand-500); box-shadow: 0 0 0 1px var(--brand-500) inset; }
.se-ver.is-current { background: var(--brand-soft); }
.se-ver-row1 { display: flex; align-items: center; gap: 7px; margin-bottom: 4px; }
.se-ver-row1 b { font-size: 13px; color: var(--text-primary); }
.se-cur-flag {
  font-size: 10px; font-weight: 700; color: var(--brand-400);
  border: 1px solid rgba(124,124,255,.4); border-radius: var(--r-full); padding: 0 7px;
}
.se-tag { font-size: 10.5px; padding: 0 8px; border-radius: var(--r-full); font-weight: 700; }
.se-tag-init { background: var(--bg-active); color: var(--text-secondary); }
.se-tag-tweak { background: var(--accent-cyan-soft); color: var(--accent-cyan); }
.se-tag-rewrite { background: var(--warning-soft); color: var(--warning); }
.se-tag-manual { background: var(--success-soft); color: var(--success); }
.se-ver-cmd {
  font-size: 12px; color: var(--text-primary); line-height: 1.55;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.se-ver-meta { font-size: 10.5px; color: var(--text-tertiary); margin-top: 5px; }
.se-ver-ops { display: flex; gap: 10px; margin-top: 7px; padding-top: 7px; border-top: 1px dashed var(--border); }
.se-link {
  border: none; background: transparent; color: var(--brand-400); font-size: 11.5px;
  cursor: pointer; padding: 0; font-weight: 600;
}
.se-link:hover { color: var(--brand-500); text-decoration: underline; }
.se-link-danger { color: var(--error); }

/* 等待遮罩 */
.se-overlay {
  position: absolute; inset: 0; z-index: 5;
  background: rgba(12, 15, 22, 0.72); backdrop-filter: blur(3px);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px;
}
.se-spinner {
  width: 42px; height: 42px; border-radius: 50%;
  border: 3px solid rgba(124,124,255,.18); border-top-color: var(--brand-500);
  animation: se-spin .8s linear infinite;
}
.se-overlay-t { color: var(--text-secondary); font-size: 13px; letter-spacing: .02em; }
@keyframes se-spin { to { transform: rotate(360deg); } }

/* 窄屏：右栏折叠为底部横向区 */
@media (max-width: 900px) {
  .se-modal { width: 96vw; height: 92vh; }
  .se-body { grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0, 1fr) 168px; }
  .se-main { border-right: none; border-bottom: 1px solid var(--border); }
  .se-aside { border-top: none; }
  .se-ver-list { flex-direction: row; overflow-x: auto; overflow-y: hidden; }
  .se-ver { min-width: 210px; }
  .se-two { grid-template-columns: 1fr; }
  .se-mode-hint { display: none; }
}

/* ============================================================
   脚本面板头部按钮 + 双击编辑 + AI 撰写对话框
   ============================================================ */
.sc-view-head-actions { display: flex; gap: 8px; }
.sc-view-head-btns { display: flex; align-items: center; gap: 8px; flex: none; }
.sc-view-btn {
  padding: 6px 12px; font-size: 13px; border-radius: 6px;
  background: var(--bg-surface-2, var(--bg-inset)); color: var(--text-secondary);
  border: 1px solid var(--border); cursor: pointer; transition: all .15s ease;
}
.sc-view-btn:hover { color: var(--brand-400); border-color: var(--brand-500); }
.sc-view-btn.is-on {
  color: #fff; border-color: var(--brand-500);
  background: var(--brand-grad, linear-gradient(135deg, #6366f1, #8b5cf6));
  box-shadow: 0 2px 10px -2px rgba(99,102,241,.55);
}

/* 按钮内嵌扣分文案（预览图 / 创建视频 / AI 发送） */
.sc-btn-price {
  font-style: normal; font-size: 11.5px; font-weight: 600;
  margin-left: 6px; padding: 1px 8px; border-radius: var(--r-full);
  background: rgba(251,191,36,.14); color: #fbbf24; white-space: nowrap;
}
.btn-ghost .sc-btn-price { background: rgba(251,191,36,.1); }
.sp-btn-price {
  font-style: normal; font-size: 11.5px; font-weight: 700;
  margin-left: 6px; padding: 1px 8px; border-radius: var(--r-full);
  background: rgba(251,191,36,.18); color: #fbbf24; white-space: nowrap;
}

/* 手动脚本纯文本编辑模式 */
.sc-view-body[data-mode="manual"] { display: block; padding: 12px 16px; }
.sc-raw-editor {
  width: 100%; min-height: calc(100vh - 320px);
  resize: vertical; display: block;
  padding: 14px 16px; border-radius: 10px;
  background: var(--bg-inset, #0c1020); color: var(--text-primary);
  border: 1px solid var(--border);
  font-family: ui-monospace, "Cascadia Code", Consolas, "Microsoft YaHei", monospace;
  font-size: 13.5px; line-height: 1.75; white-space: pre-wrap; word-break: break-word;
  outline: none; transition: border-color .15s ease, box-shadow .15s ease;
}
.sc-raw-editor:focus {
  border-color: var(--brand-500);
  box-shadow: 0 0 0 3px rgba(99,102,241,.15);
}

.sc-editable { transition: outline .15s ease; }
.sc-editable:hover { outline: 1px dashed var(--border); outline-offset: 2px; border-radius: 6px; cursor: text; }
.sc-editable.is-editing {
  outline: 2px solid var(--brand-500); outline-offset: 2px;
  padding: 8px; background: var(--bg-input, var(--bg-inset)); border-radius: 6px;
  min-height: 60px;
}

/* 板块 diff 高亮 — 微调 */
.se-sec.is-diff-change {
  border: 2px solid rgba(239, 68, 68, .75);
  box-shadow: 0 0 0 3px rgba(239, 68, 68, .15), 0 2px 12px -4px rgba(239, 68, 68, .3);
  animation: seDiffPulse 1.2s ease-in-out 0s 2;
  position: relative;
}
.se-sec.is-diff-change::before {
  content: '微调';
  position: absolute; top: -10px; right: 10px;
  font-size: 11px; padding: 1px 7px;
  background: #ef4444; color: #fff; border-radius: 10px;
  font-weight: 700;
  box-shadow: 0 1px 4px rgba(239, 68, 68, .4);
  z-index: 2;
}
.se-sec.is-diff-change .se-sec-h {
  background: linear-gradient(90deg, rgba(239, 68, 68, .18), transparent);
}

/* 板块 diff 高亮 — 重构 */
.se-sec.is-diff-rewrite {
  border: 2px solid rgba(99, 102, 241, .6);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, .12);
  animation: seDiffPulse 1.2s ease-in-out 0s 1;
}
.se-sec.is-diff-rewrite::before {
  content: '重构';
  position: absolute; top: -10px; right: 10px;
  font-size: 11px; padding: 1px 7px;
  background: var(--brand-grad); color: #fff; border-radius: 10px;
  font-weight: 700;
  box-shadow: 0 1px 4px rgba(99, 102, 241, .4);
  z-index: 2;
}

@keyframes seDiffPulse {
  0%   { transform: scale(1); }
  50%  { transform: scale(1.015); }
  100% { transform: scale(1); }
}

/* 手动编辑时清除 diff 高亮（blur 保存后） */
.sc-editable.is-editing.is-diff-change,
.sc-editable.is-editing.is-diff-rewrite {
  border-color: var(--brand-500); /* 编辑态优先显示编辑轮廓 */
  box-shadow: none;
  animation: none;
}

/* AI 气泡内简化：去掉不再需要的 diff/rewrite 容器样式（保留 sp-msg-chat 即可） */
.sp-msg-diff, .sp-msg-rewrite { display: none !important; }

.sc-chat-modal { width: 560px; max-width: 92vw; display: flex; flex-direction: column; padding: 0; border: 1px solid var(--border); border-radius: var(--r-lg); }
.sc-chat-modal-head {
  display: flex; justify-content: space-between; align-items: center;
  padding: 14px 18px; border-bottom: 1px solid var(--border);
}
.sc-chat-modal-head h3 { margin: 0; font-size: 15px; font-weight: 700; }
.sc-chat-modal-body { padding: 0; display: flex; flex-direction: column; max-height: 70vh; }
.sc-chat-log {
  flex: 1; overflow-y: auto; padding: 14px 16px;
  display: flex; flex-direction: column; gap: 10px;
  background: var(--bg-base, var(--bg-primary)); min-height: 200px; max-height: calc(70vh - 140px);
}
.sc-chat-empty { text-align: center; color: var(--text-tertiary); padding: 40px 20px; font-size: 13px; }
.sc-msg { max-width: 85%; padding: 8px 12px; border-radius: 10px; font-size: 13px; line-height: 1.5; white-space: pre-wrap; word-break: break-word; }
.sc-msg-user { align-self: flex-end; background: var(--brand-grad, linear-gradient(135deg, #7C6CFF, #5B8DFF)); color: #fff; border-bottom-right-radius: 2px; }
.sc-msg-ai { align-self: flex-start; background: var(--bg-surface); border: 1px solid var(--border); border-bottom-left-radius: 2px; color: var(--text-primary); }
.sc-chat-input-area { padding: 12px 16px; border-top: 1px solid var(--border); background: var(--bg-surface); }
.sc-chat-input-area textarea {
  width: 100%; padding: 8px 10px; border-radius: 6px;
  background: var(--bg-input, var(--bg-inset)); border: 1px solid var(--border);
  color: var(--text-primary); font-size: 13px; resize: vertical;
  font-family: inherit;
}
.sc-chat-input-row { display: flex; justify-content: space-between; align-items: center; margin-top: 8px; }
.sc-chat-price { font-size: 12px; color: var(--text-tertiary); }

/* 脚本创作 empty 态 — 历史脚本列表 */
.sc-empty-wrap { padding: 24px 20px; }
.sc-empty-hint { text-align: center; margin-bottom: 20px; }
.sc-empty-big { font-size: 40px; display: block; margin-bottom: 8px; }
.sc-empty-hint p { margin: 2px 0; color: var(--text-tertiary); font-size: 14px; }
.sc-empty-hint .sc-empty-sub { font-size: 12px; opacity: .8; }
.sc-history-list { display: flex; flex-direction: column; gap: 8px; }
.sc-history-item {
  padding: 12px 14px; border-radius: 8px; border: 1px solid var(--border);
  background: var(--bg-surface); cursor: pointer; transition: border-color .15s ease, background .15s ease;
}
.sc-history-item:hover { border-color: var(--brand-500); background: var(--brand-soft); }
.sc-history-title { font-size: 14px; font-weight: 600; color: var(--text-primary); margin-bottom: 3px; }
.sc-history-topic { font-size: 12px; color: var(--brand-400); margin-bottom: 4px; }
.sc-history-preview { font-size: 12px; color: var(--text-tertiary); line-height: 1.5; margin-bottom: 8px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.sc-history-meta { display: flex; align-items: center; gap: 10px; font-size: 11px; color: var(--text-tertiary); }
.sc-history-meta span.flex-1 { flex: 1; }
.sc-history-video { color: var(--brand-400); }
.sc-history-use {
  margin-left: auto; padding: 3px 10px; font-size: 12px;
  border-radius: 5px; border: 1px solid var(--brand-500);
  background: transparent; color: var(--brand-400); cursor: pointer;
  transition: all .15s ease;
}
.sc-history-use:hover { background: var(--brand-500); color: #fff; }
.sc-empty-mini { text-align: center; color: var(--text-tertiary); padding: 30px 20px; font-size: 13px; }
/* ====== 视频参数弹窗（全新美化版） ====== */
.video-param-modal { width: 580px; max-width: 94vw; max-height: 92vh; overflow: hidden; }
.vp-head {
  display: flex; justify-content: space-between; align-items: center;
  padding: 18px 22px;
  background: linear-gradient(135deg, rgba(99,102,241,.12), rgba(168,85,247,.08));
  border-bottom: 1px solid var(--border);
}
.vp-head-l { display: flex; align-items: center; gap: 12px; }
.vp-emoji { font-size: 28px; }
.vp-head h3 { margin: 0 0 2px 0; font-size: 16px; font-weight: 700; }
.vp-sub { font-size: 12px; color: var(--text-tertiary); }
.vp-close { margin: 0; }

.vp-body {
  padding: 16px 20px;
  display: flex; flex-direction: column; gap: 14px;
  max-height: 60vh; overflow-y: auto;
}

/* 参数卡片 */
.vp-card {
  border: 1px solid var(--border); border-radius: 10px;
  background: var(--bg-base);
  padding: 12px 14px;
}
.vp-card-h {
  display: flex; align-items: center; gap: 6px;
  font-size: 12px; font-weight: 600; color: var(--text-secondary);
  margin-bottom: 10px;
  letter-spacing: .3px;
}
.vp-card-ico { font-size: 14px; }
.vp-card-sub { font-size: 11px; color: var(--brand-400); font-weight: 500; }

/* Pill 按钮组 */
.vp-pills { display: flex; flex-wrap: wrap; gap: 8px; }
.vp-pill {
  display: flex; align-items: center; gap: 6px;
  padding: 7px 12px; border-radius: 8px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  cursor: pointer; font-size: 12.5px; font-weight: 500;
  transition: all .15s ease;
  position: relative;
}
.vp-pill:hover { border-color: var(--brand-500); color: var(--text-primary); }
.vp-pill.on { background: var(--brand-soft); border-color: var(--brand-500); color: var(--brand-500); }

/* ===== 一键换装 ===== */
.of-pose-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 10px; }
.of-pose-count { margin-top: 10px; font-size: 12px; color: var(--text-tertiary); }
.of-pose-count b { color: var(--brand-500); }
.of-custom-row { margin-top: 12px; display: flex; gap: 8px; }
.of-custom-row .input { flex: 1; }

/* 换装多图组（上装/下装）：横排缩略图 + 添加格（小格 76px：确保 173px 行宽内能并排 2 个） */
.fs-thumb-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }

/* 换装服装图子卡分组（上装/下装 2 列） */
.of-group-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; align-items: start; }
.of-group {
  background: var(--bg-surface); border: 1px solid var(--border);
  border-radius: 12px; padding: 12px; display: flex; flex-direction: column; gap: 10px;
  transition: border-color .15s;
}
.of-group:hover { border-color: var(--brand-500); }
.of-group-head { display: flex; align-items: center; gap: 5px; }
.of-group-head b { font-size: 13px; color: var(--text-primary); line-height: 1.2; white-space: nowrap; }
.of-group-head .req { color: #ef4444; font-weight: 600; line-height: 1.2; }
.of-group-sub { font-size: 11px; color: var(--text-tertiary); line-height: 1.35; margin-top: -6px; }
/* .of-group 内槽位：整宽方形预览图 + 方形上传框 */
.of-group .ref-thumb { width: 100%; aspect-ratio: 1/1; border-radius: 10px; overflow: hidden; position: relative; border: 1px solid var(--border); background: var(--bg-surface); }
.of-group .ref-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.of-group .ref-thumb .x { position: absolute; top: 4px; right: 4px; width: 22px; height: 22px; border-radius: 50%; background: rgba(0,0,0,.6); color: #fff; border: none; cursor: pointer; font-size: 14px; line-height: 1; }
.of-group .ref-thumb.uploading::after { content: ''; position: absolute; inset: 0; background: rgba(0,0,0,.45) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='2'%3E%3Cpath d='M21 12a9 9 0 1 1-6.219-8.56'/%3E%3C/svg%3E") center/24px no-repeat; animation: igRotate 1s linear infinite; }
.of-group .drop-zone { width: 100%; aspect-ratio: 1/1; box-sizing: border-box; padding: 8px; gap: 3px; border-radius: 10px; border: 1.5px dashed rgba(124,108,255,.4); background: rgba(124,108,255,.05); display: flex; flex-direction: column; align-items: center; justify-content: center; cursor: pointer; color: var(--text-tertiary); transition: all .15s; }
.of-group .drop-zone .icon { width: 34px; height: 34px; }
.of-group .drop-zone .icon svg { width: 18px; height: 18px; }
.of-group .drop-zone:hover { border-color: var(--brand-500); background: var(--brand-soft); color: var(--brand-500); }
.of-group .drop-zone .t { font-size: 12px; font-weight: 500; }
.of-group .ref-thumb.sm, .of-group .drop-zone.sm { width: 76px; height: 76px; aspect-ratio: auto; }
.of-group .drop-zone.sm { padding: 4px; gap: 2px; }
.of-group .drop-zone.sm .icon { width: 22px; height: 22px; }
.of-group .drop-zone.sm .icon svg { width: 13px; height: 13px; }
.of-group .drop-zone.sm .t { font-size: 11px; }
.of-lib-btn { width: 100%; justify-content: center; display: inline-flex; align-items: center; gap: 6px; }
.of-lib-btn svg { flex: none; }

/* 素材来源切换块：模特三选一 / 背景二选一，每块内含来源 chips 与对应输入区 */
.of-src { margin-top: 12px; padding-top: 12px; border-top: 1px dashed var(--border); }
.of-src-head { display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; margin-bottom: 8px; }
.of-src-head b { font-size: 13px; color: var(--text-primary); }
.of-src-head .s { font-size: 11px; color: var(--text-tertiary); }
.of-src-tabs { margin-bottom: 10px; }
.of-src .field { margin: 0; min-width: 0; }
/* 上传槽（模特图/背景图）：预览图给到 148px，与通栏上传框视觉重量接近 */
.of-slot-wrap .ref-thumb { width: 148px; }
/* 快捷输入 chips：等宽网格（≥78px 保 6 字完整） */
.of-src .field .chip-row { display: grid; grid-template-columns: repeat(auto-fill, minmax(78px, 1fr)); gap: 6px; margin-top: 8px; }
.of-src .field .chip-row .chip {
  display: inline-flex; align-items: center; justify-content: center;
  width: 100%; text-align: center;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  padding: 5px 6px; font-size: 11.5px;
}
/* 库选虚拟模特模板卡：竖版缩略图 + 名称，选中描边并打勾 */
.of-tpl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(74px, 1fr)); gap: 8px; }
.of-tpl {
  position: relative; padding: 0; overflow: hidden; cursor: pointer;
  border: 1px solid var(--border); border-radius: 10px; background: var(--bg-surface);
  transition: border-color .15s, box-shadow .15s;
}
.of-tpl img { width: 100%; aspect-ratio: 3/4; object-fit: cover; display: block; }
.of-tpl .n {
  display: block; padding: 4px 2px; font-size: 11px; line-height: 1.2;
  color: var(--text-secondary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.of-tpl:hover { border-color: var(--brand-500); }
.of-tpl.on { border-color: var(--brand-500); box-shadow: 0 0 0 2px var(--brand-soft); }
.of-tpl.on::after {
  content: '✓'; position: absolute; top: 4px; right: 4px; width: 18px; height: 18px;
  border-radius: 50%; background: var(--brand-500); color: #fff; font-size: 11px; line-height: 18px;
}
@media (max-width: 960px) {
  .of-group-grid { grid-template-columns: 1fr; }
}

/* 换装右栏空状态：三步引导 */
.of-steps {
  display: flex; align-items: stretch; gap: 10px;
  margin-top: 14px; padding: 0 6px;
}
.of-step {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 14px 10px; border-radius: 12px;
  background: var(--bg-surface); border: 1px solid var(--border); text-align: center;
}
.of-step .no {
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--brand-soft); color: var(--brand-500);
  font-size: 12px; font-weight: 700; line-height: 22px;
}
.of-step b { font-size: 13px; color: var(--text-primary); }
.of-step .s { font-size: 11px; color: var(--text-tertiary); line-height: 1.4; }
.of-step-arrow { align-self: center; color: var(--text-tertiary); flex: none; display: flex; }

/* 摆拍样式卡：SVG 图标 + 副标题 */
.of-pose-chip { color: var(--text-secondary); }
.of-pose-chip svg { stroke: currentColor; opacity: .9; }
.of-pose-chip.on svg { stroke: var(--brand-500); opacity: 1; }
.of-pose-chip .d { font-size: 10px; color: var(--text-tertiary); line-height: 1.3; }
.of-pose-chip.on .d { color: var(--brand-500); opacity: .75; }
.of-pose-chip {
  position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 12px 8px; border-radius: 10px;
  background: var(--bg-surface); border: 1.5px solid var(--border);
  cursor: pointer; transition: all .15s ease; text-align: center;
}
.of-pose-chip .ico { font-size: 22px; }
.of-pose-chip .n { font-size: 12px; color: var(--text-secondary); line-height: 1.3; }
.of-pose-chip:hover { border-color: var(--brand-500); }
.of-pose-chip.on { background: var(--brand-soft); border-color: var(--brand-500); }
.of-pose-chip.on .n { color: var(--brand-500); font-weight: 600; }
.of-pose-chip .ck { position: absolute; top: 4px; right: 6px; font-size: 12px; color: var(--brand-500); }

/* 换装结果卡片：选中样式 */
.pick-btn {
  position: absolute; left: 6px; bottom: 6px; z-index: 2;
  padding: 4px 10px; border-radius: 6px; font-size: 11.5px;
  display: inline-flex; align-items: center; gap: 5px;
  background: rgba(0,0,0,.55); color: #fff; border: 1px solid rgba(255,255,255,.2);
  cursor: pointer; backdrop-filter: blur(4px); transition: all .15s;
}
/* 精修入口的魔法棒图标：跟着按钮字号走，固定 13px 方框 */
.pick-btn svg { width: 13px; height: 13px; display: block; flex: none; }
.pick-btn:hover { background: rgba(0,0,0,.75); }
.pick-btn.on { background: var(--brand-500); border-color: var(--brand-500); }
.ig-cell.is-picked { outline: 2px solid var(--brand-500); outline-offset: -2px; }

.vp-pill.is-on {
  background: linear-gradient(135deg, var(--brand-grad));
  color: #fff; border-color: transparent;
  box-shadow: 0 2px 8px -2px rgba(99,102,241,.5);
}
.vp-pill.is-on .vp-pill-note, .vp-pill.is-on .vp-pill-sale { color: rgba(255,255,255,.75); }
.vp-pill.is-on .vp-pill-icon { color: #fff; }

.vp-pill-name { font-weight: 600; }
.vp-pill-note { font-size: 11px; color: var(--text-tertiary); }
.vp-pill-ico { padding: 7px 14px; }
.vp-pill-icon { font-size: 16px; line-height: 1; }

/* 默认标签 */
.vp-def-tag {
  font-size: 9.5px; padding: 1px 5px; border-radius: 8px;
  background: rgba(99,102,241,.15); color: var(--brand-400);
  font-weight: 600; letter-spacing: .3px;
}
.vp-pill.is-on .vp-def-tag { background: rgba(255,255,255,.22); color: #fff; }

/* 清晰度 pill */
.vp-pill-tier { flex-direction: column; align-items: flex-start; gap: 2px; padding: 8px 14px; min-width: 72px; }
.vp-pill-res { font-size: 14px; font-weight: 700; }
.vp-pill-sale { font-size: 11px; color: var(--text-tertiary); }

/* 时长控件 */
.vp-dur-row {
  display: flex; align-items: center; gap: 10px;
}
.vp-dur-btn {
  width: 36px; height: 36px; border-radius: 8px;
  background: var(--bg-surface); border: 1px solid var(--border);
  color: var(--text-primary); font-size: 18px; font-weight: 700;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: all .15s ease;
}
.vp-dur-btn:hover { background: var(--brand-soft); border-color: var(--brand-500); color: var(--brand-400); }
.vp-dur-num {
  display: flex; align-items: baseline; gap: 3px;
  font-size: 22px; font-weight: 800; color: var(--brand-400);
  min-width: 70px; justify-content: center;
}
.vp-dur-unit { font-size: 12px; color: var(--text-tertiary); font-weight: 400; }
/* 左侧表单「脚本时长」拉杆美化：渐变已选轨道 + 发光拇指 + 拖动数值气泡 */
.sc-dur-wrap { position: relative; margin: 12px 0 6px; padding: 0 2px; }
.sc-dur-val { float: right; font-weight: 700; color: var(--brand-400); }
.sc-dur-marks { display: flex; justify-content: space-between; font-size: 11px; color: var(--text-tertiary); margin-top: 2px; }
.sc-dur-range {
  --pct: 50%;
  -webkit-appearance: none; appearance: none;
  width: 100%; height: 8px;
  background: linear-gradient(to right,
    var(--brand-grad) 0%, var(--brand-grad) var(--pct),
    var(--border) var(--pct), var(--border) 100%);
  border-radius: 999px; outline: none; cursor: pointer;
}
.sc-dur-range::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 22px; height: 22px; border-radius: 50%;
  background: #fff; border: 3px solid var(--brand-500);
  cursor: pointer; box-shadow: 0 2px 8px rgba(99,102,241,0.45), 0 0 0 6px rgba(99,102,241,0.08);
  transition: transform .12s ease, box-shadow .12s ease;
}
.sc-dur-range::-webkit-slider-thumb:hover { transform: scale(1.15); box-shadow: 0 2px 10px rgba(99,102,241,0.6), 0 0 0 9px rgba(99,102,241,0.12); }
.sc-dur-range::-moz-range-thumb {
  width: 22px; height: 22px; border-radius: 50%; border: 3px solid var(--brand-500);
  background: #fff; cursor: pointer; box-shadow: 0 2px 8px rgba(99,102,241,0.45);
}
/* 拖动时浮在拇指上方的数值气泡 */
.sc-dur-bubble {
  position: absolute; top: -28px; left: var(--pct); transform: translateX(-50%);
  padding: 2px 10px; border-radius: 8px;
  background: var(--brand-grad); color: #fff; font-size: 12px; font-weight: 700; white-space: nowrap;
  box-shadow: 0 3px 8px rgba(99,102,241,0.35); pointer-events: none; opacity: 0;
  transition: opacity .14s ease;
}
.sc-dur-bubble::after {
  content: ''; position: absolute; bottom: -4px; left: 50%; transform: translateX(-50%);
  border: 4px solid transparent; border-top-color: var(--brand-500);
}
.sc-dur-wrap:hover .sc-dur-bubble, .sc-dur-range:focus + .sc-dur-bubble { opacity: 1; }
.vp-dur-range {
  flex: 1; height: 4px;
  -webkit-appearance: none; appearance: none;
  background: var(--border); border-radius: 3px; outline: none;
  cursor: pointer;
  margin: 0 8px;
}
.vp-dur-range::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 16px; height: 16px; border-radius: 50%;
  background: var(--brand-grad); cursor: pointer;
  box-shadow: 0 1px 4px rgba(0,0,0,.3);
}
.vp-dur-range::-moz-range-thumb {
  width: 16px; height: 16px; border-radius: 50%; border: none;
  background: var(--brand-grad); cursor: pointer;
}

/* 空提示 */
.vp-empty-hint { font-size: 12px; color: var(--text-tertiary); padding: 8px 0; }

/* 底部结算 */
.vp-foot {
  display: flex; justify-content: space-between; align-items: center;
  padding: 14px 22px;
  border-top: 1px solid var(--border);
  background: var(--bg-surface);
  gap: 16px;
}
.vp-summary { flex: 1; min-width: 0; }
.vp-price-row {
  display: flex; align-items: baseline; gap: 6px;
}
.vp-price-label { font-size: 12px; color: var(--text-tertiary); font-weight: 600; }
.vp-price-num {
  font-size: 26px; font-weight: 900;
  background: linear-gradient(135deg, var(--brand-grad));
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
  line-height: 1.1;
}
.vp-price-unit { font-size: 13px; color: var(--text-tertiary); font-weight: 500; }
.vp-breakdown { font-size: 11px; color: var(--text-tertiary); margin-top: 2px; }

.vp-gen-btn {
  padding: 0 28px; height: 42px; font-size: 14px; font-weight: 700;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--brand-grad));
  border: none; cursor: pointer;
  color: #fff;
  transition: transform .15s ease, box-shadow .15s ease;
  box-shadow: 0 4px 14px -4px rgba(99,102,241,.6);
  white-space: nowrap;
}
.vp-gen-btn:hover { transform: translateY(-1px); box-shadow: 0 6px 18px -4px rgba(99,102,241,.75); }
.vp-gen-btn:active { transform: translateY(0); }

/* 原简易样式覆盖（如果还有旧 select/input 存在的兜底） */
.vp-row { display: none; }

/* ════════════════════════════════════════════════════════
   脚本蒙太奇预览 — 遮罩 + 弹窗（.se-preview-* + .se-montage-*）
   ════════════════════════════════════════════════════════ */

/* 生成中遮罩 */
.se-preview-mask {
  position: fixed; inset: 0; z-index: 9999;
  background: radial-gradient(ellipse at center, rgba(10,12,24,.88) 0%, rgba(4,6,14,.96) 100%);
  display: flex; align-items: center; justify-content: center;
  backdrop-filter: blur(6px); animation: seFadeIn .25s ease;
}
.se-preview-card {
  width: 400px; padding: 32px 28px;
  background: linear-gradient(160deg, #1a1f35 0%, #121627 100%);
  border: 1px solid rgba(129,140,248,.25); border-radius: 18px;
  text-align: center; box-shadow: 0 20px 60px -10px rgba(99,102,241,.35), inset 0 1px 0 rgba(255,255,255,.05);
}
.se-preview-spinner {
  width: 56px; height: 56px; margin: 0 auto 20px;
  border-radius: 50%;
  border: 3px solid rgba(129,140,248,.18);
  border-top-color: #818cf8;
  animation: seSpin .9s linear infinite;
}
.se-preview-title { font-size: 17px; font-weight: 600; color: #e5e7eb; margin-bottom: 10px; }
.se-preview-phase { font-size: 13.5px; color: #a5b4fc; margin-bottom: 18px; min-height: 20px; }
.se-preview-bar {
  width: 100%; height: 6px; background: rgba(129,140,248,.12); border-radius: 4px; overflow: hidden;
}
.se-preview-bar > i {
  display: block; height: 100%; width: 5%; border-radius: 4px;
  background: linear-gradient(90deg, #6366f1, #a78bfa, #f472b6);
  transition: width .6s cubic-bezier(.4,0,.2,1);
}
@keyframes seSpin { to { transform: rotate(360deg); } }
@keyframes seFadeIn { from { opacity: 0; } to { opacity: 1; } }

/* 结果弹窗 */
.se-montage-modal { position: fixed; inset: 0; z-index: 9998; }
.se-montage-mask {
  position: absolute; inset: 0;
  background: rgba(4,6,14,.78); backdrop-filter: blur(8px);
  animation: seFadeIn .2s ease;
}
.se-montage-card {
  position: relative; z-index: 1;
  max-width: min(92vw, 960px); max-height: 92vh;
  margin: 4vh auto; padding: 0;
  background: #0f1320; border: 1px solid rgba(129,140,248,.3); border-radius: 16px;
  overflow: hidden; display: flex; flex-direction: column;
  box-shadow: 0 25px 80px -15px rgba(99,102,241,.4);
  animation: seFadeIn .25s ease;
}
.se-montage-h {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 20px; border-bottom: 1px solid rgba(255,255,255,.06);
  font-size: 14.5px; font-weight: 600; color: #e5e7eb;
}
.se-montage-close {
  width: 28px; height: 28px; border: none; border-radius: 8px;
  background: rgba(255,255,255,.06); color: #9ca3af; cursor: pointer;
  font-size: 14px; transition: all .15s;
}
.se-montage-close:hover { background: rgba(255,255,255,.12); color: #fff; }
.se-montage-img-wrap {
  flex: 1; overflow: auto; padding: 16px;
  background: #0a0e1a; display: flex; align-items: center; justify-content: center;
}
.se-montage-img-wrap img {
  max-width: 100%; max-height: 65vh; border-radius: 8px;
  box-shadow: 0 8px 30px rgba(0,0,0,.5);
}
.se-montage-foot {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 20px; border-top: 1px solid rgba(255,255,255,.06);
  font-size: 13px;
}
.se-montage-credits { color: #fbbf24; font-weight: 500; }
.se-montage-download {
  color: #a5b4fc; text-decoration: none; padding: 6px 14px;
  border-radius: 8px; border: 1px solid rgba(129,140,248,.3);
  transition: all .15s;
}
.se-montage-download:hover { background: rgba(99,102,241,.15); color: #c4b5fd; }

/* ============================================================
   AI 3D 商品建模（views/model3d.js）
   ============================================================ */

/* 上传方式切换（单图 / 多视角） */
.m3d-mode { width: 100%; margin-bottom: var(--sp-4); }

/* 单图：一个大框 */
.m3d-single { display: grid; grid-template-columns: minmax(0, 260px); }

/* 多视角：飞机位布局（顶在上、底在下，正面居中，左右各一侧） */
.m3d-views {
  display: grid; gap: 10px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  grid-template-areas:
    ".      top    ."
    "left   front  right"
    ".      back   ."
    ".      bottom .";
}
.m3d-views .m3d-slot { height: 80px; }
.m3d-views [data-area="top"] { grid-area: top; }
.m3d-views [data-area="left"] { grid-area: left; }
.m3d-views [data-area="front"] { grid-area: front; }
.m3d-views [data-area="right"] { grid-area: right; }
.m3d-views [data-area="back"] { grid-area: back; }
.m3d-views [data-area="bottom"] { grid-area: bottom; }

.m3d-slot {
  position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  height: 92px; border-radius: var(--r-md); cursor: pointer;
  border: 1px dashed var(--border-strong); background: var(--bg-inset);
  color: var(--text-tertiary); font-size: var(--fs-caption); transition: all .15s var(--ease-out);
}
.m3d-slot:hover { border-color: var(--brand-400); color: var(--brand-400); }
/* 单图模式的大框：必须排在 .m3d-slot 基础规则之后，同特异性下后者会盖前者 */
.m3d-slot--big { height: 168px; }
.m3d-slot em { font-style: normal; font-weight: 600; letter-spacing: .2px; }
.m3d-slot-req {
  position: absolute; top: 6px; left: 6px; padding: 1px 6px; border-radius: var(--r-full);
  font-size: 11px; font-weight: 600; color: var(--brand-400); background: var(--brand-soft);
}
.m3d-slot.is-filled { border-style: solid; padding: 0; overflow: hidden; }
.m3d-slot.is-filled img { width: 100%; height: 100%; object-fit: cover; display: block; }
.m3d-slot.is-filled em {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 3px 0;
  font-size: 11px; color: #fff; background: rgba(0, 0, 0, .55);
}
.m3d-slot.is-busy { cursor: default; }
.m3d-slot-x {
  position: absolute; top: 5px; right: 5px; z-index: 2;
  display: flex; align-items: center; justify-content: center;
  width: 22px; height: 22px; border: none; border-radius: 50%; cursor: pointer;
  background: rgba(0, 0, 0, .6); color: #fff;
}
.m3d-slot-x:hover { background: var(--error); }

.m3d-tip { margin-top: 10px; font-size: var(--fs-caption); color: var(--text-tertiary); line-height: 1.6; }
.m3d-sub { margin-top: 8px; font-size: var(--fs-caption); color: var(--text-tertiary); line-height: 1.6; }
#m3dGenField.is-dim { opacity: .72; }

/* 开关行：标题 + 一句说明 + 右侧开关 */
.m3d-switch-row {
  display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3);
  padding-top: 12px; margin-top: 12px; border-top: 1px solid var(--border);
}
.m3d-switch-row > div { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.m3d-switch-row b { font-size: var(--fs-sm); font-weight: 600; }
.m3d-switch-row span { font-size: var(--fs-caption); color: var(--text-tertiary); }

/* 排队情况一行（贴在提交按钮上方） */
.m3d-queue-line {
  flex: none; display: flex; align-items: center; flex-wrap: wrap; gap: 10px;
  margin-top: var(--sp-3); padding: 8px 12px;
  border: 1px solid var(--border); border-radius: var(--r-md); background: var(--bg-inset);
  font-size: var(--fs-caption); color: var(--text-tertiary);
}
.m3d-queue-line #m3dQueue { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; min-width: 0; }
.m3d-queue-line > .btn { margin-left: auto; flex: none; padding: 4px 7px; }
.m3d-q-item b { font-weight: 700; color: var(--text-primary); }
.m3d-q-ok, .m3d-q-busy {
  display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px;
  border-radius: var(--r-full); font-weight: 600;
}
.m3d-q-ok { color: var(--success); background: var(--success-soft); }
.m3d-q-busy { color: var(--warning); background: var(--warning-soft); }
.m3d-queue-err { display: inline-flex; align-items: center; gap: 6px; color: var(--error); }

/* 报价行（提交按钮下方） */
.m3d-price { display: flex; align-items: center; justify-content: center; gap: 6px; margin-top: 7px; font-size: var(--fs-caption); color: var(--text-tertiary); }
.m3d-price b { font-size: var(--fs-sm); font-weight: 700; color: var(--brand-400); }
.m3d-price-note { margin-left: 4px; }
.m3d-price-na { color: var(--text-tertiary); }

/* 右侧两栏内容：共享 vs-pane 没有内边距，这里补上 */
.m3d-page .vs-scroll > .vs-pane { padding: 2px 8px 18px 2px; }
/* ---------- 进度与结果：状态卡 / 步骤条 / 指标卡 / 流光进度 / 结果框 ---------- */

/* 每个状态一套强调色，卡片、呼吸点、步骤条、进度条全部跟着走，
   这样不用读文字也能看出这一单是好是坏 */
.m3d-card[data-st="queued"] { --m3d-accent: var(--warning); --m3d-glow: var(--warning-soft); }
.m3d-card[data-st="running"] { --m3d-accent: var(--brand-500); --m3d-glow: var(--brand-soft); }
.m3d-card[data-st="completed"] { --m3d-accent: var(--success); --m3d-glow: var(--success-soft); }
.m3d-card[data-st="failed"] { --m3d-accent: var(--error); --m3d-glow: var(--error-soft); }
.m3d-card[data-st="cancelled"] { --m3d-accent: var(--text-tertiary); --m3d-glow: var(--bg-active); }

.m3d-card {
  position: relative; overflow: hidden;
  padding: 12px 14px; border-radius: var(--r-md);
  border: 1px solid var(--border);
  background-color: var(--bg-surface);
  background-image: radial-gradient(160px 160px at calc(100% + 10px) -22px, var(--m3d-glow), transparent 70%);
  background-repeat: no-repeat;
  box-shadow: var(--shadow-sm), var(--ring-edge);
  animation: m3dRise .34s var(--ease-out) both;
}
/* 顶边一道状态色渐隐光带 */
.m3d-card::before {
  content: ''; position: absolute; left: 0; right: 0; top: 0; height: 2px;
  background: linear-gradient(90deg, transparent, var(--m3d-accent), transparent);
}
.m3d-st-head { position: relative; display: flex; align-items: center; gap: 8px; }
.m3d-st-head b {
  font-size: var(--fs-body); font-weight: 650; min-width: 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.m3d-st-head .badge { margin-left: auto; flex: none; }
/* 呼吸状态点：还在跑的单才闪，终态（完成/失败/取消）静止 */
.m3d-live { position: relative; flex: none; width: 8px; height: 8px; }
.m3d-live i { position: absolute; inset: 0; border-radius: 50%; background: var(--m3d-accent); }
.m3d-live::after {
  content: ''; position: absolute; inset: 0; border-radius: 50%;
  border: 1px solid var(--m3d-accent); animation: m3dRing 1.9s ease-out infinite;
}
.m3d-card[data-st="completed"] .m3d-live::after,
.m3d-card[data-st="failed"] .m3d-live::after,
.m3d-card[data-st="cancelled"] .m3d-live::after { display: none; }
.m3d-st-meta { position: relative; display: flex; flex-wrap: wrap; gap: 6px; margin-top: 9px; }
.m3d-chip {
  padding: 2px 8px; border-radius: var(--r-full); font-size: var(--fs-caption);
  border: 1px solid var(--border); background: var(--bg-inset); color: var(--text-secondary);
  font-variant-numeric: tabular-nums;
}

/* 三阶段步骤条 */
.m3d-steps { display: flex; align-items: flex-start; margin: 16px 6px 2px; }
.m3d-step { display: flex; flex-direction: column; align-items: center; gap: 5px; flex: none; width: 60px; }
.m3d-step-dot {
  display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%;
  border: 1px solid var(--border-strong); background: var(--bg-inset); color: var(--text-tertiary);
  transition: background var(--dur-base) var(--ease-out), border-color var(--dur-base) var(--ease-out),
              color var(--dur-base) var(--ease-out), box-shadow var(--dur-base) var(--ease-out);
}
.m3d-step em { font-style: normal; font-size: var(--fs-caption); color: var(--text-tertiary); white-space: nowrap; }
.m3d-step.is-done .m3d-step-dot { border-color: transparent; background: var(--brand-soft); color: var(--brand-400); }
.m3d-step.is-done em { color: var(--text-secondary); }
.m3d-step.is-cur .m3d-step-dot {
  border-color: transparent; background: var(--brand-grad); color: #fff;
  box-shadow: var(--glow-brand); animation: m3dBeat 1.9s ease-in-out infinite;
}
.m3d-step.is-cur em { color: var(--text-primary); font-weight: 600; }
.m3d-steps[data-bad="1"] .m3d-step.is-cur .m3d-step-dot {
  background: var(--error-soft); color: var(--error); box-shadow: none; animation: none;
  border-color: var(--error);
}
.m3d-steps[data-bad="1"] .m3d-step.is-cur em { color: var(--error); }
.m3d-step-bar { position: relative; flex: 1 1 auto; min-width: 14px; height: 2px; margin-top: 10px; border-radius: 2px; background: var(--border); overflow: hidden; }
.m3d-step-bar i {
  position: absolute; inset: 0; border-radius: inherit; background: var(--brand-grad-hi);
  transform: scaleX(0); transform-origin: left; transition: transform .55s var(--ease-out);
}
.m3d-step-bar.is-fill i { transform: scaleX(1); }
.m3d-steps[data-bad="1"] .m3d-step-bar.is-fill i { background: var(--error); opacity: .5; }

/* 内容面板：指标卡、进度条、说明文字放在一起 */
.m3d-panel {
  margin-top: 10px; padding: 14px; border-radius: var(--r-md);
  border: 1px solid var(--border); background: var(--bg-surface);
  box-shadow: var(--ring-edge);
  animation: m3dRise .34s .07s var(--ease-out) both;
}
.m3d-panel-ok { border-color: var(--success-soft); }

/* 数字指标卡：挤不下就换行，不能把数字截断；只有一个时居中限宽，不拉成整行 */
.m3d-metrics { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.m3d-metric {
  flex: 1 1 120px; min-width: 0; max-width: 220px; padding: 9px 11px; border-radius: var(--r-sm);
  border: 1px solid var(--border); background: var(--bg-inset);
  display: flex; flex-direction: column; gap: 1px;
}
.m3d-metric-k { font-size: var(--fs-caption); color: var(--text-tertiary); }
.m3d-metric-row { display: flex; align-items: baseline; gap: 3px; min-width: 0; }
.m3d-metric-v {
  font-family: var(--font-num); font-size: 19px; font-weight: 700; line-height: 1.25;
  color: var(--text-primary); font-variant-numeric: tabular-nums; letter-spacing: -.2px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.m3d-metric-u { flex: none; font-size: 11px; color: var(--text-tertiary); }

/* 不确定进度条：厂商不给百分比，就只画"在动"，不画假完成度 */
.m3d-flow { position: relative; height: 8px; margin: 14px 0 0; border-radius: var(--r-full); background: var(--bg-active); box-shadow: inset 0 1px 3px rgba(0, 0, 0, .25); overflow: hidden; }
.m3d-flow i {
  position: absolute; top: 0; bottom: 0; left: 0; width: 38%; border-radius: var(--r-full);
  background: var(--brand-grad-hi); box-shadow: 0 0 12px rgba(124, 124, 255, .5);
  animation: m3dSlide 1.9s ease-in-out infinite;
}
.m3d-flow b {
  position: absolute; inset: 0; background-size: 220% 100%;
  background-image: linear-gradient(100deg, transparent 32%, rgba(255, 255, 255, .35) 50%, transparent 68%);
  animation: m3dSweep 2.6s linear infinite;
}
.m3d-flow[data-kind="queue"] i { background: linear-gradient(90deg, var(--warning), #FDE68A); box-shadow: 0 0 12px rgba(251, 191, 36, .45); }
.m3d-note { margin: 11px 0 0; font-size: var(--fs-caption); line-height: 1.7; color: var(--text-tertiary); }

/* 生成中的旋转光球 */
.m3d-orb { position: relative; width: 76px; height: 76px; margin: 2px auto 14px; display: grid; place-items: center; }
.m3d-orb i {
  position: absolute; inset: 0; border-radius: 50%;
  background: conic-gradient(from 0deg, transparent 0 18%, var(--brand-500) 52%, var(--accent-cyan) 74%, transparent 100%);
  -webkit-mask: radial-gradient(circle, transparent 0 58%, #000 60%);
  mask: radial-gradient(circle, transparent 0 58%, #000 60%);
  animation: m3dSpin 2.1s linear infinite;
}
.m3d-orb span {
  display: grid; place-items: center; width: 52px; height: 52px; border-radius: 50%;
  background: var(--brand-soft); color: var(--brand-400); box-shadow: 0 0 26px var(--brand-soft);
  animation: m3dBeat 2.1s ease-in-out infinite;
}

/* 结果框：浅色网格底 + 四角标记 + 左上角产物标签 */
.m3d-result {
  position: relative; min-height: 200px; margin-top: 12px; border-radius: var(--r-md); overflow: hidden;
  border: 1px solid var(--border-strong); background-color: var(--bg-inset);
  background-image: linear-gradient(var(--border) 1px, transparent 1px), linear-gradient(90deg, var(--border) 1px, transparent 1px);
  background-size: 18px 18px;
}
.m3d-result-img { position: relative; display: block; width: 100%; max-height: 240px; object-fit: contain; background: #000; }
.m3d-result-video { position: relative; display: block; width: 100%; max-height: 260px; background: #000; }
.m3d-frame i { position: absolute; width: 14px; height: 14px; border: 2px solid var(--brand-400); opacity: .85; pointer-events: none; }
.m3d-frame i:nth-child(1) { left: 7px; top: 7px; border-right: none; border-bottom: none; border-radius: 4px 0 0 0; }
.m3d-frame i:nth-child(2) { right: 7px; top: 7px; border-left: none; border-bottom: none; border-radius: 0 4px 0 0; }
.m3d-frame i:nth-child(3) { left: 7px; bottom: 7px; border-right: none; border-top: none; border-radius: 0 0 0 4px; }
.m3d-frame i:nth-child(4) { right: 7px; bottom: 7px; border-left: none; border-top: none; border-radius: 0 0 4px 0; }
.m3d-tag-float {
  position: absolute; left: 28px; top: 8px; display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 9px; border-radius: var(--r-full); font-size: 11px;
  color: #fff; background: rgba(12, 15, 22, .72); border: 1px solid rgba(255, 255, 255, .14);
  backdrop-filter: blur(6px);
}
.m3d-ok-line { display: flex; align-items: center; gap: 7px; }
.m3d-ok-line svg { color: var(--success); }
.m3d-ok-line b { font-size: var(--fs-sm); font-weight: 650; color: var(--text-primary); }
.m3d-ok-line span { margin-left: auto; font-size: var(--fs-caption); color: var(--text-tertiary); }

.m3d-dl-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.m3d-open { margin-top: 12px; }
.m3d-dl { position: relative; overflow: hidden; flex: 1 1 auto; justify-content: center; }
.m3d-dl-row .btn-primary { box-shadow: var(--glow-brand); }
/* 主按钮划过一道高光，强调"这才是主操作" */
.m3d-dl-row .btn-primary::after {
  content: ''; position: absolute; inset: 0; transform: translateX(-100%); pointer-events: none;
  background: linear-gradient(100deg, transparent 30%, rgba(255, 255, 255, .45) 50%, transparent 70%);
}
.m3d-dl-row .btn-primary:hover::after { animation: m3dSheen .85s var(--ease-out); }

/* 整宽操作按钮（取消 / 再提交一次）：取消是排队中唯一的退出口，必须看着像可按的按钮 */
.m3d-act { width: 100%; justify-content: center; margin-top: 12px; border: 1px solid var(--border-strong); }
.m3d-act-danger:hover { border-color: var(--error); color: var(--error); background: var(--error-soft); }

/* 失败 / 取消说明卡：左侧一条强调色竖栏 */
.m3d-bad {
  position: relative; display: flex; align-items: flex-start; gap: 9px; overflow: hidden;
  margin-top: 12px; padding: 12px 12px 12px 15px; border-radius: var(--r-md);
  background: var(--error-soft); color: var(--error); font-size: var(--fs-caption); line-height: 1.6;
  animation: m3dRise .34s .07s var(--ease-out) both;
}
.m3d-bad::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--error); }
.m3d-bad > svg { margin-top: 1px; }
.m3d-bad div { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.m3d-bad b { font-size: var(--fs-sm); font-weight: 650; }
.m3d-bad span { color: var(--text-secondary); word-break: break-word; }
.m3d-bad-mute { background: var(--bg-inset); color: var(--text-secondary); }
.m3d-bad-mute::before { background: var(--text-tertiary); }
.m3d-bad-mute b { color: var(--text-primary); }
.m3d-refund { margin-top: 10px; font-size: var(--fs-caption); color: var(--warning); }
.m3d-refund.is-ok { color: var(--success); }

/* 未下单空态 */
.m3d-idle {
  display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 40px 16px; text-align: center;
  border: 1px dashed var(--border-strong); border-radius: var(--r-lg); background: var(--bg-inset);
  color: var(--text-tertiary);
}
.m3d-idle-badge { display: grid; place-items: center; width: 56px; height: 56px; margin-bottom: 4px; border-radius: 50%; background: var(--brand-soft); color: var(--brand-400); }
.m3d-idle b { font-size: var(--fs-sm); font-weight: 650; color: var(--text-primary); }
.m3d-idle p { margin: 0; font-size: var(--fs-caption); line-height: 1.75; }

@keyframes m3dRise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes m3dRing { 0% { transform: scale(1); opacity: .8; } 70%, 100% { transform: scale(2.7); opacity: 0; } }
@keyframes m3dBeat { 50% { transform: scale(1.1); } }
@keyframes m3dSpin { to { transform: rotate(360deg); } }
@keyframes m3dSlide { from { transform: translateX(-100%); } to { transform: translateX(263%); } }
@keyframes m3dSweep { from { background-position: 160% 0; } to { background-position: -160% 0; } }
@keyframes m3dSheen { from { transform: translateX(-100%); } to { transform: translateX(100%); } }

/* 系统里关了动效的人：只留静态样式，信息一条不少。
   注意流光条停掉后不能留在 38% 宽，否则看着像"已完成 38%"，改成整条常亮。 */
@media (prefers-reduced-motion: reduce) {
  .m3d-card, .m3d-panel, .m3d-bad, .m3d-idle,
  .m3d-live::after, .m3d-step.is-cur .m3d-step-dot,
  .m3d-orb i, .m3d-orb span, .m3d-dl-row .btn-primary:hover::after { animation: none; }
  .m3d-step-bar i, .m3d-step-dot, .m3d-dl { transition: none; }
  .m3d-flow b { display: none; }
  .m3d-flow i { width: 100%; opacity: .45; transform: none; }
}

/* ---------- 3D 演示页（view3d.js：实时查看器 + 素材类型选择） ---------- */
.v3d-lock { overflow: hidden; }
.v3d-mask {
  position: fixed; inset: 0; z-index: 1400;
  display: flex; flex-direction: column;
  background: var(--bg-page);
  animation: m3dRise .22s var(--ease-out);
}
.v3d-top {
  display: flex; align-items: center; gap: 10px; flex: none;
  height: 56px; padding: 0 14px;
  border-bottom: 1px solid var(--border); background: var(--bg-surface);
}
.v3d-top > svg { width: 18px; height: 18px; flex: none; color: var(--brand-400); }
.v3d-top b { font-size: var(--fs-body); font-weight: 650; max-width: 40%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.v3d-hint { font-size: var(--fs-caption); color: var(--text-tertiary); }
.v3d-tools { display: flex; gap: 6px; margin-left: auto; }
.v3d-tool {
  height: 30px; padding: 0 12px; border-radius: var(--r-full); cursor: pointer;
  border: 1px solid var(--border-strong); background: transparent; color: var(--text-secondary);
  font-size: var(--fs-caption); transition: all var(--dur-fast) var(--ease-out);
}
.v3d-tool:hover { color: var(--brand-400); border-color: var(--brand-500); }
.v3d-tool.is-on { color: var(--brand-400); border-color: var(--brand-500); background: var(--brand-soft); }
.v3d-x {
  display: grid; place-items: center; width: 32px; height: 32px; flex: none; margin-left: 4px;
  border: none; border-radius: var(--r-sm); background: transparent; color: var(--text-secondary); cursor: pointer;
}
.v3d-x svg { width: 18px; height: 18px; }
.v3d-x:hover { background: var(--bg-active); color: var(--text-primary); }

.v3d-body { display: grid; grid-template-columns: minmax(0, 1fr) 336px; flex: 1 1 auto; min-height: 0; }
.v3d-stage { position: relative; min-width: 0; min-height: 0; overflow: hidden; background: var(--bg-inset); }
.v3d-stage canvas { display: block; width: 100% !important; height: 100% !important; touch-action: none; }
.v3d-load {
  position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 10px; font-size: var(--fs-caption); color: var(--text-tertiary); pointer-events: none;
  transition: opacity var(--dur-base) ease;
}
.v3d-load.is-hidden { opacity: 0; }
.v3d-load i {
  width: 26px; height: 26px; border-radius: 50%;
  border: 2px solid var(--border-strong); border-top-color: var(--brand-500);
  animation: m3dSpin .9s linear infinite;
}
.v3d-fail { max-width: 320px; text-align: center; line-height: 1.7; pointer-events: auto; }

.v3d-side {
  display: flex; flex-direction: column; gap: 8px; min-height: 0; padding: 14px;
  border-left: 1px solid var(--border); background: var(--bg-surface); overflow-y: auto;
}
.v3d-side-h { font-size: var(--fs-caption); font-weight: 650; color: var(--text-secondary); }
.v3d-side-h-2 { margin-top: 6px; }
.v3d-list { display: flex; flex-direction: column; gap: 6px; }
.v3d-item {
  display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; cursor: pointer;
  padding: 9px 10px; border-radius: var(--r-sm);
  border: 1px solid var(--border); background: var(--bg-inset); color: var(--text-primary);
  transition: border-color var(--dur-fast) ease, background var(--dur-fast) ease, transform var(--dur-fast) var(--ease-out);
}
.v3d-item:hover { border-color: var(--brand-500); transform: translateX(-2px); }
.v3d-item.is-on { border-color: var(--brand-500); background: var(--brand-soft); }
.v3d-item-tag {
  flex: none; min-width: 44px; padding: 3px 6px; border-radius: var(--r-sm); text-align: center;
  font-size: 11px; font-weight: 700; letter-spacing: .3px;
  color: var(--brand-400); background: var(--brand-soft);
}
.v3d-item-tag-conv { color: var(--text-secondary); background: var(--bg-active); }
.v3d-item-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1 1 auto; }
.v3d-item-main b { font-size: var(--fs-sm); font-weight: 650; }
.v3d-item-main span { font-size: 11px; line-height: 1.5; color: var(--text-tertiary); }
.v3d-item-act { display: grid; place-items: center; width: 26px; height: 26px; flex: none; border-radius: var(--r-sm); color: var(--brand-400); }
.v3d-item-act svg { width: 15px; height: 15px; }
.v3d-item-act-conv { color: var(--text-secondary); }
.v3d-item-conv.is-busy { cursor: progress; opacity: .7; }
.v3d-item-conv.is-busy .v3d-item-act-conv { animation: m3dSpin .9s linear infinite; }
.v3d-note { font-size: 11px; line-height: 1.65; color: var(--text-tertiary); }
.v3d-err {
  padding: 8px 10px; border-radius: var(--r-sm); font-size: var(--fs-caption); line-height: 1.6;
  background: var(--error-soft); color: var(--error);
}

@media (max-width: 900px) {
  .v3d-body { grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(220px, 1fr) auto; }
  .v3d-side { border-left: none; border-top: 1px solid var(--border); max-height: 44vh; }
  .v3d-hint { display: none; }
  .v3d-top b { max-width: 34%; }
}

/* 历史页签：条头 + 行距（列表容器复用共享的 .his-list） */
.m3d-his-bar { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; font-size: var(--fs-caption); color: var(--text-tertiary); }
.his-list .m3d-row + .m3d-row { margin-top: 8px; }
.m3d-list-err { display: flex; align-items: center; gap: 6px; font-size: var(--fs-caption); color: var(--error); }
.m3d-empty { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 26px 0; color: var(--text-tertiary); text-align: center; }
.m3d-empty p { margin: 0; font-size: var(--fs-caption); }
.m3d-row {
  display: flex; align-items: center; gap: var(--sp-3);
  padding: 10px 12px; border-radius: var(--r-md);
  border: 1px solid var(--border); background: var(--bg-inset);
}
.m3d-row-cover { position: relative; flex: none; width: 56px; height: 56px; border-radius: var(--r-sm); overflow: hidden; background: var(--bg-elevated); }
.m3d-row-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.m3d-row-ph { display: flex; align-items: center; justify-content: center; width: 100%; height: 100%; color: var(--text-tertiary); }
.m3d-dot {
  position: absolute; top: 3px; right: 3px; width: 8px; height: 8px; border-radius: 50%;
  background: var(--accent-cyan); box-shadow: 0 0 0 2px rgba(0, 0, 0, .35);
}
.m3d-row-main { flex: 1 1 auto; min-width: 0; }
.m3d-row-name { font-size: var(--fs-sm); font-weight: 600; }
.m3d-row-sub { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 5px; font-size: var(--fs-caption); color: var(--text-tertiary); }
.m3d-row-err { margin-top: 4px; font-size: var(--fs-caption); color: var(--error); }
.m3d-row-acts { display: flex; flex: none; gap: 6px; }

/* 后台总开关关闭时的整页说明 */
.m3d-closed { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 56px 24px; text-align: center; color: var(--text-tertiary); }
.m3d-closed b { font-size: var(--fs-h3); color: var(--text-primary); }
.m3d-closed p { margin: 0; font-size: var(--fs-sm); line-height: 1.7; max-width: 420px; }

/* 我的作品 → 3D 预览弹窗：渲染预览图放在播放器上方，共用 wk-player/wk-modal-meta */
.wk3d-preview { margin-bottom: 12px; border-radius: var(--r-md); overflow: hidden; background: #000; text-align: center; }
.wk3d-preview img { display: block; width: 100%; max-height: 320px; object-fit: contain; }
.wk3d-note { margin-top: 10px; font-size: var(--fs-caption); color: var(--text-tertiary); }
@media (max-width: 720px) {
  .m3d-views .m3d-slot { height: 66px; }
  .m3d-single { grid-template-columns: minmax(0, 1fr); }
  .m3d-row-acts .btn { padding: 6px 8px; }
}
