/* ============================================================
 * 配音素材管理页面 — V21 设计系统
 * ============================================================ */

.vmat-page {
  padding: 24px 32px;
  min-height: 100%;
}

/* ── 页面操作按钮 ─────────────────────────────────────────── */

.vmat-page-actions {
  display: flex;
  gap: 8px;
}

/* ── 工具栏 ───────────────────────────────────────────────── */

.vmat-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.vmat-toolbar-left {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.vmat-toolbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.vmat-result-count {
  font-size: 13px;
  color: var(--text-secondary);
  white-space: nowrap;
}

/* ── 视图切换 ─────────────────────────────────────────────── */

.vmat-view-toggle {
  display: flex;
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.vmat-view-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border: none;
  background: var(--bg-surface);
  color: var(--text-tertiary);
  cursor: pointer;
  transition: all var(--transition-fast);
  font-size: 15px;
}

.vmat-view-btn:first-child {
  border-right: 1px solid var(--border-primary);
}

.vmat-view-btn:hover {
  color: var(--text-primary);
  background: var(--bg-hover);
}

.vmat-view-btn.active {
  color: var(--primary-600);
  background: var(--primary-50);
}

/* ── 卡片网格 ─────────────────────────────────────────────── */

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

/* ── 卡片 ─────────────────────────────────────────────────── */

.vmat-card {
  position: relative;
  background: var(--bg-surface);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-lg);
  padding: 18px;
  transition: all var(--transition-normal);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.vmat-card:hover {
  border-color: var(--primary-300);
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

.vmat-card.playing {
  border-color: var(--primary-500);
  box-shadow:
    0 0 0 1px var(--primary-500),
    var(--shadow-md);
}

/* 性别色带 */
.vmat-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  background: var(--neutral-300);
}

.vmat-card.vmat-gender--male::before {
  background: var(--primary-500);
}

.vmat-card.vmat-gender--female::before {
  background: var(--secondary-500);
}

.vmat-card.vmat-gender--child::before {
  background: var(--accent-500);
}

.vmat-card.vmat-gender--neutral::before {
  background: linear-gradient(90deg, var(--primary-500), var(--secondary-500));
}

/* 卡片操作按钮 */
.vmat-card-actions {
  position: absolute;
  top: 12px;
  right: 12px;
  display: flex;
  gap: 4px;
  opacity: 0;
  transition: opacity var(--transition-fast);
}

.vmat-card:hover .vmat-card-actions {
  opacity: 1;
}

.vmat-card-action-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border: none;
  border-radius: var(--radius-sm);
  background: var(--bg-hover);
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 13px;
  transition: all var(--transition-fast);
}

.vmat-card-action-btn:hover {
  background: var(--primary-50);
  color: var(--primary-600);
}

.vmat-card-action-btn--danger:hover {
  background: var(--error-50);
  color: var(--error-600);
}

/* 卡片头部 */
.vmat-card-header {
  display: flex;
  align-items: center;
  gap: 12px;
}

.vmat-card-avatar {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  background: var(--primary-50);
  color: var(--primary-600);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}

.vmat-gender--female .vmat-card-avatar {
  background: var(--secondary-50);
  color: var(--secondary-600);
}

.vmat-gender--child .vmat-card-avatar {
  background: var(--accent-50);
  color: var(--accent-600);
}

.vmat-gender--neutral .vmat-card-avatar {
  background: var(--indigo-50);
  color: var(--indigo-600);
}

.vmat-card-title-area {
  flex: 1;
  min-width: 0;
}

.vmat-card-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0 0 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.vmat-card-gender {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  color: var(--text-tertiary);
}

.vmat-card-gender.vmat-gender--male {
  color: var(--primary-600);
}

.vmat-card-gender.vmat-gender--female {
  color: var(--secondary-600);
}

.vmat-card-gender.vmat-gender--child {
  color: var(--accent-600);
}

