/**
 * V4 中栏次级视图样式（panels-ui）
 * 颜色/字体/圆角/阴影全部来自 tokens.css 的 DSH token；这里只做 --v4v-* 局部映射。
 */

.v4v {
  --v4v-text: var(--dsw-alias-label-primary, var(--dsw-static-neutral-bluish-1000));
  --v4v-secondary: var(--dsw-alias-label-secondary, var(--dsw-static-neutral-bluish-700));
  --v4v-tertiary: var(--dsw-alias-label-tertiary, var(--dsw-static-neutral-bluish-600));
  --v4v-caption: var(--dsw-alias-label-caption, var(--dsw-static-neutral-bluish-400));
  --v4v-dimmed: var(--dsw-static-neutral-bluish-500);
  --v4v-page-bg: var(--dsw-alias-bg-base, var(--dsw-static-neutral-bluish-00));
  --v4v-card-bg: var(--dsw-alias-bg-layer-1, var(--dsw-static-neutral-bluish-00));
  --v4v-soft: var(--dsw-static-neutral-bluish-50, var(--dsw-static-neutral-bluish-60));
  --v4v-chip-bg: var(--dsw-static-neutral-bluish-100);
  --v4v-hover: var(--dsw-static-neutral-bluish-60);
  --v4v-selected: var(--dsw-static-neutral-bluish-75);
  --v4v-module: var(--dsw-static-neutral-bluish-200);
  --v4v-border-l1: var(--dsw-alias-border-l1);
  --v4v-border-l2: var(--dsw-alias-border-l2);
  --v4v-border-l3: var(--dsw-alias-border-l3);
  --v4v-accent: var(--dsw-alias-state-business-primary, var(--dsw-static-deepseek-500));
  --v4v-success: var(--dsw-alias-state-success-primary, var(--dsw-static-green-500));
  --v4v-success-text: var(--dsw-static-green-600, var(--v4v-success));
  --v4v-warn: var(--dsw-alias-state-warn-primary, var(--dsw-static-amber-500));
  --v4v-warn-text: var(--dsw-alias-state-warn-label, var(--dsw-static-amber-600, var(--v4v-warn)));
  --v4v-error: var(--dsw-alias-state-error-primary, var(--dsw-static-red-600));
  --v4v-on-dark: var(--dsw-alias-label-primary-foreground, var(--dsw-static-neutral-bluish-00));
  --v4v-primary-fill: var(--dsw-alias-button-primary-fill, var(--dsw-static-neutral-bluish-1000));
  --v4v-primary-hover: var(--dsw-alias-button-primary-hover, var(--dsw-static-neutral-bluish-750));
  --v4v-radius: var(--dsw-radius-md, 12px);
  --v4v-shadow: var(--dsw-shadow-lv1);
  --v4v-shadow-lv2: var(--dsw-shadow-lv2);
  --v4v-shadow-lv3: var(--dsw-shadow-lv3);
  --v4v-mono: var(--ds-font-family-code, var(--dsw-font-family, ui-monospace, "SF Mono", Consolas, monospace));

  position: relative;
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
  background: var(--v4v-page-bg);
  color: var(--v4v-text);
  font-family: var(--ds-font-family-text, var(--dsw-font-family, sans-serif));
  font-size: 13px;
  line-height: 20px;
  -webkit-font-smoothing: antialiased;
}

.v4v *,
.v4v *::before,
.v4v *::after { box-sizing: border-box; }

/* ---------------------------------------------------------------- 头部 */

.v4v-head {
  flex: 0 0 auto;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  min-height: 48px;
  padding: 9px 24px 8px;
  border-bottom: 1px solid var(--v4v-border-l1);
}

.v4v-head-main { min-width: 0; }

.v4v-head-line { display: flex; align-items: baseline; gap: 8px; min-width: 0; }
.v4v-title { margin: 0; font-size: 16px; line-height: 24px; font-weight: 500; color: var(--v4v-text); white-space: nowrap; }
.v4v-head-meta { font-size: 12px; line-height: 18px; color: var(--v4v-caption); white-space: nowrap; }
.v4v-head-count { font-family: var(--v4v-mono); font-size: 11px; color: var(--v4v-tertiary); }
.v4v-head-sub { margin-top: 1px; font-size: 11px; line-height: 16px; color: var(--v4v-caption); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.v4v-head-side { flex: 0 0 auto; display: flex; align-items: center; gap: 8px; }

.v4v-back {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  margin-left: -6px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--v4v-secondary);
  font: inherit;
  font-size: 15px;
  line-height: 24px;
  cursor: pointer;
}

