/**
 * LuckEner MKT DAM System · V2 界面样式
 * 在 base.css / dam.css 之后加载，只新增 V2 组件；不改动 base.css。
 * 设计：极简黑白、大量留白、圆角卡片、白色正方形缩略图底。
 */

/* ----------------------------- 顶栏与全局 ------------------------------ */

.app-version {
  height: 24px;
  padding: 0 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--muted);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: .04em;
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
}

.dam-body .global-nav-inner {
  grid-template-columns: minmax(340px, 420px) minmax(0, 1fr);
}

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

.dam-body .brand-copy strong {
  font-size: 13px;
  letter-spacing: .01em;
}

.dam-body.is-modal-open {
  overflow: hidden;
}

.dam-body.is-login .sidebar,
.dam-body.is-login .global-nav-actions,
.dam-body.is-login .mobile-brand {
  display: none;
}

.dam-body.is-login .main-area .content {
  padding: 0;
  min-height: 100vh;
  display: grid;
  place-items: center;
}

.dam-body.is-public .main-area .content {
  padding-top: 0;
}

.v2-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* ------------------------------- 页头区 -------------------------------- */

.v2-page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 18px;
}

.v2-page-head h1 {
  font-size: 30px;
  line-height: 1.15;
  letter-spacing: -.01em;
}

.v2-page-sub {
  margin-top: 7px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.v2-head-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

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

.v2-detail-title {
  font-size: 26px;
  line-height: 1.2;
  letter-spacing: -.01em;
  overflow-wrap: anywhere;
}

/* ------------------------------- 统计条 -------------------------------- */

.v2-statline {
  display: flex;
  align-items: center;
  gap: 26px;
  padding: 12px 2px 4px;
  flex-wrap: wrap;
}

.v2-stat {
  display: flex;
  align-items: baseline;
  gap: 8px;
  min-width: 0;
}

.v2-stat small {
  color: var(--muted-light);
  font-size: 10px;
  letter-spacing: .04em;
}

.v2-stat b {
  font-size: 16px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.v2-stat b.v2-stat-sm {
  font-size: 13px;
}

/* -------------------------------- 筛选 --------------------------------- */

.v2-filters {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 14px 0 16px;
  flex-wrap: wrap;
}

.v2-search {
  position: relative;
  flex: 1 1 300px;
  min-width: 220px;
  display: flex;
  align-items: center;
}

.v2-search svg {
  position: absolute;
  left: 14px;
  width: 15px;
  height: 15px;
  fill: none;
  stroke: var(--muted-light);
  stroke-width: 1.7;
  stroke-linecap: round;
  pointer-events: none;
}

.v2-search input {
  width: 100%;
  height: 42px;
  padding: 0 14px 0 38px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  font-size: 12px;
  color: var(--ink);
  outline: none;
  transition: border-color 150ms ease, box-shadow 150ms ease;
}

.v2-search input:focus {
  border-color: #b8b8bd;
  box-shadow: 0 0 0 3px rgba(0, 0, 0, .05);
}

.dam-body select.v2-filter {
  height: 42px;
  min-width: 150px;
  border-radius: 999px;
  border-color: var(--line);
  background: #fff;
  font-size: 12px;
}

/* ----------------------------- 访达分栏视图 ----------------------------- */

.finder {
  display: grid;
  grid-template-columns: 238px minmax(320px, 400px) minmax(0, 1fr);
  height: calc(100vh - 300px);
  min-height: 420px;
  max-height: 900px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--canvas);
  overflow: hidden;
  box-shadow: 0 1px 2px rgba(0, 0, 0, .03);
}

.finder-col {
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--line-soft);
  background: #fff;
}

.finder-col:last-child {
  border-right: 0;
}

