.eo-title-badge.eo-title-no-ico {
  gap: 0;
  padding-left: 10px;
  padding-right: 10px;
}
.eo-title-badge.eo-title-no-ico .eo-title-ico {
  display: none !important;
}

/* 地球Online · 美化称号徽章（可全站复用） */
.eo-title-badge {
  --eo-title-c: #6b7280;
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  max-width: 100%;
  padding: 3px 10px 3px 8px;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--eo-title-c) 45%, #111);
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--eo-title-c) 14%, #fff), #fff);
  color: var(--eo-title-c) !important;
  font-weight: 700;
  font-size: 12px;
  line-height: 1.3;
  letter-spacing: 0.02em;
  vertical-align: middle;
  overflow: hidden;
  isolation: isolate;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.8) inset;
}

.eo-title-badge .eo-title-ico {
  width: 14px;
  height: 14px;
  object-fit: contain;
  flex: 0 0 auto;
  transform-origin: center center;
  image-rendering: auto;
}

.eo-title-badge .eo-title-text {
  position: relative;
  z-index: 2;
  color: var(--eo-title-c) !important;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 12em;
}

.eo-title-badge .eo-title-fx {
  display: none;
}

.eo-title-badge::after,
.eo-title-badge::before {
  content: none;
  display: none;
}

/* —— 列表轻量态：无无限动画、无 filter —— */
.eo-title-lite .eo-title-ico {
  filter: none;
  animation: none !important;
}

.eo-title-lite .eo-title-text {
  animation: none !important;
  background: none !important;
  -webkit-background-clip: unset !important;
  background-clip: unset !important;
  color: var(--eo-title-c) !important;
}

.eo-title-lite.eo-title-r3,
.eo-title-lite.eo-title-r4,
.eo-title-lite.eo-title-r5 {
  animation: none !important;
  filter: none !important;
}

/* —— 焦点态（装备展示 / 详情弹窗）：完整动效 —— */
.eo-title-focus .eo-title-ico {
  filter: drop-shadow(0 0 2px color-mix(in srgb, var(--eo-title-c) 50%, transparent));
  animation: eo-ico-bob 2.4s ease-in-out infinite;
}

.eo-title-focus.eo-title-r3 .eo-title-ico { animation-duration: 2s; }
.eo-title-focus.eo-title-r4 .eo-title-ico { animation-duration: 1.7s; }
.eo-title-focus.eo-title-r5 .eo-title-ico { animation-duration: 1.4s; }

.eo-title-focus .eo-title-text {
  background: linear-gradient(
    100deg,
    var(--eo-title-c) 0%,
    color-mix(in srgb, var(--eo-title-c) 55%, #fff) 45%,
    var(--eo-title-c) 90%
  );
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent !important;
  background-size: 200% 100%;
  animation: eo-title-flow 3.2s ease-in-out infinite;
}

.eo-title-focus .eo-title-fx {
  display: block;
  position: absolute;
  inset: -2px;
  z-index: 1;
  pointer-events: none;
  background: url('/title/assets/fx/sparkles.svg') center / 100% 100% no-repeat;
  opacity: 0.55;
}

.eo-title-focus::after {
  content: '';
  display: block;
  position: absolute;
  top: -20%;
  left: 0;
  width: 42%;
  height: 140%;
  z-index: 3;
  pointer-events: none;
  background: linear-gradient(
    100deg,
    transparent 0%,
    rgba(255, 255, 255, 0.05) 35%,
    rgba(255, 255, 255, 0.75) 50%,
    rgba(255, 255, 255, 0.05) 65%,
    transparent 100%
  );
  transform: translateX(-160%) skewX(-18deg);
  animation: eo-title-shine 3.4s ease-in-out infinite;
}

/* 稀有度 1 普通 */
.eo-title-r1 {
  --eo-title-c: #6b7280;
}

/* 2 精良 */
.eo-title-r2 {
  --eo-title-c: #2563eb;
  box-shadow: 0 0 0 1px rgba(37, 99, 235, 0.12), 0 4px 14px rgba(37, 99, 235, 0.12);
}

/* 3 稀有 */
.eo-title-r3 {
  --eo-title-c: #9333ea;
  box-shadow: 0 0 0 1px rgba(147, 51, 234, 0.16), 0 4px 16px rgba(147, 51, 234, 0.16);
}

.eo-title-focus.eo-title-r3 {
  animation: eo-title-pulse 2.8s ease-in-out infinite;
}

.eo-title-focus.eo-title-r3 .eo-title-fx {
  opacity: 0.75;
}

/* 4 史诗 */
.eo-title-r4 {
  --eo-title-c: #d97706;
  background:
    linear-gradient(180deg, rgba(240, 180, 41, 0.22), #fff 70%),
    #fff;
  box-shadow: 0 0 0 1px rgba(217, 119, 6, 0.22), 0 6px 18px rgba(240, 180, 41, 0.22);
}

.eo-title-focus.eo-title-r4 {
  animation: eo-title-pulse 2.2s ease-in-out infinite;
}

.eo-title-focus.eo-title-r4 .eo-title-text {
  text-shadow: 0 0 12px rgba(240, 180, 41, 0.25);
}

.eo-title-focus.eo-title-r4 .eo-title-fx {
  opacity: 0.85;
}

/* 5 传说 — 朱砂红，区别于史诗金 */
.eo-title-r5 {
  --eo-title-c: #b91c1c;
  background:
    linear-gradient(180deg, rgba(185, 28, 28, 0.14), #fff 72%),
    #fff;
  border: 1px solid #111;
  box-shadow:
    0 0 0 1px color-mix(in srgb, #b91c1c 35%, transparent),
    0 4px 14px rgba(185, 28, 28, 0.12);
}

.eo-title-focus.eo-title-r5 {
  animation: eo-title-pulse 1.8s ease-in-out infinite;
}

.eo-title-focus.eo-title-r5 .eo-title-text {
  background-image: linear-gradient(
    90deg,
    #7f1d1d,
    #b91c1c,
    #f0b429,
    #b91c1c,
    #7f1d1d
  );
  background-size: 300% 100%;
  animation: eo-title-flow 2.2s linear infinite;
}

.eo-title-focus.eo-title-r5 .eo-title-fx {
  opacity: 0.95;
  background-image: url('/title/assets/fx/sparkles.svg'), url('/title/assets/fx/glow.png');
  background-size: 100% 100%, cover;
  background-position: center, center;
  background-repeat: no-repeat;
}

.eo-title-focus.eo-title-r5::before {
  content: '';
  display: block;
  position: absolute;
  inset: 0;
  z-index: 0;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.35),
    transparent
  );
  background-size: 200% 100%;
  animation: eo-title-flow 2.8s linear infinite;
  pointer-events: none;
}

/* 图鉴页大号展示 */
.eo-title-badge.eo-title-lg {
  font-size: 15px;
  padding: 7px 14px 7px 12px;
  gap: 8px;
}

.eo-title-badge.eo-title-lg .eo-title-ico {
  width: 18px;
  height: 18px;
}

.eo-title-badge.eo-title-lg .eo-title-text {
  max-width: 16em;
}

/* 卡片 / 合成台内称号名 */
.tc-card .eo-title-badge,
.tc-recipe .eo-title-badge {
  margin-bottom: 4px;
  max-width: 100%;
}

.tc-card .eo-title-badge .eo-title-text {
  max-width: 9.5em;
  font-size: 12px;
}

@keyframes eo-ico-bob {
  0%, 100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-1px) scale(1.1); }
}

