/* tags.css — 标签管理页面样式（G6.5-fix2 4-Tab + 拖拽）*/
.tags-container {
  padding: 20px;
  max-width: 1100px;
}
.tags-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}
.tags-header h2 {
  margin: 0;
  font-size: 18px;
}
.tags-toolbar {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-bottom: 14px;
  flex-wrap: wrap;
}
.tags-toolbar select,
.tags-toolbar input[type="search"] {
  padding: 6px 10px;
  border: 1px solid #d0d5dd;
  border-radius: 6px;
  font-size: 13px;
  background: #fff;
}
.tags-toolbar input[type="search"] {
  flex: 1;
  min-width: 160px;
}

/* 标签表格 */
.tags-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.tags-table th {
  text-align: left;
  padding: 8px 10px;
  border-bottom: 2px solid #e5e7eb;
  font-weight: 600;
  color: #6b7280;
  font-size: 12px;
  white-space: nowrap;
}
.tags-table td {
  padding: 8px 10px;
  border-bottom: 1px solid #f3f4f6;
  vertical-align: middle;
}
.tags-table tr:hover td {
  background: #f9fafb;
}

/* 颜色 pill 标签 */
.tag-pill {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 12px;
  color: #fff;
  font-weight: 500;
}

/* 颜色选择器 */
.color-swatch-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 6px 0;
}
.color-swatch {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  border: 2px solid transparent;
  cursor: pointer;
  transition: border-color 0.15s;
}
.color-swatch:hover,
.color-swatch.active {
  border-color: #1f2937;
}
.color-hex-input {
  width: 90px;
  padding: 4px 8px;
  border: 1px solid #d0d5dd;
  border-radius: 6px;
  font-size: 13px;
  font-family: monospace;
}

/* 系统标签行 */
tr.is-system td:first-child {
  position: relative;
  padding-left: 18px;
}
tr.is-system td:first-child::before {
  content: "🔒";
  position: absolute;
  left: 2px;
  top: 8px;
  font-size: 11px;
}

/* 用量数列 */
.tag-count {
  font-weight: 600;
  color: #374151;
}
.tag-count.zero {
  color: #9ca3af;
}

/* 内联编辑按钮 */
.tag-action-btn {
  background: none;
  border: 1px solid #d0d5dd;
  border-radius: 4px;
  padding: 3px 8px;
  cursor: pointer;
  font-size: 12px;
  color: #374151;
  margin-right: 4px;
}
.tag-action-btn:hover {
  background: #f3f4f6;
}
.tag-action-btn.danger:hover {
  background: #fef2f2;
  border-color: #fca5a5;
  color: #dc2626;
}
.tag-action-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* 空状态 */
.tags-empty {
  padding: 40px 0;
  text-align: center;
  color: #9ca3af;
  font-size: 14px;
}

/* G6.5-fix6: zones.css 第二份 .drawer-overlay 把 z-index 升到 900,
   但 .drawer 还是 201, 导致 overlay 盖在 drawer 上面. 输入框点不到.
   tags-drawer 提级到 1001 确保高于 overlay. */
.drawer.tags-drawer { z-index: 1001 !important; }

/* Drawer 样式微调 */
.tags-drawer .drawer-body label {
  display: block;
  margin: 10px 0 4px;
  font-size: 13px;
  font-weight: 500;
  color: #374151;
}
.tags-drawer .drawer-body input,
.tags-drawer .drawer-body select {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid #d0d5dd;
  border-radius: 6px;
  font-size: 13px;
  box-sizing: border-box;
}
.tags-drawer .drawer-body input:disabled {
  background: #f3f4f6;
  color: #9ca3af;
}

/* ── G6.5-fix2: Tab 栏 ── */
.tags-tab-bar {
  display: flex;
  gap: 4px;
  border-bottom: 2px solid #e5e7eb;
  margin-bottom: 16px;
  padding-bottom: 0;
}
.tags-tab-btn {
  padding: 8px 18px;
  border: 1px solid transparent;
  border-bottom: none;
  border-radius: 6px 6px 0 0;
  background: transparent;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  color: #6b7280;
  transition: all 0.15s;
  position: relative;
  bottom: -2px;
}
.tags-tab-btn:hover {
  background: #f3f4f6;
  color: #374151;
}
.tags-tab-btn.active {
  background: #fff;
  border-color: #e5e7eb;
  color: #1f2937;
  font-weight: 600;
  border-bottom-color: #fff;
}

/* ── G6.5-fix2: 拖拽列表 ── */
.tags-dnd-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.tags-dnd-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  transition: box-shadow 0.15s, border-color 0.15s;
  user-select: none;
}
.tags-dnd-item:hover {
  border-color: #94a3b8;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}
.tags-dnd-item.dragging {
  opacity: 0.6;
  border-color: #3b82f6;
  box-shadow: 0 4px 12px rgba(59,130,246,0.2);
}
.tags-dnd-handle {
  cursor: grab;
  color: #9ca3af;
  font-size: 16px;
  line-height: 1;
  flex-shrink: 0;
}
.tags-dnd-handle:active {
  cursor: grabbing;
}
.tags-color-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  flex-shrink: 0;
  border: 1px solid rgba(0,0,0,0.1);
}
.tags-name {
  font-size: 14px;
  font-weight: 500;
  color: #1f2937;
  min-width: 60px;
}
.tags-name-en {
  font-size: 12px;
  color: #94a3b8;
}
.tags-ns-badge {
  font-size: 11px;
  padding: 2px 6px;
  background: #f3f4f6;
  border-radius: 4px;
  color: #6b7280;
}
.tags-applies-badge {
  font-size: 11px;
  padding: 2px 6px;
  background: #eff6ff;
  border-radius: 4px;
  color: #3b82f6;
}
.tags-count-badge {
  font-size: 12px;
  color: #6b7280;
  margin-left: auto;
}
.tags-btn {
  border: 1px solid #d0d5dd;
  border-radius: 4px;
  cursor: pointer;
  font-size: 12px;
  padding: 4px 10px;
  background: #fff;
  color: #374151;
}
.tags-btn:hover {
  background: #f3f4f6;
}
.tags-btn-sm {
  padding: 3px 8px;
}
.tags-btn-edit {
  color: #2563eb;
}
.tags-btn-del {
  color: #dc2626;
}
.tags-btn-del:hover {
  background: #fef2f2;
  border-color: #fca5a5;
}
.tags-lock-icon {
  font-size: 14px;
  cursor: default;
}
.tags-loading {
  padding: 40px 0;
  text-align: center;
  color: #94a3b8;
}
.tags-error {
  padding: 40px 0;
  text-align: center;
  color: #dc2626;
}
.tags-count {
  font-size: 13px;
  color: #6b7280;
  margin-right: auto;
}

/* Toast 通知 */
.tags-toast {
  position: fixed;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  padding: 10px 24px;
  border-radius: 8px;
  font-size: 14px;
  color: #fff;
  z-index: 10000;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  animation: tags-toast-fadein 0.2s ease;
}
.tags-toast-success { background: #10b981; }
.tags-toast-error   { background: #ef4444; }
.tags-toast-info    { background: #3b82f6; }
@keyframes tags-toast-fadein {
  from { opacity: 0; transform: translateX(-50%) translateY(10px); }
  to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}


/* G6.5-fix7: 极简 form 元数据行（系统标签只读展示） */
.tags-meta-row { display: flex; padding: 6px 0; border-bottom: 1px solid #f3f4f6; font-size: 13px; }
.tags-meta-key { color: #6b7280; min-width: 56px; }
.tags-meta-val { color: #374151; font-weight: 500; }