.finder-col-head {
  height: 44px;
  flex: 0 0 44px;
  padding: 0 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border-bottom: 1px solid var(--line-soft);
  background: var(--pearl);
  color: var(--muted);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.finder-col-head .text-button {
  font-size: 10px;
}

.finder-scroll {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 8px;
  overscroll-behavior: contain;
}

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

.finder-preview-body {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 16px;
}

.finder-mid {
  position: relative;
  background: var(--pearl);
}

.finder-mid .finder-list {
  background: transparent;
  outline: none;
  padding-bottom: 10px;
}

.finder-mid.has-bulk .finder-list {
  padding-bottom: 74px;
}

/* 左栏分类 */

.f-cat {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  height: 34px;
  padding: 0 8px 0 11px;
  border-radius: 9px;
  color: var(--ink-soft);
  font-size: 12px;
  cursor: pointer;
  user-select: none;
  transition: background-color 120ms ease, color 120ms ease;
}

.f-cat + .f-cat {
  margin-top: 2px;
}

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

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

.f-cat.active {
  background: var(--ink);
  color: #fff;
}

.f-cat-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.f-cat-count {
  margin-left: auto;
  padding-right: 4px;
  color: var(--muted-light);
  font-size: 10px;
  font-variant-numeric: tabular-nums;
}

.f-cat.active .f-cat-count {
  color: rgba(255, 255, 255, .72);
}

.f-cat-share {
  width: 22px;
  height: 22px;
  flex: 0 0 22px;
  margin-left: 2px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: inherit;
  display: grid;
  place-items: center;
  opacity: 0;
  cursor: pointer;
  transition: opacity 120ms ease, background-color 120ms ease;
}

.f-cat-share svg {
  width: 13px;
  height: 13px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
}

.f-cat:hover .f-cat-share,
.f-cat.active .f-cat-share,
.f-cat-share:focus-visible {
  opacity: .75;
}

.f-cat-share:hover {
  opacity: 1 !important;
  background: rgba(0, 0, 0, .08);
}

.f-cat.active .f-cat-share:hover {
  background: rgba(255, 255, 255, .16);
}

.v2-fallback-note {
  padding: 10px 8px;
  color: var(--muted-light);
  font-size: 10px;
  line-height: 1.5;
}

/* 中栏素材行 */

.f-row {
  display: flex;
  align-items: center;
  gap: 11px;
  height: 64px;
  padding: 0 10px;
  border: 1px solid transparent;
  border-radius: 12px;
  background: transparent;
  cursor: pointer;
  user-select: none;
  transition: background-color 120ms ease, border-color 120ms ease, box-shadow 140ms ease, transform 140ms ease;
}

.f-row + .f-row {
  margin-top: 2px;
}

.f-row:hover {
  background: #fff;
  border-color: var(--line-soft);
  box-shadow: 0 2px 8px rgba(0, 0, 0, .05);
  transform: translateY(-1px);
}

.f-row.is-selected {
  background: #eef1f6;
  border-color: #d8dde6;
}

.f-row.is-focused {
  box-shadow: inset 0 0 0 1px var(--ink);
}

.f-row.is-selected.is-focused {
  box-shadow: inset 0 0 0 1px var(--ink);
}

.f-row-main {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
  flex: 1;
}

.f-row-title {
  color: var(--ink);
  font-size: 12.5px;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

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

.v2-row-dot {
  width: 6px;
  height: 6px;
  flex: 0 0 6px;
  border-radius: 50%;
  background: var(--green);
}

/* 缩略图：白色正方形底 + contain + 绝不放大 */

.v2-thumb {
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  padding: 3px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: #fff;
  display: grid;
  place-items: center;
  overflow: hidden;
}

.v2-thumb img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  display: block;
}

.v2-thumb-fallback {
  display: none;
  color: var(--muted-light);
  font-size: 8px;
  font-weight: 700;
  letter-spacing: .03em;
}

.v2-thumb.is-missing .v2-thumb-fallback {
  display: block;
}

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

/* 多选浮动条 */

.f-bulkbar {
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: 10px;
  z-index: 3;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: 12px;
  background: rgba(29, 29, 31, .95);
  color: #fff;
  font-size: 11px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, .22);
  backdrop-filter: blur(10px);
}

