/* 工作区布局：经典四列 / 专业三栏 / 导演侧栏+流式 */

.workspace-shell {
  min-width: 0;
}

.workspace {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--ipt-grid-gap);
  align-items: start;
}

.workspace-rail {
  display: none;
}

.ws-group-prep,
.ws-group-finish {
  display: contents;
}

.ws-col {
  display: flex;
  flex-direction: column;
  gap: var(--ipt-grid-gap);
  min-width: 0;
}

.ws-col-copy { grid-column: 1; }
.ws-col-meta { grid-column: 2; }
.ws-col-video { grid-column: 3; }
.ws-col-publish { grid-column: 4; }

.card-title {
  display: flex;
  align-items: center;
  gap: 10px;
}
.card-step-num {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  height: 28px;
  padding: 0 8px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.02em;
  background: rgba(37, 99, 235, 0.12);
  color: var(--ipt-primary);
}
.card-step-name { flex: 1; min-width: 0; }
.card-step-hint {
  font-size: 12px;
  font-weight: 400;
  color: #64748b;
  margin-left: 4px;
}

.header-brand { min-width: 0; }
.header-tagline {
  display: none;
  margin: 4px 0 0;
  font-size: 12px;
  font-weight: 400;
  opacity: 0.78;
  letter-spacing: 0.06em;
}

@media (max-width: 768px) {
  .workspace {
    display: flex;
    flex-direction: column;
    gap: 12px;
  }
  .ws-group-prep,
  .ws-group-finish {
    display: flex;
    flex-direction: column;
    gap: 12px;
  }
  .ws-col { width: 100%; }
}

/* ========== 专业：三栏创作台 ========== */
[data-theme="pro"] .header-tagline { display: block; }

[data-theme="pro"] .workspace {
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1.35fr) minmax(0, 1fr);
  gap: 18px;
  max-width: 1680px;
  margin: 0 auto;
  align-items: stretch;
}

[data-theme="pro"] .ws-group-prep {
  display: flex;
  flex-direction: column;
  gap: 14px;
  grid-column: 1;
  grid-row: 1;
}

[data-theme="pro"] .ws-group-finish {
  display: flex;
  flex-direction: column;
  gap: 14px;
  grid-column: 3;
  grid-row: 1;
}

[data-theme="pro"] .ws-col-copy,
[data-theme="pro"] .ws-col-meta,
[data-theme="pro"] .ws-col-publish { grid-column: auto; }

[data-theme="pro"] .ws-col-video {
  grid-column: 2;
  grid-row: 1;
  position: sticky;
  top: 14px;
  align-self: start;
}

[data-theme="pro"] .card-step-num {
  min-width: 36px;
  height: 32px;
  border-radius: 10px;
  font-size: 13px;
  background: linear-gradient(135deg, rgba(30, 58, 95, 0.12) 0%, rgba(37, 99, 235, 0.18) 100%);
  border: 1px solid rgba(37, 99, 235, 0.15);
}

[data-theme="pro"] #cardStep4 { padding-bottom: 12px; }
[data-theme="pro"] #cardStep4 .card-title { margin-bottom: 12px; }
[data-theme="pro"] #cardStep4 .label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #64748b;
}

[data-theme="pro"] #videoDisplay {
  border: 3px solid #0f172a;
  border-radius: 18px;
  background: radial-gradient(ellipse at 50% 30%, #1e293b 0%, #0f172a 70%);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.06) inset, 0 24px 48px rgba(15, 23, 42, 0.22);
  min-height: 480px;
  height: min(68vh, 580px);
}

[data-theme="pro"] .media-box.video-box2 {
  height: min(68vh, 580px);
  min-height: 480px;
}

[data-theme="pro"] #cardStep7 {
  margin-top: auto;
  border: 1px solid rgba(37, 99, 235, 0.2);
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.96) 0%, rgba(239, 246, 255, 0.92) 100%);
}

[data-theme="pro"] .step7-action-row { flex-direction: column; align-items: stretch; }
[data-theme="pro"] .btn-publish-main { width: 100%; padding: 14px 20px; font-size: 16px; }
[data-theme="pro"] #cardStep1 .media-box { border-radius: 12px; background: #f8fafc; }

[data-theme="pro"] .workflow-progress { margin-top: 14px; padding-top: 14px; }
[data-theme="pro"] .workflow-progress-track {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 4px;
  position: relative;
  padding: 6px 4px 0;
}
[data-theme="pro"] .workflow-progress-track::before {
  content: "";
  position: absolute;
  top: 20px;
  left: 28px;
  right: 28px;
  height: 2px;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.28), rgba(255, 255, 255, 0.12));
  z-index: 0;
}
[data-theme="pro"] .workflow-step { flex: 1; z-index: 1; gap: 6px; min-width: 0; }
[data-theme="pro"] .workflow-step-dot {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  margin: 0 auto;
  background: rgba(255, 255, 255, 0.12) !important;
  border: 2px solid rgba(255, 255, 255, 0.25);
  box-shadow: none !important;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.85);
  line-height: 1;
}
[data-theme="pro"] .workflow-step.done .workflow-step-dot {
  background: rgba(52, 211, 153, 0.25) !important;
  border-color: #34d399;
  color: #ecfdf5;
}
[data-theme="pro"] .workflow-step.current .workflow-step-dot {
  background: rgba(251, 191, 36, 0.3) !important;
  border-color: #fbbf24;
  color: #fffbeb;
  box-shadow: 0 0 0 4px rgba(251, 191, 36, 0.2), 0 0 16px rgba(251, 191, 36, 0.35) !important;
  transform: scale(1.06);
}
[data-theme="pro"] .workflow-step-label { font-size: 10px; opacity: 0.8; }

