/* ==========================================================================
   AI 导演 · 温暖电影感美学系统 (Warm Cinematic Studio · 夏日来信风格)
   100% 还原用户指定视觉设计图 (01项目首页 / 02剧本编辑 / 04分镜编排 / 05视频剪辑)
   ========================================================================== */
:root {
  /* 基础底色：暖米白纸张质感、高级柔和雅致、通透自然 */
  --bg-page: #f6f5f3;
  --bg-card: #ffffff;
  --bg-subtle: #fcfbf9;
  --bg-tag: #f2efe9;
  --bg-input: #ffffff;

  /* 核心主题色：温柔明丽珊瑚粉 (Warm Coral / Sunset Pink) */
  --coral: #f43f5e;
  --coral-hover: #e11d48;
  --coral-light: #fff1f2;
  --coral-border: #fecdd3;

  /* 辅助电影调色 */
  --ocean-blue: #0284c7;
  --ocean-blue-light: #f0f9ff;
  --ocean-blue-border: #bae6fd;

  --sage-green: #059669;
  --sage-green-light: #ecfdf5;
  --sage-green-border: #a7f3d0;

  --gold-amber: #d97706;
  --gold-amber-light: #fffbeb;
  --gold-amber-border: #fde68a;

  /* 电影文字排版阶度 */
  --text-title: #18181b;       /* 浓郁墨黑 */
  --text-body: #3f3f46;        /* 沉稳暖炭灰 */
  --text-muted: #71717a;       /* 典雅中灰 */
  --text-subtle: #a1a1aa;      /* 轻柔淡灰 */

  /* 边框与微柔阴影 (轻薄、无厚重黑边) */
  --border-light: #f0ece5;
  --border-medium: #e5e0d8;
  --border-active: #fda4af;

  --shadow-warm-sm: 0 1px 3px rgba(39, 34, 28, 0.04), 0 1px 2px rgba(39, 34, 28, 0.02);
  --shadow-warm-md: 0 4px 12px rgba(39, 34, 28, 0.06), 0 2px 4px rgba(39, 34, 28, 0.03);
  --shadow-card: 0 8px 24px -4px rgba(45, 38, 30, 0.08);

  --radius-xs: 4px;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-pill: 9999px;

  --font-serif: "Songti SC", "SimSun", "Noto Serif CJK SC", Georgia, "Times New Roman", serif;
  --font-sans: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Segoe UI", Roboto, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

/* 全局重置 */
* { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }

html, body {
  height: 100%;
  font-family: var(--font-sans);
  font-size: 13px;
  line-height: 1.6;
  color: var(--text-body);
  background-color: var(--bg-page);
  -webkit-font-smoothing: antialiased;
}

button, input, select, textarea {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
  background: none;
  border: none;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
  filter: grayscale(0.5);
}

a { color: inherit; text-decoration: none; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); border: 0; }
.req { color: var(--coral); font-weight: bold; }
.mt-2 { margin-top: 8px; }

/* 珊瑚粉圆润按钮 (Warm Coral Button) */
.warm-coral-btn {
  background-color: var(--coral);
  color: #ffffff;
  padding: 8px 20px;
  border-radius: var(--radius-pill);
  font-size: 13px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  box-shadow: 0 4px 14px rgba(244, 63, 94, 0.28);
  transition: all 0.2s ease;
}

.warm-coral-btn:hover:not(:disabled) {
  background-color: var(--coral-hover);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(244, 63, 94, 0.38);
}

.warm-coral-btn:active:not(:disabled) {
  transform: translateY(0);
}

.primary-button {
  background-color: var(--coral);
  color: #ffffff;
  padding: 7px 18px;
  border-radius: var(--radius-pill);
  font-size: 12px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  box-shadow: 0 2px 10px rgba(244, 63, 94, 0.25);
  transition: all 0.2s ease;
}

.primary-button:hover:not(:disabled) {
  background-color: var(--coral-hover);
  box-shadow: 0 4px 14px rgba(244, 63, 94, 0.35);
}

