/* ========== video-replication 专属样式 ========== */

.topbar {
  position: fixed; top: 0; left: 0; right: 0; height: 48px;
  display: flex; align-items: center; padding: 0 16px 0 20px; z-index: 200;
  background: rgba(0,0,0,0.85);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  gap: 16px;
}
.topbar .back { font-size: 14px; color: #7c4dff; text-decoration: none; flex-shrink: 0; }
.topbar .title { font-size: 14px; font-weight: 600; color: #f5f5f7; flex-shrink: 0; }
.topbar .right { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.credits-badge { font-size: 12px; color: #ffd60a; background: #1a1505; padding: 3px 10px; border-radius: 8px; }

.page {
  max-width: 1180px; margin: 0 auto;
  padding: 72px 20px 80px;
}

.input {
  background: #1d1d1f; color: #f5f5f7; border: 1px solid #38383a;
  border-radius: 10px; padding: 9px 14px; font-size: 13px; font-family: inherit;
  outline: none; transition: border .15s;
}
.input:focus { border-color: #7c4dff; }

.btn {
  background: #1d1d1f; color: #f5f5f7; border: 1px solid #38383a;
  padding: 9px 18px; border-radius: 10px; font-size: 13px; cursor: pointer;
  font-family: inherit; transition: all .15s;
}
.btn:hover:not(:disabled) { background: #2d2d2f; }
.btn:disabled { opacity: .4; cursor: not-allowed; }
.btn-primary { background: #7c4dff; border-color: #7c4dff; color: #fff; font-weight: 500; }
.btn-primary:hover:not(:disabled) { background: #0a84ff; }
.btn-ghost { background: transparent; border-color: #38383a; color: #86868b; }

.pill {
  background: #1d1d1f; border: 1px solid #38383a; color: #86868b;
  padding: 4px 10px; border-radius: 999px; font-size: 12px;
  cursor: pointer; font-family: inherit;
}
.pill:hover { color: #f5f5f7; }

/* -- 上传卡片 -- */
.upload-card {
  background: #1d1d1f; border: 1px solid #38383a; border-radius: 16px;
  padding: 26px 28px;
}
.upload-card h2 { font-size: 20px; font-weight: 600; color: #f5f5f7; margin: 0 0 6px; letter-spacing: -0.2px; }
.upload-sub { font-size: 13px; color: #86868b; margin: 0 0 18px; line-height: 1.65; }
.upload-sub code { background: #2c2c2e; color: #a5a5ff; padding: 1px 6px; border-radius: 4px; font-size: 11px; font-family: 'SF Mono', monospace; }

.upload-drop {
  border: 2px dashed #48484a; border-radius: 14px; padding: 32px 20px;
  text-align: center; cursor: pointer; transition: all .2s;
  background: #141416;
}
.upload-drop:hover, .upload-drop.dragover {
  border-color: #7c4dff; background: #0d1a2a;
}
.drop-icon { font-size: 36px; margin-bottom: 8px; }
.drop-text { font-size: 15px; color: #f5f5f7; font-weight: 500; }
.drop-hint { font-size: 11px; color: #6e6e73; margin-top: 6px; }

/* 限制条 */
.limits-bar {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 10px; margin-top: 14px;
}
.limit-item {
  background: #141416; border: 1px solid #2c2c2e; border-radius: 10px;
  padding: 10px 14px; display: flex; flex-direction: column; gap: 2px;
}
.limit-item .limit-label {
  font-size: 11px; color: #6e6e73; text-transform: uppercase; letter-spacing: 0.5px; font-weight: 600;
}
.limit-item .limit-val { font-size: 14px; color: #ffcc66; font-weight: 600; }
.limit-item .limit-note { font-size: 10px; color: #86868b; margin-top: 2px; line-height: 1.4; }

/* -- 进度 -- */
.progress-step {
  display: flex; align-items: center; gap: 10px; padding: 8px 0;
  font-size: 13px; color: #86868b;
}
.progress-step .icon {
  width: 20px; height: 20px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; font-size: 11px;
}
.progress-step.doing .icon { background: #7c4dff; color: #fff; }
.progress-step.done .icon { background: #30d158; color: #fff; }
.progress-step.pending .icon { background: #2c2c2e; color: #6e6e73; }
.progress-step.fail .icon { background: #ff453a; color: #fff; }
.progress-step.doing { color: #f5f5f7; font-weight: 500; }

.spinner-mini {
  width: 14px; height: 14px; border: 2px solid #38383a; border-top-color: #7c4dff;
  border-radius: 50%; animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* -- 结果区 -- */
#resultArea { margin-top: 28px; }
.result-section {
  background: #1d1d1f; border: 1px solid #38383a; border-radius: 14px;
  padding: 22px 24px; margin-bottom: 18px;
}
.result-section h3 {
  font-size: 16px; font-weight: 600; color: #f5f5f7; margin: 0 0 14px;
  display: flex; align-items: center; gap: 8px;
}
.result-section h3 .count {
  font-size: 12px; color: #86868b; font-weight: 400;
  background: #2c2c2e; padding: 2px 10px; border-radius: 999px;
}
.result-section .sub { font-size: 12px; color: #86868b; margin: -8px 0 14px; }

/* -- 资产卡（人物/场景）-- */
.asset-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
}
.asset-card {
  background: #141416; border: 1px solid #2c2c2e; border-radius: 12px;
  padding: 14px; transition: all .15s; cursor: pointer;
}
.asset-card:hover { border-color: #7c4dff; transform: translateY(-2px); }
.asset-card .id {
  display: inline-block; background: #5e5ce6; color: #fff;
  padding: 1px 8px; border-radius: 6px; font-size: 10px; font-weight: 600;
  font-family: 'SF Mono', monospace; letter-spacing: 0.3px;
}
.asset-card .name { font-size: 14px; font-weight: 600; color: #f5f5f7; margin: 6px 0 4px; }
.asset-card .desc { font-size: 11px; color: #86868b; line-height: 1.5; margin-bottom: 8px; }
.asset-card .mj-prompt {
  background: #0a0a0c; border: 1px solid #2c2c2e; border-radius: 6px;
  padding: 8px; font-size: 10px; color: #a5a5ff; font-family: 'SF Mono', monospace;
  max-height: 60px; overflow: hidden; text-overflow: ellipsis;
  line-height: 1.4;
}

/* -- 分镜条目 -- */
.shots-list { display: flex; flex-direction: column; gap: 10px; }
.shot-item {
  background: #141416; border: 1px solid #2c2c2e; border-radius: 10px;
  padding: 14px 16px;
}
.shot-head {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 8px;
}
.shot-head .idx {
  background: #7c4dff; color: #fff; padding: 2px 8px; border-radius: 6px;
  font-size: 11px; font-weight: 600; font-family: 'SF Mono', monospace;
}
.shot-head .time, .shot-head .dur, .shot-head .size, .shot-head .cam {
  font-size: 11px; color: #86868b; background: #2c2c2e;
  padding: 2px 8px; border-radius: 6px;
}
.shot-head .purpose { font-size: 11px; color: #ffb84d; }
.shot-desc {
  font-size: 13px; color: #f5f5f7; line-height: 1.7; margin: 6px 0;
}
.shot-desc .ref-badge {
  display: inline-block; background: #5e5ce6; color: #fff;
  padding: 1px 7px; border-radius: 5px; font-size: 11px; margin: 0 2px;
  font-family: 'SF Mono', monospace; cursor: pointer;
  transition: all .15s;
}
.shot-desc .ref-badge.scene { background: #30d158; }
.shot-desc .ref-badge:hover { transform: scale(1.08); }
.shot-dialogue { font-size: 12px; color: #ffcc66; margin: 6px 0; font-style: italic; }
.shot-sound {
  font-size: 11px; color: #86868b; margin: 4px 0;
  background: #0a0a0c; border-left: 2px solid #5e5ce6;
  padding: 4px 10px; border-radius: 0 6px 6px 0;
}
.shot-prompt-label {
  font-size: 11px; color: #6e6e73; margin: 10px 0 4px; text-transform: uppercase;
  letter-spacing: 0.5px; font-weight: 600; display: flex; justify-content: space-between;
}
.shot-prompt {
  background: #0a0a0c; border: 1px solid #2c2c2e; border-radius: 6px;
  padding: 8px 10px; font-size: 11px; color: #a5a5ff;
  font-family: 'SF Mono', monospace; line-height: 1.55; word-break: break-word;
}

/* -- 历史记录卡 -- */
.list-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 14px;
}
.history-card {
  background: #1d1d1f; border: 1px solid #38383a; border-radius: 14px;
  padding: 16px 18px; cursor: pointer; transition: all .15s;
}
.history-card:hover { border-color: #7c4dff; transform: translateY(-2px); }
.history-card .h-title { font-size: 14px; font-weight: 600; color: #f5f5f7; margin-bottom: 6px; }
.history-card .h-meta { font-size: 11px; color: #86868b; margin-bottom: 8px; }
.history-card .h-stats {
  display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px;
}
.history-card .h-stats span {
  font-size: 10px; color: #86868b; background: #2c2c2e;
  padding: 2px 8px; border-radius: 999px;
}
.history-card .h-distilled {
  background: #30d15822; color: #30d158 !important;
}

.empty-msg { color: #86868b; text-align: center; padding: 36px 20px; font-size: 13px; }
.loading-msg { color: #86868b; text-align: center; padding: 20px; font-size: 13px; }

/* -- 资产弹窗 -- */
.asset-modal {
  display: none; position: fixed; top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.8); backdrop-filter: blur(10px);
  z-index: 500; align-items: center; justify-content: center;
}
.asset-modal.active { display: flex; }
.asset-modal-body {
  background: #1d1d1f; border: 1px solid #38383a; border-radius: 16px;
  max-width: 620px; width: 92vw; max-height: 80vh; overflow-y: auto;
  padding: 24px 28px; position: relative;
}
.asset-modal-close {
  position: absolute; top: 10px; right: 12px; background: none; border: none;
  color: #86868b; font-size: 26px; cursor: pointer; padding: 4px;
}
.asset-modal-close:hover { color: #f5f5f7; }

/* 按钮 */
.section { margin-top: 16px; }

.action-bar {
  display: flex; gap: 10px; margin-top: 16px; flex-wrap: wrap;
  padding-top: 16px; border-top: 1px solid #2c2c2e;
}

/* -- 编辑态 -- */
.shot-item.editing {
  border-color: #ffb84d;
  background: #1a1510;
}
.shot-item.editing .shot-head .idx {
  background: #ffb84d; color: #000;
}
.edit-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 10px; margin: 12px 0;
}
.edit-grid label, .edit-label-row {
  display: flex; flex-direction: column; gap: 4px; font-size: 11px;
  color: #86868b; font-weight: 500;
}
.edit-label-row { margin: 10px 0; }
.edit-grid .input, .edit-label-row .input {
  font-size: 13px; padding: 8px 12px;
}
.edit-label-row textarea.input {
  resize: vertical; font-family: inherit; line-height: 1.55;
}

@media (max-width: 600px) {
  .page { padding: 60px 12px 60px; }
  .upload-card, .result-section { padding: 16px; }
  .asset-grid { grid-template-columns: 1fr; }
  .edit-grid { grid-template-columns: 1fr 1fr; }
}