@keyframes eo-title-shine {
  0%, 20% { transform: translateX(-160%) skewX(-18deg); opacity: 0.2; }
  45% { opacity: 0.95; }
  70%, 100% { transform: translateX(260%) skewX(-18deg); opacity: 0.2; }
}

@keyframes eo-title-flow {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

@keyframes eo-title-pulse {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-1px); }
}

@media (prefers-reduced-motion: reduce) {
  .eo-title-badge,
  .eo-title-badge .eo-title-text,
  .eo-title-badge .eo-title-ico,
  .eo-title-badge::after,
  .eo-title-badge::before {
    animation: none !important;
  }
}

/* 兼容茶馆原有称号节点：挂上 eo-title-badge 后生效 */
.community-title-tag.eo-title-badge,
.bbs-left-title.eo-title-badge,
.user-title-tag.eo-title-badge,
.bbs-comment-level.eo-title-badge,
.community-codex-title.eo-title-badge,
.bbs-left-codex-title.eo-title-badge,
.user-codex-tag.eo-title-badge {
  font-size: 11px;
  padding: 2px 8px 2px 6px;
}

.community-codex-slot,
.bbs-left-codex-slot {
  display: flex;
  justify-content: center;
  margin-top: 6px;
}

.modal-user-codex[hidden],
.modal-user-codex-slot[hidden] {
  display: none !important;
}

.community-codex-title.eo-title-badge,
.bbs-left-codex-title.eo-title-badge,
.user-codex-tag.eo-title-badge {
  max-width: 100%;
  font-size: 11px;
  padding: 2px 8px 2px 6px;
  gap: 4px;
}

.community-codex-title.eo-title-badge .eo-title-ico,
.bbs-left-codex-title.eo-title-badge .eo-title-ico {
  width: 14px !important;
  height: 14px !important;
  max-width: 14px !important;
  max-height: 14px !important;
  flex: 0 0 14px !important;
  object-fit: contain !important;
}

/* 站外未标 lite/focus 时，默认轻量（避免全站卡顿） */
.eo-title-badge:not(.eo-title-focus):not(.eo-title-lite) .eo-title-ico {
  animation: none;
  filter: none;
}
.eo-title-badge:not(.eo-title-focus):not(.eo-title-lite) .eo-title-text {
  animation: none;
  background: none;
  color: var(--eo-title-c) !important;
}
.eo-title-badge:not(.eo-title-focus):not(.eo-title-lite)::after,
.eo-title-badge:not(.eo-title-focus):not(.eo-title-lite)::before {
  content: none;
  display: none;
}
.eo-title-badge:not(.eo-title-focus):not(.eo-title-lite) .eo-title-fx {
  display: none;
}
.eo-title-badge:not(.eo-title-focus):not(.eo-title-lite).eo-title-r3,
.eo-title-badge:not(.eo-title-focus):not(.eo-title-lite).eo-title-r4,
.eo-title-badge:not(.eo-title-focus):not(.eo-title-lite).eo-title-r5 {
  animation: none !important;
  filter: none !important;
}