.primary-button.video-action {
  background: linear-gradient(135deg, #f43f5e 0%, #fb7185 100%);
}

.secondary-button {
  background-color: #ffffff;
  color: var(--text-body);
  border: 1px solid var(--border-medium);
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  font-size: 12px;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  box-shadow: var(--shadow-warm-sm);
  transition: all 0.15s ease;
}

.secondary-button:hover:not(:disabled) {
  background-color: var(--bg-subtle);
  border-color: var(--coral-border);
  color: var(--coral);
}

.secondary-button.small { padding: 4px 10px; font-size: 11px; }
.primary-button.small { padding: 4px 12px; font-size: 11px; }

.text-button {
  color: var(--coral);
  font-size: 12px;
  font-weight: 600;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
}

.text-button:hover:not(:disabled) {
  background-color: var(--coral-light);
}

.link-button {
  color: var(--coral);
  font-size: 12px;
  font-weight: 600;
}

/* 全局主结构 (App Shell) */
.app-shell {
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
  background-color: var(--bg-page);
}

/* ==========================================================================
   全局顶栏 (Warm Clean Topbar)
   ========================================================================== */
.topbar {
  height: 56px;
  background-color: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  flex-shrink: 0;
  z-index: 40;
}

.topbar-brand {
  display: flex;
  align-items: center;
  gap: 16px;
}

/* Mac 经典三色窗口圆点 */
.traffic-lights {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.light-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
}

.dot-red { background-color: #ff5f56; }
.dot-yellow { background-color: #ffbd2e; }
.dot-green { background-color: #27c93f; }

.brand-text-logo {
  font-size: 16px;
  font-weight: 800;
  color: var(--text-title);
  letter-spacing: -0.02em;
}

/* 顶部导航管线项 (项目 / 剧本 / 角色 / 分镜 / 剪辑 / 发布) */
.top-nav {
  display: flex;
  align-items: center;
  gap: 8px;
  background-color: rgba(240, 236, 229, 0.6);
  padding: 4px;
  border-radius: var(--radius-pill);
}

.top-nav-item {
  padding: 6px 18px;
  border-radius: var(--radius-pill);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  transition: all 0.2s ease;
}

.top-nav-item:hover {
  color: var(--text-title);
}

.top-nav-item.is-active {
  background-color: #ffffff;
  color: var(--coral);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.compact-health {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-muted);
  padding: 4px 10px;
  background-color: #ffffff;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-pill);
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background-color: var(--text-subtle);
}

.status-dot.is-good { background-color: #10b981; }
.status-dot.is-bad { background-color: var(--coral); }
.status-dot.is-neutral { background-color: var(--text-subtle); }

.icon-button {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background-color: #ffffff;
  border: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  transition: all 0.15s ease;
}

.icon-button:hover {
  color: var(--coral);
  border-color: var(--coral-border);
  background-color: var(--coral-light);
}

/* ==========================================================================
   内容主区与电影意境栏
   ========================================================================== */
.content {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 18px 32px 24px;
  overflow-y: auto;
}

.page-caption-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.caption-quote {
  font-family: var(--font-serif);
  font-size: 14px;
  font-style: italic;
  color: var(--text-muted);
  letter-spacing: 0.04em;
}

.caption-status {
  font-size: 12px;
  color: var(--text-subtle);
  font-weight: 500;
}

/* 4项指标概览卡 (极简温润白底) */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 20px;
}

.metric-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 14px 18px;
  box-shadow: var(--shadow-warm-sm);
  display: flex;
  flex-direction: column;
  position: relative;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.metric-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-warm-md);
}

.metric-label {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 500;
  margin-bottom: 4px;
}

.metric-value {
  font-size: 24px;
  font-weight: 800;
  color: var(--text-title);
  font-family: var(--font-mono);
}

.metric-note {
  position: absolute;
  right: 18px;
  bottom: 14px;
  font-size: 11px;
  color: var(--coral);
  background-color: var(--coral-light);
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  font-weight: 600;
}

/* ==========================================================================
   分镜编排双栏生产台 (Workspace Layout)
   ========================================================================== */
.workspace-layout {
  flex: 1;
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 20px;
  min-height: 600px;
}

/* 左侧 Task Rail */
.task-rail {
  background-color: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-warm-sm);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.rail-header {
  padding: 16px 20px 12px;
  border-bottom: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.rail-title h2 {
  font-size: 15px;
  font-weight: 800;
  color: var(--text-title);
}

.rail-counter {
  font-size: 11px;
  color: var(--text-subtle);
  margin-left: 6px;
}

.rail-btn-create {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background-color: var(--coral-light);
  color: var(--coral);
  font-size: 16px;
  font-weight: bold;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}

.rail-btn-create:hover {
  background-color: var(--coral);
  color: #ffffff;
}

.task-filters {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-light);
  display: flex;
  flex-direction: column;
  gap: 10px;
  background-color: var(--bg-subtle);
}

.search-box {
  display: flex;
  align-items: center;
  background-color: #ffffff;
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-pill);
  padding: 6px 12px;
  gap: 8px;
  box-shadow: var(--shadow-warm-sm);
}

.search-box:focus-within {
  border-color: var(--coral);
  box-shadow: 0 0 0 2px rgba(244, 63, 94, 0.15);
}

.search-icon { color: var(--text-subtle); flex-shrink: 0; }
.search-box input { border: none; outline: none; width: 100%; font-size: 12px; }
.search-box input::placeholder { color: var(--text-subtle); }

.filter-controls { display: flex; gap: 6px; }

.filter-select {
  flex: 1;
  background-color: #ffffff;
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-pill);
  padding: 4px 8px;
  font-size: 11px;
  color: var(--text-body);
  outline: none;
}

.filter-btn-toggle {
  padding: 4px 12px;
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-pill);
  font-size: 11px;
  background-color: #ffffff;
  color: var(--text-muted);
  font-weight: 500;
}

