.biliindex-wrap {
  display: inline-flex !important;
  align-items: center;
  vertical-align: middle;
  position: relative;
  z-index: 12;
  pointer-events: auto;
  flex-shrink: 0;
}

#user-name + .biliindex-wrap,
.user-name + .biliindex-wrap,
.upname .biliindex-wrap,
.up-name .biliindex-wrap {
  margin-left: 6px;
  vertical-align: middle;
}

bili-comment-user-renderer,
bili-comment-renderer .comment-header,
bili-comment-renderer .user-info {
  overflow: visible !important;
}

.video-page-card-small .upinfo .upname,
.video-page-card-small .r-upinfo .upname,
.rec-list-item .upinfo .upname {
  display: inline-flex;
  align-items: center;
  flex-wrap: nowrap;
  max-width: 100%;
}

.up-panel-container .up-name,
.up-panel-container .upname,
.up-info-container .up-name,
#v_upinfo .up-name,
.up-info--wrapper .up-name {
  display: inline-flex !important;
  align-items: center;
  flex-wrap: nowrap;
}

.video-page-card-small a.up-name,
.video-page-card-small .up-name a,
.video-page-card-small .upinfo a {
  display: inline !important;
  vertical-align: middle;
}

.video-page-card-small .biliindex-wrap {
  margin-left: 4px;
  vertical-align: middle;
}

.biliindex-bar {
  display: inline-flex !important;
  align-items: center;
  gap: 5px;
  margin-left: 6px;
  vertical-align: middle;
  flex-shrink: 0;
  position: relative;
  z-index: 50;
  pointer-events: auto;
  font-size: inherit;
  line-height: inherit;
  visibility: visible !important;
  opacity: 1 !important;
}

#user-name,
.user-name,
bili-comment-user-renderer,
.upname,
.up-name,
.up-info--wrapper {
  overflow: visible !important;
}

.biliindex-slot {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  min-width: 28px;
  min-height: 1.2em;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid #c9ccd0;
  background: #f6f7f8;
  color: #61666d;
  font-size: inherit;
  font-family: inherit;
  line-height: 1.2;
  white-space: nowrap;
  max-width: 9em;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
  vertical-align: middle;
  opacity: 1 !important;
  -webkit-backdrop-filter: none !important;
  backdrop-filter: none !important;
}

.biliindex-slot.biliindex-slot-filled {
  background: #e3f6fc;
  border-color: #00aeec;
  color: #00aeec;
  font-weight: 500;
  gap: 3px;
}

.biliindex-slot-label {
  line-height: 1.1;
}

.biliindex-slot-count {
  font-size: 0.82em;
  font-weight: 700;
  color: #00aeec;
  line-height: 1;
  min-width: 1ch;
}

.biliindex-tag-menu .menu-emoji {
  margin-right: 8px;
  font-family: "Segoe UI Emoji", "Apple Color Emoji", "Noto Color Emoji", sans-serif;
  font-size: 1.15em;
  line-height: 1;
}

.biliindex-tag-menu .menu-count {
  margin-left: auto;
  font-size: 0.9em;
  color: #00aeec;
  font-weight: 700;
}

.biliindex-tag-menu button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.biliindex-slot:hover {
  background: #e3f6fc;
  border-color: #00aeec;
}

/* 评论区：白底实心，避免透出输入框占位文案 */
.biliindex-bar[data-placement="comment"] .biliindex-slot {
  background: #ffffff !important;
  border-color: #e3e5e7 !important;
  color: #61666d !important;
}

.biliindex-bar[data-placement="comment"] .biliindex-slot.biliindex-slot-filled {
  background: #e3f6fc !important;
  border-color: #00aeec !important;
  color: #00aeec !important;
}

.biliindex-bar[data-placement="comment"] .biliindex-slot-label,
.biliindex-bar[data-placement="comment"] .biliindex-slot-count {
  color: #00aeec !important;
}

.biliindex-tag-menu {
  position: absolute;
  left: 0;
  top: calc(100% + 4px);
  z-index: 99999;
  min-width: 96px;
  padding: 4px;
  background: #fff;
  border: 1px solid #e3e5e7;
  border-radius: 6px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  display: flex;
  flex-direction: column;
  gap: 2px;
}

/* 一级分类：路人置顶 + 横向选项卡，第二行常用标签 */
.biliindex-tag-menu.is-category-tabs {
  min-width: 0;
  padding: 6px 8px 4px;
  gap: 6px;
}

.biliindex-tag-tab-row-main {
  display: flex;
  flex-direction: row;
  align-items: stretch;
  gap: 4px;
  width: min(360px, calc(100vw - 24px));
  max-width: 360px;
}

