/* 懂脉帝 - 合作需求卡片组件（列表页 / 首页共用） */
.pl-card,
.pl-items {
  --pl-brand: #087e78;
  --pl-brand-700: #066a65;
  --pl-brand-100: #e9f7f5;
  --pl-gold: #b8873b;
  --pl-text: #1d2939;
  --pl-text-2: #475467;
  --pl-muted: #7b8794;
  --pl-muted-2: #98a2b3;
  --pl-line: #e9eef3;
  --pl-line-2: #dce4ea;
  --pl-shadow-sm: 0 4px 14px rgba(16, 24, 40, .04);
  --pl-shadow-md: 0 14px 34px rgba(16, 24, 40, .08);
}

/* ============ 卡片 ============ */
.pl-items { display: grid; gap: 12px; }
.pl-card {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--pl-line);
  border-radius: var(--pl-radius);
  background: #fff;
  box-shadow: var(--pl-shadow-sm);
  transition: border-color .2s ease, box-shadow .2s ease, transform .2s ease;
  /* 卡片自身作为尺寸容器：右侧行动区按「卡片实际宽度」决定是否展开，而不是按视口 */
  container-type: inline-size;
  container-name: pl-card;
}
.pl-card::before {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 3px;
  background: linear-gradient(180deg, #0f9b93, #067069);
  content: '';
  opacity: 0;
  transition: opacity .2s ease;
}
.pl-card:hover {
  transform: translateY(-2px);
  border-color: #d5e9e6;
  box-shadow: var(--pl-shadow-md);
}
.pl-card:hover::before { opacity: 1; }
.pl-card.is-top {
  border-color: #e9dcc2;
  background: linear-gradient(180deg, #fffdf8 0%, #fff 46%);
}
.pl-card.is-top::before { background: linear-gradient(180deg, #d5a651, #b8873b); opacity: 1; }
.pl-card.is-top .pl-title-row { padding-right: 58px; }
.pl-ribbon {
  position: absolute;
  top: 0;
  right: 20px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 0 0 7px 7px;
  background: linear-gradient(135deg, #d9ab5b, #b8873b);
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .5px;
}
.pl-ribbon i { font-size: 9px; }

/* ============ 卡片骨架：左内容 + 右行动区 ============ */
.pl-card-grid {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr);
  grid-template-areas:
    "aside main"
    "side  side";
  align-items: stretch;
  column-gap: 15px;
  row-gap: 12px;
  padding: 17px 20px 15px;
}
.pl-card-aside {
  grid-area: aside;
  align-self: start;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.pl-avatar {
  display: block;
  width: 56px;
  height: 56px;
  overflow: hidden;
  border: 1px solid #eef1f4;
  border-radius: 13px;
  background: #f4f7f8;
}
.pl-avatar img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .35s ease;
}
.pl-card:hover .pl-avatar img { transform: scale(1.07); }
.pl-auths {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 3px;
  width: 100%;
  margin-top: 6px;
}
.pl-auth {
  padding: 0 4px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 600;
  line-height: 15px;
  letter-spacing: .2px;
}
.pl-auth.real { border: 1px solid #cfeae5; background: #eff9f7; color: #168779; }
.pl-auth.comp { border: 1px solid #d7e1fb; background: #f1f4ff; color: #536fc1; }
.pl-auth.vip { border: 1px solid #f0dcb4; background: #fff8eb; color: #b07c26; }

.pl-card-main {
  grid-area: main;
  display: flex;
  min-width: 0;
  flex-direction: column;
}
.pl-title-row { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.pl-title {
  color: #17262f;
  font-size: 16px;
  font-weight: 650;
  line-height: 1.5;
  transition: color .15s ease;
}
.pl-title:hover { color: var(--pl-brand); }
.pl-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 0 7px;
  border-radius: 5px;
  font-size: 10.5px;
  font-weight: 600;
  line-height: 18px;
}
.pl-badge.new { border: 1px solid #cdece8; background: #effbf9; color: #0d837a; }
.pl-badge.vip { border: 1px solid #f1dcb3; background: linear-gradient(135deg, #fffaef, #fdf1d9); color: #ab7722; }
/* 审核状态徽章：只在作者/管理员的待审核列表里出现（正常上架帖 status=1 不显示） */
.pl-badge.audit { border: 1px solid #fbd9a8; background: #fff8ec; color: #b06000; }
.pl-badge.audit-fail { border: 1px solid #fde3e1; background: #fff5f4; color: #c4363b; }
.pl-dot-live {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #12b3a4;
  box-shadow: 0 0 0 2px rgba(18, 179, 164, .18);
  animation: plPulse 2.2s ease-in-out infinite;
}
@keyframes plPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: .35; }
}

.pl-byline {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 5px 9px;
  margin-top: 7px;
  color: var(--pl-muted);
  font-size: 12px;
}
.pl-nick { color: #344054; font-size: 12.5px; font-weight: 650; }
.pl-company {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  max-width: 240px;
  overflow: hidden;
  color: #5c6b77;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.pl-company i { color: #b0bab5; font-size: 10px; }

/* ============ 结构化字段条（四格 · 标签 + 值） ============ */
/* 1px 的网格间隙配合底色，形成发丝分隔线，比文本框更像「参数表」 */
.pl-specs {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  margin-top: 11px;
  overflow: hidden;
  border: 1px solid #eef2f6;
  border-radius: 10px;
  background: #eef2f6;
}
.pl-spec {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 2px;
  padding: 7px 11px 8px;
  background: #fbfcfd;
}
.pl-spec-label {
  margin: 0;
  color: #667085; /* 对 #fbfcfd 底 4.9:1，满足 WCAG AA */
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .2px;
  line-height: 1.35;
}
.pl-spec-value {
  margin: 0;
  overflow: hidden;
  color: #344054;
  font-size: 12.5px;
  font-weight: 650;
  line-height: 1.45;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.pl-spec.is-empty .pl-spec-value { color: #667085; font-weight: 500; }

/* ============ 一句话钩子（提供 / 寻求，单行省略） ============ */
.pl-hooks {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 3px;
  margin-top: 9px;
}
.pl-hook {
  display: flex;
  min-width: 0;
  align-items: flex-start;
  gap: 7px;
  margin: 0;
  color: #5b6a77;
  font-size: 12.5px;
  line-height: 1.6;
}
.pl-hook b {
  flex: 0 0 auto;
  margin-top: 1px;
  padding: 0 5px;
  border-radius: 4px;
  font-size: 10.5px;
  font-weight: 600;
  line-height: 16px;
}
.pl-hook b.is-offer { background: #eaf7f5; color: #0d837a; }
.pl-hook b.is-need { background: #fdf1e4; color: #c07430; }
.pl-hook span {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ============ 右侧行动区（窄卡片时自动落到卡片底部成为一条） ============ */
.pl-card-side {
  grid-area: side;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px 16px;
  padding-top: 11px;
  border-top: 1px dashed #f0f3f6;
}
.pl-side-status { display: flex; align-items: center; }
.pl-side-time {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: #a2adb8;
  font-size: 11.5px;
  white-space: nowrap;
}
.pl-side-time i { color: #b6c0c9; font-size: 11px; }
.pl-side-stats {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-right: auto;
}
.pl-side-stat { display: inline-flex; align-items: baseline; gap: 4px; }
.pl-side-stat b {
  color: #57646f;
  font-size: 12.5px;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
}
.pl-side-stat em { color: #a6b0ba; font-size: 11px; font-style: normal; }
.pl-side-stat.is-key b { color: var(--pl-brand); }
.pl-side-actions { display: flex; align-items: center; gap: 8px; margin-left: auto; }

.pl-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 32px;
  padding: 0 15px;
  border-radius: 8px;
  font-size: 12.5px;
  font-weight: 600;
  white-space: nowrap;
  transition: all .18s ease;
}
.pl-btn.ghost {
  border: 1px solid var(--pl-line-2);
  background: #fff;
  color: #5c6b77;
}
.pl-btn.ghost:hover { border-color: #b9ded9; background: #f6fcfb; color: var(--pl-brand); }
.pl-btn.primary {
  border: 1px solid transparent;
  background: linear-gradient(135deg, #0a8f88, #067069);
  color: #fff;
  box-shadow: 0 4px 12px rgba(8, 126, 120, .2);
}
.pl-btn.primary:hover { filter: brightness(1.07); box-shadow: 0 6px 16px rgba(8, 126, 120, .28); }

/* ============ 中窄卡片：字段条收成两列，避免每格被压成两三个字 ============ */
@container pl-card (max-width: 620px) {
  .pl-specs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ============ 宽卡片：右侧展开成独立的行动栏 ============ */
@container pl-card (min-width: 840px) {
  .pl-card-grid {
    grid-template-columns: 56px minmax(0, 1fr) 200px;
    grid-template-areas: "aside main side";
    column-gap: 18px;
    row-gap: 0;
    padding: 19px 22px 17px;
  }
  .pl-card-side {
    flex-direction: column;
    align-items: stretch;
    flex-wrap: nowrap;
    justify-content: space-between;
    gap: 10px;
    padding: 2px 0 0 20px;
    border-top: 0;
    border-left: 1px dashed #e4ebf1;
  }
  .pl-side-status { justify-content: flex-start; }
  .pl-side-stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 3px;
    margin: 0;
  }
  .pl-side-stat {
    flex-direction: column;
    align-items: center;
    gap: 1px;
    padding: 6px 2px 5px;
    border-radius: 8px;
    background: #f8fafb;
  }
  .pl-side-stat.is-key { background: #eef8f6; }
  .pl-side-stat b { font-size: 15px; line-height: 1.15; }
  .pl-side-stat em { font-size: 10.5px; letter-spacing: .3px; }
  .pl-side-actions {
    flex-direction: column;
    gap: 6px;
    margin-left: 0;
  }
  .pl-side-actions .pl-btn { width: 100%; }
  .pl-side-actions .pl-btn.ghost {
    height: 29px;
    border-color: #edf1f5;
    background: #fcfdfd;
    color: #7b8794;
    font-weight: 500;
  }
  .pl-side-actions .pl-btn.ghost:hover { border-color: #c9e5e0; background: #f6fcfb; color: var(--pl-brand); }
}

/* ============ 卡片视图（2 列紧凑卡） ============ */
.pl-items.is-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: stretch; }
.pl-items.is-grid .pl-card { display: flex; }
.pl-items.is-grid .pl-card-grid {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 9px;
  padding: 16px;
}
.pl-items.is-grid .pl-card-aside { flex-direction: row; align-items: center; align-self: stretch; gap: 8px; }
.pl-items.is-grid .pl-avatar { width: 40px; height: 40px; border-radius: 10px; }
.pl-items.is-grid .pl-auths { width: auto; margin-top: 0; justify-content: flex-start; }
.pl-items.is-grid .pl-card-main { flex: 1; }
.pl-items.is-grid .pl-title {
  display: -webkit-box;
  overflow: hidden;
  font-size: 14.5px;
  line-height: 1.55;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}
.pl-items.is-grid .pl-badge.new { display: none; }
.pl-items.is-grid .pl-byline { margin-top: 6px; }
/* 紧凑卡只留结构字段，隐藏段落钩子 */
.pl-items.is-grid .pl-hooks { display: none; }
/* 紧凑卡只留「合作类型 + 地区」两个关键字段，保持单行 */
.pl-items.is-grid .pl-specs { grid-template-columns: repeat(2, minmax(0, 1fr)); margin-top: 9px; }
.pl-items.is-grid .pl-spec { padding: 6px 9px 7px; }
.pl-items.is-grid .pl-spec:nth-child(2),
.pl-items.is-grid .pl-spec:nth-child(4) { display: none; }
.pl-items.is-grid .pl-card-side {
  margin-top: auto;
  gap: 8px 12px;
  padding-top: 10px;
  flex-wrap: nowrap;
}
.pl-items.is-grid .pl-side-time { display: none; }
.pl-items.is-grid .pl-side-stats { gap: 12px; }
.pl-items.is-grid .pl-side-actions .pl-btn.ghost { display: none; }
.pl-items.is-grid .pl-side-actions .pl-btn { height: 29px; padding: 0 12px; font-size: 12px; }
.pl-items.is-grid .pl-company { max-width: 150px; }

/* ============ 响应式 ============ */
@media (max-width: 860px) {
  .pl-items.is-grid { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 640px) {
  .pl-card-grid {
    grid-template-columns: 48px minmax(0, 1fr);
    column-gap: 12px;
    row-gap: 10px;
    padding: 14px;
  }
  .pl-avatar { width: 48px; height: 48px; border-radius: 12px; }
  .pl-title { font-size: 14.5px; }
  .pl-company { max-width: 140px; }
  .pl-specs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pl-spec { padding: 6px 9px 7px; }
  .pl-hook { font-size: 12px; }
  .pl-card-side {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }
  .pl-side-stats { gap: 14px; margin-right: 0; }
  .pl-side-actions { width: 100%; margin-left: 0; }
  .pl-side-actions .pl-btn { flex: 1; }
  .pl-card.is-top .pl-title-row { padding-right: 44px; }
}