.v4v-back:hover { background: var(--v4v-hover); color: var(--v4v-text); }

/* ---------------------------------------------------------------- 主体 */

.v4v-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 20px 24px 32px;
  scrollbar-width: thin;
  scrollbar-color: var(--v4v-module) transparent;
}

.v4v-body::-webkit-scrollbar { width: 5px; height: 5px; }
.v4v-body::-webkit-scrollbar-thumb { background: var(--v4v-module); border-radius: 3px; }
.v4v-body::-webkit-scrollbar-track { background: transparent; }

.v4v-inner {
  width: 100%;
  max-width: 760px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* ---------------------------------------------------------------- 通用 */

.v4v-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 14px;
  border: 1px solid var(--v4v-border-l2);
  border-radius: var(--v4v-radius);
  background: var(--v4v-card-bg);
  box-shadow: var(--v4v-shadow);
}

.v4v-section-t {
  font-size: 12px;
  line-height: 18px;
  font-weight: 500;
  color: var(--v4v-secondary);
}

.v4v-mono { font-family: var(--v4v-mono); }
.v4v-dim { color: var(--v4v-caption); font-size: 11px; line-height: 16px; }
.v4v-cap { font-size: 11px; line-height: 16px; color: var(--v4v-caption); }

.v4v-chip {
  display: inline-flex;
  align-items: center;
  height: 20px;
  padding: 0 6px;
  border-radius: 4px;
  background: var(--v4v-chip-bg);
  color: var(--v4v-secondary);
  font-size: 11px;
  line-height: 20px;
  white-space: nowrap;
}

.v4v-chip--xs { height: 18px; font-size: 10px; padding: 0 5px; }

.v4v-badge {
  display: inline-flex;
  align-items: center;
  height: 18px;
  padding: 0 6px;
  border-radius: 4px;
  background: var(--v4v-chip-bg);
  color: var(--v4v-secondary);
  font-size: 10px;
  line-height: 18px;
  font-weight: 500;
  white-space: nowrap;
}

.v4v-badge.is-ok { color: var(--v4v-success-text); background: color-mix(in srgb, var(--v4v-success) 12%, transparent); }
.v4v-badge.is-warn { color: var(--v4v-warn-text); background: color-mix(in srgb, var(--v4v-warn) 14%, transparent); }
.v4v-badge.is-info { color: var(--v4v-accent); background: color-mix(in srgb, var(--v4v-accent) 10%, transparent); }
.v4v-badge.is-draft,
.v4v-badge.is-muted { color: var(--v4v-tertiary); background: var(--v4v-chip-bg); }

.v4v-ico { width: 18px; height: 18px; flex: 0 0 auto; }

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

.v4v-filters { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 2px; }

.v4v-filter {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 28px;
  padding: 0 10px;
  border: 1px solid var(--v4v-border-l3);
  border-radius: 8px;
  background: var(--v4v-card-bg);
  color: var(--v4v-secondary);
  font: inherit;
  font-size: 12px;
  line-height: 18px;
  cursor: pointer;
}

.v4v-filter:hover { background: var(--v4v-hover); }
.v4v-filter.is-on { border-color: transparent; background: var(--v4v-primary-fill); color: var(--v4v-on-dark); }
.v4v-filter-n { font-family: var(--v4v-mono); font-size: 10px; opacity: 0.75; }

/* ---------------------------------------------------------------- 列表行 */

.v4v-list { display: flex; flex-direction: column; gap: 8px; }
.v4v-list--memories { gap: 10px; }

