/* ==========================================================================
   LuckEner MKT DAM · V2.2
   在 base.css / dam.css / dam-v2.css / dam-theme.css / dam-theme-ia.css 之后加载。
   只做布局与组件收敛，沿用仓库设计令牌：
   --blue #0066cc / --ink #1d1d1f / --parchment #f5f5f7 / --line #e5e5e7
   ========================================================================== */

/* ------------------------------ 顶栏固定 ------------------------------ */

/* base.css 的 body{overflow-x:hidden} 会让 sticky 失效；clip 不产生滚动容器。 */
html,
body { overflow-x: clip; }

.dam-body .app-shell { position: relative; }

.dam-body .sidebar {
  position: sticky;
  top: 0;
  z-index: 40;
  height: 52px;
  background: rgba(255, 255, 255, .88);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
}

.dam-body .main-area { position: relative; z-index: 1; }

.dam-body .content { scroll-margin-top: 64px; }

/* --------------------------- 左上角品牌区（对齐仓库） --------------------------- */

.dam-body .brand-logo { width: 116px; }

.dam-body .brand-copy {
  padding-left: 13px;
  border-left: 1px solid #d2d2d7;
}

.dam-body .brand-title {
  display: flex;
  align-items: baseline;
  gap: 6px;
  min-width: 0;
}

.dam-body .brand-copy strong {
  display: block;
  font-size: 12px;
  line-height: 1.2;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dam-body .brand-copy small {
  margin-top: 2px;
  color: var(--muted-light);
  font-size: 9px;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dam-body .brand-copy .brand-version {
  margin-top: 0;
  color: var(--muted-light);
  font-size: 9px;
  font-weight: 500;
  line-height: 1.2;
  letter-spacing: .01em;
  white-space: nowrap;
}

.dam-body .mobile-brand .brand-copy .brand-version { font-size: 8px; }

/* -------------------------------- 资产库 -------------------------------- */

.dam-body .v2-page-head { margin-bottom: 20px; }

.dam-body .lib-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0;
  margin-bottom: 16px;
  padding: 14px 4px;
  border-top: 1px solid var(--line-soft);
  border-bottom: 1px solid var(--line-soft);
}

.dam-body .lib-stats .v2-stat {
  min-height: 0;
  padding: 0 16px;
  border-right: 1px solid var(--line-soft);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 5px;
}

.dam-body .lib-stats .v2-stat:last-child { border-right: 0; }

.dam-body .lib-stats .v2-stat small {
  font-size: 10px;
  letter-spacing: .03em;
}

.dam-body .lib-stats .v2-stat b {
  font-size: 20px;
  line-height: 1.1;
  font-weight: 600;
}

.dam-body .lib-stats .v2-stat b.v2-stat-sm { font-size: 15px; }

.lib-shell {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #fff;
  overflow: hidden;
}

.lib-top {
  padding: 16px 18px 0;
}

.lib-searchrow {
  display: flex;
  align-items: center;
  gap: 12px;
}

.lib-searchrow .v2-search {
  flex: 1 1 auto;
  min-width: 0;
}

.lib-searchrow .v2-search input {
  height: 44px;
  background: var(--parchment);
  border-color: transparent;
  font-size: 13px;
}

.lib-searchrow .v2-search input:focus {
  background: #fff;
  border-color: #c8c8cd;
  box-shadow: 0 0 0 3px rgba(0, 0, 0, .04);
}

.lib-searchrow .v2-search svg { left: 15px; }

.lib-quick {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 6px;
}

.lib-quick .text-button {
  min-height: 36px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  font-size: 11px;
}

.lib-tabsrow {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 0 12px;
}

.lib-tabs {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 3px;
  border-radius: 999px;
  background: var(--parchment);
}

.lib-tab {
  min-height: 34px;
  padding: 0 18px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 140ms ease, color 140ms ease, box-shadow 140ms ease;
}

.lib-tab:hover { color: var(--ink); }

.lib-tab.active {
  background: #fff;
  color: var(--ink);
  font-weight: 600;
  box-shadow: 0 1px 2px rgba(0, 0, 0, .08), 0 0 0 1px rgba(0, 0, 0, .02);
}

.lib-tab:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }

