.layout {
  max-width: 1680px;
  margin: 0 auto;
  padding: 8px 36px 64px;
}
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 36px;
  max-width: 1680px;
  margin: 0 auto;
  gap: 16px;
  flex-wrap: wrap;
}
.grid {
  display: grid;
  grid-template-columns: 420px 1fr;
  gap: 32px;
  align-items: start;
}
.panel {
  padding: 26px 26px 22px;
  position: sticky;
  top: 24px;
}
.panel-title {
  display: flex; align-items: center; gap: 10px;
  margin: 0 0 4px;
  font-size: 18px;
  color: #fff;
}
.panel-title-icon {
  width: 32px; height: 32px;
  border-radius: 10px;
  background: rgba(139,92,246,.18);
  border: 1px solid rgba(139,92,246,.4);
  display: inline-flex; align-items: center; justify-content: center;
  color: #c4b5fd;
}
.panel-title-icon svg { width: 18px; height: 18px; }
:root[data-app-theme="vale"] #imageMode #iconWand,
:root[data-app-theme="vale"] #imageMode .empty-state .empty-icon {
  color: #111827 !important;
}
:root[data-app-theme="vale"] #imageMode #iconWand {
  background: #111827 !important;
  border-color: #111827 !important;
  color: #ffffff !important;
  box-shadow: 0 10px 24px -16px rgba(15,23,42,.55);
}
:root[data-app-theme="vale"] #storyMode #iconStoryPanel {
  background: #111827 !important;
  border-color: #111827 !important;
  color: #ffffff !important;
  box-shadow: 0 10px 24px -16px rgba(15,23,42,.55);
}
:root[data-app-theme="vale"] #imageMode #iconWand svg,
:root[data-app-theme="vale"] #imageMode #iconWand svg *,
:root[data-app-theme="vale"] #imageMode .empty-state .empty-icon svg,
:root[data-app-theme="vale"] #imageMode .empty-state .empty-icon svg * {
  color: #111827 !important;
  stroke: currentColor !important;
}
:root[data-app-theme="vale"] #imageMode #iconWand svg,
:root[data-app-theme="vale"] #imageMode #iconWand svg * {
  color: #ffffff !important;
  stroke: currentColor !important;
}
:root[data-app-theme="vale"] #storyMode #iconStoryPanel svg,
:root[data-app-theme="vale"] #storyMode #iconStoryPanel svg * {
  color: #ffffff !important;
  stroke: currentColor !important;
}
.panel-sub {
  color: rgba(255,255,255,.55);
  font-size: 13px;
  margin: 0 0 18px 42px;
}
.form-grid { display: grid; grid-template-columns: 5fr 2fr; gap: 12px; margin-top: 14px; }

.prompt-mode-shell {
  max-width: 1160px;
  margin: 0 auto;
}
#promptMode .prompt-optimizer {
  margin: 0;
  padding: 24px;
  border-radius: 20px;
}
#promptMode .po-title { font-size: 18px; }
#promptMode .po-title-icon {
  width: 34px;
  height: 34px;
  border-radius: 11px;
}
#promptMode .po-sub {
  margin-left: 42px;
  font-size: 13px;
}
#promptMode .po-output-text { min-height: 190px; }
#promptMode .po-type-grid { display: block; }
#promptMode .po-output-actions { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }

.image-edit-shell {
  width: 100%;
  max-width: none;
  margin-left: 0;
  margin-right: 0;
  padding: 18px;
  border-radius: 24px;
  border: 1px solid rgba(255,255,255,.12);
  background:
    radial-gradient(circle at 18% 0%, rgba(99,102,241,.16), transparent 32%),
    linear-gradient(180deg, rgba(255,255,255,.08), rgba(255,255,255,.035));
  box-shadow: 0 26px 80px -48px rgba(0,0,0,.75), inset 0 1px 0 rgba(255,255,255,.08);
}
#editMode {
  width: 100%;
  margin-left: 0;
  margin-right: 0;
}
.image-edit-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.16fr) minmax(330px, .84fr);
  gap: 18px;
  align-items: stretch;
}
.image-edit-card {
  min-width: 0;
  padding: 20px;
  border-radius: 20px;
  border: 1px solid rgba(255,255,255,.12);
  background: rgba(8,13,28,.55);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.06);
}
.image-edit-upload-card {
  min-height: auto;
}
.image-edit-upload-card .image-edit-upload-wrap {
  margin-top: 0;
  margin-bottom: 0;
  transform: none;
}
.image-edit-title {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  color: #fff;
  font-size: 22px;
  font-weight: 850;
  line-height: 1.25;
}
.image-edit-sub {
  margin: 8px 0 0;
  color: rgba(255,255,255,.58);
  font-size: 13px;
  line-height: 1.6;
}
.image-edit-drop {
  height: clamp(320px, 34vw, 500px);
  min-height: 320px;
  border: 1px dashed rgba(196,181,253,.36);
  border-radius: 20px;
  background: rgba(255,255,255,.035);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  cursor: pointer;
  transition: border-color .16s ease, background .16s ease, transform .16s ease;
}
.image-edit-drop.dragover {
  border-color: rgba(167,139,250,.58);
  background: rgba(139,92,246,.10);
  transform: translateY(-1px);
}
.image-edit-drop.dragover .image-edit-drop-hint,
.image-edit-drop.dragover .image-edit-preview {
  filter: saturate(1.08);
}
.image-edit-drop-hint {
  width: 100%;
  padding: 34px 18px;
  text-align: center;
  color: rgba(255,255,255,.72);
}
.image-edit-drop-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 16px;
  border-radius: 22px;
  display: grid;
  place-items: center;
  color: #fff;
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.12);
}
.image-edit-preview {
  position: relative;
  width: 100%;
  height: clamp(320px, 34vw, 500px);
  display: none;
  place-items: center;
  background: rgba(0,0,0,.22);
}
.image-edit-preview img {
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 500px;
  object-fit: contain;
  display: block;
}
#imageEditBrushCanvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  cursor: crosshair;
  touch-action: none;
  z-index: 2;
}
.image-edit-detect-overlay {
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
}
.image-edit-detect-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  pointer-events: none;
}
.image-edit-detect-shape {
  fill: rgba(236,72,153,.045);
  stroke: rgba(255,46,157,.98);
  stroke-width: 1.05;
  stroke-linecap: round;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
  pointer-events: auto;
  cursor: move;
  transition: fill .16s ease, stroke .16s ease, stroke-width .16s ease;
}
.image-edit-detect-shape:hover {
  fill: rgba(236,72,153,.12);
  stroke-width: 1.45;
}
.image-edit-detect-shape.selected {
  fill: rgba(236,72,153,.16);
  stroke: rgba(255,0,128,1);
  stroke-width: 1.75;
}
.image-edit-detect-delete {
  position: absolute;
  z-index: 4;
  min-height: 30px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid rgba(255,46,157,.42);
  background: rgba(255,255,255,.92);
  color: #be185d;
  -webkit-text-fill-color: #be185d;
  font-family: inherit;
  font-size: 12px;
  font-weight: 900;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  cursor: pointer;
  box-shadow: 0 14px 28px -18px rgba(15,23,42,.5), inset 0 1px 0 rgba(255,255,255,.9);
  pointer-events: auto;
}
.image-edit-detect-delete svg {
  width: 13px;
  height: 13px;
  stroke: currentColor;
}
.image-edit-detect-box {
  position: absolute;
  border: 2px solid rgba(15,23,42,.86);
  background: transparent !important;
  border-radius: 8px;
  pointer-events: auto;
  cursor: pointer;
  box-shadow: 0 10px 24px -18px rgba(15,23,42,.7);
  appearance: none;
  -webkit-appearance: none;
  padding: 0;
}
.image-edit-detect-box span {
  position: absolute;
  left: -2px;
  top: -26px;
  max-width: 180px;
  padding: 3px 8px;
  border-radius: 8px;
  background: #0f172a;
  color: #fff;
  font-size: 12px;
  font-weight: 850;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  opacity: 0;
  transform: translateY(4px);
  pointer-events: none;
  transition: opacity .14s ease, transform .14s ease;
}
.image-edit-detect-box:hover span,
.image-edit-detect-box:focus-visible span {
  opacity: 1;
  transform: translateY(0);
}
.image-edit-remove {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 4;
  width: 34px;
  height: 34px;
  border-radius: 11px;
  border: 1px solid rgba(255,255,255,.2);
  background: rgba(15,23,42,.78);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.image-edit-options {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}
.image-edit-option-block {
  margin-top: 14px;
}
.image-edit-pill {
  min-height: 44px;
  width: 100%;
  padding: 0 12px;
  border-radius: 13px;
  border: 1px solid rgba(255,255,255,.12);
  background: rgba(255,255,255,.055);
  color: rgba(255,255,255,.72);
  -webkit-text-fill-color: currentColor;
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 750;
  cursor: pointer;
  transition: background .16s ease, color .16s ease, border-color .16s ease;
}
.image-edit-pill.active {
  color: #fff !important;
  -webkit-text-fill-color: #fff !important;
  background: linear-gradient(135deg, rgba(99,102,241,.55), rgba(236,72,153,.36));
  border-color: rgba(196,181,253,.40);
}
.image-edit-pill.active *,
.image-edit-pill.active svg,
.image-edit-pill.active svg * {
  color: #fff !important;
  stroke: #fff !important;
  -webkit-text-fill-color: #fff !important;
}
.image-edit-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 14px;
}
#imageEditClearBtn {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  text-align: center;
}
.image-edit-brush-panel {
  margin-top: 14px;
}
.image-edit-brush-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}
.image-edit-brush-tools {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: nowrap;
  width: 100%;
  min-height: 54px;
  padding: 6px;
  border-radius: 999px;
  background: rgba(255,255,255,.045);
  border: 1px solid rgba(255,255,255,.08);
}
.image-edit-brush-btn {
  min-height: 42px;
  padding: 0 12px;
  flex: 0 0 auto;
  border-radius: 999px;
  border: 0;
  background: transparent;
  color: rgba(255,255,255,.76);
  font-family: inherit;
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  white-space: nowrap;
  transition: background .15s ease, color .15s ease;
}
.image-edit-brush-btn.active {
  color: #fff !important;
  -webkit-text-fill-color: #fff !important;
  background: #0f172a;
  box-shadow: 0 8px 18px -14px rgba(15,23,42,.35);
}
.image-edit-brush-btn.active svg,
.image-edit-brush-btn.active svg * {
  color: #fff !important;
  stroke: #fff !important;
}
.image-edit-brush-btn svg {
  width: 17px;
  height: 17px;
  stroke: currentColor;
}
.image-edit-brush-size {
  width: 96px;
  min-width: 72px;
  flex: 1 1 92px;
  accent-color: #6366f1;
}
.image-edit-brush-size-word {
  flex: 0 0 auto;
}
.image-edit-brush-size-label {
  min-width: 40px;
  flex: 0 0 auto;
  color: rgba(255,255,255,.86);
  font-size: 13px;
  font-weight: 850;
  text-align: right;
}
.image-edit-detect-btn {
  margin-top: 8px;
  width: 100%;
  min-height: 40px;
  border-radius: 13px;
  border: 1px solid #cbd5e1;
  background: rgba(255,255,255,.72);
  color: #0f172a;
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 850;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.88);
}
.image-edit-detect-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 8px;
}
.image-edit-detect-grid .image-edit-detect-btn {
  margin-top: 0;
  min-width: 0;
  padding: 0 10px;
  white-space: nowrap;
}
.image-edit-loading {
  height: clamp(320px,34vw,500px);
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at 50% 36%, rgba(99,102,241,.12), transparent 35%),
    rgba(248,250,252,.78);
  color: #0f172a;
  text-align: center;
  font-weight: 850;
}
.image-edit-loading .spinner {
  width: 24px;
  height: 24px;
  border-width: 2.4px;
  margin: 0 auto 12px;
}
.image-edit-loading-sub {
  margin-top: 6px;
  color: #64748b;
  font-size: 12.5px;
  font-weight: 750;
}
.pending-job {
  min-height: 260px;
  border-radius: 18px;
  border: 1px solid rgba(203,213,225,.78);
  background:
    radial-gradient(circle at 50% 28%, rgba(99,102,241,.13), transparent 34%),
    linear-gradient(180deg, rgba(255,255,255,.72), rgba(248,250,252,.58));
  display: grid;
  place-items: center;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.8);
}
.pending-job-inner {
  text-align: center;
  color: #0f172a;
  padding: 24px;
}
.pending-job-inner .spinner {
  width: 24px;
  height: 24px;
  border-width: 2.4px;
  margin: 0 auto 14px;
}
.pending-job-title {
  font-size: 17px;
  font-weight: 900;
  letter-spacing: 0;
}
.pending-job-sub {
  margin-top: 8px;
  color: #64748b;
  font-size: 13px;
  font-weight: 760;
  line-height: 1.55;
}
.image-edit-result-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.image-edit-result-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}
.image-edit-result-grid {
  min-height: 260px;
}
.image-edit-result-card {
  grid-column: 1 / -1;
  margin-top: 0;
}
.image-edit-control-card > div:first-child {
  margin-top: 0 !important;
}
#editMode .label-dark {
  font-size: 15.5px;
  font-weight: 850;
  line-height: 1.35;
}
#editMode .image-edit-drop-hint > div:nth-child(2) {
  font-size: 20px !important;
  font-weight: 900 !important;
  margin-bottom: 8px !important;
}
#editMode .image-edit-drop-hint > div:nth-child(3) {
  font-size: 13.5px !important;
}
#editMode .image-edit-pill {
  font-size: 14px;
}
#editMode .overlay-actions {
  gap: 8px;
  top: 12px;
  right: 12px;
}
#editMode .overlay-actions .icon-btn {
  width: 38px;
  height: 38px;
  border-radius: 13px;
  background: rgba(248,250,252,.88) !important;
  border: 1px solid rgba(203,213,225,.82) !important;
  color: #111827 !important;
  box-shadow: 0 10px 22px -16px rgba(15,23,42,.42), inset 0 1px 0 rgba(255,255,255,.75);
  backdrop-filter: blur(8px);
}
#editMode .overlay-actions .icon-btn svg,
#editMode .overlay-actions .icon-btn svg * {
  color: #111827 !important;
  stroke: #111827 !important;
}
#editMode .image-card {
  border-radius: 20px;
}
:root[data-app-theme="vale"] .image-edit-title,
:root[data-app-theme="vale"] .image-edit-card .label-dark {
  color: #0f172a !important;
  -webkit-text-fill-color: #0f172a !important;
}
:root[data-app-theme="vale"] .image-edit-sub {
  color: #526070 !important;
}
:root[data-app-theme="vale"] .image-edit-drop {
  background: #f8fafc;
  border-color: #cbd5e1;
}
:root[data-app-theme="vale"] .image-edit-brush-tools {
  background: rgba(255,255,255,.72);
  border-color: #dbe4ef;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.88);
}
:root[data-app-theme="vale"] .image-edit-brush-btn {
  color: #0f172a;
}
:root[data-app-theme="vale"] .image-edit-brush-btn.active {
  color: #fff !important;
  -webkit-text-fill-color: #fff !important;
  background: #0f172a;
}
:root[data-app-theme="vale"] .image-edit-brush-size-label {
  color: #0f172a;
}
:root[data-app-theme="vale"] .image-edit-drop-hint {
  color: #475569;
}
:root[data-app-theme="vale"] .image-edit-drop-icon,
:root[data-app-theme="vale"] .image-edit-remove {
  background: #fff;
  border-color: #cbd5e1;
  color: #111827;
}
:root[data-app-theme="vale"] .image-edit-pill {
  background: #f8fafc;
  border-color: #cbd5e1;
  color: #475569;
}
:root[data-app-theme="vale"] .image-edit-pill.active {
  background: #111827 !important;
  border-color: #111827 !important;
  color: #fff !important;
  -webkit-text-fill-color: #fff !important;
  box-shadow: 0 10px 22px -18px rgba(15,23,42,.65);
}
:root[data-app-theme="vale"] .image-edit-pill.active *,
:root[data-app-theme="vale"] .image-edit-pill.active svg,
:root[data-app-theme="vale"] .image-edit-pill.active svg * {
  color: #fff !important;
  stroke: #fff !important;
  -webkit-text-fill-color: #fff !important;
}
@media (max-width: 900px) {
  #editMode {
    width: 100%;
    margin-left: 0;
  }
  .image-edit-grid {
    grid-template-columns: 1fr;
  }
  .image-edit-shell {
    width: 100%;
    padding: 12px;
    border-radius: 18px;
  }
  .image-edit-card {
    padding: 16px;
    border-radius: 16px;
  }
  .image-edit-upload-card {
    min-height: auto;
  }
  .image-edit-result-card {
    grid-column: auto;
  }
  .image-edit-upload-card .image-edit-upload-wrap {
    margin-top: 0;
    margin-bottom: 0;
    transform: none;
  }
  .image-edit-drop {
    height: 280px;
    min-height: 236px;
  }
  #editMode .label-dark {
    font-size: 14.5px;
  }
  #editMode .image-edit-drop-hint > div:nth-child(2) {
    font-size: 18px !important;
  }
  .image-edit-preview img {
    height: auto;
    max-height: 280px;
  }
  .image-edit-preview {
    height: 280px;
  }
  .image-edit-options {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .image-edit-pill {
    padding: 0 6px;
    font-size: 12px;
  }
  .image-edit-brush-tools {
    width: 100%;
    justify-content: flex-start;
    border-radius: 18px;
    gap: 5px;
  }
  .image-edit-brush-btn {
    padding: 0 8px;
    font-size: 12px;
    gap: 4px;
  }
  .image-edit-brush-btn svg {
    width: 14px;
    height: 14px;
  }
  .image-edit-brush-size {
    width: 70px;
    min-width: 52px;
  }
  .image-edit-brush-size-label {
    min-width: 34px;
    font-size: 12px;
  }
}

