/* PropAI Dashboard — the entry screen of the light workspace.
   Inherits the .pai colour variables; only what is unique to this screen
   lives here. */

.pdash .pside--grouped { padding-top: 20px; }

.pdash__mark {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  color: var(--gold);
}
.pdash__mark .icon { width: 30px; }

.pdash__word {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--ink);
}
.pdash__word b { color: var(--gold); font-weight: 700; }

/* Topbar carries only the account cluster — no breadcrumb on this screen. */
.ptop--right { justify-content: flex-end; }
.pdash__back {
  display: inline-flex; align-items: center; gap: 7px;
  height: 34px; padding: 0 14px 0 11px;
  border: 1px solid var(--line); border-radius: 999px; background: var(--paper);
  color: var(--ink-2); font-size: 13px; font-weight: 500; text-decoration: none;
  transition: border-color 160ms var(--ease), color 160ms var(--ease), background-color 160ms var(--ease);
}
.pdash__back:hover { border-color: var(--gold); color: var(--gold); background: var(--gold-wash); }
.pdash__back .icon { width: 15px; }
.pav--plain { border: none; }
.pdash__av {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--gold-wash);
  border: 1px solid var(--gold);
  font-size: 11.5px;
  font-weight: 600;
  color: var(--gold);
}

.pdash__main { padding-bottom: 50px; }

/* ---- Hero ---------------------------------------------------------------- */

/* Taller than the original band. The footage came back 4:3, not 16:9
   (Kling matched the source still's ratio), so the panel below is sized
   against 1.33 — otherwise `cover` throws away a third of the frame and
   magnifies what remains. */

/* Full-bleed. The plate is 21:9 against a ~2.95 band, so the crop is small
   and comes off sky and grass rather than the building. No mask and no
   overlay: the picture's own left half is already near-white mist, which is
   why there is nothing to feather and no seam to hide. */

/* Feathers the footage into the page so the copy sits on clean paper
   rather than on a hard edge. */
/* The white overlay that used to sit here is gone. Feathering is now done
   by the mask on .dhero__video, which cannot leave a seam the way an
   overlay does. */

.pgen--hero { display: inline-flex; margin-top: 22px; padding: 0 26px; height: 50px; }
.pgen--hero .icon { width: 16px; }

/* ---- Sections -------------------------------------------------------------- */

.dsec { margin: 30px 30px 0; }
.dsec__head { display: flex; align-items: baseline; justify-content: space-between; }
.dsec__t { margin: 0; font-size: 21px; font-weight: 700; letter-spacing: -0.01em; }
.dsec__s { margin: 7px 0 0; font-size: 13.5px; color: var(--ink-2); }
.dsec__link { display: inline-flex; align-items: center; gap: 7px; font-size: 13.5px; color: var(--ink-2); text-decoration: none; }
.dsec__link:hover { color: var(--ink); }
.dsec__link .icon { width: 13px; }

/* AI Studio cards */

/* Open Canvas — the car-dealer example, since it is the clearest "one image
   in, a finished ad out" result the tool produces. car2-wide.jpg is a 16:9
   centre crop of car2.jpg (generated 2026-07-25, System.Drawing) so this
   tile fits its frame exactly like the other four; the 3:2 original is
   still used by the Open Canvas page's own 3:2 example frames. */

/* Featured creations */

.dfeat { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 15px; margin-top: 16px; }
.dfcard { display: block; }
.dfcard__row { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-top: 11px; }
.dfcard__row b { font-size: 14px; font-weight: 500; color: var(--ink); }
.dfcard__row i { font-size: 12.5px; font-style: normal; color: var(--ink-3); }

/* Empty state */

.dempty {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 16px;
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--paper-2);
}
.dempty__i {
  display: grid; place-items: center; width: 46px; height: 46px; flex-shrink: 0;
  border-radius: 11px; background: var(--paper); border: 1px solid var(--line); color: var(--ink-3);
}
.dempty__x { display: flex; flex-direction: column; gap: 6px; flex: 1; min-width: 0; }
.dempty__x b { font-size: 14.5px; font-weight: 600; color: var(--ink); }
.dempty__x i { font-size: 13px; font-style: normal; color: var(--ink-2); }
.dempty__cta { margin: 0; flex-shrink: 0; padding: 0 22px; }

/* ════════════════════════════════════════════════════════════════════════
   R3 —— 合并后的 dashboard

   版式借鉴 higgsfield.ai 的 apps 画廊（/root/design-ref/hf/ref_019）：
   封面当主体、名字压在图上、hover 才出 Open。
   ⚠️ 借的是【版式和密度】。颜色全部是 .pai 现有那套（--paper / --ink /
      --ink-2 / --line / --gold），一个新色值都没发明。
   ⚠️ 本段全部长在 .pai 里，所以是【浅色】。
   ════════════════════════════════════════════════════════════════════════ */

