/* 局部编辑面板 · 偏色处理（配色沿用 .admin-side-editor 暖色深色风格） */
.admin-side-editor.nano-cast-active > .admin-side-editor-body,
.admin-side-editor.nano-cast-active > .admin-side-editor-foot { display: none !important; }
.admin-side-editor.nano-cast-active .admin-side-editor-toolbar > :not(.admin-side-editor-mode-switch):not(#admin-side-editor-expand-tool) { visibility: hidden; pointer-events: none; }
.admin-side-editor .nano-cast-mode-btn svg { width: 19px; height: 19px; display: block; }
.admin-side-editor .nano-cast-mode-text { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

.nano-cast-body[hidden], .nano-cast-foot[hidden], .nano-cast-body [hidden] { display: none !important; }
.nano-cast-body {
  position: relative; flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 10px;
  padding: 14px 18px 10px; overflow: hidden; color: rgba(255, 247, 239, .9); font-size: 13px;
}
.nano-cast-stage {
  position: relative; flex: 1 1 auto; min-height: 220px; display: grid; place-items: center;
  border: 1px solid rgba(255, 236, 214, .1); border-radius: 18px; background: rgba(0, 0, 0, .28); overflow: hidden;
}
.nano-cast-empty { color: rgba(255, 239, 220, .6); padding: 24px; text-align: center; }
.nano-cast-compare {
  position: relative; display: none; line-height: 0; cursor: ew-resize; touch-action: none; user-select: none;
  border-radius: 10px; overflow: hidden; outline: none; --split: 50%;
}
.nano-cast-compare.ready { display: block; }
.nano-cast-compare canvas { display: block; width: 100%; height: 100%; }
.nano-cast-compare .nano-cast-after, .nano-cast-compare .nano-cast-heat { position: absolute; inset: 0; }
.nano-cast-compare .nano-cast-after { clip-path: inset(0 0 0 var(--split)); visibility: hidden; }
.nano-cast-compare.has-fix .nano-cast-after { visibility: visible; }
.nano-cast-compare .nano-cast-heat { display: none; }
.nano-cast-compare.show-heat .nano-cast-heat { display: block; }
.nano-cast-divider {
  position: absolute; top: 0; bottom: 0; left: var(--split); width: 2px; margin-left: -1px; background: #fff;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, .25), 0 0 12px rgba(0, 0, 0, .5); pointer-events: none; display: none;
}
.nano-cast-compare.has-fix .nano-cast-divider { display: block; }
.nano-cast-divider span {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); width: 30px; height: 30px; border-radius: 50%;
  display: grid; place-items: center; background: rgba(20, 14, 10, .78); border: 2px solid #fff; color: #fff; font-size: 13px; line-height: 1;
}
.nano-cast-label {
  position: absolute; top: 10px; padding: 3px 8px; border-radius: 999px; font-size: 11px; line-height: 1.4; color: #fff;
  background: rgba(0, 0, 0, .5); pointer-events: none;
}
.nano-cast-label.before { left: 10px; }
.nano-cast-label.after { right: 10px; display: none; }
.nano-cast-compare.has-fix .nano-cast-label.after { display: block; }
.nano-cast-busy { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(18, 13, 10, .62); backdrop-filter: blur(2px); }
.nano-cast-busy-card {
  min-width: 220px; padding: 14px 16px; border-radius: 14px; border: 1px solid rgba(255, 236, 214, .14);
  background: rgba(34, 23, 16, .95); color: rgba(255, 247, 239, .9); display: grid; grid-template-columns: auto 1fr; gap: 10px; align-items: center;
}
.nano-cast-spinner { width: 18px; height: 18px; border-radius: 50%; border: 2.5px solid rgba(255, 236, 214, .2); border-top-color: #ffc863; animation: nano-cast-spin .8s linear infinite; }
@keyframes nano-cast-spin { to { transform: rotate(360deg); } }
.nano-cast-bar { grid-column: 1 / -1; height: 4px; border-radius: 99px; background: rgba(255, 236, 214, .12); overflow: hidden; }
.nano-cast-bar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #ffe178, #ff9f3d); transition: width .15s; }

.nano-cast-panel {
  flex: 0 0 auto; display: grid; gap: 9px; padding: 12px 14px; border: 1px solid rgba(255, 236, 214, .12);
  border-radius: 16px; background: rgba(255, 255, 255, .045);
}
.nano-cast-row { display: flex; align-items: center; gap: 10px; min-width: 0; }
.nano-cast-label-text { flex: 0 0 56px; font-size: 12px; font-weight: 800; color: rgba(255, 239, 220, .62); }
.nano-cast-refs, .nano-cast-chips { display: flex; flex-wrap: wrap; gap: 6px; min-width: 0; }
.nano-cast-chip, .nano-cast-ref {
  height: 30px; border: 1px solid rgba(255, 236, 214, .14); border-radius: 999px; background: rgba(255, 255, 255, .06);
  color: rgba(255, 247, 239, .86); font: inherit; font-size: 12px; font-weight: 700; padding: 0 11px; cursor: pointer;
  display: inline-flex; align-items: center; gap: 6px; transition: .15s;
}
.nano-cast-ref { padding: 0 10px 0 3px; }
.nano-cast-ref.text { padding: 0 11px; }
.nano-cast-ref img { width: 24px; height: 24px; border-radius: 50%; object-fit: cover; background: rgba(255, 255, 255, .08); }
.nano-cast-chip:hover, .nano-cast-ref:hover { border-color: rgba(255, 205, 102, .45); }
.nano-cast-chip.active, .nano-cast-ref.active { background: rgba(255, 205, 102, .18); border-color: rgba(255, 205, 102, .55); color: #fff3cf; }
.nano-cast-row input[type=range] { flex: 1; min-width: 80px; accent-color: #ffb24d; }
.nano-cast-value { flex: 0 0 42px; text-align: right; font-weight: 800; color: #fff3cf; }
.nano-cast-toggles { flex-wrap: wrap; gap: 6px 14px; padding-left: 66px; }
.nano-cast-toggles label { display: inline-flex; align-items: center; gap: 5px; color: rgba(255, 239, 220, .72); font-size: 12px; cursor: pointer; }
.nano-cast-toggles input { accent-color: #ffb24d; width: 14px; height: 14px; }
.nano-cast-toggles input:disabled + * , .nano-cast-toggles label:has(input:disabled) { opacity: .45; cursor: not-allowed; }
.nano-cast-link { border: 0; background: none; padding: 0; color: #ffcd72; font: inherit; font-size: 12px; font-weight: 700; cursor: pointer; }
.nano-cast-link:hover { text-decoration: underline; }
.nano-cast-toggles .nano-cast-link { margin-left: auto; }
.nano-cast-diag { display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: 12px; color: rgba(255, 239, 220, .56); min-height: 18px; padding-left: 66px; }
.nano-cast-diag b { color: rgba(255, 247, 239, .92); font-weight: 800; }

.nano-cast-batch {
  flex: 0 0 auto; display: grid; gap: 8px; padding: 10px 14px 12px; border: 1px solid rgba(255, 236, 214, .12);
  border-radius: 16px; background: rgba(255, 255, 255, .03);
}
.nano-cast-batch-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.nano-cast-batch-head strong { font-size: 13px; font-weight: 900; }
.nano-cast-batch-head em { font-style: normal; font-weight: 700; color: rgba(255, 239, 220, .56); margin-left: 4px; }
.nano-cast-batch-actions { display: flex; align-items: center; gap: 12px; }
.nano-cast-queue { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 2px; scrollbar-width: thin; }
.nano-cast-queue-empty { font-size: 12px; color: rgba(255, 239, 220, .5); line-height: 1.6; }
.nano-cast-q {
  position: relative; flex: 0 0 64px; height: 80px; border-radius: 10px; overflow: hidden; cursor: pointer;
  border: 2px solid transparent; background: rgba(255, 255, 255, .06);
}
.nano-cast-q.active { border-color: #ffc863; }
.nano-cast-q img { width: 100%; height: 100%; object-fit: cover; display: block; }
.nano-cast-q-badge {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 2px 0; text-align: center; font-size: 10px; font-weight: 800;
  color: #fff; background: rgba(0, 0, 0, .55);
}
.nano-cast-q.is-done .nano-cast-q-badge { background: rgba(46, 125, 72, .85); }
.nano-cast-q.is-working .nano-cast-q-badge { background: rgba(214, 140, 30, .9); }
.nano-cast-q.is-error .nano-cast-q-badge { background: rgba(180, 50, 50, .9); }
.nano-cast-q-ref {
  position: absolute; top: 4px; left: 4px; padding: 0 5px; border-radius: 6px; font-size: 10px; font-weight: 800; line-height: 16px;
  color: #33190a; background: rgba(255, 214, 120, .92);
}
.nano-cast-q-x {
  position: absolute; top: 3px; right: 3px; width: 18px; height: 18px; border: 0; border-radius: 50%; padding: 0; cursor: pointer;
  background: rgba(0, 0, 0, .55); color: #fff; font-size: 13px; line-height: 18px; display: none;
}
.nano-cast-q:hover .nano-cast-q-x { display: block; }

.nano-cast-ghost, .nano-cast-primary {
  height: 34px; border-radius: 999px; font: inherit; font-size: 12px; font-weight: 850; padding: 0 14px; cursor: pointer; white-space: nowrap;
}
.nano-cast-ghost { border: 1px solid rgba(255, 236, 214, .2); background: rgba(255, 255, 255, .06); color: rgba(255, 247, 239, .9); }
.nano-cast-ghost:hover { border-color: rgba(255, 205, 102, .5); }
.nano-cast-primary { border: 0; background: linear-gradient(135deg, #ffe178, #ff9f3d); color: #33190a; }
.nano-cast-foot .nano-cast-primary { height: 42px; font-size: 13px; font-weight: 950; padding: 0 18px; }
.nano-cast-ghost:disabled, .nano-cast-primary:disabled { opacity: .45; cursor: not-allowed; }

.nano-cast-foot {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px 18px 18px; border-top: 1px solid rgba(255, 236, 214, .1);
}
.nano-cast-status { min-width: 0; font-size: 12px; line-height: 1.6; color: rgba(255, 239, 220, .64); }
.nano-cast-status.ok { color: #ffd27a; }
.nano-cast-status.warn { color: #ff9a8a; }
.nano-cast-foot-actions { display: flex; gap: 8px; flex: 0 0 auto; }

.nano-cast-picker { position: absolute; inset: 0; z-index: 5; display: grid; place-items: center; background: rgba(12, 9, 7, .72); padding: 16px; }
.nano-cast-picker-card {
  width: 100%; max-height: 100%; display: flex; flex-direction: column; gap: 10px; padding: 14px;
  border-radius: 18px; border: 1px solid rgba(255, 236, 214, .14); background: linear-gradient(180deg, #1c1511, #251810);
  box-shadow: 0 20px 60px rgba(0, 0, 0, .45);
}
.nano-cast-picker-head { display: flex; align-items: center; gap: 10px; }
.nano-cast-picker-head strong { font-size: 15px; font-weight: 900; }
.nano-cast-picker-head span { color: rgba(255, 239, 220, .6); font-size: 12px; }
.nano-cast-x { margin-left: auto; width: 30px; height: 30px; border-radius: 50%; border: 1px solid rgba(255, 236, 214, .16); background: rgba(255, 255, 255, .06); color: #fff; font-size: 18px; line-height: 1; cursor: pointer; }
.nano-cast-picker-tools { display: flex; align-items: center; gap: 12px; }
.nano-cast-hint { font-size: 12px; color: rgba(255, 239, 220, .5); }
.nano-cast-picker-grid { flex: 1; min-height: 120px; overflow: auto; display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; align-content: start; }
.nano-cast-pick {
  position: relative; aspect-ratio: 3 / 4; border: 2px solid transparent; border-radius: 12px; overflow: hidden; padding: 0; cursor: pointer;
  background: rgba(255, 255, 255, .06);
}
.nano-cast-pick img { width: 100%; height: 100%; object-fit: cover; display: block; }
.nano-cast-pick.selected { border-color: #ffc863; }
.nano-cast-pick.queued { opacity: .45; cursor: default; }
.nano-cast-check {
  position: absolute; right: 5px; top: 5px; min-width: 22px; height: 22px; padding: 0 5px; border-radius: 999px; display: grid; place-items: center;
  font-size: 11px; font-weight: 900; color: #33190a; background: rgba(255, 255, 255, .78);
}
.nano-cast-pick:not(.selected):not(.queued) .nano-cast-check { background: rgba(0, 0, 0, .35); border: 1.5px solid rgba(255, 255, 255, .8); }
.nano-cast-pick.selected .nano-cast-check { background: #ffc863; }
.nano-cast-picker-foot { display: flex; justify-content: space-between; gap: 10px; }

/* 选择器页码 */
.nano-cast-pages { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; min-width: 0; }
.nano-cast-page {
  min-width: 30px; height: 30px; padding: 0 8px; border-radius: 8px; border: 1px solid rgba(255, 236, 214, .14);
  background: rgba(255, 255, 255, .05); color: rgba(255, 247, 239, .86); font: inherit; font-size: 12px; font-weight: 800; cursor: pointer;
}
.nano-cast-page:hover:not(:disabled) { border-color: rgba(255, 205, 102, .5); }
.nano-cast-page.active { background: rgba(255, 205, 102, .2); border-color: rgba(255, 205, 102, .6); color: #fff3cf; }
.nano-cast-page:disabled { opacity: .35; cursor: default; }
.nano-cast-page-gap { padding: 0 2px; color: rgba(255, 239, 220, .5); }
.nano-cast-picker-foot { align-items: center; }
.nano-cast-picker-grid.loading { opacity: .5; pointer-events: none; }

/* 定时批量：批次卡片上的偏色处理 */
.nano-cast-sched { display: inline-flex; align-items: center; gap: 6px; margin-left: 6px; vertical-align: middle; }
.nano-cast-sched-pick { display: inline-flex; align-items: center; gap: 3px; font-size: 12px; opacity: .8; cursor: pointer; white-space: nowrap; }
.nano-cast-sched-pick input { width: 14px; height: 14px; accent-color: #ffb24d; cursor: pointer; }
.nano-cast-sched-bar[hidden] { display: none !important; }
.nano-cast-sched-bar {
  position: absolute; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 20;
  display: flex; align-items: center; gap: 12px; padding: 10px 12px 10px 18px; border-radius: 999px;
  background: rgba(30, 20, 14, .96); border: 1px solid rgba(255, 205, 102, .35); box-shadow: 0 14px 40px rgba(0, 0, 0, .45);
  color: #fff3cf; font-size: 13px; font-weight: 800; white-space: nowrap;
}
.nano-cast-sched-bar button {
  height: 34px; border-radius: 999px; font: inherit; font-size: 12px; font-weight: 900; padding: 0 14px; cursor: pointer;
}
.nano-cast-sched-clear { border: 1px solid rgba(255, 236, 214, .25); background: transparent; color: rgba(255, 247, 239, .85); }
.nano-cast-sched-go { border: 0; background: linear-gradient(135deg, #ffe178, #ff9f3d); color: #33190a; }
.nano-cast-sched-go:disabled { opacity: .55; cursor: wait; }

#admin-side-editor[data-local-edit-tool="expand"] #admin-side-editor-tool-picker,
#admin-side-editor[data-local-edit-tool="expand"] #admin-side-editor-clear{display:none!important}