.f-bulkbar > span {
  margin-right: auto;
  white-space: nowrap;
}

.f-bulkbar .button.primary {
  min-height: 32px;
  padding: 0 14px;
  border: 0;
  background: #fff;
  color: var(--ink);
  font-size: 11px;
}

.f-bulkbar .text-button {
  color: rgba(255, 255, 255, .72);
  font-size: 11px;
}

/* 右栏预览 */

.v2-preview-empty {
  height: 100%;
  min-height: 280px;
  display: grid;
  place-content: center;
  gap: 8px;
  text-align: center;
  color: var(--muted-light);
  font-size: 11px;
  line-height: 1.6;
  padding: 24px;
}

.v2-preview-empty strong {
  color: var(--ink-soft);
  font-size: 13px;
  font-weight: 600;
}

.v2-preview-empty-mark {
  width: 44px;
  height: 44px;
  margin: 0 auto 4px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--pearl);
  color: var(--muted-light);
  display: grid;
  place-items: center;
  font-size: 16px;
}

.v2-multi-note {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 12px;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--pearl);
  color: var(--muted);
  font-size: 10.5px;
}

.v2-multi-note strong {
  color: var(--ink);
  font-size: 11px;
}

.v2-multi-share {
  margin-left: auto;
  min-height: 30px !important;
  padding: 0 12px !important;
  font-size: 10.5px !important;
}

.v2-preview-media {
  width: 100%;
  aspect-ratio: 1 / 1;
  max-height: 320px;
  padding: 12px;
  border: 1px solid var(--line-soft);
  border-radius: 14px;
  background: #fff;
  display: grid;
  place-items: center;
  overflow: hidden;
}

.v2-preview-media img.v2-media,
.v2-preview-media video.v2-media {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  display: block;
  margin: 0 auto;
}

.v2-preview-head {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  flex-wrap: wrap;
  margin: 14px 0 10px;
}

.v2-preview-head h2 {
  font-size: 16px;
  line-height: 1.35;
  font-weight: 600;
  overflow-wrap: anywhere;
}

.v2-preview-meta {
  border-top: 1px solid var(--line-soft);
  padding-top: 4px;
}

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

.v2-meta-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 14px;
  padding: 7px 0;
  border-bottom: 1px solid var(--line-soft);
  font-size: 11px;
}

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

.v2-meta-row > span {
  color: var(--muted-light);
  flex: 0 0 auto;
}

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

.v2-preview-actions {
  display: flex;
  gap: 8px;
  margin-top: 16px;
  flex-wrap: wrap;
}

.v2-preview-actions .button {
  min-height: 36px;
  padding: 0 16px;
  font-size: 11px;
}

/* 媒体与文件占位 */

.v2-media {
  display: block;
  max-width: 100%;
}

.v2-media-fallback {
  display: none;
  color: var(--muted-light);
  font-size: 11px;
}

.is-missing .v2-media-fallback {
  display: block;
}

.v2-file-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: 100%;
  padding: 14px 18px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--pearl);
  color: var(--muted);
  font-size: 11px;
}

.v2-file-ext {
  padding: 4px 7px;
  border-radius: 6px;
  background: #fff;
  border: 1px solid var(--line);
  color: var(--ink);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .04em;
}

.v2-file-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.v2-audio {
  width: 100%;
  max-width: 420px;
}

/* ------------------------------ 列表态/空态 ----------------------------- */

.v2-list-state {
  min-height: 180px;
  font-size: 11px;
}

.v2-empty {
  padding: 28px 20px;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 9px;
  text-align: center;
  color: var(--muted-light);
  font-size: 11px;
  line-height: 1.6;
}

.v2-empty strong {
  color: var(--ink-soft);
  font-size: 13px;
  font-weight: 600;
}

.v2-empty .button {
  margin-top: 4px;
  min-height: 36px;
  padding: 0 16px;
  font-size: 11px;
}