.lib-tabs-note {
  color: var(--muted-light);
  font-size: 10.5px;
  white-space: nowrap;
}

/* -------------------------------- 三栏 -------------------------------- */

.dam-body .finder {
  --side-w: 224px;
  display: flex;
  align-items: stretch;
  height: max(480px, calc(100vh - 372px));
  max-height: 900px;
  min-height: 480px;
  border: 0;
  border-top: 1px solid var(--line-soft);
  border-radius: 0;
  background: #fff;
  overflow: hidden;
}

.dam-body .finder-col {
  min-width: 0;
  min-height: 0;
  border-right: 1px solid var(--line-soft);
}

.dam-body .finder-side {
  flex: 0 0 var(--side-w);
  width: var(--side-w);
  background: #fff;
}

.dam-body .finder-mid {
  flex: 1 1 auto;
  width: auto;
  background: #fff;
  transition: width 200ms ease;
}

.dam-body .finder-preview {
  flex: 0 0 auto;
  width: clamp(240px, 26%, 320px);
  border-right: 0;
  border-left: 1px solid var(--line-soft);
  background: #fff;
  overflow: hidden;
  opacity: 1;
  visibility: visible;
  transition: width 200ms ease;
}

.dam-body .finder.is-preview .finder-preview {
  width: 46%;
  opacity: 1;
  visibility: visible;
  transition: width 200ms ease, opacity 180ms ease 40ms, visibility 0s;
}

.dam-body .finder-col-head {
  height: 46px;
  flex: 0 0 46px;
  padding: 0 14px;
  background: #fff;
  border-bottom: 1px solid var(--line-soft);
  color: var(--muted);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
}

.dam-body .finder-col-head > span:first-child {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--ink);
  font-size: 12px;
  font-weight: 600;
}

.dam-body .finder-col-head .text-button {
  min-height: 28px;
  padding: 0 8px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--blue);
  font-size: 11px;
  font-weight: 500;
}

.dam-body .finder-col-head .text-button:hover { background: var(--parchment); }

.dam-body .finder-side .finder-scroll { padding: 8px; }

.dam-body .finder-mid .finder-scroll { padding: 6px 6px 10px; }

.dam-body .f-cat {
  height: 36px;
  padding: 0 8px 0 10px;
  border-radius: 9px;
}

.dam-body .f-cat.active { background: var(--ink); color: #fff; }
.dam-body .f-cat.active .f-cat-name,
.dam-body .f-cat.active .f-cat-icon { color: #fff; }
.dam-body .f-cat.active .f-cat-count { color: rgba(255, 255, 255, .72); }
.dam-body .f-cat.active .f-cat-share { color: rgba(255, 255, 255, .8); }

.dam-body .f-cat-share { opacity: .55; }

/* 分类表头 */
.cat-head-ops {
  display: flex;
  align-items: center;
  gap: 2px;
}

/* ------------------------------- 文件栏 ------------------------------- */

.mid-head-ops {
  display: flex;
  align-items: center;
  gap: 2px;
  flex: 0 0 auto;
}

.mid-head-ops .text-button {
  min-height: 28px;
  padding: 0 7px;
  border-radius: 7px;
  color: var(--muted);
  font-size: 10.5px;
}

.mid-head-ops .text-button:hover { color: var(--ink); }

.mid-head-ops [data-action="new-folder"] { color: var(--blue); }

.f-list-group { display: grid; gap: 1px; }

/* 文件夹手风琴 */

.fl-folder { border-radius: 10px; }

.fl-folder + .fl-folder { margin-top: 1px; }

.fl-folder-head {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 46px;
  padding: 0 6px 0 8px;
  border-radius: 10px;
  cursor: pointer;
  user-select: none;
  transition: background-color 120ms ease;
}

.fl-folder-head:hover { background: var(--parchment); }

.fl-folder-head:focus-visible { outline: 2px solid var(--ink); outline-offset: -2px; }

.fl-caret {
  width: 14px;
  height: 14px;
  flex: 0 0 14px;
  display: grid;
  place-items: center;
  color: var(--muted-light);
  transition: transform 160ms ease;
}

.fl-caret svg { width: 12px; height: 12px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.fl-folder.is-open .fl-caret { transform: rotate(90deg); }

.fl-folder-icon {
  width: 26px;
  height: 26px;
  flex: 0 0 26px;
  display: grid;
  place-items: center;
  border-radius: 7px;
  background: var(--parchment);
  color: var(--muted);
}

.fl-folder-icon svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linejoin: round; }

.fl-folder-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--ink);
  font-size: 12.5px;
  font-weight: 600;
}