.v4v-row {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 12px;
  border: 1px solid var(--v4v-border-l2);
  border-radius: var(--v4v-radius);
  background: var(--v4v-card-bg);
  box-shadow: var(--v4v-shadow);
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.v4v-row:hover { background: var(--v4v-soft); border-color: var(--v4v-border-l3); }
.v4v-row--static { cursor: default; }
.v4v-row--static:hover { background: var(--v4v-card-bg); border-color: var(--v4v-border-l2); }

.v4v-row-main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.v4v-row-top { display: flex; align-items: center; gap: 8px; min-width: 0; }
.v4v-row-id {
  font-size: 13px;
  line-height: 20px;
  font-weight: 500;
  color: var(--v4v-text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.v4v-row-sub {
  font-size: 12px;
  line-height: 18px;
  color: var(--v4v-secondary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
/* 产出清单的关键信息概要：一行，放不下省略，悬停看全文 */
.v4v-row-insight {
  font-size: 12px;
  line-height: 18px;
  color: var(--v4v-secondary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
/* 概要下面那行（房间 / 槽位 / kind / 日期）退成三级字，让概要更像「内容」 */
.v4v-row--art .v4v-row-sub {
  font-size: 11px;
  line-height: 16px;
  color: var(--v4v-caption);
}
.v4v-row-note {
  font-size: 11px;
  line-height: 16px;
  color: var(--v4v-caption);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.v4v-row-side { flex: 0 0 auto; display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.v4v-row-time { font-size: 11px; line-height: 16px; color: var(--v4v-caption); }
.v4v-row-arrow { font-size: 16px; line-height: 16px; color: var(--v4v-caption); }

/* 产出清单行 */

.v4v-group { display: flex; flex-direction: column; gap: 6px; }
.v4v-group + .v4v-group { margin-top: 10px; }
.v4v-group-h {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  font-size: 11px;
  line-height: 16px;
  font-weight: 500;
  color: var(--v4v-tertiary);
}
.v4v-group-n { font-family: var(--v4v-mono); font-size: 10px; color: var(--v4v-caption); font-weight: 400; }

.v4v-row--art { align-items: flex-start; padding: 8px; }
.v4v-art-thumb {
  flex: 0 0 auto;
  width: 44px;
  height: 56px;
  padding: 0;
  border: 0;
  border-radius: 6px;
  overflow: hidden;
  background: var(--v4v-soft);
  cursor: zoom-in;
}
.v4v-art-thumb img { display: block; width: 100%; height: 100%; object-fit: cover; }
.v4v-art-thumb.is-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px dashed var(--v4v-border-l3);
  color: var(--v4v-caption);
  cursor: default;
}

/* ---------------------------------------------------------------- 委托详情 */

.v4v-detail-top { display: flex; align-items: baseline; flex-wrap: wrap; gap: 8px; }
.v4v-detail-id { font-size: 15px; line-height: 22px; font-weight: 500; color: var(--v4v-text); }
.v4v-detail-top .v4v-dim { margin-left: auto; }

.v4v-kvs { display: flex; flex-direction: column; gap: 6px; }
.v4v-kv { display: flex; gap: 10px; align-items: flex-start; font-size: 12px; line-height: 18px; }
.v4v-kv .v4v-k { flex: 0 0 64px; font-size: 11px; line-height: 18px; color: var(--v4v-caption); }
.v4v-kv .v4v-v { flex: 1 1 auto; min-width: 0; color: var(--v4v-text); word-break: break-word; }

.v4v-snap {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(92px, 1fr));
  gap: 6px;
}

.v4v-snap-item {
  display: flex;
  flex-direction: column;
  gap: 1px;
  padding: 8px;
  border: 1px solid var(--v4v-border-l1);
  border-radius: 8px;
  background: var(--v4v-soft);
}

.v4v-snap-k { font-size: 10px; line-height: 14px; color: var(--v4v-caption); }
.v4v-snap-v { font-family: var(--v4v-mono); font-size: 14px; line-height: 20px; font-weight: 500; color: var(--v4v-text); }
.v4v-snap-v small { margin-left: 2px; font-size: 10px; font-weight: 400; color: var(--v4v-caption); }

.v4v-text { font-size: 12px; line-height: 19px; color: var(--v4v-secondary); word-break: break-word; }
.v4v-text p { margin: 0 0 4px; }
.v4v-text p:last-child { margin-bottom: 0; }

.v4v-clamp {
  font-size: 12px;
  line-height: 19px;
  color: var(--v4v-secondary);
  cursor: pointer;
  word-break: break-word;
}
.v4v-clamp:not(.is-expanded) { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.v4v-clamp:hover { color: var(--v4v-text); }
.v4v-clamp p { margin: 0 0 4px; }
.v4v-clamp p:last-child { margin-bottom: 0; }

/* 状态机 */

.v4v-statebar { display: flex; align-items: center; padding: 4px 0 6px; }
.v4v-state { display: inline-flex; align-items: center; gap: 6px; flex: 0 0 auto; }
.v4v-state-line { flex: 1 1 auto; height: 1px; min-width: 16px; margin: 0 10px; background: var(--v4v-border-l3); }
.v4v-state-line.is-on { background: var(--v4v-accent); }
.v4v-state-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--v4v-module); }
.v4v-state-dot.is-warn { background: var(--v4v-warn); }
.v4v-state-dot.is-info { background: var(--v4v-accent); }
.v4v-state-dot.is-ok { background: var(--v4v-success); }
.v4v-state-dot.is-muted { background: var(--v4v-dimmed); }
.v4v-state-dot.is-idle { background: var(--v4v-module); }
.v4v-state-label { font-size: 11px; line-height: 16px; color: var(--v4v-caption); }
.v4v-state-label.is-on { color: var(--v4v-text); font-weight: 500; }

.v4v-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.v4v-actions-links { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 4px; }

.v4v-link {
  display: inline-flex;
  align-items: center;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--v4v-accent);
  font: inherit;
  font-size: 12px;
  line-height: 18px;
  cursor: pointer;
}

.v4v-link:hover { text-decoration: underline; }

/* ---------------------------------------------------------------- 衣识 */

.v4v-memory { gap: 8px; }
.v4v-memory-top { display: flex; align-items: flex-start; gap: 12px; }

.v4v-memory-thumb {
  flex: 0 0 auto;
  width: 56px;
  height: 74px;
  padding: 0;
  border: 0;
  border-radius: 8px;
  overflow: hidden;
  background: var(--v4v-soft);
  cursor: zoom-in;
}

.v4v-memory-thumb img { display: block; width: 100%; height: 100%; object-fit: cover; }
.v4v-memory-thumb.is-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px dashed var(--v4v-border-l3);
  color: var(--v4v-caption);
  cursor: default;
}

.v4v-memory-main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.v4v-memory-t { font-size: 13px; line-height: 20px; font-weight: 500; color: var(--v4v-text); }
.v4v-memory-src { font-size: 12px; line-height: 18px; color: var(--v4v-secondary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.v4v-memory-time { font-size: 11px; line-height: 16px; color: var(--v4v-caption); }
.v4v-memory-text {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  font-size: 12px;
  line-height: 18px;
  color: var(--v4v-secondary);
}

.v4v-more { border-top: 1px solid var(--v4v-border-l1); padding-top: 6px; }
.v4v-more > summary { cursor: pointer; list-style: none; font-size: 11px; line-height: 16px; color: var(--v4v-tertiary); }
.v4v-more > summary::-webkit-details-marker { display: none; }
.v4v-more > summary::before { content: "▸ "; color: var(--v4v-caption); }
.v4v-more[open] > summary::before { content: "▾ "; }
.v4v-more .v4v-kvs { margin-top: 8px; }
.v4v-more .v4v-text { margin-top: 8px; font-size: 11px; line-height: 18px; }

/* ---- 衣识 P1：记一条 / 待确认 / 已生效 / 已忽略与已归档 ---- */

.v4v [hidden] { display: none !important; }

.v4v-memsec { display: flex; flex-direction: column; gap: 8px; }

.v4v-memsec-h {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 12px;
  line-height: 18px;
  font-weight: 500;
  color: var(--v4v-secondary);
}

.v4v-memsec-s { font-size: 11px; line-height: 16px; font-weight: 400; color: var(--v4v-caption); }

.v4v-mem { gap: 6px; }

.v4v-mem-rule { font-size: 13px; line-height: 21px; color: var(--v4v-text); word-break: break-word; }
.v4v-mem-tags { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; }
.v4v-mem-meta { font-size: 11px; line-height: 17px; color: var(--v4v-caption); word-break: break-word; }
.v4v-mem-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 2px; }

.v4v-mem--fold {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 10px 0;
  border-top: 1px solid var(--v4v-border-l1);
}

.v4v-mem--fold:first-child { padding-top: 4px; border-top: 0; }

.v4v-memform { gap: 9px; }

.v4v-input {
  width: 100%;
  min-width: 0;
  height: 32px;
  padding: 0 9px;
  border: 1px solid var(--v4v-border-l3);
  border-radius: 8px;
  background: var(--v4v-card-bg);
  color: var(--v4v-text);
  font: inherit;
  font-size: 12px;
  line-height: 19px;
}

.v4v-input:focus { border-color: var(--v4v-accent); }
.v4v-input::placeholder { color: var(--v4v-caption); }

.v4v-memform-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }

.v4v-field { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.v4v-field-k { font-size: 11px; line-height: 16px; color: var(--v4v-caption); }

.v4v-select {
  width: 100%;
  min-width: 0;
  height: 30px;
  padding: 0 6px;
  border: 1px solid var(--v4v-border-l3);
  border-radius: 7px;
  background: var(--v4v-card-bg);
  color: var(--v4v-text);
  font: inherit;
  font-size: 12px;
  line-height: 18px;
}

.v4v-select:focus { border-color: var(--v4v-accent); }

.v4v-check {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  line-height: 16px;
  color: var(--v4v-secondary);
  cursor: pointer;
}

.v4v-check input { margin: 0; accent-color: var(--v4v-accent); }

.v4v-memfold { padding: 0 14px; gap: 0; }

.v4v-memfold-h {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 8px;
  padding: 11px 0;
  font-size: 12px;
  line-height: 18px;
  font-weight: 500;
  color: var(--v4v-secondary);
  cursor: pointer;
  list-style: none;
}

.v4v-memfold-h::-webkit-details-marker { display: none; }
.v4v-memfold-h::before { content: "▸"; color: var(--v4v-caption); }
.v4v-memfold[open] > .v4v-memfold-h::before { content: "▾"; }
.v4v-memfold-hint { margin-left: auto; font-size: 11px; line-height: 16px; font-weight: 400; color: var(--v4v-caption); }
.v4v-list--fold { gap: 0; padding-bottom: 6px; }

/* ---- 衣识 P2：知识库（分类 / 文档 / 上传 / 搜索 / 详情） ---- */

.v4v-tabs {
  display: flex;
  gap: 4px;
  padding: 3px;
  border: 1px solid var(--v4v-border-l2);
  border-radius: 9px;
  background: var(--v4v-soft);
  align-self: flex-start;
}

.v4v-tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 28px;
  padding: 0 12px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--v4v-secondary);
  font: inherit;
  font-size: 12px;
  line-height: 18px;
  cursor: pointer;
}

.v4v-tab:hover { color: var(--v4v-text); }
.v4v-tab.is-on { background: var(--v4v-card-bg); color: var(--v4v-text); font-weight: 500; box-shadow: var(--v4v-shadow); }
.v4v-tab-n { font-family: var(--v4v-mono); font-size: 10px; color: var(--v4v-caption); }

.v4v-docbar { gap: 10px; }
.v4v-docsearch { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.v4v-docsearch .v4v-input { flex: 1 1 180px; width: auto; min-width: 0; }
.v4v-docsearch .v4v-select { flex: 0 1 130px; width: auto; min-width: 0; }
.v4v-docsearch .v4v-cap { margin-left: auto; white-space: nowrap; }

.v4v-docrow { align-items: center; }
.v4v-doc-ico {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: var(--v4v-soft);
  color: var(--v4v-tertiary);
}
.v4v-doc-ico .v4v-ico { width: 18px; height: 18px; }
.v4v-doc-excerpt { white-space: normal; display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; }
.v4v-doc-side { flex: 0 0 auto; display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }

.v4v-docform { gap: 9px; }
.v4v-filepick { display: flex; align-items: center; gap: 8px; min-width: 0; cursor: pointer; }
.v4v-filepick input[type="file"] { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.v4v-filepick .v4v-btn { flex: 0 0 auto; }
.v4v-filepick-name { font-size: 12px; color: var(--v4v-secondary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.v4v-docdetail { gap: 8px; }
.v4v-doc-content {
  max-height: 360px;
  overflow: auto;
  padding: 10px;
  border: 1px solid var(--v4v-border-l1);
  border-radius: 8px;
  background: var(--v4v-soft);
  font-size: 12px;
  line-height: 19px;
  color: var(--v4v-secondary);
  white-space: pre-wrap;
  word-break: break-word;
  scrollbar-width: thin;
}
.v4v-docimg {
  align-self: flex-start;
  max-width: 100%;
  padding: 0;
  border: 0;
  border-radius: 8px;
  overflow: hidden;
  background: var(--v4v-soft);
  cursor: zoom-in;
}
.v4v-docimg img { display: block; max-width: 100%; max-height: 320px; object-fit: contain; }
.v4v-docedit { display: flex; flex-direction: column; gap: 8px; padding-top: 8px; border-top: 1px solid var(--v4v-border-l1); }

.v4v-catform {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px;
  border: 1px dashed var(--v4v-border-l3);
  border-radius: 8px;
}
.v4v-list--cats { gap: 0; }
.v4v-catrow { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; padding: 8px 0; border-bottom: 1px solid var(--v4v-border-l1); }
.v4v-catrow:last-child { border-bottom: 0; }
.v4v-cat-name { font-size: 13px; line-height: 20px; color: var(--v4v-text); }
.v4v-cat-meta { font-size: 11px; line-height: 16px; color: var(--v4v-caption); }
.v4v-cat-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-left: auto; }
.v4v-cat-input { flex: 1 1 140px; width: auto; }
.v4v-filter.is-dim { opacity: 0.55; }

/* ---------------------------------------------------------------- 事件流 */

.v4v-events { display: flex; flex-direction: column; }
.v4v-events-more {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--v4v-border-l1);
}
.v4v-events-count { margin-left: auto; font-size: 11px; line-height: 16px; color: var(--v4v-caption); }
.v4v-event { padding: 7px 0; border-bottom: 1px solid var(--v4v-border-l1); }
.v4v-event:last-child { border-bottom: 0; }
.v4v-event-top { display: flex; align-items: baseline; flex-wrap: wrap; gap: 8px; }
.v4v-event-time { font-size: 11px; line-height: 16px; color: var(--v4v-caption); flex: 0 0 auto; }
.v4v-event-actor { font-size: 11px; line-height: 16px; color: var(--v4v-tertiary); flex: 0 0 auto; }
.v4v-event-action { font-size: 12px; line-height: 18px; color: var(--v4v-text); }
.v4v-event-note { margin-top: 1px; font-size: 11px; line-height: 17px; color: var(--v4v-caption); word-break: break-word; }

/* ---------------------------------------------------------------- 空态 / 错误 / 骨架 */

.v4v-empty { padding: 64px 20px; text-align: center; }
.v4v-empty-icon { display: flex; align-items: center; justify-content: center; width: 32px; height: 32px; margin: 0 auto 10px; color: var(--v4v-caption); }
.v4v-empty-icon .v4v-ico { width: 32px; height: 32px; }
.v4v-empty-t { font-size: 14px; line-height: 22px; color: var(--v4v-secondary); }
.v4v-empty-s { margin-top: 3px; font-size: 12px; line-height: 18px; color: var(--v4v-caption); }

.v4v-error {
  padding: 40px 20px;
  border: 1px dashed var(--v4v-border-l3);
  border-radius: var(--v4v-radius);
  background: var(--v4v-soft);
  text-align: center;
}
.v4v-error-t { font-size: 14px; line-height: 22px; font-weight: 500; color: var(--v4v-text); }
.v4v-error-m { margin: 4px auto 14px; max-width: 520px; font-size: 12px; line-height: 18px; color: var(--v4v-tertiary); word-break: break-word; }

.v4v-sk { background: var(--dsw-alias-bg-skeleton); border-radius: 6px; animation: v4v-pulse 1.6s ease-in-out infinite; }
.v4v-sk-line { height: 10px; margin: 6px 0; }
@keyframes v4v-pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.55; } }

/* ---------------------------------------------------------------- 表单 / 按钮 */

.v4v-textarea {
  width: 100%;
  min-width: 0;
  padding: 7px 9px;
  border: 1px solid var(--v4v-border-l3);
  border-radius: 8px;
  background: var(--v4v-card-bg);
  color: var(--v4v-text);
  font: inherit;
  font-size: 12px;
  line-height: 19px;
  resize: vertical;
}

.v4v-textarea:focus { border-color: var(--v4v-accent); }
.v4v-textarea::placeholder { color: var(--v4v-caption); }
.v4v-form-error { display: none; margin-top: 2px; font-size: 11px; line-height: 16px; color: var(--v4v-error); }
.v4v-form-error.is-on { display: block; }
.v4v-form-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 2px; }

.v4v-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 32px;
  padding: 0 14px;
  border: 1px solid var(--v4v-border-l3);
  border-radius: 8px;
  background: var(--v4v-card-bg);
  color: var(--v4v-text);
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  line-height: 18px;
  cursor: pointer;
  white-space: nowrap;
}

.v4v-btn:hover { background: var(--v4v-hover); }
.v4v-btn--primary { border-color: transparent; background: var(--v4v-primary-fill); color: var(--v4v-on-dark); }
.v4v-btn--primary:hover { background: var(--v4v-primary-hover); }
.v4v-btn--danger { border-color: transparent; background: var(--v4v-error); color: var(--v4v-on-dark); }
.v4v-btn--danger:hover { filter: brightness(0.94); }
.v4v-btn--danger-ghost { border-color: color-mix(in srgb, var(--v4v-error) 35%, transparent); background: transparent; color: var(--v4v-error); }
.v4v-btn--danger-ghost:hover { background: color-mix(in srgb, var(--v4v-error) 8%, transparent); }
.v4v-btn--sm { height: 26px; padding: 0 10px; font-size: 12px; }

.v4v button:focus-visible,
.v4v textarea:focus-visible,
.v4v summary:focus-visible { outline: 2px solid var(--v4v-accent); outline-offset: 1px; }

/* ---------------------------------------------------------------- toast / 浮层 */

.v4v-toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translateX(-50%);
  z-index: 60;
  max-width: min(420px, calc(100vw - 40px));
  padding: 9px 14px;
  border-radius: 8px;
  background: var(--v4v-primary-fill);
  color: var(--v4v-on-dark);
  font-size: 12px;
  line-height: 18px;
  box-shadow: var(--v4v-shadow-lv2);
  animation: v4v-toast-in 0.16s ease-out;
}