/* 描述 */
.vmat-card-desc {
  font-size: 13px;
  color: var(--text-secondary);
  margin: 0;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* 标签 */
.vmat-card-tags {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

/* 元信息 */
.vmat-card-meta {
  display: flex;
  gap: 12px;
  font-size: 12px;
  color: var(--text-tertiary);
}

/* 播放器 */
.vmat-card-player {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-top: 12px;
  border-top: 1px solid var(--border-light);
}

.vmat-play-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 50%;
  background: var(--primary-500);
  color: #fff;
  cursor: pointer;
  font-size: 18px;
  transition: all var(--transition-fast);
  flex-shrink: 0;
}

.vmat-play-btn:hover {
  background: var(--primary-600);
  transform: scale(1.05);
}

.vmat-play-btn:active {
  transform: scale(0.95);
}

.vmat-progress {
  flex: 1;
  height: 4px;
  background: var(--neutral-200);
  border-radius: 2px;
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.vmat-progress:hover {
  height: 6px;
  margin-top: -1px;
  margin-bottom: -1px;
}

.vmat-progress-bar {
  height: 100%;
  background: var(--primary-500);
  border-radius: 2px;
  transition: width 0.1s linear;
}

.vmat-time {
  font-size: 12px;
  color: var(--text-tertiary);
  font-variant-numeric: tabular-nums;
  min-width: 36px;
  text-align: right;
}

/* ── 列表视图 ─────────────────────────────────────────────── */

.vmat-list {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.vmat-list-header {
  display: grid;
  grid-template-columns: 48px 1fr 80px 160px 120px 60px 70px 80px;
  align-items: center;
  padding: 10px 16px;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-primary);
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.vmat-row {
  display: grid;
  grid-template-columns: 48px 1fr 80px 160px 120px 60px 70px 80px;
  align-items: center;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-light);
  transition: background var(--transition-fast);
  position: relative;
}

.vmat-row:last-child {
  border-bottom: none;
}

.vmat-row:hover {
  background: var(--bg-hover);
}

.vmat-row.playing {
  background: var(--primary-50);
}

/* 列表性别色条 */
.vmat-row::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: transparent;
}

.vmat-row.vmat-gender--male::before {
  background: var(--primary-500);
}

.vmat-row.vmat-gender--female::before {
  background: var(--secondary-500);
}

.vmat-row.vmat-gender--child::before {
  background: var(--accent-500);
}

.vmat-row.vmat-gender--neutral::before {
  background: linear-gradient(180deg, var(--primary-500), var(--secondary-500));
}

/* 列表播放按钮 */
.vmat-row-play {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: var(--primary-600);
  cursor: pointer;
  font-size: 20px;
  transition: all var(--transition-fast);
}

.vmat-row-play:hover {
  background: var(--primary-50);
}

/* 列表信息 */
.vmat-row-info {
  min-width: 0;
  padding-right: 12px;
}

.vmat-row-name {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
  margin: 0 0 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.vmat-row-desc {
  font-size: 12px;
  color: var(--text-tertiary);
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* 列表性别 */
.vmat-row-gender {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  color: var(--text-tertiary);
}

.vmat-row-gender.vmat-gender--male {
  color: var(--primary-600);
}

.vmat-row-gender.vmat-gender--female {
  color: var(--secondary-600);
}

.vmat-row-gender.vmat-gender--child {
  color: var(--accent-600);
}

/* 列表标签 */
.vmat-row-tags {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}

/* 列表进度条 */
.vmat-row-progress {
  height: 4px;
  background: var(--neutral-200);
  border-radius: 2px;
  cursor: pointer;
  overflow: hidden;
}

.vmat-row-progress:hover {
  height: 6px;
}

.vmat-row-progress-bar {
  height: 100%;
  background: var(--primary-500);
  border-radius: 2px;
  transition: width 0.1s linear;
}

/* 列表其他列 */
.vmat-row-time,
.vmat-row-size {
  font-size: 12px;
  color: var(--text-tertiary);
  font-variant-numeric: tabular-nums;
}

/* 列表操作 */
.vmat-row-actions {
  display: flex;
  gap: 4px;
  justify-content: flex-end;
}

.vmat-row-action-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border: none;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-tertiary);
  cursor: pointer;
  font-size: 13px;
  transition: all var(--transition-fast);
}

.vmat-row-action-btn:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.vmat-row-action-btn--danger:hover {
  background: var(--error-50);
  color: var(--error-600);
}

/* ── 空状态 ───────────────────────────────────────────────── */

.vmat-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 64px 24px;
  text-align: center;
}

