/* ==========================================================================
   用户任务市场：任务卡片 / 详情 / 发布
   ========================================================================== */

/* 任务状态徽标（公共任务平台专属，自包含样式，避免依赖 account.css） */
.badge {
  display: inline-block;
  padding: 4px 12px;
  font-size: 12.5px;
  font-weight: 600;
  border-radius: 999px;
  white-space: nowrap;
  line-height: 1.55;
}
/* 待接单：实色填充 + 投影，视觉最突出，引导接单 */
.badge--mkt-open      { color: #fff; background: #1a56db; box-shadow: 0 2px 8px rgba(26, 86, 219, .35); }
.badge--mkt-assigned  { color: #0b6bcb; background: #e3f0ff; } /* 进行中 */
.badge--mkt-delivered { color: #b76e00; background: #fff3d6; } /* 待验收 */
.badge--mkt-settled   { color: #6d3bd4; background: #efe6ff; } /* 待平台审核 */
.badge--mkt-done      { color: #0a7a5c; background: #dcf5ec; } /* 已完成 */
.badge--mkt-cancelled { color: #c22a2a; background: #ffe4e4; } /* 已取消 */

/* 待接单呼吸式投影，进一步吸引注意（尊重减弱动态偏好） */
@keyframes mktOpenPulse {
  0%, 100% { box-shadow: 0 2px 8px rgba(26, 86, 219, .35); }
  50%      { box-shadow: 0 2px 14px rgba(26, 86, 219, .55); }
}
@media (prefers-reduced-motion: no-preference) {
  .badge--mkt-open { animation: mktOpenPulse 2.2s ease-in-out infinite; }
}

.mkt-hero__actions {
  margin-top: 22px;
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}

.mkt-status-filter { min-width: 130px; }

/* 任务卡片网格 */
.mkt-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 18px;
}
.mkt-card {
  display: flex;
  flex-direction: column;
  padding: 20px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 2px 10px rgba(15, 45, 90, .04);
  transition: transform .2s var(--ease), box-shadow .2s var(--ease);
}
.mkt-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 26px rgba(15, 45, 90, .1);
}
.mkt-card__top {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}
.mkt-card__title {
  font-size: 17px;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 8px;
  line-height: 1.4;
}
.mkt-card__desc {
  font-size: 13.5px;
  color: var(--muted);
  line-height: 1.7;
  margin-bottom: 14px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.mkt-card__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  font-size: 13px;
  color: var(--muted);
  padding: 12px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.mkt-card__meta strong { color: var(--brand); font-size: 15px; }
.mkt-card__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 14px;
}
.mkt-card__publisher { font-size: 12.5px; color: var(--muted); }

/* 详情弹窗 */
.mkt-detail__head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
}
.mkt-detail__metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 18px;
}
.mkt-metric {
  padding: 14px;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.mkt-metric span { display: block; font-size: 12.5px; color: var(--muted); margin-bottom: 4px; }
.mkt-metric strong { font-size: 18px; color: var(--ink); }
.mkt-detail__block { margin-bottom: 16px; }
.mkt-detail__block h4 {
  font-size: 14px;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 6px;
}
.mkt-detail__block p { font-size: 14px; color: var(--text); line-height: 1.8; }
.mkt-detail__req {
  font-size: 14px;
  color: var(--text);
  line-height: 1.9;
  white-space: pre-wrap;
  padding: 12px 14px;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.mkt-detail__parties p { color: var(--muted); }

.mkt-deliver { display: flex; flex-direction: column; gap: 10px; }
.mkt-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.mkt-hint { font-size: 13.5px; color: var(--muted); }

@media (max-width: 620px) {
  .mkt-detail__metrics { grid-template-columns: 1fr; }
}

/* 发布页说明与操作 */
.mkt-publish__note {
  padding: 14px 16px;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font-size: 13px;
  color: var(--muted);
  line-height: 1.8;
  margin-bottom: 20px;
}
.mkt-publish__note p { font-weight: 600; color: var(--text); margin-bottom: 4px; }
.mkt-publish__note ul { padding-left: 18px; }
.mkt-publish__actions { display: flex; gap: 12px; justify-content: flex-end; }

/* 发布页资质准入提示（未通过资质审核时显示，拦截发布） */
.mkt-qual-gate {
  padding: 20px 22px;
  margin-bottom: 22px;
  background: #fff8ec;
  border: 1px solid #f0d49a;
  border-left: 4px solid #e0a93b;
  border-radius: var(--radius);
}
.mkt-qual-gate[hidden] { display: none; }
.mkt-qual-gate__title { font-size: 16px; font-weight: 700; color: #8a5a00; margin-bottom: 8px; }
.mkt-qual-gate__desc { font-size: 13.5px; color: var(--text); line-height: 1.8; margin-bottom: 14px; }

/* 详情页操作区 */
.mkt-detail-actions {
  margin-top: 18px;
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  flex-wrap: wrap;
}
.mkt-detail-actions .mkt-deliver { width: 100%; }
.mkt-detail-actions .mkt-actions { margin-left: auto; }

/* 发布页结构文件上传 */
.form-hint { font-size: 12px; color: var(--muted); margin-top: 4px; }
.mkt-struct { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.mkt-struct__pick {
  display: inline-flex;
  align-items: center;
  padding: 9px 16px;
  font-size: 14px;
  font-weight: 600;
  color: var(--brand);
  background: #fff;
  border: 1px dashed var(--brand);
  border-radius: var(--radius);
  cursor: pointer;
  transition: all .18s ease;
}
.mkt-struct__pick:hover { background: #eef4ff; }
.mkt-struct__hint { font-size: 12.5px; color: var(--muted); }
.mkt-struct__list { list-style: none; margin: 10px 0 0; padding: 0; }
.mkt-struct__item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 12px;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  margin-bottom: 8px;
}
.mkt-struct__name { flex: 1; min-width: 0; font-size: 13.5px; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mkt-struct__size { font-size: 12px; color: var(--muted); flex: none; }

/* 发布页 / 详情页内容面板
   注意：style.css 的 .panel{display:none} 服务于 services 页 tabs，
   这两个页面不能复用 .panel，否则内容被隐藏显示为空白。 */
.mkt-panel {
  padding: 24px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 2px 10px rgba(15, 45, 90, .04);
}
@media (max-width: 620px) {
  .mkt-panel { padding: 16px; }
}