/* ── ① 细条欢迎行（替掉原来的 21:9 大 Hero）───────────────────────── */
.dwelcome {
  display: flex; align-items: center; gap: 16px;
  margin: 26px 30px 0;
  padding-bottom: 4px;
}
.dwelcome__x { flex: 1; min-width: 0; }
.dwelcome__t {
  margin: 0; font-size: 24px; font-weight: 700; letter-spacing: -0.02em;
  color: var(--ink);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.dwelcome__s { margin: 5px 0 0; font-size: 13.5px; color: var(--ink-2); }
.dwelcome__bal {
  display: inline-flex; align-items: center; gap: 7px; flex-shrink: 0;
  padding: 8px 14px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--paper);
  font-size: 13px; font-weight: 600; color: var(--ink);
}
.dwelcome__bal .icon { width: 15px; color: var(--gold); }
/* ⚠️ .pgen 自身 padding:0（它本来是给通栏大按钮用的）。放进 flex 行里就必须
   自己补左右内边距，否则文字贴着按钮边缘，看起来像被裁掉。
   数值照 .dempty__cta 的 0 22px，两个 CTA 一致。 */
.dwelcome__cta { margin: 0; flex-shrink: 0; padding: 0 22px; }

/* ── 筛选条 ─────────────────────────────────────────────────────────── */
.dfilters {
  display: flex; flex-wrap: wrap; align-items: center; gap: 12px;
  margin-top: 14px;
}
.dsearch {
  flex: 1 1 240px; min-width: 0;
  padding: 9px 14px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--paper);
  color: var(--ink); font: inherit; font-size: 13.5px;
}
.dsearch::placeholder { color: var(--ink-3); }
.dsearch:focus { outline: none; border-color: rgba(217, 164, 65, 0.55); }
.dcats { display: flex; flex-wrap: wrap; gap: 6px; }
.dcat {
  padding: 7px 13px; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--line); background: transparent;
  color: var(--ink-2); font: inherit; font-size: 12.5px;
  transition: border-color 200ms var(--ease), color 200ms var(--ease);
}
.dcat:hover { border-color: rgba(217, 164, 65, 0.55); color: var(--ink); }
.dcat.is-on { background: var(--gold); border-color: transparent; color: var(--ink); font-weight: 600; }

.dmuted { margin: 14px 0 0; font-size: 13.5px; color: var(--ink-2); }

/* ── ② Templates 网格 ───────────────────────────────────────────────── */
/* 🔴 固定列宽 220px 而不是 1fr —— 卡片不足一行时【左对齐平铺】，
   不会被拉伸成一整排大方块。auto-fill（不是 auto-fit）是关键：
   auto-fit 会把空轨道塌掉，剩下的卡就又被拉宽了。 */
.pdt {
  display: grid;
  grid-template-columns: repeat(auto-fill, 220px);
  gap: 18px 16px;
  margin-top: 16px;
  align-items: start;
}
.pdt__card { display: block; text-decoration: none; min-width: 0; }

/* 封面。🔴 统一 4:5 —— 见 21-PropLanding.js 里 pdashCard() 上那段注释：
   逐卡比例实测会让行高参差（169/436/436/151），空洞比裁切难看。 */
.pdt__shot {
  position: relative; display: block; overflow: hidden;
  aspect-ratio: 4 / 5;
  border-radius: 13px;
  border: 1px solid var(--line);
  background: var(--paper-2);
  transition: transform 180ms var(--ease), border-color 180ms var(--ease),
              box-shadow 180ms var(--ease);
}
.pdt__card:hover .pdt__shot {
  transform: translateY(-3px);
  border-color: rgba(217, 164, 65, 0.45);
  box-shadow: 0 16px 34px -18px rgba(23, 24, 26, 0.26);
}
.pdt__media { display: block; width: 100%; height: 100%; object-fit: cover; }
/* 没有素材时的兜底：浅灰块 + 图标，不放破图。 */
.pdt__blank {
  display: grid; place-items: center; width: 100%; height: 100%;
  background: linear-gradient(160deg, var(--gold-wash), var(--paper-2) 70%);
}
.pdt__blank .icon { width: 30px; color: var(--gold); }

