/* 剧本详情页：二级页面，所有内容来自 MySQL 快照；与后台面板共用 console.css 的设计变量。 */
.project-page { padding-top: 2px; }
.project-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 28px;
  margin-bottom: 8px;
  color: var(--ink-3);
  font-size: 12px;
}
.project-back:hover { color: var(--blue); }
.project-back:focus-visible { outline: 2px solid rgba(51, 112, 255, .3); outline-offset: 2px; border-radius: 4px; }

.project-header { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 14px 24px; }
.page-title-block { min-width: 0; }
.project-title {
  margin: 0;
  color: var(--ink);
  font-size: 22px;
  font-weight: 600;
  line-height: 1.35;
  letter-spacing: -.3px;
  overflow-wrap: anywhere;
}
.project-title:focus { outline: none; }
.project-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; margin-top: 10px; color: var(--ink-4); font-size: 12px; }
.project-meta-item { display: inline-flex; align-items: baseline; gap: 5px; }
.project-meta-label { color: var(--ink-4); font-size: 11.5px; }
.project-meta-value { color: var(--ink-2); font-size: 12px; }
.project-meta-tags { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.project-meta-note { width: 100%; color: var(--ink-4); font-size: 11px; }

.project-status-tag,
.project-secondary-tag {
  display: inline-flex;
  align-items: center;
  height: 22px;
  padding: 0 8px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 400;
  line-height: 1;
  white-space: nowrap;
}
.project-status-tag.is-active { background: var(--blue-soft); color: var(--blue); }
.project-status-tag.is-paused { background: var(--orange-soft); color: #d25f00; }
.project-status-tag.is-closed { background: #f2f3f5; color: var(--ink-3); }
.project-status-tag.is-pending,
.project-status-tag.is-unknown { background: #f2f3f5; color: var(--ink-4); }
.project-secondary-tag { background: #f7f8fa; color: var(--ink-3); }
.project-secondary-tag.is-rating { background: var(--gold-soft); color: #a87300; }

.project-hero {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  min-width: 160px;
  padding: 10px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}
.project-hero-label { color: var(--ink-4); font-size: 11.5px; }
.project-hero-value {
  color: var(--ink);
  font-size: 30px;
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -.8px;
  font-variant-numeric: tabular-nums;
}
.project-hero-value.is-long { font-size: 18px; letter-spacing: 0; }
.project-hero-value.is-empty { color: var(--ink-4); font-size: 22px; letter-spacing: 0; }
.project-hero-value.is-good { color: var(--green); }
.project-hero-value.is-warn { color: var(--orange); }
.project-hero-note { color: var(--ink-4); font-size: 11px; }

.project-summary { max-width: 980px; margin: 16px 0 0; color: var(--ink-2); font-size: 13px; line-height: 1.85; }

.project-stats {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
  margin: 16px 0 18px;
}
.project-stat { min-width: 0; padding: 12px 14px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); }
.project-stat dt { margin-bottom: 5px; color: var(--ink-4); font-size: 11.5px; line-height: 17px; }
.project-stat dd {
  margin: 0;
  color: var(--ink);
  font-size: 20px;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: -.4px;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}
.project-stat dd.is-long { font-size: 15px; letter-spacing: 0; line-height: 1.45; }
.project-stat.is-accent dd { color: var(--blue); }
.project-stat.is-empty dd { color: var(--ink-5); }

.project-sections { display: flex; flex-direction: column; gap: 14px; }
.project-section { padding: 16px 18px 8px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.project-section-head { position: relative; padding-right: 110px; }
.page-eyebrow { color: var(--ink-4); font-size: 10px; font-weight: 500; line-height: 1.5; letter-spacing: .12em; }
.project-section-head h2 { margin: 3px 0 4px; color: var(--ink); font-size: 15px; font-weight: 600; line-height: 1.35; }
.project-section-head p { color: var(--ink-4); font-size: 12px; line-height: 1.65; }
.project-section-count { position: absolute; top: 2px; right: 0; color: var(--ink-4); font-size: 11px; font-variant-numeric: tabular-nums; }
.project-empty { padding: 12px 0 18px; color: var(--ink-4); font-size: 12px; }
.project-empty.history-empty { padding: 12px 0 18px; }

.project-fields { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); column-gap: 28px; margin: 6px 0 10px; padding: 0; }
.project-field { display: grid; grid-template-columns: 106px minmax(0, 1fr); align-items: baseline; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line-soft); }
.project-field.is-wide { grid-column: 1 / -1; }
.project-field.is-key dd { color: var(--ink); font-size: 13.5px; font-weight: 600; font-variant-numeric: tabular-nums; }
.project-field dt { color: var(--ink-4); font-size: 11.5px; line-height: 1.8; }
.project-field dd { margin: 0; color: var(--ink); font-size: 13px; line-height: 1.8; overflow-wrap: anywhere; white-space: pre-wrap; }
.project-link { color: var(--blue); }
.project-link:hover { color: #245bdb; text-decoration: underline; }
.project-tags { display: inline-flex; flex-wrap: wrap; gap: 4px; }
.project-tag { display: inline-flex; align-items: center; height: 21px; padding: 0 8px; border-radius: 4px; background: #f2f3f5; color: var(--ink-2); font-size: 11.5px; }
.project-people { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; }
.project-person { display: inline-flex; align-items: center; gap: 5px; }
.project-person-avatar { display: inline-grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; background: var(--blue-soft); color: #384252; font-size: 10px; font-weight: 500; }
.field-tag { display: inline-flex; align-items: center; height: 20px; padding: 0 7px; border-radius: 4px; background: #f2f3f5; color: var(--ink-3); font-size: 11px; font-weight: 400; }
.field-tag.is-green { background: var(--green-soft); color: var(--green); }
.field-tag.is-blue { background: var(--blue-soft); color: var(--blue); }
.field-tag.is-orange { background: var(--orange-soft); color: #d25f00; }
.field-tag.is-red { background: var(--red-soft); color: var(--red); }
.field-tag.is-gold { background: var(--gold-soft); color: #a87300; }
.field-tag.is-muted { background: #f2f3f5; color: var(--ink-4); }
.project-field dd.history-empty { white-space: normal; }

.history-list { display: flex; flex-direction: column; gap: 8px; padding: 6px 0 12px; }
.history-item { padding: 12px 14px; border: 1px solid var(--line-soft); border-radius: 8px; background: var(--surface-2); }
.history-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px; }
.history-time { color: var(--ink-2); font-size: 12px; font-weight: 500; font-variant-numeric: tabular-nums; }
.history-count { color: var(--ink-4); font-size: 11px; }
.history-status { margin-top: 7px; color: var(--ink-2); font-size: 12px; }
.history-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 24px; margin: 6px 0 0; }
.history-field { display: grid; grid-template-columns: 92px minmax(0, 1fr); gap: 8px; padding: 6px 0; border-bottom: 1px dashed var(--line-soft); }
.history-field dt { color: var(--ink-4); font-size: 11.5px; }
.history-field dd { margin: 0; color: var(--ink-2); font-size: 12px; overflow-wrap: anywhere; }
.history-before { color: var(--ink-4); text-decoration: line-through; text-decoration-color: var(--line-strong); }
.history-arrow { margin: 0 5px; color: var(--ink-5); }
.history-after.is-added { color: var(--green); font-weight: 500; }
.history-after.is-changed { color: var(--orange); font-weight: 500; }
.history-after.is-removed { color: var(--red); }

.project-history.history-empty { padding: 0; }
.project-source {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 16px;
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  color: var(--ink-4);
  font-size: 11.5px;
}
.project-source-note { color: var(--ink-4); }
.project-source-link { color: var(--ink-3); }
.project-source-link:hover { color: var(--blue); }

@media (max-width: 1180px) {
  .project-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .project-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .history-fields { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 720px) {
  .project-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .project-fields { grid-template-columns: minmax(0, 1fr); }
  .project-field { grid-template-columns: 96px minmax(0, 1fr); }
  .project-header { align-items: flex-start; }
  .project-hero { align-items: flex-start; min-width: 0; }
  .project-section-head { padding-right: 0; }
  .project-section-count { position: static; display: block; margin-top: 2px; }
}

/* 数据变化：关键指标前后对比，全部字段变动折叠为审计明细。 */
.history-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px 12px;
  margin: 10px 0 4px;
}
.history-metric {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
  padding: 8px 10px;
  border: 1px solid var(--line-soft);
  border-radius: 6px;
  background: #fff;
}
.history-metric dt { color: var(--ink-4); font-size: 11.5px; line-height: 16px; }
.history-metric dd { margin: 0; font-size: 13px; line-height: 1.6; overflow-wrap: anywhere; }
.history-text-changes { margin: 7px 0 0; color: var(--ink-2); font-size: 12px; line-height: 1.7; }
.history-all { margin-top: 10px; padding-top: 8px; border-top: 1px dashed var(--line-soft); }
.history-all-summary { display: inline-block; padding: 2px 0; color: var(--ink-3); font-size: 12px; cursor: pointer; user-select: none; }
.history-all-summary:hover { color: var(--blue); }
.history-all[open] .history-all-summary { color: var(--ink-2); }
.history-all .history-fields { margin-top: 4px; }
@media (max-width: 900px) {
  .history-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 560px) {
  .history-metrics { grid-template-columns: minmax(0, 1fr); }
}

/* ============ 详情页经营摘要：重点提示、流程、预计与实际、收入构成 ============ */
.project-alerts {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: -2px 0 14px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}
.project-alerts-label {
  padding-right: 10px;
  border-right: 1px solid var(--line);
  color: var(--ink-3);
  font-size: 12px;
  font-weight: 500;
}
.project-alert {
  display: inline-flex;
  align-items: center;
  height: 24px;
  padding: 0 9px;
  border-radius: 4px;
  background: #f2f3f5;
  color: var(--ink-2);
  font-size: 12px;
  white-space: nowrap;
}
.project-alert.is-danger { background: var(--red-soft); color: var(--red); }
.project-alert.is-warn { background: var(--orange-soft); color: #d25f00; }
.project-alert.is-muted { background: #f2f3f5; color: var(--ink-3); }

.flow-scroll { overflow-x: auto; padding: 12px 2px 6px; margin: 0 -6px; }
.flow {
  position: relative;
  display: flex;
  gap: 10px;
  min-width: 1120px;
  margin: 0;
  padding: 0 4px 6px;
  list-style: none;
}
.flow::before {
  content: '';
  position: absolute;
  top: 15px;
  left: calc(100% / 16);
  right: calc(100% / 16);
  height: 2px;
  background: var(--line);
  z-index: 0;
}
.flow-step { position: relative; z-index: 1; flex: 1 1 0; min-width: 128px; padding: 0 4px; }
.flow-marker {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border: 2px solid var(--line-strong);
  border-radius: 50%;
  background: var(--surface);
  color: var(--ink-4);
  font-size: 12px;
  font-weight: 600;
}
.flow-step.is-done .flow-marker { border-color: var(--blue); background: var(--blue); color: #fff; }
.flow-step.is-active .flow-marker { border-color: var(--blue); background: var(--blue-soft); color: var(--blue); }
.flow-step.is-overdue .flow-marker,
.flow-step.is-paused .flow-marker { border-color: var(--orange); background: var(--orange-soft); color: #d25f00; }
.flow-step.is-back .flow-marker { border-color: var(--red); background: var(--red-soft); color: var(--red); }
.flow-body { padding-top: 8px; }
.flow-step:hover .flow-title { color: var(--blue); }
.flow-head { display: flex; align-items: center; gap: 6px; margin-bottom: 4px; }
.flow-title { margin: 0; color: var(--ink); font-size: 13px; font-weight: 600; line-height: 1.4; }
.flow-state {
  display: inline-flex;
  align-items: center;
  height: 18px;
  padding: 0 6px;
  border-radius: 3px;
  background: #f2f3f5;
  color: var(--ink-3);
  font-size: 10.5px;
  white-space: nowrap;
}
.flow-state.is-done,
.flow-state.is-active { background: var(--blue-soft); color: var(--blue); }
.flow-state.is-overdue,
.flow-state.is-paused { background: var(--orange-soft); color: #d25f00; }
.flow-state.is-back { background: var(--red-soft); color: var(--red); }
.flow-line { margin: 2px 0 0; color: var(--ink-3); font-size: 11.5px; line-height: 1.6; overflow-wrap: anywhere; }
.flow-note { margin: 4px 0 0; color: var(--ink-4); font-size: 11px; line-height: 1.55; }

.project-pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin-top: 14px; }
.project-pair .project-section { padding-bottom: 16px; }
.project-compare-row + .project-compare-row { margin-top: 12px; padding-top: 12px; border-top: 1px dashed var(--line-soft); }
.project-compare-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.project-compare-label { color: var(--ink-2); font-size: 12.5px; font-weight: 500; }
.project-compare-note { color: var(--ink-4); font-size: 11.5px; }
.project-compare-note.is-good { color: var(--green); }
.project-compare-note.is-warn { color: var(--orange); }
.project-compare-note.is-danger { color: var(--red); }
.project-compare-values {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 8px;
  margin-top: 4px;
  color: var(--ink-3);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}
.project-compare-before { color: var(--ink-4); }
.project-compare-arrow { color: var(--ink-5); }
.project-compare-after { color: var(--ink); font-weight: 500; }
.project-compare-bar { height: 6px; margin-top: 7px; overflow: hidden; border-radius: 999px; background: #f2f3f5; }
.project-compare-fill { display: block; height: 100%; border-radius: inherit; background: var(--blue); }
.project-compare-fill.is-warn { background: var(--orange); }
.project-compare-fill.is-danger { background: var(--red); }
.project-compare-fill.is-good { background: var(--green); }

.income-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-bottom: 6px; }
.income-head-label { color: var(--ink-4); font-size: 11.5px; }
.income-head-value { color: var(--ink); font-size: 20px; font-weight: 600; font-variant-numeric: tabular-nums; letter-spacing: -.3px; }
.income-stack { display: flex; height: 10px; margin: 6px 0 12px; overflow: hidden; border-radius: 999px; background: #f2f3f5; }
.income-segment { display: block; height: 100%; }
.income-list { display: flex; flex-direction: column; gap: 7px; margin: 0; padding: 0; list-style: none; }
.income-item.is-empty { color: var(--ink-4); }
.income-item.is-empty .income-value { color: var(--ink-4); font-weight: 400; }
.income-item { display: grid; grid-template-columns: 10px minmax(0, 1fr) auto auto; align-items: center; gap: 8px; color: var(--ink-2); font-size: 12px; }
.income-dot { width: 8px; height: 8px; border-radius: 50%; }
.income-label { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.income-value { color: var(--ink); font-weight: 500; font-variant-numeric: tabular-nums; }
.income-share { color: var(--ink-4); font-size: 11.5px; font-variant-numeric: tabular-nums; }
.income-total { margin-top: 10px; color: var(--ink-4); font-size: 11.5px; }

.project-stat-note { display: block; margin-top: 3px; color: var(--ink-4); font-size: 11px; line-height: 1.5; }
.project-sections { margin-top: 14px; }

@media (max-width: 1180px) {
  .project-pair { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 720px) {
  .flow { min-width: 980px; }
  .project-alerts { padding: 10px 12px; }
}
