/* ==========================================================================
   项目管理（主题 / 气泡 / 头像框共用，前缀 pm-）
   ========================================================================== */
.pm-summary { min-width: 0; }
.pm-count { font-size: var(--fs-18); line-height: 1.35; }
.pm-sub { margin-top: 2px; font-size: var(--fs-13); color: var(--c-text-3); }

.pm-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(288px, 1fr));
  gap: 16px;
  align-items: stretch;
}
.pm-grid:empty { display: none; }

/* ---------- 项目卡片 ---------- */
.pm-card {
  display: flex;
  flex-direction: column;
  transition: border-color var(--dur-2) var(--ease-out);
}
.pm-card.is-new { animation: pm-ring 1.8s var(--ease-out); }
.pm-card.is-leaving { pointer-events: none; }
@keyframes pm-ring {
  0%, 35% { border-color: var(--c-brand-sun); box-shadow: 0 0 0 3px rgba(255, 194, 61, .45); }
  100% { box-shadow: 0 0 0 3px rgba(255, 194, 61, 0); }
}

.pm-media { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; padding: 12px 12px 0; }
.pm-shot {
  position: relative;
  display: grid;
  place-items: center;
  aspect-ratio: 3 / 4;
  overflow: hidden;
  border-radius: 10px;
  background: var(--c-fill-1);
}
.pm-shot img { width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity var(--dur-3) var(--ease-out); }
.pm-shot img.is-loaded { opacity: 1; }
/* 空位只是图片占位：浅底、无描边，避免在卡片里再套一层「小卡片」 */
.pm-shot.is-empty { background: var(--c-fill-1); color: var(--c-text-4); }
.pm-shot.is-empty .yb-icon { width: 18px; height: 18px; }

/* 气泡 / 头像框：一张设计工坊生成的预览图 */
.pm-media--cover { grid-template-columns: minmax(0, 1fr); }
.pm-cover {
  position: relative;
  display: grid;
  place-items: center;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: 10px;
  background: var(--c-fill-1);
}
.pm-cover img { max-width: 78%; max-height: 78%; object-fit: contain; opacity: 0; transition: opacity var(--dur-3) var(--ease-out); }
.pm-cover img.is-loaded { opacity: 1; }
.pm-cover.is-empty { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; color: var(--c-text-4); font-size: var(--fs-12); }
.pm-cover.is-empty .yb-icon { width: 22px; height: 22px; }
.pm-skel .pm-cover { display: block; }
.pm-studio-tip { display: flex; align-items: flex-start; gap: 6px; margin-top: 0; line-height: 1.6; }
.pm-studio-tip .yb-icon { flex: none; margin-top: 2px; }