.vmat-empty-icon {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--neutral-100);
  color: var(--neutral-400);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  margin-bottom: 16px;
}

.vmat-empty h3 {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0 0 8px;
}

.vmat-empty p {
  font-size: 14px;
  color: var(--text-secondary);
  margin: 0 0 20px;
}

/* ── 表单 ─────────────────────────────────────────────────── */

.vmat-form {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.vmat-form-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.vmat-form-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
}

/* 上传区域 */
.vmat-upload-zone {
  border: 2px dashed var(--border-primary);
  border-radius: var(--radius-lg);
  padding: 24px;
  cursor: pointer;
  transition: all var(--transition-fast);
  text-align: center;
}

.vmat-upload-zone:hover {
  border-color: var(--primary-400);
  background: var(--primary-50);
}

.vmat-upload-placeholder {
  color: var(--text-tertiary);
}

.vmat-upload-placeholder .vmat-upload-icon {
  font-size: 32px;
  color: var(--primary-400);
  margin-bottom: 8px;
}

.vmat-upload-placeholder p {
  font-size: 14px;
  color: var(--text-secondary);
  margin: 8px 0 4px;
}

.vmat-upload-placeholder span {
  font-size: 12px;
  color: var(--text-tertiary);
}

.vmat-upload-selected {
  display: flex;
  align-items: center;
  gap: 10px;
}

.vmat-upload-selected .vmat-upload-icon {
  font-size: 20px;
  color: var(--primary-500);
}

.vmat-upload-filename {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
  flex: 1;
  text-align: left;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.vmat-upload-filesize {
  font-size: 12px;
  color: var(--text-tertiary);
}

.vmat-upload-clear {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border: none;
  border-radius: 50%;
  background: var(--neutral-100);
  color: var(--text-tertiary);
  cursor: pointer;
  font-size: 12px;
  transition: all var(--transition-fast);
}

.vmat-upload-clear:hover {
  background: var(--error-50);
  color: var(--error-600);
}

/* 性别选择 */
.vmat-gender-group {
  display: flex;
  gap: 8px;
}

.vmat-gender-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-md);
  background: var(--bg-surface);
  color: var(--text-secondary);
  font-size: 13px;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.vmat-gender-btn:hover {
  border-color: var(--primary-300);
  color: var(--text-primary);
}

.vmat-gender-btn.active.vmat-gender--male {
  border-color: var(--primary-500);
  background: var(--primary-50);
  color: var(--primary-700);
}

.vmat-gender-btn.active.vmat-gender--female {
  border-color: var(--secondary-500);
  background: var(--secondary-50);
  color: var(--secondary-700);
}

.vmat-gender-btn.active.vmat-gender--child {
  border-color: var(--accent-500);
  background: var(--accent-50);
  color: var(--accent-700);
}

.vmat-gender-btn.active.vmat-gender--neutral {
  border-color: var(--indigo-500);
  background: var(--indigo-50);
  color: var(--indigo-700);
}

/* 标签选择 */
.vmat-tag-group {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.vmat-tag-btn {
  padding: 5px 12px;
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-full);
  background: var(--bg-surface);
  color: var(--text-secondary);
  font-size: 13px;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.vmat-tag-btn:hover {
  border-color: var(--primary-300);
  color: var(--text-primary);
}

.vmat-tag-btn.active {
  border-color: var(--primary-500);
  background: var(--primary-50);
  color: var(--primary-700);
}

/* 表单操作 */
.vmat-form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding-top: 8px;
}

/* ── 响应式 ───────────────────────────────────────────────── */

@media (max-width: 768px) {
  .vmat-page {
    padding: 16px;
  }

  .vmat-grid {
    grid-template-columns: 1fr;
  }

  .vmat-list-header,
  .vmat-row {
    grid-template-columns: 40px 1fr 60px 80px;
  }

  .vmat-lh-progress,
  .vmat-lh-time,
  .vmat-lh-size,
  .vmat-lh-actions,
  .vmat-row-progress,
  .vmat-row-time,
  .vmat-row-size,
  .vmat-row-actions {
    display: none;
  }

  .vmat-toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .vmat-toolbar-right {
    justify-content: space-between;
  }
}