.filter-btn-toggle:hover, .filter-btn-toggle.is-active {
  background-color: var(--coral-light);
  border-color: var(--coral-border);
  color: var(--coral);
}

.date-range-panel {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  padding-top: 4px;
}

.date-field label { display: block; font-size: 10px; color: var(--text-subtle); margin-bottom: 2px; }
.date-field input { width: 100%; border: 1px solid var(--border-medium); border-radius: var(--radius-sm); padding: 4px 6px; font-size: 11px; }

.task-list {
  flex: 1;
  overflow-y: auto;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.task-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-light);
  background-color: #ffffff;
  text-align: left;
  transition: all 0.15s ease;
  box-shadow: var(--shadow-warm-sm);
}

.task-item:hover {
  border-color: var(--coral-border);
  background-color: var(--bg-subtle);
  transform: translateX(2px);
}

.task-item.is-selected {
  border-color: var(--coral);
  background-color: var(--coral-light);
  box-shadow: 0 4px 12px rgba(244, 63, 94, 0.12);
}

.task-source-icon, .detail-source-icon {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: bold;
  flex-shrink: 0;
}

.source-video { background-color: var(--gold-amber-light); color: var(--gold-amber); }
.source-image { background-color: var(--ocean-blue-light); color: var(--ocean-blue); }
.source-script { background-color: var(--coral-light); color: var(--coral); }

.task-item-content { flex: 1; min-width: 0; }
.task-item-title {
  display: block;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-title);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.task-item-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--text-subtle);
  margin-top: 3px;
}

.meta-category {
  color: var(--text-muted);
  padding-left: 6px;
  border-left: 1px solid var(--border-medium);
}

/* 状态药丸 (柔和治愈系配色) */
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: var(--radius-pill);
  font-size: 11px;
  font-weight: 600;
  border: 1px solid transparent;
  flex-shrink: 0;
}

.status-pill.large { padding: 5px 14px; font-size: 12px; }
.status-pill-dot { width: 6px; height: 6px; border-radius: 50%; background-color: currentColor; }

.status-running { background-color: var(--ocean-blue-light); color: var(--ocean-blue); border-color: var(--ocean-blue-border); }
.status-waiting { background-color: var(--coral-light); color: var(--coral); border-color: var(--coral-border); }
.status-approved { background-color: var(--sage-green-light); color: var(--sage-green); border-color: var(--sage-green-border); }
.status-failed { background-color: #fef2f2; color: #ef4444; border-color: #fecaca; }
.status-ready { background-color: var(--gold-amber-light); color: var(--gold-amber); border-color: var(--gold-amber-border); }
.status-draft { background-color: #f4f4f5; color: #71717a; border-color: #e4e4e7; }

.task-list-empty {
  padding: 40px 20px;
  text-align: center;
  color: var(--text-muted);
}
.task-list-empty p { font-weight: 700; color: var(--text-title); margin-bottom: 4px; }
.task-list-empty span { font-size: 12px; display: block; margin-bottom: 10px; }

/* ==========================================================================
   右侧分镜编排控制台 (Detail Pane)
   ========================================================================== */
.detail-pane {
  background-color: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-warm-sm);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  min-width: 0;
}

.detail-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  min-height: 480px;
  color: var(--text-muted);
  gap: 14px;
}

.empty-icon-box {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background-color: var(--coral-light);
  display: flex;
  align-items: center;
  justify-content: center;
}

.detail-header {
  padding: 20px 28px 16px;
  border-bottom: 1px solid var(--border-light);
  background-color: #ffffff;
}

.detail-title-line {
  display: flex;
  align-items: center;
  gap: 14px;
}

.detail-source-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  font-size: 18px;
}

.detail-title-line h2 {
  font-family: var(--font-serif);
  font-size: 20px;
  font-weight: 800;
  color: var(--text-title);
  letter-spacing: -0.01em;
}

.task-id-tag {
  font-size: 11px;
  font-family: var(--font-mono);
  color: var(--text-subtle);
  display: block;
}

.detail-status-wrap {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 10px;
}

.live-processing {
  font-size: 11px;
  font-weight: 600;
  color: var(--coral);
  background-color: var(--coral-light);
  border: 1px solid var(--coral-border);
  padding: 3px 10px;
  border-radius: var(--radius-pill);
}

.detail-meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  margin-top: 14px;
  font-size: 12px;
  color: var(--text-muted);
}

.detail-meta-row strong {
  color: var(--text-subtle);
  margin-right: 6px;
}

/* 详情 Tabs */
.detail-tabs {
  display: flex;
  padding: 0 28px;
  border-bottom: 1px solid var(--border-light);
  background-color: #ffffff;
  gap: 12px;
}

.detail-tab {
  padding: 12px 16px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  border-bottom: 2px solid transparent;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.15s ease;
}

.detail-tab:hover { color: var(--text-title); }
.detail-tab.is-active {
  color: var(--coral);
  border-bottom-color: var(--coral);
}