.v2-error-state {
  min-height: 160px;
  padding: 26px 20px;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 10px;
  text-align: center;
  color: var(--muted);
}

.v2-error-state strong {
  color: var(--ink-soft);
  font-size: 13px;
}

/* -------------------------------- 上传页 -------------------------------- */

.v2-upload-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(0, .92fr);
  gap: 20px;
  align-items: start;
}

.v2-dropzone {
  display: grid;
  place-items: center;
  gap: 7px;
  padding: 34px 20px;
  border: 1px dashed #c8c8ce;
  border-radius: 14px;
  background: var(--pearl);
  color: var(--muted);
  text-align: center;
  cursor: pointer;
  transition: border-color 140ms ease, background-color 140ms ease;
}

.v2-dropzone:hover,
.v2-dropzone.is-drag {
  border-color: var(--ink);
  background: #f1f1f4;
}

.v2-drop-mark {
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  color: var(--ink-soft);
  display: grid;
  place-items: center;
  font-size: 18px;
  font-weight: 300;
}

.v2-dropzone strong {
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 500;
}

.v2-drop-help {
  color: var(--muted-light);
  font-size: 10px;
}

.v2-file-list {
  margin-top: 12px;
  display: grid;
  gap: 8px;
}

.v2-file-row {
  display: flex;
  align-items: center;
  gap: 11px;
  min-height: 52px;
  padding: 8px 11px;
  border: 1px solid var(--line-soft);
  border-radius: 11px;
  background: #fff;
}

.v2-file-row.is-done {
  border-color: #cfe6d5;
  background: #f6fbf7;
}

.v2-file-dot {
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: var(--pearl);
  color: var(--muted);
  display: grid;
  place-items: center;
  font-size: 8.5px;
  font-weight: 700;
  letter-spacing: .03em;
}

.v2-file-main {
  min-width: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.v2-file-title {
  font-size: 11.5px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.v2-file-sub {
  color: var(--muted-light);
  font-size: 10px;
}

.v2-file-row .text-button {
  font-size: 10.5px;
}

.v2-up-status {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--muted);
  font-size: 10.5px;
}

.v2-progress {
  margin-top: 18px;
  padding: 14px 18px;
  border: 1px solid var(--line-soft);
  border-radius: 14px;
  background: var(--pearl);
}

.v2-progress-bar {
  height: 5px;
  border-radius: 999px;
  background: #e4e4e8;
  overflow: hidden;
}

.v2-progress-bar > i {
  display: block;
  width: 0;
  height: 100%;
  border-radius: 999px;
  background: var(--ink);
  transition: width 200ms ease;
}

.v2-progress > span {
  display: block;
  margin-top: 9px;
  color: var(--muted);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

/* -------------------------------- 登录页 -------------------------------- */

.v2-login-wrap {
  width: min(420px, calc(100vw - 40px));
  padding: 40px 0;
}

.v2-login-card {
  display: grid;
  gap: 18px;
  padding: 34px 32px 26px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: #fff;
  box-shadow: 0 20px 60px rgba(0, 0, 0, .06);
}

.v2-login-brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.v2-login-brand img {
  width: 118px;
  height: auto;
}

.v2-login-brand span {
  padding-left: 14px;
  border-left: 1px solid #d2d2d7;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.5;
}

.v2-login-card h1 {
  font-size: 24px;
  letter-spacing: -.01em;
}

.v2-login-sub {
  margin-top: 6px;
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.5;
}

.v2-login-error {
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--red-soft);
  color: var(--red);
  font-size: 11px;
}

.v2-login-card .button.primary {
  width: 100%;
}

.v2-login-foot {
  color: var(--muted-light);
  font-size: 10px;
  line-height: 1.6;
}

.v2-login-version {
  display: block;
  margin-top: 6px;
  font-size: 9px;
  letter-spacing: .04em;
}

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

.v2-detail-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.32fr) minmax(340px, .88fr);
  gap: 20px;
  align-items: start;
}