.reverse-shell {
  max-width: 1180px;
  margin: 0 auto;
}
.rp-hero {
  padding: 8px 2px 16px;
}
.rp-kickers {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.rp-kicker {
  height: 34px;
  padding: 0 14px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.12);
  background: rgba(255,255,255,.07);
  color: rgba(255,255,255,.82);
  font-size: 12px;
  font-weight: 700;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.06);
}
.rp-title {
  margin: 0;
  color: #fff;
  font-size: clamp(38px, 6vw, 76px);
  line-height: .95;
  font-weight: 900;
  letter-spacing: 0;
}
.rp-sub {
  margin: 10px 0 0;
  color: rgba(216,226,255,.68);
  font-size: 15px;
  line-height: 1.7;
}
.rp-workspace {
  padding: 18px;
  border-radius: 24px;
  border: 1px solid rgba(255,255,255,.12);
  background:
    radial-gradient(circle at 18% 0%, rgba(99,102,241,.16), transparent 32%),
    linear-gradient(180deg, rgba(255,255,255,.08), rgba(255,255,255,.035));
  box-shadow: 0 26px 80px -48px rgba(0,0,0,.75), inset 0 1px 0 rgba(255,255,255,.08);
}
.rp-main-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.16fr) minmax(330px, .84fr);
  gap: 18px;
  align-items: stretch;
}
.rp-card {
  min-width: 0;
  padding: 20px;
  border-radius: 20px;
  border: 1px solid rgba(255,255,255,.12);
  background: rgba(8,13,28,.55);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.06);
}
.rp-card-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 14px;
}
.rp-eyebrow {
  color: rgba(196,181,253,.88);
  font-size: 12px;
  font-weight: 850;
  margin-bottom: 4px;
}
.rp-card-title {
  margin: 0;
  color: #fff;
  font-size: 22px;
  font-weight: 850;
  line-height: 1.25;
}
.rp-status {
  height: 30px;
  padding: 0 12px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  border: 1px solid rgba(255,255,255,.12);
  background: rgba(255,255,255,.06);
  color: rgba(255,255,255,.62);
  font-size: 12px;
  font-weight: 750;
  white-space: nowrap;
}
.rp-status.ready {
  color: #bbf7d0;
  border-color: rgba(34,197,94,.24);
  background: rgba(34,197,94,.10);
}
.rp-drop {
  height: clamp(320px, 34vw, 500px);
  min-height: 320px;
  border: 1px dashed rgba(196,181,253,.36);
  border-radius: 20px;
  background: rgba(255,255,255,.035);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  transition: border-color .15s, background .15s, transform .15s;
}
.rp-drop.drag-over {
  border-color: rgba(196,181,253,.74);
  background: rgba(139,92,246,.13);
  transform: translateY(-1px);
}
.rp-drop-hint {
  width: 100%;
  padding: 34px 18px;
  text-align: center;
  cursor: pointer;
  color: rgba(255,255,255,.64);
}
.rp-upload-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 22px;
  color: #c4b5fd;
  background: rgba(139,92,246,.16);
  border: 1px solid rgba(196,181,253,.26);
}
.rp-drop-title {
  color: #fff;
  font-size: 19px;
  font-weight: 850;
  margin-bottom: 8px;
}
.rp-drop-sub {
  font-size: 13px;
  line-height: 1.6;
  color: rgba(216,226,255,.58);
}
.rp-select-btn {
  height: 40px;
  border: 0;
  border-radius: 999px;
  margin-top: 18px;
  padding: 0 20px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #fff;
  background: #0f172a;
  font-family: inherit;
  font-size: 13px;
  font-weight: 850;
  cursor: pointer;
}
.rp-paste-tip {
  margin-top: 12px;
  color: rgba(216,226,255,.42);
  font-size: 12px;
}
.rp-preview {
  position: relative;
  width: 100%;
  height: 100%;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,.26);
}
.rp-preview img {
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  display: block;
}
.rp-remove {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  background: rgba(15,23,42,.88);
  cursor: pointer;
  box-shadow: 0 14px 28px -18px rgba(0,0,0,.9);
}
:root[data-app-theme="vale"] .rp-remove {
  color: #0f172a;
  background: rgba(255,255,255,.92);
  border: 1px solid rgba(203,213,225,.86);
  box-shadow: 0 16px 32px -22px rgba(15,23,42,.45), inset 0 1px 0 rgba(255,255,255,.75);
}
:root[data-app-theme="vale"] .rp-remove:hover {
  color: #020617;
  background: #fff;
  border-color: rgba(148,163,184,.95);
}
:root[data-app-theme="vale"] .rp-remove svg {
  stroke: currentColor;
}
.rp-desc {
  margin: 0 0 18px;
  color: rgba(216,226,255,.66);
  font-size: 13.5px;
  line-height: 1.85;
}
.rp-feature-list {
  display: grid;
  gap: 9px;
  margin-bottom: 16px;
}
.rp-feature {
  display: flex;
  align-items: center;
  gap: 9px;
  color: rgba(255,255,255,.72);
  font-size: 13px;
}
.rp-feature span:first-child {
  width: 22px;
  height: 22px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #c4b5fd;
  background: rgba(139,92,246,.12);
  flex-shrink: 0;
}
.rp-extra {
  min-height: 82px;
  resize: vertical;
  margin-bottom: 14px;
}
.rp-run {
  width: 100%;
  height: 48px;
  border: 0;
  border-radius: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  color: #fff;
  background: linear-gradient(135deg, rgba(99,102,241,.95), rgba(139,92,246,.92), rgba(236,72,153,.82));
  font-family: inherit;
  font-size: 15px;
  font-weight: 850;
  cursor: pointer;
  box-shadow: 0 16px 36px -24px rgba(139,92,246,.95);
}
.rp-run:disabled {
  cursor: not-allowed;
  color: rgba(255,255,255,.72);
  background: rgba(148,163,184,.42);
  box-shadow: none;
}
.rp-result-card {
  margin-top: 18px;
}
.rp-result-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.rp-result-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.rp-output {
  min-height: 360px;
  resize: vertical;
}
.rp-output-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.rp-output-pane {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.rp-output-label {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}
.rp-output-actions {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  flex: 0 0 auto;
}
.rp-output-action {
  min-height: 36px;
  padding: 0 14px;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  color: #0f172a !important;
  -webkit-text-fill-color: #0f172a !important;
  background: rgba(241,245,249,.86);
  border-color: rgba(148,163,184,.42);
  box-shadow: 0 10px 22px -18px rgba(15,23,42,.55);
}
.rp-output-action:hover {
  color: #0f172a !important;
  -webkit-text-fill-color: #0f172a !important;
  background: rgba(226,232,240,.96);
  border-color: rgba(100,116,139,.45);
}
.rp-output-action svg,
.rp-output-action svg * {
  color: #0f172a !important;
  stroke: #0f172a !important;
  -webkit-text-fill-color: #0f172a !important;
}
.rp-output-action.po-strong {
  color: #0f172a !important;
  -webkit-text-fill-color: #0f172a !important;
  background: rgba(226,232,240,.96);
  border-color: rgba(148,163,184,.5);
}
#videoReverseOutput {
  min-height: 300px;
}
#videoReverseAnalysisWrap {
  display: none !important;
}
.rp-analysis {
  display: none;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
}
.rp-analysis.open {
  display: grid;
}
.rp-analysis-box {
  min-width: 0;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,.10);
  background: rgba(255,255,255,.045);
  padding: 12px;
}
.rp-analysis-title {
  color: rgba(196,181,253,.88);
  font-size: 12px;
  font-weight: 850;
  margin-bottom: 8px;
}
.rp-analysis-text {
  color: rgba(255,255,255,.66);
  font-size: 12.5px;
  line-height: 1.7;
}
.rp-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.rp-tag {
  border-radius: 999px;
  padding: 5px 9px;
  background: rgba(139,92,246,.13);
  border: 1px solid rgba(196,181,253,.17);
  color: rgba(237,233,254,.88);
  font-size: 12px;
}
#reverseMode .rp-kickers,
#reverseMode .rp-sub,
#videoReverseMode .rp-kickers,
#videoReverseMode .rp-sub {
  display: none;
}
#videoReverseMode .rp-eyebrow {
  display: none;
}
#reverseApplyBtn #iconReverseApply,
#videoReverseApplyBtn #iconVideoReverseApply,
#reverseApplyBtn #iconReverseApply svg,
#videoReverseApplyBtn #iconVideoReverseApply svg,
#reverseApplyBtn #iconReverseApply svg *,
#videoReverseApplyBtn #iconVideoReverseApply svg * {
  color: #0f172a !important;
  stroke: #0f172a !important;
}
:root[data-app-theme="vale"] #reverseApplyBtn,
:root[data-app-theme="vale"] #videoReverseApplyBtn {
  color: #0f172a !important;
  -webkit-text-fill-color: #0f172a !important;
  background: #e8eef6 !important;
  border-color: #b7c4d6 !important;
}
:root[data-app-theme="vale"] #reverseApplyBtn:hover,
:root[data-app-theme="vale"] #videoReverseApplyBtn:hover {
  color: #0f172a !important;
  -webkit-text-fill-color: #0f172a !important;
  background: #dde7f2 !important;
  border-color: #93a4bc !important;
}
:root[data-app-theme="vale"] #reverseApplyBtn svg,
:root[data-app-theme="vale"] #videoReverseApplyBtn svg {
  color: #0f172a !important;
  stroke: #0f172a !important;
}
.video-analyze-panel {
  margin: 12px 0 14px;
  padding: 14px;
  border-radius: 18px;
  border: 1px solid rgba(148, 163, 184, .20);
  background: rgba(255, 255, 255, .58);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .38);
}
.video-analyze-title {
  margin-bottom: 10px;
  color: #0f172a;
  font-size: 13px;
  font-weight: 850;
}
.video-analyze-options {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}
.video-analyze-option {
  display: flex;
  gap: 11px;
  align-items: flex-start;
  padding: 13px 14px;
  border-radius: 16px;
  border: 1px solid rgba(148, 163, 184, .22);
  background: rgba(248, 250, 252, .86);
  color: #0f172a;
  cursor: pointer;
  transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}
.video-analyze-option:hover {
  border-color: rgba(15, 23, 42, .20);
  box-shadow: 0 12px 28px -24px rgba(15, 23, 42, .50);
  transform: translateY(-1px);
}
.video-analyze-option input[type="radio"] {
  margin-top: 3px;
  accent-color: #0f172a;
}
.video-analyze-option b {
  display: block;
  color: #0f172a;
  font-size: 14px;
  font-weight: 850;
}
.video-analyze-option small {
  display: block;
  margin-top: 3px;
  color: #475569;
  font-size: 12px;
  line-height: 1.45;
}
.video-frame-count-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 10px;
  color: #334155;
  font-size: 12px;
  font-weight: 750;
}
.video-frame-count-row input {
  width: 86px;
  height: 32px;
  padding: 0 10px;
  border-radius: 10px;
  border: 1px solid rgba(148, 163, 184, .35);
  background: #f8fafc;
  color: #0f172a;
  font-size: 13px;
  font-weight: 750;
}
.video-shot-interval {
  margin: 6px 0 14px;
  padding: 10px;
  border-radius: 18px;
  border: 1px solid rgba(148, 163, 184, .24);
  background: linear-gradient(180deg, rgba(255,255,255,.78), rgba(241,245,249,.78));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: #0f172a;
  font-size: 13px;
  font-weight: 800;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.7), 0 14px 32px -28px rgba(15,23,42,.45);
}
.video-shot-interval select {
  display: none;
  height: 42px;
  min-width: 168px;
  width: 100%;
  padding: 0 42px 0 16px;
  border-radius: 14px;
  border: 1px solid rgba(148, 163, 184, .34);
  background: #f8fafc;
  color: #0f172a;
  font: inherit;
  font-weight: 850;
  cursor: pointer;
  outline: none;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.8);
  appearance: none;
  -webkit-appearance: none;
}
.video-shot-interval select:focus {
  border-color: rgba(15,23,42,.34);
  box-shadow: 0 0 0 3px rgba(15,23,42,.08), inset 0 1px 0 rgba(255,255,255,.8);
}
.video-select-wrap {
  position: relative;
  flex: 0 0 150px;
}
.video-select-btn {
  width: 100%;
  height: 42px;
  padding: 0 34px 0 14px;
  border: 1px solid rgba(148, 163, 184, .34);
  border-radius: 14px;
  background: #f8fafc;
  color: #0f172a;
  font: inherit;
  font-weight: 850;
  text-align: left;
  cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.8);
  position: relative;
}
.video-select-btn::after {
  content: "";
  position: absolute;
  right: 13px;
  top: 50%;
  width: 8px;
  height: 8px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: translateY(-65%) rotate(45deg);
  pointer-events: none;
  color: #0f172a;
  opacity: .82;
}
.video-select-menu {
  position: absolute;
  top: calc(100% + 7px);
  left: 0;
  right: 0;
  display: none;
  padding: 6px;
  border-radius: 14px;
  border: 1px solid rgba(148, 163, 184, .34);
  background: rgba(248,250,252,.98);
  box-shadow: 0 18px 36px -24px rgba(15,23,42,.55);
  z-index: 20;
}
.video-select-wrap.open .video-select-menu {
  display: grid;
  gap: 4px;
}
.video-select-option {
  height: 34px;
  padding: 0 10px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: #0f172a;
  font-size: 13px;
  font-weight: 800;
  text-align: left;
  cursor: pointer;
}
.video-select-option:hover,
.video-select-option.active {
  background: #e2e8f0;
}
.rp-history {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid rgba(148,163,184,.18);
}
.rp-history-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}
.rp-history-title {
  margin: 0;
  color: #0f172a;
  font-size: 14px;
  font-weight: 900;
}
.rp-history-list {
  display: grid;
  gap: 8px;
}
.rp-history-empty {
  padding: 12px;
  border-radius: 13px;
  border: 1px dashed rgba(148,163,184,.45);
  color: #64748b;
  font-size: 12.5px;
  text-align: center;
}
.rp-history-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 11px 12px;
  border-radius: 14px;
  border: 1px solid rgba(148,163,184,.22);
  background: rgba(255,255,255,.56);
}
.rp-history-item.pending {
  grid-template-columns: auto minmax(0, 1fr);
  background:
    linear-gradient(135deg, rgba(99,102,241,.10), rgba(14,165,233,.06)),
    rgba(255,255,255,.62);
  border-style: dashed;
}
.rp-history-pending-icon {
  width: 30px;
  height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  background: rgba(15,23,42,.06);
}
.rp-history-pending-icon .spinner {
  width: 16px;
  height: 16px;
  border-width: 1.8px;
}
.rp-history-name {
  color: #0f172a;
  font-size: 13px;
  font-weight: 850;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.rp-history-meta {
  margin-top: 3px;
  color: #64748b;
  font-size: 11.5px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.rp-history-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.rp-history-btn {
  height: 30px;
  padding: 0 9px;
  border-radius: 10px;
  border: 1px solid rgba(148,163,184,.32);
  background: rgba(248,250,252,.86);
  color: #0f172a;
  font-size: 11.5px;
  font-weight: 800;
  cursor: pointer;
}
.rp-history-btn:hover {
  background: #fff;
  border-color: rgba(100,116,139,.45);
}
.video-prompt-edit-mask {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 18px;
  background: rgba(2, 6, 23, .64);
  backdrop-filter: blur(7px);
}
.video-prompt-edit-dialog {
  width: min(1040px, 96vw);
  max-height: 92vh;
  display: grid;
  grid-template-rows: auto auto minmax(280px, 1fr) auto;
  gap: 12px;
  padding: 18px;
  border-radius: 22px;
  border: 1px solid rgba(148, 163, 184, .24);
  background: #f8fafc;
  box-shadow: 0 30px 80px -42px rgba(15, 23, 42, .65);
  color: #0f172a;
  animation: modalIn .18s ease;
}
.video-prompt-edit-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}
.video-prompt-edit-title {
  margin: 0;
  color: #0f172a;
  font-size: 18px;
  font-weight: 900;
  letter-spacing: 0;
}
.video-prompt-edit-sub {
  margin-top: 4px;
  color: #64748b;
  font-size: 12.5px;
  font-weight: 700;
  line-height: 1.5;
}
.video-prompt-edit-close {
  width: 36px;
  height: 36px;
  border: 1px solid rgba(148, 163, 184, .36);
  border-radius: 12px;
  background: #fff;
  color: #0f172a;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}
.video-prompt-edit-tools {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 10px;
  align-items: stretch;
}
.video-prompt-edit-requirement,
.video-prompt-edit-textarea {
  width: 100%;
  border: 1px solid rgba(148, 163, 184, .32);
  border-radius: 15px;
  background: #fff;
  color: #0f172a;
  font: inherit;
  outline: none;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .7);
}
.video-prompt-edit-requirement {
  min-height: 44px;
  max-height: 110px;
  padding: 12px 14px;
  resize: vertical;
  font-size: 13px;
  line-height: 1.55;
}
.video-prompt-edit-textarea {
  min-height: 46vh;
  padding: 14px;
  resize: vertical;
  font-size: 13px;
  line-height: 1.7;
  white-space: pre-wrap;
}
.video-prompt-edit-ai,
.video-prompt-edit-save,
.video-prompt-edit-cancel {
  height: 44px;
  padding: 0 14px;
  border-radius: 14px;
  border: 1px solid rgba(148, 163, 184, .30);
  font: inherit;
  font-size: 12.5px;
  font-weight: 850;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  white-space: nowrap;
}
.video-prompt-edit-ai {
  background: #0f172a;
  color: #fff !important;
  -webkit-text-fill-color: #fff !important;
  border-color: #0f172a;
}
.video-prompt-edit-save {
  background: #111827;
  color: #fff !important;
  -webkit-text-fill-color: #fff !important;
  border-color: #111827;
}
.video-prompt-edit-cancel {
  background: #fff;
  color: #0f172a !important;
  -webkit-text-fill-color: #0f172a !important;
}
.video-prompt-edit-ai *,
.video-prompt-edit-save * {
  color: #fff !important;
  stroke: #fff !important;
  -webkit-text-fill-color: #fff !important;
}
.video-prompt-edit-cancel *,
.video-prompt-edit-close * {
  color: inherit !important;
  stroke: currentColor !important;
  -webkit-text-fill-color: currentColor !important;
}
.video-prompt-edit-ai:disabled,
.video-prompt-edit-save:disabled,
.video-prompt-edit-cancel:disabled {
  opacity: .72;
  cursor: not-allowed;
}
.video-prompt-edit-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}
[data-app-theme="original"] .video-prompt-edit-dialog,
[data-app-theme="daydream"] .video-prompt-edit-dialog {
  border-color: rgba(255,255,255,.16);
  background: #15171d;
  color: #f8fafc;
}
[data-app-theme="original"] .video-prompt-edit-title,
[data-app-theme="daydream"] .video-prompt-edit-title {
  color: #f8fafc;
}
[data-app-theme="original"] .video-prompt-edit-sub,
[data-app-theme="daydream"] .video-prompt-edit-sub {
  color: rgba(226,232,240,.68);
}
[data-app-theme="original"] .video-prompt-edit-requirement,
[data-app-theme="original"] .video-prompt-edit-textarea,
[data-app-theme="daydream"] .video-prompt-edit-requirement,
[data-app-theme="daydream"] .video-prompt-edit-textarea {
  border-color: rgba(255,255,255,.14);
  background: rgba(2,6,23,.36);
  color: #f8fafc;
}
[data-app-theme="original"] .video-prompt-edit-close,
[data-app-theme="original"] .video-prompt-edit-cancel,
[data-app-theme="daydream"] .video-prompt-edit-close,
[data-app-theme="daydream"] .video-prompt-edit-cancel {
  border-color: rgba(255,255,255,.14);
  background: rgba(255,255,255,.08);
  color: #f8fafc !important;
  -webkit-text-fill-color: #f8fafc !important;
}
[data-app-theme="vale"] .video-prompt-edit-ai,
[data-app-theme="vale"] .video-prompt-edit-save,
[data-app-theme="vale"] .video-prompt-edit-ai *,
[data-app-theme="vale"] .video-prompt-edit-save * {
  color: #fff !important;
  stroke: #fff !important;
  -webkit-text-fill-color: #fff !important;
}
@media (max-width: 720px) {
  .video-prompt-edit-mask { padding: 10px; align-items: stretch; }
  .video-prompt-edit-dialog { width: 100%; max-height: calc(100vh - 20px); padding: 14px; border-radius: 18px; }
  .video-prompt-edit-tools { grid-template-columns: 1fr; }
  .video-prompt-edit-textarea { min-height: 42vh; }
  .video-prompt-edit-ai,
  .video-prompt-edit-save,
  .video-prompt-edit-cancel { width: 100%; }
}
[data-app-theme="original"] .video-shot-interval,
[data-app-theme="daydream"] .video-shot-interval {
  border-color: rgba(255, 255, 255, .12);
  background: rgba(255, 255, 255, .075);
  color: #f8fafc;
}
[data-app-theme="original"] .video-shot-interval select,
[data-app-theme="daydream"] .video-shot-interval select {
  border-color: rgba(255, 255, 255, .16);
  background: rgba(15, 23, 42, .62);
  color: #f8fafc;
}
[data-app-theme="original"] .video-select-wrap::after,
[data-app-theme="daydream"] .video-select-wrap::after {
  color: #f8fafc;
}
[data-app-theme="original"] .video-select-btn,
[data-app-theme="daydream"] .video-select-btn {
  border-color: rgba(255, 255, 255, .16);
  background: rgba(15, 23, 42, .62);
  color: #f8fafc;
}
[data-app-theme="original"] .video-select-btn::after,
[data-app-theme="daydream"] .video-select-btn::after {
  color: #f8fafc;
}
[data-app-theme="original"] .video-select-menu,
[data-app-theme="daydream"] .video-select-menu {
  border-color: rgba(255, 255, 255, .14);
  background: rgba(15,23,42,.98);
}
[data-app-theme="original"] .video-select-option,
[data-app-theme="daydream"] .video-select-option {
  color: #f8fafc;
}
[data-app-theme="original"] .video-select-option:hover,
[data-app-theme="original"] .video-select-option.active,
[data-app-theme="daydream"] .video-select-option:hover,
[data-app-theme="daydream"] .video-select-option.active {
  background: rgba(255,255,255,.10);
}
[data-app-theme="original"] .rp-history-title,
[data-app-theme="daydream"] .rp-history-title,
[data-app-theme="original"] .rp-history-name,
[data-app-theme="daydream"] .rp-history-name {
  color: #f8fafc;
}
[data-app-theme="original"] .rp-history-item,
[data-app-theme="daydream"] .rp-history-item {
  border-color: rgba(255,255,255,.12);
  background: rgba(255,255,255,.055);
}
[data-app-theme="original"] .rp-history-item.pending,
[data-app-theme="daydream"] .rp-history-item.pending {
  background:
    linear-gradient(135deg, rgba(99,102,241,.14), rgba(14,165,233,.08)),
    rgba(255,255,255,.055);
  border-color: rgba(255,255,255,.18);
}
[data-app-theme="original"] .rp-history-pending-icon,
[data-app-theme="daydream"] .rp-history-pending-icon {
  background: rgba(255,255,255,.08);
}
[data-app-theme="original"] .rp-history-meta,
[data-app-theme="daydream"] .rp-history-meta,
[data-app-theme="original"] .rp-history-empty,
[data-app-theme="daydream"] .rp-history-empty {
  color: rgba(226,232,240,.62);
}
[data-app-theme="original"] .rp-history-btn,
[data-app-theme="daydream"] .rp-history-btn {
  border-color: rgba(255,255,255,.14);
  background: rgba(15,23,42,.42);
  color: #f8fafc;
}
[data-app-theme="original"] .video-analyze-panel,
[data-app-theme="daydream"] .video-analyze-panel {
  border-color: rgba(255, 255, 255, .12);
  background: rgba(255, 255, 255, .075);
}
[data-app-theme="original"] .video-analyze-title,
[data-app-theme="daydream"] .video-analyze-title,
[data-app-theme="original"] .video-analyze-option b,
[data-app-theme="daydream"] .video-analyze-option b {
  color: #f8fafc;
}
[data-app-theme="original"] .video-analyze-option,
[data-app-theme="daydream"] .video-analyze-option {
  border-color: rgba(255, 255, 255, .12);
  background: rgba(15, 23, 42, .34);
  color: #f8fafc;
}
[data-app-theme="original"] .video-analyze-option small,
[data-app-theme="daydream"] .video-analyze-option small,
[data-app-theme="original"] .video-frame-count-row,
[data-app-theme="daydream"] .video-frame-count-row {
  color: rgba(226, 232, 240, .76);
}