.detail-body { padding: 24px 28px; }

/* 工作流概览 */
.workflow-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
  gap: 18px;
}

.workflow-summary h3 {
  font-family: var(--font-serif);
  font-size: 16px;
  font-weight: 800;
  color: var(--text-title);
}

.workflow-summary p {
  font-size: 12px;
  color: var(--text-muted);
}

.workflow-summary-actions {
  display: flex;
  gap: 10px;
  flex-shrink: 0;
}

/* 生产管线指示器 (Warm Pipeline) */
.pipeline-track {
  display: flex;
  align-items: center;
  background-color: var(--bg-subtle);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 12px 20px;
  margin-bottom: 24px;
  gap: 12px;
}

.pipeline-stage {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
}

.pipeline-number {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background-color: #ffffff;
  border: 1px solid var(--border-medium);
  color: var(--text-subtle);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: bold;
  font-family: var(--font-mono);
}

.pipeline-stage strong { font-size: 12px; font-weight: 700; color: var(--text-body); display: block; }
.pipeline-stage small { font-size: 10px; color: var(--text-subtle); display: block; }
.pipeline-stage.done .pipeline-number { background-color: var(--sage-green); border-color: var(--sage-green); color: #ffffff; }
.pipeline-stage.done strong { color: var(--sage-green); }
.pipeline-stage.active .pipeline-number { background-color: var(--coral); border-color: var(--coral); color: #ffffff; box-shadow: 0 0 0 3px rgba(244,63,94,0.18); }
.pipeline-stage.active strong { color: var(--coral); }

.pipeline-connector {
  height: 1px;
  background-color: var(--border-medium);
  flex: 1;
  margin: 0 6px;
}

/* ==========================================================================
   全新导演监视大屏 + 检查器 (夏日来信电影控制台)
   ========================================================================== */
.studio-console-layout {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 20px;
  margin-bottom: 26px;
}

.director-monitor-pane {
  background-color: #ffffff;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-warm-md);
  display: flex;
  flex-direction: column;
}

.monitor-header {
  padding: 12px 18px;
  background-color: var(--bg-subtle);
  border-bottom: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.monitor-tag {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  color: var(--text-title);
}

.rec-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--coral);
  box-shadow: 0 0 8px var(--coral);
  display: inline-block;
}

.monitor-viewport {
  width: 100%;
  height: 320px;
  background-color: #1c1917;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.monitor-viewport video, .monitor-viewport img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.monitor-control-bar {
  padding: 14px 18px;
  background-color: #ffffff;
  border-top: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  gap: 12px;
}

/* 检查器 (Shot Inspector) */
.shot-inspector-pane {
  background-color: var(--bg-subtle);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 18px;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-warm-sm);
}

.inspector-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-light);
  margin-bottom: 14px;
}

.inspector-header h4 {
  font-family: var(--font-serif);
  font-size: 15px;
  font-weight: 800;
  color: var(--text-title);
}

.badge {
  font-size: 11px;
  font-family: var(--font-mono);
  color: var(--coral);
  background-color: var(--coral-light);
  padding: 3px 8px;
  border-radius: var(--radius-pill);
  font-weight: 600;
}

.inspector-fields {
  display: flex;
  flex-direction: column;
  gap: 14px;
  flex: 1;
}

.field-group { display: flex; flex-direction: column; gap: 5px; }

.field-label-row {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
}

.field-group textarea, .field-group input {
  width: 100%;
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  font-size: 12px;
  background-color: #ffffff;
  color: var(--text-title);
  box-shadow: var(--shadow-warm-sm);
}

.field-group textarea:focus, .field-group input:focus {
  border-color: var(--coral);
  outline: none;
  box-shadow: 0 0 0 2px rgba(244, 63, 94, 0.15);
}

.inspector-footer {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--border-light);
  display: flex;
  justify-content: flex-end;
}

/* ==========================================================================
   胶卷时间线走廊 (Filmstrip Reel)
   ========================================================================== */
.filmstrip-section {
  margin-bottom: 26px;
}

.section-heading-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 12px;
}

.section-heading-row h3 {
  font-family: var(--font-serif);
  font-size: 16px;
  font-weight: 800;
  color: var(--text-title);
}

.heading-hint {
  font-size: 12px;
  color: var(--coral);
  font-weight: 600;
}

.filmstrip-track {
  display: flex;
  gap: 14px;
  overflow-x: auto;
  padding: 6px 4px 14px;
  scrollbar-width: thin;
}

.filmstrip-card {
  width: 154px;
  flex-shrink: 0;
  background-color: #ffffff;
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-md);
  overflow: hidden;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: var(--shadow-warm-sm);
}

.filmstrip-card:hover {
  border-color: var(--coral-border);
  transform: translateY(-2px);
  box-shadow: var(--shadow-warm-md);
}

.filmstrip-card.is-active-shot {
  border-color: var(--coral);
  box-shadow: 0 0 0 2px var(--coral), 0 6px 16px rgba(244, 63, 94, 0.18);
  transform: translateY(-2px);
}

