/* 资产库素材卡片与全屏预览：对标线上 card-list / FullscreenPreview。仅用语义 token。 */
.asset-grid,
.card-list__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(236px, 1fr));
  gap: var(--df-space-4);
  padding: 0 0 var(--df-space-6);
}
/* 素材封面的原始尺寸不能决定网格列宽。 */
.story-detail .asset-card { min-width: 0; }
.story-detail .asset-card__media {
  position: relative;
  display: grid;
  place-items: center;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: var(--df-radius-lg);
  background: var(--df-color-surface-raised);
}
.story-detail .asset-card__media img {
  width: 100%;
  height: 100%;
  min-height: 0;
  object-fit: cover;
}
.story-detail .asset-card__badge {
  position: absolute;
  inset-block-start: var(--df-space-2);
  inset-inline-start: var(--df-space-2);
  padding-inline: var(--df-space-2);
  border-radius: var(--df-radius-sm);
  background: var(--df-color-surface);
  color: var(--df-color-text-strong);
}
.asset-grid[hidden],
.card-list__grid[hidden] { display: none; }

.card-list__card {
  position: relative;
  height: auto;
  overflow: visible;
  border: 0 solid transparent;
  border-radius: 0;
  background: transparent;
  color: var(--df-color-text-strong);
  cursor: pointer;
}
.card-list__card:hover { box-shadow: none; }
.card-list__card:hover .card-list__image { box-shadow: var(--df-shadow-card-hover); }
.card-list__card:hover .label-with-actions__trigger { opacity: 1; pointer-events: auto; }
.card-list__card--has-locate:hover .card-list__locate { opacity: 1; pointer-events: auto; }
.card-list__card.is-batch,
.card-list__card--batch { border: 0; box-shadow: none; }
.card-list__card.is-batch:hover .card-list__image,
.card-list__card.is-selected .card-list__image {
  outline: 2px solid var(--df-color-primary);
  outline-offset: -2px;
}

.card-list__image {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 236px;
  overflow: hidden;
  padding: 0;
  border: 0;
  border-radius: 12px;
  background: var(--df-color-surface-raised);
  color: inherit;
  cursor: inherit;
}
.card-list__image img,
.card-list__image video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.card-list__play-icon {
  position: absolute;
  left: 12px;
  bottom: 12px;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--df-palette-neutral-950);
  color: var(--df-color-on-media);
  pointer-events: none;
}
.card-list__play-icon .df-icon { width: 10px; height: 10px; }

.card-list__locate {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 2;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  box-sizing: border-box;
  height: 80px;
  padding-bottom: 12px;
  background: linear-gradient(360deg, var(--df-color-surface-card) 1%, transparent 98%);
  opacity: 0;
  pointer-events: none;
}
.card-list__locate-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: calc(100% - 44px);
  height: 32px;
  padding: 0 12px;
  border: 1px solid var(--df-color-border-strong);
  border-radius: var(--df-radius-md);
  background: var(--df-color-surface-raised);
  color: var(--df-color-text-strong);
  font: inherit;
  font-size: var(--df-font-size-sm);
  cursor: pointer;
}
.card-list__locate-btn .df-icon { width: 16px; height: 16px; }