.prompt-optimizer {
  margin: 0 0 16px;
  padding: 15px;
  border-radius: 16px;
  border: 1px solid rgba(167,139,250,.20);
  background:
    radial-gradient(circle at 12% 0%, rgba(139,92,246,.18), transparent 36%),
    linear-gradient(180deg, rgba(255,255,255,.07), rgba(255,255,255,.035));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.06);
}
.po-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
.po-title {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #fff;
  font-weight: 700;
  font-size: 14px;
}
.po-title-icon {
  width: 28px;
  height: 28px;
  border-radius: 9px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #ddd6fe;
  background: rgba(139,92,246,.20);
  border: 1px solid rgba(167,139,250,.34);
  flex-shrink: 0;
}
.po-sub {
  margin: 5px 0 0 36px;
  color: rgba(255,255,255,.48);
  font-size: 11.5px;
  line-height: 1.45;
}
.po-mini-btn {
  height: 36px;
  padding: 0 12px;
  border-radius: 11px;
  border: 1px solid rgba(255,255,255,.12);
  background: rgba(255,255,255,.055);
  color: rgba(255,255,255,.72);
  font-size: 12px;
  font-family: inherit;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  transition: background .15s, border-color .15s, color .15s;
  white-space: nowrap;
}
.po-mini-btn:hover {
  background: rgba(255,255,255,.10);
  border-color: rgba(167,139,250,.36);
  color: #fff;
}
.po-mini-btn.po-strong {
  height: 36px;
  border-radius: 11px;
  background: rgba(99,102,241,.20);
  border-color: rgba(167,139,250,.30);
  color: #ede9fe;
  font-weight: 650;
}
.po-mini-btn.po-strong:hover {
  background: rgba(99,102,241,.30);
  border-color: rgba(196,181,253,.50);
}
.po-mini-btn.po-primary-action {
  height: 36px;
  border: 0;
  color: #fff;
  font-weight: 700;
  background: linear-gradient(135deg, rgba(99,102,241,.95), rgba(139,92,246,.92), rgba(236,72,153,.82));
  box-shadow: 0 12px 24px -18px rgba(139,92,246,.95);
}
.po-mini-btn.po-primary-action:hover {
  color: #fff;
  background: linear-gradient(135deg, #6366f1, #8b5cf6 55%, #ec4899);
  border-color: transparent;
}
.prompt-optimizer.collapsed .po-body { display: none; }
.po-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 10px;
}
.po-select {
  min-height: 38px;
  padding-top: 8px;
  padding-bottom: 8px;
  font-size: 13px;
  border-radius: 10px;
}
.po-dropdown .cw-trigger {
  min-height: 42px;
  border-radius: 12px;
  background:
    linear-gradient(180deg, rgba(255,255,255,.075), rgba(255,255,255,.045));
  border-color: rgba(167,139,250,.18);
  color: rgba(255,255,255,.88);
  font-size: 13.5px;
  font-weight: 600;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.06);
}
.po-dropdown.open .cw-trigger {
  border-color: rgba(196,181,253,.55);
  background: rgba(139,92,246,.16);
  box-shadow: 0 0 0 3px rgba(139,92,246,.14), inset 0 1px 0 rgba(255,255,255,.08);
}
.po-dropdown .cw-menu {
  background: #17142f;
  border-color: rgba(196,181,253,.28);
  box-shadow: 0 18px 40px -18px rgba(0,0,0,.75), 0 0 0 1px rgba(255,255,255,.04) inset;
}
.po-dropdown .cw-opt {
  display: flex;
  align-items: center;
  min-height: 34px;
  font-size: 13px;
}
.po-source-actions,
.po-output-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 8px;
}
.po-preserve {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
  margin-top: 7px;
}
.po-check {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  padding: 7px 8px;
  border-radius: 10px;
  background: rgba(255,255,255,.045);
  border: 1px solid rgba(255,255,255,.08);
  color: rgba(255,255,255,.68);
  font-size: 12px;
  cursor: pointer;
  user-select: none;
}
.po-check input { accent-color: #8b5cf6; }
.po-type-grid {
  display: block;
  margin-top: 7px;
}
.po-config-grid,
.po-type-columns {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  align-items: start;
}
.po-type-column {
  display: grid;
  gap: 10px;
  align-content: start;
  min-width: 0;
}
.po-category {
  margin-top: 12px;
}
.po-category:first-child { margin-top: 0; }
.po-category-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin: 0 0 8px;
  color: rgba(255,255,255,.82);
  font-size: 12.5px;
  font-weight: 750;
}
.po-category-title span {
  color: rgba(255,255,255,.42);
  font-size: 11px;
  font-weight: 500;
}
.po-type-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin: 7px 0 10px;
}
.po-type-tools .po-mini-btn {
  min-width: 68px;
}
.po-type-card {
  min-width: 0;
  align-self: start;
  border: 1px solid rgba(255,255,255,.10);
  border-radius: 13px;
  background:
    radial-gradient(circle at 10% 0%, rgba(167,139,250,.10), transparent 42%),
    rgba(255,255,255,.04);
  overflow: hidden;
  transition: border-color .15s, background .15s, box-shadow .15s;
}
.po-type-card.enabled {
  border-color: rgba(167,139,250,.30);
  background:
    radial-gradient(circle at 10% 0%, rgba(167,139,250,.18), transparent 44%),
    rgba(99,102,241,.07);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.055);
}
.po-type-head {
  width: 100%;
  min-height: 44px;
  padding: 9px 10px;
  border: 0;
  background: transparent;
  color: rgba(255,255,255,.82);
  font-family: inherit;
  cursor: pointer;
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr) 18px;
  align-items: center;
  gap: 8px;
  text-align: left;
}
.po-type-card.po-select-card .po-type-head {
  grid-template-columns: minmax(0, 1fr) 18px;
}
.po-type-enable {
  width: 17px;
  height: 17px;
  accent-color: #8b5cf6;
  cursor: pointer;
  justify-self: center;
}
.po-type-name {
  display: block;
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.25;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.po-type-summary {
  display: block;
  color: rgba(255,255,255,.45);
  font-size: 11px;
  margin-top: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.po-type-chevron {
  width: 18px;
  height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: rgba(196,181,253,.84);
  transition: transform .15s;
}
.po-type-card.open .po-type-chevron { transform: rotate(180deg); }
.po-type-panel {
  display: none;
  padding: 0 10px 10px;
  border-top: 1px solid rgba(255,255,255,.07);
}
.po-type-card.open .po-type-panel { display: grid; gap: 8px; }
.po-option-box {
  padding: 9px;
  border-radius: 11px;
  background: rgba(0,0,0,.16);
  border: 1px solid rgba(255,255,255,.075);
}
.po-option-title {
  color: rgba(255,255,255,.72);
  font-size: 11.5px;
  font-weight: 650;
  margin-bottom: 7px;
}
.po-radio-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.po-radio-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 28px;
  padding: 5px 8px;
  border-radius: 999px;
  background: rgba(255,255,255,.045);
  border: 1px solid rgba(255,255,255,.08);
  color: rgba(255,255,255,.66);
  font-size: 11.5px;
  cursor: pointer;
  transition: background .15s, border-color .15s, color .15s;
}
.po-radio-pill input {
  width: 13px;
  height: 13px;
  accent-color: #8b5cf6;
  margin: 0;
}
.po-radio-pill:has(input:checked) {
  color: #fff;
  background: rgba(139,92,246,.24);
  border-color: rgba(196,181,253,.36);
}
.po-custom-input {
  width: 100%;
  min-height: 32px;
  margin-top: 8px;
  padding: 7px 10px;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,.10);
  background: rgba(255,255,255,.045);
  color: #fff;
  font-size: 12px;
  font-family: inherit;
  outline: none;
}
.po-custom-input::placeholder { color: rgba(255,255,255,.34); }
.po-custom-input:focus {
  border-color: rgba(167,139,250,.52);
  background: rgba(255,255,255,.075);
  box-shadow: 0 0 0 3px rgba(139,92,246,.12);
}
.po-type-btn {
  min-height: 34px;
  border: 1px solid rgba(255,255,255,.10);
  background: rgba(255,255,255,.045);
  color: rgba(255,255,255,.68);
  border-radius: 10px;
  padding: 7px 8px;
  font-size: 12.5px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.045);
  transition: background .15s, border-color .15s, color .15s, transform .12s, box-shadow .15s;
}
.po-type-btn:hover {
  color: #fff;
  background: rgba(255,255,255,.08);
  border-color: rgba(167,139,250,.25);
  transform: translateY(-1px);
}
.po-type-btn.active {
  color: #fff;
  background: linear-gradient(135deg, rgba(99,102,241,.56), rgba(139,92,246,.50));
  border-color: rgba(196,181,253,.42);
  box-shadow: 0 12px 24px -18px rgba(139,92,246,.9), inset 0 1px 0 rgba(255,255,255,.10);
}
.po-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 9px;
}
.po-field label {
  display: block;
  color: rgba(255,255,255,.58);
  font-size: 11.5px;
  margin-bottom: 5px;
}
.po-input {
  width: 100%;
  min-height: 34px;
  padding: 8px 10px;
  border-radius: 10px;
  background: rgba(0,0,0,.18);
  border: 1px solid rgba(255,255,255,.11);
  color: #fff;
  font-size: 12.5px;
  font-family: inherit;
  outline: none;
  resize: vertical;
}
.po-input:focus {
  border-color: rgba(167,139,250,.60);
  background: rgba(255,255,255,.07);
  box-shadow: 0 0 0 3px rgba(139,92,246,.14);
}
.po-primary {
  width: 100%;
  height: 42px;
  margin-top: 10px;
  border-radius: 12px;
  border: 0;
  background: linear-gradient(135deg, #6366f1, #8b5cf6 55%, #ec4899);
  color: #fff;
  font-weight: 700;
  font-size: 13.5px;
  font-family: inherit;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 14px 30px -16px rgba(139,92,246,.95);
  transition: transform .16s, box-shadow .16s, filter .16s;
}
.po-primary:hover {
  transform: translateY(-1px);
  filter: saturate(1.08);
  box-shadow: 0 18px 36px -16px rgba(139,92,246,1);
}
.po-primary:disabled {
  opacity: .55;
  cursor: not-allowed;
  box-shadow: none;
}
.po-output {
  display: none;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid rgba(255,255,255,.08);
}
.po-output.open { display: block; }
.po-tabs {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
  margin-bottom: 8px;
}
.po-tab {
  height: 30px;
  border-radius: 9px;
  border: 1px solid rgba(255,255,255,.10);
  background: rgba(255,255,255,.045);
  color: rgba(255,255,255,.62);
  font-size: 11.5px;
  font-family: inherit;
  cursor: pointer;
}
.po-tab.active {
  color: #fff;
  background: rgba(139,92,246,.36);
  border-color: rgba(196,181,253,.35);
}
.po-output-text {
  min-height: 132px;
  font-size: 12.5px;
  line-height: 1.65;
  resize: vertical;
}
.po-score-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 10px;
}
.po-score {
  min-width: 0;
  padding: 8px;
  border-radius: 10px;
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.07);
}
.po-score-top {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  color: rgba(255,255,255,.70);
  font-size: 11.5px;
  margin-bottom: 6px;
}
.po-score-bar {
  height: 5px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(255,255,255,.08);
}
.po-score-bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #6366f1, #8b5cf6, #ec4899);
}
.po-issues {
  margin: 10px 0 0;
  padding: 9px 10px;
  border-radius: 10px;
  background: rgba(0,0,0,.16);
  border: 1px solid rgba(255,255,255,.07);
  color: rgba(255,255,255,.62);
  font-size: 12px;
  line-height: 1.6;
}

.res-btn {
  padding: 0 12px;
  height: 100%;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .5px;
  color: rgba(255,255,255,.45);
  background: transparent;
  border: none;
  cursor: pointer;
  transition: all .15s;
}
.res-btn.active {
  background: linear-gradient(135deg, rgba(139,92,246,.5), rgba(236,72,153,.35));
  color: #fff;
  text-shadow: 0 1px 2px rgba(0,0,0,.2);
}
.res-btn:hover:not(.active) {
  color: rgba(255,255,255,.8);
  background: rgba(255,255,255,.06);
}