.v2-detail-main,
.v2-detail-side {
  min-width: 0;
  display: grid;
  gap: 20px;
}

.v2-preview-panel {
  overflow: hidden;
}

.v2-preview-stage {
  min-height: 300px;
  padding: 20px;
  display: grid;
  place-items: center;
  background: #fff;
}

.v2-preview-stage > img.v2-media,
.v2-preview-stage > video.v2-media {
  max-width: 100%;
  max-height: min(56vh, 520px);
  width: auto;
  height: auto;
  object-fit: contain;
  margin: 0 auto;
}

.v2-preview-caption {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 11px 18px;
  border-top: 1px solid var(--line-soft);
  background: var(--pearl);
  color: var(--muted);
  font-size: 10.5px;
}

.v2-preview-caption > span:first-child {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* 折叠块 */

.v2-fold {
  margin-top: 14px;
  border-top: 1px solid var(--line-soft);
}

.v2-fold > summary {
  padding: 11px 2px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.v2-fold > summary::-webkit-details-marker {
  display: none;
}

.v2-fold > summary::after {
  content: "＋";
  color: var(--muted-light);
  font-size: 12px;
}

.v2-fold[open] > summary::after {
  content: "－";
}

.v2-fold .form-grid {
  margin-top: 6px;
  margin-bottom: 4px;
}

.v2-detail-side .form-actions {
  margin-top: 4px;
}

/* 版本 */

.v2-version-list {
  display: grid;
  gap: 2px;
  list-style: none;
}

.v2-version-row {
  display: flex;
  align-items: center;
  gap: 11px;
  min-height: 46px;
  padding: 6px 0;
  border-bottom: 1px solid var(--line-soft);
}

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

.v2-version-no {
  min-width: 30px;
  padding: 3px 6px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--pearl);
  color: var(--ink-soft);
  font-size: 9px;
  font-weight: 700;
  text-align: center;
}

.v2-version-main {
  min-width: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 11px;
}

.v2-version-main > span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.v2-version-main small {
  color: var(--muted-light);
  font-size: 9.5px;
}

.v2-version-empty {
  padding: 14px 0;
  color: var(--muted-light);
  font-size: 11px;
}

.v2-version-status {
  color: var(--muted);
  font-size: 10.5px;
}

.v2-version-status:not(:empty) {
  margin-bottom: 8px;
}

/* 分享卡 */

.v2-share-panel {
  scroll-margin-top: 80px;
}

.v2-share-panel.is-focused {
  box-shadow: 0 0 0 2px var(--ink);
}

.v2-switch {
  position: relative;
  width: 44px;
  height: 26px;
  flex: 0 0 44px;
  display: inline-block;
}

.v2-switch input {
  position: absolute;
  inset: 0;
  z-index: 2;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}

.v2-switch i {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  background: #d6d6db;
  transition: background-color 160ms ease;
}

.v2-switch i::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .22);
  transition: transform 160ms ease;
}

.v2-switch input:checked + i {
  background: var(--ink);
}

.v2-switch input:checked + i::after {
  transform: translateX(18px);
}

.v2-switch input:focus-visible + i {
  box-shadow: 0 0 0 3px rgba(0, 0, 0, .12);
}

.v2-share-off {
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.65;
}

.v2-share-off-hint {
  margin-top: 6px;
  color: var(--muted-light);
  font-size: 10.5px;
  line-height: 1.6;
}

.v2-qr-wrap {
  display: flex;
  align-items: flex-start;
  gap: 18px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--pearl);
}

.v2-qr-box {
  width: 176px;
  flex: 0 0 176px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  display: grid;
  place-items: center;
}

.v2-qr-box canvas {
  width: 156px;
  height: 156px;
  display: block;
}

.v2-qr-info {
  min-width: 0;
  flex: 1;
  display: grid;
  gap: 9px;
  align-content: start;
}

.v2-qr-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.v2-link-box {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 8px 5px 10px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
}