.fl-folder-meta {
  flex: 0 0 auto;
  margin-left: auto;
  color: var(--muted-light);
  font-size: 10px;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.fl-folder-ops {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 1px;
}

.fl-folder-ops .text-button {
  min-height: 26px;
  padding: 0 6px;
  border-radius: 6px;
  color: var(--muted);
  font-size: 10px;
}

.fl-folder-ops .text-button:hover { background: #ececf0; color: var(--ink); }

.fl-folder-body {
  display: grid;
  gap: 1px;
  padding: 0 0 6px 12px;
  margin-left: 14px;
  border-left: 1px solid var(--line-soft);
}

.fl-folder-body[hidden] { display: none !important; }

.fl-folder-empty {
  padding: 12px 10px 14px;
  color: var(--muted-light);
  font-size: 11px;
}

.fl-unfiled-head {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  margin-top: 4px;
  padding: 0 8px;
  color: var(--muted-light);
  font-size: 10px;
  letter-spacing: .04em;
  text-transform: uppercase;
}

/* 素材行 */

.dam-body .f-row {
  min-height: 58px;
  padding: 5px 6px;
  gap: 10px;
  border-radius: 9px;
  align-items: center;
}

.dam-body .f-row + .f-row { margin-top: 1px; }

.dam-body .v2-thumb {
  width: 48px;
  height: 48px;
  flex: 0 0 48px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
  display: grid;
  place-items: center;
  overflow: hidden;
  position: relative;
}

.dam-body .v2-thumb img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  background: #fff;
  border-radius: 5px;
  position: relative;
  z-index: 1;
}

.dam-body .v2-thumb .v2-thumb-fallback {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: var(--muted-light);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: .02em;
  z-index: 0;
}

.dam-body .v2-thumb.is-missing img { display: none; }

.dam-body .f-row-main { display: grid; gap: 3px; min-width: 0; }

.dam-body .f-row-title {
  font-size: 12.5px;
  font-weight: 500;
  line-height: 1.3;
  color: var(--ink);
}

.dam-body .f-row-sub {
  color: var(--muted-light);
  font-size: 10px;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.f-row-ext {
  flex: 0 0 auto;
  padding: 2px 5px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: #fff;
  color: var(--muted);
  font-size: 9px;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: .02em;
}

.f-row-more {
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  display: grid;
  place-items: center;
  opacity: 0;
  transition: opacity 120ms ease, background-color 120ms ease;
}

.f-row-more svg { width: 16px; height: 16px; fill: currentColor; }

.dam-body .f-row:hover .f-row-more,
.dam-body .f-row.is-selected .f-row-more,
.dam-body .f-row.is-focused .f-row-more { opacity: 1; }

.f-row-more:hover { background: #ececf0; color: var(--ink); }

@media (hover: none) {
  .f-row-more { opacity: 1; }
}

/* ------------------------------- 预览栏 ------------------------------- */

.preview-head { justify-content: space-between; gap: 8px; }

.preview-title {
  color: var(--ink);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0;
  white-space: nowrap;
}

.preview-ops {
  display: flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
}

.preview-act {
  height: 32px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--ink);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 500;
  line-height: 1;
  white-space: nowrap;
  text-decoration: none;
  transition: background-color 120ms ease, border-color 120ms ease;
}

.preview-act:hover { background: var(--parchment); border-color: #d2d2d7; }

.preview-act.is-icon { width: 32px; padding: 0; }

.preview-act svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

.preview-act.download { color: var(--blue); }

.preview-body { padding: 14px 16px 22px; }

.preview-media {
  width: 100%;
  min-height: 220px;
  max-height: 46vh;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  display: grid;
  place-items: center;
  overflow: hidden;
}

.preview-media img {
  display: block;
  max-width: 100%;
  max-height: 42vh;
  width: auto;
  height: auto;
  object-fit: contain;
  object-position: center;
  background: #fff;
  border-radius: 6px;
}

.preview-media.is-video {
  position: relative;
  aspect-ratio: 16 / 9;
  max-height: 56vh;
  min-height: 0;
  padding: 0;
  border-color: #0a0a0a;
  background: #000;
}

.preview-media.is-video video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  max-height: none;
  display: block;
  object-fit: contain;
  background: #000;
}

.preview-media .v2-file-chip { max-width: 100%; }

.preview-media .v2-media-fallback { display: none; }

.preview-meta {
  margin-top: 14px;
  display: grid;
}

.preview-meta .v2-meta-row {
  display: grid;
  grid-template-columns: 84px minmax(0, 1fr);
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--line-soft);
  font-size: 11.5px;
}

.preview-meta .v2-meta-row:last-child { border-bottom: 0; }

.preview-meta .v2-meta-row > span { color: var(--muted); }

.preview-meta .v2-meta-row > b {
  font-weight: 500;
  color: var(--ink);
  overflow-wrap: anywhere;
}

.preview-title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin: 16px 0 6px;
}