.pm-body { display: flex; flex-direction: column; min-width: 0; padding: 14px 16px 0; }
.pm-title-row { display: flex; align-items: center; gap: 8px; min-width: 0; }
.pm-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  font-size: var(--fs-16);
  white-space: nowrap;
  text-overflow: ellipsis;
}
.pm-meta { display: flex; flex-wrap: wrap; align-items: center; margin-top: 4px; font-size: var(--fs-12); color: var(--c-text-3); }
.pm-meta > span + span::before {
  content: "";
  display: inline-block;
  width: 1px; height: 10px;
  margin: 0 8px;
  background: var(--c-border-2);
  vertical-align: -1px;
}
.pm-price { display: inline-flex; align-items: center; gap: 3px; color: var(--c-text-3); }
.pm-price.is-paid { color: var(--c-amber-700); font-weight: var(--fw-medium); }
.pm-price .yb-icon { width: 14px; height: 14px; }
.pm-pending { display: inline-flex; align-items: center; color: var(--c-amber-700); }
.pm-pending i { width: 6px; height: 6px; margin-right: 5px; border-radius: 50%; background: var(--c-amber-500); }
.pm-intro {
  display: -webkit-box;
  min-height: calc(1.6em * 2);
  margin-top: 8px;
  overflow: hidden;
  font-size: var(--fs-13);
  line-height: 1.6;
  color: var(--c-text-2);
  word-break: break-word;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.pm-reqs { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.pm-req {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 24px;
  padding: 0 9px 0 7px;
  border-radius: var(--r-full);
  background: var(--c-fill-1);
  font-size: var(--fs-12);
  color: var(--c-text-3);
}
.pm-req .yb-icon { width: 14px; height: 14px; }
.pm-req.is-done { color: var(--c-text-1); }

.pm-foot { display: flex; align-items: center; gap: 8px; margin-top: auto; padding: 16px; }
.pm-more { margin-left: auto; }
.pm-menu { min-width: 168px; }

/* 骨架屏：加载很快时不出现 */
.pm-skel { animation: pm-fade var(--dur-3) 150ms both; }
.pm-skel .pm-shot { display: block; }
.pm-skel .pm-body > .yb-skeleton { display: block; }
@keyframes pm-fade { from { opacity: 0; } }

.pm-empty[hidden] { display: none; }
.pm-empty:not([hidden]) { animation: pm-fade var(--dur-3) var(--ease-out); }

/* ---------- 弹窗内容 ---------- */
.pm-form { display: flex; flex-direction: column; gap: 20px; }
.pm-label-row { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.pm-counter { font-size: var(--fs-12); color: var(--c-text-3); }
.pm-field-help:empty { display: none; }
.pm-zip { outline: none; border-radius: var(--r-lg); }

/* 价格：免费 / 收费 + 小鱼干数量 */
.pm-price-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.pm-price-row .yb-segmented-item { min-width: 64px; }
.pm-fish { width: 168px; }
.pm-fish[hidden] { display: none; }
.pm-fish > .yb-icon { color: var(--c-amber-600); }
.pm-fish input { font-variant-numeric: tabular-nums; }
.pm-fish-unit { flex: none; font-size: var(--fs-13); color: var(--c-text-3); }

.pm-facts {
  display: grid;
  margin: 4px 0 0;
  border-top: 1px solid var(--c-divider);
  font-size: var(--fs-13);
}
.pm-facts div { display: flex; gap: 16px; padding: 10px 0; border-bottom: 1px solid var(--c-divider); }
.pm-facts dt { flex: none; width: 56px; color: var(--c-text-3); }
.pm-facts dd { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0; color: var(--c-text-1); }
.pm-version { font-weight: var(--fw-semibold); }
.pm-note { margin-top: 12px; font-size: var(--fs-12); color: var(--c-text-3); }
.pm-live { color: var(--c-success); }
.pm-modal-text { margin: 0; font-size: var(--fs-14); line-height: 1.7; color: var(--c-text-2); }

/* 新建项目：模版选择（气泡 / 头像框）。单选卡片：缩略区固定高度，名称单行居中，选中时描边加深，文字位置不随选中变化 */
.pm-tpl-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.pm-tpl {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 6px;
  padding: 6px 6px 8px;
  border-radius: var(--r-lg);
  box-shadow: inset 0 0 0 1px var(--c-border-2);
  cursor: pointer;
  transition: box-shadow var(--dur-2) var(--ease-out), background-color var(--dur-2) var(--ease-out);
}
.pm-tpl:hover { background: var(--c-fill-1); }
.pm-tpl.is-checked { box-shadow: inset 0 0 0 2px var(--c-primary); }
.pm-tpl-input { position: absolute; width: 1px; height: 1px; margin: 0; opacity: 0; pointer-events: none; }
.pm-tpl:has(.pm-tpl-input:focus-visible) { outline: 2px solid var(--c-brand-sky); outline-offset: 2px; }
.pm-tpl-art { display: grid; place-items: center; height: 64px; border-radius: var(--r-sm); background: var(--c-fill-1); overflow: hidden; }
.pm-tpl-art img { display: block; max-width: 92%; max-height: 56px; object-fit: contain; }
.pm-tpl-blank { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; color: var(--c-text-3); box-shadow: inset 0 0 0 1px var(--c-border-2); background: #fff; }
.pm-tpl-name { display: block; overflow: hidden; font-size: var(--fs-13); line-height: 18px; text-align: center; white-space: nowrap; text-overflow: ellipsis; color: var(--c-text-1); }
@media (max-width: 480px) {
  .pm-tpl-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@container main (max-width: 560px) {
  .pm .page-head { flex-wrap: nowrap; }
  .pm-grid { grid-template-columns: minmax(0, 1fr); gap: 12px; }
}