.filmstrip-thumb {
  width: 100%;
  height: 94px;
  background-color: #27272a;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.filmstrip-thumb img, .filmstrip-thumb video {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.filmstrip-empty-icon {
  font-size: 11px;
  color: #a1a1aa;
  font-family: var(--font-mono);
}

.filmstrip-card-meta {
  padding: 8px 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background-color: #ffffff;
  border-top: 1px solid var(--border-light);
}

.filmstrip-card-meta strong {
  font-size: 11px;
  font-family: var(--font-mono);
  color: var(--text-title);
}

/* 角色与设定抽屉区 (Task Editor) */
.task-editor-section {
  background-color: var(--bg-subtle);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 20px 24px;
  margin-top: 20px;
}

.form-grid { display: grid; gap: 14px; }
.two-columns { grid-template-columns: 1fr 1fr; }

.replacement-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-top: 14px;
}

.task-editor-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--border-light);
}

.editor-save-hint { font-size: 11px; color: var(--text-subtle); }

/* 产物库与模型服务 */
.artifact-filter-bar {
  display: flex;
  gap: 8px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}

.artifact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 16px;
}

.artifact-card {
  background-color: #ffffff;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-warm-sm);
  display: flex;
  flex-direction: column;
}

.artifact-preview {
  height: 140px;
  background-color: #18181b;
  display: flex;
  align-items: center;
  justify-content: center;
}

.artifact-preview img, .artifact-preview video { width: 100%; height: 100%; object-fit: contain; }
.artifact-info { padding: 12px 14px; font-size: 11px; flex: 1; }
.artifact-title-row { display: flex; justify-content: space-between; font-weight: 700; color: var(--text-title); margin-bottom: 4px; }
.artifact-path { font-family: var(--font-mono); font-size: 10px; color: var(--text-subtle); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.artifact-link { display: inline-block; color: var(--coral); margin-top: 8px; font-weight: 600; }

.provider-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
}

.provider-card {
  background-color: #ffffff;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 16px;
  box-shadow: var(--shadow-warm-sm);
}

.provider-card-actions { display:flex; justify-content:flex-end; margin-top:12px; }

.provider-name { font-weight: 700; color: var(--text-title); }
.provider-details { font-size: 11px; color: var(--text-muted); margin-top: 4px; }

/* 模态框 */
.create-dialog {
  border: none;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  max-width: 640px;
  width: 90vw;
  margin: auto;
  background-color: #ffffff;
}

.create-dialog::backdrop {
  background-color: rgba(24, 24, 27, 0.4);
  backdrop-filter: blur(8px);
}

.dialog-shell { display: flex; flex-direction: column; }
.dialog-header {
  padding: 20px 28px;
  border-bottom: 1px solid var(--border-light);
  display: flex;
  justify-content: space-between;
}

.dialog-header h2 { font-family: var(--font-serif); font-size: 18px; font-weight: 800; color: var(--text-title); }
.dialog-header p { font-size: 12px; color: var(--text-muted); }
.dialog-close-btn { font-size: 24px; color: var(--text-subtle); line-height: 1; }

.create-form { padding: 22px 28px; display: flex; flex-direction: column; gap: 16px; }
.form-row-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.field-item label, .group-label { display: block; font-size: 12px; font-weight: 600; color: var(--text-body); margin-bottom: 6px; }
.field-item input, .field-item textarea { width: 100%; border: 1px solid var(--border-medium); border-radius: var(--radius-sm); padding: 8px 12px; font-size: 12px; }

.source-segmented-tabs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.source-tab {
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-md);
  padding: 10px 12px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 2px;
  background-color: #ffffff;
  transition: all 0.15s ease;
}
.source-tab input { display: none; }
.source-tab.is-selected {
  border-color: var(--coral);
  background-color: var(--coral-light);
  box-shadow: 0 2px 8px rgba(244, 63, 94, 0.15);
}
.tab-badge { font-weight: 700; font-size: 13px; color: var(--text-title); }
.source-tab.is-selected .tab-badge { color: var(--coral); }
.tab-desc { font-size: 10px; color: var(--text-muted); }

.upload-dropzone {
  border: 2px dashed var(--border-medium);
  border-radius: var(--radius-md);
  padding: 24px;
  text-align: center;
  background-color: var(--bg-subtle);
  cursor: pointer;
}
.upload-dropzone input { display: none; }
.dropzone-label { display: flex; flex-direction: column; align-items: center; gap: 6px; cursor: pointer; }
.dropzone-title { font-weight: 700; font-size: 13px; color: var(--text-title); }
.dropzone-desc { font-size: 11px; color: var(--text-muted); }

.dropzone-label-horizontal { display: flex; align-items: center; justify-content: space-between; cursor: pointer; }
.btn-select { padding: 4px 12px; background-color: var(--coral-light); color: var(--coral); border-radius: var(--radius-pill); font-size: 11px; font-weight: 600; }

