/* 转场和色板系统样式 */

.shot-transition-palette-panel {
  margin-top: 20px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fafbfa;
}

.transition-desc {
  margin-top: 8px;
  padding: 10px 12px;
  border-radius: 7px;
  background: rgba(44, 130, 115, 0.08);
  color: var(--ink-soft);
  font-size: 11px;
  line-height: 1.6;
}

.transition-endframe-control {
  margin-top: 16px;
  padding: 14px;
  border: 1px solid #d4e5df;
  border-radius: 8px;
  background: #fff;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
  width: 18px;
  height: 18px;
  cursor: pointer;
}

.checkbox-label span {
  font-size: 12px;
  font-weight: 600;
  color: var(--ink);
}

.endframe-preview {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.endframe-preview small {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.endframe-thumbnail {
  width: 100%;
  max-width: 280px;
  height: 160px;
  display: grid;
  place-items: center;
  margin-bottom: 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #f8faf9;
  color: var(--muted);
  font-size: 11px;
  overflow: hidden;
}

.endframe-thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.palette-controls {
  margin-top: 16px;
  padding: 14px;
  border: 1px solid #d4e5df;
  border-radius: 8px;
  background: #fff;
}

.palette-controls .field-label {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.palette-controls input[type="range"] {
  width: 100%;
  height: 6px;
  border-radius: 3px;
  background: linear-gradient(to right, #e2e7e1 0%, var(--teal) 100%);
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
}

.palette-controls input[type="range"]::-webkit-slider-thumb {
  width: 18px;
  height: 18px;
  border: 2px solid #fff;
  border-radius: 50%;
  background: var(--teal);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
}

.palette-controls input[type="range"]::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border: 2px solid #fff;
  border-radius: 50%;
  background: var(--teal);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
  cursor: pointer;
}

#paletteStrengthValue {
  margin-left: auto;
  color: var(--teal);
  font-weight: 700;
  font-size: 13px;
  font-family: var(--mono);
}

.palette-actions {
  margin-top: 14px;
}

.palette-source-preview {
  margin-top: 12px;
  max-width: 400px;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: #f8faf9;
}

.palette-source-preview img {
  width: 100%;
  height: auto;
  display: block;
}

.muted {
  color: var(--muted);
  font-size: 10px;
}

/* 动画效果 */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.endframe-preview,
.palette-controls {
  animation: fadeIn 0.3s ease-out;
}

/* 响应式调整 */
@media (max-width: 768px) {
  .shot-transition-palette-panel {
    padding: 14px;
  }

  .endframe-thumbnail {
    max-width: 100%;
    height: 140px;
  }

  .transition-desc {
    font-size: 10px;
  }
}

/* ========= 情绪弧线 UI ========= */

.segment-emotion-row {
  margin-top: 12px;
  padding: 12px;
  border: 1px solid #d9dcea;
  border-radius: 8px;
  background: #f8f8fc;
}

.segment-emotion-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 10px;
  padding: 4px 12px;
  border-radius: 20px;
  background: #2f3563;
  color: #f1f2fa;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.segment-emotion-badge.muted {
  background: #e3e8e6;
  color: #7d8a86;
}

.segment-emotion-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0 14px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.segment-emotion-toolbar .section-kicker {
  color: #4a539c;
}

.segment-emotion-toolbar small.muted {
  color: var(--muted);
  font-size: 10px;
  flex-basis: 100%;
}

.segment-intensity-label {
  margin-left: auto;
  color: #4a539c;
  font-weight: 700;
  font-size: 13px;
  font-family: var(--mono);
}

.segment-intensity-slider {
  width: 100%;
  height: 6px;
  border-radius: 3px;
  background: linear-gradient(to right, #dde0f0, #4f5bd5);
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
  margin-top: 6px;
}

.segment-intensity-slider::-webkit-slider-thumb {
  width: 18px;
  height: 18px;
  border: 2px solid #fff;
  border-radius: 50%;
  background: #4652c4;
  box-shadow: 0 2px 6px rgba(0,0,0,0.15);
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
}

.segment-intensity-slider::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border: 2px solid #fff;
  border-radius: 50%;
  background: #4652c4;
  box-shadow: 0 2px 6px rgba(0,0,0,0.15);
  cursor: pointer;
}

.segment-row-head {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  justify-content: space-between;
  margin-bottom: 10px;
}

.segment-row-head .field-label {
  flex: 1;
  margin-bottom: 0;
}

/* ========= V2 资产树 ========= */
.v2-asset-grid { display: block; }
.v2-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.v2-toolbar strong { display: block; font-size: 15px; }
.v2-toolbar small { color: var(--muted); font-size: 11px; }

.v2-entity { border: 1px solid var(--line); border-radius: 12px; background: var(--surface); box-shadow: var(--shadow); margin-bottom: 14px; overflow: hidden; }
.v2-entity-head { display: grid; grid-template-columns: 72px minmax(0,1fr) auto; gap: 14px; align-items: center; padding: 12px 14px; cursor: pointer; }
.v2-entity-head:hover { background: #fafbfa; }
.v2-entity-cover .v2-thumb { width: 72px; height: 96px; border-radius: 8px; object-fit: cover; }
.v2-entity-cover .v2-thumb-empty { width: 72px; height: 96px; }
.v2-entity-title { display: flex; align-items: center; gap: 8px; }
.v2-entity-title strong { font-size: 15px; cursor: text; border-bottom: 1px dashed transparent; }
.v2-entity-title strong:hover { border-bottom-color: var(--teal); }
.v2-kind { padding: 2px 8px; border-radius: 12px; background: var(--teal-soft); color: var(--teal); font-size: 10px; font-weight: 700; }
.v2-entity-copy small { color: var(--muted); font-size: 11px; }
.v2-entity-actions { display: flex; align-items: center; gap: 6px; }
.v2-chevron { width: 18px; color: var(--muted); }
.v2-tree { padding: 6px 14px 16px; border-top: 1px solid var(--line); background: #fbfcfb; }
.v2-empty-tree { display: grid; place-items: center; gap: 10px; padding: 28px 12px; text-align: center; color: var(--ink-soft); }
.v2-empty-tree i { width: 28px; height: 28px; color: var(--muted); }
.v2-empty-tree p { max-width: 460px; font-size: 12px; line-height: 1.7; }

.v2-node { margin-top: 12px; padding: 12px; border: 1px solid var(--line); border-left: 3px solid var(--line); border-radius: 10px; background: #fff; }
.v2-node.is-base { border-left-color: var(--teal); }
.v2-node-approved { border-left-color: #3f9b6e; }
.v2-node-review { border-left-color: var(--yellow); }
.v2-node-rejected { border-left-color: var(--coral); }
.v2-node-generating { border-left-color: #8fa8c8; }
.v2-children { margin-left: 22px; padding-left: 12px; border-left: 2px dashed #dbe3de; }
.v2-node-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; margin-bottom: 10px; }
.v2-node-label { font-size: 14px; cursor: text; }
.v2-node-head small { display: block; color: var(--muted); font-size: 10px; margin-top: 2px; }
.v2-status { padding: 3px 9px; border-radius: 12px; font-size: 10px; font-weight: 700; white-space: nowrap; }
.v2-status-draft { background: #eef1ef; color: #6b7671; }
.v2-status-generating { background: #e6eef8; color: #3f6aa3; animation: v2pulse 1.4s ease-in-out infinite; }
.v2-status-review { background: var(--yellow-soft); color: #9a6b12; }
.v2-status-approved { background: #e3f3ea; color: #2d7a52; }
.v2-status-rejected { background: var(--coral-soft); color: #b4452c; }
@keyframes v2pulse { 0%,100% { opacity: 1 } 50% { opacity: .55 } }

.v2-node-media { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); gap: 12px; }
.v2-node-media.has-spatial-views { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.v2-node-media figure { margin: 0; }
.v2-node-media figcaption { margin-top: 6px; color: var(--muted); font-size: 10px; }
.v2-thumb { width: 100%; max-height: 300px; object-fit: contain; border-radius: 8px; background: #f0f2f0; cursor: zoom-in; display: block; }
.v2-thumb-tall { max-height: 300px; }
.v2-thumb-empty { display: grid; place-items: center; min-height: 160px; border: 1px dashed #d6ddd8; border-radius: 8px; color: var(--muted); font-size: 11px; background: #f7f9f8; cursor: default; }
.v2-node-note, .v2-node-review { margin: 10px 0 0; font-size: 11px; line-height: 1.6; color: var(--ink-soft); }
.v2-node-review { padding: 8px 10px; border-radius: 6px; background: var(--coral-soft); color: #7d3620; }
.v2-node-approved .v2-node-review { background: #f2f6f3; color: var(--ink-soft); }
.v2-prompt { margin-top: 10px; font-size: 11px; }
.v2-prompt summary { cursor: pointer; color: var(--teal); font-weight: 600; }
.v2-prompt pre { margin: 6px 0 0; padding: 10px; border-radius: 6px; background: #f6f8f7; white-space: pre-wrap; word-break: break-word; font-family: var(--mono); font-size: 10.5px; line-height: 1.6; color: var(--ink-soft); max-height: 240px; overflow: auto; }
.v2-node-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--line); }
.v2-danger-quiet { margin-left: auto; color: #a45; }
.v2-danger-quiet:hover { background: var(--coral-soft); }

.v2-source-tabs { display: flex; gap: 14px; padding: 8px 0 12px; border-bottom: 1px solid var(--line); margin-bottom: 12px; font-size: 12px; }
.v2-source-tabs label { display: flex; align-items: center; gap: 6px; cursor: pointer; }
.v2-fork-parent { display: grid; grid-template-columns: 96px minmax(0,1fr); gap: 12px; align-items: center; padding: 10px; border: 1px solid var(--line); border-radius: 8px; background: #fafbfa; margin-bottom: 12px; }
.v2-fork-parent .v2-thumb { width: 96px; height: 128px; object-fit: cover; }
.v2-fork-parent .v2-thumb-empty { width: 96px; height: 128px; min-height: 0; }
.v2-fork-parent strong { display: block; font-size: 13px; }
.v2-fork-parent small { color: var(--muted); font-size: 11px; line-height: 1.6; }
.v2-template-instruction { margin: -4px 0 10px; font-size: 11px; line-height: 1.6; }
.v2-check { display: flex; align-items: center; gap: 8px; font-size: 12px; margin: 6px 0 4px; cursor: pointer; }
.v2-lightbox { display: grid; place-items: center; max-height: 78vh; }
.v2-lightbox img { max-width: 100%; max-height: 78vh; object-fit: contain; border-radius: 8px; }

@media (max-width: 768px) {
  .v2-node-media, .v2-node-media.has-spatial-views { grid-template-columns: 1fr; }
  .v2-entity-head { grid-template-columns: 56px minmax(0,1fr) auto; }
  .v2-entity-cover .v2-thumb, .v2-entity-cover .v2-thumb-empty { width: 56px; height: 74px; }
  .v2-children { margin-left: 10px; padding-left: 8px; }
}

/* ========= V2 项目卡片 ========= */
#projectGrid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 16px;
  align-items: start;
}
.pcv2 {
  display: flex; flex-direction: column; gap: 0;
  border: 1px solid var(--line); border-radius: 14px;
  background: var(--surface); box-shadow: var(--shadow);
  cursor: pointer; text-align: left;
  transition: box-shadow .15s, transform .15s;
}
.pcv2:hover { box-shadow: 0 18px 44px rgba(20,36,31,.11); transform: translateY(-2px); }
.pcv2-active { border-color: var(--teal); box-shadow: 0 0 0 2px rgba(44,130,115,.25), var(--shadow); }

.pcv2-head { display: grid; grid-template-columns: 64px minmax(0,1fr) auto; gap: 10px; align-items: center; padding: 14px 14px 10px; }
.pcv2-cover { width: 64px; height: 80px; border-radius: 8px; display: grid; place-items: center; overflow: hidden; }
.pcv2-cover span { font-size: 9px; font-weight: 800; letter-spacing: .04em; color: rgba(255,255,255,.85); text-align: center; padding: 0 4px; }
.pcv2-meta strong { display: block; font-size: 14px; line-height: 1.3; margin-bottom: 2px; }
.pcv2-meta small { color: var(--muted); font-size: 11px; }
.pcv2-badge { display: inline-flex; align-items: center; gap: 4px; padding: 3px 8px; border-radius: 12px; background: var(--teal-soft); color: var(--teal); font-size: 10px; font-weight: 700; white-space: nowrap; }
.pcv2-badge i { width: 11px; }

.pcv2-prog { display: flex; align-items: center; gap: 8px; padding: 0 14px 8px; }
.pcv2-bar { flex: 1; height: 5px; border-radius: 3px; background: #e3e8e6; overflow: hidden; }
.pcv2-bar span { display: block; height: 100%; border-radius: 3px; transition: width .4s ease; }
.pcv2-pct { font-size: 11px; font-family: var(--mono); color: var(--ink-soft); white-space: nowrap; }

.pcv2-stage-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 0 14px 8px; }
.pcv2-pips { display: flex; gap: 4px; }
.pcv2-pip { width: 8px; height: 8px; border-radius: 50%; background: #dbe0de; }
.pcv2-pip.done { background: var(--teal); }
.pcv2-pip.active { background: #e2ab35; box-shadow: 0 0 0 3px rgba(226,171,53,.25); }
.pcv2-pip.active.partial { background: rgba(236,190,80,.6); }
.pcv2-stage-label { display: flex; align-items: center; gap: 5px; font-size: 11px; font-weight: 700; color: var(--ink-soft); }
.pcv2-stage-label i { width: 13px; }

.pcv2-hint { margin: 0; padding: 0 14px 10px; font-size: 11px; color: var(--muted); line-height: 1.5; }
.pcv2-hint b { color: var(--ink-soft); }

.pcv2-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 14px 12px; border-top: 1px solid var(--line); font-size: 11px; color: var(--muted); }
.pcv2-action { color: var(--teal); font-weight: 700; white-space: nowrap; }

.pcv2-add {
  border: 2px dashed #c9d3cf; border-radius: 14px;
  background: transparent; min-height: 120px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  color: var(--muted); cursor: pointer; transition: border-color .15s, color .15s;
}
.pcv2-add:hover { border-color: var(--teal); color: var(--teal); }
.pcv2-add i { width: 22px; height: 22px; }
.pcv2-add span { font-size: 14px; font-weight: 700; }
.pcv2-add small { font-size: 11px; }

@media (max-width: 768px) {
  #projectGrid { grid-template-columns: 1fr; }
  .pcv2-head { grid-template-columns: 52px minmax(0,1fr) auto; }
  .pcv2-cover { width: 52px; height: 66px; }
}

/* ========= 基础版本 · 上传参考图 AI 分析 ========= */
.v2-analyze-bar { display: flex; gap: 12px; align-items: flex-start; }
.v2-analyze-tools { flex: 0 0 200px; display: flex; flex-direction: column; gap: 8px; padding-top: 22px; }
.v2-analyze-upload-btn {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  padding: 9px 10px; border: 1px dashed #b9c9c2; border-radius: 8px;
  background: #f7faf8; color: var(--teal); font-size: 11px; font-weight: 700; cursor: pointer;
  transition: border-color .15s, background .15s;
}
.v2-analyze-upload-btn:hover { border-color: var(--teal); background: var(--teal-soft); }
.v2-analyze-upload-btn i { width: 14px; height: 14px; }
.v2-analyze-hint { font-size: 10px; line-height: 1.5; }
.v2-analyze-preview { position: relative; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: #f0f2f0; }
.v2-analyze-preview img { display: block; width: 100%; max-height: 180px; object-fit: contain; }
.v2-analyze-preview .v2-danger-quiet { position: absolute; top: 4px; right: 4px; margin: 0; padding: 2px 6px; background: rgba(255,255,255,.9); }
#v2AnalyzeBtn { width: 100%; justify-content: center; }
@media (max-width: 768px) {
  .v2-analyze-bar { flex-direction: column; }
  .v2-analyze-tools { flex: none; width: 100%; padding-top: 0; }
}
/* hidden 属性必须压过 .btn 的 display:inline-flex */
#v2AnalyzeBtn[hidden], .v2-analyze-preview[hidden] { display: none !important; }
