/*
 * session-assets.css — K-ASSET-RAIL · 右栏产物架 + 折叠窄条 + 历史轮收起摘要行 + lightbox
 * 定稿 spec：docs/superpowers/specs/2026-07-13-param-card-asset-rail.md §2
 * 视觉贴合 image-chat.html 现有暗色板（slate + violet #c4b5fd / #8b5cf6）。
 * 折叠靠复合类选择器 .ic-work-body.sa-collapsed（0,2,0）压过内联 <style> 的 .ic-work-body（0,1,0），无需 !important。
 */

/* ── 产物架面板（替换「已生成图片」块，沿用 .ic-asset-panel 外框）───────────────── */
.sa-panel { padding-bottom: 6px; }
.sa-head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.sa-head h3 { margin: 0; color: #c4b5fd; font-size: 13px; font-weight: 800; }
.sa-cnt {
  background: rgba(139, 92, 246, .22); color: #c4b5fd;
  border-radius: 999px; padding: 0 8px; font-size: 11.5px; font-weight: 700;
}
.sa-fold {
  margin-left: auto; cursor: pointer; user-select: none;
  background: rgba(15, 23, 42, .6); border: 1px solid rgba(148, 163, 184, .2);
  color: #94a3b8; border-radius: 8px; width: 26px; height: 24px; font-size: 14px; line-height: 1;
}
.sa-fold:hover { color: #c4b5fd; border-color: rgba(139, 92, 246, .5); }

.sa-body { display: block; }
.sa-grp { margin-bottom: 14px; }
.sa-grp:last-child { margin-bottom: 2px; }
.sa-grp-head { display: flex; gap: 6px; align-items: center; font-size: 11.5px; color: #6b7280; margin-bottom: 7px; }
.sa-grp-head b { color: #94a3b8; font-weight: 700; }
.sa-grp-meta { margin-left: auto; color: #6b7280; }

.sa-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; }
.sa-item {
  position: relative; border-radius: 8px; overflow: hidden; cursor: pointer;
  border: 1px solid rgba(148, 163, 184, .16); background: rgba(15, 23, 42, .6);
}
.sa-item > img { width: 100%; height: 66px; object-fit: cover; display: block; }
.sa-item .sa-nm {
  display: block; font-size: 10px; color: #94a3b8; padding: 2px 5px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.sa-item:hover { border-color: rgba(139, 92, 246, .6); }
.sa-item .sa-ops {
  position: absolute; inset: 0; background: rgba(13, 11, 30, .82);
  display: none; flex-wrap: wrap; align-items: center; justify-content: center; gap: 4px; padding: 4px;
}
.sa-item:hover .sa-ops { display: flex; }
.sa-ops button, .sa-ops a {
  background: rgba(36, 28, 73, .95); border: 1px solid rgba(76, 61, 153, .9); color: #d6ccff;
  border-radius: 6px; font-size: 10.5px; padding: 2px 7px; cursor: pointer; text-decoration: none; line-height: 1.5;
}
.sa-ops button:hover, .sa-ops a:hover { border-color: #a78bfa; }

.sa-item.sa-skel { cursor: default; }
.sa-item.sa-skel .sa-sk {
  height: 66px;
  background: linear-gradient(90deg, rgba(23, 19, 45, 1) 25%, rgba(34, 28, 68, 1) 50%, rgba(23, 19, 45, 1) 75%);
  background-size: 200% 100%; animation: sa-sh 1.2s infinite;
}
@keyframes sa-sh { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

/* 审查修#2：url 未过 scheme 白名单时的灰占位（不出 <img src>） */
.sa-noimg { height: 66px; background: rgba(15, 23, 42, .6); }

.sa-empty { text-align: center; color: #6b7280; font-size: 12px; padding: 30px 10px; line-height: 1.7; }
.sa-empty-ic { font-size: 28px; margin-bottom: 8px; }

/* ── 折叠整栏 → 46px 窄条 ───────────────────────────────────────────────────────
 * 复合类选择器压过 image-chat.html 内联 .ic-work-body（同一 grid 声明，特异性更高即胜，无关源码顺序）。
 * 审查修：媒体查询不加特异性——image-chat.html 在 ≤1120px 用 .ic-work-body{1fr}+.ic-asset-side{display:none}
 * 整栏隐藏，若本规则不限宽会在小屏赢过它、留出 46px 空轨。限定 ≥1121px，小屏维持既有隐藏行为。 */
@media (min-width: 1121px) {
  .ic-work-body.sa-collapsed { grid-template-columns: minmax(0, 1fr) 46px; }
}
.ic-asset-side.sa-collapsed { overflow: hidden; }
/* 审查修#3：排除式隐藏——右栏直子不止 .ic-asset-panel（合规摘要块无该类），折叠时除窄条外全部收起 */
.ic-asset-side.sa-collapsed > *:not(.sa-rail-strip) { display: none; }

.sa-rail-strip { display: none; } /* 展开态隐藏 */
.ic-asset-side.sa-collapsed > .sa-rail-strip {
  display: flex; align-items: center; justify-content: center;
  writing-mode: vertical-lr; letter-spacing: 3px;
  width: 46px; height: 100%; min-height: 220px;
  background: rgba(15, 23, 42, .7); border: 1px solid rgba(148, 163, 184, .14);
  border-radius: 12px; color: #c4b5fd; font-size: 12px; font-weight: 700; cursor: pointer;
}
.ic-asset-side.sa-collapsed > .sa-rail-strip:hover { border-color: rgba(139, 92, 246, .55); background: rgba(24, 20, 51, .8); }

/* ── 历史轮收起：#icTimeline 里更早的 image_grid 卡切 class 隐藏 + 摘要行（纯 CSS 收起）──── */
.sa-round-summary { display: none; }
.ic-msg.sa-round-collapsed > .sa-round-summary {
  display: flex; align-items: center; gap: 8px; width: 100%;
  background: rgba(22, 18, 45, .7); border: 1px dashed rgba(139, 92, 246, .35);
  border-radius: 10px; padding: 9px 14px; margin: 2px 0;
  font-size: 13px; color: #94a3b8; cursor: pointer; text-align: left;
}
.ic-msg.sa-round-collapsed > .sa-round-summary:hover { border-color: rgba(139, 92, 246, .7); color: #c4b5fd; }
.ic-msg.sa-round-collapsed > .label { display: none; }
.ic-msg.sa-round-collapsed > .bubble { display: none; }

/* 定位高亮闪 */
.sa-flash { animation: sa-flash 1.6s ease; }
@keyframes sa-flash {
  0%, 55% { box-shadow: 0 0 0 2px #8b5cf6, 0 0 26px rgba(139, 92, 246, .4); border-radius: 14px; }
  100% { box-shadow: none; }
}

/* ── lightbox ───────────────────────────────────────────────────────────────── */
.sa-lb {
  position: fixed; inset: 0; background: rgba(0, 0, 0, .78); z-index: 9999;
  display: none; align-items: center; justify-content: center; padding: 20px;
}
.sa-lb.on { display: flex; }
.sa-lb-card {
  background: #14112b; border: 1px solid #2b2650; border-radius: 14px; padding: 16px;
  width: min(1040px, 90vw); max-height: 92vh; overflow: auto;
}
.sa-lb-stage { display: flex; align-items: center; justify-content: center; }
.sa-lb-img { max-width: 100%; max-height: min(56vh, 500px); border-radius: 10px; display: block; }
.sa-lb-navrow { display: flex; align-items: center; gap: 10px; margin-top: 10px; }
.sa-lb-nav {
  flex: none; width: 34px; height: 34px; border-radius: 50%;
  border: 1px solid #4c3d99; background: #241c49; color: #d6ccff; cursor: pointer; font-size: 18px; line-height: 1;
}
.sa-lb-nav:hover { border-color: #a78bfa; }
.sa-lb-strip { flex: 1; display: flex; gap: 6px; overflow-x: auto; padding: 2px; min-width: 0; }
.sa-lb-st { flex: none; width: 56px; height: 40px; border-radius: 6px; overflow: hidden; border: 2px solid transparent; cursor: pointer; padding: 0; background: none; }
.sa-lb-st img { width: 100%; height: 100%; object-fit: cover; display: block; }
.sa-lb-st.cur { border-color: #8b5cf6; }
.sa-lb-name { font-size: 13px; color: #e5e1ff; margin-top: 10px; }
.sa-lb-ops { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.sa-lb-btn {
  background: #241c49; border: 1px solid #4c3d99; color: #d6ccff; border-radius: 8px;
  padding: 6px 14px; cursor: pointer; font-size: 12.5px; text-decoration: none; line-height: 1.6;
}
.sa-lb-btn:hover { border-color: #a78bfa; }
.sa-lb-btn[disabled] { opacity: .45; cursor: not-allowed; }
.sa-lb-btn-off { opacity: .45; cursor: not-allowed; pointer-events: none; } /* 缺资产 id 的精修钮禁用态 */
.sa-lb-note { font-size: 11.5px; color: #6b659a; margin-top: 8px; }

/* ── toast ───────────────────────────────────────────────────────────────────── */
.sa-toast {
  position: fixed; bottom: 26px; left: 50%; transform: translateX(-50%);
  background: #241c49; border: 1px solid #4c3d99; color: #e9d5ff;
  border-radius: 10px; padding: 8px 18px; font-size: 13px; z-index: 10000; display: none;
}
.sa-toast.on { display: block; }

/* 小屏（现状 <1120px 整栏 display:none，见 image-chat 内联样式）：产物架随之隐藏，属既有行为 */