.replacements-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-divider { height: 1px; background-color: var(--border-light); margin: 6px 0; }
.form-section-header { display: flex; justify-content: space-between; align-items: baseline; }
.form-section-header h3 { font-family: var(--font-serif); font-size: 14px; font-weight: 800; color: var(--text-title); }
.form-section-header p { font-size: 11px; color: var(--text-muted); }

.dialog-actions-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 14px;
  border-top: 1px solid var(--border-light);
}

.actions-right { display: flex; gap: 10px; }

/* 提示通知 */
.toast-region {
  position: fixed;
  right: 28px;
  bottom: 28px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 100;
}

.toast {
  background-color: #ffffff;
  color: var(--text-title);
  padding: 10px 18px;
  border-radius: var(--radius-pill);
  font-size: 12px;
  font-weight: 600;
  border: 1px solid var(--coral-border);
  box-shadow: var(--shadow-card);
}

/* ==========================================================================
   项目档案库与模型集群页面样式 (Warm Cinema Archives & Providers)
   ========================================================================== */
.history-page, .provider-page {
  background-color: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 24px 28px;
  box-shadow: var(--shadow-warm-sm);
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.provider-page-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border-light);
}

.provider-page-heading h2 {
  font-family: var(--font-serif);
  font-size: 18px;
  font-weight: 800;
  color: var(--text-title);
}

.health-card {
  margin-top: 14px;
  padding: 16px 20px;
  background-color: var(--bg-subtle);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
}

.health-card-title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}

.health-card-title h3 {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-title);
}