/* 画质按钮组（auto / low / medium / high） */
.quality-group {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  width: 100%;
}
.quality-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  padding: 7px 4px 8px;
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.10);
  border-radius: 10px;
  color: rgba(255,255,255,.55);
  font-family: inherit;
  cursor: pointer;
  transition: background .15s, color .15s, border-color .15s, transform .12s;
  line-height: 1.2;
}
.quality-btn .qb-main {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .2px;
}
.quality-btn .qb-sub {
  font-size: 10.5px;
  opacity: .65;
  letter-spacing: .3px;
}
.quality-btn:hover:not(.active) {
  color: rgba(255,255,255,.85);
  background: rgba(255,255,255,.07);
  border-color: rgba(255,255,255,.18);
}
.quality-btn.active {
  background: linear-gradient(135deg, rgba(99,102,241,.55), rgba(139,92,246,.55));
  border-color: rgba(167,139,250,.45);
  color: #fff;
  box-shadow: 0 0 0 1px rgba(167,139,250,.15) inset, 0 4px 14px -4px rgba(99,102,241,.4);
}
.quality-btn.active .qb-sub { opacity: .85; }

/* 自定义下拉（尺寸 / 数量 / 秒数等通用） */
.size-dropdown, .cw-dropdown { font-size: 14px; position: relative; }
.size-trigger, .cw-trigger {
  width: 100%;
  height: 100%;
  min-height: 42px;
  padding: 0 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  background: rgba(255,255,255,.05);
  color: #e2e0f0;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 10px;
  cursor: pointer;
  font-size: 14px;
  font-family: inherit;
  transition: border-color .15s, background .15s;
}
.size-trigger:hover, .cw-trigger:hover { background: rgba(255,255,255,.07); }
.size-dropdown.open .size-trigger,
.cw-dropdown.open .cw-trigger {
  border-color: #a78bfa;
  background: rgba(255,255,255,.09);
}
.size-dropdown.open .size-trigger svg,
.cw-dropdown.open .cw-trigger svg { transform: rotate(180deg); }
.size-trigger svg, .cw-trigger svg { transition: transform .15s; flex-shrink: 0; }

.size-menu, .cw-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  background: #1e1b3a;
  border: 1px solid rgba(167,139,250,.3);
  border-radius: 12px;
  padding: 6px;
  z-index: 50;
  box-shadow: 0 12px 30px -8px rgba(0,0,0,.55), 0 0 0 1px rgba(255,255,255,.04) inset;
  max-height: 280px;
  overflow-y: auto;
  display: none;
}
.size-dropdown.open .size-menu,
.cw-dropdown.open .cw-menu { display: block; }

.size-opt, .cw-opt {
  padding: 9px 12px;
  border-radius: 8px;
  color: #e2e0f0;
  cursor: pointer;
  transition: background .12s, color .12s;
  user-select: none;
  font-size: 13.5px;
}
.size-opt:hover, .cw-opt:hover { background: rgba(167,139,250,.18); color: #fff; }
.size-opt.active, .cw-opt.active {
  background: linear-gradient(135deg, rgba(99,102,241,.55), rgba(139,92,246,.55));
  color: #fff;
  font-weight: 500;
}
.size-opt.active:hover, .cw-opt.active:hover {
  background: linear-gradient(135deg, rgba(99,102,241,.7), rgba(139,92,246,.7));
}

.feed-sort-btn { transition: background .12s, color .12s; }
.feed-sort-btn:hover:not(.active) { background: rgba(255,255,255,.05) !important; color: #fff !important; }
.feed-sort-btn.active {
  background: linear-gradient(135deg, rgba(99,102,241,.55), rgba(139,92,246,.55)) !important;
  color: #fff !important;
  font-weight: 500;
}

.tabs {
  display: inline-flex;
  gap: 4px;
  background: rgba(255,255,255,.05);
  padding: 4px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,.10);
}
.tab {
  padding: 7px 16px;
  border-radius: 9px;
  cursor: pointer;
  color: rgba(255,255,255,.6);
  font-size: 13px;
  transition: all .15s;
  border: 0;
  background: transparent;
  display: inline-flex; align-items: center; gap: 6px;
}
.tab svg { width: 14px; height: 14px; }
.tab:hover { color: #fff; }
.tab.active {
  background: var(--grad-brand);
  color: #fff;
  box-shadow: 0 4px 14px -4px rgba(139,92,246,.6);
}

.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 18px;
}
@media (min-width: 1400px) {
  .gallery { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
}

@media (min-width: 1025px) {
  #imageMode {
    height: calc(100vh - 124px);
    min-height: 620px;
    align-items: stretch;
    overflow: hidden;
  }

  #imageMode > aside.panel {
    position: sticky;
    top: 30px;
    align-self: start;
    margin-top: 16px;
    max-height: calc(100% - 42px);
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-gutter: stable;
  }

  #imageMode > section {
    min-height: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
  }

  #imageMode > section > div:first-child {
    flex: 0 0 auto;
    margin-bottom: 14px !important;
    padding: 2px 2px 0;
  }

  #latestArea,
  #historyArea,
  #feedArea {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 2px 8px 18px 2px;
    overscroll-behavior: contain;
    scrollbar-gutter: stable;
  }

  #latestArea::-webkit-scrollbar,
  #historyArea::-webkit-scrollbar,
  #feedArea::-webkit-scrollbar,
  #imageMode > aside.panel::-webkit-scrollbar {
    width: 10px;
  }

  #latestArea::-webkit-scrollbar-track,
  #historyArea::-webkit-scrollbar-track,
  #feedArea::-webkit-scrollbar-track,
  #imageMode > aside.panel::-webkit-scrollbar-track {
    background: rgba(255,255,255,.035);
    border-radius: 999px;
  }

  #latestArea::-webkit-scrollbar-thumb,
  #historyArea::-webkit-scrollbar-thumb,
  #feedArea::-webkit-scrollbar-thumb,
  #imageMode > aside.panel::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,.18);
    border: 2px solid transparent;
    border-radius: 999px;
    background-clip: padding-box;
  }

  #latestArea::-webkit-scrollbar-thumb:hover,
  #historyArea::-webkit-scrollbar-thumb:hover,
  #feedArea::-webkit-scrollbar-thumb:hover,
  #imageMode > aside.panel::-webkit-scrollbar-thumb:hover {
    background: rgba(255,255,255,.28);
    border: 2px solid transparent;
    background-clip: padding-box;
  }
}

@media (max-width: 1024px) {
  #imageMode {
    height: auto;
    min-height: 0;
    overflow: visible;
  }
  #imageMode > aside.panel {
    position: static;
    max-height: none;
    overflow: visible;
  }
  #imageMode > section {
    display: block;
    min-height: 0;
    overflow: visible;
  }
  #latestArea,
  #historyArea,
  #feedArea {
    max-height: none;
    overflow: visible;
    padding: 0;
  }
}

.history-pagination {
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 20px;
  padding: 14px 0 6px;
  position: sticky;
  bottom: 0;
  z-index: 2;
  background: linear-gradient(180deg, rgba(17,24,39,0), rgba(17,24,39,.78) 26%, rgba(17,24,39,.92));
  backdrop-filter: blur(10px);
}

.history-page-btn {
  min-width: 34px;
  height: 34px;
  padding: 0 12px;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,.12);
  background: rgba(255,255,255,.06);
  color: rgba(255,255,255,.78);
  font-family: inherit;
  font-size: 13px;
  font-weight: 750;
  cursor: pointer;
}

.history-page-btn:hover:not(:disabled),
.history-page-btn.active {
  background: #fff;
  border-color: rgba(255,255,255,.72);
  color: #111827;
}

.history-page-btn:disabled {
  cursor: not-allowed;
  opacity: .38;
}

.history-page-ellipsis,
.history-page-total {
  color: rgba(255,255,255,.52);
  font-size: 12.5px;
}

.history-page-total {
  margin-left: 4px;
}

:root[data-app-theme="vale"] .history-page-btn {
  background: #eef4fb;
  border-color: #c8d3e1;
  color: #253044;
}

:root[data-app-theme="vale"] .history-page-btn:hover:not(:disabled),
:root[data-app-theme="vale"] .history-page-btn.active {
  background: #111827;
  border-color: #111827;
  color: #fff;
}

:root[data-app-theme="vale"] .history-page-ellipsis,
:root[data-app-theme="vale"] .history-page-total {
  color: #64748b;
}

:root[data-app-theme="vale"] .history-pagination {
  background: linear-gradient(180deg, rgba(248,250,252,0), rgba(248,250,252,.86) 26%, rgba(248,250,252,.96));
}

@media (max-width: 1024px) {
  .history-pagination {
    position: static;
    background: transparent;
    backdrop-filter: none;
  }
}

.preset-row { display: flex; flex-wrap: wrap; gap: 6px; }

.stats-row {
  display: flex; gap: 8px; flex-wrap: wrap;
  align-items: center;
}
/* 顶栏元素统一高度 */
.stats-row .chip,
.stats-row .btn-ghost {
  height: 36px;
  padding: 0 14px;
  font-size: 13px;
  box-sizing: border-box;
  line-height: 1;
}
.topbar .stats-row .chip,
.topbar .stats-row .btn-ghost {
  border-radius: 10px !important;
  border: 1px solid rgba(255,255,255,.14) !important;
  background: rgba(255,255,255,.06) !important;
  box-shadow: none !important;
  font-weight: 650;
}
.topbar .stats-row .chip:hover,
.topbar .stats-row .btn-ghost:hover {
  background: rgba(255,255,255,.12) !important;
  border-color: rgba(255,255,255,.22) !important;
}
:root[data-app-theme="vale"] .topbar .stats-row .chip,
:root[data-app-theme="vale"] .topbar .stats-row .btn-ghost {
  background: #eef4fb !important;
  border-color: #c8d3e1 !important;
  color: #111827 !important;
}
:root[data-app-theme="vale"] .topbar .stats-row .chip:hover,
:root[data-app-theme="vale"] .topbar .stats-row .btn-ghost:hover {
  background: #f5f8fc !important;
  border-color: #b5c2d2 !important;
}
:root[data-app-theme="daydream"] .topbar .stats-row .chip,
:root[data-app-theme="daydream"] .topbar .stats-row .btn-ghost {
  background: #20232a !important;
  border-color: rgba(255,255,255,.18) !important;
  color: #f5f6f8 !important;
}
.quota-bar {
  height: 4px;
  background: rgba(255,255,255,.08);
  border-radius: 999px;
  overflow: hidden;
  margin-top: 10px;
}
.quota-bar > div {
  height: 100%;
  background: var(--grad-brand);
  border-radius: 999px;
  transition: width .4s ease;
}

@media (max-width: 1024px) {
  .grid { grid-template-columns: 1fr; }
  .panel { position: static; }
}