.biliindex-tag-tab-viewport {
  display: flex;
  flex: 1 1 0;
  flex-direction: row;
  align-items: stretch;
  gap: 4px;
  min-width: 0;
}

.biliindex-tag-menu.is-category-tabs button.is-passerby {
  flex: 0 0 auto;
  min-width: 44px;
  max-width: 52px;
  background: #fff3e8;
  border-color: #ffb86c;
  color: #e58900;
  font-weight: 600;
}

.biliindex-tag-menu.is-category-tabs button.is-passerby:hover {
  background: #ffe8cc;
  border-color: #ff9f1a;
  color: #c96f00;
}

.biliindex-tag-tab-row-frequent {
  display: flex;
  flex-direction: column;
  gap: 4px;
  width: min(360px, calc(100vw - 24px));
  max-width: 360px;
}

.biliindex-tag-tab-row-label {
  font-size: 11px;
  color: #61666d;
  line-height: 1.2;
  padding: 0 2px;
}

.biliindex-tag-tab-frequent {
  display: flex;
  flex-direction: row;
  align-items: stretch;
  gap: 4px;
}

.biliindex-tag-menu.is-category-tabs .biliindex-tag-tab-frequent button {
  flex: 1 1 0;
  max-width: none;
}

.biliindex-tag-tab-frequent .freq-empty {
  flex: 1 1 0;
  padding: 6px 4px;
  text-align: center;
  font-size: 12px;
  color: #c9ccd0;
  border: 1px dashed #e3e5e7;
  border-radius: 6px;
  line-height: 1.25;
}

.biliindex-tag-menu.is-category-tabs button {
  flex: 1 1 0;
  min-width: 0;
  max-width: 68px;
  padding: 6px 4px;
  text-align: center;
  font-size: 12px;
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  border: 1px solid #e3e5e7;
  background: #f6f7f8;
  border-radius: 6px;
}

.biliindex-tag-menu.is-category-tabs button:hover {
  background: #e8f7fc;
  border-color: #00aeec;
  color: #00aeec;
}

.biliindex-tag-tab-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 0 2px 2px;
  font-size: 11px;
  color: #9499a0;
  user-select: none;
}

.biliindex-tag-tab-foot .tab-page {
  font-variant-numeric: tabular-nums;
}

.biliindex-tag-menu button {
  padding: 6px 8px;
  border: none;
  background: transparent;
  border-radius: 4px;
  cursor: pointer;
  font-size: 13px;
  color: #18191c;
  text-align: left;
}

.biliindex-tag-menu button:hover {
  background: #f1f2f3;
}

.biliindex-tag-empty {
  padding: 6px 8px;
  font-size: 12px;
  color: #9499a0;
}

a .biliindex-bar,
a .biliindex-slot {
  position: relative;
  z-index: 60;
}

/* 空间个人主页头图：昵称后 3+1 槽，浅色描边便于压在头图上 */
.s-space .h-name,
.s-space .h-user .h-name,
.s-space #h-name,
.s-space .space-info .n-name,
.h-header .h-name,
.h-header .nickname,
.h-user .h-name,
.h-user .nickname,
#h-name,
.space-info .n-name,
.header-info .nickname {
  display: inline-flex !important;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  overflow: visible !important;
}

.h-header .biliindex-wrap,
.h-gradient .biliindex-wrap,
.h-user .biliindex-wrap,
.nickname + .biliindex-wrap,
.h-name .biliindex-wrap {
  margin-left: 4px;
  vertical-align: middle;
}

/* 空间头图：粉红底 + 白字（与大会员徽章类似，头图上易读） */
.biliindex-bar-space .biliindex-slot,
.biliindex-bar[data-placement="space"] .biliindex-slot {
  background: #fb7299 !important;
  border-color: rgba(255, 255, 255, 0.9) !important;
  color: #fff !important;
}

.biliindex-bar-space .biliindex-slot-label,
.biliindex-bar-space .biliindex-slot-count,
.biliindex-bar[data-placement="space"] .biliindex-slot-label,
.biliindex-bar[data-placement="space"] .biliindex-slot-count {
  color: #fff !important;
}

.biliindex-bar-space .biliindex-slot.biliindex-slot-filled,
.biliindex-bar[data-placement="space"] .biliindex-slot.biliindex-slot-filled {
  background: #fb7299 !important;
  border-color: rgba(255, 255, 255, 0.95) !important;
}

.biliindex-bar-space .biliindex-slot:hover,
.biliindex-bar[data-placement="space"] .biliindex-slot:hover {
  background: #ff85a8 !important;
  filter: brightness(1.05);
}
