/* 共用历史角标：不挤压原按钮，窄屏仍能看到数字。 */
[data-ai-history-button] { position: relative; overflow: visible !important; }
.ai-history-unread-badge {
    position: absolute; top: -2px; right: -7px; z-index: 3;
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 19px; height: 19px; padding: 0 4px; box-sizing: border-box;
    border-radius: 999px; background: #dc2626; color: #fff;
    border: 2px solid #fff; font: 700 11px/1 Arial, sans-serif;
    pointer-events: none; white-space: nowrap;
}
.ai-history-is-unread { box-shadow: inset 3px 0 0 #dc2626; }
/* 任务页签位于横向滚动容器，把角标放在按钮内侧，避免手机上被裁切。 */
[data-manim-tab="history"][data-ai-history-button] .ai-history-unread-badge { top: 1px; right: 1px; }
[data-ai-history-label]:empty { display: none; }
.ai-history-unread-label,
[data-ai-history-label] > .ai-history-unread-label {
    display: inline-block; margin-left: 7px; padding: 2px 5px;
    border-radius: 4px; background: #fef2f2; color: #b91c1c;
    font: 600 11px/1.4 sans-serif; white-space: nowrap; vertical-align: middle;
}
@media (max-width: 600px) {
    .ai-history-unread-badge { top: -2px; right: -4px; }
    .ai-history-unread-label { margin-left: 4px; }
}