/* 🔴 静态样片【加载失败】时的兜底 —— 不放破图。
   为什么不复用 .pdt__blank：那一层是「压根没有素材」时渲的，而且
   `.pdt__shot:has(.pdt__blank) .pdt__name` 会把名字改成深色。如果为了
   兜底就无条件多渲一个 .pdt__blank，那条 :has() 会命中【每一张卡】，
   整个 dashboard 的卡片名会从白字变深字 —— 那才是真的动了版式。
   所以改成 onError 时给 .pdt__shot 加一个类，效果等同、平时零影响。
   ⚠️ 视频没有这条：<video> 加载失败会停在 poster / 底色上，本来就不破图。 */
.pdt__shot.is-noshot .pdt__media { display: none; }
.pdt__shot.is-noshot {
  background: linear-gradient(160deg, var(--gold-wash), var(--paper-2) 70%);
}
.pdt__shot.is-noshot .pdt__name {
  color: var(--ink); text-shadow: none; background: none;
}

/* 名字压在封面上（学 ref_019）。底部一层渐变保证任何画面上都读得出来。 */
.pdt__name {
  position: absolute; left: 0; right: 0; bottom: 0;
  padding: 26px 12px 10px;
  font-size: 14px; font-weight: 600; color: #ffffff;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.55);
  background: linear-gradient(to top, rgba(0, 0, 0, 0.62), rgba(0, 0, 0, 0));
  /* ⚠️ 长名字截断而不是换行 —— 两行会把渐变顶出封面。 */
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
/* 纯色兜底卡是浅底，白字读不出来 —— 单独换成深字、去掉渐变。 */
.pdt__shot:has(.pdt__blank) .pdt__name {
  color: var(--ink); text-shadow: none; background: none;
}

.pdt__price {
  position: absolute; top: 8px; left: 8px;
  display: inline-flex; align-items: center; gap: 4px;
  padding: 4px 9px; border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  font-size: 11px; font-weight: 600; color: var(--ink);
}
.pdt__price .icon { width: 11px; color: var(--gold); }

/* hover 才出（学 ref_019 的 Open 按钮）。
   ⚠️ 用 opacity 不用 display —— display 切换在触屏上会闪。 */
.pdt__open {
  position: absolute; top: 8px; right: 8px;
  padding: 5px 12px; border-radius: 999px;
  background: var(--gold); color: var(--ink);
  font-size: 11.5px; font-weight: 600;
  opacity: 0; transform: translateY(-3px);
  transition: opacity 160ms var(--ease), transform 160ms var(--ease);
}
.pdt__card:hover .pdt__open { opacity: 1; transform: none; }

.pdt__line {
  display: block; margin-top: 9px;
  font-size: 12.5px; font-style: normal; line-height: 1.45; color: var(--ink-2);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ── ③ Insights 瓦片 ───────────────────────────────────────────────── */
.dtiles {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 15px; margin-top: 16px;
}
.dtile {
  display: flex; align-items: center; gap: 13px; min-width: 0;
  padding: 16px 18px;
  border: 1px solid var(--line); border-radius: 13px;
  background: var(--paper); text-decoration: none;
  transition: transform 180ms var(--ease), border-color 180ms var(--ease),
              box-shadow 180ms var(--ease);
}
.dtile:hover {
  transform: translateY(-3px);
  border-color: rgba(217, 164, 65, 0.45);
  box-shadow: 0 16px 34px -18px rgba(23, 24, 26, 0.26);
}
.dtile__i {
  display: grid; place-items: center; width: 38px; height: 38px; flex-shrink: 0;
  border-radius: 11px; background: var(--gold-wash); color: var(--gold);
}
.dtile__x { min-width: 0; flex: 1; }
.dtile__x b { display: block; font-size: 14.5px; font-weight: 600; color: var(--ink); }
.dtile__x i {
  display: block; margin-top: 3px; font-size: 12.5px; font-style: normal;
  line-height: 1.45; color: var(--ink-2);
}
.dtile__go { flex-shrink: 0; color: var(--gold); }
.dtile__go .icon { width: 15px; }

/* ── ④ Your projects：真数据的缩略图 ───────────────────────────────── */
.dfcard__img {
  display: block; width: 100%; aspect-ratio: 16 / 9;
  object-fit: cover; border-radius: 11px; background: var(--paper-2);
}
.dfcard__img--blank { display: grid; place-items: center; }
.dfcard__img--blank .icon { width: 22px; color: var(--ink-3); }

@media (max-width: 900px) {
  .dtiles { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 640px) {
  .dwelcome { flex-wrap: wrap; margin: 20px 16px 0; }
  .dwelcome__x { flex: 1 1 100%; }
  .dwelcome__t { font-size: 20px; }
  /* 手机上列宽跟着容器走，否则 220px 固定列会在 375 下留一条空隙。 */
  .pdt { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
}
