/* ============================================================
   JR杰瑞 · 短剧工坊 「上时间轴 · 下工作台」
   2026-09-10 19:35 · 只做布局/视觉层，不动 id/data-action/class
   依赖：drama.html 内联样式（.director-phases 基础定义）
   ============================================================ */

/* ---------- 1. 时间轴吸顶：含阶段条的 tabs 容器固定在内容区顶部 ---------- */
/* 内容区去掉顶部 padding，让吸顶条真正贴到顶部（否则滚动时有 24px 内容穿透缝隙） */
#dramaMain:has(> div:first-child .director-phases) { padding-top: 0 !important; }

#dramaMain > div:first-child:has(.director-phases) {
  position: sticky;
  top: 0;
  z-index: 30;
  margin: 0 -24px 14px;
  padding: 12px 24px 10px;
  background: var(--bg, #040814);
  border-bottom: 1px solid var(--line, rgba(255, 255, 255, .08));
}

/* ---------- 2. 阶段条 → 横向时间轴（节点 + 贯穿连线） ---------- */
.director-phases {
  display: grid !important;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  align-items: start;
  gap: 0;
  margin-bottom: 10px !important;
  padding: 4px 0 0 !important;
  background: transparent !important;
  border: none !important;
  border-radius: 0;
}

/* 原来的 → 箭头退役，改用连线 */
.director-phases .phase-arrow { display: none !important; }

.director-phases .phase-step {
  position: relative;
  display: flex !important;
  flex-direction: column;
  align-items: center;
  gap: 7px;
  padding: 2px 6px 6px !important;
  border-radius: 10px;
  background: transparent !important;
  transition: background .2s cubic-bezier(.2, .7, .3, 1);
}
.director-phases .phase-step:hover {
  background: var(--eco-soft, rgba(217, 154, 43, .08)) !important;
}

.director-phases .phase-info { text-align: center; }
.director-phases .phase-label { font-size: 13.5px; font-weight: 600; line-height: 1.35; }
.director-phases .phase-desc {
  font-size: 11.5px;
  color: var(--muted, #8892a6);
  margin-top: 2px;
  letter-spacing: .01em;
}

/* 圆点节点 */
.director-phases .phase-num {
  position: relative;
  z-index: 2;
  width: 32px !important;
  height: 32px !important;
  font-size: 13px !important;
  background: rgba(255, 255, 255, .06) !important;
  border: 2px solid var(--line, rgba(255, 255, 255, .14));
  color: var(--muted, #8892a6) !important;
  box-sizing: border-box;
  transition: all .2s cubic-bezier(.2, .7, .3, 1);
}
.director-phases .phase-step.active .phase-num {
  background: var(--eco, #D99A2B) !important;
  border-color: var(--eco, #D99A2B) !important;
  color: #1c1a17 !important;
  box-shadow: 0 0 0 4px var(--eco-soft, rgba(217, 154, 43, .14));
}
.director-phases .phase-step.done .phase-num { font-size: 0 !important; }
.director-phases .phase-step.done .phase-num::after { content: '✓' !important; font-size: 15px !important; }
.director-phases .phase-step.done .phase-num {
  background: var(--eco-soft, rgba(217, 154, 43, .12)) !important;
  border-color: var(--eco, #D99A2B) !important;
  color: var(--eco-text, #D99A2B) !important;
}

/* 当前阶段的文字用剧场藤黄，锁定态维持灰 */
.director-phases .phase-step.active .phase-label { color: var(--eco-text, #E0A83C); }

/* 节点之间的贯穿连线（最后一个节点不出线） */
.director-phases .phase-step:not(:last-child)::before {
  content: '';
  position: absolute;
  top: 17px;
  left: calc(50% + 21px);
  right: calc(-50% + 21px);
  height: 2px;
  border-radius: 2px;
  background: var(--line, rgba(255, 255, 255, .10));
}
.director-phases .phase-step.done:not(:last-child)::before {
  background: linear-gradient(90deg, var(--eco, #D99A2B), var(--eco-line, rgba(217, 154, 43, .4)));
}

/* ---------- 3. 阶段提示条收紧，跟时间轴一起吸顶 ---------- */
.phase-tip {
  margin-bottom: 0 !important;
  padding: 8px 12px !important;
  font-size: 12.5px !important;
  border-radius: 8px !important;
  background: var(--eco-soft, rgba(217, 154, 43, .06)) !important;
  border-color: var(--eco-line, rgba(217, 154, 43, .18)) !important;
}

/* ---------- 4. 响应式：窄屏时间轴横向滑动，不吸顶 ---------- */
@media (max-width: 900px) {
  #dramaMain > div:first-child:has(.director-phases) {
    position: static;
    margin: 0 0 12px;
    padding: 0;
    border-bottom: none;
  }
  .director-phases {
    grid-template-columns: repeat(4, minmax(104px, 1fr));
    overflow-x: auto;
    padding-bottom: 4px !important;
  }
  .director-phases .phase-desc { display: none; }
}