.health-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.health-grid div {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.health-grid span {
  font-size: 11px;
  color: var(--text-muted);
}

.health-grid strong {
  font-size: 13px;
  color: var(--text-title);
  font-family: var(--font-mono);
}

/* ==========================================================================
   移动端与窄屏自适应规则 (Mobile Drawer & Responsive Rules)
   ========================================================================== */
@media (max-width: 960px) {
  .topbar {
    padding: 0 16px;
  }
  .mobile-menu-button {
    display: flex !important;
  }
  .workspace-layout {
    grid-template-columns: 1fr;
    position: relative;
  }
  .task-rail {
    position: fixed;
    top: 56px;
    bottom: 0;
    left: 0;
    width: 300px;
    z-index: 50;
    box-shadow: var(--shadow-card);
    transform: translateX(-105%);
    transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  }
  .task-rail.is-mobile-open {
    transform: translateX(0);
  }
  .studio-console-layout {
    grid-template-columns: 1fr;
  }
  .replacement-grid {
    grid-template-columns: 1fr 1fr;
  }
  .metrics-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 600px) {
  .topbar {
    height: auto;
    padding: 8px 12px;
    flex-wrap: wrap;
    gap: 8px;
  }
  .brand-text-logo {
    font-size: 14px;
    white-space: nowrap;
  }
  .top-nav {
    order: 3;
    width: 100%;
    justify-content: center;
  }
  .topbar-actions {
    margin-left: auto;
  }
  .compact-health {
    display: none;
  }
  .top-create-button {
    padding: 5px 12px;
    font-size: 11px;
  }
  .metrics-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin-bottom: 12px;
  }
  .metric-card {
    min-height: 68px;
    padding: 8px 10px;
    border-radius: 10px;
  }
  .metric-label { font-size: 10px; margin-bottom: 0; white-space: nowrap; }
  .metric-value { font-size: 18px; line-height: 1.3; }
  .metric-note {
    position: static;
    align-self: flex-start;
    margin-top: 2px;
    padding: 0 5px;
    font-size: 9px;
    line-height: 1.5;
  }
  .caption-quote { display: none; }
  .page-caption-bar { margin-bottom: 10px; }
  .next-step-card {
    align-items: stretch;
    flex-direction: column;
    gap: 12px;
    padding: 16px;
    margin-bottom: 12px;
  }
  .next-step-copy h2 { font-size: 18px; }
  .next-step-button { width: 100%; min-height: 44px; }
  .friendly-input-bar { align-items: stretch; flex-direction: column; gap: 12px; padding: 12px; }
  .friendly-upload-controls .secondary-button { flex: 1; justify-content: center; }
  .friendly-section-heading { align-items: flex-start; flex-direction: column; gap: 4px; margin-top: 14px; }
  .friendly-shot-grid { grid-template-columns: 1fr; gap: 10px; }
  .friendly-shot-card { padding: 10px; border-radius: 12px; }
  .friendly-shot-actions { align-items: stretch; flex-wrap: wrap; }
  .friendly-shot-actions .primary-button,
  .friendly-shot-actions .secondary-button { flex: 1; justify-content: center; }
  .friendly-shot-actions .actions-spacer { display: none; }
  .friendly-change-input { min-height: 54px; }
  .replacement-grid {
    grid-template-columns: 1fr;
  }
  .form-row-grid {
    grid-template-columns: 1fr;
  }
  .content {
    padding: 12px 14px;
  }
}
@media (min-width: 700px) {
  .friendly-workflow { max-width: 1180px; margin: 0 auto; }
}
.next-step-card {
  display:flex; align-items:center; justify-content:space-between; gap:20px; padding:22px 24px;
  margin-bottom:16px; border:1px solid #ffd1c5; border-radius:18px; background:linear-gradient(135deg,#fff8f5,#fff);
  box-shadow:0 8px 24px rgba(75,40,28,.06);
}
.production-stepper {
  display:grid; grid-template-columns:repeat(4,1fr); gap:8px; list-style:none;
  margin:0 0 12px; padding:0;
}
.production-step {
  display:flex; align-items:center; gap:9px; min-width:0; padding:10px 12px;
  border:1px solid var(--border-light); border-radius:12px; background:#fff;
  color:var(--text-muted);
}
.production-step-number {
  display:grid; place-items:center; flex:0 0 24px; width:24px; height:24px;
  border-radius:50%; background:#f1eeeb; color:#847b76; font-size:12px; font-weight:800;
}
.production-step-copy { display:grid; min-width:0; gap:2px; }
.production-step-copy strong { overflow:hidden; color:var(--text-body); font-size:12px; text-overflow:ellipsis; white-space:nowrap; }
.production-step-copy small { overflow:hidden; color:var(--text-muted); font-size:10px; text-overflow:ellipsis; white-space:nowrap; }
.production-step.is-current { border-color:#ffb9a8; background:#fff8f5; box-shadow:0 0 0 2px rgba(244,63,94,.08); }
.production-step.is-current .production-step-number { background:var(--coral); color:#fff; }
.production-step.is-complete { border-color:#b8dfc3; background:#f6fff8; }
.production-step.is-complete .production-step-number { background:#31834a; color:#fff; }
.preflight-issues { display:grid; gap:8px; margin:12px 0; padding:0; list-style:none; }
.preflight-issues li { display:flex; align-items:flex-start; gap:9px; padding:10px 12px; border:1px solid #f5d7cf; border-radius:10px; background:#fff8f5; color:var(--text-body); font-size:13px; line-height:1.5; }
.preflight-issue-icon { display:grid; place-items:center; flex:0 0 18px; width:18px; height:18px; border-radius:50%; background:#e8755d; color:#fff; font-size:11px; font-weight:800; }
.preflight-notice { margin:12px 0; color:var(--text-muted); font-size:12px; line-height:1.5; }
.create-source-help { margin:8px 2px 0; color:var(--text-muted); font-size:12px; line-height:1.5; }
.field-help { display:block; margin-top:5px; color:var(--text-muted); font-size:11px; line-height:1.4; }
.next-step-card.is-download { border-color:#b6e2c3; background:#f5fff7; }
.next-step-copy h2 { margin:4px 0 5px; font-size:22px; color:var(--text-title); }
.next-step-copy p { margin:0; color:var(--text-muted); font-size:13px; }
.eyebrow { color:var(--coral); font-size:11px; font-weight:800; letter-spacing:.08em; }
.next-step-button { min-width:210px; min-height:48px; font-size:15px; }
.friendly-error { display:flex; align-items:center; gap:10px; flex-wrap:wrap; padding:12px 14px; margin-bottom:16px; border-radius:12px; background:#fff5f2; color:#8c3d31; }
.friendly-error span { flex:1; min-width:220px; font-size:12px; }
.friendly-input-bar { display:flex; align-items:center; justify-content:space-between; gap:16px; margin-bottom:22px; padding:16px 18px; border:1px solid var(--border-light); border-radius:14px; background:#fff; }
.friendly-input-bar h3, .friendly-section-heading h3 { margin:0 0 4px; color:var(--text-title); }
.friendly-input-bar p, .friendly-section-heading p { margin:0; color:var(--text-muted); font-size:12px; }
.friendly-upload-controls { display:flex; gap:8px; flex-wrap:wrap; }
.friendly-section-heading { display:flex; justify-content:space-between; align-items:end; gap:16px; margin:18px 0 12px; }
.friendly-section-heading > span { color:var(--coral); font-size:12px; font-weight:700; }
.friendly-shot-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(280px,1fr)); gap:16px; }
.friendly-shot-card { padding:14px; border:1px solid var(--border-light); border-radius:16px; background:#fff; }
.friendly-shot-card.is-approved { border-color:#b8dfc3; }
.friendly-shot-heading { display:flex; justify-content:space-between; align-items:start; gap:8px; margin-bottom:10px; }
.friendly-shot-heading h4 { margin:3px 0 0; font-size:15px; color:var(--text-title); }
.shot-number { color:var(--text-muted); font-size:11px; }
.friendly-shot-media { height:220px; overflow:hidden; border-radius:11px; background:#f4f2f0; margin-bottom:11px; }
.friendly-shot-media .artifact-preview, .friendly-shot-media img, .friendly-shot-media video { width:100%; height:100%; object-fit:contain; }
.friendly-shot-card > label { display:block; margin:4px 0; color:var(--text-body); font-size:12px; font-weight:700; }
.friendly-scope-row { display:flex; gap:6px; flex-wrap:wrap; margin:6px 0 8px; }
.scope-choice, .quick-idea { border:1px solid var(--border-medium); border-radius:999px; background:#fff; color:var(--text-body); cursor:pointer; font:inherit; font-size:11px; padding:6px 10px; }
.scope-choice:hover, .quick-idea:hover { border-color:#f1a08f; background:#fff8f5; }
.scope-choice.is-selected { border-color:var(--coral); background:var(--coral); color:#fff; font-weight:700; }
.scope-choice:disabled { cursor:not-allowed; opacity:.6; }
.friendly-quick-ideas { display:flex; gap:5px; flex-wrap:wrap; margin:6px 0 2px; }
.quick-idea { border-style:dashed; color:var(--text-muted); padding:4px 8px; }
.friendly-change-input { width:100%; box-sizing:border-box; resize:vertical; border:1px solid var(--border-light); border-radius:9px; padding:9px; font:inherit; font-size:12px; }
.friendly-shot-actions { display:flex; align-items:center; gap:8px; flex-wrap:wrap; margin-top:10px; }
.friendly-approved-label { color:#31834a; font-size:12px; }
.advanced-shot-settings { margin-top:12px; padding-top:10px; border-top:1px solid #f0ece9; }
.advanced-shot-settings summary, .version-history summary { cursor:pointer; color:var(--text-muted); font-size:12px; }
.advanced-shot-settings .prompt-field { margin-top:10px; }
.version-history { margin-top:22px; padding:14px 16px; border:1px solid var(--border-light); border-radius:12px; background:#fff; }
.version-link { display:block; width:100%; margin-top:8px; padding:8px 10px; border:0; border-radius:8px; background:#faf8f6; color:var(--text-body); text-align:left; cursor:pointer; }
.version-dialog { width:min(760px,92vw); max-height:88vh; border:0; border-radius:16px; padding:0; }
.version-dialog-body { max-height:70vh; overflow:auto; padding:18px; }
.version-artifact-row { display:flex; align-items:center; gap:10px; margin-top:10px; padding:8px; border:1px solid var(--border-light); border-radius:9px; }
.version-artifact-row .artifact-preview { width:90px; height:60px; overflow:hidden; }
.version-artifact-row img, .version-artifact-row video { width:100%; height:100%; object-fit:contain; }
@media (max-width: 700px) {
  .next-step-card, .friendly-input-bar { align-items:stretch; flex-direction:column; }
  .next-step-button { width:100%; }
  .production-stepper { grid-template-columns:repeat(2,1fr); }
  .friendly-upload-controls button { flex:1; }
}

/* Preserve the full image for human review; administrative links start hidden. */
[hidden] { display: none !important; }
.friendly-input-editor { margin: 0 0 18px; padding: 14px 16px; border: 1px solid var(--border-light); border-radius: 12px; background: #fff; }
.friendly-input-editor > summary { cursor: pointer; font-size: 13px; color: var(--text-body); }
.friendly-input-editor .task-editor-section { margin-top: 16px; }

/* Keep narrow-screen actions compact after the shared card rules. */
@media (max-width: 600px) {
  .next-step-card { gap: 12px; padding: 16px; margin-bottom: 12px; }
  .next-step-copy h2 { font-size: 18px; }
  .next-step-button { min-height: 44px; }
  .production-step { padding: 9px 10px; }
  .production-step-copy small { display:none; }
  .friendly-input-bar { gap: 12px; padding: 12px; }
  .friendly-section-heading { align-items: flex-start; flex-direction: column; gap: 4px; margin-top: 14px; }
  .friendly-shot-grid { grid-template-columns: 1fr; gap: 10px; }
  .friendly-shot-card { padding: 10px; border-radius: 12px; }
}

/* Conflict review stays readable and usable on narrow screens. */
.edit-conflict-dialog .dialog-shell { padding: 24px; gap: 16px; }
.edit-conflict-dialog label { display: grid; gap: 8px; min-width: 0; }
.edit-conflict-dialog textarea { width: 100%; box-sizing: border-box; padding: 12px; border: 1px solid var(--border-medium); border-radius: var(--radius-sm); resize: vertical; }
.edit-conflict-dialog .dialog-actions-bar { flex-wrap: wrap; gap: 10px; }
@media (max-width: 600px) {
  .edit-conflict-dialog .dialog-shell { padding: 16px; }
  .edit-conflict-dialog .dialog-actions-bar button { width: 100%; white-space: normal; }
}

.friendly-shot-card > select {
  max-width: 100%; min-height: 44px; padding: 8px 12px;
  border: 1px solid var(--border-medium); border-radius: var(--radius-sm);
  background: var(--surface, #fff); font: inherit;
}
.friendly-shot-card > select:focus-visible { outline: 2px solid var(--coral); outline-offset: 2px; }
