/* ========================================================================
   pipeline-board.css —— 首页 AI 工作流看板（采集 → 清洗 → 翻译 → 入库）
   ======================================================================== */
.pipeline {
  position: relative;
  z-index: 1;
  padding: 100px 48px;
  max-width: 1280px;
  margin: 0 auto;
}
.pipeline-desc {
  margin: -18px auto 34px;
  max-width: 700px;
  text-align: center;
  font-size: 14px;
  line-height: 1.8;
  color: var(--text-secondary);
}

.pipe {
  padding: 22px;
  border: 1px solid var(--border-color);
  border-radius: 10px;
  background: rgba(6, 10, 16, 0.55);
}

/* ---------- 顶部指标 ---------- */
.pipe-kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}
.pipe-kpi {
  position: relative;
  overflow: hidden;
  padding: 16px 18px 14px;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  background: linear-gradient(165deg, rgba(58, 123, 213, 0.1), rgba(255, 255, 255, 0.012) 55%);
}
.pipe-kpi::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--accent), transparent);
  opacity: 0.65;
}
.pipe-kpi[data-kpi="clean"] {
  background: linear-gradient(165deg, rgba(47, 191, 160, 0.1), rgba(255, 255, 255, 0.012) 55%);
}
.pipe-kpi[data-kpi="clean"]::after {
  background: linear-gradient(90deg, #2fbfa0, transparent);
}
.pipe-kpi[data-kpi="translate"] {
  background: linear-gradient(165deg, rgba(201, 165, 76, 0.1), rgba(255, 255, 255, 0.012) 55%);
}
.pipe-kpi[data-kpi="translate"]::after {
  background: linear-gradient(90deg, var(--gold), transparent);
}
.pipe-kpi[data-kpi="submit"] {
  background: linear-gradient(165deg, rgba(143, 111, 224, 0.12), rgba(255, 255, 255, 0.012) 55%);
}
.pipe-kpi[data-kpi="submit"]::after {
  background: linear-gradient(90deg, #8f6fe0, transparent);
}
.pipe-kpi-label {
  font-size: 11px;
  letter-spacing: 2px;
  color: var(--text-muted);
}
.pipe-kpi-value {
  display: flex;
  align-items: baseline;
  gap: 6px;
  margin-top: 6px;
}
.pipe-kpi-value strong {
  font-size: 30px;
  font-weight: 700;
  line-height: 1.1;
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
}
.pipe-kpi-value em {
  font-style: normal;
  font-size: 12px;
  color: var(--text-secondary);
}
.pipe-kpi-note {
  display: block;
  margin-top: 4px;
  font-size: 11px;
  color: var(--text-muted);
}

/* ---------- 四段流水线 ---------- */
.pipe-track {
  position: relative;
  margin: 24px 0;
}
.pipe-track-line {
  position: absolute;
  left: 12%;
  right: 12%;
  top: 70px;
  height: 1px;
  background: linear-gradient(90deg,
    rgba(58, 123, 213, 0.55),
    rgba(47, 191, 160, 0.45),
    rgba(201, 165, 76, 0.5),
    rgba(143, 111, 224, 0.5));
}
.pipe-stages {
  position: relative;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
  list-style: none;
}
.pipe-stage {
  padding: 16px;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.02);
  transition: border-color 0.3s, box-shadow 0.3s, transform 0.3s;
}
.pipe-stage:hover {
  transform: translateY(-2px);
  border-color: rgba(58, 123, 213, 0.45);
}
.pipe-stage[data-state="running"] {
  border-color: var(--accent);
  box-shadow: 0 0 26px rgba(58, 123, 213, 0.18);
}

.pipe-stage-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 14px;
}
.pipe-stage-no {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 11px;
  letter-spacing: 2px;
  color: var(--text-muted);
}
.pipe-state {
  padding: 2px 8px;
  border: 1px solid rgba(47, 191, 160, 0.35);
  border-radius: 999px;
  background: rgba(47, 191, 160, 0.08);
  color: #4fd1b0;
  font-size: 10px;
  letter-spacing: 1px;
  white-space: nowrap;
}
.pipe-stage[data-state="pending"] .pipe-state,
.pipe-stage[data-state="empty"] .pipe-state {
  border-color: var(--border-color);
  background: transparent;
  color: var(--text-muted);
}
.pipe-stage[data-state="running"] .pipe-state {
  border-color: rgba(58, 123, 213, 0.5);
  background: rgba(58, 123, 213, 0.14);
  color: var(--accent-light);
}

.pipe-stage-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  margin-bottom: 12px;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  background: rgba(58, 123, 213, 0.08);
  color: var(--accent-light);
}
.pipe-stage-icon svg {
  width: 20px;
  height: 20px;
}
.pipe-stage[data-stage="clean"] .pipe-stage-icon {
  background: rgba(47, 191, 160, 0.08);
  color: #4fd1b0;
}
.pipe-stage[data-stage="translate"] .pipe-stage-icon {
  background: rgba(201, 165, 76, 0.08);
  color: var(--gold-light);
}
.pipe-stage[data-stage="submit"] .pipe-stage-icon {
  background: rgba(143, 111, 224, 0.1);
  color: #b49bf0;
}