/* ─── 批量操作栏 ─────────────────────────────────────────── */

.vmat-batch-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 16px;
  margin-bottom: 16px;
  background: var(--primary-soft, #eef2ff);
  border: 1px solid var(--primary-color, #6366f1);
  border-radius: 8px;
  animation: vmat-batch-bar-in 0.2s ease;
}

@keyframes vmat-batch-bar-in {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.vmat-batch-bar-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.vmat-batch-bar-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.vmat-select-all {
  font-size: 13px;
  color: var(--text-secondary, #64748b);
  cursor: pointer;
  user-select: none;
}

.vmat-select-all:hover {
  color: var(--primary-color, #6366f1);
}

.vmat-batch-count {
  font-size: 13px;
  font-weight: 500;
  color: var(--primary-color, #6366f1);
}

/* ─── 自定义 checkbox ────────────────────────────────────── */

.vmat-checkbox {
  width: 18px;
  height: 18px;
  border: 2px solid var(--neutral-300, #cbd5e1);
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s ease;
  background: var(--bg-primary, #fff);
  flex-shrink: 0;
}

.vmat-checkbox:hover {
  border-color: var(--primary-color, #6366f1);
}

.vmat-checkbox.checked {
  background: var(--primary-color, #6366f1);
  border-color: var(--primary-color, #6366f1);
  color: #fff;
  font-size: 10px;
}

/* ─── 卡片 checkbox 覆盖 ─────────────────────────────────── */

.vmat-card-checkbox {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 2;
}

.vmat-row-checkbox {
  flex-shrink: 0;
}

/* ─── 选中态 + 批量模式 ──────────────────────────────────── */

.vmat-card.selected {
  border-color: var(--primary-color, #6366f1);
  box-shadow: 0 0 0 1px var(--primary-color, #6366f1);
}

.vmat-row.selected {
  background: var(--primary-soft, #eef2ff);
}

.vmat-card.batch-mode {
  cursor: pointer;
}

.vmat-row.batch-mode {
  cursor: pointer;
}

/* ─── 进度条拖拽 thumb ───────────────────────────────────── */

.vmat-progress-thumb {
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--primary-color, #6366f1);
  border: 2px solid #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
  pointer-events: none;
  z-index: 1;
}

/* ─── 音量控制 ────────────────────────────────────────────── */

.vmat-volume {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 6px;
}

.vmat-volume-btn {
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  color: var(--text-secondary, #64748b);
  font-size: 14px;
  display: flex;
  align-items: center;
  transition: color 0.15s;
}

.vmat-volume-btn:hover {
  color: var(--primary-color, #6366f1);
}

.vmat-volume-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 48px;
  height: 4px;
  border-radius: 2px;
  background: var(--neutral-200, #e2e8f0);
  outline: none;
  cursor: pointer;
}

.vmat-volume-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--primary-color, #6366f1);
  cursor: pointer;
}

.vmat-volume-slider::-moz-range-thumb {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--primary-color, #6366f1);
  cursor: pointer;
  border: none;
}

/* ─── 上传进度条 ──────────────────────────────────────────── */

.vmat-upload-progress {
  position: relative;
  height: 20px;
  background: var(--neutral-100, #f1f5f9);
  border-radius: 10px;
  overflow: hidden;
  margin-top: 12px;
}

.vmat-upload-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--primary-color, #6366f1), #818cf8);
  border-radius: 10px;
  transition: width 0.3s ease;
}

.vmat-upload-progress-text {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 11px;
  font-weight: 600;
  color: var(--text-primary, #1e293b);
}

/* ─── 批量打标签 Popover ──────────────────────────────────── */

.vmat-tag-popover {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  max-width: 240px;
}

.vmat-tag-pop-btn {
  padding: 4px 12px;
  border: 1px solid var(--neutral-200, #e2e8f0);
  border-radius: 14px;
  background: var(--bg-primary, #fff);
  font-size: 12px;
  color: var(--text-secondary, #64748b);
  cursor: pointer;
  transition: all 0.15s;
}

.vmat-tag-pop-btn:hover {
  border-color: var(--primary-color, #6366f1);
  color: var(--primary-color, #6366f1);
  background: var(--primary-soft, #eef2ff);
}

/* ─── 列表 checkbox 列 ────────────────────────────────────── */

.vmat-lh-checkbox {
  width: 30px;
}

.vmat-list.batch-mode .vmat-list-header,
.vmat-list.batch-mode .vmat-row {
  grid-template-columns: 30px 48px 1fr 80px 160px 120px 60px 70px 80px;
}

/* ─── 标签筛选药丸条 ─────────────────────────────────────── */

.vmat-tag-filter-bar {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 10px 0;
  margin-bottom: 12px;
  scrollbar-width: thin;
}

.vmat-tag-filter-bar::-webkit-scrollbar {
  height: 4px;
}

.vmat-tag-filter-bar::-webkit-scrollbar-thumb {
  background: var(--neutral-300, #cbd5e1);
  border-radius: 2px;
}

.vmat-filter-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 16px;
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-full, 9999px);
  background: var(--bg-surface);
  color: var(--text-secondary);
  font-size: 13px;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  transition: all 0.2s ease;
  line-height: 1.4;
}

.vmat-filter-pill:hover {
  border-color: var(--primary-300);
  color: var(--text-primary);
  background: var(--primary-50);
}

.vmat-filter-pill:focus-visible {
  outline: 2px solid var(--primary-500);
  outline-offset: 2px;
}

.vmat-filter-pill.active {
  background: var(--primary-500);
  color: #fff;
  border-color: var(--primary-500);
}

.vmat-filter-pill.active .vmat-filter-pill-count {
  color: rgba(255, 255, 255, 0.75);
}

.vmat-filter-pill-count {
  font-size: 11px;
  opacity: 0.7;
  color: var(--text-tertiary);
}

/* ─── TagSelector ──────────────────────────────────────────── */

.vmat-tag-selector-wrapper {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.vmat-tag-selector {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 8px;
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-md);
  background: var(--bg-surface);
  min-height: 42px;
  cursor: text;
  transition:
    border-color 0.2s,
    box-shadow 0.2s;
}

.vmat-tag-selector:focus-within {
  border-color: var(--primary-500);
  box-shadow: 0 0 0 2px var(--primary-100);
}

.vmat-tag-selector-input {
  border: none;
  outline: none;
  flex: 1;
  min-width: 80px;
  font-size: 13px;
  background: transparent;
  color: var(--text-primary);
}

.vmat-tag-selector-input::placeholder {
  color: var(--text-placeholder);
}

.vmat-tag-suggestions {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  z-index: 10;
  margin-top: 4px;
  background: var(--bg-surface);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md, 0 4px 12px rgba(0, 0, 0, 0.1));
  max-height: 160px;
  overflow-y: auto;
}

.vmat-tag-suggestion-item {
  padding: 8px 12px;
  font-size: 13px;
  color: var(--text-primary);
  cursor: pointer;
  transition: background 0.15s;
}

.vmat-tag-suggestion-item:hover {
  background: var(--primary-50);
}

.vmat-tag-selector-presets {
  width: 100%;
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 4px;
  padding-top: 8px;
  border-top: 1px solid var(--border-light);
}

.vmat-tag-selector-preset {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 10px;
  font-size: 12px;
  border: 1px solid var(--border-primary);
  border-radius: 12px;
  background: var(--bg-surface);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s;
}

.vmat-tag-selector-preset:hover {
  border-color: var(--primary-300);
  color: var(--primary-600);
  background: var(--primary-50);
}

.vmat-tag-selector-preset.selected {
  opacity: 0.4;
  pointer-events: none;
}

/* ─── 标签溢出 + 空态 ─────────────────────────────────────── */

.vmat-tag-empty {
  font-size: 12px;
  color: var(--primary-500);
  cursor: pointer;
  padding: 2px 8px;
  border: 1px dashed var(--primary-300);
  border-radius: var(--radius-sm);
  transition: all 0.15s;
}

.vmat-tag-empty:hover {
  background: var(--primary-50);
  border-color: var(--primary-500);
}

.vmat-tag-overflow {
  font-style: italic;
  opacity: 0.7;
  cursor: default;
}

/* ── 批量打标签 Popover 自定义输入 ── */
.vmat-tag-pop-input-row {
  margin-bottom: 10px;
}