.preview-title-row h2 {
  font-size: 17px;
  line-height: 1.3;
  letter-spacing: -0.01em;
  font-weight: 600;
  overflow-wrap: anywhere;
}

.preview-empty {
  min-height: 260px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 6px;
  color: var(--muted-light);
  text-align: center;
  font-size: 12px;
}

.preview-empty strong { color: var(--muted); font-size: 13px; font-weight: 500; }

.preview-empty svg { width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 1.4; opacity: .7; }

.v2-multi-note {
  margin-bottom: 12px;
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--parchment);
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 11px;
}

.v2-multi-note .button { min-height: 32px; margin-left: auto; padding: 0 12px; font-size: 11px; }

/* -------------------------------- 详情页 -------------------------------- */

.dam-body .v2-detail-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 400px;
  gap: 20px;
  align-items: stretch;
}

.dam-body .v2-detail-main,
.dam-body .v2-detail-side {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.dam-body .v2-detail-main > .v2-preview-panel {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
}

.dam-body .v2-preview-panel .v2-preview-stage {
  flex: 1 1 auto;
  min-height: 420px;
  padding: 20px;
  display: grid;
  place-items: center;
  background: #fff;
}

.dam-body .v2-preview-stage img.v2-media {
  display: block;
  max-width: 100%;
  max-height: 72vh;
  width: auto;
  height: auto;
  object-fit: contain;
  object-position: center;
  background: #fff;
  border-radius: 8px;
}

.dam-body .v2-preview-stage.is-video {
  padding: 0;
  background: #000;
  aspect-ratio: 16 / 9;
  min-height: 420px;
  overflow: hidden;
}

.dam-body .v2-preview-stage.is-video video.v2-media {
  width: 100%;
  height: 100%;
  min-height: 420px;
  max-height: none;
  display: block;
  object-fit: contain;
  background: #000;
}

.dam-body .v2-detail-side > .panel {
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.dam-body .v2-detail-side > .panel:first-child { flex: 1 1 auto; }

.dam-body .v2-detail-side .panel-body { flex: 1 1 auto; }

.dam-body .v2-meta-rows { display: grid; }

.dam-body .v2-meta-rows .v2-meta-row,
.dam-body .v2-meta-rows .v2-meta-row-edit {
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  min-height: 40px;
  padding: 8px 0;
  border-bottom: 1px solid var(--line-soft);
  font-size: 12.5px;
}

.dam-body .v2-meta-rows .v2-meta-row:last-child { border-bottom: 0; }

.dam-body .v2-meta-rows .v2-meta-row > span,
.dam-body .v2-meta-rows .v2-meta-row-edit > span {
  color: var(--muted);
  font-weight: 400;
}

.dam-body .v2-meta-rows .v2-meta-row > b {
  color: var(--ink);
  font-weight: 500;
  overflow-wrap: anywhere;
}

.dam-body .v2-meta-row-edit .v2-detail-select {
  width: 100%;
  min-width: 0;
  height: 34px;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  font-size: 12px;
}

.dam-body .v2-detail-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.dam-body .v2-detail-actions .button {
  min-height: 38px;
  padding: 0 15px;
  font-size: 12.5px;
}

.dam-body .v2-detail-title { font-size: 34px; line-height: 1.15; letter-spacing: -0.015em; }

.dam-body .v2-detail-top { margin-bottom: 14px; }

.dam-body .v2-preview-caption {
  padding: 11px 18px;
  border-top: 1px solid var(--line-soft);
  color: var(--muted-light);
  font-size: 11px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.dam-body .v2-media-note {
  margin: 0;
  padding: 0 18px 14px;
  color: var(--muted-light);
  font-size: 11px;
}

.dam-body .v2-versions-panel { flex: 0 0 auto; }

.dam-body .meta-move-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.dam-body .meta-move-row .button {
  min-height: 32px;
  padding: 0 12px;
  font-size: 11px;
}

.dam-body .meta-folder-name {
  min-width: 0;
  color: var(--ink);
  font-weight: 500;
  overflow-wrap: anywhere;
}

/* 详情编辑字段：品牌不显示型号 */
.dam-body .v2-detail-side .form-grid { gap: 12px; }

.dam-body .v2-detail-side .form-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

/* ------------------------------ 分类管理弹窗 ------------------------------ */

.cat-mgr { display: grid; gap: 4px; }

.cat-mgr-tools {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.cat-mgr-tools .button {
  min-height: 36px;
  padding: 0 14px;
  font-size: 12px;
}

.cat-mgr-section {
  margin: 16px 0 4px;
  color: var(--muted-light);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.cat-mgr-section:first-child { margin-top: 0; }

.cat-mgr-row {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 46px;
  padding: 4px 8px;
  border-radius: 9px;
  cursor: pointer;
  transition: background-color 120ms ease;
}

.cat-mgr-row:hover { background: var(--parchment); }

.cat-mgr-row:focus-visible { outline: 2px solid var(--ink); outline-offset: -2px; }

.cat-mgr-icon {
  width: 26px;
  height: 26px;
  flex: 0 0 26px;
  display: grid;
  place-items: center;
  border-radius: 7px;
  background: var(--parchment);
  color: var(--muted);
  overflow: hidden;
}

.cat-mgr-icon img { width: 100%; height: 100%; object-fit: contain; }

.cat-mgr-icon svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.6; }

.cat-mgr-name {
  min-width: 0;
  flex: 1 1 auto;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--ink);
}

.cat-mgr-count { color: var(--muted-light); font-size: 10px; }

.cat-mgr-actions { display: flex; gap: 2px; }

.cat-mgr-actions .text-button { font-size: 10.5px; }

.cat-mgr-row.is-child { margin-left: 26px; }

.cat-mgr-row.is-child .cat-mgr-name { font-weight: 400; }

.cat-mgr-back {
  justify-self: start;
  margin-bottom: 8px;
}

.cat-mgr-editor .v2-cat-icon-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 0 16px;
}

.cat-mgr-editor .v2-cat-icon-lg {
  width: 48px;
  height: 48px;
  flex: 0 0 48px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  display: grid;
  place-items: center;
  overflow: hidden;
}

.cat-mgr-editor .v2-cat-icon-lg img { width: 100%; height: 100%; object-fit: contain; }

.cat-mgr-editor .v2-cat-icon-lg svg { width: 22px; height: 22px; fill: none; stroke: var(--muted); stroke-width: 1.5; }

.cat-mgr-editor .v2-cat-icon-ops { display: grid; gap: 6px; }

.cat-mgr-editor .v2-cat-icon-btns { display: flex; gap: 6px; flex-wrap: wrap; }

.cat-mgr-editor .v2-cat-icon-btns .button {
  min-height: 32px;
  padding: 0 11px;
  font-size: 11px;
}

.cat-mgr-editor .v2-cat-name-form {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 4px;
}

.cat-mgr-editor .v2-cat-name-form .field { flex: 1 1 200px; }

.cat-mgr-editor .v2-cat-name-form .button { min-height: 40px; }

.cat-mgr-editor .v2-cat-danger {
  margin-top: 22px;
  padding-top: 14px;
  border-top: 1px solid var(--line-soft);
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.cat-mgr-editor .v2-cat-danger span { color: var(--muted-light); font-size: 10.5px; }

/* ------------------------------- 行内菜单 ------------------------------- */

.row-menu {
  position: fixed;
  z-index: 80;
  min-width: 178px;
  max-width: 240px;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, .98);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  box-shadow: 0 14px 40px rgba(0, 0, 0, .16);
}

.row-menu button,
.row-menu a {
  width: 100%;
  min-height: 36px;
  padding: 0 9px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--ink);
  display: flex;
  align-items: center;
  gap: 8px;
  font: inherit;
  font-size: 12px;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}

.row-menu button:hover,
.row-menu a:hover { background: var(--parchment); }

.row-menu .is-danger { color: var(--red); }

.row-menu-sep { height: 1px; margin: 4px 2px; background: var(--line-soft); }

/* ------------------------------ 文件夹 / 归档 ------------------------------ */

.folder-pick-list {
  display: grid;
  gap: 4px;
  max-height: 46vh;
  overflow: auto;
}

.folder-pick {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 44px;
  padding: 6px 10px;
  border: 1px solid transparent;
  border-radius: 9px;
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.folder-pick:hover { background: var(--parchment); }

.folder-pick.is-current { border-color: var(--line); background: var(--parchment); }

.folder-pick-mark {
  width: 28px;
  height: 28px;
  flex: 0 0 28px;
  border-radius: 7px;
  background: #fff;
  border: 1px solid var(--line);
  display: grid;
  place-items: center;
  color: var(--muted);
}

.folder-pick-mark svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.6; }

.folder-pick-main { min-width: 0; display: grid; gap: 2px; }

.folder-pick-main strong { font-size: 12.5px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.folder-pick-main small { color: var(--muted-light); font-size: 10px; }

.archive-list { display: grid; gap: 2px; }

.archive-row {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 56px;
  padding: 6px 8px;
  border-radius: 9px;
}

.archive-row:hover { background: var(--parchment); }

.archive-main { min-width: 0; flex: 1 1 auto; display: grid; gap: 2px; }

.archive-main strong { font-size: 12.5px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.archive-main small { color: var(--muted-light); font-size: 10px; }

.archive-ops { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; justify-content: flex-end; }

.archive-ops .text-button { font-size: 11px; }

.archive-empty { padding: 36px 18px; text-align: center; color: var(--muted-light); font-size: 12px; }

/* 弹窗内表单 */

.modal .form-grid { gap: 12px; }

.folder-dialog-hint {
  margin-top: 10px;
  color: var(--muted-light);
  font-size: 11px;
  line-height: 1.5;
}

/* --------------------------------- 移动端 --------------------------------- */

@media (max-width: 1180px) {
  .dam-body .global-nav-inner {
    grid-template-columns: minmax(300px, 320px) minmax(0, 1fr);
    gap: 16px;
  }

  .dam-body .finder { --side-w: 200px; }
  .dam-body .finder.is-preview .finder-preview { width: 44%; }
  .dam-body .v2-detail-grid { grid-template-columns: minmax(0, 1fr) 360px; }
}

@media (max-width: 980px) {
  .dam-body .finder { --side-w: 188px; }
  .dam-body .finder.is-preview .finder-preview { width: 42%; }
  .lib-tabs-note { display: none; }
}

@media (max-width: 820px) {
  /* 顶栏：base.css 已切为“顶部品牌条 + 底部标签栏”，此处只做尺寸收敛 */
  .dam-body .sidebar {
    position: fixed;
    top: auto;
    bottom: 0;
    z-index: 45;
    height: calc(60px + env(safe-area-inset-bottom));
  }

  .dam-body .mobile-brand {
    z-index: 51;
    width: min(250px, calc(100vw - 74px));
    gap: 8px;
  }

  .dam-body .mobile-brand .brand-logo { width: 68px; }

  .dam-body .mobile-brand .brand-copy {
    padding-left: 8px;
    border-left: 1px solid #d2d2d7;
  }

  .dam-body .mobile-brand .brand-copy strong { font-size: 10px; }

  .dam-body .mobile-brand .brand-copy small { font-size: 8px; }

  .dam-body .mobile-brand .brand-version { font-size: 8px; }

  .dam-body .content { padding: calc(var(--mobile-topbar-height) + 12px) 16px calc(78px + env(safe-area-inset-bottom)); }

  .dam-body .v2-page-head { margin-bottom: 16px; }

  .dam-body .lib-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0;
    padding: 0;
    border: 0;
    margin-bottom: 14px;
    border-radius: 14px;
    background: var(--parchment);
  }

  .dam-body .lib-stats .v2-stat {
    padding: 12px 14px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    flex-direction: row;
    align-items: baseline;
    gap: 8px;
  }

  .dam-body .lib-stats .v2-stat:nth-child(odd) { border-right: 1px solid var(--line); }

  .dam-body .lib-stats .v2-stat:nth-last-child(-n + 2) { border-bottom: 0; }

  .dam-body .lib-stats .v2-stat b { font-size: 18px; }

  .dam-body .lib-stats .v2-stat b.v2-stat-sm { font-size: 13px; }

  .lib-top { padding: 12px 12px 0; }

  .lib-searchrow { gap: 8px; }

  .lib-searchrow .v2-search { flex: 1 1 100%; }

  .lib-searchrow .v2-search input { height: 44px; font-size: 16px; }

  .lib-quick { display: none; }

  .lib-tabsrow { padding: 10px 0; gap: 8px; }

  .lib-tabs { width: 100%; }

  .lib-tab { flex: 1 1 0; min-width: 0; min-height: 36px; padding: 0 8px; font-size: 13px; }

  .dam-body .finder {
    display: block;
    height: auto;
    min-height: 0;
    max-height: none;
    border-top: 1px solid var(--line-soft);
  }

  .dam-body .finder-col {
    border: 0;
    border-bottom: 1px solid var(--line-soft);
    border-radius: 0;
  }

  .dam-body .finder-side {
    width: 100%;
    max-height: 236px;
  }

  .dam-body .finder-side .finder-scroll { max-height: 190px; }

  .dam-body .finder-mid {
    width: 100%;
    height: 52vh;
    min-height: 320px;
    max-height: 560px;
    border-bottom: 1px solid var(--line-soft);
  }

  .dam-body .finder-preview {
    display: block;
    width: 100%;
    max-height: none;
    border-left: 0;
    border-bottom: 0;
    opacity: 0;
    visibility: hidden;
    height: 0;
    overflow: hidden;
    scroll-margin-top: 68px;
    transition: opacity 160ms ease;
  }

  .dam-body .finder.is-preview .finder-preview {
    width: 100%;
    height: auto;
    opacity: 1;
    visibility: visible;
  }

  .dam-body .finder.is-preview .finder-mid { display: none; }

  .dam-body .finder-preview .preview-body { padding: 14px 14px 22px; }

  .preview-head { flex-wrap: wrap; height: auto; min-height: 48px; padding: 8px 12px; }

  .preview-act { height: 32px; padding: 0 9px; font-size: 11px; }

  .preview-media { min-height: 200px; max-height: 46vh; padding: 8px; }

  .preview-media img { max-height: 40vh; }

  .preview-media.is-video { max-height: 56vh; }

  .dam-body .v2-detail-grid { grid-template-columns: minmax(0, 1fr); gap: 14px; }

  .dam-body .v2-detail-title { font-size: 26px; }

  .dam-body .v2-preview-panel .v2-preview-stage { min-height: 300px; padding: 12px; }

  .dam-body .v2-preview-stage.is-video { min-height: 300px; }

  .dam-body .v2-preview-stage.is-video video.v2-media { min-height: 300px; }

  .dam-body .v2-meta-rows .v2-meta-row,
  .dam-body .v2-meta-rows .v2-meta-row-edit { grid-template-columns: 78px minmax(0, 1fr); }

  .dam-body .finder-col-head { height: 46px; flex-basis: 46px; }

  .mid-head-ops .text-button { padding: 0 6px; font-size: 10.5px; }

  .dam-body .f-row { min-height: 56px; }

  .f-row-more { opacity: 1; }

  .fl-folder-meta { font-size: 10px; }

  .cat-mgr-editor .v2-cat-name-form .button { width: 100%; }

  .modal .form-grid { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 480px) {
  .dam-body .v2-page-sub { font-size: 13px; }

  .dam-body .lib-stats .v2-stat { padding: 10px 12px; }

  .dam-body .lib-stats .v2-stat b { font-size: 16px; }

  .mid-head-ops { gap: 0; }

  .mid-head-ops .text-button { padding: 0 5px; }

  .fl-folder-head { flex-wrap: wrap; padding-right: 4px; }

  .fl-folder-meta { margin-left: 0; padding-left: 0; }

  .fl-folder-ops { margin-left: auto; }

  .preview-ops { gap: 3px; }

  .preview-act { padding: 0 8px; font-size: 10.5px; }

  .preview-act.is-icon { width: 30px; padding: 0; }

  .dam-body .v2-detail-actions .button { flex: 1 1 auto; }

  .dam-body .v2-detail-actions .badge { width: 100%; justify-content: center; }
}

/* V2.2 收尾：详情危险文案、文件夹内缩、预览栏滚动 */
.dam-body .v2-danger-text {
  border-color: #f0b8be;
  color: var(--red);
}

.dam-body .fl-folder-body .f-row {
  padding-left: 8px;
}

.dam-body .fl-folder-body .f-row .v2-thumb {
  width: 42px;
  height: 42px;
  flex-basis: 42px;
}

.dam-body .finder-preview-body {
  display: block;
}

.dam-body .finder-preview-body .preview-media { margin-top: 2px; }

@media (max-width: 820px) {
  .dam-body .finder-preview-body { padding: 14px; }
}

/* --- 详情页视频舞台：按 16:9 锁定高度，避免被 flex 拉伸产生超大黑边 --- */
.dam-body .v2-preview-panel:has(.v2-preview-stage.is-video) { flex: 0 0 auto; }
.dam-body .v2-preview-panel:has(.v2-preview-stage.is-video) .v2-preview-stage {
  flex: 0 0 auto;
  min-height: 0;
  aspect-ratio: 16 / 9;
}
.dam-body .v2-detail-main:has(.v2-preview-stage.is-video) .v2-versions-panel { flex: 1 1 auto; }
