
*{box-sizing:border-box} body{margin:0;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Microsoft YaHei",Arial,sans-serif;background:#f6f7fb;color:#1d2433;height:100vh;overflow:hidden}.app-shell{height:100vh;padding:14px;display:flex;flex-direction:column;gap:12px}.topbar{height:82px;display:flex;justify-content:space-between;align-items:center;background:#fff;border:1px solid #e9edf5;border-radius:18px;padding:14px 18px;box-shadow:0 8px 22px rgba(26,32,44,.05)}h1{font-size:20px;margin:0 0 6px}h2{font-size:15px;margin:0}.topbar p{margin:0;color:#7a8497;font-size:12px}.top-actions{display:flex;align-items:center;gap:8px}button{border:1px solid #dfe5ee;background:#fff;border-radius:12px;padding:9px 13px;cursor:pointer;color:#2a3344}button:hover{background:#f4f7fb}.primary,.send-btn{background:#222a36;color:#fff;border-color:#222a36}.primary:hover,.send-btn:hover{background:#111827}.small{font-size:12px;padding:6px 10px}.grid{flex:1;min-height:0;display:grid;grid-template-columns:1.15fr .85fr;grid-template-rows:1.08fr .92fr;gap:12px}.panel{background:#fff;border:1px solid #e9edf5;border-radius:18px;padding:14px;min-height:0;box-shadow:0 8px 22px rgba(26,32,44,.05);position:relative}.section-title{display:flex;align-items:center;justify-content:space-between;margin-bottom:10px}.prompt-panel{display:flex;flex-direction:column}.editor{flex:1;min-height:140px;border:1px dashed #d9e0ea;border-radius:16px;background:#fbfcff;padding:12px;outline:none;overflow:auto;line-height:1.55;font-size:14px}.editor:empty:before{content:attr(data-placeholder);color:#a1a9b8}.hint{font-size:12px;color:#8993a5;margin-top:8px}.ref-tag{display:inline-flex;align-items:center;gap:5px;vertical-align:middle;border:1px solid #dfe7f2;background:#f1f5fb;border-radius:999px;padding:2px 6px;margin:0 2px;cursor:grab;user-select:none}.ref-tag img{width:22px;height:22px;border-radius:6px;object-fit:cover}.ref-tag b{font-size:12px;color:#ef4444;margin-left:2px;cursor:pointer}.mention-popup{position:absolute;z-index:40;width:230px;max-height:190px;overflow:auto;background:#fff;border:1px solid #e4e9f2;border-radius:14px;padding:6px;box-shadow:0 14px 32px rgba(15,23,42,.16);left:28px;bottom:46px}.mention-item{display:flex;align-items:center;gap:8px;padding:6px;border-radius:10px;cursor:pointer}.mention-item:hover{background:#f3f6fb}.mention-item img{width:36px;height:36px;border-radius:8px;object-fit:cover}.hidden{display:none!important}.image-panel{display:flex;flex-direction:column}.image-list{flex:1;overflow:auto;display:grid;grid-template-columns:repeat(auto-fill,minmax(118px,1fr));gap:10px;align-content:start}.image-list.empty,.task-list.empty{display:flex;align-items:center;justify-content:center;color:#a3acba;font-size:13px;border:1px dashed #dce3ed;border-radius:14px}.image-card{position:relative;border:1px solid #e5ebf4;border-radius:14px;background:#fbfcff;padding:8px;min-height:116px}.image-card.uploading{filter:grayscale(1);opacity:.55}.image-card img{width:100%;height:68px;object-fit:cover;border-radius:10px;display:block;cursor:pointer}.image-card .name{font-size:12px;font-weight:600;margin-top:6px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.image-card .row{display:flex;gap:6px;margin-top:6px}.image-card .row button{flex:1;font-size:11px;padding:4px 6px;border-radius:8px}.del{position:absolute!important;right:4px;top:4px;background:#ef4444!important;color:#fff!important;border:none!important;width:22px;height:22px;border-radius:999px!important;padding:0!important;line-height:22px}.option-panel{display:flex;flex-direction:column;gap:10px}.ratio-row{display:flex;gap:8px;flex-wrap:wrap}.ratio{width:58px;height:48px;border:1px solid #dce4ef;background:#fbfcff;border-radius:12px;display:flex;flex-direction:column;align-items:center;justify-content:center;font-size:11px;gap:4px}.ratio.active{border-color:#222a36;background:#eef2f7}.rect{border:2px solid currentColor;border-radius:3px}.r916{width:14px;height:24px}.r169{width:28px;height:16px}.r43{width:24px;height:18px}.r34{width:18px;height:24px}.r11{width:21px;height:21px}.option-row{display:grid;grid-template-columns:repeat(4,1fr);gap:8px}.option-row label{font-size:12px;color:#6c7586;display:flex;flex-direction:column;gap:4px}.option-row input,.option-row select,.config-bottom input,.config-bottom select{height:34px;border:1px solid #dfe5ee;border-radius:10px;padding:0 8px;background:#fff}.send-btn{height:42px;font-size:15px}.status-line{font-size:12px;color:#667085;min-height:18px}.task-panel{display:flex;flex-direction:column}.task-list{flex:1;overflow:auto;display:flex;flex-direction:column;gap:8px}.task-card{border:1px solid #e6ebf3;border-radius:14px;padding:10px;background:#fbfcff;display:grid;grid-template-columns:82px 1fr auto;gap:10px;align-items:center}.fan{height:52px;position:relative}.fan img{position:absolute;width:42px;height:42px;border-radius:10px;object-fit:cover;border:2px solid #fff;box-shadow:0 3px 8px rgba(15,23,42,.18)}.fan img:nth-child(1){left:0;top:4px;transform:rotate(-10deg)}.fan img:nth-child(2){left:22px;top:5px;transform:rotate(4deg)}.fan img:nth-child(3){left:44px;top:6px;transform:rotate(12deg)}.task-main strong{font-size:13px}.task-main p{font-size:12px;color:#667085;margin:4px 0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:480px}.task-main em{font-style:normal;font-size:11px;color:#8a94a6}.badge{display:inline-block;border-radius:999px;padding:3px 8px;font-size:11px;background:#ecfdf3;color:#027a48}.badge.fail{background:#fff1f2;color:#be123c}.task-actions{display:flex;flex-direction:column;gap:6px}.modal{position:fixed;inset:0;background:rgba(15,23,42,.35);z-index:100;display:flex;align-items:center;justify-content:center}.modal-card{position:relative;background:#fff;border-radius:18px;padding:18px;border:1px solid #e7ecf4;box-shadow:0 20px 60px rgba(15,23,42,.25)}.close{position:absolute;right:12px;top:10px;width:28px;height:28px;border-radius:50%;padding:0}.config-card{width:min(760px,92vw);height:min(620px,88vh);display:flex;flex-direction:column}.config-card p{font-size:12px;color:#667085;margin:8px 38px 10px 0}.config-card textarea{flex:1;min-height:260px;resize:none;border:1px solid #dfe5ee;border-radius:14px;padding:10px;font-family:Consolas,monospace;font-size:12px;overflow:auto}.config-bottom{display:grid;grid-template-columns:150px 130px 1fr 110px 110px;gap:10px;align-items:end;margin-top:10px}.check{font-size:12px;color:#4b5563}.modal-msg{min-height:20px;margin-top:8px;font-size:12px;color:#027a48}.logs-card{width:min(900px,94vw);height:min(650px,88vh);display:flex;flex-direction:column}.log-actions{display:flex;gap:8px;margin:8px 0}.logs-card pre{flex:1;overflow:auto;background:#0f172a;color:#dbeafe;border-radius:14px;padding:12px;font-size:12px;white-space:pre-wrap}.preview-card{max-width:88vw;max-height:88vh}.preview-card img{max-width:82vw;max-height:78vh;border-radius:14px;display:block}@media(max-width:900px){body{overflow:auto}.app-shell{height:auto}.grid{grid-template-columns:1fr;grid-template-rows:auto}.panel{min-height:250px}.topbar{height:auto;align-items:flex-start;gap:10px;flex-direction:column}.top-actions{flex-wrap:wrap}}

/* 修复版布局：左侧 60%，右侧任务队列 40%；图片列表放在提示词框上方横向排列 */
.grid{grid-template-columns:minmax(0,3fr) minmax(340px,2fr);grid-template-rows:minmax(0,1.45fr) minmax(0,.55fr)}
.prompt-panel{grid-column:1;grid-row:1;display:flex;flex-direction:column;min-height:0}
.option-panel{grid-column:1;grid-row:2;min-height:0}
.task-panel{grid-column:2;grid-row:1 / span 2;min-height:0}
.image-shelf{height:128px;border:1px dashed #d9e0ea;border-radius:16px;background:#fbfcff;padding:8px;margin-bottom:10px;display:flex;flex-direction:column;gap:6px;transition:border-color .15s,background .15s}
.image-shelf.over{border-color:#222a36;background:#f3f6fb}
.image-shelf-head{display:flex;align-items:center;justify-content:space-between;font-size:12px;color:#5f6b7d;line-height:1}
.image-shelf-head span{font-weight:700;color:#2a3344}.image-shelf-head em{font-style:normal;color:#8a94a6}
.image-shelf-title{display:flex;align-items:center;gap:10px;min-width:0}
.auto-eye-cover-toggle{display:inline-flex;align-items:center;gap:5px;min-width:0;color:#667085;font-size:11px;font-weight:600;line-height:18px;white-space:nowrap;cursor:pointer;user-select:none}
.auto-eye-cover-toggle input{position:absolute;width:1px;height:1px;opacity:0;pointer-events:none}
.auto-eye-cover-toggle>span{position:relative;flex:0 0 28px;width:28px;height:16px;border:1px solid #cbd5e1;border-radius:999px;background:#e5e7eb;transition:background .16s,border-color .16s}
.auto-eye-cover-toggle>span::after{content:"";position:absolute;left:2px;top:2px;width:10px;height:10px;border-radius:50%;background:#fff;box-shadow:0 1px 3px rgba(15,23,42,.25);transition:transform .16s}
.auto-eye-cover-toggle input:checked+span{background:#222a36;border-color:#222a36}
.auto-eye-cover-toggle input:checked+span::after{transform:translateX(12px)}
.auto-eye-cover-toggle input:focus-visible+span{outline:2px solid rgba(34,42,54,.25);outline-offset:2px}
.image-list{flex:1;min-height:0;overflow-x:auto;overflow-y:hidden;display:flex;grid-template-columns:none;gap:8px;align-items:stretch;align-content:stretch;padding-bottom:2px}
.image-list.empty{display:flex;align-items:center;justify-content:center;min-height:74px;color:#a3acba;font-size:13px;border:1px dashed #dce3ed;border-radius:12px}
.image-drop-empty{display:grid;gap:4px;text-align:center;pointer-events:none}.image-drop-empty strong{color:#667085;font-size:12px}.image-drop-empty small{color:#98a2b3;font-size:10px;font-weight:500}
.image-card{flex:0 0 104px;width:104px;min-height:0;height:84px;padding:6px;border-radius:12px}
.image-card img{height:42px;border-radius:8px}.image-card .name{font-size:11px;margin-top:4px}.image-card .row{gap:4px;margin-top:4px}.image-card .row button{font-size:10px;padding:3px 4px;border-radius:7px}.del{right:2px!important;top:2px!important;width:20px;height:20px;line-height:20px!important}
.editor{min-height:120px}.hint{margin-top:6px}.task-card{grid-template-columns:72px 1fr auto}.task-main p{max-width:100%}
@media(max-width:900px){.grid{grid-template-columns:1fr;grid-template-rows:auto}.task-panel,.prompt-panel,.option-panel{grid-column:auto;grid-row:auto}.image-shelf{height:130px}}
@media(max-width:560px){.image-shelf-title{gap:6px}.auto-eye-cover-toggle{font-size:10px}.auto-eye-cover-toggle>span{flex-basis:26px;width:26px}}

/* 文档要求优化：比例预览、拖拽提示、清空按钮、任务时间布局 */
.prompt-actions{display:flex;justify-content:flex-end;margin-top:8px}
.danger{background:#ef4444!important;border-color:#ef4444!important;color:#fff!important}
.danger:hover{background:#dc2626!important;border-color:#dc2626!important}
.editor.over{border-color:#222a36;background:#f3f6fb}
.ref-tag.dragging{opacity:.45}
.mention-popup{bottom:auto}
.ratio{width:66px;height:60px;gap:3px}
.ratio-visual{width:36px;height:36px;display:flex;align-items:center;justify-content:center}
.rect{display:block;border:2px solid currentColor;border-radius:4px;background:rgba(255,255,255,.55)}
.r916{width:18px;height:32px}.r169{width:32px;height:18px}.r43{width:32px;height:24px}.r34{width:24px;height:32px}.r11{width:28px;height:28px}
.image-card{cursor:grab}.image-card:active{cursor:grabbing}
.task-card{display:grid;grid-template-columns:72px 1fr auto;grid-template-areas:"time time time" "fan main actions";align-items:center;gap:8px 10px;padding:11px}
.task-time{grid-area:time;font-size:13px;font-weight:800;color:#111827;line-height:1.2}
.fan{grid-area:fan}.task-main{grid-area:main;min-width:0}.task-actions{grid-area:actions}.task-title{display:flex;align-items:center;gap:6px;min-width:0}.task-main strong{font-size:13px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;display:inline-block;max-width:72%}.task-main em{display:block}


/* 文档新增优化：100% 缩放完整显示、全页禁止滚动、任务列表独立滚动、IP 状态点、上传独立状态、请求中任务态 */
html,body{width:100%;height:100%;min-height:100%;overflow:hidden}body{height:100vh;min-height:100vh;overflow:hidden}.app-shell{height:100vh;min-height:0;max-height:100vh;padding:10px;gap:8px;overflow:hidden}.topbar{height:72px;min-height:72px;flex-shrink:0;padding:10px 14px}.grid{min-height:0;overflow:hidden;gap:8px}.panel{overflow:hidden}.prompt-panel,.option-panel,.task-panel{min-height:0;overflow:hidden}.task-list{min-height:0;overflow-y:auto;overflow-x:hidden;overscroll-behavior:contain;padding-right:2px}.option-row{grid-template-columns:repeat(4,minmax(0,1fr))}.option-row input,.option-row select,.config-bottom input,.config-bottom select{width:100%;min-width:0}.upload-state{position:absolute;left:6px;top:6px;z-index:2;border-radius:999px;padding:2px 6px;font-size:10px;font-weight:700;background:rgba(17,24,39,.72);color:#fff;max-width:calc(100% - 32px);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.image-card.upload-ok .upload-state{background:#16a34a}.image-card.upload-failed .upload-state{background:#dc2626}.image-card.upload-failed{opacity:.82}.image-error{font-size:10px;color:#be123c;margin-top:3px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.ref-tag img{pointer-events:none}.task-card.pending{background:#f3f4f6;border-color:#d1d5db}.badge.pending{background:#eef0f3;color:#4b5563}button:disabled{opacity:.55;cursor:not-allowed}button:disabled:hover{background:inherit}@media(max-height:760px){.app-shell{padding:8px;gap:6px}.topbar{height:64px;min-height:64px;padding:8px 12px}.grid{gap:6px}.panel{padding:9px}.image-shelf{height:104px;margin-bottom:7px}.editor{min-height:76px}.ratio{width:54px;height:46px}.ratio-visual{height:26px}.hint{font-size:11px;margin-top:5px}.option-panel{gap:6px}.send-btn{height:36px}.prompt-actions{margin-top:6px}.config-bottom{grid-template-columns:1fr 1fr}.config-bottom button{grid-column:1 / -1}}@media(max-width:900px){html,body{overflow:hidden}body{overflow:hidden}.app-shell{height:100vh;min-height:0}.topbar{height:72px;min-height:72px;flex-direction:row;align-items:center}.grid{grid-template-columns:1fr;grid-template-rows:minmax(0,1.2fr) minmax(136px,.5fr) minmax(0,1fr);overflow:hidden}.prompt-panel{grid-column:1;grid-row:1}.option-panel{grid-column:1;grid-row:2}.task-panel{grid-column:1;grid-row:3}.task-panel,.prompt-panel,.option-panel{min-height:0}}


/* 修复配置浮窗 checkbox：避免被 .config-bottom input 通用样式拉大和错位 */
.config-bottom .check{
  display:flex;
  align-items:center;
  gap:6px;
  height:34px;
  line-height:1.2;
  margin:0;
  white-space:nowrap;
}
.config-bottom .check input[type="checkbox"]{
  flex:0 0 auto;
  width:14px;
  height:14px;
  min-width:14px;
  margin:0;
  padding:0;
  vertical-align:middle;
  accent-color:#222a36;
}

/* 修复配置浮窗底部代理配置排版：放大浮窗宽度，避免复选框文案与后续字段重叠 */
.config-card{
  width:min(980px,96vw);
  height:min(640px,90vh);
  max-width:96vw;
}
.config-bottom{
  grid-template-columns:minmax(240px,1.25fr) minmax(150px,.78fr) minmax(230px,1.15fr) minmax(138px,.72fr) 148px;
  gap:12px;
  align-items:end;
}
.config-bottom label:not(.check){
  display:flex;
  flex-direction:column;
  gap:4px;
  min-width:0;
  font-size:12px;
  color:#4b5563;
}
.config-bottom .check{
  width:100%;
  min-width:0;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}
.config-bottom .primary{
  width:100%;
  min-width:0;
  height:44px;
}
.modal-msg{
  line-height:1.45;
  white-space:normal;
  word-break:break-word;
}
@media(max-width:980px), (max-height:760px){
  .config-card{
    width:min(820px,94vw);
    height:min(640px,90vh);
  }
  .config-bottom{
    grid-template-columns:1fr 1fr;
    gap:10px;
  }
  .config-bottom .check{
    grid-column:1 / -1;
    height:auto;
    min-height:34px;
    white-space:normal;
    overflow:visible;
    text-overflow:clip;
  }
  .config-bottom .primary{
    grid-column:1 / -1;
  }
}

/* 配置浮窗底部在 100% 缩放下的最终列宽修正，避免 1024px 左右视口出现横向挤压 */
.config-bottom{
  grid-template-columns:minmax(235px,1.3fr) minmax(145px,.75fr) minmax(220px,1.15fr) minmax(130px,.7fr) 140px;
  gap:12px;
}
@media(max-width:980px), (max-height:760px){
  .config-bottom{
    grid-template-columns:1fr 1fr;
    gap:10px;
  }
}

/* 任务列表：函数5轮询状态 + 右侧视频预览区 */
.task-card{grid-template-columns:minmax(0,2fr) 1px minmax(120px,1fr)!important;align-items:stretch;min-height:136px;gap:12px}.task-left{display:grid;grid-template-columns:82px minmax(0,1fr) auto;gap:10px;align-items:center;min-width:0}.task-video-divider{width:1px;background:#e5e7eb;align-self:stretch}.task-video-box{display:flex;flex-direction:column;align-items:flex-end;justify-content:center;gap:8px;min-width:0}.task-video-box.empty-video{min-height:112px}.task-cover{width:88px;height:88px;object-fit:cover;border-radius:14px;border:1px solid #e5e7eb;background:#f8fafc;cursor:pointer;box-shadow:0 4px 14px rgba(15,23,42,.12)}.download-video{width:88px;text-align:center}.badge.processing{background:#eef0f3;color:#4b5563}.badge.ok{background:#ecfdf3;color:#027a48}.status-submit_failed,.status-failed,.status-retry{border-color:#fecdd3;background:#fff7f8}.status-processing{border-color:#d1d5db;background:#f9fafb}.status-succeed{border-color:#abefc6;background:#fbfffd}.task-error,.task-poll-note{font-size:11px;margin-top:3px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.task-error{color:#be123c}.task-poll-note{color:#6b7280}.retry-query{border-color:#fecdd3;color:#be123c}.video-card{width:min(74vh,88vw);height:min(74vh,88vw);background:rgba(255,255,255,.82);backdrop-filter:blur(6px);display:flex;flex-direction:column;align-items:center;justify-content:center;padding:18px}.video-frame{width:100%;height:calc(100% - 54px);display:flex;align-items:center;justify-content:center;border-radius:16px;background:rgba(15,23,42,.08);overflow:hidden}.video-frame video{max-width:100%;max-height:100%;width:auto;height:auto;border-radius:12px;background:#000}.video-close{background:rgba(107,114,128,.55)!important;color:#fff!important;border:none!important}.video-download-btn{position:absolute;left:50%;bottom:16px;transform:translateX(-50%);background:rgba(15,23,42,.55);color:#fff;border-color:rgba(255,255,255,.28);backdrop-filter:blur(4px)}.video-download-btn:hover{background:rgba(15,23,42,.72)}@media(max-width:900px){.task-card{grid-template-columns:1fr!important}.task-video-divider{display:none}.task-video-box{align-items:flex-start}.task-left{grid-template-columns:82px minmax(0,1fr)}}

/* 本次修复：任务卡片三栏对齐、左侧扇形图靠最左、提示词按钮可点击、视频分割线紧贴预览区且左右留白一致 */
.task-card{
  display:grid!important;
  grid-template-columns:minmax(0,1fr) auto!important;
  grid-template-areas:none!important;
  align-items:stretch!important;
  min-height:136px;
  gap:0!important;
  padding:10px 12px!important;
  overflow:hidden;
}
.task-left{
  display:grid!important;
  grid-template-columns:92px minmax(0,1fr)!important;
  gap:12px!important;
  align-items:stretch!important;
  min-width:0;
}
.task-left .fan{
  grid-area:auto!important;
  width:92px!important;
  height:100%!important;
  min-height:112px;
  align-self:stretch;
  position:relative;
  margin:0;
}
.task-left .fan img{
  width:62px!important;
  height:62px!important;
  border-radius:12px!important;
  object-fit:cover;
  border:2px solid #fff;
  box-shadow:0 4px 12px rgba(15,23,42,.18);
}
.task-left .fan img:nth-child(1){left:2px!important;top:50%!important;transform:translateY(-50%) rotate(-10deg)!important;z-index:1}
.task-left .fan img:nth-child(2){left:18px!important;top:50%!important;transform:translateY(-50%) rotate(3deg)!important;z-index:2}
.task-left .fan img:nth-child(3){left:34px!important;top:50%!important;transform:translateY(-50%) rotate(12deg)!important;z-index:3}
.task-main{
  grid-area:auto!important;
  min-width:0;
  display:flex!important;
  flex-direction:column;
  justify-content:space-between;
  align-items:stretch;
  padding:4px 0 2px;
  text-align:left;
}
.task-head{
  display:flex;
  align-items:center;
  justify-content:flex-start;
  gap:8px;
  min-width:0;
  line-height:1.2;
}
.task-head strong{
  flex:0 0 auto;
  max-width:none!important;
  display:inline!important;
  font-size:14px!important;
  font-weight:900!important;
  color:#111827;
  white-space:nowrap;
}
.task-head .task-time{
  grid-area:auto!important;
  flex:0 1 auto;
  min-width:0;
  font-size:12px!important;
  font-weight:500!important;
  color:#667085!important;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}
.task-head .badge{flex:0 0 auto}
.task-prompt,.task-main p.task-prompt{
  width:100%;
  max-width:100%!important;
  flex:1 1 auto;
  margin:7px 0 6px!important;
  padding:0;
  font-size:12px;
  line-height:1.45;
  color:#667085;
  text-align:left;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}
.task-bottom{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  min-width:0;
}
.task-info{
  display:flex;
  align-items:center;
  justify-content:flex-start;
  gap:12px;
  min-width:0;
  color:#8a94a6;
  font-size:11px;
  white-space:nowrap;
  overflow:hidden;
}
.task-info span{flex:0 0 auto}
.task-actions{
  grid-area:auto!important;
  flex:0 0 auto;
  display:flex!important;
  flex-direction:row!important;
  align-items:center;
  justify-content:flex-end;
  gap:6px;
  position:relative;
  z-index:3;
}
.task-actions button{position:relative;z-index:4;white-space:nowrap}
.task-video-area{
  display:grid;
  grid-template-columns:1px 112px;
  align-items:center;
  align-self:stretch;
  min-width:113px;
  margin-left:12px;
}
.task-video-area .task-video-divider{
  display:block;
  width:1px;
  height:100%;
  background:#e5e7eb;
  align-self:stretch;
}
.task-video-area .task-video-box{
  width:112px;
  min-width:112px;
  min-height:112px;
  display:flex;
  flex-direction:column;
  align-items:center!important;
  justify-content:center;
  gap:8px;
  padding:0;
}
.task-video-area .task-cover{
  width:88px!important;
  height:88px!important;
}
.task-preview-video{
  position:relative;
  display:block;
  width:88px!important;
  height:88px!important;
  padding:0!important;
  overflow:hidden;
  border:0!important;
  border-radius:14px;
  background:#0b0e14!important;
  box-shadow:0 4px 14px rgba(15,23,42,.12);
}
.task-preview-video .task-cover{
  display:block;
  width:100%!important;
  height:100%!important;
  border:0;
  border-radius:inherit;
  object-fit:cover;
  pointer-events:none;
}
.task-cover-play{
  position:absolute;
  left:50%;
  top:50%;
  display:grid;
  width:32px;
  height:32px;
  place-items:center;
  padding-left:2px;
  transform:translate(-50%,-58%);
  border-radius:50%;
  color:#fff;
  background:rgba(15,23,42,.68);
  box-shadow:0 2px 10px rgba(0,0,0,.28);
  pointer-events:none;
}
.task-cover-label{
  position:absolute;
  left:50%;
  bottom:5px;
  transform:translateX(-50%);
  padding:2px 6px;
  border-radius:999px;
  color:#fff;
  background:rgba(15,23,42,.68);
  font-size:10px;
  line-height:1.2;
  pointer-events:none;
}
.task-cover.cover-load-failed{
  opacity:.35;
}
.task-video-area .download-video{
  width:88px!important;
  text-align:center;
}
.task-video-area .empty-video{min-height:112px}
.task-error,.task-poll-note{max-width:100%;text-align:left}
@media(max-width:900px){
  .task-card{grid-template-columns:1fr!important;gap:8px!important}
  .task-left{grid-template-columns:92px minmax(0,1fr)!important}
  .task-video-area{grid-template-columns:1px 112px;margin-left:104px;min-height:112px}
}


/* 本次优化：视频预览浮窗放大、不透明，下载按钮放到视频区域下方，避免遮挡 9:16 视频 */
.video-card{
  width:min(920px,96vw)!important;
  height:min(980px,92vh)!important;
  background:#fff!important;
  backdrop-filter:none!important;
  display:flex!important;
  flex-direction:column!important;
  align-items:center!important;
  justify-content:stretch!important;
  gap:12px!important;
  padding:18px!important;
}
.video-frame{
  flex:1 1 auto!important;
  width:100%!important;
  height:auto!important;
  min-height:0!important;
  background:#111827!important;
}
.video-frame video{
  max-width:100%!important;
  max-height:100%!important;
  width:auto!important;
  height:auto!important;
}
.video-download-btn{
  position:static!important;
  left:auto!important;
  bottom:auto!important;
  transform:none!important;
  flex:0 0 auto!important;
  align-self:center!important;
  background:#111827!important;
  color:#fff!important;
  border-color:#111827!important;
  backdrop-filter:none!important;
}
.video-download-btn:hover{background:#020617!important}
.task-poll-note{display:none!important}

/* 新增：高级参数设置浮窗，替代主参数行中的帧间隔输入 */
.option-panel{overflow:visible;z-index:20}
.option-row{grid-template-columns:repeat(3,minmax(0,1fr))}
.advanced-wrap{position:relative;display:flex;justify-content:flex-end;min-height:34px;z-index:25}
.advanced-btn{height:34px;min-width:132px;font-weight:700;background:#fbfcff}
.advanced-popup{position:absolute;left:0;right:0;bottom:calc(100% + 8px);z-index:60;background:#fff;border:1px solid #e2e8f0;border-radius:16px;padding:12px;box-shadow:0 18px 42px rgba(15,23,42,.18);max-height:min(320px,calc(100vh - 220px));overflow:auto}
.advanced-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px 12px;align-items:end}
.advanced-grid label{font-size:12px;color:#5f6b7d;display:flex;flex-direction:column;gap:4px;min-width:0;font-weight:600}
.advanced-grid input,.advanced-grid select{height:34px;width:100%;min-width:0;border:1px solid #dfe5ee;border-radius:10px;padding:0 8px;background:#fff;color:#1d2433;font-weight:500}
.advanced-grid input:focus,.advanced-grid select:focus{outline:none;border-color:#222a36;box-shadow:0 0 0 3px rgba(34,42,54,.08)}
@media(max-height:760px){.advanced-popup{max-height:min(270px,calc(100vh - 150px));padding:10px}.advanced-grid{gap:8px;grid-template-columns:repeat(2,minmax(0,1fr))}.advanced-btn{height:32px}.advanced-grid input,.advanced-grid select{height:32px}}
@media(max-width:900px){.option-row{grid-template-columns:repeat(3,minmax(0,1fr))}.advanced-popup{left:0;right:0;max-height:min(300px,60vh)}.advanced-grid{grid-template-columns:1fr 1fr}}
@media(max-width:560px){.option-row{grid-template-columns:1fr}.advanced-grid{grid-template-columns:1fr}.advanced-wrap{justify-content:stretch}.advanced-btn{width:100%}}

/* 本次修复：高级参数按钮与分辨率/时长/生成条数同排等宽；弹窗仍从按钮处展开 */
.option-row{grid-template-columns:repeat(4,minmax(0,1fr))!important;align-items:end}
.advanced-wrap{width:100%;min-width:0;align-self:end;justify-content:stretch!important}
.advanced-btn{width:100%!important;min-width:0!important;height:34px!important;border-radius:10px!important;padding:0 8px!important;white-space:nowrap}
.advanced-popup{left:auto!important;right:0!important;width:min(520px,calc(100vw - 32px))!important;bottom:calc(100% + 8px)!important}
@media(max-width:900px){.option-row{grid-template-columns:repeat(4,minmax(0,1fr))!important}.advanced-popup{right:0!important;left:auto!important}}
@media(max-width:560px){.option-row{grid-template-columns:1fr!important}.advanced-wrap{justify-content:stretch!important}.advanced-popup{left:0!important;right:0!important;width:auto!important}}

/* 本次调整：上传图片列表缩略图固定为 1:1，保留原有横向图片列表与操作逻辑 */
.image-shelf{height:138px;min-height:138px;flex:0 0 138px}
.image-list{align-items:stretch;scrollbar-gutter:stable}
.image-card{flex:0 0 104px;width:104px;height:102px;padding:5px;display:flex;flex-direction:column;gap:3px;overflow:hidden;background:linear-gradient(180deg,#fff,#fbfcff);box-shadow:0 4px 12px rgba(15,23,42,.04)}
.image-card img{width:52px!important;height:52px!important;aspect-ratio:1/1;object-fit:cover;border-radius:10px;margin:0 auto;box-shadow:inset 0 0 0 1px rgba(255,255,255,.35);background:#eef2f7;flex:0 0 auto}
.image-card .name{margin-top:0;line-height:1.25;text-align:center;min-height:14px}
.image-card .row{margin-top:auto;gap:4px;flex:0 0 auto}
.image-card .row button{min-width:0;height:22px;line-height:1;padding:0 4px}
.image-error{position:absolute;left:6px;right:6px;bottom:30px;margin-top:0;padding:1px 4px;border-radius:6px;background:rgba(255,255,255,.9);box-shadow:0 1px 4px rgba(190,18,60,.08);text-align:center}
@media(max-height:760px){.image-shelf{height:118px;min-height:118px;flex-basis:118px}.image-card{flex-basis:94px;width:94px;height:84px;padding:4px;gap:2px}.image-card img{width:40px!important;height:40px!important;border-radius:8px}.image-card .row button{height:19px;font-size:10px}.image-error{bottom:24px}}
@media(max-width:900px){.image-shelf{height:132px;min-height:132px;flex-basis:132px}.image-card{height:96px}.image-card img{width:48px!important;height:48px!important}}

/* 文档优化：任务卡片略增高度，避免内容溢出；失败任务在视频按钮区域显示重新生成 */
.task-card{min-height:152px!important;}
.task-left .fan{min-height:128px!important;}
.task-video-area .task-video-box,.task-video-area .empty-video{min-height:128px!important;}
.task-video-area .retry-generate{width:88px!important;text-align:center;}


/* 客户端卡密状态与配置窗口 */
.license-card{min-width:220px;height:50px;padding:7px 12px;border-radius:14px;background:#f7f9fd;border:1px solid #e8edf6;display:flex;flex-direction:column;justify-content:center}
.license-card span{font-size:11px;color:#8a94a6}.license-card strong{font-size:13px}.license-card em{font-size:11px;color:#667085;font-style:normal;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:280px}.modal-label{display:flex;flex-direction:column;gap:6px;margin:8px 0 10px;font-size:13px;color:#4b5563}.modal-label input{height:38px;border:1px solid #dfe5ee;border-radius:12px;padding:0 10px;background:#fff}.client-config-bottom{display:flex!important;justify-content:flex-end!important;grid-template-columns:none!important}.client-config-bottom .primary{width:auto!important;min-width:180px}.config-card textarea#licenseTextInput{min-height:250px}
@media(max-width:900px){.top-actions{flex-wrap:wrap;justify-content:flex-end}.license-card{min-width:180px}.topbar{height:auto;min-height:92px}.grid{grid-template-rows:minmax(0,1.05fr) minmax(136px,.5fr) minmax(0,1fr)}}

/* 本次调整：服务器连通测试按钮 + 卡密验证阶段详细错误展示 */
.client-config-bottom{gap:10px;align-items:center;flex-wrap:wrap}
.client-config-bottom button{width:auto!important;min-width:160px;height:40px}
.client-config-bottom .primary{min-width:180px!important}
.config-card .modal-msg{white-space:pre-wrap;word-break:break-word;max-height:170px;overflow:auto;border-radius:10px;padding:0;font-family:Consolas,"Microsoft YaHei",monospace}
.config-card .modal-msg:not(:empty){padding:8px 10px;background:#fff7f8;border:1px solid #fecdd3}
.config-card .modal-msg:not(:empty){color:inherit}
@media(max-width:560px){.client-config-bottom button{width:100%!important}.client-config-bottom .primary{width:100%!important}}

.config-card .modal-msg.config-msg-success:not(:empty){background:#ecfdf3!important;border-color:#86efac!important;color:#065f46!important}
.config-card .modal-msg.config-msg-error:not(:empty){background:#fff1f2!important;border-color:#fda4af!important;color:#9f1239!important}


/* Final client cleanup: fixed backend, no IP card, readable license/quota, preserved prompt line breaks. */
.top-actions{flex-wrap:wrap;justify-content:flex-end;max-width:620px}
.license-card{min-width:470px!important;max-width:520px!important;width:clamp(470px,42vw,520px)!important;height:66px!important;min-height:66px!important;padding:8px 12px!important;margin-right:8px!important;gap:4px!important}
.license-card strong,.license-card em{display:block;max-width:100%!important;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;line-height:1.35}
.license-card em{white-space:normal!important;overflow:visible!important;text-overflow:clip!important;display:flex!important;flex-direction:column;justify-content:center;gap:2px;line-height:1.15!important}
.license-card .quota-line{display:flex;align-items:center;gap:5px;white-space:nowrap;overflow:hidden;font-size:11px}.license-card .quota-line b{font-weight:500;color:#7a8497}.license-card .quota-line strong{display:inline!important;font-size:12px;color:inherit;overflow:visible;max-width:none;margin-right:4px}
.task-image-placeholder{position:absolute;left:0;top:50%;width:58px;height:58px;transform:translateY(-50%);display:flex;align-items:center;justify-content:center;border:1px dashed #cbd5e1;border-radius:10px;background:#f8fafc;color:#98a2b3;font-size:10px}
.task-image-unavailable{border-style:solid!important;border-color:#aab3c1!important;background:#e7ebf1!important;color:#667085!important;font-weight:700;line-height:1.2;text-align:center;box-shadow:0 3px 8px rgba(15,23,42,.12)}
.media-load-failed{background:linear-gradient(135deg,#1b2230,#121722)!important;border:1px dashed #526078!important;color:#8f9db4!important;object-fit:contain!important}
.task-left .fan .task-image-placeholder:nth-child(2){left:12px}.task-left .fan .task-image-placeholder:nth-child(3){left:24px}
.editor{white-space:pre-wrap;word-break:break-word;overflow-wrap:anywhere}
.config-card{width:min(680px,94vw)!important;height:min(560px,88vh)!important}
.config-card textarea#licenseTextInput{min-height:300px!important}
.client-config-bottom{justify-content:flex-end!important;gap:10px!important}
.modal-msg{line-height:1.5!important}
@media(max-width:900px){.top-actions{justify-content:flex-start;max-width:100%}.license-card{min-width:100%!important;max-width:100%!important;width:100%!important;height:66px!important;margin-right:0!important}.topbar{height:auto!important;min-height:92px!important}}
@media(min-width:901px){.top-actions{flex:1;min-width:0;gap:8px}.top-actions .license-card{margin-left:auto}}

/* License card final layout: keep it inside the topbar and preserve all other visuals. */
@media(min-width:901px){
  .topbar{overflow:visible!important}
  .top-actions{max-width:none!important;flex-wrap:nowrap!important;justify-content:flex-end!important}
  .top-actions .license-card{flex:0 0 430px!important;width:430px!important;min-width:430px!important;max-width:430px!important;height:58px!important;min-height:58px!important;margin-left:8px!important;margin-right:0!important;padding:7px 12px!important}
  .license-card>span{display:block!important;line-height:14px!important}
  .license-card>strong{display:block!important;line-height:15px!important;font-size:13px!important}
  .license-card>em{display:block!important;height:18px!important;line-height:18px!important;overflow:hidden!important;white-space:nowrap!important}
  .license-card .quota-line{display:flex!important;align-items:center!important;gap:5px!important;white-space:nowrap!important;overflow:hidden!important;line-height:18px!important}
}
@media(min-width:901px) and (max-width:1250px){
  .top-actions .license-card{flex-basis:350px!important;width:350px!important;min-width:350px!important;max-width:350px!important}
  .license-card .quota-line{gap:3px!important;font-size:10px!important}
  .license-card .quota-line strong{font-size:11px!important;margin-right:2px!important}
}

/* Responsive topbar: on narrow screens use three calm rows instead of squeezing controls. */
@media(max-width:900px){
  .topbar{height:auto!important;min-height:0!important;display:flex!important;flex-direction:column!important;align-items:stretch!important;gap:9px!important;padding:11px 13px!important;overflow:visible!important}
  .topbar>div:first-child{flex:0 0 auto!important}
  .top-actions{width:100%!important;max-width:none!important;display:flex!important;flex-wrap:wrap!important;align-items:center!important;justify-content:flex-start!important;gap:7px!important}
  .top-actions .announcement-bell,.top-actions .theme-toggle,.top-actions #configBtn{flex:0 0 auto!important}
  .top-actions .license-card{order:10!important;flex:1 0 100%!important;width:100%!important;min-width:0!important;max-width:none!important;height:58px!important;min-height:58px!important;margin:0!important;padding:7px 11px!important}
  .license-card>span{display:block!important;line-height:14px!important}
  .license-card>strong{display:block!important;line-height:15px!important}
  .license-card>em{display:block!important;height:18px!important;line-height:18px!important;overflow:hidden!important;white-space:nowrap!important}
  .license-card .quota-line{display:flex!important;align-items:center!important;gap:4px!important;white-space:nowrap!important;overflow:hidden!important;font-size:10px!important}
  .license-card .quota-line strong{font-size:11px!important;margin-right:2px!important}
}

/* Asset library and concurrency update */
.prompt-section-title{gap:10px}
.prompt-upload-actions{margin-left:auto;display:flex;align-items:center;justify-content:flex-end;gap:8px}
.audio-reference-row{display:flex;align-items:center;gap:8px;min-height:34px;margin:-3px 0 7px;border:1px solid #e5eaf2;border-radius:10px;padding:5px 8px;background:#fbfcff}.audio-reference-row strong{display:flex;gap:5px;flex:0 0 auto;font-size:11px;color:#4b5563}.audio-reference-row em{font-style:normal;color:#8a94a6}.audio-reference-list{display:flex;gap:5px;overflow-x:auto;min-width:0}.audio-reference-item{display:flex;align-items:center;gap:4px;max-width:180px;background:#eef2f7;border-radius:8px;padding:3px 5px;font-size:10px;white-space:nowrap}.audio-reference-item span{overflow:hidden;text-overflow:ellipsis}.audio-reference-item button{border:0;background:transparent!important;color:#be123c;padding:0;width:16px;height:16px;line-height:16px}.media-empty{font-size:10px;color:#a1a9b8;padding:3px 0}
.asset-open-btn{min-width:78px;background:#0b2a5b!important;border-color:#0b2a5b!important;color:#fff!important;font-weight:700}
.asset-open-btn:hover{background:#071f44!important;border-color:#071f44!important}
.asset-modal{background:rgba(2,6,23,.58)!important}
.asset-card{width:75vw!important;height:75vh!important;max-width:none!important;max-height:none!important;background:#111827!important;color:#f8fafc!important;border:1px solid rgba(148,163,184,.35)!important;border-radius:20px!important;box-shadow:0 28px 80px rgba(0,0,0,.42)!important;display:flex!important;flex-direction:column!important;gap:12px!important;padding:18px!important;overflow:hidden!important}
.asset-close,.asset-preview-close{background:#ef4444!important;color:#fff!important;border:none!important;font-size:22px!important;line-height:1!important}
.asset-head{display:flex;align-items:center;justify-content:space-between;gap:12px;flex:0 0 auto;padding-right:38px}
.asset-head h2{font-size:18px;color:#fff;margin:0 0 6px}
.asset-head p{margin:0;color:#aab4c4;font-size:12px;line-height:1.45}
.asset-head-actions{display:flex;align-items:center;gap:8px;flex:0 0 auto}
.asset-head-actions .small{height:32px;min-width:88px}
.asset-grid{position:relative;flex:1 1 auto;min-height:0;overflow:auto;border:1px dashed rgba(148,163,184,.42);border-radius:16px;padding:14px;display:grid;grid-template-columns:repeat(auto-fill,minmax(132px,1fr));gap:14px;align-content:start;background:rgba(15,23,42,.82);user-select:none}
.asset-grid.empty{display:flex;align-items:center;justify-content:center;text-align:center;color:#94a3b8;font-size:14px;cursor:pointer}
.asset-card.over .asset-grid,.asset-grid:hover{border-color:#93c5fd;background:rgba(15,23,42,.92)}
.asset-item{position:relative;min-width:0;border:1px solid rgba(148,163,184,.24);border-radius:16px;background:#1f2937;padding:10px;display:flex;flex-direction:column;gap:8px;overflow:hidden;cursor:pointer;box-shadow:0 8px 24px rgba(0,0,0,.18)}
.asset-item.selected{outline:3px solid #60a5fa;border-color:#bfdbfe;background:#24344a}
.asset-item img{width:100%;aspect-ratio:1/1;height:auto;object-fit:cover;border-radius:12px;background:#0f172a;display:block;box-shadow:inset 0 0 0 1px rgba(255,255,255,.08)}
.asset-name-row{display:flex;align-items:center;justify-content:center;gap:4px;min-width:0;min-height:24px}
.asset-name{font-size:13px;line-height:1.3;max-width:calc(100% - 24px);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;text-align:center;color:#e5e7eb}
.asset-rename{width:18px;height:18px;min-width:18px;padding:0!important;border:none!important;background:transparent!important;color:#cbd5e1!important;border-radius:4px!important;font-size:14px!important;line-height:18px!important}
.asset-rename:hover{background:rgba(148,163,184,.18)!important;color:#fff!important}
.asset-name-input{width:100%;height:24px;border:1px solid #60a5fa;border-radius:8px;background:#0f172a;color:#fff;text-align:center;padding:0 6px;outline:none;font-size:13px}
.asset-selection-box{position:absolute;z-index:6;border:1px solid #60a5fa;background:rgba(96,165,250,.18);pointer-events:none;border-radius:6px}
.asset-footer{display:flex;align-items:center;justify-content:space-between;gap:12px;flex:0 0 auto;min-height:38px}
#assetMsg{font-size:12px;color:#bbf7d0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;min-width:0}
#assetMsg.bad{color:#fecdd3}
.asset-delete-all,.asset-delete-selected{height:36px;min-width:138px;font-weight:700;color:#fff!important;border:none!important;flex:0 0 auto}
.asset-delete-all{background:#dc2626!important}
.asset-delete-all:hover{background:#b91c1c!important}
.asset-delete-selected{background:#6b7280!important}
.asset-delete-selected:hover{background:#4b5563!important}
.asset-delete-all:disabled,.asset-delete-selected:disabled{opacity:.45;cursor:not-allowed}
.asset-preview-modal{background:rgba(2,6,23,.72)!important;cursor:zoom-out}
.asset-preview-card{width:min(920px,90vw)!important;height:min(880px,88vh)!important;background:#0b1120!important;border:1px solid rgba(148,163,184,.35)!important;display:flex!important;align-items:center!important;justify-content:center!important;padding:18px!important;cursor:zoom-out}
.asset-preview-card img{max-width:100%;max-height:100%;object-fit:contain;border-radius:12px;box-shadow:0 20px 60px rgba(0,0,0,.45)}
@media(max-width:900px){.asset-card{width:92vw!important;height:82vh!important}.asset-head{align-items:flex-start;flex-direction:column}.asset-head-actions{width:100%;justify-content:flex-end}.asset-grid{grid-template-columns:repeat(auto-fill,minmax(110px,1fr));gap:10px}.prompt-upload-actions{gap:6px}.asset-open-btn{min-width:72px}}

/* Task restore/reroll additions */
.task-actions{flex-direction:column!important;align-items:flex-end!important;justify-content:center!important;gap:6px!important}
.task-actions .reroll-task,.task-actions .use{width:88px!important;text-align:center!important}
.status-restoring{border-color:#d1d5db;background:#f9fafb}


/* Project optimization: per-card task selection and short-card notices */
.hidden{display:none!important}
.portrait-upload-btn{border-color:#8b5cf6!important;color:#6d28d9!important;background:#f5f3ff!important;font-weight:700}.portrait-upload-btn:hover{background:#ede9fe!important}
.portrait-tool-card{width:min(1040px,94vw);max-height:92vh;overflow:auto;padding:26px}.portrait-tool-head{display:flex;align-items:flex-start;justify-content:space-between;gap:18px;padding-right:34px}.portrait-tool-head h2{margin:0 0 6px}.portrait-tool-head p{max-width:760px;margin:0;color:var(--muted);font-size:13px;line-height:1.6}.portrait-tool-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px;margin-top:20px}.portrait-tool-pane{display:grid;grid-template-rows:auto minmax(280px,1fr);gap:8px;min-width:0}.portrait-tool-pane>strong{display:flex;align-items:center;justify-content:space-between;gap:8px;font-size:13px}.portrait-tool-pane>strong em{font-style:normal;color:var(--muted);font-size:11px}.portrait-tool-batch-list{min-height:280px;max-height:470px;overflow:auto;border:1px dashed var(--border);border-radius:12px;background:var(--surface-soft);padding:10px;display:grid;grid-template-columns:repeat(auto-fill,minmax(124px,1fr));gap:10px;align-content:start;color:var(--muted);font-size:13px}.portrait-tool-batch-list.empty{display:grid;place-items:center}.portrait-tool-batch-card{position:relative;min-width:0;border:1px solid var(--border);border-radius:8px;background:var(--surface);padding:6px;display:flex;flex-direction:column;gap:5px}.portrait-tool-batch-card img,.portrait-tool-result-placeholder{width:100%;aspect-ratio:1/1;object-fit:contain;border-radius:6px;background:#eef1f6}.portrait-tool-result-placeholder{display:grid;place-items:center;color:var(--muted);font-size:11px}.portrait-tool-result-placeholder.processing{color:#7c3aed;background:#f3e8ff}.portrait-tool-result-placeholder.failed{color:#be123c;background:#fff1f2}.portrait-tool-batch-card>span{min-height:16px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:var(--muted);font-size:10px;text-align:center}.portrait-tool-batch-card>span.error{color:#be123c}.portrait-tool-remove{position:absolute;right:3px;top:3px;z-index:2;width:22px;height:22px;padding:0!important;border:0!important;border-radius:50%!important;background:rgba(190,18,60,.9)!important;color:#fff!important;line-height:22px}.portrait-tool-status{min-height:22px;margin-top:15px;color:var(--muted);font-size:12px;line-height:1.6}.portrait-tool-status.error{color:#be123c}.portrait-tool-actions{display:flex;justify-content:flex-end;flex-wrap:wrap;gap:9px;margin-top:12px}.portrait-tool-actions button{min-height:38px}.portrait-tool-actions button:disabled{opacity:.48;cursor:not-allowed}
.portrait-tool-drop-zone{transition:border-color .16s ease,background-color .16s ease,box-shadow .16s ease}.portrait-tool-drop-zone.over{border-color:var(--accent);background:rgba(124,58,237,.08);box-shadow:inset 0 0 0 2px rgba(124,58,237,.16)}
.portrait-tool-modes{display:inline-flex;gap:4px;margin-top:16px;padding:4px;border:1px solid var(--control-border);border-radius:8px;background:var(--surface-soft)}.portrait-tool-modes button{min-width:108px;border:0;border-radius:6px;padding:7px 12px;background:transparent;color:var(--muted);font-size:12px;font-weight:700}.portrait-tool-modes button.active{background:var(--accent);color:#fff}.portrait-tool-modes button:disabled{opacity:.5;cursor:not-allowed}
html[data-theme="dark"] .portrait-upload-btn{border-color:#8b5cf6!important;color:#c4b5fd!important;background:#221936!important}html[data-theme="dark"] .portrait-upload-btn:hover{background:#2e2148!important}html[data-theme="dark"] .portrait-tool-batch-card{background:#171b25;border-color:#343c4d}html[data-theme="dark"] .portrait-tool-batch-card img,html[data-theme="dark"] .portrait-tool-result-placeholder{background:#0b0e14}
@media(max-width:760px){.portrait-tool-card{padding:18px}.portrait-tool-head{align-items:stretch;flex-direction:column;padding-right:28px}.portrait-tool-grid{grid-template-columns:1fr}.portrait-tool-pane{grid-template-rows:auto minmax(220px,1fr)}.portrait-tool-batch-list{min-height:220px;max-height:340px;grid-template-columns:repeat(auto-fill,minmax(104px,1fr))}.portrait-tool-actions{justify-content:stretch}.portrait-tool-actions button{flex:1 1 140px}}
.task-title-actions{display:flex;align-items:center;gap:8px}
.task-title-actions .danger{background:#be123c!important;border-color:#be123c!important;color:#fff!important;font-weight:700}
.task-title-actions .danger:hover{background:#9f1239!important;border-color:#9f1239!important}
.task-card{position:relative!important}
.task-retention-note{margin:0 0 8px;color:#8993a5;font-size:11px;line-height:1.4}
.task-select{position:absolute;left:10px;top:10px;width:22px;height:22px;z-index:3;display:flex;align-items:center;justify-content:center;cursor:pointer}
.task-select input{position:absolute;opacity:0;pointer-events:none}
.task-select span{width:19px;height:19px;border-radius:50%;border:2px solid #cbd5e1;background:#fff;box-shadow:0 2px 8px rgba(15,23,42,.10);display:block}
.task-select input:checked + span{background:#111827;border-color:#111827;box-shadow:inset 0 0 0 4px #fff,0 2px 8px rgba(15,23,42,.16)}
.task-card.task-selected{outline:2px solid #11182722;background:#fbfcff}
.task-card .fan{margin-left:18px}
.portrait-tool-batch-card img[data-portrait-result]{cursor:zoom-in}
#previewModal{z-index:130}
.config-card textarea#licenseTextInput{min-height:76px!important;height:86px!important;max-height:96px!important;line-height:1.45!important;font-size:13px!important;resize:none!important}
.config-card{height:auto!important;min-height:0!important;max-height:min(460px,88vh)!important}
.expire-notice-modal{background:rgba(15,23,42,.42)!important;z-index:80!important}
.expire-notice-card{width:min(560px,92vw)!important;min-height:310px!important;padding:30px 32px 20px!important;display:flex!important;flex-direction:column!important;justify-content:space-between!important;text-align:center!important}
.expire-notice-content{display:flex;flex-direction:column;align-items:center;justify-content:center;flex:1;gap:0}
.expire-notice-content .notice-line{margin:0;text-align:center;line-height:1.7;font-size:20px;color:#111827;font-weight:400}
.expire-notice-content .notice-line-2{margin-top:44px}
.expire-notice-content .notice-line-3{margin-top:44px;color:#dc2626!important;font-weight:800!important;font-size:24px!important}
.expire-notice-footer{display:flex;align-items:center;justify-content:space-between;gap:16px;margin-top:24px}
.notice-skip{font-size:13px;color:#4b5563;display:flex;align-items:center;gap:6px;user-select:none}
#expireNoticeCloseBtn{min-width:96px;height:38px}
@media(max-width:560px){.expire-notice-card{padding:24px 18px 18px!important}.expire-notice-content .notice-line{font-size:17px}.expire-notice-content .notice-line-3{font-size:21px!important}.expire-notice-footer{align-items:stretch;flex-direction:column}.notice-skip{justify-content:flex-start}#expireNoticeCloseBtn{width:100%}}


/* Fixed prompt content box */
.fixed-prompt-wrap{display:flex;flex-direction:column;gap:6px;margin-top:8px;flex:0 0 auto;min-height:100px;font-size:12px;color:#6c7586}
.fixed-prompt-wrap span{font-weight:700;color:#4b5563}
.fixed-prompt-head{display:flex;align-items:center;justify-content:space-between;gap:10px;min-height:28px}
.fixed-prompt-head-actions{display:flex;align-items:center;justify-content:flex-end;gap:8px;min-width:0}
.fixed-prompt-preset-select{min-width:180px;max-width:320px;height:32px;border:1px solid #dfe5ee;border-radius:9px;background:#fff;padding:0 30px 0 9px;color:#2a3344;font:inherit}
.fixed-prompt-head .danger{flex:0 0 auto;padding:5px 10px}
.fixed-prompt-input{width:100%;min-height:66px;max-height:118px;resize:vertical;border:1px solid #dfe5ee;border-radius:14px;background:#fbfcff;padding:10px 12px;outline:none;line-height:1.45;font-size:13px;font-family:inherit;color:#1d2433}
.fixed-prompt-input:focus{border-color:#94a3b8;background:#fff}
.prompt-character-counter{margin-top:-2px;padding-right:4px;text-align:right;font-size:12px;line-height:18px;color:#8a94a6;flex:0 0 auto}.prompt-character-counter.over-limit{color:#dc2626;font-weight:700}.edit-prompt-character-counter{margin-top:-8px;padding-right:58px}
@media(max-height:760px){.prompt-panel{overflow-y:auto}.fixed-prompt-input{min-height:50px;max-height:84px}.fixed-prompt-wrap{margin-top:6px;min-height:86px}}


/* Project optimization requested in uploaded document: image re-upload, stable task previews, and tighter task-left layout */
.image-list.over{border-color:#222a36;background:#f3f6fb}
.image-card .row .reupload{font-weight:700}
.task-card{padding:8px 12px 10px 8px!important}
.task-left{grid-template-columns:76px minmax(0,1fr)!important;gap:8px!important}
.task-left .fan{width:76px!important;min-height:128px!important;margin-left:0!important;transform:translateX(-4px)}
.task-left .fan img{width:58px!important;height:58px!important}
.task-left .fan img:nth-child(1){left:0!important}
.task-left .fan img:nth-child(2){left:12px!important}
.task-left .fan img:nth-child(3){left:24px!important}
.task-select{left:4px!important;top:4px!important;width:20px!important;height:20px!important}
.task-select span{width:17px!important;height:17px!important}
@media(max-width:900px){.task-left{grid-template-columns:76px minmax(0,1fr)!important}.task-video-area{margin-left:88px!important}}

/* Requested update pack: upload retry, task toolbar, edit prompt dialog, desktop download, server selector, and compact desktop scale. */
.success{background:#16a34a!important;border-color:#16a34a!important;color:#fff!important;font-weight:700}.success:hover{background:#15803d!important;border-color:#15803d!important}.image-card .row.single{justify-content:center}.image-card .row.single button{flex:0 0 64px}.image-card .row.dual{justify-content:center}.image-card .row.dual button{flex:0 0 58px}.image-card .retry-upload{font-weight:700}.task-section-title{display:grid!important;grid-template-columns:auto 1fr auto;align-items:center;gap:10px}.task-section-title h2{text-align:center}.task-title-actions{justify-content:flex-end}.task-actions{flex-direction:row!important;align-items:center!important;justify-content:flex-end!important;gap:6px!important;flex-wrap:wrap}.task-actions .reroll-task,.task-actions .use,.task-actions .modify-prompt{width:88px!important;text-align:center!important}.badge.waiting{background:#eef2ff;color:#3730a3}.status-queued{border-color:#c7d2fe;background:#f8faff}.status-submitting{border-color:#fde68a;background:#fffbeb}.edit-prompt-card{width:min(860px,94vw);height:min(720px,90vh);display:flex;flex-direction:column;gap:12px;padding:18px}.edit-prompt-head{display:flex;align-items:center;justify-content:space-between;padding-right:36px}.edit-image-shelf{height:150px;margin-bottom:0}.edit-prompt-editor{min-height:220px;flex:1}.edit-prompt-send{position:absolute;right:18px;bottom:18px;width:44px;height:44px;border-radius:50%!important;background:#111827!important;color:#fff!important;border-color:#111827!important;font-size:20px!important;line-height:1!important;padding:0!important;display:flex;align-items:center;justify-content:center}.download-card{width:min(560px,92vw)}.download-card h2{margin-bottom:14px}.download-path-row{display:flex;gap:8px;align-items:center}.download-path-row input{flex:1;height:34px;border:1px solid #dfe5ee;border-radius:10px;padding:0 10px}.download-modal-actions{display:flex;justify-content:flex-end;margin-top:16px}.confirm-delete-card{width:min(420px,90vw);text-align:center}.confirm-delete-card p{margin:14px 8px 20px;font-size:15px}.confirm-actions{display:flex;justify-content:center;gap:14px}.confirm-actions button{min-width:96px}.danger-confirm{background:#be123c!important;border-color:#be123c!important}.client-server-picker{position:relative;margin:8px 0 10px}.client-server-picker label{display:block;font-size:12px;color:#667085;margin-bottom:6px}.client-server-select{width:100%;height:38px;display:flex;align-items:center;justify-content:space-between;border:1px solid #dfe5ee;background:#fff;border-radius:12px;padding:0 12px}.client-server-drawer{position:absolute;left:0;right:0;top:64px;z-index:5;background:#fff;border:1px solid #e5e7eb;border-radius:14px;box-shadow:0 14px 36px rgba(15,23,42,.16);padding:6px;max-height:190px;overflow:auto}.client-server-item{height:34px;border-radius:10px;padding:0 10px;display:flex;align-items:center;justify-content:space-between;cursor:pointer;font-size:13px}.client-server-item:hover,.client-server-item.active{background:#f3f6fb;font-weight:700}.client-config-bottom{display:flex!important;justify-content:flex-end!important}.client-config-bottom .primary{min-width:150px!important}.config-card{max-height:min(520px,88vh)!important}.modal.click-close{cursor:pointer}.modal.click-close .modal-card{cursor:auto}
@media(max-height:760px){.edit-prompt-card{height:92vh}.edit-image-shelf{height:118px}.edit-prompt-editor{min-height:160px}.task-actions .reroll-task,.task-actions .use,.task-actions .modify-prompt{width:82px!important}}
@media (max-aspect-ratio:16/9) and (max-height:820px){.app-shell{transform:scale(.9);transform-origin:top left;width:111.111vw;height:111.111vh}}


/* Requested final adjustment: hide server URLs, replace drawer chevrons, and keep task buttons right aligned. */
.client-server-select .select-caret{width:8px;height:8px;border-right:2px solid #667085;border-bottom:2px solid #667085;transform:rotate(45deg);margin-left:10px;flex:0 0 auto}
.client-server-select[aria-expanded="true"] .select-caret{transform:rotate(225deg);margin-top:4px}
.client-server-item{justify-content:flex-start!important}
.client-server-item span{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.client-server-item em{display:none!important}
.task-actions{flex-direction:row!important;align-items:center!important;justify-content:flex-end!important;gap:6px!important;flex-wrap:wrap}
.task-actions .reroll-task,.task-actions .modify-prompt,.task-actions .use{width:88px!important;text-align:center!important}
@media(max-height:760px){.task-actions .reroll-task,.task-actions .modify-prompt,.task-actions .use{width:82px!important}}


/* Web-only download modal modes */
.download-card{width:min(560px,92vw)!important;padding:18px!important}
.download-mode-tabs{display:grid;grid-template-columns:1fr 1fr;gap:8px;margin-bottom:18px}
.download-mode-tab{height:36px;border-radius:12px;border:1px solid #dfe5ee;background:#f8fafc;color:#334155;font-weight:700}
.download-mode-tab.active{background:#111827;color:#fff;border-color:#111827}
.download-mode-panel{display:none;gap:14px}
.download-modal[data-mode="download"] .download-directory-panel{display:flex;flex-direction:column}
.download-modal[data-mode="package"] .download-package-panel{display:flex;flex-direction:column}
.download-main-input{width:100%;height:40px;border:1px solid #dfe5ee;border-radius:12px;padding:0 12px;font-size:14px;background:#fff;color:#111827}
.download-modal-actions{display:flex!important;justify-content:flex-end!important;gap:10px!important;margin-top:0!important}
.download-modal-actions .primary{min-width:92px}


/* Requested download notices and readable license verification result. */
.config-card .modal-msg{font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Microsoft YaHei",Arial,sans-serif!important;font-size:14px!important;font-weight:700!important;line-height:1.55!important;letter-spacing:.01em!important}
.download-notice{position:fixed;left:50%;top:18%;transform:translate(-50%,-50%);z-index:2147483647;min-width:126px;max-width:min(360px,calc(100vw - 32px));padding:7px 14px;border-radius:999px;text-align:center;font-size:13px;font-weight:800;line-height:1.35;box-shadow:0 10px 28px rgba(15,23,42,.18);pointer-events:none;animation:downloadNoticeIn .16s ease-out}
.download-notice-ok{background:#dcfce7;border:1px solid #86efac;color:#166534}
.download-notice-fail{background:#fee2e2;border:1px solid #fca5a5;color:#b91c1c}
@keyframes downloadNoticeIn{from{opacity:0;transform:translate(-50%,-62%)}to{opacity:1;transform:translate(-50%,-50%)}}

/* Announcement and light/dark theme switch */
:root{color-scheme:light;--page-bg:#f6f7fb;--surface:#fff;--surface-soft:#fbfcff;--text:#1d2433;--muted:#7a8497;--border:#e9edf5;--control-border:#dfe5ee;--accent:#222a36;--announcement-bg:#f5efff;--announcement-border:#dfc4ff;--announcement-text:#5b21b6}
html[data-theme="dark"]{color-scheme:dark;--page-bg:#090b11;--surface:#11141c;--surface-soft:#171b25;--text:#eef2ff;--muted:#aab4c8;--border:#252b39;--control-border:#343c4d;--accent:#8b5cf6;--announcement-bg:#1b1530;--announcement-border:#6544a6;--announcement-text:#e9d5ff}
body{background:var(--page-bg);color:var(--text);transition:background .2s ease,color .2s ease}
.topbar,.panel,.modal-card{background:var(--surface);border-color:var(--border);color:var(--text)}
.topbar p,.hint,.task-main p,.task-main em,.option-row label,.announcement-content span{color:var(--muted)}
button,.option-row input,.option-row select,.config-bottom input,.config-bottom select,.download-main-input{background:var(--surface);border-color:var(--control-border);color:var(--text)}
.editor,.image-shelf,.task-card,.ratio,.image-card{background:var(--surface-soft);border-color:var(--control-border);color:var(--text)}
.primary,.send-btn{background:var(--accent);border-color:var(--accent)}
 .ratio-field{min-width:0}.ratio-field>select{width:100%;min-width:0}
.theme-toggle{width:36px;height:36px;border-radius:999px;padding:0;font-size:18px;display:grid;place-items:center;background:var(--surface-soft);border-color:var(--control-border)}
.announcement-bar{display:flex;align-items:center;gap:10px;min-height:44px;padding:9px 13px;border:1px solid var(--announcement-border);border-radius:14px;background:var(--announcement-bg);color:var(--announcement-text);box-shadow:0 6px 18px rgba(90,50,140,.08)}
.announcement-icon{flex:0 0 auto;font-size:11px;font-weight:800;padding:4px 7px;border-radius:999px;background:var(--announcement-text);color:#fff}
.announcement-content{min-width:0;display:flex;align-items:baseline;gap:8px;flex:1;line-height:1.45}.announcement-content strong{font-size:13px;white-space:nowrap}.announcement-content span{font-size:12px;white-space:pre-wrap;overflow:hidden;text-overflow:ellipsis}
.announcement-close{flex:0 0 auto;width:28px;height:28px;padding:0;border:0;background:transparent;color:var(--announcement-text);font-size:20px;line-height:1}.announcement-close:hover{background:rgba(127,87,180,.12)}
html[data-theme="dark"] .modal{background:rgba(0,0,0,.58)}
@media(max-width:700px){.announcement-content{display:block}.announcement-content strong{display:block}.announcement-content span{display:block;white-space:nowrap}.announcement-bar{align-items:flex-start}}
html[data-theme="dark"] body{background:var(--page-bg);color:var(--text)}
html[data-theme="dark"] .topbar,html[data-theme="dark"] .panel,html[data-theme="dark"] .modal-card{background:var(--surface);border-color:var(--border);color:var(--text);box-shadow:0 8px 22px rgba(0,0,0,.24)}
html[data-theme="dark"] button,html[data-theme="dark"] .ratio,html[data-theme="dark"] .image-shelf,html[data-theme="dark"] .editor,html[data-theme="dark"] .image-card,html[data-theme="dark"] .task-card,html[data-theme="dark"] .config-card textarea,html[data-theme="dark"] .option-row input,html[data-theme="dark"] .option-row select,html[data-theme="dark"] .config-bottom input,html[data-theme="dark"] .config-bottom select{background:var(--surface-soft);color:var(--text);border-color:var(--control-border)}
html[data-theme="dark"] button:hover{background:#202737}html[data-theme="dark"] .primary,html[data-theme="dark"] .send-btn{background:#8b5cf6;border-color:#8b5cf6;color:#fff}html[data-theme="dark"] .ratio.active{background:#29233d;border-color:#a78bfa}
html[data-theme="dark"] .mention-popup{background:var(--surface);border-color:var(--border);color:var(--text)}html[data-theme="dark"] .mention-item:hover{background:#202737}html[data-theme="dark"] .ref-tag{background:#202737;border-color:#3a4558;color:var(--text)}html[data-theme="dark"] .audio-ref-tag span{background:#263b63!important;color:#bfdbfe!important}
html[data-theme="dark"] .auto-eye-cover-toggle{color:#aab4c8}html[data-theme="dark"] .auto-eye-cover-toggle>span{background:#343c4d;border-color:#4b5568}html[data-theme="dark"] .auto-eye-cover-toggle input:checked+span{background:#8b5cf6;border-color:#8b5cf6}
html[data-theme="dark"] .audio-reference-row,html[data-theme="dark"] .audio-reference-item{background:var(--surface-soft);border-color:var(--border);color:var(--text)}html[data-theme="dark"] .task-video-divider{background:var(--border)}html[data-theme="dark"] .task-cover{background:#0b0e14;border-color:var(--border)}html[data-theme="dark"] .task-card.pending,html[data-theme="dark"] .status-processing{background:#171b25;border-color:#343c4d}html[data-theme="dark"] .status-succeed{background:#10231b;border-color:#236743}html[data-theme="dark"] .status-submit_failed,html[data-theme="dark"] .status-failed,html[data-theme="dark"] .status-retry{background:#2a171d;border-color:#70303c}
html[data-theme="dark"] .license-card{background:#171d28!important;border-color:#3b465b!important;color:var(--text)}html[data-theme="dark"] .license-card span{color:#8f9db4}html[data-theme="dark"] .license-card strong{color:#eef2ff}html[data-theme="dark"] .license-card em{color:#aab4c8}

/* Credit balance layout: keep the available balance prominent and separate supporting metrics. */
.license-card:has(.quota-summary){display:grid!important;grid-template-columns:auto minmax(104px,1fr)!important;grid-template-rows:15px 1fr!important;column-gap:12px!important;align-items:center!important;padding:7px 12px!important}
.license-card:has(.quota-summary)>span:first-child{grid-column:1;grid-row:1;align-self:end}
.license-card:has(.quota-summary)>strong{grid-column:2;grid-row:1;align-self:end}
.license-card:has(.quota-summary)>em{grid-column:1 / -1;grid-row:2;display:grid!important;grid-template-columns:minmax(94px,.72fr) minmax(0,1.28fr)!important;align-items:center!important;height:auto!important;min-width:0;overflow:visible!important;white-space:normal!important}
.license-card .quota-summary{display:flex;align-items:baseline;gap:5px;min-width:0;white-space:nowrap}
.license-card .quota-summary b{font-size:11px;font-weight:600;color:#667085}
.license-card .quota-summary strong{display:inline!important;font-size:19px!important;line-height:1;color:#111827;margin:0!important;letter-spacing:0}
.license-card .quota-summary small{font-size:11px;color:#98a2b3}
.license-card .quota-metrics{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:0;min-width:0}
.license-card .quota-metrics>span{min-width:0;padding-left:9px;border-left:1px solid #e5e7eb;display:flex;flex-direction:column;gap:1px;line-height:1.1}
.license-card .quota-metrics b{font-size:10px;font-weight:500;color:#7a8497;white-space:nowrap}
.license-card .quota-metrics strong{display:block!important;font-size:12px!important;color:#344054;margin:0!important;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
html[data-theme="dark"] .license-card .quota-summary b{color:#aab4c8}
html[data-theme="dark"] .license-card .quota-summary strong{color:#f8fafc}
html[data-theme="dark"] .license-card .quota-summary small,html[data-theme="dark"] .license-card .quota-metrics b{color:#7f8ba2}
html[data-theme="dark"] .license-card .quota-metrics strong{color:#d7deea}
html[data-theme="dark"] .license-card .quota-metrics>span{border-color:#3b465b}
@media(min-width:901px){.top-actions .license-card:has(.quota-summary){height:66px!important;min-height:66px!important}}
@media(max-width:1250px) and (min-width:901px){.license-card:has(.quota-summary)>em{grid-template-columns:86px minmax(0,1fr)!important;column-gap:7px!important}.license-card .quota-summary strong{font-size:17px!important}.license-card .quota-metrics>span{padding-left:6px}.license-card .quota-metrics b{font-size:9px}.license-card .quota-metrics strong{font-size:10px!important}}
@media(max-width:900px){.top-actions .license-card:has(.quota-summary){height:auto!important;min-height:96px!important;grid-template-columns:auto 1fr!important;grid-template-rows:15px 1fr!important;padding:9px 11px!important}.license-card:has(.quota-summary)>em{grid-template-columns:1fr!important;gap:8px!important;padding-top:5px}.license-card .quota-metrics{grid-template-columns:repeat(3,minmax(0,1fr))}}
@media(max-width:520px){.top-actions .license-card:has(.quota-summary){min-height:126px!important}.license-card .quota-metrics{grid-template-columns:repeat(2,minmax(0,1fr));row-gap:7px}.license-card .quota-metrics .quota-estimate{grid-column:1 / -1;border-left:0;padding-left:0}}
html[data-theme="dark"] .fixed-prompt-input{background:#171d28!important;border-color:#3b465b!important;color:#eef2ff!important}html[data-theme="dark"] .fixed-prompt-input:focus{background:#1c2330!important;border-color:#8b5cf6!important}
html[data-theme="dark"] .fixed-prompt-preset-select{background:#171d28;border-color:#3b465b;color:#eef2ff}
html[data-theme="dark"] .prompt-character-counter{color:#9aa6ba}html[data-theme="dark"] .prompt-character-counter.over-limit{color:#f87171}
html[data-theme="dark"] .status-succeed{background:#171d2a!important;border-color:#46557a!important;box-shadow:inset 3px 0 0 #8b5cf6}html[data-theme="dark"] .badge.ok,html[data-theme="dark"] .badge:not(.fail):not(.processing):not(.pending){background:#29233d!important;color:#d8ccff!important;border:1px solid #5945a2}html[data-theme="dark"] .task-card.status-succeed .task-time{color:#aab4c8}
html[data-theme="dark"] .config-card,html[data-theme="dark"] .config-card textarea,html[data-theme="dark"] .modal-label input,html[data-theme="dark"] .client-server-select,html[data-theme="dark"] .client-server-drawer,html[data-theme="dark"] .download-main-input,html[data-theme="dark"] .download-path-row input{background:var(--surface-soft)!important;color:var(--text)!important;border-color:var(--control-border)!important}
html[data-theme="dark"] .config-card p,html[data-theme="dark"] .modal-label,html[data-theme="dark"] .client-server-picker label,html[data-theme="dark"] .check,html[data-theme="dark"] .config-card .modal-msg{color:var(--muted)}
html[data-theme="dark"] .config-card .modal-msg:not(:empty),html[data-theme="dark"] .config-card .modal-msg.config-msg-error:not(:empty){background:#2a171d!important;border-color:#70303c!important;color:#fda4af!important}html[data-theme="dark"] .config-card .modal-msg.config-msg-success:not(:empty){background:#172b2a!important;border-color:#2f6f69!important;color:#9ce7d9!important}
html[data-theme="dark"] .client-server-item:hover,html[data-theme="dark"] .client-server-item.active{background:#202737;color:var(--text)}html[data-theme="dark"] .download-mode-tab{background:var(--surface-soft);border-color:var(--control-border);color:var(--text)}html[data-theme="dark"] .download-mode-tab.active{background:#29233d;border-color:#8b5cf6;color:#fff}
html[data-theme="dark"] .confirm-delete-card p{color:var(--muted)}html[data-theme="dark"] .announcement-bar{background:var(--announcement-bg);border-color:var(--announcement-border);color:var(--announcement-text)}
html[data-theme="dark"] .task-head strong{color:#f3f4f6!important;font-weight:800}html[data-theme="dark"] .task-head .task-time{color:#aab4c8!important}html[data-theme="dark"] .task-head{color:#f3f4f6}
html[data-theme="dark"] .task-image-unavailable{border-color:#536075!important;background:#202735!important;color:#a8b2c3!important;box-shadow:0 4px 10px rgba(0,0,0,.28)}
.video-ref{border:0!important;background:transparent!important;color:#2563eb!important;padding:0 4px!important;width:auto!important;height:22px!important}.video-ref-icon{display:inline-flex;width:22px;height:22px;align-items:center;justify-content:center;border-radius:6px;background:#ede9fe;color:#6d28d9;font-weight:700;font-size:11px}.video-ref-tag .video-ref-icon{background:#ede9fe;color:#6d28d9}
html[data-theme="dark"] .video-ref{color:#93c5fd!important}html[data-theme="dark"] .video-ref-icon,html[data-theme="dark"] .video-ref-tag .video-ref-icon{background:#352a58;color:#c4b5fd}
.media-ref-btn{height:24px!important;min-width:48px!important;padding:3px 10px!important;border:1px solid var(--control-border)!important;border-radius:8px!important;background:var(--surface-soft)!important;color:var(--text)!important;font-size:11px!important;line-height:1!important}.media-ref-btn:hover{border-color:#8b5cf6!important;color:#8b5cf6!important}.audio-ref-tag span:last-of-type,.video-ref-tag span:last-of-type{font-size:12px;color:var(--text)}
 .announcement-bell{position:relative;width:38px;height:38px;padding:0;border-radius:50%;display:grid;place-items:center;font-size:20px;background:var(--surface-soft);color:var(--muted);border-color:var(--control-border)}.announcement-bell.has-new:after{content:'';position:absolute;right:2px;top:2px;width:7px;height:7px;border-radius:50%;background:#8b5cf6;box-shadow:0 0 0 3px var(--surface)}.announcement-bell:hover{color:var(--text);border-color:#8b5cf6}.announcement-modal{background:rgba(3,6,12,.68);backdrop-filter:blur(4px)}.announcement-card{width:min(720px,calc(100vw - 32px));padding:24px 26px 20px;background:var(--surface)!important;border-color:var(--border)!important;color:var(--text);box-shadow:0 24px 80px rgba(0,0,0,.38)}.announcement-card-head{display:flex;align-items:center;gap:12px;padding-right:28px}.announcement-card-head h2{font-size:19px;margin:0;color:var(--text)}.announcement-card-head small{display:block;margin-top:3px;color:var(--muted);font-size:11px}.announcement-card-icon{width:38px;height:38px;border-radius:12px;display:grid;place-items:center;background:#29233d;color:#c4b5fd;font-size:20px}.announcement-modal-text{margin:20px 2px 24px;white-space:pre-wrap;line-height:1.75;color:var(--text);font-size:14px;max-height:48vh;overflow:auto}.announcement-card-actions{display:flex;justify-content:flex-end;gap:8px}.announcement-card-actions .primary{background:#6d43c5;border-color:#6d43c5}.announcement-card-actions .small:not(.primary){background:var(--surface-soft);border-color:var(--control-border);color:var(--muted)}

/* Automatic image-material association reuses the existing ref-tag system. */
.mention-section-label{padding:6px 7px 3px;color:var(--muted);font-size:10px;font-weight:800;letter-spacing:.08em}
.auto-reference-caret-marker{display:inline;width:0;height:0;overflow:hidden}
@media(max-width:1180px){.prompt-upload-actions{gap:6px}}

/* Unified media-upload status: keep the phase visible beside long filenames. */
.audio-reference-item{max-width:320px;min-width:190px;flex:0 0 auto}
.audio-reference-item .media-reference-name{min-width:44px;max-width:150px;flex:1 1 auto;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.audio-reference-item .media-upload-status{flex:0 0 auto;overflow:visible;font-size:10px;font-weight:700;padding:2px 5px;border-radius:999px;background:#e5e7eb;color:#4b5563}
.audio-reference-item .media-upload-status.uploading{background:#fff7ed;color:#c2410c}
.audio-reference-item .media-upload-status.ok{background:#ecfdf3;color:#15803d}
.audio-reference-item .media-upload-status.failed{background:#fff1f2;color:#be123c}
.audio-reference-item .audio-retry,.audio-reference-item .video-retry{flex:0 0 auto;height:24px;padding:3px 7px;font-size:10px;font-weight:700}
html[data-theme="dark"] .audio-reference-item .media-upload-status{background:#303744;color:#cbd5e1}
html[data-theme="dark"] .audio-reference-item .media-upload-status.uploading{background:#4a321d;color:#fdba74}
html[data-theme="dark"] .audio-reference-item .media-upload-status.ok{background:#173c2b;color:#86efac}
html[data-theme="dark"] .audio-reference-item .media-upload-status.failed{background:#4a2428;color:#fda4af}
@media(max-width:900px){.audio-reference-item{max-width:280px;min-width:170px}.audio-reference-item .media-reference-name{max-width:120px}}

/* Prompt expansion keeps the original editor node and reference state. */
.prompt-character-counter.near-limit{color:#d97706;font-weight:700}
.prompt-expand-btn{white-space:nowrap;flex:0 0 auto}
body.prompt-editor-expanded::after{content:"";position:fixed;inset:0;z-index:149;background:rgba(2,6,23,.72);backdrop-filter:blur(3px)}
.prompt-panel.prompt-expanded{position:fixed!important;inset:4vh 4vw!important;z-index:150!important;width:auto!important;height:auto!important;max-height:none!important;min-height:0!important;display:flex!important;flex-direction:column!important;overflow:hidden!important;padding:18px!important;border-radius:18px!important;box-shadow:0 24px 90px rgba(0,0,0,.46)!important}
.prompt-panel.prompt-expanded .prompt-section-title{flex:0 0 auto}
.prompt-panel.prompt-expanded .image-shelf{height:142px;min-height:112px;flex:0 0 142px}
.prompt-panel.prompt-expanded .audio-reference-row{flex:0 0 auto}
.prompt-panel.prompt-expanded #editor{flex:1 1 auto;min-height:240px;overflow:auto;font-size:14px;line-height:1.65}
.prompt-panel.prompt-expanded .prompt-character-counter{flex:0 0 auto}
.prompt-panel.prompt-expanded .fixed-prompt-wrap{flex:0 0 auto}
.prompt-panel.prompt-expanded .fixed-prompt-input{max-height:104px}
html[data-theme="dark"] body.prompt-editor-expanded::after{background:rgba(0,0,0,.78)}
@media(max-height:760px){.prompt-panel.prompt-expanded{inset:2vh 2vw!important;padding:12px!important}.prompt-panel.prompt-expanded .image-shelf{height:104px;min-height:90px;flex-basis:104px}.prompt-panel.prompt-expanded #editor{min-height:170px}.prompt-panel.prompt-expanded .fixed-prompt-input{min-height:48px;max-height:72px}}
@media(max-width:900px){.prompt-panel.prompt-expanded{inset:0!important;border-radius:0!important;padding:10px!important}.prompt-panel.prompt-expanded .prompt-section-title{align-items:flex-start}.prompt-panel.prompt-expanded .prompt-upload-actions{max-height:76px;overflow-x:auto;overflow-y:hidden;flex-wrap:nowrap}.prompt-panel.prompt-expanded .image-shelf{height:108px;min-height:92px;flex-basis:108px}.prompt-panel.prompt-expanded #editor{min-height:180px}.prompt-panel.prompt-expanded .fixed-prompt-input{min-height:48px;max-height:72px}}
@media(max-width:640px){.fixed-prompt-head{align-items:flex-start;flex-direction:column}.fixed-prompt-head-actions{width:100%}.fixed-prompt-preset-select{flex:1 1 auto;min-width:0;max-width:none}}

/* Keep the persisted fixed prompt visible in the normal workspace. */
.prompt-panel:not(.prompt-expanded){overflow-y:auto!important;scrollbar-width:thin}
.prompt-panel:not(.prompt-expanded) #editor{flex:1 0 96px;min-height:96px}
@media(max-height:800px){.prompt-panel:not(.prompt-expanded) .image-shelf{height:98px;min-height:98px;flex-basis:98px}.prompt-panel:not(.prompt-expanded) .audio-reference-row{min-height:28px;margin:-2px 0 4px;padding:3px 7px}.prompt-panel:not(.prompt-expanded) #editor{flex-basis:64px;min-height:64px}.prompt-panel:not(.prompt-expanded) .fixed-prompt-wrap{min-height:76px;margin-top:4px}.prompt-panel:not(.prompt-expanded) .fixed-prompt-input{min-height:44px;height:44px;resize:none}}

/* Session login surface added around the mother-template workspace. */
.auth-gate{flex:1;min-height:0;display:grid;grid-template-columns:minmax(0,1.15fr) minmax(340px,.85fr);gap:18px;align-items:stretch;padding:clamp(18px,5vw,72px);border:1px solid var(--border);border-radius:18px;background:var(--surface);box-shadow:0 12px 34px rgba(15,23,42,.08)}
.auth-intro{display:flex;flex-direction:column;justify-content:center;max-width:560px;padding:18px 8px}.auth-intro .eyebrow{font-size:11px;letter-spacing:.12em;color:var(--accent);font-weight:800}.auth-intro h2{font-size:clamp(28px,4vw,48px);line-height:1.12;margin:12px 0;color:var(--text)}.auth-intro p{max-width:420px;color:var(--muted);font-size:14px;line-height:1.7;margin:0}.feature-list{display:flex;flex-wrap:wrap;gap:8px;margin-top:24px}.feature-list span{border:1px solid var(--control-border);background:var(--surface-soft);border-radius:999px;padding:7px 11px;color:var(--muted);font-size:12px}.auth-card{align-self:center;width:min(100%,430px);padding:24px;border:1px solid var(--control-border);border-radius:16px;background:var(--surface-soft);box-shadow:0 14px 36px rgba(15,23,42,.12)}.auth-tabs{display:grid;grid-template-columns:1fr 1fr;gap:6px;padding:4px;border:1px solid var(--control-border);border-radius:11px;background:var(--surface);margin-bottom:22px}.auth-tabs button{border:0;border-radius:8px;padding:9px 10px;background:transparent;color:var(--muted);font-weight:700}.auth-tabs button.active{background:var(--accent);color:#fff}.auth-form{display:flex;flex-direction:column;gap:14px}.form-heading h2{font-size:21px;margin:0 0 5px;color:var(--text)}.form-heading p{font-size:12px;color:var(--muted);margin:0 0 3px}.auth-form label{display:flex;flex-direction:column;gap:6px;color:var(--muted);font-size:12px;font-weight:700}.auth-form input{width:100%;height:42px;border:1px solid var(--control-border);border-radius:10px;padding:0 12px;background:var(--surface);color:var(--text);font:inherit;font-weight:400;outline:none}.auth-form input:focus{border-color:var(--accent);box-shadow:0 0 0 3px color-mix(in srgb,var(--accent) 18%,transparent)}.auth-submit{height:42px;margin-top:3px;font-weight:800}.auth-message{min-height:18px;margin:0;font-size:12px;line-height:1.5;color:#15803d}.auth-message.error{color:#dc2626}.session-status{min-width:132px;max-width:190px;padding:7px 11px!important}.session-status span,.session-status strong,.session-status em{display:block}.session-status.session-ok{border-color:#86efac!important}.session-status.session-ok strong{color:#15803d}.top-actions .session-credits{font-size:13px;font-weight:800;color:var(--text);white-space:nowrap}
html[data-theme="dark"] .auth-gate{box-shadow:0 12px 34px rgba(0,0,0,.24)}html[data-theme="dark"] .auth-card{box-shadow:0 14px 36px rgba(0,0,0,.28)}html[data-theme="dark"] .session-status.session-ok{border-color:#32734b!important}html[data-theme="dark"] .session-status.session-ok strong{color:#86efac}
@media(max-width:760px){.auth-gate{grid-template-columns:1fr;padding:18px;overflow:auto}.auth-intro{padding:8px 2px}.auth-intro h2{font-size:32px}.auth-card{width:100%;max-width:none}.session-status{min-width:110px}}
.top-actions .session-status{flex:0 0 176px!important;width:176px!important;min-width:176px!important;max-width:176px!important;height:52px!important;min-height:52px!important;margin:0!important;padding:7px 11px!important}
 .top-actions .session-status:not(.hidden){display:grid!important;grid-template-columns:auto minmax(0,1fr)!important;grid-template-rows:1fr 1fr!important;align-items:center!important;column-gap:5px!important;row-gap:0!important}.top-actions .session-status:not(.hidden)>span{grid-column:1;grid-row:1;font-size:10px!important;line-height:1.2!important;white-space:nowrap!important}.top-actions .session-status:not(.hidden)>strong{grid-column:2;grid-row:1;font-size:12px!important;line-height:1.2!important;white-space:nowrap!important}.top-actions .session-status:not(.hidden)>em{grid-column:1 / -1;grid-row:2;font-size:10px!important;line-height:1.2!important;white-space:nowrap!important;overflow:hidden!important;text-overflow:ellipsis!important;max-width:100%!important;display:block!important}.top-actions .session-status #licenseLabel::after{content:'：'}
@media(max-width:900px){.top-actions .session-status{flex:1 1 150px!important;width:auto!important;min-width:150px!important;max-width:220px!important}}

/* Video preview gets bandwidth priority over task-card cover extraction. */
.video-preview-status{position:absolute;left:18px;right:18px;top:18px;z-index:3;min-height:22px;padding:5px 38px 5px 10px;border-radius:9px;background:rgba(15,23,42,.72);color:#e2e8f0;font-size:12px;line-height:1.4;pointer-events:none;backdrop-filter:blur(4px)}
.video-preview-status:empty{display:none}
.video-preview-status.error{background:rgba(127,29,29,.88);color:#fff}
.top-actions{flex-wrap:nowrap;white-space:nowrap}.task-elapsed{color:var(--muted);font-size:11px;margin-top:6px}.announcement-modal-image{display:block;max-width:100%;max-height:240px;margin:10px 0;border-radius:8px;object-fit:contain}.announcement-modal-image.hidden{display:none!important}.recharge-generated{margin-top:14px;padding:12px;border:1px solid var(--admin-border);border-radius:10px;background:var(--admin-soft)}.recharge-generated textarea{width:100%;min-height:120px;resize:vertical;font-family:ui-monospace,monospace}.recharge-generated-actions{display:flex;gap:8px;margin-top:8px}

/* Topbar scrolling advertisement */
.topbar-brand{flex:0 0 auto}
.topbar-marquee{flex:1 1 auto;min-width:120px;max-width:900px;height:44px;display:flex;align-items:center;margin:0 clamp(12px,2.5vw,40px);padding:0;color:var(--text);overflow:hidden}
.topbar-marquee-viewport{min-width:0;flex:1;overflow:hidden;white-space:nowrap}
.topbar-marquee-text{display:inline-block;min-width:max-content;padding-left:100%;font-size:16px;font-weight:700;line-height:1.5;animation:topbarMarquee var(--scrolling-ad-duration,18s) linear infinite;will-change:transform}
.topbar-marquee:hover .topbar-marquee-text{animation-play-state:paused}
@keyframes topbarMarquee{from{transform:translateX(0)}to{transform:translateX(-100%)}}
html[data-theme="dark"] .topbar-marquee{color:#eef2ff}
@media(min-width:901px){.topbar>.top-actions{flex:0 0 auto!important;min-width:0!important}.topbar-marquee{width:min(48vw,900px)}}
@media(max-width:900px){.topbar-marquee{order:2;width:100%;max-width:none;min-width:0;margin:0}.topbar>.top-actions{order:3}.topbar-brand{order:1}}
@media(prefers-reduced-motion:reduce){.topbar-marquee-text{padding-left:0;animation:none}.topbar-marquee-viewport{text-align:center;text-overflow:ellipsis}}

.admin-entry-link{display:inline-flex;align-items:center;justify-content:center;min-height:36px;padding:7px 10px;border:1px solid var(--control-border,#dfe5ee);border-radius:8px;background:var(--surface,#fff);color:var(--text,#2a3344);font-size:12px;font-weight:700;text-decoration:none;white-space:nowrap}
.admin-entry-link:hover{border-color:var(--accent,#6d43c5);background:var(--surface-soft,#f4f7fb)}
html[data-theme="dark"] .admin-entry-link{border-color:#3f4655;background:#242935;color:#f3f4f6}
@media(max-width:900px){.admin-entry-link{min-height:34px;padding:6px 9px}}
