.switch {
  align-items: center;
  cursor: pointer;
  display: flex;
  font-size: 13px;
  gap: 10px;
}
.switch input { opacity: 0; position: absolute; width: 1px; }
.switch span {
  background: #cbd4df;
  border-radius: 99px;
  height: 24px;
  position: relative;
  transition: .2s;
  width: 42px;
}
.switch span::after {
  background: white;
  border-radius: 50%;
  box-shadow: 0 2px 5px rgba(0,0,0,.2);
  content: "";
  height: 18px;
  left: 3px;
  position: absolute;
  top: 3px;
  transition: .2s;
  width: 18px;
}
.switch input:checked + span { background: var(--blue); }
.switch input:checked + span::after { transform: translateX(18px); }
.switch em { color: var(--muted); font-style: normal; }
input[type="color"] { cursor: pointer; height: 44px; padding: 5px; }

.template-models { background: #f7f9fc; border: 1px solid var(--line); border-radius: 12px; margin: 12px 0 4px; padding: 12px 14px; }
.model-summary-title { align-items: center; display: flex; justify-content: space-between; margin-bottom: 9px; }
.model-summary-title strong { color: var(--ink); font-size: 12px; }
.model-summary-title span { color: var(--muted); font-size: 10px; }
.model-summary-list { display: flex; flex-wrap: wrap; gap: 7px; }
.model-summary-item { align-items: center; background: #fff; border: 1px solid #dfe5ed; border-radius: 8px; display: grid; gap: 3px 7px; grid-template-columns: auto minmax(80px,1fr) auto; max-width: 100%; padding: 7px 9px; }
.model-summary-item>span { color: var(--muted); font-size: 9px; }
.model-summary-item strong { font-size: 10px; max-width: 310px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.model-summary-item em { background: #eef1f5; border-radius: 99px; color: #758292; font-size: 9px; font-style: normal; padding: 3px 6px; }
.model-summary-item em.selectable { background: #e8f0ff; color: var(--blue); }
.field-label-wrap { align-items: center; display: inline-flex; gap: 6px; position: relative; }
.field-help { align-items: center; background: #eef3fb; border: 1px solid #cdd9ea; border-radius: 50%; color: #56708f; cursor: help; display: inline-flex; font-size: 9px; font-weight: 800; height: 16px; justify-content: center; line-height: 1; padding: 0; width: 16px; }
.field-help:hover,.field-help:focus { background: var(--blue); border-color: var(--blue); color: #fff; outline: none; }
.field-help-popover { background: #172432; border-radius: 8px; bottom: calc(100% + 8px); box-shadow: 0 8px 24px rgba(15,24,34,.18); color: #fff; display: none; font-size: 10px; font-weight: 400; left: 0; line-height: 1.55; max-width: min(320px,75vw); padding: 9px 11px; position: absolute; width: max-content; z-index: 20; }
.field-help:hover + .field-help-popover,.field-help:focus + .field-help-popover,.field-help-popover.open { display: block; }
@media(max-width:720px){.model-summary-item{width:100%}.model-summary-item strong{max-width:55vw}}

.sessions .session { align-items: center; display: flex; gap: 4px; padding: 3px 4px; }
.session-select { align-items: center; background: transparent; border: 0; color: inherit; cursor: pointer; display: flex; flex: 1; gap: 7px; justify-content: space-between; min-width: 0; padding: 7px 6px; text-align: left; }
.session-select span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.session-select small { background: #263646; border-radius: 99px; color: #8fa0b2; flex: 0 0 auto; font-size: 9px; padding: 2px 6px; }
.session-actions { display: none; flex: 0 0 auto; gap: 2px; }
.session:hover .session-actions,.session.active .session-actions { display: flex; }
.session-actions button,.session-editing>button { background: transparent; border: 0; border-radius: 6px; color: #8798aa; cursor: pointer; height: 26px; padding: 0; width: 24px; }
.session-actions button:hover,.session-editing>button:hover { background: #263646; color: #fff; }
.session-actions .delete-session:hover { color: #ff8b92; }
.session-name-input,.sessions .session-name-input { background: #fff!important; border: 2px solid #78a0ff!important; border-radius: 7px; caret-color: #17212b; color: #17212b!important; flex: 1; font-size: 12px; font-weight: 600; min-width: 0; padding: 7px 8px; -webkit-text-fill-color: #17212b; }
.session-name-input::selection { background: #cddcff; color: #17212b; }
.session-name-input:focus { background: #fff!important; border-color: #9ab6ff!important; box-shadow: 0 0 0 3px rgba(120,160,255,.2); color: #17212b!important; }
.session-delete-dialog { width: min(520px,90vw); }
.session-delete-dialog h2 { font-size: 19px; margin: 0; }
.session-delete-dialog label { display: block; margin: 18px 0 8px; }
.session-delete-actions { align-items: center; border-top: 1px solid var(--line); display: flex; gap: 9px; justify-content: flex-end; margin-top: 22px; padding-top: 18px; }
.danger-button { background: var(--red); border: 0; border-radius: 10px; color: #fff; cursor: pointer; font-weight: 700; padding: 10px 14px; }
.danger-button:hover { background: #bc3841; }
.danger-button:disabled { cursor: wait; opacity: .65; }
.session-delete-close { border: 0; background: none; color: #7a8795; cursor: pointer; font-size: 28px; }
.session-delete-actions .session-delete-close { border: 1px solid var(--line); font-size: 12px; }

.copy-output {
  background: var(--soft);
  border: 1px solid #cbd9fb;
  border-radius: 8px;
  color: var(--blue);
  cursor: pointer;
  font-size: 11px;
  font-weight: 700;
  padding: 6px 10px;
}
.copy-output:hover { background: #dfe9ff; }

.show-task-details {
  background: var(--blue);
  border: 1px solid var(--blue);
  border-radius: 8px;
  color: #fff;
  cursor: pointer;
  font-size: 11px;
  font-weight: 700;
  padding: 6px 10px;
}
.show-task-details:hover { background: var(--blue2); }
.retry-poll {
  background: #fff7e8;
  border: 1px solid #f1cf8d;
  border-radius: 8px;
  color: #a76400;
  cursor: pointer;
  font-size: 11px;
  font-weight: 700;
  padding: 6px 10px;
}
.retry-poll:hover { background: #ffefcf; }
.retry-poll:disabled { cursor: wait; opacity: .7; }

.task-card-tools {
  align-items: center;
  display: flex;
  gap: 6px;
  position: absolute;
  right: 11px;
  top: 11px;
  z-index: 2;
}
.delete-history {
  background: rgba(255,255,255,.94);
  border: 1px solid #f0c7ca;
  border-radius: 8px;
  color: var(--red);
  cursor: pointer;
  font-size: 11px;
  font-weight: 700;
  padding: 6px 10px;
}
.delete-history:hover { background: #fff2f3; }
.delete-history:disabled { color: #8793a2; cursor: not-allowed; opacity: .75; }

.open-task-folder {
  align-items: center;
  background: rgba(255,255,255,.94);
  border: 1px solid #c9d8f2;
  border-radius: 8px;
  color: var(--blue);
  cursor: pointer;
  display: inline-flex;
  height: 28px;
  justify-content: center;
  padding: 0;
  width: 30px;
}
.open-task-folder svg { fill: none; height: 15px; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.7; width: 15px; }
.open-task-folder:hover { background: #fff; border-color: #9ab6ff; }
.open-task-folder:disabled { cursor: progress; opacity: .6; }

.image-preview-button {
  background: transparent;
  border: 0;
  cursor: zoom-in;
  height: 100%;
  padding: 0;
  position: relative;
  width: 100%;
}
.image-preview-button span {
  background: rgba(15,24,34,.72);
  border-radius: 99px;
  bottom: 11px;
  color: #fff;
  font-size: 11px;
  left: 50%;
  opacity: 0;
  padding: 6px 10px;
  position: absolute;
  transform: translate(-50%,5px);
  transition: .18s;
}
.image-preview-button:hover span { opacity: 1; transform: translate(-50%,0); }
.image-carousel { height: 100%; position: relative; width: 100%; }
.image-carousel .image-preview-button span { bottom: 42px; }
.carousel-nav {
  align-items: center;
  background: rgba(15,24,34,.72);
  border: 1px solid rgba(255,255,255,.35);
  border-radius: 50%;
  color: #fff;
  cursor: pointer;
  display: flex;
  font-size: 25px;
  height: 34px;
  justify-content: center;
  line-height: 1;
  padding: 0 0 3px;
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 34px;
  z-index: 2;
}
.carousel-nav.previous { left: 10px; }
.carousel-nav.next { right: 10px; }
.carousel-nav:hover { background: rgba(15,24,34,.9); }
.carousel-label {
  background: rgba(15,24,34,.76);
  border-radius: 99px;
  bottom: 10px;
  color: #fff;
  font-size: 10px;
  left: 50%;
  max-width: calc(100% - 90px);
  overflow: hidden;
  padding: 6px 10px;
  position: absolute;
  text-overflow: ellipsis;
  transform: translateX(-50%);
  white-space: nowrap;
  z-index: 2;
}

.image-dialog {
  background: #101923;
  height: min(92vh, 1000px);
  max-width: 96vw;
  padding: 0;
  width: min(1200px, 96vw);
}
.image-dialog-bar {
  align-items: center;
  background: #172432;
  color: #fff;
  display: flex;
  gap: 20px;
  justify-content: space-between;
  padding: 12px 14px 12px 18px;
}
.image-dialog-bar strong { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.image-dialog-bar div { align-items: center; display: flex; flex-shrink: 0; gap: 8px; }
.image-dialog-bar .image-dialog-heading { align-items:flex-start; display:grid; gap:3px; min-width:0; }
.image-dialog-heading small { color:#93a2b2; font-size:9px; white-space:nowrap; }
.image-dialog-bar a { cursor: pointer; text-decoration: none; }
.image-dialog-close { background: transparent; border: 0; color: #c7d1dc; cursor: pointer; font-size: 26px; line-height: 1; }
.image-zoom-controls { background:#182432; border:1px solid #344354; border-radius:10px; padding:3px; }
.image-zoom-controls button { background:#253445; border-color:#3b4c60; color:#e5edf5; min-width:34px; padding:6px 8px; }
.image-zoom-controls button:hover { background:#31445a; }
.image-zoom-controls span { color:#b8c5d2; font-size:10px; min-width:44px; text-align:center; }
.image-dialog-canvas { cursor:grab; height:calc(100% - 58px); overflow:hidden; position:relative; touch-action:none; user-select:none; }
.image-dialog-canvas.dragging { cursor:grabbing; }
.image-dialog-canvas img { height:auto; left:0; max-height:none; max-width:none; object-fit:initial; pointer-events:none; position:absolute; top:0; transform-origin:0 0; user-select:none; width:auto; will-change:transform; }
.image-dialog-nav { align-items:center; background:rgba(15,24,34,.78); border:1px solid rgba(255,255,255,.45); border-radius:50%; box-shadow:0 5px 18px rgba(0,0,0,.35); color:#fff; cursor:pointer; display:flex; font-size:38px; height:54px; justify-content:center; line-height:1; padding:0 0 5px; position:absolute; top:50%; transform:translateY(-50%); width:54px; z-index:4; }
.image-dialog-nav.previous { left:18px; }
.image-dialog-nav.next { right:18px; }
.image-dialog-nav:hover { background:rgba(46,109,246,.92); }
.image-dialog-nav:focus-visible { outline:3px solid rgba(110,160,255,.75); outline-offset:3px; }
.image-dialog-position { background:rgba(15,24,34,.78); border:1px solid rgba(255,255,255,.25); border-radius:99px; bottom:16px; color:#fff; font-size:11px; left:50%; padding:7px 12px; position:absolute; transform:translateX(-50%); z-index:4; }
@media(max-width:760px){.image-dialog{height:94vh;width:98vw}.image-dialog-bar{align-items:flex-start;flex-direction:column;height:auto}.image-dialog-bar>div:last-child{flex-wrap:wrap}.image-dialog-canvas{height:calc(100% - 112px)}.image-dialog-heading small{display:block}.image-dialog-nav{font-size:31px;height:44px;width:44px}.image-dialog-nav.previous{left:10px}.image-dialog-nav.next{right:10px}}

.task-card { cursor: pointer; display: flex; flex-direction: column; }
.task-card.dragging { border-color: var(--blue); box-shadow: 0 18px 45px rgba(46,109,246,.2); opacity: .72; transform: scale(.985); }
.task-sort-tools { align-items: center; display: flex; gap: 3px; left: 50%; position: absolute; top: 10px; transform: translateX(-50%); z-index: 3; }
.task-drag-handle,.task-sort-tools button { background: rgba(255,255,255,.92); border: 1px solid rgba(92,107,126,.18); border-radius: 7px; color: #526176; font-size: 10px; line-height: 1; padding: 6px 7px; }
.task-drag-handle { cursor: grab; font-weight: 700; user-select: none; }
.task-drag-handle:active { cursor: grabbing; }
.task-sort-tools button { cursor: pointer; font-size: 13px; padding: 5px 7px; }
.task-sort-tools button:hover,.task-drag-handle:hover { background: #fff; color: var(--blue); }
.task-card .preview { flex: 0 0 210px; isolation: isolate; overflow: hidden; }
.task-card .preview video { background: #0f1720; display: block; max-height: 100%; object-fit: contain; }
.task-card .task-meta { background: #fff; min-height: 0; position: relative; z-index: 1; }
.task-card .task-meta h3 { line-height: 1.45; min-height: 40px; white-space: normal; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.task-card .output-links { align-items: center; border-top: 1px solid var(--line); margin-top: 12px; padding-top: 12px; }
.task-card .output-links a { background: var(--soft); border-radius: 8px; padding: 7px 10px; }
.view-output-image,
.view-input-image,
.view-model {
  background: var(--soft);
  border: 0;
  border-radius: 8px;
  color: var(--blue);
  cursor: pointer;
  font-size: 11px;
  font-weight: 700;
  padding: 7px 10px;
}
.move-task-group { background: #f3f5f8; border: 0; border-radius: 8px; color: #536174; cursor: pointer; font-size: 11px; font-weight: 700; padding: 7px 10px; }
.move-task-group:hover { background: var(--soft); color: var(--blue); }
.task-move-close { background: transparent; border: 0; color: #7a8795; cursor: pointer; font-size: 28px; }
.session-delete-actions .task-move-close { border: 1px solid var(--line); font-size: 12px; }
.split-submit { align-items: stretch; background: var(--blue); border-radius: 12px; box-shadow: 0 7px 18px rgba(46,109,246,.22); display: flex; flex: 0 0 auto; overflow: visible; position: relative; }
.submit-row .split-submit button { background: transparent; border: 0; color: #fff; cursor: pointer; font-weight: 700; min-width: 0; }
.split-submit-main { border-radius: 12px 0 0 12px!important; min-width: 128px!important; padding: 12px 17px; }
.split-submit-later { align-items: center; border-left: 1px solid rgba(255,255,255,.45)!important; border-radius: 0 12px 12px 0!important; display: flex; justify-content: center; padding: 0; width: 46px; }
.split-submit-later svg { fill: none; height: 19px; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.8; width: 19px; }
.split-submit:hover { background: var(--blue2); }
.split-submit button:disabled { cursor: not-allowed; opacity: .55; }
.split-submit-later::after { background: #18212d; border-radius: 7px; bottom: calc(100% + 10px); color: #fff; content: attr(data-tooltip); font-size: 11px; font-weight: 500; left: 50%; opacity: 0; padding: 8px 10px; pointer-events: none; position: absolute; transform: translate(-50%,5px); transition: .16s; white-space: nowrap; z-index: 10; }
.split-submit-later:hover::after,.split-submit-later:focus-visible::after { opacity: 1; transform: translate(-50%,0); }
.status.draft { color: #9a6700; }
.submit-draft { background: var(--blue); border: 0; border-radius: 8px; color: #fff; cursor: pointer; font-size: 11px; font-weight: 700; padding: 7px 10px; }
.submit-draft:hover { background: var(--blue2); }
.model-dialog { background: #111923; height: min(90vh,900px); max-width: 96vw; padding: 0; width: min(1100px,96vw); }
.model-dialog-bar { align-items: center; background: #172432; color: #fff; display: flex; gap: 20px; justify-content: space-between; min-height: 62px; padding: 11px 14px 11px 18px; }
.model-dialog-bar>div { align-items: center; display: flex; gap: 9px; }
.model-dialog-bar>div:first-child { align-items: flex-start; flex-direction: column; gap: 2px; min-width: 0; }
.model-dialog-bar strong { font-size: 13px; max-width: 65vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.model-dialog-bar small { color: #93a4b6; font-size: 10px; }
.model-dialog-bar a { cursor: pointer; text-decoration: none; }
.model-dialog-close { background: transparent; border: 0; color: #c7d1dc; cursor: pointer; font-size: 28px; line-height: 1; }
#glbViewer { background: radial-gradient(circle at 50% 40%,#eaf0f6,#cbd5e1); display: block; height: calc(100% - 62px); width: 100%; --poster-color: transparent; }
@media(max-width:720px){.model-dialog-bar small{display:none}.model-dialog-bar strong{max-width:48vw}}
.task-video .preview {
  background: #0f1720;
  flex-basis: 210px;
  padding-bottom: 20px;
}
.task-video .preview video {
  align-self: start;
  height: 100%;
  min-height: 0;
}
.reused-input-note { color: var(--blue); font-size: 11px; line-height: 1.5; }

.task-detail-dialog { max-height: 90vh; max-width: 94vw; overflow: auto; width: min(980px,94vw); }
.task-detail-head { align-items: flex-start; display: flex; gap: 20px; justify-content: space-between; }
.task-detail-head h2 { font-size: 20px; margin: 0 0 6px; }
.task-detail-head p:last-child { color: var(--muted); font-size: 11px; margin: 0; }
.task-detail-close { background: transparent; border: 0; color: #7a8795; cursor: pointer; font-size: 30px; line-height: 1; }
.task-detail-error { background: #fff2f3; border: 1px solid #f3c7cb; border-radius: 10px; color: var(--red); font-size: 12px; line-height: 1.55; margin: 18px 0 0; padding: 11px 13px; white-space: pre-wrap; }
.task-detail-grid { display: grid; gap: 20px; grid-template-columns: 1.1fr .9fr; margin-top: 20px; }
.task-detail-grid section { min-width: 0; }
.task-detail-grid h3 { font-size: 12px; margin: 0 0 9px; }
.task-detail-grid h3:not(:first-child) { margin-top: 20px; }
.task-detail-grid pre { max-height: 420px; margin: 0; white-space: pre-wrap; word-break: break-word; }
.template-definition { border-top: 1px solid var(--line); margin-top: 16px; padding-top: 14px; }
.template-definition summary { color: var(--ink); cursor: pointer; font-size: 12px; font-weight: 700; }
.template-definition pre { margin-top: 10px; max-height: 280px; }
.detail-list { display: grid; gap: 7px; list-style: none; margin: 0; padding: 0; }
.detail-list li { align-items: center; background: #f6f8fb; border-radius: 9px; display: grid; gap: 6px; grid-template-columns: auto minmax(0,1fr) auto; min-width: 0; padding: 9px 10px; }
.detail-list strong,.detail-list em,.detail-list a { font-size: 10px; }
.detail-content-toggle { -webkit-box-orient: vertical; -webkit-line-clamp: 2; background: transparent; border: 0; color: #344256; cursor: pointer; display: -webkit-box; font: inherit; font-size: 11px; line-height: 1.5; min-width: 0; overflow: hidden; padding: 2px 4px; text-align: left; text-overflow: ellipsis; white-space: normal; word-break: break-word; }
.detail-content-toggle:hover { background: #edf3ff; border-radius: 5px; color: var(--blue); }
.detail-content-toggle.expanded { -webkit-line-clamp: unset; display: block; overflow: visible; white-space: pre-wrap; }
.detail-content-toggle::after { color: #8794a4; content: '… 点击展开'; display: inline; font-size: 9px; margin-left: 5px; white-space: nowrap; }
.detail-content-toggle.expanded::after { content: ' 点击收起'; }
.detail-list em { color: var(--muted); font-style: normal; }
.detail-list a { color: var(--blue); text-decoration: none; }
.detail-list .muted-detail { color: var(--muted); display: block; font-size: 11px; }
.task-detail-footer { align-items: center; border-top: 1px solid var(--line); display: flex; gap: 18px; justify-content: space-between; margin-top: 22px; padding-top: 18px; }
.task-record-links { display: flex; flex-wrap: wrap; gap: 7px; }
.task-record-links a { background: var(--soft); border-radius: 7px; color: var(--blue); font-size: 10px; font-weight: 700; padding: 6px 8px; text-decoration: none; }
@media(max-width:720px){.task-detail-grid{grid-template-columns:1fr}.task-detail-footer{align-items:stretch;flex-direction:column}}

.task-detail-prompts { display: grid; gap: 8px; margin-bottom: 18px; }
.prompt-detail { background: #f3f7ff; border: 1px solid #dce7ff; border-left: 4px solid var(--blue); border-radius: 9px; padding: 10px 12px; }
.prompt-detail.negative { background: #fff6f6; border-color: #f3d7da; border-left-color: var(--red); }
.prompt-detail.lyrics { background: #f6fbf7; border-color: #d9eadc; border-left-color: #2e9660; }
.prompt-detail>div { align-items: center; display: flex; gap: 8px; justify-content: space-between; }
.prompt-detail strong { font-size: 11px; }
.prompt-detail span { color: var(--muted); font-size: 9px; font-weight: 700; }
.prompt-detail p { color: #344256; font-size: 11px; line-height: 1.55; margin: 7px 0 0; max-height: 150px; overflow: auto; white-space: pre-wrap; word-break: break-word; }

.template-wiki-dialog { max-height: 90vh; max-width: 94vw; overflow: auto; width: min(1120px,94vw); }
.template-wiki-close { background: transparent; border: 0; color: #7a8795; cursor: pointer; font-size: 30px; line-height: 1; }
.template-wiki-intro { color: var(--muted); font-size: 12px; line-height: 1.65; margin: 10px 0 18px; }
.template-wiki-tools { align-items: center; display: grid; gap: 10px; grid-template-columns: minmax(220px,1fr) 160px minmax(220px,auto); margin-bottom: 18px; }
.template-wiki-tools input,.template-wiki-tools select { background: #fff; border: 1px solid var(--line); border-radius: 10px; color: var(--ink); font: inherit; min-height: 42px; padding: 9px 12px; }
.template-wiki-tools span { color: var(--muted); font-size: 10px; text-align: right; white-space: nowrap; }
.template-wiki-status { align-items: center; display: flex; gap: 9px; justify-content: flex-end; }
.template-wiki-status button { white-space: nowrap; }
.template-wiki-list { display: grid; gap: 12px; grid-template-columns: repeat(2,minmax(0,1fr)); }
.template-wiki-list>.empty { grid-column: 1/-1; }
.template-wiki-card { border: 1px solid var(--line); border-radius: 13px; min-width: 0; padding: 15px; }
.template-wiki-card-head { align-items: center; display: flex; justify-content: space-between; }
.template-wiki-card-head span { color: var(--blue); font-size: 10px; font-weight: 700; }
.template-wiki-card-head em { border-radius: 99px; font-size: 9px; font-style: normal; font-weight: 700; padding: 4px 7px; }
.template-wiki-card-head em.available { background: #e9f8ef; color: #21804b; }
.template-wiki-card-head em.unavailable { background: #fff1f2; color: var(--red); }
.template-wiki-card-head em.checking { background: #f0f3f7; color: #68778a; }
.template-wiki-card h3 { font-size: 15px; margin: 10px 0 12px; }
.template-wiki-card dl,.template-wiki-card dl div { display: grid; gap: 5px; margin: 0; }
.template-wiki-card dl { gap: 9px; }
.template-wiki-card dt { color: var(--muted); font-size: 9px; font-weight: 700; }
.template-wiki-card dd { color: #344256; font-size: 11px; line-height: 1.55; margin: 0; }
.template-wiki-warning { background: #fff7f7; border-radius: 7px; color: var(--red); font-size: 10px; line-height: 1.45; margin: 10px 0 0; padding: 8px; }
@media(max-width:720px){.template-wiki-tools{grid-template-columns:1fr}.template-wiki-status{justify-content:space-between}.template-wiki-tools span{text-align:left}.template-wiki-list{grid-template-columns:1fr}}
.template-select-actions { align-items:center; display:grid; gap:10px; grid-template-columns:minmax(0,1fr) auto; }
.template-detail-trigger { height:43px; white-space:nowrap; }
.template-wiki-card-actions { display:flex; justify-content:flex-end; margin-top:12px; }
.template-detail-dialog { max-height:90vh; max-width:94vw; overflow:auto; width:min(920px,94vw); }
.template-detail-close { background:transparent; border:0; color:#7a8795; cursor:pointer; font-size:30px; line-height:1; }
.template-detail-status { align-items:center; display:flex; gap:9px; margin-top:14px; }
.template-detail-status span { background:var(--soft); border-radius:99px; color:var(--blue); font-size:10px; font-weight:800; padding:6px 9px; }
.template-detail-status em { border-radius:99px; font-size:10px; font-style:normal; font-weight:800; padding:6px 9px; }
.template-detail-status em.available { background:#e9f8ef; color:#21804b; }
.template-detail-status em.unavailable { background:#fff1f2; color:var(--red); }
.template-detail-status em.checking { background:#f0f3f7; color:#68778a; }
.template-detail-description { color:#344256; font-size:13px; margin:18px 0; }
.template-detail-grid { display:grid; gap:12px; grid-template-columns:repeat(2,minmax(0,1fr)); }
.template-detail-grid section { background:#f8fafc; border:1px solid var(--line); border-radius:13px; padding:15px; }
.template-detail-grid h3,.template-detail-gallery-section h3 { font-size:12px; margin:0 0 10px; }
.template-detail-grid ul { color:#344256; display:grid; font-size:11px; gap:7px; line-height:1.55; margin:0; padding-left:18px; }
.template-detail-grid p { color:#344256; font-size:11px; line-height:1.65; margin:0; }
.template-detail-gallery-section { margin-top:20px; }
.template-detail-gallery-section>p { color:var(--muted); font-size:9px; line-height:1.5; }
.template-detail-gallery { display:grid; gap:12px; grid-template-columns:repeat(2,minmax(0,1fr)); }
.template-detail-gallery figure { background:#f3f6fa; border:1px solid var(--line); border-radius:13px; margin:0; overflow:hidden; }
.template-detail-gallery img { aspect-ratio:16/10; display:block; object-fit:cover; width:100%; }
.template-detail-gallery figcaption { color:#536174; font-size:10px; padding:9px 11px; }
@media(max-width:720px){.template-select-actions{grid-template-columns:1fr}.template-detail-trigger{width:100%}.template-detail-grid,.template-detail-gallery{grid-template-columns:1fr}}

/* 任务耗时：紧跟生成时间，等宽数字避免多卡片之间跳动 */
.task-duration{color:var(--blue,#2e6df6);font-weight:700;font-variant-numeric:tabular-nums;white-space:nowrap}

/* 训练：耗时预估面板（提交前把「要等多久、能不能训」讲清楚） */
.train-panel { margin-top: 6px; }
.train-estimate {
  background: #fbfcfe;
  border: 1px solid var(--line, #e5e9ef);
  border-radius: 12px;
  padding: 14px 16px;
}
.train-estimate.loading { color: var(--muted, #6c7886); font-size: 13px; }
.train-estimate.error { background: #fff6f6; border-color: #f3c7ca; }
.train-estimate-head {
  align-items: baseline;
  display: flex;
  gap: 10px;
  justify-content: space-between;
  margin-bottom: 10px;
}
.train-estimate-head strong { font-size: 16px; }
.train-estimate-head em {
  background: var(--soft, #edf3ff);
  border-radius: 99px;
  color: var(--blue, #2e6df6);
  font-size: 12px;
  font-style: normal;
  padding: 3px 10px;
  white-space: nowrap;
}
/* 外推估算：用暖色提示「这不是实测值」，避免被当成承诺 */
.train-estimate.extrapolated .train-estimate-head strong { color: #a86412; }
.train-estimate.extrapolated .train-estimate-head em { background: #fff4e2; color: #a86412; }
.train-estimate.error .train-estimate-head strong { color: var(--red, #d94a52); }
.train-estimate.error .train-estimate-head em { background: #fdecec; color: var(--red, #d94a52); }
/* 无实测基准（Flux/LTX/旧版 .ckpt）：中性灰，强调「不是不能训，是估不出来」 */
.train-estimate.unverifiable { background: #f7f8fa; border-color: #dfe3e9; }
.train-estimate.unverifiable .train-estimate-head strong { color: #4a5563; }
.train-estimate.unverifiable .train-estimate-head em { background: #eceff3; color: #4a5563; }
.train-estimate dl {
  display: grid;
  gap: 6px 20px;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  margin: 0;
}
.train-estimate dl div { display: flex; font-size: 13px; gap: 8px; justify-content: space-between; }
.train-estimate dt { color: var(--muted, #6c7886); white-space: nowrap; }
.train-estimate dd { font-weight: 600; margin: 0; text-align: right; }
.train-estimate .hint { color: var(--muted, #6c7886); font-size: 12px; line-height: 1.6; margin: 10px 0 0; }
.train-warnings {
  background: #fff9ec;
  border: 1px solid #f0dfb8;
  border-radius: 8px;
  color: #8a6414;
  font-size: 12px;
  line-height: 1.65;
  list-style: none;
  margin: 10px 0 0;
  padding: 10px 12px;
}
.train-warnings li + li { margin-top: 4px; }
@media (max-width: 720px) {
  .train-estimate dl { grid-template-columns: 1fr; }
  .train-estimate-head { flex-direction: column; gap: 6px; }
}

/* 训练：按训练目的推荐底模（把「该选哪个」直接摆出来，不用在下拉里翻） */
.train-recommend {
  background: #f7faff;
  border: 1px solid #dbe6fb;
  border-radius: 12px;
  margin-top: 6px;
  padding: 14px 16px;
}
.train-recommend-head {
  align-items: baseline;
  display: flex;
  gap: 10px;
  justify-content: space-between;
}
.train-recommend-head strong { font-size: 14px; }
.train-recommend-head span {
  background: var(--soft, #edf3ff);
  border-radius: 99px;
  color: var(--blue, #2e6df6);
  font-size: 12px;
  padding: 3px 10px;
  white-space: nowrap;
}
.train-recommend-note { color: var(--muted, #6c7886); font-size: 12px; line-height: 1.65; margin: 8px 0 0; }
.train-recommend-list {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  margin-top: 10px;
}
.train-recommend-item {
  background: #fff;
  border: 1px solid var(--line, #e5e9ef);
  border-radius: 10px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 10px 12px;
  text-align: left;
}
.train-recommend-item:hover { border-color: #b9cdf7; box-shadow: 0 6px 18px rgba(46,109,246,.10); }
.train-recommend-item.active { background: #eef4ff; border-color: var(--blue, #2e6df6); }
.train-recommend-item span { color: var(--blue, #2e6df6); font-size: 12px; font-weight: 700; }
.train-recommend-item strong { font-size: 13px; word-break: break-all; }
.train-recommend-item em { color: var(--muted, #6c7886); font-size: 12px; font-style: normal; line-height: 1.6; }
.train-recommend-principle {
  border-top: 1px dashed #dbe6fb;
  color: var(--muted, #6c7886);
  font-size: 12px;
  line-height: 1.65;
  margin: 10px 0 0;
  padding-top: 9px;
}

/* 任务列表分页：滚动加载末尾的状态条 + 哨兵 */
.load-more-status {
  align-items: center;
  color: var(--muted, #6c7886);
  display: flex;
  font-size: 12px;
  gap: 8px;
  grid-column: 1/-1;
  justify-content: center;
  padding: 28px 16px;
  text-align: center;
}
.load-more-status.loading::before {
  animation: load-more-spin .9s linear infinite;
  border: 2px solid #dde4ee;
  border-top-color: var(--blue, #2e6df6);
  border-radius: 50%;
  content: '';
  height: 14px;
  width: 14px;
}
.load-more-status.done {
  color: #8794a4;
  font-size: 11px;
}
.load-more-sentinel {
  height: 1px;
  grid-column: 1/-1;
  width: 100%;
}
.load-more-error {
  background: #fff6f6;
  border: 1px solid #f3c7ca;
  border-radius: 10px;
  color: var(--red, #d94a52);
  font-size: 12px;
  grid-column: 1/-1;
  margin: 16px 0;
  padding: 12px 14px;
}

/* 缩略图懒加载：占位 / 加载中 / 加载完成 / 失败四态 */
.task-thumbnail {
  display: block;
  height: 100%;
  object-fit: cover;
  width: 100%;
}
.task-thumbnail.lazy-placeholder {
  background: linear-gradient(135deg, #e7edf5, #d4dde8);
  background-size: 200% 200%;
  animation: thumbnail-shimmer 1.6s ease-in-out infinite;
  color: transparent;
  height: 100%;
}
.task-thumbnail.lazy-loading {
  background: linear-gradient(135deg, #e7edf5, #d4dde8);
  filter: blur(4px);
  transition: filter .3s;
}
.task-thumbnail.lazy-loaded {
  animation: none;
  background: transparent;
  filter: none;
}
.task-thumbnail.lazy-error {
  /* 缩略图拉不到：保留 placeholder 背景，让用户感知到加载失败而非空白 */
  background: #f7e9ea;
}
@keyframes thumbnail-shimmer {
  0%   { background-position: 0% 0%; }
  50%  { background-position: 100% 100%; }
  100% { background-position: 0% 0%; }
}
@keyframes load-more-spin {
  to { transform: rotate(360deg); }
}

/* 视频任务卡片预览：默认只展示首帧，hover 时浮出播放按钮 */
.video-preview {
  align-items: center;
  background: #0f1720;
  display: flex;
  height: 100%;
  justify-content: center;
  position: relative;
  width: 100%;
}
.video-preview .video-poster {
  height: 100%;
  object-fit: cover;
  position: absolute;
  width: 100%;
}
.video-preview .play-overlay {
  align-items: center;
  background: rgba(15, 24, 34, .62);
  border: 1px solid rgba(255, 255, 255, .35);
  border-radius: 99px;
  color: #fff;
  cursor: pointer;
  display: inline-flex;
  font-size: 12px;
  font-weight: 700;
  gap: 6px;
  padding: 9px 16px;
  position: relative;
  transition: background .18s;
  z-index: 2;
}
.video-preview .play-overlay:hover { background: rgba(46, 109, 246, .92); }
.video-preview .play-overlay svg {
  fill: currentColor;
  height: 16px;
  width: 16px;
}
.video-preview .video-hint {
  bottom: 8px;
  color: rgba(255, 255, 255, .75);
  font-size: 10px;
  left: 50%;
  position: absolute;
  transform: translateX(-50%);
  z-index: 2;
}
/* 视频卡片缩略图缺失时的兜底（ffmpeg 缺失 / 历史产物未补帧）。给一个播放图标 +
   浅灰底，避免页面出现一片 broken image。点击播放按钮仍然能正常加载视频。 */
.video-preview .video-poster-placeholder {
  align-items: center;
  background: linear-gradient(135deg, #1c2a3a, #0f1720);
  color: rgba(255, 255, 255, .65);
  display: flex;
  flex-direction: column;
  font-size: 11px;
  gap: 4px;
  height: 100%;
  justify-content: center;
  position: absolute;
  width: 100%;
}
.video-preview .video-poster-placeholder svg {
  fill: rgba(255, 255, 255, .55);
  height: 44px;
  width: 44px;
}
/* video 元素必须 position absolute 占满 wrapper：video 是 inline 元素，默认按内容尺寸排，
   不加 position 会被 wrapper 的 flex 布局影响尺寸；占满后再用 object-fit: contain 居中。
   z-index 比 video-poster 高，覆盖在上面；poster 用 hidden 控制是否还在。 */
.video-preview .task-video-player {
  background: #0f1720;
  bottom: 0;
  display: block;
  left: 0;
  max-height: 100%;
  min-height: 0;
  object-fit: contain;
  position: absolute;
  right: 0;
  top: 0;
  width: 100%;
  z-index: 3;
}
/* 全屏按钮：浮在 video 右上角，hover 才显示，不抢播放控件的位置 */
.video-preview .fullscreen-toggle {
  align-items: center;
  background: rgba(15, 24, 34, .62);
  border: 1px solid rgba(255, 255, 255, .35);
  border-radius: 50%;
  color: #fff;
  cursor: pointer;
  display: inline-flex;
  height: 30px;
  justify-content: center;
  opacity: 0;
  padding: 0;
  position: absolute;
  right: 8px;
  top: 8px;
  transition: opacity .15s, background .15s;
  width: 30px;
  z-index: 5;
}
.video-preview.is-playing .fullscreen-toggle { opacity: 1; }
.video-preview .fullscreen-toggle:hover { background: rgba(46, 109, 246, .92); }
.video-preview .fullscreen-toggle svg {
  fill: currentColor;
  height: 14px;
  width: 14px;
}
/* 视频被全屏后某些浏览器会保留自己的控件背景，但其它元素可能被一起全屏化；
   这里把 wrapper 设成 fullscreen-friendly，给 :fullscreen 加黑底，避免出现半截白底 */
.video-preview:fullscreen,
.video-preview:-webkit-full-screen {
  align-items: stretch;
  background: #000;
  display: flex;
  justify-content: center;
  width: 100vw;
  height: 100vh;
}
.video-preview:fullscreen .task-video-player,
.video-preview:-webkit-full-screen .task-video-player {
  height: 100%;
  width: 100%;
}
.video-preview:fullscreen .fullscreen-toggle,
.video-preview:-webkit-full-screen .fullscreen-toggle {
  opacity: 1;
  right: 20px;
  top: 20px;
  height: 38px;
  width: 38px;
}
.video-preview:fullscreen .fullscreen-toggle svg,
.video-preview:-webkit-full-screen .fullscreen-toggle svg {
  height: 18px;
  width: 18px;
}

/* 图片查看器：切图时显示「正在加载原图」过渡提示 */
.image-dialog-loading {
  background: rgba(15, 24, 34, .78);
  border: 1px solid rgba(255, 255, 255, .25);
  border-radius: 99px;
  color: #fff;
  font-size: 12px;
  left: 50%;
  padding: 8px 14px;
  position: absolute;
  top: 14px;
  transform: translateX(-50%);
  z-index: 5;
}
.image-dialog-loading::before {
  animation: load-more-spin .9s linear infinite;
  border: 2px solid rgba(255, 255, 255, .35);
  border-top-color: #fff;
  border-radius: 50%;
  content: '';
  display: inline-block;
  height: 11px;
  margin-right: 7px;
  vertical-align: -1px;
  width: 11px;
}
.image-dialog-canvas img.image-loading { opacity: .35; transition: opacity .25s; }