/* 顶栏模式切换 */
.mode-switch {
  display: inline-flex;
  gap: 4px;
  background: rgba(255,255,255,.05);
  padding: 4px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,.10);
}
.mode-btn {
  padding: 8px 16px;
  border-radius: 9px;
  cursor: pointer;
  color: rgba(255,255,255,.65);
  font-size: 13px;
  transition: all .15s;
  border: 0;
  background: transparent;
  display: inline-flex; align-items: center; gap: 6px;
  font-weight: 500;
}
.mode-btn:hover { color: #fff; }
.mode-btn.active {
  background: linear-gradient(135deg, #6366f1, #8b5cf6 50%, #ec4899);
  color: #fff;
  box-shadow: 0 4px 14px -4px rgba(139,92,246,.6);
}

/* 故事板布局 */
.story-grid {
  display: grid;
  grid-template-columns: 420px 1fr;
  gap: 32px;
  align-items: start;
}
@media (max-width: 1024px) {
  .story-grid { grid-template-columns: 1fr; }
}

/* 故事板列表项 */
.sb-item {
  padding: 10px 12px;
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 10px;
  cursor: pointer;
  transition: all .15s;
  display: flex; justify-content: space-between; align-items: center;
  gap: 8px;
}
.sb-item:hover { background: rgba(255,255,255,.08); border-color: rgba(255,255,255,.18); }
.sb-item.active {
  background: rgba(139,92,246,.18);
  border-color: rgba(139,92,246,.5);
}
.sb-item .sb-title {
  flex: 1; min-width: 0;
  color: #fff; font-size: 13.5px; font-weight: 500;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.sb-item .sb-meta {
  color: rgba(255,255,255,.45);
  font-size: 11px;
}
.sb-del {
  width: 24px; height: 24px;
  border-radius: 6px;
  background: transparent;
  color: rgba(255,255,255,.4);
  border: 0;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.sb-del:hover { background: rgba(239,68,68,.2); color: #fca5a5; }
.sb-item-cover {
  width: 44px; height: 44px;
  border-radius: 8px;
  overflow: hidden;
  flex-shrink: 0;
  background: rgba(0,0,0,.3);
  border: 1px solid rgba(255,255,255,.10);
}
.sb-item-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.btn-ghost.sb-share-on {
  background: linear-gradient(135deg, rgba(99,102,241,.25), rgba(236,72,153,.25));
  border-color: rgba(236,72,153,.5);
  color: #fff;
}
.btn-ghost.sb-like-on {
  background: rgba(236,72,153,.20);
  border-color: rgba(236,72,153,.5);
  color: #fbcfe8;
}

/* 故事板详情卡片 */
.sb-section {
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 14px;
  padding: 18px 20px;
  margin-bottom: 16px;
}
.sb-section h3 {
  margin: 0 0 12px;
  color: #fff;
  font-size: 15px;
  display: flex; align-items: center; gap: 8px;
}
.sb-design-section {
  overflow: hidden;
}
.sb-section-header-toggle {
  width: 100%;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  padding: 0;
  margin: 0;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  text-align: left;
}
.sb-section-header-title {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.sb-section-header-heading {
  color: #fff;
  font-size: 15px;
  font-weight: 800;
  line-height: 1.25;
}
.sb-section-header-sub {
  color: rgba(255,255,255,.52);
  font-size: 12px;
  font-weight: 600;
}
:root[data-app-theme="vale"] .sb-section-header-heading {
  color: #07111f !important;
  -webkit-text-fill-color: #07111f !important;
}
:root[data-app-theme="vale"] .sb-section-header-sub {
  color: #526070 !important;
}
:root[data-app-theme="daydream"] .sb-section-header-heading {
  color: #f7f8fb !important;
  -webkit-text-fill-color: #f7f8fb !important;
}
:root[data-app-theme="daydream"] .sb-section-header-sub {
  color: rgba(247,248,251,.68) !important;
}
.sb-design-section-body {
  display: none;
  margin-top: 14px;
}
.sb-design-section.open .sb-design-section-body {
  display: block;
}
.sb-design-section.open > .sb-section-header-toggle .sb-collapse-icon {
  transform: rotate(180deg);
  opacity: .9;
}
.sb-char {
  background: rgba(139,92,246,.08);
  border: 1px solid rgba(139,92,246,.2);
  border-radius: 10px;
  padding: 12px 14px;
  margin-bottom: 8px;
}
.sb-activity-scene-card {
  background: rgba(59,130,246,.075);
  border-color: rgba(59,130,246,.22);
}
.sb-activity-scene-card .sb-char-role {
  background: rgba(59,130,246,.18);
  color: #bfdbfe;
}
.sb-char-grid {
  display: grid;
  grid-template-columns: 1fr 240px;
  gap: 14px;
  align-items: start;
}
@media (max-width: 760px) { .sb-char-grid { grid-template-columns: 1fr; } }
.char-view {
  display: flex; flex-direction: column; gap: 6px;
}
.char-view img {
  width: 100%;
  aspect-ratio: var(--sb-aspect, 3/2);
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,.10);
  background: rgba(0,0,0,.3);
}
.char-view-empty {
  width: 100%;
  aspect-ratio: var(--sb-aspect, 3/2);
  border-radius: 8px;
  border: 1.5px dashed rgba(255,255,255,.18);
  background: rgba(0,0,0,.15);
  display: flex; align-items: center; justify-content: center;
}
.sb-char-name {
  font-weight: 600; color: #fff; font-size: 14px;
  display: flex; align-items: center; gap: 8px;
  margin-bottom: 6px;
}
.sb-char-role {
  font-size: 11px;
  background: rgba(236,72,153,.25);
  color: #fbcfe8;
  padding: 2px 8px;
  border-radius: 999px;
}
.sb-char-row {
  font-size: 12.5px;
  color: rgba(255,255,255,.7);
  line-height: 1.6;
  margin-top: 4px;
}
.sb-char-row b {
  color: rgba(255,255,255,.5);
  font-weight: 500;
  margin-right: 6px;
}
.sb-design-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 18px;
  align-items: stretch;
}
.sb-design-grid > div {
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.sb-design-col-title {
  margin: 0 0 10px;
  color: rgba(255,255,255,.76);
  font-size: 13px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
}
.sb-design-col-head {
  margin: 0 0 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.sb-design-col-head .sb-design-col-title {
  margin: 0;
}
.sb-mini-icon-btn {
  min-height: 30px;
  padding: 0 11px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.18);
  background: rgba(255,255,255,.08);
  color: rgba(255,255,255,.88);
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
  cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.08);
  transition: transform .16s ease, border-color .16s ease, background .16s ease, color .16s ease;
  white-space: nowrap;
}
.sb-mini-icon-btn:hover {
  transform: translateY(-1px);
  border-color: rgba(255,255,255,.32);
  background: rgba(255,255,255,.14);
}
.sb-mini-icon-btn svg {
  width: 14px;
  height: 14px;
  flex: 0 0 auto;
}
.sb-mini-icon-btn.danger {
  border-color: rgba(248,113,113,.28);
  background: rgba(248,113,113,.1);
  color: #fecaca;
}
.sb-add-segment-btn {
  min-width: 0;
  min-height: 32px;
  padding: 0 12px;
  border-color: rgba(125,211,252,.3);
  background: linear-gradient(135deg, rgba(14,165,233,.2), rgba(99,102,241,.16));
  color: rgba(255,255,255,.94);
}
.sb-add-character-wrap {
  width: 96%;
  margin: 18px auto 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.sb-square-add-btn {
  width: 62px;
  height: 46px;
  min-height: 46px;
  padding: 0;
  border-radius: 15px;
}
.sb-square-add-btn svg {
  width: 18px;
  height: 18px;
}
.sb-char-ref-upload {
  margin-top: 8px;
  padding: 9px 10px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,.12);
  background: rgba(255,255,255,.055);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.sb-char-ref-upload strong {
  display: block;
  color: rgba(255,255,255,.84);
  font-size: 12px;
  line-height: 1.25;
}
.sb-char-ref-upload span {
  display: block;
  margin-top: 3px;
  color: rgba(255,255,255,.52);
  font-size: 11px;
  line-height: 1.25;
  word-break: break-all;
}
:root[data-app-theme="vale"] .sb-mini-icon-btn {
  border-color: rgba(15,23,42,.14);
  background: rgba(255,255,255,.92);
  color: #111827;
  box-shadow: 0 8px 20px -18px rgba(15,23,42,.45);
}
:root[data-app-theme="vale"] .sb-mini-icon-btn:hover {
  border-color: rgba(15,23,42,.24);
  background: #ffffff;
}
:root[data-app-theme="vale"] .sb-mini-icon-btn.danger {
  border-color: rgba(220,38,38,.2);
  background: rgba(254,242,242,.95);
  color: #991b1b;
}
:root[data-app-theme="vale"] .sb-add-segment-btn {
  border-color: rgba(17,24,39,.16);
  background: #ffffff;
  color: #111827;
}
:root[data-app-theme="vale"] .sb-char-ref-upload {
  border-color: rgba(15,23,42,.1);
  background: rgba(248,250,252,.92);
}
:root[data-app-theme="vale"] .sb-char-ref-upload strong {
  color: #111827;
}
:root[data-app-theme="vale"] .sb-char-ref-upload span {
  color: #64748b;
}
.sb-design-grid .sb-char-grid {
  grid-template-columns: 1fr;
}
.sb-design-grid .sb-char,
.sb-design-grid .sb-scene {
  width: 96%;
  margin-left: auto;
  margin-right: auto;
  display: flex;
  flex-direction: column;
}
.sb-scene {
  background: rgba(14,165,233,.08);
  border: 1px solid rgba(14,165,233,.22);
  border-radius: 10px;
  padding: 12px 14px;
  margin-bottom: 8px;
}
.sb-prereq-notice {
  margin-top: 10px;
  padding: 10px 12px;
  border: 1px solid rgba(245,158,11,.42);
  background: rgba(245,158,11,.13);
  border-radius: 10px;
  color: #facc15;
  font-size: 12.5px;
  line-height: 1.55;
  font-weight: 650;
}
:root[data-app-theme="vale"] .sb-prereq-notice {
  background: #fff7d6 !important;
  border-color: #e7b942 !important;
  color: #7a4b00 !important;
  -webkit-text-fill-color: #7a4b00 !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.7);
}
:root[data-app-theme="daydream"] .sb-prereq-notice {
  background: rgba(245,158,11,.16) !important;
  border-color: rgba(245,158,11,.48) !important;
  color: #fde68a !important;
  -webkit-text-fill-color: #fde68a !important;
}
.sb-scene-name {
  font-weight: 600;
  color: #fff;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}
.sb-scene-row {
  font-size: 12.5px;
  color: rgba(255,255,255,.7);
  line-height: 1.6;
  margin-top: 4px;
}
.sb-scene-row b {
  color: rgba(255,255,255,.5);
  font-weight: 500;
  margin-right: 6px;
}
.sb-scene-views {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 10px;
}
.scene-view-box {
  border: 1.5px dashed rgba(255,255,255,.16);
  border-radius: 8px;
  background: rgba(0,0,0,.16);
  min-height: 0;
  aspect-ratio: var(--sb-aspect, 3/2);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}
.scene-view-box img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.scene-view-actions {
  display: flex;
  gap: 6px;
  margin-top: 6px;
}
.scene-view-actions .btn-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  line-height: 1;
}
.sb-compact-card {
  overflow: hidden;
}
.sb-design-toggle {
  width: 100%;
  border: none;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
  padding: 0;
  height: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
#storyboardContent .sb-design-toggle {
  height: auto !important;
  padding: 0 !important;
  font-size: 14px !important;
}
.sb-design-title-text {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.sb-collapse-icon {
  width: 28px;
  height: 28px;
  flex-shrink: 0;
  opacity: .62;
  color: rgba(255,255,255,.72);
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: rgba(255,255,255,.065);
  border: 1px solid rgba(255,255,255,.10);
  transition: transform .18s ease, opacity .18s ease, background .18s ease, border-color .18s ease;
}
.sb-collapse-icon svg {
  width: 15px;
  height: 15px;
}
.sb-design-toggle:hover .sb-collapse-icon,
.sb-shot-toggle:hover .sb-collapse-icon {
  opacity: .95;
  background: rgba(236,72,153,.14);
  border-color: rgba(236,72,153,.32);
}
.sb-compact-card.open .sb-collapse-icon {
  transform: rotate(180deg);
  opacity: .9;
}
.sb-design-media {
  margin-top: 8px;
}
.sb-design-grid .sb-scene-views.sb-design-media {
  width: 96%;
  margin-left: auto;
  margin-right: auto;
}
.sb-design-grid .char-view.sb-design-media,
.sb-design-grid .char-view-empty.sb-design-media {
  width: min(54%, 340px);
  max-width: 340px;
  margin-left: auto;
  margin-right: auto;
  align-self: center;
}
.sb-design-details {
  display: none;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid rgba(255,255,255,.08);
}
.sb-compact-card.open .sb-design-details {
  display: block;
}
.sb-design-details .sb-edit-input {
  margin-top: 8px;
}
.sb-design-form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.sb-design-form .wide {
  grid-column: 1 / -1;
}
.sb-design-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 0;
}
.sb-design-field span {
  color: rgba(255,255,255,.54);
  font-size: 11.5px;
  font-weight: 600;
}
.sb-design-field .sb-edit-input {
  margin-top: 0;
  min-height: 34px;
  background: rgba(255,255,255,.055);
  border-color: rgba(255,255,255,.12);
}
.sb-design-field textarea.sb-edit-input {
  resize: vertical;
  line-height: 1.55;
}
.sb-design-save-row {
  display: flex;
  gap: 6px;
  margin-top: 10px;
  flex-wrap: wrap;
}
.sb-scene-control-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 10px;
}
.sb-scene-control-label {
  color: rgba(255,255,255,.52);
  font-size: 11.5px;
  margin-bottom: 4px;
}
.story-shot-plan {
  margin-top: 8px;
  color: rgba(255,255,255,.58);
  font-size: 12px;
  line-height: 1.45;
  padding: 8px 10px;
  border-radius: 10px;
  background: rgba(236,72,153,.08);
  border: 1px solid rgba(236,72,153,.18);
}
@media (max-width: 980px) {
  .sb-design-grid { grid-template-columns: 1fr; }
  .sb-scene-control-grid { grid-template-columns: 1fr; }
  .sb-design-grid .sb-char,
  .sb-design-grid .sb-scene {
    width: 100%;
  }
}
@media (max-width: 760px) {
  .sb-design-form { grid-template-columns: 1fr; }
}

.sb-shot-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  align-items: start;
}
.story-duration-field {
  min-width: 0;
  height: 46px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: rgba(255,255,255,.06);
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.08);
}
.story-duration-field span {
  font-size: 12px;
  font-weight: 800;
  color: var(--muted);
  white-space: nowrap;
}
.story-duration-input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  font-size: 16px;
  font-weight: 500;
  text-align: center;
  -moz-appearance: textfield;
}
.story-duration-input::-webkit-outer-spin-button,
.story-duration-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.story-textarea {
  min-height: 320px !important;
  max-height: 62vh;
  resize: vertical;
  line-height: 1.72;
  font-size: 15px;
}
.story-text-meta {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}
:root[data-app-theme="vale"] .story-duration-field {
  background: #f7f9fc !important;
  border-color: #cbd7e6 !important;
}
.sb-shot-segments {
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.sb-shot-segment {
  border: 1px solid rgba(148,163,184,.18);
  border-radius: 18px;
  padding: 14px;
  background:
    linear-gradient(135deg, rgba(255,255,255,.045), rgba(255,255,255,.018)),
    rgba(255,255,255,.025);
  box-shadow: 0 14px 36px rgba(15,23,42,.08);
}
.sb-shot-segment-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}
.sb-shot-segment-title {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  font-weight: 900;
  color: rgba(255,255,255,.92);
}
.sb-shot-segment-index {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  background: var(--accent);
  color: #fff;
  box-shadow: 0 10px 22px rgba(99,102,241,.24);
  font-size: 13px;
}
.sb-shot-segment-meta {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
  font-size: 12px;
  color: rgba(255,255,255,.62);
}
.sb-shot-segment.pending {
  border-style: dashed;
  background:
    linear-gradient(135deg, rgba(99,102,241,.075), rgba(14,165,233,.035)),
    rgba(255,255,255,.018);
}
.sb-shot-segment-empty {
  min-height: 86px;
  border: 1px dashed rgba(148,163,184,.28);
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 16px;
  color: rgba(255,255,255,.58);
  font-size: 13px;
  line-height: 1.65;
  background: rgba(255,255,255,.025);
}
:root[data-app-theme="vale"] .sb-shot-segment {
  background: #f7f9fc !important;
  border-color: #dbe3ee !important;
  box-shadow: 0 12px 30px rgba(15,23,42,.06);
}
:root[data-app-theme="vale"] .sb-shot-segment-title {
  color: #0f172a !important;
}
:root[data-app-theme="vale"] .sb-shot-segment-meta {
  color: #475569 !important;
}
:root[data-app-theme="vale"] .sb-shot-segment-empty {
  color: #64748b !important;
  background: #f8fafc !important;
  border-color: #cbd5e1 !important;
}
.sb-shot {
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.10);
  border-radius: 14px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.sb-overall-card {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: minmax(420px, 1fr) minmax(380px, .82fr);
  align-items: stretch;
  border-radius: 18px;
  border: 1px solid rgba(148,163,184,.20);
  box-shadow: 0 18px 48px rgba(15,23,42,.08);
  background:
    radial-gradient(circle at 20% 0%, rgba(99,102,241,.14), transparent 42%),
    radial-gradient(circle at 88% 10%, rgba(236,72,153,.11), transparent 40%),
    rgba(255,255,255,.045);
}
.sb-overall-card .sb-shot-img {
  height: clamp(330px, 34vw, 470px);
  min-height: 0;
  aspect-ratio: auto;
  padding: 18px;
  border-right: 1px solid rgba(148,163,184,.16);
  background:
    linear-gradient(135deg, rgba(255,255,255,.035), rgba(255,255,255,.015)),
    radial-gradient(circle at 50% 42%, rgba(148,163,184,.16), transparent 46%),
    rgba(8,13,24,.18);
}
.sb-overall-card .sb-shot-img img {
  object-fit: contain;
  background: rgba(0,0,0,.24);
  box-shadow: 0 14px 36px rgba(15,23,42,.20);
}
.sb-overall-pages {
  width: 100%;
  height: 100%;
  position: relative;
  display: flex;
  align-items: stretch;
  justify-content: center;
}
.sb-overall-page {
  position: relative;
  min-width: 0;
  width: 100%;
  height: 100%;
  min-height: 0;
  border-radius: 10px;
  overflow: hidden;
  background: rgba(0,0,0,.18);
  border: 1px solid rgba(255,255,255,.10);
  cursor: zoom-in;
  display: none;
}
.sb-overall-page.active {
  display: block;
}
.sb-overall-page img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  border-radius: 8px;
}
.sb-overall-page-label {
  position: absolute;
  left: 8px;
  top: 8px;
  z-index: 3;
  display: inline-flex;
  align-items: center;
  height: 24px;
  padding: 0 9px;
  border-radius: 999px;
  background: rgba(15,23,42,.78);
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  backdrop-filter: blur(8px);
}
.sb-overall-carousel-btn {
  position: absolute;
  top: 50%;
  z-index: 5;
  width: 30px;
  height: 44px;
  border-radius: 999px;
  border: 1px solid rgba(15,23,42,.14);
  background: rgba(255,255,255,.74);
  color: #111827;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transform: translateY(-50%);
  box-shadow: 0 10px 26px rgba(15,23,42,.16);
  backdrop-filter: blur(14px) saturate(1.15);
  -webkit-backdrop-filter: blur(14px) saturate(1.15);
  transition: transform .16s ease, background .16s ease, border-color .16s ease, box-shadow .16s ease, opacity .16s ease;
  opacity: .86;
}
.sb-overall-carousel-btn svg {
  width: 17px;
  height: 17px;
  stroke-width: 2.8;
}
.sb-overall-carousel-btn:hover {
  background: rgba(255,255,255,.94);
  border-color: rgba(15,23,42,.22);
  transform: translateY(-50%) scale(1.03);
  box-shadow: 0 14px 34px rgba(15,23,42,.22);
  opacity: 1;
}
.sb-overall-carousel-btn:active {
  transform: translateY(-50%) scale(.97);
}
.sb-overall-carousel-btn.prev { left: 12px; }
.sb-overall-carousel-btn.next { right: 12px; }
.sb-overall-carousel-dots {
  position: absolute;
  left: 50%;
  bottom: 10px;
  z-index: 5;
  transform: translateX(-50%);
  display: inline-flex;
  gap: 6px;
  padding: 6px 8px;
  border-radius: 999px;
  background: rgba(15,23,42,.64);
  border: 1px solid rgba(255,255,255,.16);
  backdrop-filter: blur(10px);
}
.sb-overall-carousel-dot {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  border: 0;
  padding: 0;
  cursor: pointer;
  background: rgba(255,255,255,.42);
}
.sb-overall-carousel-dot.active {
  width: 18px;
  background: #fff;
}
.sb-overall-legacy-note {
  border: 1px solid rgba(245,158,11,.34);
  background: rgba(245,158,11,.12);
  color: var(--text);
  border-radius: 12px;
  padding: 10px 12px;
  font-size: 12px;
  line-height: 1.7;
  font-weight: 750;
}
.sb-overall-card .sb-shot-body {
  padding: 20px 22px;
  gap: 13px;
}
.sb-overall-control {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
  justify-content: center;
  background: linear-gradient(180deg, rgba(255,255,255,.045), rgba(255,255,255,.025));
}
.sb-overall-empty {
  width: min(380px, 86%);
  min-height: 190px;
  border-radius: 18px;
  border: 1px solid rgba(148,163,184,.18);
  background:
    radial-gradient(circle at 50% 38%, rgba(255,255,255,.10), transparent 46%),
    linear-gradient(135deg, rgba(255,255,255,.08), rgba(255,255,255,.025));
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: rgba(255,255,255,.58);
  text-align: center;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.08);
}
.sb-overall-empty-icon {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: rgba(255,255,255,.56);
  background: rgba(255,255,255,.075);
  border: 1px solid rgba(255,255,255,.12);
}
.sb-overall-empty-title {
  color: rgba(255,255,255,.76);
  font-size: 14px;
  font-weight: 800;
}
.sb-overall-empty-sub {
  max-width: 240px;
  color: rgba(255,255,255,.42);
  font-size: 12px;
  line-height: 1.55;
}
.sb-overall-panel-note {
  border: 1px solid rgba(255,255,255,.10);
  border-radius: 12px;
  padding: 10px 12px;
  color: rgba(255,255,255,.62);
  background: rgba(255,255,255,.045);
  font-size: 12px;
  line-height: 1.55;
  overflow-wrap: break-word;
}
.sb-overall-revision-wrap {
  display: flex;
  flex-direction: column;
  gap: 7px;
  border: 1px solid rgba(167,139,250,.20);
  border-radius: 13px;
  padding: 11px;
  background: linear-gradient(180deg, rgba(167,139,250,.075), rgba(255,255,255,.035));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.05);
}
.sb-overall-revision-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: rgba(255,255,255,.82);
  font-size: 12px;
  font-weight: 780;
}
.sb-overall-revision-label small {
  color: rgba(255,255,255,.42);
  font-size: 11px;
  font-weight: 650;
}
.sb-overall-revision {
  min-height: 74px;
  background: rgba(0,0,0,.24);
  border-color: rgba(255,255,255,.12);
  color: rgba(255,255,255,.92);
  line-height: 1.55;
  min-width: 0;
}
.sb-overall-revision::placeholder {
  color: rgba(255,255,255,.36);
}
.sb-overall-action-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding-top: 2px;
}
.sb-overall-action-row .sb-shot-action-btn {
  min-width: 112px;
  height: 38px;
  justify-content: center;
  border-radius: 12px;
}
.sb-overall-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: rgba(255,255,255,.92);
  font-size: 15px;
  font-weight: 800;
  line-height: 1.35;
}
.sb-overall-desc {
  color: rgba(255,255,255,.55);
  font-size: 12.5px;
  line-height: 1.55;
}
:root[data-app-theme="vale"] .sb-overall-title {
  color: #07111f !important;
  -webkit-text-fill-color: #07111f !important;
}
:root[data-app-theme="vale"] .sb-overall-desc {
  color: #526070 !important;
}
:root[data-app-theme="vale"] .sb-overall-card {
  background:
    radial-gradient(circle at 12% 0%, rgba(15,23,42,.055), transparent 42%),
    #f8fafc !important;
  border-color: #d7dee8 !important;
  box-shadow: 0 18px 44px rgba(15,23,42,.08);
}
:root[data-app-theme="vale"] .sb-overall-card .sb-shot-img {
  background:
    radial-gradient(circle at 50% 42%, rgba(148,163,184,.18), transparent 48%),
    #eef3f8 !important;
  border-right-color: #d7dee8 !important;
}
:root[data-app-theme="vale"] .sb-overall-page {
  background: #ffffff !important;
  border-color: #d7dee8 !important;
}
:root[data-app-theme="vale"] .sb-overall-carousel-btn {
  background: rgba(248,250,252,.86) !important;
  border-color: rgba(100,116,139,.28) !important;
  color: #111827 !important;
  box-shadow: 0 10px 28px rgba(15,23,42,.14) !important;
}
:root[data-app-theme="vale"] .sb-overall-carousel-btn:hover {
  background: rgba(255,255,255,.96) !important;
  border-color: rgba(17,24,39,.32) !important;
}
:root[data-app-theme="daydream"] .sb-overall-carousel-btn {
  background: rgba(244,244,245,.78) !important;
  border-color: rgba(255,255,255,.20) !important;
  color: #111214 !important;
  box-shadow: 0 12px 30px rgba(0,0,0,.34) !important;
}
:root[data-app-theme="daydream"] .sb-overall-carousel-btn:hover {
  background: rgba(255,255,255,.94) !important;
  border-color: rgba(255,255,255,.34) !important;
}
:root[data-app-theme="vale"] .sb-overall-control {
  background: #f8fafc !important;
}
:root[data-app-theme="vale"] .sb-overall-empty {
  background:
    radial-gradient(circle at 50% 38%, rgba(148,163,184,.16), transparent 48%),
    #f8fafc !important;
  border-color: #d7dee8 !important;
  color: #64748b !important;
}
:root[data-app-theme="vale"] .sb-overall-empty-icon {
  background: #ffffff !important;
  border-color: #d7dee8 !important;
  color: #475569 !important;
}
:root[data-app-theme="vale"] .sb-overall-empty-title {
  color: #1f2937 !important;
}
:root[data-app-theme="vale"] .sb-overall-empty-sub {
  color: #64748b !important;
}
:root[data-app-theme="vale"] .sb-overall-panel-note,
:root[data-app-theme="vale"] .sb-overall-revision-wrap {
  background: #ffffff !important;
  border-color: #d7dee8 !important;
  color: #526070 !important;
}
:root[data-app-theme="vale"] .sb-overall-revision-label {
  color: #1f2937 !important;
}
:root[data-app-theme="vale"] .sb-overall-revision-label small {
  color: #64748b !important;
}
:root[data-app-theme="vale"] .sb-overall-revision {
  background: #f8fafc !important;
  border-color: #d7dee8 !important;
  color: #1f2937 !important;
}
:root[data-app-theme="vale"] .sb-overall-revision::placeholder {
  color: #94a3b8 !important;
}
:root[data-app-theme="daydream"] .sb-overall-title {
  color: #f7f8fb !important;
  -webkit-text-fill-color: #f7f8fb !important;
}
:root[data-app-theme="daydream"] .sb-overall-desc {
  color: rgba(247,248,251,.68) !important;
}
:root[data-app-theme="daydream"] .sb-overall-panel-note,
:root[data-app-theme="daydream"] .sb-overall-revision-wrap {
  border-color: rgba(255,255,255,.16);
  background: rgba(255,255,255,.055);
}
.sb-overall-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 2px;
}
.sb-generation-mode-switch {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px;
  border-radius: 13px;
  border: 1px solid rgba(255,255,255,.10);
  background: rgba(255,255,255,.055);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.08);
}
.sb-generation-mode-btn {
  height: 30px;
  border: 0;
  border-radius: 10px;
  padding: 0 12px;
  color: rgba(255,255,255,.64);
  background: transparent;
  font-size: 12px;
  font-weight: 760;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  white-space: nowrap;
  transition: background .18s ease, color .18s ease, box-shadow .18s ease;
}
.sb-generation-mode-btn.active {
  color: #fff;
  background: linear-gradient(135deg, rgba(99,102,241,.46), rgba(236,72,153,.36));
  box-shadow: 0 8px 18px rgba(99,102,241,.18);
}
:root[data-app-theme="vale"] .sb-generation-mode-switch {
  background: #f1f5f9 !important;
  border-color: #d7dee8 !important;
  box-shadow: 0 8px 20px rgba(15,23,42,.05);
}
:root[data-app-theme="vale"] .sb-generation-mode-btn {
  color: #64748b !important;
}
:root[data-app-theme="vale"] .sb-generation-mode-btn.active {
  color: #fff !important;
  background: #111827 !important;
  box-shadow: 0 8px 16px rgba(15,23,42,.12);
}
@media (max-width: 860px) {
  .sb-overall-card {
    grid-template-columns: 1fr;
  }
  .sb-overall-card .sb-shot-img {
    height: auto;
    min-height: 0;
    padding: 10px;
    border-right: 0;
    border-bottom: 1px solid rgba(148,163,184,.16);
  }
  .sb-overall-pages {
    min-height: 0;
  }
  .sb-overall-page {
    height: auto;
    aspect-ratio: 16 / 10;
  }
  .sb-overall-carousel-dots {
    bottom: 8px;
    padding: 4px 7px;
  }
  .sb-overall-carousel-btn {
    width: 28px;
    height: 38px;
  }
  .sb-overall-carousel-btn svg {
    width: 16px;
    height: 16px;
  }
  .sb-overall-carousel-btn.prev { left: 8px; }
  .sb-overall-carousel-btn.next { right: 8px; }
  .sb-overall-card .sb-shot-body {
    padding: 14px;
  }
  .sb-overall-title {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 8px;
    width: 100%;
  }
  .sb-overall-title > span:first-child {
    writing-mode: horizontal-tb !important;
    word-break: keep-all;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
  }
  .sb-overall-desc,
  .sb-overall-panel-note {
    font-size: 12px;
  }
  .sb-overall-meta .sb-shot-tag {
    flex: 1 1 calc(50% - 6px);
    justify-content: center;
    min-width: 0;
  }
  .sb-shot-list-header {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 9px;
    align-items: start;
  }
  .sb-shot-list-heading {
    display: contents;
  }
  .sb-shot-list-heading h3 {
    grid-column: 1 / -1;
  }
  .sb-shot-list-toolbar {
    display: contents;
  }
  .sb-generation-mode-switch {
    grid-column: 1;
    width: 100%;
    min-width: 0;
  }
  .sb-generation-mode-btn {
    flex: 1 1 0;
    min-width: 0;
    padding: 0 8px;
  }
  .sb-sync-wrap {
    grid-column: 2;
    align-items: stretch;
    flex: 0 0 auto;
    min-width: 0;
  }
  .sb-sync-wrap > .btn-ghost {
    width: auto;
    min-width: 118px;
    height: 38px !important;
    padding: 0 10px !important;
    font-size: 12px !important;
    white-space: nowrap;
  }
  .sb-sync-wrap > .btn-ghost svg {
    width: 12px;
    height: 12px;
  }
  .sb-sync-hint {
    grid-column: 1 / -1;
    font-size: 10.5px;
    text-align: left;
    max-width: 100%;
  }
  .sb-overall-action-row .sb-shot-action-btn {
    flex: initial;
    min-width: 0;
  }
  .sb-overall-action-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 9px;
  }
  .sb-generation-mode-switch {
    width: 100%;
  }
  .sb-generation-mode-btn {
    flex: 1;
    padding: 0 8px;
  }
}
@media (max-width: 860px) { .sb-shot-grid { grid-template-columns: 1fr; } }
.sb-shot-img {
  position: relative;
  background: rgba(0,0,0,.4);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  overflow: hidden;
  padding: 12px;
  aspect-ratio: var(--sb-aspect, 3/2);
}
.sb-shot-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: 8px;
}
.sb-shot-img.has-image img {
  opacity: 0;
  transition: opacity .22s ease;
}
.sb-shot-img.has-image.loaded img {
  opacity: 1;
}
.sb-shot-img-loader {
  position: absolute;
  inset: 12px;
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
  justify-content: center;
  color: rgba(255,255,255,.72);
  font-size: 12.5px;
  background:
    radial-gradient(circle at 50% 35%, rgba(167,139,250,.16), transparent 44%),
    rgba(5,6,18,.72);
  z-index: 2;
  pointer-events: none;
}
.sb-shot-img.loaded .sb-shot-img-loader {
  display: none;
}
.sb-shot-img.load-error .sb-shot-img-loader {
  color: #fecaca;
  background: rgba(127,29,29,.62);
}
.sb-shot-img.is-generating .sb-shot-img-loader {
  inset: 0;
  border-radius: 0;
  min-height: 100%;
  background:
    radial-gradient(circle at 50% 38%, rgba(236,72,153,.16), transparent 42%),
    radial-gradient(circle at 50% 62%, rgba(99,102,241,.16), transparent 48%),
    rgba(10,8,28,.88);
}
.sb-shot-img .placeholder {
  color: rgba(255,255,255,.3);
  font-size: 13px;
  text-align: center;
}
.sb-shot-body {
  padding: 14px 16px;
  display: flex; flex-direction: column;
  gap: 8px;
  min-width: 0;
}
.sb-shot-toggle {
  width: 100%;
  max-width: 100%;
  border: 1px solid rgba(255,255,255,.10);
  background:
    radial-gradient(circle at 18% 0%, rgba(167,139,250,.18), transparent 38%),
    linear-gradient(180deg, rgba(255,255,255,.075), rgba(255,255,255,.045));
  color: rgba(255,255,255,.9);
  border-radius: 14px;
  padding: 12px 58px 12px 20px;
  cursor: pointer;
  display: block;
  position: relative;
  text-align: left;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.08), 0 10px 24px rgba(0,0,0,.12);
  transition: background .18s ease, border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}
