/* ============================================================
   商品页 —— 照个人库的四栏：
   归类（最左）｜筛选（左二）｜产品 ▸ 规格（中）｜动态（右）
   2026-10-31
   ============================================================ */

#manageView.wide { padding: 0; height: 100%; overflow: hidden; }
#manageView.wide .wrap { width: min(1500px, calc(100% - 32px)); height: 100%; }
#manageView.wide #view { height: 100%; }
.app-main.manage-mode.wide-products { overflow: hidden; }

.pd {
  --pd-dyn: 500px;   /* 动态栏宽度（他说要加宽） */
  --pd-grid: 150px;  /* 九宫格 / 单图小方块的边长 */
  height: 100%;
  display: grid;
  grid-template-columns: 220px 220px minmax(0, 1fr) var(--pd-dyn);
  background: var(--bg);
}
.pd-col {
  background: var(--panel);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}
.pd-col:last-child { border-right: 0; }
.pd-catcol { background: #f7f7f2; }

.pd-head {
  height: 46px;
  flex: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 0 14px;
  border-bottom: 1px solid var(--line);
  font-weight: 600;
  font-size: 13px;
}
.pd-head .count { color: var(--faint); font-weight: 400; font-size: 11.5px; }

/* ---------- 最左：归类 ---------- */
.pd-mode { display: flex; gap: 4px; padding: 8px 10px; border-bottom: 1px solid var(--line); }
/* 2026-11-02：分类页收进商品页 —— 左栏这颗打开「管理分类」弹窗 */
.pd-cat-tools { padding: 7px 10px 10px; }
.pd-cat-tools .mini.danger { color: var(--bad); border-color: #e6cccc; }
.pd-cat-tools .mini.danger:hover { background: var(--bad); border-color: var(--bad); color: #fff; }
.pd-warn {
  margin: 8px 10px 0;
  padding: 8px 10px;
  border: 1px solid #ead9b8;
  background: #fbf4e8;
  color: #8a5a1a;
  border-radius: 6px;
  font-size: 11px;
  line-height: 1.6;
}
.pd-tree { flex: 1; overflow-y: auto; padding: 6px; }
.pd-tree-row {
  width: 100%;
  border: 0;
  background: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding: 5px 8px;
  border-radius: 5px;
  font: inherit;
  font-size: 12px;
  color: var(--ink);
  cursor: pointer;
  text-align: left;
}
.pd-tree-row:hover { background: #efefe9; }
.pd-tree-row.on { background: #e6e6de; font-weight: 600; }
.pd-tree-row.static { color: var(--muted); }
.pd-tree-count { color: var(--faint); font-size: 10.5px; flex: none; }
.pd-side-note {
  padding: 8px 12px;
  border-top: 1px dashed var(--line);
  color: var(--faint);
  font-size: 10.5px;
  line-height: 1.6;
}

/* ---------- 左二：筛选 ---------- */
.pd-filter-body { flex: 1; overflow-y: auto; }
.pd-group { padding: 10px 12px; border-bottom: 1px dashed var(--line); }
.pd-group-title { font-size: 11px; color: var(--faint); margin-bottom: 6px; letter-spacing: .04em; }
.pd-search {
  width: 100%;
  height: 30px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0 8px;
  font: inherit;
  font-size: 12.5px;
  background: #fff;
}
.pd-chip {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 99px;
  padding: 2px 9px;
  margin: 0 4px 4px 0;
  background: #fff;
  font: inherit;
  font-size: 11px;
  color: var(--muted);
  cursor: pointer;
}
.pd-chip.on { background: var(--ink); border-color: var(--ink); color: #fff; }
/* 2026-11-02：左二栏「标签树」—— 根 / 分组 / 标签，点标签筛 */
.pd-tag-tree { display: flex; flex-direction: column; gap: 1px; }
.pd-tag-row {
  display: flex; align-items: center; gap: 6px; width: 100%;
  border: 0; background: none; text-align: left;
  padding: 3px 6px; border-radius: 5px;
  font: inherit; font-size: 12px; color: var(--ink); cursor: pointer;
}
.pd-tag-row:hover { background: #f7f7f2; }
.pd-tag-row.head { color: var(--muted); font-size: 11.5px; font-weight: 600; }
.pd-tag-row.d1 { padding-left: 20px; }
.pd-tag-row.d2 { padding-left: 38px; }
.pd-tag-row.tag.on { background: var(--ink); color: #fff; }
.pd-tag-row.tag.on .pd-tag-count { color: #fff; opacity: .75; }
.pd-caret { flex: none; width: 12px; color: var(--faint); font-size: 10px; }
.pd-tag-box { flex: none; width: 16px; text-align: center; }
.pd-tag-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pd-tag-count { flex: none; color: var(--faint); font-size: 10.5px; font-variant-numeric: tabular-nums; }
.pd-sub-title { margin: 9px 0 4px; color: var(--muted); font-size: 10.5px; }
.pd-cat-summary { display: flex; align-items: center; justify-content: space-between; gap: 6px; font-size: 12px; }
.pd-empty-note { color: var(--faint); font-size: 11px; line-height: 1.6; }

/* ---------- 中间：产品 ▸ 规格 ---------- */
.pd-actionbar {
  flex: none;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  padding: 8px 14px;
  border-bottom: 1px solid var(--line);
  background: #fff;
  font-size: 11.5px;
}
.pd-selcount { color: var(--muted); }
.pd-list { flex: 1; overflow-y: auto; padding: 12px; background: var(--bg); }
.pd-product {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
  margin-bottom: 10px;
}
.pd-prod-head { display: flex; align-items: baseline; gap: 8px; margin-bottom: 8px; }
.pd-prod-code { font-weight: 600; font-size: 13px; }
.pd-prod-name { font-size: 12px; color: var(--muted); }
.pd-prod-count { margin-left: auto; font-size: 10.5px; color: var(--faint); }
.pd-spec-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 8px; }
.pd-spec {
  position: relative;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 6px;
  background: #fff;
  cursor: pointer;
}
.pd-spec.cur { border-color: var(--ink); box-shadow: 0 0 0 1px var(--ink); }
.pd-spec.sel { background: #f7f7f2; }
.pd-cover {
  width: 100%;
  aspect-ratio: 3 / 4;
  border-radius: 6px;
  overflow: hidden;
  background: #e9e9e2;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #a9a9a0;
  font-size: 10px;
  text-align: center;
}
.pd-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pd-check {
  position: absolute;
  top: 8px;
  right: 8px;
  background: #fff;
  border-radius: 4px;
  padding: 2px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .15);
}
.pd-check input { display: block; width: 14px; height: 14px; margin: 0; cursor: pointer; }
.pd-spec-code { margin-top: 5px; font-size: 12px; font-weight: 600; }
.pd-full { font-size: 10px; color: var(--faint); }
.pd-cat {
  font-size: 10.5px;
  color: var(--muted);
  margin-top: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.pd-cat-none { color: var(--bad); }
.pd-status {
  display: inline-block;
  margin-top: 3px;
  font-size: 10px;
  border: 1px solid var(--line);
  border-radius: 99px;
  padding: 0 6px;
  color: var(--muted);
}
.pd-status.on { color: var(--ok); border-color: #bfd8c8; background: #eef6f1; }
.pd-empty { padding: 60px 16px; text-align: center; color: var(--faint); font-size: 12px; }

/* ---------- 右边：动态（照个人库主界面：左九宫格 + 右文案框） ---------- */
.pd-dyn-body { flex: 1; overflow-y: auto; padding: 10px 12px; background: var(--bg); }
.pd-dyn-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-bottom: 10px; }
.pd-dyn-head b { font-size: 13px; }
.pd-dyn-head span { font-size: 10.5px; color: var(--faint); }

/* 日期时间流 */
.pd-year { font-size: 14px; font-weight: 600; margin: 10px 0 6px; }
.pd-month-head { display: flex; align-items: baseline; gap: 6px; color: var(--muted); font-size: 11px; margin: 6px 0; }
.pd-month-head span { font-weight: 600; color: var(--ink); }

/* 单图无文案：一排最多 3 个；单张图跟九宫格一样大 */
.pd-tile-row { display: flex; gap: 6px; margin-bottom: 8px; }
.pd-tile { flex: 0 0 var(--pd-grid); min-width: 0; }
.pd-tile-img {
  width: var(--pd-grid);
  height: var(--pd-grid);
  border-radius: 6px;
  overflow: hidden;
  background: #000;
  border: 1px solid var(--line);
}
.pd-tile-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pd-tile-time { font-size: 10px; color: var(--faint); text-align: center; margin-top: 3px; }

.pd-moment {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px;
  margin-bottom: 8px;
}
.pd-moment-body { display: flex; gap: 10px; align-items: stretch; }
.pd-moment-side { flex: none; width: var(--pd-grid); position: relative; }

/* 九宫格：跟个人库一样的排法（1 铺满 / 2 对半 / 3 左大右二 / 4 四格 /
   5 左上大+右侧竖条+下排三 / 6 左上大+五格 / 7 前两张各占一列两行 /
   8 第一张占一列两行 / 9 标准九宫格） */
.pd-nine {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(3, 1fr);
  gap: 4px;
  width: var(--pd-grid);
  height: var(--pd-grid);
  background: #000;
  border-radius: 6px;
  overflow: hidden;
}
.pd-nine.c1 { grid-template-columns: 1fr; grid-template-rows: 1fr; }
.pd-nine.c2, .pd-nine.c4 { grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; }
.pd-nine.c3 { grid-template-columns: 1fr 1fr; grid-template-rows: 1fr; }
.pd-nine.c5, .pd-nine.c6, .pd-nine.c7, .pd-nine.c8, .pd-nine.c9 {
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(3, 1fr);
}
.pd-cell {
  position: relative;
  background: #000;
  border: 1px solid var(--line);
  border-radius: 4px;
  overflow: hidden;
  aspect-ratio: 1;
  min-width: 0;
  min-height: 0;
}
.pd-cell img { width: 100%; height: 100%; object-fit: cover; display: block; }
/* 视频格：跟小程序一样中间一个播放键（2026-11-09） */
.pd-play {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 26px;
  height: 26px;
  margin: -13px 0 0 -13px;
  border: 1px solid #fff;
  border-radius: 50%;
  background: rgba(0, 0, 0, .35);
  color: #fff;
  font-size: 11px;
  line-height: 24px;
  text-align: center;
}
/* 跨格的那几种（照个人库 grid.js 的 cellExtra） */
.pd-cell.span2 { grid-row: 1 / 3; aspect-ratio: auto; width: 100%; height: 100%; }
.pd-cell.col2 { grid-column: 2; }
.pd-cell.p1 { grid-row: 1 / 3; grid-column: 1 / 3; aspect-ratio: auto; width: 100%; height: 100%; }
.pd-cell.p2 { grid-row: 1 / 3; grid-column: 3; aspect-ratio: auto; width: 100%; height: 100%; }
.pd-nine.c3 .pd-cell { aspect-ratio: auto; width: 100%; height: 100%; }
.pd-c3-big { min-width: 0; min-height: 0; }
.pd-c3-right { display: grid; grid-template-rows: 1fr 1fr; gap: 4px; min-height: 0; }

/* 右边文案框：高度跟九宫格一样，文案在里面滚 */
.pd-moment-copy {
  flex: 1;
  min-width: 0;
  height: var(--pd-grid);
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--bg);
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.pd-moment-copy pre {
  flex: 1;
  min-height: 0;
  overflow: auto;
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
  font: inherit;
  font-size: 11px;
  line-height: 1.6;
  color: var(--ink);
  background: transparent;
  border: 0;
}
.pd-moment-copy pre.empty { color: var(--faint); font-style: italic; }
.pd-moment-meta { flex: none; color: var(--faint); font-size: 10px; }
.pd-moment.copyonly .pd-moment-copy { height: 90px; }

@media (max-width: 1400px) {
  .pd {
    --pd-dyn: 460px;
    --pd-grid: 132px;
    grid-template-columns: 200px 200px minmax(0, 1fr) var(--pd-dyn);
  }
}


/* 个人库（iframe 窗口）—— 2026-11-01 */
.personal-frame {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
  background: #f3f5f8;
}


/* 个人库页：用整幅窗口宽（不是 1500 封顶）—— 2026-11-01 他要求加宽 */
#manageView.wide-personal .wrap { width: calc(100% - 16px); max-width: none; }