.pipe-stage h3 {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 1px;
  color: var(--text-primary);
}
.pipe-stage > p {
  margin-top: 6px;
  min-height: 38px;
  font-size: 12px;
  line-height: 1.6;
  color: var(--text-secondary);
}

.pipe-stage-bar {
  height: 4px;
  margin: 14px 0 10px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.06);
  overflow: hidden;
}
.pipe-stage-bar i {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--accent), var(--accent-light));
  transition: width 0.7s ease;
}
.pipe-stage[data-stage="clean"] .pipe-stage-bar i {
  background: linear-gradient(90deg, #1f8f78, #4fd1b0);
}
.pipe-stage[data-stage="translate"] .pipe-stage-bar i {
  background: linear-gradient(90deg, #9a7a2e, var(--gold-light));
}
.pipe-stage[data-stage="submit"] .pipe-stage-bar i {
  background: linear-gradient(90deg, #6b4fc0, #b49bf0);
}

.pipe-stage-meta {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 11px;
  color: var(--text-secondary);
}
.pipe-stage-meta .is-count {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color: var(--text-primary);
}

/* ---------- 日志与漏斗 ---------- */
.pipe-panels {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr);
  gap: 14px;
}
.pipe-panel {
  padding: 14px 16px;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.015);
}
.pipe-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
  font-size: 12px;
  letter-spacing: 1px;
  color: var(--text-secondary);
}
.pipe-panel-head strong {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 1px;
  color: var(--text-primary);
}
.pipe-run {
  padding: 5px 14px;
  border: 1px solid rgba(201, 165, 76, 0.45);
  border-radius: 4px;
  background: rgba(201, 165, 76, 0.08);
  color: var(--gold-light);
  font-size: 12px;
  letter-spacing: 1px;
  cursor: pointer;
  transition: all 0.25s;
}
.pipe-run:hover:not(:disabled) {
  background: rgba(201, 165, 76, 0.16);
  box-shadow: var(--glow-gold);
}
.pipe-run:disabled {
  opacity: 0.55;
  cursor: default;
}

.pipe-log {
  display: flex;
  flex-direction: column;
  gap: 8px;
  height: 196px;
  padding-right: 4px;
  overflow-y: auto;
  list-style: none;
  font-size: 12px;
  scrollbar-width: thin;
  scrollbar-color: var(--border-color) transparent;
}
.pipe-log::-webkit-scrollbar { width: 4px; }
.pipe-log::-webkit-scrollbar-thumb { background: var(--border-color); border-radius: 2px; }
.pipe-log-item {
  display: flex;
  align-items: baseline;
  gap: 10px;
  color: var(--text-secondary);
  animation: pipeLogIn 0.3s ease;
}
.pipe-log-time {
  flex: 0 0 auto;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 11px;
  color: var(--text-muted);
}
.pipe-log-tag {
  flex: 0 0 auto;
  padding: 1px 6px;
  border-radius: 3px;
  background: rgba(58, 123, 213, 0.12);
  color: var(--accent-light);
  font-size: 10px;
  letter-spacing: 1px;
}
.pipe-log-item.is-ok .pipe-log-tag {
  background: rgba(47, 191, 160, 0.12);
  color: #4fd1b0;
}
.pipe-log-item.is-done .pipe-log-tag {
  background: rgba(201, 165, 76, 0.12);
  color: var(--gold-light);
}
.pipe-log-item.is-warn .pipe-log-tag {
  background: rgba(201, 165, 76, 0.12);
  color: var(--gold-light);
}
.pipe-log-text {
  min-width: 0;
  line-height: 1.6;
}
@keyframes pipeLogIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

.pipe-funnel {
  display: flex;
  flex-direction: column;
  gap: 13px;
  padding-top: 6px;
  list-style: none;
}
.pipe-funnel li {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  font-size: 11px;
  color: var(--text-secondary);
}
.pipe-funnel-bar {
  height: 8px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.05);
  overflow: hidden;
}
.pipe-funnel-bar i {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 4px;
  background: linear-gradient(90deg, var(--accent), var(--accent-light));
  transition: width 0.7s ease;
}
.pipe-funnel li:nth-child(2) .pipe-funnel-bar i {
  background: linear-gradient(90deg, #1f8f78, #4fd1b0);
}
.pipe-funnel li:nth-child(3) .pipe-funnel-bar i {
  background: linear-gradient(90deg, #9a7a2e, var(--gold-light));
}
.pipe-funnel li:nth-child(4) .pipe-funnel-bar i {
  background: linear-gradient(90deg, #6b4fc0, #b49bf0);
}
.pipe-funnel em {
  font-style: normal;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color: var(--text-primary);
}

/* ---------- 响应式 ---------- */
@media (max-width: 1024px) {
  .pipeline { padding: 80px 32px; }
  .pipe-kpis,
  .pipe-stages { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pipe-track-line { display: none; }
  .pipe-panels { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .pipeline { padding: 64px 20px; }
  .pipe { padding: 14px; }
  .pipe-kpis,
  .pipe-stages { grid-template-columns: 1fr; }
  .pipe-kpi-value strong { font-size: 26px; }
  .pipe-log { height: 220px; }
}
@media (prefers-reduced-motion: reduce) {
  .pipe-stage,
  .pipe-stage-bar i,
  .pipe-funnel-bar i { transition: none; }
  .pipe-log-item { animation: none; }
}