.v2-link-box input {
  min-width: 0;
  flex: 1;
  height: 28px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ink-soft);
  font-size: 10.5px;
  outline: none;
}

.v2-link-box .text-button {
  font-size: 10.5px;
  white-space: nowrap;
}

.v2-share-stats {
  color: var(--muted-light);
  font-size: 10.5px;
  font-variant-numeric: tabular-nums;
}

.v2-share-settings {
  margin-top: 16px;
  display: grid;
  gap: 12px;
}

.v2-checkline {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--ink-soft);
  font-size: 11.5px;
  cursor: pointer;
}

.v2-checkline input {
  width: 15px;
  height: 15px;
  accent-color: var(--ink);
}

.v2-share-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.v2-share-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.v2-share-actions .button {
  min-height: 36px;
  padding: 0 16px;
  font-size: 11px;
}

/* ------------------------------- 分类管理 ------------------------------- */

.v2-cat-panel {
  margin-top: 20px;
}

.v2-cat-form {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.v2-cat-form .field {
  flex: 1 1 260px;
}

.v2-cat-form .button {
  min-height: 44px;
}

.v2-cat-row {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 54px;
  padding: 8px 2px;
  border-bottom: 1px solid var(--line-soft);
}

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

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

.v2-cat-count {
  color: var(--muted-light);
  font-size: 10.5px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.v2-cat-ops {
  display: flex;
  align-items: center;
  gap: 12px;
}

.v2-cat-ops .text-button {
  font-size: 10.5px;
}

.v2-cat-row.is-editing {
  gap: 10px;
}

.v2-cat-row.is-editing input {
  flex: 1;
  min-width: 0;
  height: 38px;
}

.v2-cat-row.is-editing .button {
  min-height: 38px;
  padding: 0 14px;
  font-size: 11px;
}

/* ------------------------------- 分享管理 ------------------------------- */

.v2-share-section + .v2-share-section {
  margin-top: 20px;
}

.v2-share-row {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto;
  align-items: center;
  gap: 13px;
  padding: 12px;
  border: 1px solid var(--line-soft);
  border-radius: 13px;
  background: #fff;
}

.v2-share-row + .v2-share-row {
  margin-top: 9px;
}

.v2-share-kind-mark {
  width: 44px;
  height: 44px;
  border: 1px solid var(--line-soft);
  border-radius: 9px;
  background: var(--pearl);
  color: var(--muted);
  display: grid;
  place-items: center;
  font-size: 9px;
  font-weight: 600;
}

.v2-share-main {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.v2-share-title {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  font-size: 12px;
  font-weight: 500;
}

.v2-share-title > span:first-child {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.v2-share-url {
  color: var(--muted-light);
  font-size: 10px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.v2-share-meta {
  color: var(--muted-light);
  font-size: 10px;
}

.v2-share-ops {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.v2-share-ops .text-button {
  font-size: 10.5px;
}

/* -------------------------------- 设置页 -------------------------------- */

.v2-settings-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
  align-items: start;
}

.v2-user-row {
  display: flex;
  align-items: center;
  gap: 14px;
}

.v2-avatar {
  width: 48px;
  height: 48px;
  flex: 0 0 48px;
  border-radius: 50%;
  background: var(--ink);
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 17px;
  font-weight: 600;
}

.v2-user-main {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.v2-user-main strong {
  font-size: 13px;
  font-weight: 600;
}

.v2-user-main small {
  color: var(--muted);
  font-size: 10.5px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.v2-settings-actions {
  margin-top: 18px;
  display: flex;
  gap: 10px;
}

.v2-quick-links {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
}

.v2-quick-links .button {
  min-height: 38px;
  padding: 0 16px;
  font-size: 11px;
}

.v2-system-fold {
  margin-top: 20px;
}

.v2-system-fold > summary {
  padding: 18px 24px;
  font-size: 12px;
  font-weight: 600;
}

.v2-system-fold > summary::after {
  font-size: 13px;
}

.v2-system-fold .panel-body {
  border-top: 1px solid var(--line-soft);
}

.v2-result-list {
  display: grid;
  gap: 7px;
  margin: 0;
  padding: 0;
  list-style: none;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.6;
  text-align: left;
}

/* -------------------------------- 公开页 -------------------------------- */

.v2-public {
  width: min(1080px, 100%);
  margin: 0 auto;
  padding: 0 20px 72px;
}

.v2-public-head {
  height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  border-bottom: 1px solid var(--line-soft);
  margin-bottom: 34px;
}

.v2-public-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.v2-public-brand img {
  width: 104px;
  height: auto;
}

.v2-public-brand > span {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding-left: 12px;
  border-left: 1px solid #d2d2d7;
  min-width: 0;
}

.v2-public-brand strong {
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}

.v2-public-brand small {
  color: var(--muted-light);
  font-size: 9px;
  white-space: nowrap;
}

.v2-public-main {
  min-height: 340px;
}

.v2-public-message {
  max-width: 460px;
  margin: 60px auto;
  padding: 36px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: #fff;
  text-align: center;
}

.v2-public-message h1 {
  font-size: 22px;
  margin-bottom: 10px;
}

.v2-public-message p {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}

.v2-pub-pw-form {
  display: flex;
  gap: 8px;
  margin-top: 20px;
}

.v2-pub-pw-form input {
  flex: 1;
  height: 42px;
}

.v2-pub-pw-form .button {
  min-height: 42px;
}

.v2-public-detail {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(280px, .65fr);
  gap: 30px;
  align-items: start;
}

.v2-public-stage {
  min-height: 320px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #fff;
  display: grid;
  place-items: center;
}

.v2-public-stage > img.v2-media,
.v2-public-stage > video.v2-media {
  max-width: 100%;
  max-height: min(62vh, 620px);
  width: auto;
  height: auto;
  object-fit: contain;
  margin: 0 auto;
}

.v2-public-side h1 {
  font-size: 24px;
  line-height: 1.25;
  letter-spacing: -.01em;
  overflow-wrap: anywhere;
}

.v2-public-side .v2-preview-meta {
  margin-top: 16px;
}

.v2-public-actions {
  margin-top: 20px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.v2-public-foot-note {
  margin-top: 26px;
  color: var(--muted-light);
  font-size: 10px;
}

.v2-public-collection {
  padding-top: 6px;
}

.v2-coll-head {
  margin-bottom: 24px;
}

.v2-coll-head h1 {
  font-size: 28px;
  letter-spacing: -.01em;
  overflow-wrap: anywhere;
}

.v2-coll-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
}

.v2-coll-card {
  position: relative;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  overflow: hidden;
  cursor: pointer;
  transition: transform 150ms ease, box-shadow 150ms ease, border-color 150ms ease;
}

.v2-coll-card:hover {
  transform: translateY(-2px);
  border-color: #d2d2d7;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .07);
}

.v2-coll-thumb {
  aspect-ratio: 1 / 1;
  padding: 12px;
  background: #fff;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-bottom: 1px solid var(--line-soft);
}

.v2-coll-thumb img.v2-coll-media,
.v2-coll-thumb video.v2-coll-media {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  display: block;
}

.v2-coll-body {
  display: grid;
  gap: 3px;
  padding: 11px 13px 14px;
}

.v2-coll-title {
  font-size: 11.5px;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.v2-coll-sub {
  color: var(--muted-light);
  font-size: 9.5px;
}

.v2-coll-download {
  position: absolute;
  top: 10px;
  right: 10px;
  padding: 4px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, .94);
  color: var(--ink);
  font-size: 9.5px;
  text-decoration: none;
  opacity: 0;
  transition: opacity 140ms ease;
}

.v2-coll-card:hover .v2-coll-download {
  opacity: 1;
}

/* -------------------------------- 弹窗 --------------------------------- */

.dam-body .modal.v2-modal-qr {
  width: min(500px, 100%);
}

.dam-body .modal.v2-modal-lightbox {
  width: min(920px, 100%);
}

.v2-qr-modal {
  display: grid;
  justify-items: center;
  gap: 14px;
  text-align: center;
}

.v2-qr-modal .v2-qr-box {
  width: 196px;
  flex: 0 0 196px;
  padding: 10px;
}

.v2-qr-modal .v2-qr-box canvas {
  width: 176px;
  height: 176px;
}

.v2-qr-modal .v2-link-box {
  width: 100%;
}

.v2-result-title {
  font-size: 17px;
  font-weight: 600;
  overflow-wrap: anywhere;
}

.v2-result-list {
  width: 100%;
}

.v2-share-form {
  display: grid;
  gap: 14px;
}

.v2-share-form-lead {
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.6;
}

.v2-confirm-text {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.7;
}

.v2-lightbox {
  display: grid;
  gap: 14px;
}

.v2-lightbox-media {
  max-width: 100%;
  max-height: 62vh;
  width: auto;
  height: auto;
  object-fit: contain;
  display: block;
  margin: 0 auto;
}

.v2-lightbox-foot {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 11px;
}

.v2-lightbox-foot strong {
  color: var(--ink);
  font-size: 12px;
  font-weight: 500;
}

.v2-lightbox-foot .button {
  margin-left: auto;
  min-height: 36px;
  padding: 0 16px;
  font-size: 11px;
}

/* ------------------------------- 响应式 -------------------------------- */

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

  .finder {
    grid-template-columns: 214px minmax(300px, 360px) minmax(0, 1fr);
  }

  .v2-detail-grid {
    grid-template-columns: minmax(0, 1.2fr) minmax(310px, .8fr);
  }
}

@media (max-width: 1000px) {
  .v2-upload-grid,
  .v2-detail-grid,
  .v2-settings-grid,
  .v2-public-detail {
    grid-template-columns: minmax(0, 1fr);
  }

  .v2-qr-wrap {
    flex-direction: column;
    align-items: stretch;
  }

  .v2-qr-box {
    align-self: center;
  }

  .v2-share-row {
    grid-template-columns: 44px minmax(0, 1fr);
  }

  .v2-share-ops {
    grid-column: 1 / -1;
    justify-content: flex-start;
  }
}

@media (max-width: 860px) {
  .v2-page-head {
    flex-direction: column;
    align-items: flex-start;
    gap: 14px;
  }

  .v2-page-head h1 {
    font-size: 25px;
  }

  .finder {
    grid-template-columns: minmax(0, 1fr);
    height: auto;
    max-height: none;
  }

  .finder-side {
    border-right: 0;
    border-bottom: 1px solid var(--line-soft);
    max-height: 172px;
  }

  .finder-mid {
    border-right: 0;
    border-bottom: 1px solid var(--line-soft);
    max-height: 58vh;
    min-height: 300px;
  }

  .finder-preview-body {
    max-height: none;
  }

  .v2-share-fields {
    grid-template-columns: minmax(0, 1fr);
  }

  .v2-statline {
    gap: 16px 22px;
  }

  .v2-coll-grid {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 10px;
  }

  .v2-public {
    padding: 0 14px 60px;
  }

  .v2-public-brand img {
    width: 82px;
  }

  .v2-login-card {
    padding: 26px 22px 22px;
  }
}

@media (max-width: 640px) {
  .v2-filters {
    gap: 8px;
  }

  .v2-search {
    flex-basis: 100%;
  }

  .dam-body select.v2-filter {
    flex: 1 1 0;
    min-width: 0;
  }

  .v2-cat-row {
    flex-wrap: wrap;
    gap: 6px 12px;
  }

  .v2-cat-ops {
    width: 100%;
    justify-content: flex-end;
  }

  .v2-f-bulkbar,
  .f-bulkbar {
    left: 8px;
    right: 8px;
  }

  .v2-share-row {
    padding: 10px;
  }
}