.sb-shot-toggle:hover {
  background:
    radial-gradient(circle at 18% 0%, rgba(236,72,153,.20), transparent 40%),
    linear-gradient(180deg, rgba(255,255,255,.095), rgba(255,255,255,.055));
  border-color: rgba(236,72,153,.32);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.10), 0 12px 26px rgba(99,102,241,.16);
  transform: translateY(-1px);
}
.sb-shot-title {
  min-width: 0;
  display: grid;
  gap: 9px;
  align-items: start;
  width: 100%;
}
.sb-shot-main-row {
  display: grid;
  grid-template-columns: minmax(82px, .95fr) minmax(82px, .95fr) minmax(56px, .48fr);
  gap: 10px;
  align-items: center;
  width: min(100%, 560px);
  min-width: 0;
}
.sb-shot-motion-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  min-width: 0;
}
.sb-shot-motion-row {
  width: 100%;
  padding-left: 0;
}
.sb-shot-title .num {
  background: linear-gradient(135deg, #6366f1, #ec4899);
  color: #fff;
  font-weight: 700;
  font-size: 12px;
  padding: 4px 11px;
  border-radius: 999px;
  box-shadow: 0 8px 18px rgba(99,102,241,.22);
  white-space: nowrap;
  min-width: 0;
  text-align: center;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.sb-shot-tag {
  font-size: 11.5px;
  padding: 4px 10px;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(255,255,255,.105), rgba(255,255,255,.06));
  color: rgba(255,255,255,.82);
  border: 1px solid rgba(255,255,255,.15);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
  width: auto;
  flex: 0 0 auto;
  line-height: 1.2;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.06);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}
.sb-shot-tag.wide {
  max-width: calc(100% - 4px);
}
.sb-shot-tag.scene {
  background: linear-gradient(135deg, rgba(99,102,241,.24), rgba(129,140,248,.10));
  border-color: rgba(129,140,248,.34);
  color: #ddd6fe;
}
.sb-shot-tag.duration {
  background: linear-gradient(135deg, rgba(148,163,184,.18), rgba(255,255,255,.06));
  border-color: rgba(203,213,225,.22);
  color: rgba(255,255,255,.82);
  text-align: center;
}
.sb-shot-tag.shot-size {
  background: linear-gradient(135deg, rgba(236,72,153,.20), rgba(168,85,247,.08));
  border-color: rgba(244,114,182,.30);
  color: #fbcfe8;
}
.sb-shot-tag.motion {
  max-width: min(100%, 520px);
  white-space: normal;
  overflow: visible;
  text-overflow: clip;
  line-height: 1.35;
  padding: 4px 11px;
  justify-content: center;
  text-align: center;
  background: linear-gradient(135deg, rgba(99,102,241,.13), rgba(236,72,153,.11));
  border-color: rgba(255,255,255,.16);
  color: rgba(255,255,255,.82);
}
.sb-shot .sb-collapse-icon {
  color: rgba(255,255,255,.68);
  position: absolute;
  right: 12px;
  top: 13px;
  margin-top: 0;
}
.sb-shot.open .sb-collapse-icon {
  transform: rotate(180deg);
}
.sb-shot-details {
  display: none;
  padding-top: 4px;
}
.sb-shot.open .sb-shot-details {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.sb-shot-compact-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.sb-shot-story {
  color: rgba(255,255,255,.85);
  font-size: 13.5px;
  line-height: 1.6;
}
.sb-shot-prompt {
  color: rgba(255,255,255,.5);
  font-size: 12px;
  line-height: 1.55;
  max-height: 80px;
  overflow-y: auto;
  background: rgba(0,0,0,.2);
  padding: 6px 10px;
  border-radius: 8px;
  border: 1px dashed rgba(255,255,255,.10);
  font-family: ui-monospace, 'SF Mono', monospace;
  word-break: break-word;
}
.sb-ai-prompt-preview {
  margin-top: 8px;
  border: 1px solid rgba(148,163,184,.20);
  border-radius: 10px;
  background: linear-gradient(180deg, rgba(255,255,255,.055), rgba(255,255,255,.030));
  overflow: hidden;
}
.sb-ai-prompt-preview summary {
  cursor: pointer;
  list-style: none;
  padding: 8px 10px;
  color: rgba(255,255,255,.70);
  font-size: 11.5px;
  font-weight: 650;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.sb-ai-prompt-preview summary::-webkit-details-marker {
  display: none;
}
.sb-ai-prompt-preview summary::after {
  content: '展开';
  color: rgba(255,255,255,.42);
  font-weight: 500;
  font-size: 11px;
}
.sb-ai-prompt-preview[open] summary::after {
  content: '收起';
}
.sb-ai-prompt-text {
  width: calc(100% - 16px);
  margin: 0 8px 8px;
  min-height: 74px;
  max-height: 180px;
  resize: vertical;
  background: rgba(0,0,0,.22);
  border: 1px solid rgba(255,255,255,.10);
  color: rgba(255,255,255,.82);
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 11.5px;
  line-height: 1.55;
  font-family: ui-monospace, 'SF Mono', monospace;
  outline: none;
}
:root[data-app-theme="vale"] .sb-ai-prompt-preview {
  background: #f8fafc;
  border-color: #d7dee8;
}
:root[data-app-theme="vale"] .sb-ai-prompt-preview summary {
  color: #1f2937;
}
:root[data-app-theme="vale"] .sb-ai-prompt-preview summary::after {
  color: #64748b;
}
:root[data-app-theme="vale"] .sb-ai-prompt-text {
  background: #ffffff;
  border-color: #d7dee8;
  color: #243044;
}
.sb-shot-actions {
  display: flex; gap: 8px; flex-wrap: wrap;
  margin-top: 2px;
}
.sb-shot-quick-actions {
  gap: 10px;
  margin-top: 4px;
}
.sb-overall-action-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  align-items: center;
  width: 100%;
}
.sb-overall-action-row .sb-shot-action-btn {
  width: 100%;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
}
.sb-overall-action-row .sb-shot-action-btn span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sb-shot-action-btn {
  height: 36px !important;
  padding: 0 14px !important;
  border-radius: 12px !important;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  font-size: 12.5px !important;
  font-weight: 650;
  letter-spacing: .1px;
  color: rgba(255,255,255,.88) !important;
  background: linear-gradient(180deg, rgba(255,255,255,.105), rgba(255,255,255,.055)) !important;
  border: 1px solid rgba(255,255,255,.16) !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.08), 0 8px 18px rgba(0,0,0,.12);
  transition: transform .16s ease, border-color .16s ease, background .16s ease, box-shadow .16s ease;
}
.sb-shot-action-btn svg {
  width: 14px;
  height: 14px;
  flex: 0 0 auto;
}
.sb-shot-action-btn:hover:not(:disabled) {
  transform: translateY(-1px);
  border-color: rgba(167,139,250,.42) !important;
  background: linear-gradient(180deg, rgba(139,92,246,.22), rgba(255,255,255,.07)) !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.10), 0 10px 22px rgba(99,102,241,.18);
}
.sb-shot-action-btn:active:not(:disabled) {
  transform: translateY(0);
}
.sb-shot-action-btn.regen {
  background: linear-gradient(135deg, rgba(124,58,237,.26), rgba(236,72,153,.12)) !important;
  border-color: rgba(167,139,250,.24) !important;
}
.sb-shot-action-btn.download {
  background: linear-gradient(135deg, rgba(14,165,233,.18), rgba(99,102,241,.12)) !important;
  border-color: rgba(125,211,252,.20) !important;
}
.sb-sync-wrap {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
}
.sb-shot-list-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.sb-shot-list-heading {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  min-width: 0;
}
.sb-shot-list-toolbar {
  display: flex;
  align-items: flex-start;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
  min-width: 0;
}
.sb-sync-hint {
  color: rgba(255,255,255,.42);
  font-size: 11px;
  line-height: 1.35;
  text-align: right;
}
.btn-ghost.sb-share-on,
.sb-shot-action-btn.sb-share-on {
  background: rgba(255,255,255,.10) !important;
  border-color: rgba(255,255,255,.24) !important;
  color: #f8fafc !important;
  -webkit-text-fill-color: #f8fafc !important;
}
:root[data-app-theme="vale"] .btn-ghost.sb-share-on,
:root[data-app-theme="vale"] .sb-shot-action-btn.sb-share-on {
  background: #ffffff !important;
  border-color: #cbd5e1 !important;
  color: #111827 !important;
  -webkit-text-fill-color: #111827 !important;
  box-shadow: 0 8px 18px rgba(15,23,42,.07) !important;
}
:root[data-app-theme="daydream"] .btn-ghost.sb-share-on,
:root[data-app-theme="daydream"] .sb-shot-action-btn.sb-share-on {
  background: rgba(255,255,255,.10) !important;
  border-color: rgba(255,255,255,.24) !important;
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
}
.btn-ghost.sb-share-on svg,
.sb-shot-action-btn.sb-share-on svg {
  color: currentColor !important;
  stroke: currentColor !important;
}
#storyboardContent #sbLikeBtn.sb-like-on,
#storyboardContent #sbLikeBtn.sb-like-on:hover {
  background: #111827 !important;
  border-color: #111827 !important;
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
  opacity: 1 !important;
}
#storyboardContent #sbLikeBtn.sb-like-on *,
#storyboardContent #sbLikeBtn.sb-like-on span,
#storyboardContent #sbLikeBtn.sb-like-on svg {
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
  stroke: #ffffff !important;
  opacity: 1 !important;
}
#storyboardContent #sbLikeBtn.sb-like-on svg {
  fill: #ffffff !important;
}
:root[data-app-theme="vale"] #storyboardContent #sbShareBtn.btn-ghost.sb-share-on,
:root[data-app-theme="vale"] #storyboardContent .sb-shot-action-btn.sb-share-on {
  background: #ffffff !important;
  border-color: #cbd5e1 !important;
  color: #111827 !important;
  -webkit-text-fill-color: #111827 !important;
}
:root[data-app-theme="vale"] #storyboardContent #sbShareBtn.btn-ghost.sb-share-on *,
:root[data-app-theme="vale"] #storyboardContent #sbShareBtn.btn-ghost.sb-share-on svg,
:root[data-app-theme="vale"] #storyboardContent .sb-shot-action-btn.sb-share-on *,
:root[data-app-theme="vale"] #storyboardContent .sb-shot-action-btn.sb-share-on svg {
  color: #111827 !important;
  -webkit-text-fill-color: #111827 !important;
  stroke: #111827 !important;
  opacity: 1 !important;
}
:root[data-app-theme="daydream"] #storyboardContent #sbShareBtn.btn-ghost.sb-share-on,
:root[data-app-theme="daydream"] #storyboardContent .sb-shot-action-btn.sb-share-on {
  background: #202126 !important;
  border-color: #3a3b41 !important;
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
}
:root[data-app-theme="daydream"] #storyboardContent #sbShareBtn.btn-ghost.sb-share-on *,
:root[data-app-theme="daydream"] #storyboardContent #sbShareBtn.btn-ghost.sb-share-on svg,
:root[data-app-theme="daydream"] #storyboardContent .sb-shot-action-btn.sb-share-on *,
:root[data-app-theme="daydream"] #storyboardContent .sb-shot-action-btn.sb-share-on svg {
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
  stroke: #ffffff !important;
  opacity: 1 !important;
}
.sb-final-prompt-action {
  grid-column: 1 / -1;
  display: flex;
  justify-content: center;
  padding: 6px 0 2px;
}
.sb-final-prompt-btn {
  height: 42px !important;
  min-width: 176px;
  padding: 0 22px !important;
  border-radius: 13px !important;
  border: 1px solid rgba(148,163,184,.26) !important;
  background: linear-gradient(180deg, rgba(255,255,255,.075), rgba(255,255,255,.045)) !important;
  color: rgba(255,255,255,.74) !important;
  font-size: 14px !important;
  font-weight: 760 !important;
  letter-spacing: .1px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.08), 0 8px 22px rgba(0,0,0,.10);
}
.sb-final-prompt-btn:hover:not(:disabled) {
  color: rgba(255,255,255,.92) !important;
  border-color: rgba(167,139,250,.38) !important;
  background: linear-gradient(180deg, rgba(139,92,246,.18), rgba(255,255,255,.055)) !important;
}
:root[data-app-theme="vale"] .sb-sync-hint {
  color: #64748b;
}
:root[data-app-theme="vale"] .sb-final-prompt-btn {
  background: #f8fafc !important;
  border-color: #d7dee8 !important;
  color: #64748b !important;
  box-shadow: 0 8px 20px rgba(15,23,42,.06);
}
:root[data-app-theme="vale"] .sb-final-prompt-btn:hover:not(:disabled) {
  background: #eef2f7 !important;
  color: #334155 !important;
  border-color: #c8d2df !important;
}
@media (max-width: 860px) {
  .sb-shot-list-header {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) 116px !important;
    gap: 8px !important;
    align-items: start !important;
  }
  .sb-shot-list-heading,
  .sb-shot-list-toolbar {
    display: contents !important;
  }
  .sb-shot-list-heading h3 {
    grid-column: 1 / -1 !important;
  }
  .sb-generation-mode-switch {
    grid-column: 1 !important;
    width: 100% !important;
    min-width: 0 !important;
  }
  .sb-generation-mode-btn {
    flex: 1 1 0 !important;
    min-width: 0 !important;
    padding: 0 6px !important;
    font-size: 12px !important;
  }
  .sb-sync-wrap {
    grid-column: 2 !important;
    display: flex !important;
    align-items: stretch !important;
    min-width: 0 !important;
    width: 116px !important;
  }
  .sb-sync-wrap > .btn-ghost {
    width: 116px !important;
    min-width: 0 !important;
    height: 38px !important;
    padding: 0 8px !important;
    font-size: 11.5px !important;
    white-space: nowrap !important;
    gap: 4px !important;
  }
  .sb-sync-wrap > .btn-ghost svg {
    width: 11px !important;
    height: 11px !important;
  }
  .sb-sync-hint {
    display: none !important;
  }
}
.sb-edit-group {
  display: flex; flex-direction: column;
  gap: 4px;
}
.sb-edit-row {
  display: flex; gap: 8px;
}
.sb-edit-label {
  font-size: 11px;
  color: rgba(255,255,255,.4);
  letter-spacing: .3px;
}
.sb-edit-input {
  width: 100%;
  background: rgba(0,0,0,.25);
  border: 1px solid rgba(255,255,255,.10);
  color: #fff;
  border-radius: 8px;
  padding: 7px 10px;
  font-size: 12.5px;
  font-family: inherit;
  outline: none;
  transition: border-color .15s, background .15s;
  resize: vertical;
}
.sb-edit-input:focus {
  border-color: #a78bfa;
  background: rgba(0,0,0,.35);
}
.sb-edit-prompt {
  font-family: ui-monospace, 'SF Mono', monospace;
  font-size: 11.5px;
  line-height: 1.55;
  color: rgba(255,255,255,.85);
}
.sb-shot-revision {
  min-height: 58px;
  background: linear-gradient(180deg, rgba(255,255,255,.075), rgba(255,255,255,.045));
  border-color: rgba(167,139,250,.22);
  color: rgba(255,255,255,.9);
}
.sb-shot-revision::placeholder {
  color: rgba(255,255,255,.36);
}
.btn-primary.cancel-mode {
  background: linear-gradient(135deg, #ef4444, #f97316) !important;
  box-shadow: 0 6px 18px -6px rgba(239,68,68,.6) !important;
}
.btn-primary.saved {
  background: linear-gradient(135deg, #10b981, #14b8a6) !important;
  box-shadow: 0 6px 18px -6px rgba(16,185,129,.6) !important;
}
.sb-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: rgba(255,255,255,.6);
}

/* 参考图上传 */
.ref-drop {
  border: 1.5px dashed rgba(255,255,255,.18);
  border-radius: 12px;
  background: rgba(255,255,255,.04);
  transition: border-color .15s, background .15s;
  overflow: hidden;
}
.ref-drop.drag-over {
  border-color: #a78bfa;
  background: rgba(139,92,246,.10);
}
.ref-drop:hover { border-color: rgba(255,255,255,.32); }
:root[data-app-theme="vale"] #refUploadIcon,
:root[data-app-theme="vale"] #refUploadIcon svg,
:root[data-app-theme="vale"] #refUploadIcon svg * {
  color: #111827 !important;
  stroke: #111827 !important;
  -webkit-text-fill-color: #111827 !important;
}
.ref-thumb {
  position: relative;
  width: 72px; height: 72px;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.14);
  background: rgba(0,0,0,.3);
  flex-shrink: 0;
}
.ref-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ref-thumb .ref-remove {
  position: absolute; top: 6px; right: 6px;
  width: 24px; height: 24px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(99,102,241,.96), rgba(236,72,153,.92));
  color: #fff;
  border: 1px solid rgba(255,255,255,.34);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  padding: 0;
  box-shadow: 0 10px 24px rgba(99,102,241,.28), 0 3px 10px rgba(236,72,153,.22);
  opacity: .96;
  transform: scale(.92);
  transition: transform .16s ease, opacity .16s ease, background .16s ease, color .16s ease, border-color .16s ease, box-shadow .16s ease;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.ref-thumb:hover .ref-remove { opacity: 1; transform: scale(1); }