.v4v-toast.is-error { background: var(--v4v-error); }
.v4v-toast.is-ok { background: var(--v4v-success); }

@keyframes v4v-toast-in {
  from { opacity: 0; transform: translate(-50%, 6px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}

.v4v-overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
}

.v4v-mask {
  position: absolute;
  inset: 0;
  background: var(--dsw-alias-bg-mask-1, color-mix(in srgb, var(--v4v-text) 36%, transparent));
}

.v4v-modal {
  position: relative;
  width: min(340px, calc(100vw - 40px));
  padding: 16px;
  border: 1px solid var(--v4v-border-l2);
  border-radius: var(--v4v-radius);
  background: var(--v4v-card-bg);
  box-shadow: var(--v4v-shadow-lv3);
}

.v4v-modal-t { font-size: 14px; line-height: 20px; font-weight: 500; color: var(--v4v-text); }
.v4v-modal-m { margin-top: 6px; font-size: 12px; line-height: 19px; color: var(--v4v-secondary); white-space: pre-line; word-break: break-word; }
.v4v-modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 14px; }

.v4v-lightbox {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  max-width: min(760px, calc(100vw - 48px));
  max-height: calc(100vh - 48px);
  margin: 0;
}

.v4v-lightbox img {
  max-width: 100%;
  max-height: calc(100vh - 96px);
  object-fit: contain;
  border-radius: 10px;
  background: var(--v4v-card-bg);
  box-shadow: var(--v4v-shadow-lv3);
}

