/* 错因标签：详情页的编辑器、列表卡片上的小标签、侧栏的标签筛选。颜色全部走主题变量。 */

.tag-editor { margin: var(--space-4) 0; }
.tag-editor[aria-busy="true"] { cursor: progress; }
.tag-list { display: flex; flex-wrap: wrap; gap: var(--space-2); margin: var(--space-2) 0; padding: 0; list-style: none; }
.tag-list[hidden] { display: none; }
.tag-chip {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: 2px var(--space-1) 2px var(--space-3);
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  background: var(--soft);
  color: var(--accent-hover);
  font-size: var(--text-sm);
  font-weight: 600;
  line-height: 24px;
}
.tag-remove {
  position: relative;
  width: 24px;
  min-height: 24px;
  padding: 0;
  border: 0;
  border-radius: var(--radius-round);
  background: transparent;
  color: inherit;
  font-size: 17px;
  line-height: 1;
}
/* 看上去还是 24px，点击范围扩到 44px。 */
.tag-remove::after { content: ""; position: absolute; inset: -10px; }
.tag-remove:hover:not(:disabled) { background: var(--surface); transform: none; }
.tag-add { display: flex; gap: var(--space-2); max-width: 420px; margin: var(--space-2) 0; }
.tag-add[hidden] { display: none; }
.tag-input { flex: 1; min-width: 0; margin: 0; padding: 8px 12px; }
.tag-submit { min-height: 40px; padding: 0 var(--space-4); }
.tag-suggest { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.tag-suggest[hidden] { display: none; }
.tag-suggestion {
  min-height: 32px;
  padding: 0 var(--space-3);
  border-style: dashed;
  border-radius: var(--radius-pill);
  background: transparent;
  color: var(--ink-2);
  font-size: var(--text-xs);
}
.tag-status { min-height: 1.5em; margin: var(--space-1) 0 0; color: var(--ink-2); font-size: var(--text-xs); }
.tag-status:empty { display: none; }
.tag-sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; border: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* 列表卡片上的小标签（卡片里的 span 默认是块级，这里要压过去）。 */
.record-button .record-tags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: var(--space-2); }
.record-tags .tag-chip { display: inline-flex; padding: 0 var(--space-2); font-size: var(--text-meta); line-height: 18px; }

/* 侧栏的标签筛选 */
.tag-pill-list { display: flex; flex-wrap: wrap; gap: 6px; margin: var(--space-2) 0 0; padding: 0; list-style: none; }
.tag-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 28px;
  padding: 0 var(--space-2) 0 var(--space-3);
  border-radius: var(--radius-pill);
  background: var(--surface);
  font-size: var(--text-xs);
  font-weight: 600;
}
.tag-pill[aria-pressed="true"] { border-color: var(--accent); background: var(--soft); color: var(--accent-hover); }
.tag-pill:hover:not(:disabled) { transform: none; }
.tag-pill-count { color: var(--ink-2); font-variant-numeric: tabular-nums; font-weight: 500; }
.sidebar-hint { margin: var(--space-2) 0 0; color: var(--ink-2); font-size: var(--text-xs); line-height: 1.6; }
.sidebar-hint:empty { display: none; }
.tag-pill:focus-visible, .tag-suggestion:focus-visible, .tag-remove:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

@media (pointer: coarse) {
  .tag-suggestion { min-height: 44px; }
  .tag-submit { min-height: 44px; }
  .tag-input { min-height: 44px; font-size: 16px; }
  .tag-pill { min-height: 44px; }
}