.card-list__info {
  height: 64px;
  background: transparent;
}
.card-list__info-default {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  box-sizing: border-box;
  height: 64px;
  padding: 10px 2px 0;
}
.label-with-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
}
.label-with-actions__label {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  color: var(--df-color-text-strong);
  font-size: var(--df-font-size-sm);
  font-weight: 500;
  line-height: 20px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.label-with-actions__trigger {
  display: inline-flex;
  flex: none;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  padding: 0;
  border: 0;
  border-radius: var(--df-radius-sm);
  background: transparent;
  color: var(--df-color-text-strong);
  opacity: 0;
  pointer-events: none;
  cursor: pointer;
  transition: background-color .2s ease;
}
.label-with-actions__trigger:hover { background: var(--df-color-fill); }
.label-with-actions__trigger:focus-visible,
.card-menu button:focus-visible {
  opacity: 1;
  outline: 2px solid var(--df-color-focus-ring);
  outline-offset: -2px;
}
.label-with-actions__trigger .df-icon { width: 18px; height: 18px; }
.card-list__card.is-menu-open .label-with-actions__trigger { opacity: 1; pointer-events: auto; }

.card-list__meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--df-color-text-muted);
  font-size: var(--df-font-size-xs);
  line-height: 18px;
}
.card-list__author,
.card-list__date {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.card-list__check {
  position: absolute;
  top: var(--df-space-2);
  left: var(--df-space-2);
  z-index: 3;
  display: none;
  padding: 2px;
  border-radius: var(--df-radius-sm);
  background: var(--df-color-tag-bg);
}
.task-list .card-list__check input[type="checkbox"] {
  box-sizing: border-box;
  width: 14px;
  height: 14px;
  margin: 0;
  padding: 0;
  accent-color: var(--df-color-primary);
  cursor: pointer;
}
.card-list__card.is-batch .card-list__check { display: block; }

.card-menu {
  position: fixed;
  z-index: var(--df-z-popover);
  min-width: 96px;
  padding: 4px 0;
  border: 0;
  border-radius: var(--df-radius-lg);
  background: var(--df-color-menu-bg);
  box-shadow: var(--df-shadow-popover);
}
.card-menu[hidden] { display: none; }
.card-menu button {
  display: flex;
  align-items: center;
  gap: 4px;
  width: 100%;
  height: 34px;
  padding: 0 16px;
  border: 0;
  background: transparent;
  color: var(--df-color-text-soft);
  font: inherit;
  font-size: var(--df-font-size-xs);
  line-height: 17px;
  white-space: nowrap;
  cursor: pointer;
}
.card-menu button:hover { background: var(--df-color-fill); }
.card-menu button .df-icon { width: 14px; height: 14px; }
.card-menu button.is-danger { color: var(--df-color-danger); }
html[data-theme="light"] .card-menu button.is-danger { color: var(--df-color-danger-text, #bd252e); }
html[data-theme="dark"] .card-menu button.is-danger { color: var(--df-color-danger-hover); }
html[data-theme="dark"] .card-menu button.is-danger:is(:hover, :focus-visible) {
  color: color-mix(in srgb, var(--df-color-danger-hover) 76%, var(--df-color-on-media));
}

.asset-batch {
  position: sticky;
  bottom: var(--df-space-4);
  display: flex;
  align-items: center;
  gap: var(--df-space-3);
  align-self: flex-start;
  margin: 0 0 var(--df-space-4);
  padding: var(--df-space-2) var(--df-space-4);
  border: 1px solid var(--df-color-divider);
  border-radius: var(--df-radius-pill);
  background: var(--df-color-panel);
  box-shadow: var(--df-shadow-popover);
  font-size: var(--df-font-size-sm);
}
.asset-batch[hidden] { display: none; }
.asset-batch button {
  padding: 4px 12px;
  border: 1px solid var(--df-color-border);
  border-radius: var(--df-radius-pill);
  background: transparent;
  color: var(--df-color-text);
  font: inherit;
  font-size: var(--df-font-size-xs);
  cursor: pointer;
}
.asset-batch button[disabled] { color: var(--df-color-text-faint); cursor: not-allowed; }
.asset-batch button.is-danger { color: var(--df-color-danger); border-color: var(--df-color-danger); }

/* ---------- 全屏预览（对标 FullscreenPreview） ----------
   注意：不可在未 open 时写 display:flex，否则会盖掉 UA 的 dialog:not([open]){display:none}，
   导致一进页就铺满且 close() 无效。 */
.fullscreen-preview {
  position: fixed;
  inset: 0;
  z-index: 9999;
  box-sizing: border-box;
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  overflow: hidden;
  margin: 0;
  padding: 0;
  border: 0;
  background: var(--df-color-preview-scrim);
  color: var(--df-color-text-on-card);
  overscroll-behavior-x: contain;
}
.fullscreen-preview[open] {
  display: flex;
  flex-direction: column;
}
.fullscreen-preview:not([open]),
.fullscreen-preview[hidden] { display: none; }
.fullscreen-preview::backdrop { background: transparent; }
.fullscreen-preview__close {
  position: absolute;
  top: 24px;
  right: 24px;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--df-color-on-media);
  cursor: pointer;
  transition: opacity .2s;
}
.fullscreen-preview__close:hover { color: var(--df-color-on-media); opacity: .85; }
.fullscreen-preview__close .df-icon,
.fullscreen-preview__close svg {
  width: 20px;
  height: 20px;
  color: var(--df-color-on-media);
  fill: var(--df-color-on-media);
}
.fullscreen-preview__body {
  display: flex;
  flex: 1;
  align-items: center;
  justify-content: center;
  min-height: 0;
  overflow: hidden;
  padding: 40px 40px 0;
}
.fullscreen-preview__content {
  display: flex;
  gap: 20px;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  max-height: 80%;
}
.fullscreen-preview__media {
  position: relative;
  display: flex;
  flex: 1;
  align-items: center;
  justify-content: center;
  align-self: stretch;
  min-width: 0;
  overflow: hidden;
  border-radius: var(--df-radius-lg);
  background: var(--df-color-surface-media);
}
.fullscreen-preview__media-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  height: 100%;
  color: var(--df-color-on-media-muted);
  font-size: 24px;
  line-height: 36px;
}
.fullscreen-preview__media-placeholder--video { gap: 16px; font-size: 14px; line-height: 22px; }
.fullscreen-preview__media-placeholder .df-icon {
  width: 112px;
  height: 112px;
  color: var(--df-color-on-media-muted);
  fill: currentColor;
}
.fullscreen-preview__ai-tag {
  position: absolute;
  right: 16px;
  bottom: 16px;
  z-index: 2;
  padding: 2px 8px;
  border-radius: var(--df-radius-sm);
  background: var(--df-color-preview-ai-tag-bg);
  color: var(--df-color-on-media);
  font-size: var(--df-font-size-xs);
  line-height: 18px;
  pointer-events: none;
}
.fullscreen-preview__info {
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  align-self: stretch;
  justify-content: space-between;
  width: 280px;
  padding-bottom: 20px;
  border-radius: var(--df-radius-lg);
  background: var(--df-color-surface-media);
}
.fullscreen-preview__info-content {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
}
.fullscreen-preview__title {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  margin: 0 0 8px;
  color: var(--df-color-text-on-card);
  font-size: 16px;
  font-weight: 600;
  line-height: 28px;
  word-break: break-all;
}
.fullscreen-preview__desc-list { margin-bottom: 20px; }
.fullscreen-preview__desc {
  color: var(--df-color-text-soft);
  font-size: var(--df-font-size-xs);
  font-weight: 400;
  line-height: 18px;
  word-break: break-all;
}
.fullscreen-preview__info-row {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 20px;
}
.fullscreen-preview__info-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.fullscreen-preview__info-label {
  color: var(--df-color-text-faint);
  font-size: var(--df-font-size-xs);
  line-height: 18px;
}
.fullscreen-preview__copy {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--df-color-text-faint);
  cursor: pointer;
}
.fullscreen-preview__copy:hover { color: var(--df-color-text-soft); }
.fullscreen-preview__copy .df-icon { width: 14px; height: 14px; }
.fullscreen-preview__info-value {
  color: var(--df-color-text-on-card);
  font-size: var(--df-font-size-xs);
  font-weight: 400;
  line-height: normal;
  word-break: break-all;
}
.fullscreen-preview__info-param {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  font-size: var(--df-font-size-xs);
  line-height: 18px;
}
.fullscreen-preview__info-param + .fullscreen-preview__info-param { margin-top: 8px; }
.fullscreen-preview__info-param-label {
  flex-shrink: 0;
  color: var(--df-color-text-on-card);
  font-size: var(--df-font-size-xs);
  font-weight: 400;
}
.fullscreen-preview__info-param-value {
  color: var(--df-color-text-on-card);
  font-size: var(--df-font-size-xs);
  font-weight: 400;
  line-height: normal;
  text-align: right;
  word-break: break-all;
}
.fullscreen-preview__actions {
  display: flex;
  flex-shrink: 0;
  gap: 12px;
  margin-top: 20px;
  padding: 0 20px;
}
.fullscreen-preview__action-btn {
  display: inline-flex;
  flex: 1;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 32px;
  padding: 0 8px;
  border: 1px solid var(--df-color-border);
  border-radius: var(--df-radius-sm);
  background: var(--df-color-surface-panel);
  color: var(--df-color-text-on-card);
  font: inherit;
  font-size: var(--df-font-size-xs);
  cursor: pointer;
}
.fullscreen-preview__action-btn .df-icon { width: 14px; height: 14px; }

