.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.65rem 1.15rem;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, transform 0.1s;
}

.btn:active:not(:disabled) {
  transform: scale(0.98);
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-primary {
  background: linear-gradient(180deg, #e4bc6a, var(--accent));
  color: #1c1508;
  border-color: rgba(255, 255, 255, 0.12);
  box-shadow: 0 4px 16px rgba(212, 168, 83, 0.25);
}

.btn-primary:hover:not(:disabled) {
  filter: brightness(1.05);
}

.btn-secondary {
  background: var(--surface);
  color: var(--text);
  border-color: var(--border);
}

.btn-secondary:hover:not(:disabled) {
  background: var(--surface-hover);
}

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
  border-color: var(--border);
}

.btn-ghost:hover:not(:disabled) {
  color: var(--text);
  background: var(--surface);
}

.btn-sm {
  padding: 0.35rem 0.65rem;
  font-size: 0.75rem;
}

.btn.is-loading .btn-text {
  opacity: 0.5;
}

.btn.is-loading .btn-loader {
  display: block;
  width: 1rem;
  height: 1rem;
  border: 2px solid rgba(28, 21, 8, 0.25);
  border-top-color: #1c1508;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

.btn-secondary.is-loading .btn-loader,
.btn-ghost.is-loading .btn-loader {
  border-color: rgba(255, 255, 255, 0.15);
  border-top-color: var(--accent);
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 1rem 1.1rem;
  margin-bottom: 0.75rem;
}

.card:last-child {
  margin-bottom: 0;
}

.card-title {
  margin: 0 0 0.5rem;
  font-size: 0.9375rem;
  font-weight: 600;
}

.card-meta {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.card-body {
  font-size: 0.875rem;
  line-height: 1.55;
  color: var(--text-muted);
}

.card-body strong {
  color: var(--text);
  font-weight: 600;
}

.tag {
  display: inline-block;
  padding: 0.2rem 0.45rem;
  border-radius: 4px;
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: var(--accent-dim);
  color: var(--accent);
  margin-right: 0.35rem;
}

.prompt-block {
  margin-top: 0.65rem;
}

.prompt-label {
  font-size: 0.6875rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 0.35rem;
}

.prompt-text {
  font-family: var(--mono);
  font-size: 0.75rem;
  line-height: 1.5;
  color: var(--text);
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.55rem 0.65rem;
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
}

.prompt-actions {
  margin-top: 0.45rem;
  display: flex;
  gap: 0.35rem;
  flex-wrap: wrap;
}

.palette {
  display: flex;
  gap: 0.35rem;
  flex-wrap: wrap;
  margin-top: 0.5rem;
}

.swatch {
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 4px;
  border: 1px solid var(--border);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.2);
}

.section-title {
  margin: 0 0 0.75rem;
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--accent);
}

.timeline {
  position: relative;
  padding-left: 0.5rem;
}

.shot-card {
  position: relative;
  padding-left: 1.25rem;
  margin-bottom: 1rem;
  border-left: 2px solid var(--border);
  padding-bottom: 0.25rem;
}

.shot-card:last-child {
  margin-bottom: 0;
}

.shot-card::before {
  content: "";
  position: absolute;
  left: -5px;
  top: 0.35rem;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-dim);
}

.shot-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.5rem 0.75rem;
  margin-bottom: 0.5rem;
}

.shot-num {
  font-weight: 700;
  font-size: 0.9375rem;
}

.shot-time {
  font-size: 0.8125rem;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

.stats-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.75rem;
  font-size: 0.8125rem;
  color: var(--text-muted);
}

.stats-row span {
  padding: 0.25rem 0.5rem;
  background: rgba(0, 0, 0, 0.25);
  border-radius: 6px;
  border: 1px solid var(--border);
}

/* 剧本自检未通过：弹层 */
.script-val-backdrop {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: rgba(10, 8, 6, 0.72);
  backdrop-filter: blur(4px);
}

.script-val-backdrop.is-hidden {
  display: none;
}

/* 分镜校验弹窗内点「重新生成」后：全屏加载（z 低于校验弹窗，避免与弹窗叠两层） */
.storyboard-regen-loading {
  position: fixed;
  inset: 0;
  z-index: 115;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: rgba(10, 8, 6, 0.55);
  backdrop-filter: blur(3px);
}

.storyboard-regen-loading.is-hidden {
  display: none;
}

.storyboard-regen-loading-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  padding: 1.75rem 2rem;
  border-radius: var(--radius-md, 12px);
  border: 1px solid var(--border);
  background: var(--bg-elevated, #1a1714);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
}

.storyboard-regen-spinner {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  border: 3px solid var(--border);
  border-top-color: var(--accent, #c9a227);
  animation: storyboard-regen-spin 0.85s linear infinite;
}

@keyframes storyboard-regen-spin {
  to {
    transform: rotate(360deg);
  }
}

.storyboard-regen-loading-text {
  margin: 0;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.script-val-dialog {
  width: min(32rem, 100%);
  max-height: min(90vh, 36rem);
  overflow: auto;
  padding: 1.25rem 1.35rem;
  border-radius: var(--radius-md, 12px);
  border: 1px solid var(--border);
  background: var(--bg-elevated, #1a1714);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.45);
}

.script-val-title {
  margin: 0 0 0.5rem;
  font-size: 1.05rem;
}

.script-val-lead {
  margin: 0 0 0.85rem;
  font-size: 0.8125rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.script-val-lead--patch {
  margin-top: -0.25rem;
  padding: 0.55rem 0.65rem;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(201, 162, 39, 0.35);
  background: rgba(201, 162, 39, 0.08);
  font-size: 0.78rem;
}

.script-val-issues {
  margin: 0 0 1rem;
  padding-left: 1.15rem;
  font-size: 0.8125rem;
  line-height: 1.55;
  color: var(--text);
}

.script-val-issues li {
  margin-bottom: 0.4rem;
}

.script-val-issues .is-warn {
  color: var(--text-muted);
}

.script-val-label {
  display: block;
  font-size: 0.8125rem;
  font-weight: 600;
  margin-bottom: 0.35rem;
}

.script-val-notes {
  width: 100%;
  box-sizing: border-box;
  margin-bottom: 1rem;
  padding: 0.6rem 0.65rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-family: inherit;
  font-size: 0.8125rem;
  resize: vertical;
  min-height: 5rem;
}

.script-val-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: flex-end;
}
