:root{
  --wf-bg:#090b10;
  --wf-panel:#11151c;
  --wf-panel-2:#171b23;
  --wf-line:rgba(255,255,255,.085);
  --wf-text:#f4f2ec;
  --wf-muted:#888f9b;
  --wf-gold:#d7ad62;
  --wf-green:#65c98d;
  --wf-red:#e47770;
}
*{scrollbar-width:thin;scrollbar-color:rgba(174,181,193,.38) transparent}
*::-webkit-scrollbar{width:7px;height:7px}
*::-webkit-scrollbar-track{background:transparent}
*::-webkit-scrollbar-thumb{border:2px solid transparent;border-radius:999px;background:rgba(174,181,193,.38);background-clip:padding-box}
*::-webkit-scrollbar-thumb:hover{background:rgba(215,173,98,.62);background-clip:padding-box}

body[data-workflow-route]{background:var(--wf-bg)}
body[data-workflow-route] .content{min-width:0;background:var(--wf-bg)}
body[data-workflow-route] #view{min-width:0;background:var(--wf-bg)}
body[data-workflow-route] .btn,
body[data-workflow-route] button,
body[data-workflow-route] input,
body[data-workflow-route] select,
body[data-workflow-route] textarea{font-family:inherit}

/* 剧本仓：保持数据与操作不变，只压缩视觉层级并让分集区独立滚动 */
body[data-workflow-route="scripts"] .wk-warehouse{padding:14px 22px 32px}
body[data-workflow-route="scripts"] .wk-warehouse-hero{height:188px;border-radius:14px}
body[data-workflow-route="scripts"] .wk-hero-content{left:26px;bottom:20px;max-width:860px}
body[data-workflow-route="scripts"] .wk-hero-content h1{font-size:30px;margin:4px 0}
body[data-workflow-route="scripts"] .wk-back{bottom:124px}
body[data-workflow-route="scripts"] .wk-stage-nav{margin-bottom:14px}
body[data-workflow-route="scripts"] .wk-workspace-grid{gap:14px;grid-template-columns:minmax(0,1fr) 310px}
body[data-workflow-route="scripts"] .wk-main-column,
body[data-workflow-route="scripts"] .wk-side-column{gap:12px}
body[data-workflow-route="scripts"] .wk-panel,
body[data-workflow-route="scripts"] .wk-asset-group{padding:16px;border-radius:12px}
body[data-workflow-route="scripts"] .wk-side-column{position:sticky;top:10px;align-self:start}
body[data-workflow-route="scripts"] .wk-episode-list{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;max-height:560px;overflow:auto;padding-right:4px}
body[data-workflow-route="scripts"] .wk-episode-detail{padding:12px 16px}
body[data-workflow-route="scripts"] .wk-analysis-stats{margin-top:14px}
body[data-workflow-route="scripts"] .wk-asset-strip{grid-template-columns:repeat(4,minmax(0,1fr))}