.ref-thumb .ref-remove:hover {
  background: linear-gradient(135deg, #fb7185, #ef4444);
  color: #fff;
  border-color: rgba(255,255,255,.38);
  box-shadow: 0 10px 24px rgba(239,68,68,.35);
  transform: scale(1.06);
}
.ref-thumb .ref-remove:active { transform: scale(.96); }
.ref-thumb .ref-remove svg { width: 13px; height: 13px; stroke-width: 2.7; }
:root[data-app-theme="daydream"] .ref-thumb .ref-remove {
  background: rgba(15,16,20,.88);
  color: #f4f4f5;
  border-color: rgba(244,244,245,.72);
  box-shadow: 0 10px 26px rgba(0,0,0,.42), inset 0 0 0 1px rgba(255,255,255,.08);
}
:root[data-app-theme="vale"] .ref-thumb .ref-remove {
  background: rgba(255,255,255,.92);
  color: #334155;
  border-color: rgba(148,163,184,.42);
  box-shadow: 0 9px 22px rgba(15,23,42,.14), inset 0 1px 0 rgba(255,255,255,.72);
}
:root[data-app-theme="daydream"] .ref-thumb .ref-remove:hover,
:root[data-app-theme="vale"] .ref-thumb .ref-remove:hover {
  background: #111827;
  color: #fff;
  border-color: rgba(239,68,68,.72);
  box-shadow: 0 10px 24px rgba(239,68,68,.22);
}
.ref-add-more {
  width: 72px; height: 72px;
  border-radius: 10px;
  border: 1.5px dashed rgba(255,255,255,.2);
  background: transparent;
  color: rgba(255,255,255,.55);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  transition: border-color .15s, color .15s;
}
.ref-add-more:hover { border-color: #a78bfa; color: #a78bfa; }

/* ==========================================================
 * 移动端适配（≤ 768px）
 * 不改 web 端任何视觉，只在小屏激活
 * ========================================================== */
@media (max-width: 768px) {
  /* 全局：禁止横向溢出 */
  html, body { overflow-x: hidden; }
  * { box-sizing: border-box; }

  /* 整体容器 */
  .layout { padding: 4px 10px 32px; max-width: 100vw; overflow-x: hidden; }

  /* 图片创作面板溢出修复 */
  #imageMode {
    width: 100%;
    min-width: 0;
    overflow: hidden;
  }
  #imageMode > aside,
  #imageMode > section {
    min-width: 0;
    overflow: hidden;
    word-break: break-word;
  }
  #imageMode > aside.panel {
    position: static;
    max-height: none;
    overflow: visible;
  }
  .topbar {
    padding: 10px 10px;
    gap: 8px;
    flex-wrap: wrap;
  }

  /* 品牌：缩小 logo 字号 */
  .brand { gap: 6px; }
  .brand-logo { width: 30px; height: 30px; border-radius: 8px; }
  .brand-logo svg { width: 18px; height: 18px; }
  .brand > div:not(.brand-logo) > div:first-child,
  .brand .brand-title { font-size: 15px; }
  .brand .brand-sub { font-size: 9.5px; }

  /* 模式切换（图片创作 / 故事板） 占满整行第二行 */
  .mode-switch {
    order: 3;
    width: 100%;
    justify-content: stretch;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    padding: 8px;
    border-radius: 18px;
    background: rgba(255,255,255,.58);
    border: 1px solid rgba(148,163,184,.24);
    box-shadow: inset 0 1px 0 rgba(255,255,255,.78), 0 10px 24px rgba(15,23,42,.06);
  }
  .mode-switch .mode-btn {
    min-width: 0;
    width: 100%;
    flex: initial;
    justify-content: center;
    height: 36px;
    padding: 0 4px;
    font-size: 11.2px;
    line-height: 1;
    gap: 3px;
    white-space: nowrap;
    border-radius: 13px;
    letter-spacing: 0;
    background: rgba(248,250,252,.72);
    border: 1px solid rgba(148,163,184,.18);
    box-shadow: 0 4px 12px rgba(15,23,42,.04);
  }
  .mode-switch .mode-btn svg {
    width: 12px;
    height: 12px;
    flex: 0 0 auto;
  }
  .mode-switch .mode-btn.active {
    box-shadow: inset 0 1px 0 rgba(255,255,255,.22), 0 10px 20px -14px rgba(15,23,42,.75);
  }

  /* 顶部 chip 区缩紧 */
  .stats-row {
    order: 2;
    width: 100%;
    display: grid;
    grid-template-columns: 36px minmax(104px, 1.18fr) minmax(70px, .78fr) 36px minmax(56px, .58fr);
    gap: 5px;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: stretch;
    min-width: 0;
  }
  .stats-row > span,
  .stats-row > a,
  .stats-row > button {
    min-width: 0;
    width: 100%;
  }
  .stats-row > span[style*="position:relative"] {
    display: block;
  }
  .stats-row .chip,
  .stats-row .btn-ghost {
    width: 100%;
    height: 34px;
    min-width: 0;
    padding: 0 7px;
    font-size: 11.5px;
    justify-content: center;
    gap: 5px;
    white-space: nowrap;
    overflow: hidden;
  }
  .stats-row .chip svg,
  .stats-row .btn-ghost svg { width: 13px; height: 13px; }
  #quotaText,
  #userName,
  #authActionText {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  #announceBtn,
  #adminLink {
    padding: 0 !important;
  }
  #authActionBtn {
    padding-left: 6px !important;
    padding-right: 6px !important;
  }

  /* 公告面板：宽度限制为视口减边距 */
  #announcePanel {
    position: fixed !important;
    top: 72px !important;
    left: 12px !important;
    right: 12px !important;
    transform: none !important;
    width: auto !important;
    max-width: none !important;
    max-height: calc(100vh - 96px) !important;
    overflow: hidden !important;
    padding: 16px !important;
  }
  #announceList {
    max-height: calc(100vh - 170px) !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch;
  }

  /* 账号面板同样自适应 */
  #accountPanel {
    position: fixed !important;
    top: calc(env(safe-area-inset-top, 0px) + 92px) !important;
    left: 12px !important;
    right: 12px !important;
    width: auto !important;
    max-width: none !important;
    max-height: calc(100vh - 116px) !important;
    max-height: calc(100dvh - 116px) !important;
    transform: none !important;
    padding: 16px !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    box-sizing: border-box !important;
    -webkit-overflow-scrolling: touch;
    z-index: 10000 !important;
  }
  #accountPanel * {
    max-width: 100%;
    box-sizing: border-box;
  }
  #accountPanel input {
    min-width: 0;
  }
  #accountPanel > div {
    padding: 12px !important;
  }
  #accountPanel > div > div[style*="display:flex"] {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: stretch;
    gap: 8px !important;
  }

  /* 主内容区：双栏变单栏（已有 1024px 触发，这里再小屏微调） */
  .grid, .story-grid { gap: 14px !important; }
  .panel { padding: 20px 16px 18px !important; overflow: hidden; width: 100% !important; max-width: 100% !important; }
  .panel-title { font-size: 16px; gap: 8px; }
  .panel-title-icon { width: 30px; height: 30px; border-radius: 9px; }
  .panel-title-icon svg { width: 16px; height: 16px; }

  /* 移动端标签样式增强 */
  .label-dark {
    font-size: 13px;
    font-weight: 600;
    color: rgba(255,255,255,.8);
    margin-bottom: 8px;
    margin-top: 2px;
    letter-spacing: .3px;
  }

  /* 表单分组卡片化 — 尺寸 + 数量移动端保持一行 */
  .form-grid {
    grid-template-columns: minmax(0, 1.35fr) minmax(86px, .65fr) !important;
    gap: 8px !important;
    margin-top: 16px !important;
    background: rgba(255,255,255,.03);
    border: 1px solid rgba(255,255,255,.07);
    border-radius: 14px;
    padding: 14px 10px 12px;
  }
  .form-grid > div { min-width: 0; }

  .prompt-optimizer {
    padding: 13px 11px 12px;
    border-radius: 15px;
    margin-bottom: 14px;
  }
  .prompt-mode-shell { max-width: 100%; }
  #promptMode .prompt-optimizer {
    padding: 16px 12px 14px;
    border-radius: 16px;
  }
  #promptMode .po-title { font-size: 15px; }
  #promptMode .po-sub { margin-left: 34px; font-size: 11px; }
  .reverse-shell { max-width: 100%; }
  .rp-hero { padding: 4px 0 12px; }
  .rp-title { font-size: 40px; }
  .rp-sub { font-size: 13px; }
  .rp-workspace {
    padding: 12px;
    border-radius: 18px;
  }
  .rp-main-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  .rp-card {
    padding: 16px;
    border-radius: 16px;
  }
  .rp-card-title { font-size: 18px; }
  .rp-drop,
  .rp-preview {
    height: 280px;
    min-height: 236px;
  }
  .rp-result-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
  }
  .rp-result-actions .po-mini-btn {
    min-width: 0;
  }
  #videoReverseMode .rp-result-head {
    display: block;
  }
  #videoReverseMode .rp-result-actions {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    margin-top: 10px;
  }
  #videoReverseMode .rp-result-actions .po-mini-btn {
    width: 100%;
    height: 40px;
    padding: 0 4px;
    border-radius: 12px;
    justify-content: center;
    font-size: 12px;
    gap: 4px;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  #videoReverseMode .rp-result-actions .po-mini-btn svg,
  #videoReverseMode .rp-result-actions .po-mini-btn span[id^="icon"] svg {
    width: 14px;
    height: 14px;
  }
  .rp-output-grid {
    grid-template-columns: 1fr;
  }
  .rp-analysis {
    grid-template-columns: 1fr;
  }
  .po-header { gap: 8px; margin-bottom: 10px; }
  .po-sub { margin-left: 34px; font-size: 11px; }
  .po-row,
  .po-fields,
  .po-score-grid {
    grid-template-columns: 1fr;
  }
  .po-config-grid,
  .po-type-columns {
    grid-template-columns: 1fr;
  }
  .po-type-grid,
  .po-preserve,
  .po-tabs {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  #promptMode .po-type-grid,
  #promptMode .po-output-actions {
    grid-template-columns: 1fr;
  }
  .po-type-tools {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    width: 100%;
  }
  .po-type-tools .po-mini-btn {
    min-width: 0;
    padding: 0 8px;
  }
  .po-type-btn,
  .po-tab,
  .po-mini-btn {
    font-size: 11.5px;
  }
  .po-output-actions .po-mini-btn {
    flex: 1 1 calc(50% - 4px);
  }

  /* 1K/2K/4K + 比例下拉保持一行 */
  .form-grid > div > div[style*="display:flex"][style*="gap:6px"] {
    flex-direction: row !important;
    align-items: stretch !important;
    gap: 4px !important;
  }
  #resToggle {
    width: auto;
    flex-shrink: 0;
    border-radius: 9px;
    background: rgba(255,255,255,.06);
    border-color: rgba(255,255,255,.12);
  }
  .size-dropdown { flex: 1 !important; min-width: 0 !important; }
  .res-btn {
    padding: 0 7px;
    font-size: 11.5px;
    height: 34px;
    min-width: 0;
  }

  /* 表单元素强制不溢出 */
  .panel * { max-width: 100%; box-sizing: border-box; }
  .panel { overflow-wrap: break-word; word-wrap: break-word; }
  .input, .textarea, .select { width: 100%; max-width: 100%; box-sizing: border-box; }
  .textarea {
    font-size: 14px;
    min-height: 110px;
    padding: 12px 14px;
    border-radius: 12px;
    line-height: 1.7;
  }

  /* panel-sub 字体收紧 */
  .panel-sub { font-size: 12px; line-height: 1.4; margin-bottom: 16px; margin-left: 38px; }

  /* 自定义下拉菜单 */
  .size-trigger, .cw-trigger {
    min-height: 34px;
    padding: 0 10px;
    font-size: 12.5px;
    border-radius: 10px;
  }
  .size-menu, .cw-menu { max-height: 240px; }

  /* 画质/分镜按钮移动端保持单行 */
  .quality-group { grid-template-columns: repeat(4, minmax(0, 1fr)) !important; gap: 6px !important; }
  .quality-btn {
    min-width: 0;
    padding: 8px 2px;
    border-radius: 10px;
  }
  .quality-btn .qb-main { font-size: 12px; }
  .quality-btn .qb-sub { font-size: 9px; }
  #storyMode .quality-group[style*="repeat(3,1fr)"] {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  }
  #storyMode .quality-group[style*="repeat(2,1fr)"] {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
  #storyMode .panel > div[style*="display:flex"][style*="align-items:stretch"] {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.08fr);
    gap: 10px !important;
    align-items: stretch !important;
  }
  #storyMode .story-duration-field,
  #storyMode #segmentDurationDropdown,
  #storyMode #shotDurationDropdown {
    width: auto !important;
    min-width: 0 !important;
  }
  #storyMode .story-duration-field,
  #storyMode #segmentDurationDropdown .cw-trigger,
  #storyMode #shotDurationDropdown .cw-trigger {
    height: 46px !important;
    border-radius: 14px;
    justify-content: space-between;
    padding: 0 14px;
    font-size: 15px;
    background: rgba(255,255,255,.06);
  }
  #storyMode #analyzeBtn {
    grid-column: 1 / -1;
    width: 100% !important;
    min-width: 0 !important;
    height: 48px !important;
    margin-top: 0 !important;
    border-radius: 16px;
    justify-content: center;
    font-size: 16px !important;
    letter-spacing: .2px;
    box-shadow: inset 0 1px 0 rgba(255,255,255,.22), 0 12px 24px -16px rgba(99,102,241,.95);
  }
  #storyMode #analyzeBtn svg {
    width: 17px;
    height: 17px;
    flex-shrink: 0;
  }
  #storyMode #analyzeBtnLabel {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  /* 灵感预设：移动端双行展示 */
  .preset-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(104px, 1fr));
    overflow: visible;
    max-height: none;
    gap: 9px;
    padding-bottom: 2px;
  }
  .preset-row::-webkit-scrollbar { display: none; }
  .preset-row .chip-btn {
    white-space: nowrap;
    width: 100%;
    min-width: 0;
    height: 36px;
    padding: 0 10px;
    font-size: 12px;
    justify-content: center;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  /* 画廊 tabs 横向排满 */
  .tabs { flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .tab { white-space: nowrap; flex-shrink: 0; }

  /* 画廊单列 / 双列自动 */
  .gallery { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)) !important; gap: 10px; }

  /* 故事板：详情区单列、参考图缩小 */
  .sb-shot { grid-template-columns: 1fr !important; }
  .sb-shot-img { padding: 8px !important; }
  .sb-overall-card {
    display: grid !important;
    grid-template-columns: 1fr !important;
    width: 100% !important;
    max-width: 100% !important;
    overflow: hidden;
  }
  .sb-overall-card .sb-overall-img {
    width: 100% !important;
    min-width: 0 !important;
    min-height: 220px !important;
    height: auto !important;
    aspect-ratio: 16 / 10 !important;
    position: relative;
    border-right: 0 !important;
    border-bottom: 1px solid rgba(148,163,184,.18);
  }
  .sb-overall-card .sb-shot-img-loader {
    inset: 8px !important;
    border-radius: 14px !important;
    min-height: 0 !important;
    z-index: 3;
  }
  .sb-overall-card .sb-shot-body {
    min-width: 0 !important;
    width: 100% !important;
  }
  .sb-shot-body {
    padding: 11px 12px 12px !important;
    gap: 10px !important;
  }
  .sb-char-grid { grid-template-columns: 1fr !important; gap: 10px; }
  .sb-section { padding: 14px 12px !important; }
  .sb-section h3 { font-size: 13.5px; }
  .sb-section-header-heading { font-size: 13.5px; }
  .sb-section-header-sub { font-size: 11px; }

  /* 镜头/角色卡的小标签收紧 */
  .sb-shot-toggle {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) 34px;
    align-items: start;
    gap: 8px;
    position: relative;
    width: 100%;
    max-width: 100%;
    padding: 10px 12px 10px 18px !important;
    border-radius: 12px;
    background:
      radial-gradient(circle at 20% 0%, rgba(167,139,250,.16), transparent 42%),
      linear-gradient(180deg, rgba(255,255,255,.07), rgba(255,255,255,.045));
  }
  .sb-shot-title {
    width: 100%;
    gap: 7px;
    overflow: hidden;
  }
  .sb-shot-main-row {
    display: grid !important;
    grid-template-columns: minmax(64px, .92fr) minmax(64px, .92fr) 46px;
    gap: 8px;
    width: min(100%, 360px);
  }
  .sb-shot-motion-row {
    display: flex !important;
    flex-wrap: nowrap;
    gap: 8px;
    align-items: center;
    width: 100%;
  }
  .sb-shot-title .num {
    font-size: 11px;
    padding: 3px 9px;
    min-height: 24px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
  }
  .sb-shot-tag {
    min-height: 24px;
    padding: 3px 8px;
    font-size: 11px;
    line-height: 1.25;
    min-width: 0;
    width: 100%;
    justify-content: center;
    text-align: center;
  }
  .sb-shot-tag.scene {
    max-width: none;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .sb-shot-tag.duration {
    min-width: 38px;
    text-align: center;
  }
  .sb-shot-tag.shot-size {
    width: auto;
    max-width: 42%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .sb-shot-tag.motion {
    display: inline-flex;
    align-items: center;
    min-width: 0;
    width: auto;
    max-width: calc(58% - 8px);
    flex: 1 1 auto;
    margin-top: 0;
    padding: 4px 10px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .sb-shot .sb-collapse-icon {
    width: 28px;
    height: 28px;
    margin-top: 0;
    position: static;
    align-self: start;
    justify-self: end;
  }
  .sb-shot-actions {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px !important;
    margin-top: 0 !important;
  }
  .sb-shot-actions > button {
    width: 100%;
    min-width: 0;
    justify-content: center;
    border-radius: 10px !important;
    padding: 0 10px !important;
    height: 32px !important;
    line-height: 1.1;
  }
  .sb-shot-quick-actions {
    gap: 9px !important;
    margin-top: 2px !important;
  }
  .sb-shot-quick-actions > .sb-shot-action-btn {
    height: 40px !important;
    border-radius: 13px !important;
    font-size: 13px !important;
    gap: 6px;
    box-shadow: inset 0 1px 0 rgba(255,255,255,.08), 0 8px 18px rgba(0,0,0,.16);
  }
  .sb-shot-quick-actions > .sb-shot-action-btn svg {
    width: 15px;
    height: 15px;
  }
  .sb-shot-actions > button:only-child {
    grid-column: 1 / -1;
  }
  .sb-shot-details .sb-shot-actions {
    grid-template-columns: 1fr;
  }

  /* 大图预览 */
  .preview-mask { padding: 0; }
  .preview-body { max-width: 100vw !important; max-height: 100vh; padding: 8px !important; }
  .preview-body img { max-height: 60vh; }
  .preview-info { padding: 12px 14px !important; font-size: 13px; }
  .preview-action { font-size: 12px; padding: 6px 10px; }
  .preview-close { top: 12px !important; right: 12px !important; }

  /* 上传区美化 */
  .ref-drop {
    padding: 0;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    overflow: hidden;
    border-radius: 14px;
    border: 1.5px dashed rgba(167,139,250,.25);
    background: rgba(139,92,246,.04);
    transition: border-color .2s, background .2s;
  }
  .ref-drop:hover {
    border-color: rgba(167,139,250,.45) !important;
    background: rgba(139,92,246,.08) !important;
  }
  .ref-drop > div {
    padding: 16px 10px !important;
    font-size: 12px !important;
    overflow: hidden;
    word-break: break-all;
  }

  /* 隐藏 hide-sm（已存在 920px 规则，这里冗余但保险） */
  .hide-sm { display: none !important; }

  /* 生成按钮增强 */
  .btn-primary {
    font-size: 15px;
    border-radius: 14px;
    height: 50px !important;
    font-weight: 600;
    letter-spacing: .5px;
  }

  /* 画质区域卡片化 */
  #imageMode .panel > div[style*="margin-top:14px"]:has(.quality-group) {
    background: rgba(255,255,255,.03);
    border: 1px solid rgba(255,255,255,.07);
    border-radius: 14px;
    padding: 14px 12px 12px;
  }

  /* 参考图上传区域卡片化 */
  #imageMode .panel > div[style*="margin-top:14px"]:has(.ref-drop) {
    background: rgba(255,255,255,.02);
    border: 1px solid rgba(255,255,255,.06);
    border-radius: 14px;
    padding: 14px 12px 12px;
  }

  /* 故事板列表项 */
  .sb-item { padding: 8px 10px; font-size: 13px; }

  /* 故事板模式底部按钮组：换行更整齐 */
  #storyboardContent > div > div[style*="margin-top:12px"] { gap: 6px !important; }
  #storyboardContent > div > div[style*="margin-top:12px"] > button {
    font-size: 12px !important;
    padding: 0 10px !important;
    height: 32px !important;
  }
  #storyboardContent .sb-shot-quick-actions > .sb-shot-action-btn {
    height: 40px !important;
    padding: 0 12px !important;
  }

  /* 最终提示词框最大高度 */
  #finalPromptBox {
    max-height: 360px !important;
    max-height: 42vh !important;
    overflow: hidden !important;
    padding: 10px !important;
    box-sizing: border-box !important;
  }
  #finalPromptBox > div:first-child {
    min-width: 0;
    gap: 8px;
  }
  #finalPromptBox > div:first-child span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  #finalPromptContent {
    display: block;
    max-height: 300px !important;
    max-height: calc(42vh - 52px) !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    -webkit-overflow-scrolling: touch;
    word-break: break-word !important;
    overflow-wrap: anywhere !important;
    white-space: pre-wrap !important;
    text-align: left !important;
    font-size: 11px !important;
    line-height: 1.58 !important;
    padding-right: 4px;
  }
}