@media (max-width: 1100px) and (min-width: 769px) {
  [data-theme="pro"] .workspace {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: auto auto;
  }
  [data-theme="pro"] .ws-group-prep { grid-column: 1; grid-row: 1; }
  [data-theme="pro"] .ws-col-video {
    grid-column: 2;
    grid-row: 1 / span 2;
    position: sticky;
    top: 12px;
  }
  [data-theme="pro"] .ws-group-finish { grid-column: 1; grid-row: 2; }
}

/* ========== 导演：左侧步骤轨 + 右侧单列流式 ========== */
[data-theme="director"] .workspace-shell {
  display: grid;
  grid-template-columns: 196px minmax(0, 1fr);
  gap: 20px;
  max-width: 1080px;
  margin: 0 auto;
  align-items: start;
}

[data-theme="director"] .workspace-rail {
  display: flex;
  flex-direction: column;
  gap: 4px;
  position: sticky;
  top: 14px;
  padding: 14px 10px;
  background: #161b26;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
}

[data-theme="director"] .workspace-rail.is-empty { display: none; }

[data-theme="director"] .workspace-rail-title {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(251, 191, 36, 0.7);
  padding: 0 8px 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  margin-bottom: 6px;
}

[data-theme="director"] .rail-step {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 8px 10px;
  border: none;
  border-radius: 10px;
  background: transparent;
  color: #94a3b8;
  font-family: inherit;
  font-size: 12px;
  text-align: left;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}

[data-theme="director"] .rail-step:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #e2e8f0;
}

[data-theme="director"] .rail-step.done { color: #6ee7b7; }
[data-theme="director"] .rail-step.current {
  background: rgba(245, 158, 11, 0.15);
  color: #fcd34d;
  font-weight: 600;
}

[data-theme="director"] .rail-step-num {
  flex-shrink: 0;
  width: 26px;
  height: 26px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

[data-theme="director"] .rail-step.current .rail-step-num {
  background: var(--ipt-primary-gradient);
  color: #1a1206;
  border-color: transparent;
}

[data-theme="director"] .rail-step.done .rail-step-num {
  border-color: rgba(52, 211, 153, 0.4);
  color: #6ee7b7;
}

[data-theme="director"] .workspace {
  display: flex;
  flex-direction: column;
  gap: 28px;
  max-width: none;
}

[data-theme="director"] .ws-group-prep,
[data-theme="director"] .ws-group-finish {
  display: contents;
}

[data-theme="director"] .ws-col {
  display: contents;
}

[data-theme="director"] .card {
  scroll-margin-top: 20px;
}

[data-theme="director"] #cardStep4 {
  order: 0;
  padding: 0;
  background: transparent;
  border: none;
  box-shadow: none;
}

[data-theme="director"] #cardStep4 .card-title {
  justify-content: center;
  border: none;
  padding-bottom: 8px;
}

[data-theme="director"] #cardStep4 .field-row,
[data-theme="director"] #cardStep4 > .field:not(:last-child) {
  max-width: 640px;
  margin-left: auto;
  margin-right: auto;
  width: 100%;
}

[data-theme="director"] #videoDisplay {
  border: 4px solid #000;
  border-radius: 20px;
  background: #000;
  box-shadow:
    0 0 0 1px rgba(245, 158, 11, 0.25),
    0 32px 64px rgba(0, 0, 0, 0.65);
  min-height: 520px;
  height: min(78vh, 680px);
}

[data-theme="director"] .media-box.video-box2 {
  height: min(78vh, 680px);
  min-height: 520px;
}

[data-theme="director"] #cardStep7 {
  border: 1px solid rgba(245, 158, 11, 0.35);
  background: linear-gradient(160deg, #1c222f 0%, #141820 100%);
}

[data-theme="director"] #cardStep7 .btn-publish-main {
  width: 100%;
  padding: 16px;
  font-size: 17px;
}

[data-theme="director"] .step7-action-row {
  flex-direction: column;
  align-items: stretch;
}

@media (max-width: 900px) {
  [data-theme="director"] .workspace-shell {
    grid-template-columns: 1fr;
  }
  [data-theme="director"] .workspace-rail {
    position: static;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 6px;
    padding: 10px;
  }
  [data-theme="director"] .workspace-rail-title {
    width: 100%;
    margin-bottom: 4px;
    padding-bottom: 6px;
  }
  [data-theme="director"] .rail-step {
    flex: 1 1 auto;
    min-width: 0;
    padding: 6px 8px;
    font-size: 11px;
  }
  [data-theme="director"] .rail-step-label { display: none; }
  [data-theme="director"] #videoDisplay,
  [data-theme="director"] .media-box.video-box2 {
    height: 420px;
    min-height: 360px;
  }
}

@media (max-width: 768px) {
  [data-theme="pro"] .ws-col-video { position: static; }
  [data-theme="pro"] #videoDisplay,
  [data-theme="pro"] .media-box.video-box2 {
    height: 420px;
    min-height: 360px;
  }
}

/* 微信小程序 web-view 内嵌：为底部 Tab 预留空间 */
html.mp-embed body {
  padding-bottom: calc(96px + env(safe-area-inset-bottom, 0px));
  box-sizing: border-box;
}

html.mp-embed .page {
  padding-bottom: calc(16px + env(safe-area-inset-bottom, 0px));
}