/* 资产仓与角色/场景/道具管理：数据不重排，只让列表在内容区内滚动 */
body[data-workflow-route="assets"] .wk-project-assets{padding:16px 22px 28px}
body[data-workflow-route="assets"] .wk-page-head{margin-bottom:14px}
body[data-workflow-route="assets"] .wk-asset-summary{margin:12px 0}
body[data-workflow-route="assets"] .wk-entity-image{aspect-ratio:4/3}
body[data-workflow-route="settings"] #view{overflow:hidden!important;padding:0!important}
body[data-workflow-route="settings"] .settings-page{
  height:100%;min-height:0;display:flex;flex-direction:column;overflow:hidden;
  padding:14px 22px 12px;background:var(--wf-bg)
}
body[data-workflow-route="settings"] .set-tabs{flex:0 0 auto;margin:0 0 10px}
body[data-workflow-route="settings"] .set-top-row{flex:0 0 auto;margin-bottom:10px;border-radius:12px}
body[data-workflow-route="settings"] .set-grid-wrap{flex:1;min-height:0;overflow:auto;padding:0 4px 20px 0}
body[data-workflow-route="settings"] .char-wall{align-content:start}
body[data-workflow-route="settings"] .char-wall-card{border-radius:12px;background:#12161d;border-color:var(--wf-line)}
body[data-workflow-route="settings"] .cwc-img{background:radial-gradient(circle at 50% 25%,#242b35,#0d1015)}
body[data-workflow-route="settings"] .cwc-meta{background:#151a22}

/* 分镜制作固定在工作区，分集、镜头与右侧参数各自滚动 */
body[data-workflow-route="shots"] #view{overflow:hidden!important;padding:0!important}
body[data-workflow-route="shots"] .sb-page{
  height:100%;min-height:0;overflow:hidden;display:flex;flex-direction:column;
  gap:8px;padding:10px 14px 12px;background:var(--wf-bg)!important
}
body[data-workflow-route="shots"] .sb-eps-top{flex:0 0 auto;margin:0!important;border-radius:11px!important}
body[data-workflow-route="shots"] .sb-workspace{flex:1;min-height:0;overflow:hidden;border-radius:12px}
body[data-workflow-route="shots"] .sb-3col{height:100%;min-height:0}
body[data-workflow-route="shots"] .sb-board{height:100%;min-height:0;overflow:auto}
body[data-workflow-route="shots"] .sb-board-head{position:sticky;top:0;z-index:12;backdrop-filter:blur(12px)}
body[data-workflow-route="shots"] .sb-left,
body[data-workflow-route="shots"] .sb-center,
body[data-workflow-route="shots"] .sb-right{min-height:0;overflow:auto}

/* 分镜剪辑：固定一屏，监视器/参数/时间线为嵌套工作区 */
body[data-workflow-route="editline"] #view{overflow:hidden!important;padding:0!important}
body[data-workflow-route="editline"] .el2-wrap{
  height:100%;min-height:0;overflow:hidden;padding:10px 14px 12px;gap:8px
}
body[data-workflow-route="editline"] .el2-toolbar{
  flex:0 0 auto;min-height:62px;padding:10px 14px;border-radius:11px;align-items:center
}
body[data-workflow-route="editline"] .el2-toolbar h2{font-size:18px}
body[data-workflow-route="editline"] .el2-toolbar p{white-space:nowrap}
body[data-workflow-route="editline"] .el2-eps{flex:0 0 auto;min-height:40px;padding:5px 8px}
body[data-workflow-route="editline"] .el2-body{flex:1;min-height:0;overflow:hidden}
body[data-workflow-route="editline"] .el2-right{
  height:100%;min-height:0;display:grid;grid-template-rows:minmax(0,1fr) 6px var(--wf-timeline-h,190px);gap:0
}
body[data-workflow-route="editline"] .el2-top{
  min-height:0;overflow:hidden;display:grid;
  grid-template-columns:minmax(340px,1fr) 6px minmax(230px,var(--wf-inspector-w,300px));gap:0
}
body[data-workflow-route="editline"] .el2-monitor{min-width:0;min-height:0;overflow:hidden;border-radius:10px}
body[data-workflow-route="editline"] .el2-mon-view{height:calc(100% - 42px);max-height:none;aspect-ratio:auto}
body[data-workflow-route="editline"] .el2-info{
  min-width:0;min-height:0;max-height:none;height:100%;overflow:auto;border-radius:10px
}
body[data-workflow-route="editline"] .el2-tl{
  min-height:0;height:100%;padding:9px 10px;border-radius:10px;overflow:hidden
}
body[data-workflow-route="editline"] .el2-tl-body{min-height:0}
body[data-workflow-route="editline"] .el2-tl-scroll{height:100%}
.wf-column-resizer,.wf-timeline-resizer{position:relative;z-index:20;touch-action:none}
.wf-column-resizer{cursor:col-resize;background:transparent}
.wf-column-resizer:after{content:"";position:absolute;top:14px;bottom:14px;left:2px;width:2px;border-radius:4px;background:#2d333e}
.wf-column-resizer:hover:after{background:var(--wf-gold)}
.wf-timeline-resizer{cursor:row-resize;background:transparent}
.wf-timeline-resizer:after{content:"";position:absolute;left:44%;right:44%;top:2px;height:2px;border-radius:4px;background:#303642}
.wf-timeline-resizer:hover:after{background:var(--wf-gold)}

/* 视频预览 */
body[data-workflow-route="film"] .fm-page{max-width:1480px;margin:auto;padding:18px 24px 34px}
body[data-workflow-route="film"] .fm-empty,
body[data-workflow-route="film"] .fm-films{border-radius:14px;border-color:var(--wf-line);background:var(--wf-panel)}

/* 项目调用历史入口 */
.wf-call-history-button{
  position:fixed;right:18px;bottom:18px;z-index:8800;display:flex;align-items:center;gap:9px;
  min-height:42px;padding:0 12px 0 15px;border:1px solid rgba(215,173,98,.5);border-radius:999px;
  background:rgba(17,21,28,.96);color:#f4f2ec;box-shadow:0 14px 36px rgba(0,0,0,.38);
  backdrop-filter:blur(14px);cursor:pointer;font-size:12px;font-weight:700
}
.wf-call-history-button:hover{transform:translateY(-1px);border-color:var(--wf-gold)}
.wf-call-history-button b{display:grid;place-items:center;min-width:21px;height:21px;padding:0 5px;border-radius:999px;background:var(--wf-gold);color:#17120a;font-size:9px}
.wf-history-drawer{
  position:fixed;z-index:9000;right:0;top:0;width:min(980px,92vw);height:100vh;display:flex;flex-direction:column;
  color:var(--wf-text);background:#0b0e13;border-left:1px solid var(--wf-line);
  box-shadow:-30px 0 70px rgba(0,0,0,.48);animation:wf-slide-in .18s ease-out
}
@keyframes wf-slide-in{from{transform:translateX(30px);opacity:.6}to{transform:none;opacity:1}}
.wf-history-head{flex:0 0 auto;display:flex;align-items:flex-start;justify-content:space-between;gap:20px;padding:19px 20px 16px;border-bottom:1px solid var(--wf-line);background:linear-gradient(125deg,#161b23,#0f1218)}
.wf-history-head small,.wf-detail-head small,.wf-prompt-box small{font-size:9px;letter-spacing:.16em;color:var(--wf-gold);font-weight:800}
.wf-history-head h2{margin:4px 0 3px;font-size:22px}
.wf-history-head p{margin:0;color:var(--wf-muted);font-size:11px}
.wf-history-head-actions{display:flex;gap:7px}
.wf-mini-button{border:1px solid #343a45;border-radius:7px;background:#191e27;color:#cbd0d7;padding:7px 10px;font-size:10px;cursor:pointer}
.wf-mini-button:hover{border-color:var(--wf-gold);color:#f3d99f}
.wf-history-body{flex:1;min-height:0;display:flex;flex-direction:column}
.wf-history-loading{display:grid;place-items:center;height:100%;color:var(--wf-muted)}
.wf-history-toolbar{flex:0 0 auto;display:flex;align-items:center;justify-content:space-between;padding:10px 14px;border-bottom:1px solid var(--wf-line)}
.wf-history-tabs{display:flex;gap:5px}
.wf-history-tabs button{border:1px solid #2c323c;border-radius:7px;background:#151a22;color:#8f96a1;padding:6px 11px;font-size:10px;cursor:pointer}
.wf-history-tabs button.active{border-color:rgba(215,173,98,.55);background:rgba(215,173,98,.13);color:#efcc86}
.wf-history-count{font-size:10px;color:var(--wf-muted)}
.wf-history-layout{flex:1;min-height:0;display:grid;grid-template-columns:350px minmax(0,1fr)}
.wf-history-list{min-height:0;overflow:auto;padding:10px;border-right:1px solid var(--wf-line)}
.wf-job-card{padding:11px;margin-bottom:8px;border:1px solid var(--wf-line);border-radius:10px;background:#12161d}
.wf-job-card.active{border-color:rgba(215,173,98,.56);background:#171a20}
.wf-job-top,.wf-job-meta,.wf-job-actions,.wf-detail-head{display:flex;align-items:center;justify-content:space-between;gap:8px}
.wf-job-top strong,.wf-job-top small{display:block}
.wf-job-top strong{font-size:12px}
.wf-job-top small{margin-top:3px;color:#7f8792;font-size:9px}
.wf-job-status{padding:4px 7px;border-radius:999px;background:#242a33;color:#adb3bd;font-size:9px}
.wf-job-status.succeeded{background:rgba(101,201,141,.13);color:#78dca1}
.wf-job-status.failed{background:rgba(228,119,112,.13);color:#f08b85}
.wf-job-status.running,.wf-job-status.pending{background:rgba(215,173,98,.13);color:#e9c47e}
.wf-job-prompt{height:32px;margin:9px 0 7px;overflow:hidden;color:#b2b7c0;font-size:10px;line-height:1.6}
.wf-job-meta{color:#6f7681;font-size:9px}
.wf-job-actions{justify-content:flex-start;flex-wrap:wrap;margin-top:9px;padding-top:8px;border-top:1px solid rgba(255,255,255,.055)}
.wf-job-actions button{border:0;border-radius:6px;background:#252b34;color:#b9bec7;padding:5px 7px;font-size:9px;cursor:pointer}
.wf-job-actions button:hover{background:#333a45;color:#fff}
.wf-job-actions .danger{margin-left:auto;color:#e6948f;background:transparent}
.wf-history-detail{min-width:0;min-height:0;overflow:auto;padding:16px}
.wf-detail-placeholder,.wf-history-empty{display:grid;place-items:center;align-content:center;gap:7px;min-height:180px;border:1px dashed #303641;border-radius:11px;color:#7e8590;text-align:center;padding:20px}
.wf-history-empty p{margin:0;font-size:10px}
.wf-detail-head{margin-bottom:12px}
.wf-detail-head h3{margin:4px 0 0;font-size:17px}
.wf-json-view{margin:0;max-height:calc(100vh - 190px);overflow:auto;white-space:pre-wrap;word-break:break-word;padding:14px;border:1px solid var(--wf-line);border-radius:10px;background:#07090d;color:#bfc5ce;font:11px/1.65 ui-monospace,SFMono-Regular,Consolas,monospace}
.wf-prompt-box{margin-top:12px;padding:13px;border:1px solid rgba(215,173,98,.18);border-radius:10px;background:rgba(215,173,98,.055)}
.wf-prompt-box p{margin:7px 0 0;color:#d6d0c4;font-size:11px;line-height:1.7;white-space:pre-wrap}
.wf-return-media{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
.wf-return-media figure{margin:0;overflow:hidden;border:1px solid var(--wf-line);border-radius:10px;background:#07090d}
.wf-return-media img,.wf-return-media video{display:block;width:100%;aspect-ratio:16/10;object-fit:contain;background:#030405}
.wf-return-media figcaption{padding:7px 9px;color:#858c97;font-size:9px}

@media(max-width:900px){
  body[data-workflow-route="scripts"] .wk-episode-list{grid-template-columns:1fr}
  body[data-workflow-route="editline"] .el2-top{grid-template-columns:1fr}
  body[data-workflow-route="editline"] .wf-column-resizer{display:none}
  body[data-workflow-route="editline"] .el2-info{display:none}
  .wf-history-layout{grid-template-columns:1fr}
  .wf-history-list{max-height:42vh;border-right:0;border-bottom:1px solid var(--wf-line)}
  .wf-return-media{grid-template-columns:1fr}
}
body[data-workflow-route] img.wf-media-missing,
body[data-workflow-route] video.wf-media-missing {
  opacity: 0;
}
body[data-workflow-route="scripts"] .wk-stage-nav {
  display: none;
}

.wk-field-hint {
  display: block;
  margin: -5px 0 10px;
  color: #9aa4b2;
  font-size: 11px;
  line-height: 1.55;
}