/* ---------- 真人素材组明细（P-04b） ---------- */
.team-group-name {
  width: 200px;
  padding: 4px 8px;
  border: 1px solid transparent;
  border-radius: var(--df-radius-md);
  background: transparent;
  color: var(--df-color-text);
  font: inherit;
  font-size: var(--df-font-size-lg);
  font-weight: var(--df-font-weight-medium);
}
.team-group-name:hover { border-color: var(--df-color-border); }
.team-group-name:focus { border-color: var(--df-color-focus-ring); outline: none; background: var(--df-color-surface-sunken); }
.team-group-meta { color: var(--df-color-text-faint); font-size: var(--df-font-size-xs); }
.person-asset-actions {
  display: flex;
  gap: var(--df-space-1);
  padding: var(--df-space-2) var(--df-space-2) 0;
}
.person-asset-actions button {
  flex: 1;
  padding: 4px 8px;
  border: 1px solid var(--df-color-border);
  border-radius: var(--df-radius-md);
  background: transparent;
  color: var(--df-color-text);
  font: inherit;
  font-size: var(--df-font-size-xs);
  cursor: pointer;
}
.person-asset-actions button:hover { background: var(--df-color-surface-hover); }
.person-asset-actions .is-danger { color: var(--df-color-danger); border-color: var(--df-color-danger); }
.asset-busy-mask { position: absolute; inset: 0; z-index: 20; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; overflow: hidden; border-radius: inherit; background: var(--df-color-overlay); pointer-events: auto; }
.asset-busy-mask__icon { flex-shrink: 0; color: var(--df-color-text-on-card); }
.asset-busy-mask__icon .df-icon { width: 24px; height: 24px; }
.asset-busy-mask__icon.is-spin { animation: asset-busy-mask-spin 2s linear infinite; }
.asset-busy-mask__text { margin: 0; color: var(--df-color-text-on-card); font-size: 14px; font-weight: 600; line-height: 1.5; text-align: center; }
@keyframes asset-busy-mask-spin { from { transform: rotate(0); } to { transform: rotate(360deg); } }

.task-list .card-list__check input[type="checkbox"]:enabled:not(:checked) {
  border-color: var(--df-palette-white);
}