/* 超窄屏（≤ 380px）极致压缩 */
@media (max-width: 380px) {
  .layout { padding: 4px 8px 24px; }
  .topbar { padding: 8px; }
  .stats-row {
    grid-template-columns: 32px minmax(82px, 1fr) minmax(54px, .72fr) 32px 50px;
    gap: 4px;
  }
  .stats-row .chip,
  .stats-row .btn-ghost { padding: 0 5px; font-size: 11px; }
  .stats-row .chip svg,
  .stats-row .btn-ghost svg { width: 12px; height: 12px; }
  .quality-btn .qb-sub { display: none; }
}

/* 浅色主题：提示词优化工具按钮文字必须保持可读 */
:root[data-app-theme="vale"] #promptMode .po-type-tools .po-mini-btn {
  color: #253044 !important;
  -webkit-text-fill-color: #253044 !important;
  background: #f3f7fb !important;
  border-color: #c2ccda !important;
  font-weight: 700 !important;
  opacity: 1 !important;
}
:root[data-app-theme="vale"] #promptMode .po-type-tools .po-mini-btn.po-strong {
  color: #0f172a !important;
  -webkit-text-fill-color: #0f172a !important;
  background: #e2eaf4 !important;
  border-color: #aebbcf !important;
  font-weight: 800 !important;
}
:root[data-app-theme="vale"] #promptMode .po-type-tools .po-mini-btn:hover,
:root[data-app-theme="vale"] #promptMode .po-type-tools .po-mini-btn.po-strong:hover {
  color: #0f172a !important;
  -webkit-text-fill-color: #0f172a !important;
  background: #d8e2ef !important;
  border-color: #93a4bc !important;
}
:root[data-app-theme="vale"] #promptMode .po-type-tools .po-mini-btn[disabled],
:root[data-app-theme="vale"] #promptMode .po-type-tools .po-mini-btn:disabled {
  color: #a8b3c2 !important;
  -webkit-text-fill-color: #a8b3c2 !important;
  background: #f5f8fb !important;
  border-color: #d5dde8 !important;
  opacity: 1 !important;
}
#reverseMode #reverseCopyZhBtn,
#reverseMode #reverseCopyEnBtn,
#reverseMode #reverseApplyZhBtn,
#reverseMode #reverseApplyEnBtn {
  color: #0f172a !important;
  -webkit-text-fill-color: #0f172a !important;
  background: rgba(226,232,240,.96) !important;
  border-color: rgba(148,163,184,.5) !important;
  background-image: none !important;
  opacity: 1 !important;
}
#reverseMode #reverseCopyZhBtn *,
#reverseMode #reverseCopyEnBtn *,
#reverseMode #reverseApplyZhBtn *,
#reverseMode #reverseApplyEnBtn *,
#reverseMode #reverseCopyZhBtn svg,
#reverseMode #reverseCopyEnBtn svg,
#reverseMode #reverseApplyZhBtn svg,
#reverseMode #reverseApplyEnBtn svg,
#reverseMode #reverseCopyZhBtn svg *,
#reverseMode #reverseCopyEnBtn svg *,
#reverseMode #reverseApplyZhBtn svg *,
#reverseMode #reverseApplyEnBtn svg * {
  color: #0f172a !important;
  stroke: #0f172a !important;
  fill: none !important;
  -webkit-text-fill-color: #0f172a !important;
  opacity: 1 !important;
}
:root[data-app-theme="original"] .sb-add-segment-btn,
:root[data-app-theme="daydream"] .sb-add-segment-btn,
:root[data-app-theme="original"] .sb-generation-mode-btn.active,
:root[data-app-theme="daydream"] .sb-generation-mode-btn.active,
:root[data-app-theme="original"] .image-edit-pill.active,
:root[data-app-theme="daydream"] .image-edit-pill.active,
:root[data-app-theme="original"] .image-edit-brush-btn.active,
:root[data-app-theme="daydream"] .image-edit-brush-btn.active {
  background: rgba(244,244,245,.96) !important;
  background-image: none !important;
  border-color: rgba(255,255,255,.72) !important;
  color: #111216 !important;
  -webkit-text-fill-color: #111216 !important;
  box-shadow: 0 10px 24px -18px rgba(255,255,255,.42) !important;
}
:root[data-app-theme="original"] .sb-add-segment-btn *,
:root[data-app-theme="daydream"] .sb-add-segment-btn *,
:root[data-app-theme="original"] .sb-generation-mode-btn.active *,
:root[data-app-theme="daydream"] .sb-generation-mode-btn.active *,
:root[data-app-theme="original"] .image-edit-pill.active *,
:root[data-app-theme="daydream"] .image-edit-pill.active *,
:root[data-app-theme="original"] .image-edit-brush-btn.active *,
:root[data-app-theme="daydream"] .image-edit-brush-btn.active *,
:root[data-app-theme="original"] .sb-add-segment-btn svg,
:root[data-app-theme="daydream"] .sb-add-segment-btn svg,
:root[data-app-theme="original"] .sb-generation-mode-btn.active svg,
:root[data-app-theme="daydream"] .sb-generation-mode-btn.active svg,
:root[data-app-theme="original"] .image-edit-pill.active svg,
:root[data-app-theme="daydream"] .image-edit-pill.active svg,
:root[data-app-theme="original"] .image-edit-brush-btn.active svg,
:root[data-app-theme="daydream"] .image-edit-brush-btn.active svg {
  color: #111216 !important;
  stroke: #111216 !important;
  -webkit-text-fill-color: #111216 !important;
}
:root[data-app-theme="original"] #imageMode #iconWand,
:root[data-app-theme="daydream"] #imageMode #iconWand,
:root[data-app-theme="original"] #storyMode #iconStoryPanel,
:root[data-app-theme="daydream"] #storyMode #iconStoryPanel {
  background: rgba(244,244,245,.96) !important;
  border-color: rgba(255,255,255,.68) !important;
  color: #111216 !important;
  box-shadow: 0 10px 24px -18px rgba(255,255,255,.38) !important;
}
:root[data-app-theme="original"] #imageMode #iconWand svg,
:root[data-app-theme="daydream"] #imageMode #iconWand svg,
:root[data-app-theme="original"] #storyMode #iconStoryPanel svg,
:root[data-app-theme="daydream"] #storyMode #iconStoryPanel svg,
:root[data-app-theme="original"] #imageMode #iconWand svg *,
:root[data-app-theme="daydream"] #imageMode #iconWand svg *,
:root[data-app-theme="original"] #storyMode #iconStoryPanel svg *,
:root[data-app-theme="daydream"] #storyMode #iconStoryPanel svg * {
  color: #111216 !important;
  stroke: #111216 !important;
}
:root[data-app-theme="original"] #videoReverseChooseBtn,
:root[data-app-theme="daydream"] #videoReverseChooseBtn,
:root[data-app-theme="original"] #videoReverseChooseBtn *,
:root[data-app-theme="daydream"] #videoReverseChooseBtn * {
  color: #111216 !important;
  -webkit-text-fill-color: #111216 !important;
}
:root[data-app-theme="original"] #videoReverseChooseBtn svg,
:root[data-app-theme="daydream"] #videoReverseChooseBtn svg,
:root[data-app-theme="original"] #videoReverseChooseBtn svg *,
:root[data-app-theme="daydream"] #videoReverseChooseBtn svg * {
  stroke: #111216 !important;
  color: #111216 !important;
}