.v4v-lightbox figcaption { font-size: 11px; line-height: 16px; color: var(--dsw-alias-label-primary-foreground, var(--dsw-static-neutral-bluish-00)); }

.v4v-lightbox-x {
  position: absolute;
  top: -34px;
  right: -8px;
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 8px;
  background: var(--v4v-card-bg);
  color: var(--v4v-text);
  font-size: 16px;
  line-height: 28px;
  cursor: pointer;
}

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

@media (max-width: 720px) {
  .v4v-head { padding: 8px 16px; }
  .v4v-body { padding: 14px 16px 28px; }
  .v4v-row { flex-wrap: wrap; }
  .v4v-row-side { width: 100%; flex-direction: row; justify-content: space-between; align-items: center; }
  .v4v-detail-top .v4v-dim { margin-left: 0; }
  .v4v-memform-grid { grid-template-columns: minmax(0, 1fr); }
  .v4v-memfold-hint { display: none; }
  .v4v-tabs { align-self: stretch; }
  .v4v-tab { flex: 1 1 auto; justify-content: center; }
  .v4v-docsearch .v4v-input { flex: 1 1 100%; }
  .v4v-docsearch .v4v-select { flex: 1 1 100%; }
  .v4v-docsearch .v4v-cap { margin-left: 0; }
  .v4v-cat-actions { margin-left: 0; }
  .v4v-doc-side { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .v4v-sk,
  .v4v-toast { animation: none; }
}
