/* 素材工单 · 样式 */
:root {
  --bg: #f7f7f9;
  --card: #ffffff;
  --text: #1d2130;
  --text-2: #42485c;
  --muted: #7c8396;
  --border: #e8e9ef;
  --soft: #f4f5f8;
  --primary: #ff5c35;
  --primary-dark: #e34a24;
  --primary-soft: #fff0eb;
  --primary-border: #ffcdbd;
  --teal: #0d9c9c;
  --teal-soft: #e8f7f6;
  --shadow: 0 5px 20px rgba(32, 38, 66, .055);
  --shadow-lg: 0 14px 38px rgba(32, 38, 66, .11);
  --radius: 15px;
  --radius-sm: 9px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0; min-height: 100vh; background: var(--bg); color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Segoe UI", Roboto, sans-serif;
  font-size: 14px; line-height: 1.6; -webkit-font-smoothing: antialiased;
}
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
h1, h2, h3, h4, p, ul, ol { margin: 0; }

.bg-deco { position: fixed; inset: 0; z-index: 0; overflow: hidden; pointer-events: none; }
.bg-deco i { position: absolute; display: block; border-radius: 50%; filter: blur(100px); opacity: .45; }
.bg-deco i:nth-child(1) { width: 400px; height: 400px; background: #ffe2d8; top: -170px; left: -110px; }
.bg-deco i:nth-child(2) { width: 340px; height: 340px; background: #dcf1f1; top: 260px; right: -170px; }
.bg-deco i:nth-child(3) { width: 300px; height: 300px; background: #fdeee0; bottom: -150px; left: 34%; }

/* 顶栏 */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between;
  height: 66px; padding: 0 clamp(18px, 4vw, 48px);
  background: rgba(255,255,255,.84); backdrop-filter: saturate(1.6) blur(14px);
  -webkit-backdrop-filter: saturate(1.6) blur(14px);
  border-bottom: 1px solid rgba(232,233,239,.9);
}
.brand { display: flex; align-items: center; gap: 11px; }
.brand-mark {
  width: 37px; height: 37px; border-radius: 10px; display: grid; place-items: center;
  background: linear-gradient(135deg, var(--primary), #ff8a4c); color: #fff;
  box-shadow: 0 5px 15px rgba(255,92,53,.26);
}
.brand-mark svg { width: 20px; height: 20px; }
.brand-text h1 { font-size: 17px; font-weight: 750; letter-spacing: .3px; line-height: 1.2; }
.brand-text p { font-size: 11px; color: var(--muted); margin-top: 2px; letter-spacing: .3px; }
.topbar-right { display: flex; align-items: center; gap: 12px; }
.badge {
  display: inline-flex; align-items: center; gap: 7px; padding: 6px 12px; border-radius: 999px;
  background: var(--primary-soft); color: var(--primary-dark); font-size: 12px; font-weight: 600;
}
.badge .dot { width: 6px; height: 6px; border-radius: 50%; background: #35c48a; box-shadow: 0 0 0 3px rgba(53,196,138,.15); }
.icon-btn {
  width: 33px; height: 33px; border-radius: 9px; border: 1px solid var(--border);
  background: #fff; color: var(--muted); display: grid; place-items: center; transition: .18s;
}
.icon-btn:hover { color: var(--primary); border-color: var(--primary-border); background: var(--primary-soft); }
.icon-btn svg { width: 17px; height: 17px; }

/* 布局 */
.layout {
  position: relative; z-index: 1; max-width: 1400px; margin: 0 auto;
  padding: 30px clamp(18px, 4vw, 48px) 60px;
  display: grid; grid-template-columns: minmax(0, 1fr) 430px; gap: 24px; align-items: start;
}
.hero { margin-bottom: 22px; }
.hero h2 { font-size: clamp(21px, 2.3vw, 28px); font-weight: 750; letter-spacing: -.4px; line-height: 1.35; }
.hero p { color: var(--muted); margin-top: 7px; font-size: 13.5px; }
.jump-result {
  display: none; margin-top: 12px; padding: 7px 13px; border-radius: 8px;
  border: 1px solid var(--primary-border); background: var(--primary-soft);
  color: var(--primary-dark); font-size: 12px; font-weight: 650;
}

.panel, .result-card, .side-card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow);
}
.panel { padding: 19px 21px; margin-bottom: 16px; }
.panel-head { display: flex; align-items: flex-start; gap: 11px; margin-bottom: 15px; }
.step {
  flex: none; width: 23px; height: 23px; border-radius: 7px;
  background: var(--primary-soft); color: var(--primary-dark);
  font-size: 12px; font-weight: 700; display: grid; place-items: center; margin-top: 2px;
}
.panel-title h3 { font-size: 14.5px; font-weight: 700; line-height: 1.35; }
.panel-title p { font-size: 12px; color: var(--muted); margin-top: 3px; }

/* 模式卡片 */
.mode-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 11px; }
.mode-card {
  position: relative; text-align: left; padding: 14px;
  border-radius: 12px; border: 1.5px solid var(--border); background: #fff;
  transition: .18s; min-height: 108px;
}
.mode-card:hover { border-color: var(--primary-border); transform: translateY(-2px); }
.mode-card.active { border-color: var(--primary); background: var(--primary-soft); box-shadow: 0 6px 18px rgba(255,92,53,.14); }
.mode-card .mc-icon {
  width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center;
  background: var(--soft); color: var(--muted); margin-bottom: 9px; transition: .18s;
}
.mode-card.active .mc-icon { background: #fff; color: var(--primary); }
.mode-card .mc-icon svg { width: 17px; height: 17px; }
.mode-card h4 { font-size: 13.5px; font-weight: 700; }
.mode-card p { font-size: 11.5px; color: var(--muted); line-height: 1.55; margin-top: 4px; }
.mode-card .mc-check {
  position: absolute; top: 11px; right: 11px; width: 17px; height: 17px; border-radius: 50%;
  background: var(--primary); color: #fff; display: none; place-items: center; font-size: 11px; font-weight: 700;
}
.mode-card.active .mc-check { display: grid; }

/* 预设 */
.preset-bar {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 13px 16px; margin-bottom: 16px;
  background: #fff; border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow);
}
.preset-label { font-size: 12px; font-weight: 650; color: var(--text-2); white-space: nowrap; }
.preset-chips { display: flex; flex-wrap: wrap; gap: 7px; }
.preset-chip {
  padding: 6px 11px; border-radius: 999px; border: 1px dashed #d9dbe6;
  background: #fbfbfd; color: var(--text-2); font-size: 12px; transition: .18s;
}
.preset-chip:hover { border-style: solid; border-color: var(--primary); color: var(--primary-dark); background: var(--primary-soft); }

/* 导入 */
.import-panel { padding: 15px 19px; }
.import-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.import-head h3 { font-size: 13.5px; font-weight: 700; }
.import-head p { font-size: 11.5px; color: var(--muted); margin-top: 3px; line-height: 1.55; }
.mini-btn {
  flex: none; padding: 6px 12px; border-radius: 8px; border: 1px solid var(--border);
  background: #fff; color: var(--text-2); font-size: 12px; font-weight: 600; transition: .18s;
}
.mini-btn:hover { border-color: var(--primary-border); color: var(--primary-dark); background: var(--primary-soft); }
.import-panel textarea { margin-top: 12px; min-height: 118px; }
.import-actions { display: flex; align-items: center; gap: 8px; margin-top: 9px; flex-wrap: wrap; }
.import-result { font-size: 11.5px; color: var(--teal); }

/* 表单通用 */
.inline-note { font-size: 11.5px; color: var(--muted); line-height: 1.65; }
.field-label { display: block; font-size: 12px; font-weight: 650; color: var(--text-2); margin: 13px 0 7px; }
.field-label:first-child { margin-top: 0; }
.chips { display: flex; flex-wrap: wrap; gap: 7px; }
.chip {
  padding: 6px 11px; border-radius: 8px; border: 1px solid var(--border);
  background: #fff; font-size: 12.5px; color: var(--text-2); transition: .16s; line-height: 1.45;
}
.chip:hover { border-color: var(--primary-border); background: #fffaf8; }
.chip.selected { border-color: var(--primary); background: var(--primary); color: #fff; font-weight: 600; box-shadow: 0 4px 10px rgba(255,92,53,.2); }
.chip.selected:hover { filter: brightness(1.04); }
.chip.teal.selected { background: var(--teal); border-color: var(--teal); box-shadow: 0 4px 10px rgba(13,156,156,.2); }
textarea.input, input.input, select.input {
  width: 100%; padding: 10px 12px; border-radius: var(--radius-sm);
  border: 1px solid var(--border); background: #fbfbfd; font-size: 12.5px;
  line-height: 1.65; transition: .18s;
}
textarea.input { resize: vertical; min-height: 76px; }
input.input { min-height: 38px; }
textarea.input::placeholder, input.input::placeholder { color: #a8adbd; }
textarea.input:focus, input.input:focus, select.input:focus {
  outline: none; border-color: var(--primary); background: #fff; box-shadow: 0 0 0 3px rgba(255,92,53,.1);
}
.hint-line { font-size: 11.5px; color: var(--muted); margin-top: 8px; line-height: 1.6; }

/* 参考附件 */
.ref-list { display: flex; flex-direction: column; gap: 9px; }
.ref-row { display: grid; grid-template-columns: 56px minmax(0, 1fr) minmax(0, 1fr) 30px; gap: 8px; align-items: center; }
.ref-type {
  height: 38px; border-radius: 8px; display: grid; place-items: center;
  font-size: 11.5px; font-weight: 650; background: var(--primary-soft); color: var(--primary-dark);
}
.ref-type.image { background: var(--teal-soft); color: var(--teal); }
.ref-name-wrap { position: relative; }
.ref-name-wrap input { padding-right: 66px; }
.pick-btn {
  position: absolute; right: 5px; top: 5px; height: 28px; padding: 0 8px;
  border: 0; border-radius: 6px; background: #eef0f6; color: var(--text-2);
  font-size: 11px; font-weight: 600; transition: .16s;
}
.pick-btn:hover { background: var(--primary-soft); color: var(--primary-dark); }
.ref-del {
  width: 30px; height: 30px; border-radius: 8px; border: 1px solid var(--border);
  background: #fff; color: var(--muted); display: grid; place-items: center; font-size: 16px; line-height: 1;
}
.ref-del:hover { color: #d4524b; border-color: #f0c4c0; background: #fff5f4; }
.ref-adds { display: flex; gap: 8px; margin-top: 11px; flex-wrap: wrap; }
.add-btn {
  display: inline-flex; align-items: center; gap: 5px; padding: 7px 12px;
  border-radius: 8px; border: 1px dashed #d5d7e3; background: #fbfbfd;
  color: var(--text-2); font-size: 12px; font-weight: 600; transition: .16s;
}
.add-btn:hover { border-color: var(--primary); color: var(--primary-dark); background: var(--primary-soft); }
.ref-empty { font-size: 12px; color: var(--muted); padding: 8px 0; }

/* 改动清单 */
.item-list { display: flex; flex-direction: column; gap: 10px; }
.item-card { border: 1px solid var(--border); border-radius: 11px; background: #fcfcfe; overflow: hidden; }
.item-card.disabled { opacity: .5; }
.item-head { display: flex; align-items: center; gap: 8px; padding: 9px 12px; background: #f6f7fb; border-bottom: 1px solid var(--border); }
.item-num { width: 20px; height: 20px; border-radius: 6px; background: var(--primary); color: #fff; font-size: 11px; font-weight: 700; display: grid; place-items: center; flex: none; }
.item-type { font-size: 12px; font-weight: 700; color: var(--text-2); flex: 1; }
.item-ctrl { display: flex; gap: 4px; align-items: center; }
.ic-btn {
  width: 26px; height: 26px; border-radius: 6px; border: 1px solid var(--border);
  background: #fff; color: var(--muted); font-size: 13px; line-height: 1; display: grid; place-items: center;
}
.ic-btn:hover { border-color: var(--primary-border); color: var(--primary-dark); }
.ic-btn.on { background: var(--teal-soft); border-color: #b9e3e0; color: var(--teal); }
.ic-btn.danger:hover { color: #d4524b; border-color: #f0c4c0; }
.item-body { padding: 11px 12px 12px; }
.item-body .field-label { margin: 10px 0 6px; }
.item-body .field-label:first-child { margin-top: 0; }
.item-row { display: flex; gap: 7px; align-items: center; }
.item-row .input { flex: 1; min-width: 0; }
.item-arrow { color: var(--muted); font-size: 13px; flex: none; }
.quick-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.quick-chips button {
  padding: 4px 9px; border-radius: 7px; border: 1px dashed #d9dbe6;
  background: #fff; color: var(--text-2); font-size: 11.5px;
}
.quick-chips button:hover { border-style: solid; border-color: var(--primary); color: var(--primary-dark); background: var(--primary-soft); }
.add-item-bar { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; margin-top: 13px; padding-top: 13px; border-top: 1px dashed var(--border); }
.add-item-bar > span { font-size: 12px; color: var(--muted); }
#quickAdd { display: flex; flex-wrap: wrap; gap: 6px; }
#quickAdd button {
  padding: 6px 10px; border-radius: 8px; border: 1px solid var(--border);
  background: #fff; font-size: 12px; color: var(--text-2); transition: .16s;
}
#quickAdd button:hover { border-color: var(--primary); color: var(--primary-dark); background: var(--primary-soft); }

/* 脚本与结尾 */
.script-tools { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 9px; }
.script-tag {
  padding: 5px 10px; border-radius: 7px; border: 1px solid var(--border);
  background: #fff; color: var(--text-2); font-size: 11.5px; transition: .16s;
}
.script-tag:hover { border-color: var(--primary-border); color: var(--primary-dark); background: var(--primary-soft); }
.switch-row {
  display: flex; align-items: flex-start; gap: 10px; margin-top: 13px;
  padding: 11px 13px; border-radius: 10px; background: var(--teal-soft); cursor: pointer;
}
.switch-row input { margin: 3px 0 0; accent-color: var(--teal); width: 15px; height: 15px; flex: none; }
.switch-row b { font-size: 12.5px; color: #0b6f74; }
.switch-row p { font-size: 11.5px; color: #438a8e; line-height: 1.6; margin-top: 2px; }
.ending-box { margin-top: 15px; padding: 12px 13px; border-radius: 10px; background: var(--soft); }

/* 参数 */
.param-row { display: flex; flex-wrap: wrap; gap: 20px; }
.param-group { min-width: 190px; }
.param-group > label { display: block; font-size: 12px; font-weight: 650; color: var(--text-2); margin-bottom: 8px; }
.param-options { display: flex; flex-wrap: wrap; gap: 6px; }
.param-option {
  padding: 6px 11px; border-radius: 8px; border: 1px solid var(--border);
  background: #fff; font-size: 12px; color: var(--text-2); transition: .16s;
}
.param-option:hover { border-color: var(--primary-border); }
.param-option.active { background: var(--primary-soft); border-color: var(--primary-border); color: var(--primary-dark); font-weight: 650; }

/* 结果区 */
.preview { position: sticky; top: 84px; display: flex; flex-direction: column; gap: 14px; }
.result-card { padding: 18px; }
.result-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; margin-bottom: 12px; }
.result-head h3 { font-size: 14.5px; font-weight: 700; }
.result-head p { font-size: 11.5px; color: var(--muted); margin-top: 2px; }
.word-count { font-size: 11.5px; color: var(--muted); background: var(--soft); padding: 3px 9px; border-radius: 6px; white-space: nowrap; }
.form-switch { display: grid; grid-template-columns: repeat(3, 1fr); gap: 5px; padding: 4px; border-radius: 10px; background: var(--soft); margin-bottom: 11px; }
.form-switch button {
  padding: 7px 4px; border: 0; border-radius: 7px; background: transparent;
  font-size: 12.5px; font-weight: 650; color: var(--muted); line-height: 1.4; transition: .16s;
}
.form-switch button span { display: block; font-size: 10.5px; font-weight: 400; opacity: .8; margin-top: 1px; }
.form-switch button.active { background: #fff; color: var(--primary-dark); box-shadow: 0 1px 6px rgba(32,38,66,.09); }
.form-switch button.active span { color: var(--primary); opacity: 1; }
.edit-status {
  display: flex; align-items: center; gap: 7px; flex-wrap: wrap;
  padding: 8px 11px; border-radius: 8px; margin-bottom: 9px;
  background: var(--teal-soft); font-size: 11.5px; color: #0b6f74;
}
.edit-status.manual { background: var(--primary-soft); color: var(--primary-dark); }
.es-dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex: none; }
#editStatusText { flex: 1; min-width: 140px; }
#resumeBtn { border: 0; background: #fff; color: var(--primary-dark); padding: 3px 9px; border-radius: 6px; font-size: 11px; font-weight: 650; }
#resumeBtn:hover { background: #ffe3d8; }
.result-editor {
  width: 100%; min-height: 400px; max-height: 620px; height: 400px;
  padding: 14px 15px; border-radius: 11px; border: 1px solid #eceef4;
  background: linear-gradient(165deg, #fbfbfd, #f6f7fb);
  font-family: inherit; font-size: 12.5px; line-height: 1.9; color: var(--text-2);
  resize: vertical; white-space: pre-wrap; word-break: break-word;
}
.result-editor:focus { outline: none; border-color: var(--primary-border); background: #fff; box-shadow: 0 0 0 3px rgba(255,92,53,.08); }
.result-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 13px; }
.result-actions .btn-primary { flex: 1 1 100%; }
.result-actions .btn-ghost { flex: 1 1 auto; padding: 0 10px; }
.btn-primary, .btn-ghost {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 40px; padding: 0 14px; border-radius: 9px; font-size: 12.5px; font-weight: 650; transition: .18s; white-space: nowrap;
}
.btn-primary { border: 0; background: linear-gradient(135deg, var(--primary), #ff8348); color: #fff; box-shadow: 0 6px 16px rgba(255,92,53,.24); }
.btn-primary:hover { filter: brightness(1.05); transform: translateY(-1px); }
.btn-primary svg { width: 16px; height: 16px; }
.btn-primary.wide { width: 100%; margin-top: 18px; }
.btn-primary.slim, .btn-ghost.slim { height: 32px; font-size: 12px; padding: 0 13px; }
.btn-ghost { border: 1px solid var(--border); background: #fff; color: var(--text-2); }
.btn-ghost:hover { border-color: var(--primary-border); color: var(--primary-dark); background: var(--primary-soft); }
.result-hint { font-size: 11.5px; color: var(--muted); margin-top: 11px; line-height: 1.6; }

/* 版本 */
.side-card { padding: 16px 18px; }
.side-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 11px; }
.side-head h3 { font-size: 13.5px; font-weight: 700; }
.side-head span { font-size: 11px; color: var(--muted); }
.version-list { display: flex; flex-direction: column; gap: 7px; max-height: 210px; overflow-y: auto; }
.version-item { display: flex; align-items: flex-start; gap: 8px; padding: 9px 10px; border-radius: 9px; background: var(--soft); }
.version-main { flex: 1; min-width: 0; cursor: pointer; }
.version-main b { display: block; font-size: 11.5px; color: var(--text-2); }
.version-main span { display: block; font-size: 11px; color: var(--muted); margin-top: 2px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.version-del { border: 0; background: transparent; color: var(--muted); font-size: 15px; line-height: 1; padding: 2px 4px; }
.version-del:hover { color: #d4524b; }
.version-empty { font-size: 11.5px; color: var(--muted); }
.tips-card ul { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; }
.tips-card li { font-size: 11.5px; color: var(--text-2); line-height: 1.6; padding-left: 13px; position: relative; }
.tips-card li::before { content: ''; position: absolute; left: 0; top: 8px; width: 5px; height: 5px; border-radius: 50%; background: var(--primary); }
.privacy-note { text-align: center; font-size: 11px; color: #9aa0b0; }

/* 弹窗 & toast */
.modal { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 20px; }
.modal[hidden] { display: none; }
.modal-mask { position: absolute; inset: 0; background: rgba(24,28,50,.45); backdrop-filter: blur(3px); }
.modal-card { position: relative; width: min(100%, 470px); background: #fff; border-radius: 17px; padding: 23px; box-shadow: var(--shadow-lg); }
.modal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 17px; }
.modal-head h3 { font-size: 17px; font-weight: 700; }
.help-steps { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 12px; }
.help-steps li { display: flex; gap: 11px; align-items: flex-start; }
.help-steps strong { flex: none; min-width: 56px; text-align: center; background: var(--primary-soft); color: var(--primary-dark); padding: 4px 8px; border-radius: 7px; font-size: 12px; }
.help-steps span { font-size: 12.5px; color: var(--text-2); line-height: 1.65; }
.help-tip { margin-top: 17px; padding: 12px 14px; border-radius: 10px; background: var(--teal-soft); }
.help-tip strong { font-size: 12.5px; color: #0b6f74; }
.help-tip p { font-size: 12px; color: #438a8e; line-height: 1.7; margin-top: 4px; }
.toast {
  position: fixed; left: 50%; bottom: 30px; transform: translate(-50%, 20px);
  padding: 10px 18px; border-radius: 10px; background: #22263a; color: #fff;
  font-size: 13px; box-shadow: var(--shadow-lg); opacity: 0; pointer-events: none; transition: .25s; z-index: 100;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* 快捷开始（可选入口） */
.start-card {
  padding: 15px 18px; margin-bottom: 16px;
  background: #fff; border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow);
}
.start-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.start-title h3 { font-size: 13.5px; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.start-title p { font-size: 11.5px; color: var(--muted); margin-top: 4px; line-height: 1.6; }
.optional-tag {
  font-size: 10.5px; font-weight: 600; padding: 2px 8px; border-radius: 999px;
  background: var(--soft); color: var(--muted); border: 1px solid var(--border);
}
.start-card .mini-btn { background: #fff; }
.start-card textarea { margin-top: 12px; min-height: 110px; }
.start-card .import-actions { margin-top: 9px; }
.panel-title { flex: 1; min-width: 0; }
.head-sub { font-size: 10.5px; font-weight: 600; color: var(--primary-dark); background: var(--primary-soft); padding: 2px 7px; border-radius: 6px; vertical-align: 2px; margin-left: 4px; }
.head-btn { margin-top: 1px; }

/* 复刻程度 */
.fidelity-box { margin-top: 14px; padding-top: 14px; border-top: 1px dashed var(--border); }
.fidelity-label { font-size: 12px; font-weight: 700; color: var(--text-2); margin-bottom: 9px; }
.fidelity-label span { font-weight: 400; color: var(--muted); font-size: 11px; margin-left: 6px; }
.fidelity-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.fidelity-card {
  text-align: left; padding: 10px 11px; border-radius: 10px;
  border: 1.5px solid var(--border); background: #fbfbfd; transition: .16s;
}
.fidelity-card:hover { border-color: var(--primary-border); }
.fidelity-card.active { border-color: var(--primary); background: var(--primary-soft); }
.fidelity-card b { display: block; font-size: 12.5px; font-weight: 700; color: var(--text-2); }
.fidelity-card.active b { color: var(--primary-dark); }
.fidelity-card span { display: block; font-size: 11px; color: var(--muted); line-height: 1.55; margin-top: 3px; }
.fidelity-tip { font-size: 11.5px; color: var(--teal); margin-top: 9px; line-height: 1.6; }

/* 改动项：关联附件 */
.item-ref { margin-top: 11px; padding-top: 10px; border-top: 1px dashed var(--border); }
.item-ref label { display: block; font-size: 11.5px; font-weight: 600; color: var(--muted); margin-bottom: 6px; }
.item-ref select { min-height: 34px; padding: 6px 10px; font-size: 12px; }

/* 文案区引导 */
.tail-lead {
  font-size: 11.5px; line-height: 1.65; color: var(--muted);
  background: var(--soft); border-radius: 8px; padding: 8px 11px; margin-bottom: 13px;
}
.tail-lead.focus { background: var(--teal-soft); color: #0b6f74; font-weight: 600; }

/* 输出参数：自定义时长 */
.duration-group { min-width: 100%; }
.custom-duration { display: flex; align-items: center; gap: 10px; margin-top: 9px; flex-wrap: wrap; }
.custom-duration[hidden] { display: none; }
.custom-duration .input { width: 220px; min-height: 34px; }
.custom-duration span { font-size: 11px; color: var(--muted); line-height: 1.5; flex: 1; min-width: 180px; }
.param-note { font-size: 11.5px; color: var(--muted); margin-top: 12px; line-height: 1.6; }

/* 发送前检查 */
.check-card .side-head span { font-size: 10.5px; }
.check-row { display: flex; align-items: flex-start; gap: 8px; font-size: 11.5px; line-height: 1.6; padding: 4px 0; color: var(--text-2); }
.check-row > span {
  flex: none; width: 16px; height: 16px; border-radius: 50%; display: grid; place-items: center;
  font-size: 10px; font-weight: 700; margin-top: 1px;
}
.check-row.ok > span { background: var(--teal-soft); color: var(--teal); }
.check-row.warn > span { background: var(--primary-soft); color: var(--primary-dark); }
.check-row.warn { color: var(--primary-dark); }

/* 我的常用搭配 */
.combo-bar { margin-top: 15px; padding-top: 14px; border-top: 1px dashed var(--border); }
.combo-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.combo-title h4 { font-size: 12.5px; font-weight: 700; display: flex; align-items: center; gap: 7px; }
.combo-title h4 span { font-size: 10.5px; font-weight: 600; color: var(--muted); background: var(--soft); padding: 2px 7px; border-radius: 999px; }
.combo-title p { font-size: 11px; color: var(--muted); margin-top: 3px; line-height: 1.55; }
.combo-actions { display: flex; gap: 6px; flex: none; }
.combo-actions .mini-btn { background: #fff; font-size: 11.5px; padding: 5px 10px; }
#comboChips { display: flex; flex-wrap: wrap; gap: 7px; }
.combo-chip-wrap { display: inline-flex; align-items: stretch; }
.combo-chip {
  text-align: left; padding: 6px 11px; border-radius: 8px 0 0 8px;
  border: 1px solid #cfe8e6; border-right: 0; background: var(--teal-soft);
  color: #0b6f74; font-size: 12px; font-weight: 650; transition: .16s;
}
.combo-chip:hover { background: #d7f0ee; }
.combo-chip.is-default { border-color: var(--primary-border); background: var(--primary-soft); color: var(--primary-dark); }
.combo-chip em { font-style: normal; font-size: 10px; font-weight: 600; margin-left: 6px; padding: 1px 5px; border-radius: 5px; background: rgba(255,255,255,.75); }
.combo-chip span { display: block; font-size: 10.5px; font-weight: 400; opacity: .8; margin-top: 1px; }
.combo-del {
  padding: 0 8px; border-radius: 0 8px 8px 0; border: 1px solid #cfe8e6; border-left: 0;
  background: var(--teal-soft); color: #6aa5a5; font-size: 14px; line-height: 1;
}
.combo-del:hover { color: #d4524b; background: #fff5f4; }
.combo-empty { font-size: 11.5px; color: var(--muted); }
.combo-panel { margin-top: 10px; padding: 11px 12px; border-radius: 10px; background: var(--soft); }
.combo-panel[hidden] { display: none; }
.combo-panel .input { background: #fff; }
.combo-panel textarea { min-height: 88px; font-size: 11.5px; }
.combo-default { display: flex; align-items: center; gap: 7px; font-size: 11.5px; color: var(--text-2); margin-top: 9px; cursor: pointer; }
.combo-default input { accent-color: var(--primary); width: 14px; height: 14px; }
.combo-panel-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.combo-hint { font-size: 10.5px; color: var(--muted); }

/* 批量加图 */
.batch-label { font-size: 11.5px; color: var(--muted); margin-left: 4px; }
.add-btn.batch { border-style: solid; background: #fff; }

/* 分镜台词行 */
.shots-box { padding: 12px 13px; border-radius: 10px; background: var(--teal-soft); margin-bottom: 14px; }
.shots-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.shots-head b { font-size: 12.5px; color: #0b6f74; }
.shots-head p { font-size: 11px; color: #438a8e; margin-top: 3px; line-height: 1.55; }
.shots-head .add-btn { background: #fff; flex: none; }
.shots-empty { font-size: 11.5px; color: #438a8e; line-height: 1.6; padding: 4px 0 6px; }
.shots-box .hint-line { color: #438a8e; margin-top: 9px; }
.shot-row { background: #fff; border: 1px solid #cfe8e6; border-radius: 9px; padding: 9px 10px; margin-bottom: 8px; }
.shot-top { display: flex; align-items: center; gap: 7px; }
.shot-num { flex: none; width: 19px; height: 19px; border-radius: 6px; background: var(--teal); color: #fff; font-size: 10.5px; font-weight: 700; display: grid; place-items: center; }
.shot-top .input { flex: 1; min-width: 0; min-height: 32px; padding: 6px 9px; font-size: 12px; }
.shot-ctrl { display: flex; gap: 3px; flex: none; }
.shot-ctrl .ic-btn { width: 23px; height: 23px; font-size: 12px; }
.shot-line { margin-top: 7px; min-height: 32px; padding: 6px 9px; font-size: 12px; }

/* 顶层任务切换：先清图，再成片 */
.task-switch { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 8px; }
.task-tab {
  display: flex; align-items: center; gap: 11px; text-align: left;
  padding: 13px 15px; border-radius: 12px; border: 1.5px solid var(--border);
  background: #fff; transition: .18s;
}
.task-tab:hover { border-color: var(--primary-border); transform: translateY(-1px); }
.task-tab.active { border-color: var(--primary); background: var(--primary-soft); box-shadow: 0 6px 18px rgba(255,92,53,.12); }
.tt-icon {
  flex: none; width: 34px; height: 34px; border-radius: 9px;
  display: grid; place-items: center; background: var(--soft); color: var(--muted);
}
.tt-icon svg { width: 18px; height: 18px; }
.task-tab.active .tt-icon { background: #fff; color: var(--primary); }
.tt-text b { display: block; font-size: 13.5px; font-weight: 700; }
.task-tab.active .tt-text b { color: var(--primary-dark); }
.tt-text em { display: block; font-style: normal; font-size: 11.5px; color: var(--muted); margin-top: 3px; line-height: 1.5; }
.task-note { font-size: 11.5px; color: var(--muted); margin: 0 0 16px; line-height: 1.6; padding-left: 3px; }
.panel[hidden] { display: none; }

/* 一站式串联按钮 */
.btn-next {
  display: inline-flex; align-items: center; justify-content: center;
  height: 40px; width: 100%; flex: 1 1 100%; border-radius: 9px;
  border: 1px solid #b9e3e0; background: var(--teal-soft); color: #0b6f74;
  font-size: 12.5px; font-weight: 700; transition: .18s;
}
.btn-next:hover { background: #d7f0ee; }
.btn-next[hidden] { display: none; }

/* 图片处理：作用图片范围 */
.scope-row {
  display: grid; grid-template-columns: 1fr 1fr; gap: 9px;
  margin-top: 11px; padding-top: 10px; border-top: 1px dashed var(--border);
}
.scope-cell label { display: block; font-size: 11.5px; font-weight: 600; color: var(--muted); margin-bottom: 5px; }
.scope-cell select { min-height: 34px; padding: 6px 9px; font-size: 12px; }
.item-scope {
  font-size: 10.5px; font-weight: 650; color: var(--teal);
  background: var(--teal-soft); padding: 2px 7px; border-radius: 6px;
}

/* 图片处理：输出规格 */
.spec-box > label { display: block; font-size: 12px; font-weight: 650; color: var(--text-2); margin-bottom: 9px; }
.spec-box .hint-line { margin-top: 10px; }

/* ===== 本地素材预览 / 对照板 ===== */
.ref-type { position: relative; overflow: hidden; cursor: pointer; transition: .16s; }
.ref-type:hover { filter: brightness(.97); box-shadow: inset 0 0 0 1px rgba(255,92,53,.35); }
.ref-type.has-thumb { color: #fff; text-shadow: 0 1px 4px rgba(0,0,0,.8); }
.ref-type.has-thumb::after {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(180deg, rgba(0,0,0,.04), rgba(0,0,0,.45));
}
.pv-inline-thumb { position: absolute; inset: 0; display: block; }
.pv-inline-thumb img, .pv-inline-thumb video { width: 100%; height: 100%; object-fit: cover; display: block; }

.pv-board {
  margin-top: 14px; border: 1px solid #dfe9ed; border-radius: 12px;
  background: linear-gradient(180deg, #fbfeff, #f7fbfc); overflow: hidden;
}
.pv-head {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 10px 12px; background: #f1fafb; border-bottom: 1px solid #e4eef1;
}
.pv-title { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.pv-title b { font-size: 12.5px; color: #0b6f74; }
.pv-title span {
  font-size: 10.5px; color: #5c9296; background: #fff;
  border: 1px solid #cfe8e6; padding: 2px 7px; border-radius: 999px;
}
.pv-tools { display: flex; gap: 6px; flex-wrap: wrap; }
.pv-tools button {
  border: 1px solid #cfe0e4; background: #fff; color: #3c6a70;
  font-size: 11px; padding: 4px 9px; border-radius: 7px; white-space: nowrap;
}
.pv-tools button:hover { border-color: var(--primary); color: var(--primary-dark); background: var(--primary-soft); }
.pv-tools button[hidden] { display: none; }
.pv-body { padding: 10px 12px 12px; }
.pv-lead { font-size: 11.5px; color: #58787e; line-height: 1.6; margin-bottom: 10px; }
.pv-foot { font-size: 10.5px; color: #8ba0a8; line-height: 1.6; margin-top: 10px; }
.pv-foot b { color: var(--primary-dark); }
.pv-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); gap: 9px; }
.pv-empty { grid-column: 1 / -1; font-size: 11.5px; color: #7f979d; padding: 12px 4px; }
.pv-card {
  border: 1px solid #e3eaee; border-radius: 10px; background: #fff;
  overflow: hidden; display: flex; flex-direction: column; min-width: 0;
}
.pv-card.empty { border-style: dashed; }
.pv-thumb {
  position: relative; aspect-ratio: 4 / 3; background: #e9eff2;
  display: grid; place-items: center; cursor: pointer; overflow: hidden;
  isolation: isolate;
}
.pv-thumb:hover { filter: brightness(.97); }
/* 模糊底：竖屏素材完整显示时，左右留白不会是死白一块 */
.pv-thumb::before {
  content: ''; position: absolute; inset: -10%; z-index: 0;
  background-image: var(--pv-bg); background-size: cover; background-position: center;
  filter: blur(16px) saturate(.85); opacity: .34; transform: scale(1.06);
  pointer-events: none;
}
.pv-thumb img, .pv-thumb video {
  position: relative; z-index: 1;
  width: 100%; height: 100%; object-fit: contain; display: block;
}
.pv-board.fit-contain .pv-thumb { aspect-ratio: var(--pv-ar, 1.3333); }
.pv-board.fit-fill .pv-thumb { aspect-ratio: 4 / 3; }
.pv-board.fit-fill .pv-thumb img, .pv-board.fit-fill .pv-thumb video { object-fit: cover; }
.pv-board.fit-fill .pv-thumb::before { opacity: 0; }
.pv-num {
  position: absolute; z-index: 2; left: 5px; top: 5px; background: rgba(24,30,48,.8);
  color: #fff; font-size: 10px; font-weight: 650; padding: 2px 6px; border-radius: 5px;
}
.pv-play {
  position: absolute; z-index: 2; inset: 0; margin: auto; width: 30px; height: 30px;
  border-radius: 50%; background: rgba(24,30,48,.62); color: #fff;
  display: grid; place-items: center; font-size: 12px; pointer-events: none;
}
.pv-ph { position: relative; z-index: 2; display: grid; place-items: center; gap: 4px; color: #a9b6bd; pointer-events: none; }
.pv-ph svg { width: 22px; height: 22px; }
.pv-ph em { font-style: normal; font-size: 10.5px; }
.pv-meta { padding: 6px 8px 3px; display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.pv-meta b, .pv-meta span, .pv-meta em {
  overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-style: normal;
}
.pv-meta b {
  font-size: 11px; color: var(--text-2);
  white-space: normal; display: -webkit-box; -webkit-line-clamp: 2;
  -webkit-box-orient: vertical; line-height: 1.35; word-break: break-all;
}
.pv-meta span { font-size: 10.5px; color: var(--muted); }
.pv-meta em { font-size: 10px; color: #8ba0a8; }
.pv-card-acts { display: flex; gap: 3px; padding: 5px 6px 7px; margin-top: auto; }
.pv-card-acts button {
  border: 1px solid #e3eaee; background: #fafcfd; color: #4a7076;
  font-size: 10px; padding: 3px 4px; border-radius: 6px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0;
}
.pv-card-acts button:hover { border-color: var(--primary-border); color: var(--primary-dark); background: var(--primary-soft); }
.pv-card-acts button:first-child { flex: 2 1 auto; }
.pv-card-acts button:not(:first-child) { flex: 0 0 22px; }

/* 浮起：钉在左下角，边填单边看画面 */
.pv-board.floating {
  position: fixed; left: 18px; bottom: 18px; width: 330px; max-height: 66vh; z-index: 45;
  display: flex; flex-direction: column; border-color: #c8dfe3; box-shadow: var(--shadow-lg);
}
.pv-board.floating .pv-body { overflow-y: auto; }
.pv-board.floating .pv-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.pv-board.floating.collapsed .pv-body { display: none; }
.pv-drag-over { outline: 2px dashed var(--primary); outline-offset: 4px; background: #fffaf8; }

/* 灯箱：大图 / 视频 / 取位置 */
.pv-lightbox { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; padding: 22px; }
.pv-lightbox[hidden] { display: none; }
.pv-lb-mask { position: absolute; inset: 0; background: rgba(20,24,42,.72); backdrop-filter: blur(4px); }
.pv-lb-card {
  position: relative; width: min(100%, 900px); max-height: 92vh;
  display: flex; flex-direction: column; background: #fff;
  border-radius: 16px; box-shadow: var(--shadow-lg); overflow: hidden;
}
.pv-lb-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 16px; border-bottom: 1px solid var(--border);
}
.pv-lb-head b { font-size: 13.5px; font-weight: 700; color: var(--text); }
.pv-lb-head span { display: block; font-size: 11px; color: var(--muted); margin-top: 2px; }
.pv-lb-close {
  border: 1px solid var(--border); background: #fff; color: var(--muted);
  width: 30px; height: 30px; border-radius: 8px; font-size: 20px; line-height: 1;
}
.pv-lb-close:hover { color: #d4524b; border-color: #f0c4c0; background: #fff5f4; }
.pv-lb-stage {
  position: relative; flex: 1; min-height: 300px; padding: 14px;
  background: repeating-conic-gradient(#edf2f5 0% 25%, #f7f9fb 0% 50%) 50% / 22px 22px;
  display: grid; place-items: center; overflow: hidden;
}
.pv-lb-media { position: relative; display: inline-block; max-width: 100%; line-height: 0; border-radius: 8px; }
.pv-lb-media > img, .pv-lb-media > video {
  display: block; width: auto; height: auto;
  max-width: 100%; max-height: 60vh; object-fit: contain;
  background: #1d2130; border-radius: 8px;
}
.pv-lb-media > img { background: #fff; }
.pv-lb-media > img[hidden], .pv-lb-media > video[hidden] { display: none; }
.pv-lb-media.picking > img, .pv-lb-media.picking > video { pointer-events: none; }
.pv-lb-empty { font-size: 12.5px; color: var(--muted); text-align: center; line-height: 1.7; padding: 30px 12px; }
.pv-lb-empty[hidden] { display: none; }
.pv-lb-marker {
  position: absolute; z-index: 5; width: 16px; height: 16px; border: 2px solid #fff; border-radius: 50%;
  background: var(--primary); transform: translate(-50%, -50%); pointer-events: none;
  box-shadow: 0 0 0 3px rgba(255,92,53,.35), 0 2px 8px rgba(0,0,0,.3);
}
.pv-lb-marker[hidden] { display: none; }

/* 取点层：盖住画面，点它只取位置，绝不会触发视频播放 */
.pv-pick-layer { position: absolute; inset: 0; z-index: 3; cursor: crosshair; border-radius: 8px; overflow: hidden; }
.pv-pick-layer[hidden] { display: none; }
.pv-pick-grid { position: absolute; inset: 0; opacity: 0; transition: opacity .16s; pointer-events: none; }
.pv-pick-layer:hover .pv-pick-grid, .pv-pick-grid.show { opacity: .6; }
.pv-pick-hover {
  position: absolute; background: rgba(255,92,53,.16);
  border: 1px solid rgba(255,255,255,.85); box-shadow: inset 0 0 0 1px rgba(255,92,53,.55);
  pointer-events: none;
}
.pv-pick-hover[hidden] { display: none; }
.pv-pick-box {
  position: absolute; border: 2px solid #ff5c35; border-radius: 4px;
  background: rgba(255,92,53,.14); box-shadow: 0 0 0 1px rgba(255,255,255,.65);
  pointer-events: none;
}
.pv-pick-box[hidden] { display: none; }

/* 位置词气泡挂在舞台上，竖屏窄画面也不会被裁掉 */
.pv-pick-badge {
  position: absolute; z-index: 6; width: 234px; max-width: 78vw;
  transform: translate(12px, 12px); background: #fff;
  border: 1px solid #d8e5e9; border-radius: 10px;
  box-shadow: 0 10px 30px rgba(20,36,48,.24);
  padding: 8px 9px 9px; line-height: 1.4; cursor: default;
}
.pv-pick-badge.flip-x { transform: translate(calc(-100% - 12px), 12px); }
.pv-pick-badge.flip-y { transform: translate(12px, calc(-100% - 12px)); }
.pv-pick-badge.flip-x.flip-y { transform: translate(calc(-100% - 12px), calc(-100% - 12px)); }
.pv-pick-badge[hidden] { display: none; }
.pv-pick-badge-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.pv-pick-badge-top b { font-size: 11px; color: #0b6f74; }
.pv-pick-badge-top button { border: 0; background: transparent; color: #8ba0a8; font-size: 16px; line-height: 1; cursor: pointer; padding: 0 2px; }
.pv-pick-badge-top button:hover { color: #d4524b; }
.pv-pick-word {
  width: 100%; box-sizing: border-box; font-size: 11.5px; color: var(--text);
  border: 1px solid #cfe0e4; border-radius: 6px; padding: 5px 7px; background: #fbfeff;
}
.pv-pick-badge-acts { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 7px; }
.pv-pick-badge-acts button {
  border: 1px solid #cfe0e4; background: #fff; color: #3c6a70;
  font-size: 10.5px; padding: 4px 7px; border-radius: 6px; cursor: pointer;
}
.pv-pick-badge-acts button:first-child { border-color: #b9e3e0; background: var(--teal-soft); color: #0b6f74; font-weight: 650; }
.pv-pick-badge-acts button:hover { border-color: var(--primary); color: var(--primary-dark); }
.pv-pick-foot { display: flex; align-items: center; gap: 6px; margin-top: 7px; font-size: 10px; color: #8ba0a8; flex-wrap: wrap; }
.pv-pick-foot select { border: 1px solid #e0e9ec; border-radius: 5px; font-size: 10px; padding: 2px 3px; background: #fff; color: #3c6a70; }
.pv-lb-bar {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  padding: 10px 14px; border-top: 1px solid var(--border); background: #fbfcfd;
}
.pv-lb-bar button {
  border: 1px solid var(--border); background: #fff; color: var(--text-2);
  font-size: 11.5px; padding: 5px 10px; border-radius: 7px; white-space: nowrap;
}
.pv-lb-bar button:hover:not(:disabled) { border-color: var(--primary); color: var(--primary-dark); background: var(--primary-soft); }
.pv-lb-bar button:disabled { opacity: .45; cursor: not-allowed; }
.pv-lb-bar > span#pvLbPos { font-size: 11.5px; color: var(--muted); }
.pv-lb-spacer { flex: 1; }
.pv-lb-picked { font-size: 11.5px; color: #0b6f74; font-weight: 600; }
.pv-lb-bar button[data-pv="insert-pos"], .pv-lb-bar button[data-pv="insert-tag"] {
  border-color: #b9e3e0; background: var(--teal-soft); color: #0b6f74; font-weight: 650;
}

/* 视频时间轴：0.1 秒定位 / 逐帧 / 区间 / 抽帧 / 时间标记 */
.pv-lb-card.with-timeline .pv-lb-stage { min-height: 230px; }
.pv-lb-card.with-timeline .pv-lb-media > img,
.pv-lb-card.with-timeline .pv-lb-media > video { max-height: 44vh; }
.pv-timeline {
  border-top: 1px solid var(--border); background: #fff;
  padding: 9px 14px 11px; max-height: 52vh; overflow-y: auto;
}
.pv-timeline button#pvPickModeBtn.off { border-color: #f0c4c0; background: #fff5f4; color: #b8574f; }
.pv-timeline button.pv-fps-src {
  border: 1px dashed #cfdde2; background: #f7fafb; color: #7d9299;
  font-size: 10px; padding: 3px 8px; border-radius: 999px; font-weight: 500;
}
.pv-timeline button.pv-fps-src.known {
  border-style: solid; border-color: #b9e3e0; background: var(--teal-soft);
  color: #0b6f74; font-weight: 650;
}
.pv-timeline button.pv-fps-src:hover { border-color: var(--primary); color: var(--primary-dark); }
.pv-timeline[hidden] { display: none; }
.pv-tl-row { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-bottom: 7px; }
.pv-tl-row:last-child { margin-bottom: 0; }
.pv-timeline button, .pv-markers button {
  border: 1px solid #cfe0e4; background: #fff; color: #3c6a70;
  font-size: 11px; padding: 4px 8px; border-radius: 7px; white-space: nowrap;
}
.pv-timeline button:hover, .pv-markers button:hover {
  border-color: var(--primary); color: var(--primary-dark); background: var(--primary-soft);
}
.pv-timeline button.pv-btn-primary {
  border-color: var(--primary); background: var(--primary); color: #fff; font-weight: 650;
}
.pv-timeline button.pv-btn-primary:hover { background: var(--primary-dark); color: #fff; }
.pv-tl-clock {
  font-size: 16px; font-weight: 700; color: var(--text);
  font-variant-numeric: tabular-nums; letter-spacing: .5px;
}
.pv-tl-frame, .pv-tl-total, .pv-tl-tip { font-size: 10.5px; color: var(--muted); }
.pv-tl-frame { color: #0b6f74; background: var(--teal-soft); padding: 2px 6px; border-radius: 5px; }
.pv-tl-fps {
  margin-left: auto; font-size: 10.5px; color: var(--muted);
  display: flex; align-items: center; gap: 4px;
}
.pv-tl-fps select {
  border: 1px solid var(--border); border-radius: 5px;
  font-size: 10.5px; padding: 2px 4px; background: #fff;
}
.pv-tl-range { width: 100%; margin: 2px 0 9px; accent-color: var(--primary); cursor: pointer; }
.pv-tl-range-text { font-size: 10.5px; color: #0b6f74; font-weight: 600; }
.pv-tl-note .input { flex: 1 1 220px; min-width: 0; font-size: 11.5px; padding: 5px 8px; }

/* 抽帧设置行 */
.pv-strip-tools {
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
  padding: 7px 8px; margin: 2px 0 8px;
  background: #f7fbfc; border: 1px solid #e2edef; border-radius: 9px;
}
.pv-strip-field {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 10.5px; color: #4a7076; white-space: nowrap;
}
.pv-strip-field select, .pv-strip-num, .pv-strip-custom {
  border: 1px solid #cfe0e4; border-radius: 6px; background: #fff;
  font-size: 10.5px; padding: 3px 5px; color: var(--text-2);
}
.pv-strip-num { width: 64px; }
.pv-strip-custom { flex: 1 1 190px; min-width: 140px; }
.pv-strip-field[hidden], .pv-strip-custom[hidden] { display: none; }
.pv-strip-progress { font-size: 10px; color: #0b6f74; white-space: nowrap; }

/* 缩略图：保持原始比例完整显示，不再横向裁切 */
.pv-strip { display: flex; gap: 6px; overflow-x: auto; padding: 2px 0 8px; scrollbar-width: thin; }
.pv-strip[hidden] { display: none; }
.pv-timeline .pv-strip-cell {
  flex: 0 0 var(--pv-cell-w, 96px); border: 1px solid #dfe9ed; border-radius: 8px; background: #fff;
  padding: 0; overflow: hidden; cursor: pointer; display: flex; flex-direction: column;
  color: #5c7b82; position: relative;
}
.pv-timeline .pv-strip-cell:hover { border-color: var(--primary); box-shadow: 0 2px 8px rgba(255,92,53,.12); }
.pv-strip-canvas { position: relative; height: 76px; background: #e9eff2; display: grid; place-items: center; }
.pv-strip-cell img { width: 100%; height: 100%; object-fit: contain; display: block; }
.pv-strip-ph { font-size: 10px; color: #9fb1b7; }
.pv-timeline .pv-strip-canvas button.pv-strip-dl {
  position: absolute; right: 3px; top: 3px; z-index: 2;
  border: 1px solid #cfdde2; background: rgba(255,255,255,.94); color: #3c6a70;
  font-size: 11px; line-height: 1; padding: 2px 6px; border-radius: 5px;
  opacity: 0; transition: opacity .15s;
}
.pv-timeline .pv-strip-cell:hover .pv-strip-canvas button.pv-strip-dl { opacity: 1; }
.pv-timeline .pv-strip-canvas button.pv-strip-dl:hover { border-color: var(--primary); color: var(--primary-dark); }
.pv-strip-cell em {
  font-style: normal; font-size: 9.5px; color: #5c7b82; text-align: center;
  padding: 4px 0; font-variant-numeric: tabular-nums; border-top: 1px solid #eef2f5;
}

/* 时间标记清单 */
.pv-markers { margin-top: 12px; border: 1px solid #d9e9e7; border-radius: 10px; background: #fff; overflow: hidden; }
.pv-markers[hidden] { display: none; }
.pv-mk-head { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; padding: 8px 10px; background: var(--teal-soft); }
.pv-mk-head b { font-size: 12px; color: #0b6f74; }
.pv-mk-head > span:not(.pv-mk-spacer) {
  font-size: 10.5px; color: #4a8b8e; background: #fff; border-radius: 999px; padding: 2px 7px;
}
.pv-mk-spacer { flex: 1; }
.pv-mk-hint {
  font-size: 10.5px; color: #6c8b90; line-height: 1.6;
  padding: 7px 10px; border-bottom: 1px solid #edf4f4; margin: 0;
}
.pv-mk-list { max-height: 210px; overflow-y: auto; }
.pv-mk-row { display: flex; align-items: center; gap: 8px; padding: 7px 10px; border-bottom: 1px solid #f0f5f6; }
.pv-mk-row:last-child { border-bottom: 0; }
.pv-mk-thumb { flex: 0 0 56px; width: 56px; height: 38px; object-fit: contain; border-radius: 5px; background: #e9eff2; display: block; }
.pv-mk-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.pv-mk-main b { font-size: 11px; color: var(--text-2); font-variant-numeric: tabular-nums; }
.pv-mk-main span { font-size: 10.5px; color: var(--muted); overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.pv-mk-row button { flex: none; font-size: 10px; padding: 3px 6px; }

/* 检测到原视频时长 */
.detected-duration {
  margin-top: 11px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 9px 11px; border-radius: 9px; background: var(--teal-soft);
  font-size: 11.5px; color: #0b6f74;
}
.detected-duration span { flex: 1; min-width: 180px; line-height: 1.55; }
.detected-duration .mini-btn { flex: none; }
.help-shortcuts { margin-top: 12px; font-size: 11px; color: var(--muted); text-align: center; line-height: 1.6; }

@media (max-width: 1120px) {
  .layout { grid-template-columns: 1fr; }
  .preview { position: static; }
  .result-editor { min-height: 320px; height: 320px; }
  .jump-result { display: inline-flex; }
}
@media (max-width: 680px) {
  .topbar { padding: 0 15px; }
  .badge { display: none; }
  .layout { padding: 20px 13px 44px; gap: 16px; }
  .panel { padding: 16px; }
  .mode-cards { grid-template-columns: 1fr; }
  .mode-card { min-height: 0; }
  .fidelity-cards { grid-template-columns: 1fr; }
  .fidelity-label span { display: block; margin: 2px 0 0; }
  .start-head { flex-direction: column; align-items: stretch; }
  .start-card .mini-btn { align-self: flex-start; }
  .custom-duration .input { width: 100%; }
  .ref-row { grid-template-columns: 52px minmax(0, 1fr) 30px; }
  .ref-row .ref-note { grid-column: 1 / -1; }
  .param-group { min-width: 100%; }
  .result-actions .btn-ghost { flex: 1 1 45%; }
  .combo-head { flex-direction: column; align-items: stretch; }
  .shot-top { flex-wrap: wrap; }
  .shot-top .input { flex: 1 1 40%; }
  .shot-ctrl { margin-left: auto; }
  .task-switch { grid-template-columns: 1fr; }
  .task-tab { padding: 11px 13px; }
  .scope-row { grid-template-columns: 1fr; }
  .pv-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pv-board.floating { left: 10px; right: 10px; bottom: 10px; width: auto; max-height: 60vh; }
  .pv-head { flex-direction: column; align-items: stretch; }
  .pv-lb-card { max-height: 94vh; }
  .pv-lb-stage { min-height: 200px; padding: 10px; }
  .pv-lb-media > img, .pv-lb-media > video { max-height: 42vh; }
  .pv-lb-spacer { display: none; }
  .pv-lb-picked { flex: 1 1 100%; }
  .pv-pick-badge { width: 200px; max-width: 84vw; }
  .pv-timeline { max-height: 50vh; padding: 8px 10px; }
  .pv-tl-clock { font-size: 14px; }
  .pv-tl-fps { margin-left: 0; }
  .pv-strip-tools { padding: 6px; gap: 5px; }
  .pv-strip-custom { flex-basis: 100%; }
  .pv-strip-progress { flex-basis: 100%; }
  .pv-mk-thumb { flex-basis: 44px; width: 44px; height: 32px; }
  .pv-mk-row { gap: 5px; padding: 6px; }
  .detected-duration .mini-btn { width: 100%; }
}

/* ===== 场景选择 / 步骤导航 / 完成度 ===== */
.scene-badge {
  display: inline-flex; align-items: center; gap: 6px; padding: 6px 11px; border-radius: 999px;
  background: #f1f0fe; color: #5c4bc4; font-size: 12px; font-weight: 650; white-space: nowrap;
}
.scene-badge::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

.scene-card {
  position: relative; background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 18px 20px 17px; margin-bottom: 18px;
  overflow: hidden;
}
.scene-card::before {
  content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 3px;
  background: linear-gradient(180deg, #ff5c35, #7a5cff 55%, #0d9c9c);
}
.scene-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.scene-card-head h3 { font-size: 14.5px; font-weight: 750; }
.scene-card-head p { font-size: 11.8px; color: var(--muted); margin-top: 4px; line-height: 1.6; }
.optional-tag {
  display: inline-block; margin-left: 5px; padding: 1px 7px; border-radius: 5px; vertical-align: 2px;
  background: var(--soft); color: var(--muted); font-size: 10.5px; font-weight: 600;
}
.scene-count {
  flex: none; font-size: 11px; color: var(--muted); background: var(--soft);
  padding: 4px 9px; border-radius: 999px;
}
.scene-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 9px; }
.scene-tile {
  position: relative; display: flex; align-items: flex-start; gap: 10px; text-align: left;
  min-height: 88px; padding: 11px 12px; border: 1px solid var(--border); border-radius: 11px;
  background: #fcfcfe; transition: .18s; --sc: #ff5c35;
}
.scene-tile:hover { border-color: var(--sc); transform: translateY(-2px); box-shadow: 0 6px 16px rgba(32,38,66,.07); }
.scene-tile.active {
  border-color: var(--sc); background: #fff;
  box-shadow: 0 0 0 2px var(--sc), 0 8px 20px rgba(32,38,66,.09);
}
.st-icon {
  flex: none; width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center;
  background: var(--soft); color: var(--sc);
}
.st-icon svg { width: 17px; height: 17px; }
.scene-tile.active .st-icon { background: var(--sc); color: #fff; }
.st-body { min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.st-body b { font-size: 12.8px; font-weight: 700; line-height: 1.4; }
.st-body em { font-size: 10.5px; color: var(--sc); font-style: normal; font-weight: 600; }
.st-body > span { font-size: 10.8px; color: var(--muted); line-height: 1.5; margin-top: 2px; }
.st-check {
  display: none; position: absolute; right: 9px; top: 9px; width: 17px; height: 17px;
  border-radius: 50%; background: var(--sc); color: #fff; font-size: 10px; font-weight: 700;
  place-items: center;
}
.scene-tile.active .st-check { display: grid; }

.scene-focus-box {
  margin-top: 14px; padding: 12px 13px; border-radius: 11px;
  background: var(--soft); border: 1px solid var(--border);
}
.scene-focus-head { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; margin-bottom: 9px; }
.scene-focus-head b { font-size: 12.2px; font-weight: 700; }
.scene-focus-head > span {
  font-size: 10.5px; color: var(--teal); background: var(--teal-soft); padding: 1px 7px; border-radius: 5px;
}
.scene-focus-head em { font-size: 10.8px; color: var(--muted); font-style: normal; }
.scene-focus-box .hint-line { margin-top: 8px; }
.preset-empty { font-size: 11.5px; color: var(--muted); }

.workflow-head {
  display: flex; align-items: center; gap: 12px; margin: 0 0 11px; flex-wrap: wrap;
}
.workflow-label { font-size: 11.5px; font-weight: 700; color: var(--text-2); white-space: nowrap; }
.workflow-label::before {
  content: ''; display: inline-block; width: 3px; height: 12px; border-radius: 2px;
  background: var(--primary); vertical-align: -2px; margin-right: 7px;
}
.step-nav { display: flex; flex: 1; gap: 6px; overflow-x: auto; padding-bottom: 2px; scrollbar-width: thin; }
.step-nav button {
  flex: none; display: inline-flex; align-items: center; gap: 5px; white-space: nowrap;
  padding: 4px 10px 4px 5px; border: 1px solid var(--border); border-radius: 999px;
  background: #fff; color: var(--text-2); font-size: 11px; transition: .18s;
}
.step-nav button b {
  width: 17px; height: 17px; border-radius: 50%; display: grid; place-items: center;
  background: var(--soft); color: var(--muted); font-size: 10px;
}
.step-nav button:hover { border-color: var(--primary-border); color: var(--primary-dark); background: var(--primary-soft); }
.step-nav button:hover b { background: var(--primary); color: #fff; }

.panel-fold {
  flex: none; margin-left: auto; align-self: center; padding: 3px 9px; border-radius: 7px;
  border: 1px solid var(--border); background: #fff; color: var(--muted); font-size: 11px;
}
.panel-fold:hover { color: var(--primary-dark); border-color: var(--primary-border); background: var(--primary-soft); }
.panel.collapsed { padding-bottom: 15px; }
.panel.collapsed > :not(.panel-head) { display: none; }
.panel.collapsed .panel-head { margin-bottom: 0; }
.panel.collapsed .panel-title p { display: none; }

.result-scene {
  display: inline-block; margin-top: 7px; padding: 2px 8px; border-radius: 6px;
  background: var(--soft); color: var(--muted); font-size: 10.5px;
}
.check-progress { display: flex; align-items: center; gap: 9px; margin-bottom: 11px; }
.cp-track { flex: 1; height: 6px; border-radius: 999px; background: var(--soft); overflow: hidden; }
.cp-track i {
  display: block; height: 100%; width: 0; border-radius: 999px;
  background: linear-gradient(90deg, #ff9a6d, var(--primary)); transition: width .3s ease;
}
#checkProgressText { flex: none; font-size: 10.5px; color: var(--muted); white-space: nowrap; }
.check-card.all-ok .cp-track i { background: linear-gradient(90deg, #55cfa0, var(--teal)); }
.check-card.all-ok #checkProgressText { color: var(--teal); font-weight: 650; }

/* 短剧分镜表：一镜一行、三个补充字段 */
.shot-row.drama { padding: 10px 10px 11px; border: 1px solid var(--border); border-radius: 10px; background: #fcfcfe; }
.shot-more {
  display: grid; grid-template-columns: 90px minmax(0, 1fr) minmax(0, 1fr);
  gap: 8px; margin: 8px 0;
}
.shot-more label { font-size: 10.5px; color: var(--muted); line-height: 1.5; }
.shot-more .input { margin-top: 3px; height: 30px; font-size: 12px; }
.drama-shots .shots-head p { color: #5c4bc4; }

@media (max-width: 1120px) {
  .scene-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 680px) {
  .scene-badge { display: none; }
  .scene-card { padding: 15px 14px; }
  .scene-card-head { flex-direction: column; gap: 5px; }
  .scene-grid { grid-template-columns: 1fr; gap: 7px; }
  .scene-tile { min-height: 0; padding: 9px 10px; }
  .scene-tile .st-body > span { display: none; }
  .workflow-head { gap: 7px; }
  .step-nav { width: 100%; }
  .step-nav button { font-size: 10.5px; }
  .shot-more { grid-template-columns: 1fr 1fr; }
  .shot-more label:first-child { grid-column: 1 / -1; }
  .panel-fold { display: none; }
}
