/* ══════════════════════════════════════════════════════════════════
   wc-layout-coupled-action-row · 12栅格整行动作与联立结果卡样式
   命名空间前缀: car- (CoupledActionRow)
   ══════════════════════════════════════════════════════════════════ */

.car-unit {
  grid-column: span 12;
  display: flex;
  flex-direction: column;
  width: 100%;
  box-sizing: border-box;
}

/* ── 第一行: 整行主动作卡 ── */
.car-main-card {
  position: relative;
  background: var(--ck-surface, #ffffff);
  border: 1px solid var(--ck-border, #dbe2ea);
  border-radius: 10px;
  padding: 14px 20px;
  transition: all .16s ease;
  display: grid;
  grid-template-columns: minmax(280px, 1.3fr) auto auto;
  gap: 18px;
  align-items: center;
  box-sizing: border-box;
  width: 100%;
}

@media (max-width: 960px) {
  .car-main-card {
    grid-template-columns: 1fr;
    gap: 12px;
  }
}

.car-main-card:hover {
  border-color: #60a5fa;
  box-shadow: 0 4px 12px rgba(37, 99, 235, .07);
}

/* 联立卡展开时: 上方主动作卡底边与下方联立卡无缝桥接 */
.car-unit.is-open .car-main-card {
  border-color: #2563eb;
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
  background: linear-gradient(90deg, #f8fbff 0%, #ffffff 100%);
}

.car-head {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.car-name {
  font-weight: 700;
  font-size: 15.5px;
  color: #0f172a;
}

.car-group-tag {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 9px;
  border-radius: 12px;
  background: #eff6ff;
  color: #1d4ed8;
  border: 1px solid #bfdbfe;
  white-space: nowrap;
}

.car-target-tag {
  font-size: 11.5px;
  color: #64748b;
  font-family: "SF Mono", Menlo, Consolas, monospace;
}

.car-desc {
  font-size: 13px;
  color: #475569;
  line-height: 1.5;
  margin-top: 4px;
}

/* ── 中部行内参数区 ── */
.car-params {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 7px 12px;
  align-items: center;
}

.car-param-item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  color: #334155;
  font-weight: 600;
}

.car-param-input {
  padding: 4px 8px;
  border: 1px solid #cbd5e1;
  border-radius: 5px;
  font-family: "SF Mono", Menlo, Consolas, monospace;
  font-size: 12px;
  width: 110px;
  background: #fff;
  color: #0f172a;
}

/* ── 右侧动作按钮栏 ── */
.car-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  justify-content: flex-end;
  white-space: nowrap;
}

.car-exec-btn {
  background: #2563eb;
  border: 1px solid #1d4ed8;
  color: #ffffff;
  border-radius: 7px;
  padding: 7px 14px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s;
}

.car-exec-btn:hover {
  background: #1d4ed8;
}

.car-toggle-btn {
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  color: #334155;
  border-radius: 7px;
  padding: 6px 12px;
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
  transition: all .15s;
}

.car-toggle-btn:hover {
  background: #e2e8f0;
  color: #0f172a;
}

/* ── 第二行: 整行按需展开联立结果卡 ── */
@keyframes carSlideDown {
  from {
    opacity: 0;
    transform: translateY(-6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.car-coupled-card {
  display: none;
  background: #ffffff;
  border: 1.5px solid #2563eb;
  border-top: 2px dashed #93c5fd;
  border-bottom-left-radius: 10px;
  border-bottom-right-radius: 10px;
  padding: 18px 22px;
  box-shadow: 0 10px 26px rgba(15, 23, 42, .07);
  animation: carSlideDown .18s ease-out;
  box-sizing: border-box;
  width: 100%;
}

.car-unit.is-open .car-coupled-card {
  display: block;
}

.car-coupled-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid #e2e8f0;
}

.car-coupled-title {
  font-weight: 700;
  font-size: 15px;
  color: #0f172a;
  display: flex;
  align-items: center;
  gap: 10px;
}

.car-badge {
  font-size: 12px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 12px;
  white-space: nowrap;
}

.car-badge.ok      { background: #dcfce7; color: #15803d; }
.car-badge.running { background: #fef3c7; color: #b45309; }
.car-badge.pending { background: #f1f5f9; color: #64748b; }

.car-meta {
  font-size: 12px;
  color: #64748b;
}

/* ══════════════ 内置 Admin Auth 强制登录遮罩弹窗 (car-auth-*) ══════════════ */
.car-auth-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(15, 23, 42, 0.72);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.car-auth-overlay[hidden] {
  display: none !important;
}

.car-auth-dialog {
  width: 100%;
  max-width: 380px;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 14px;
  box-shadow: 0 20px 50px rgba(15, 23, 42, 0.35);
  padding: 26px 28px 22px;
  box-sizing: border-box;
}

.car-auth-icon {
  width: 42px;
  height: 42px;
  margin: 0 auto 12px;
  border-radius: 10px;
  background: #eff6ff;
  color: #2563eb;
  border: 1px solid #bfdbfe;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
}

.car-auth-title {
  margin: 0 0 4px;
  font-size: 17px;
  font-weight: 700;
  color: #0f172a;
  text-align: center;
}

.car-auth-sub {
  margin: 0 0 18px;
  font-size: 12.5px;
  color: #64748b;
  text-align: center;
}

.car-auth-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

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

.car-auth-label {
  font-size: 12px;
  font-weight: 600;
  color: #334155;
}

.car-auth-input {
  width: 100%;
  box-sizing: border-box;
  padding: 9px 12px;
  font-size: 14px;
  color: #0f172a;
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  outline: none;
}

.car-auth-input:focus {
  border-color: #2563eb;
  background: #ffffff;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.14);
}

.car-auth-err {
  padding: 8px 11px;
  font-size: 12px;
  border-radius: 7px;
  color: #b91c1c;
  background: #fef2f2;
  border: 1px solid #fecaca;
}

.car-auth-submit {
  margin-top: 4px;
  padding: 10px 14px;
  font-size: 14px;
  font-weight: 600;
  color: #ffffff;
  background: #2563eb;
  border: none;
  border-radius: 8px;
  cursor: pointer;
}

.car-auth-submit:hover:not(:disabled) {
  background: #1d4ed8;
}

.car-auth-submit:disabled {
  opacity: 0.6;
  cursor: wait;
}
