/* 勋章插件前台样式 */
.badge-icons{
  display:inline-flex;
  align-items:center;
  gap:6px;
  vertical-align:middle;
  margin-left:4px;
  flex-wrap:wrap;
}
.badge-icons .badge-icon{
  display:inline-flex;
  align-items:center;
  line-height:0;
  flex:0 0 auto;
}
.badge-icons .badge-icon img{
  display:block;
  width:auto;
  height:auto;
  object-fit:contain;
}
.badge-icons-sm .badge-icon img{max-height:18px;max-width:48px}
.badge-icons-md .badge-icon img{max-height:24px;max-width:64px}
.badge-icons-lg .badge-icon img{max-height:48px;max-width:120px}
.badge-wear-row{margin:0;gap:8px}

.badge-panel .uc-panel-head,
.badge-detail-panel .uc-panel-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  margin-bottom:0;
  padding: 20px 22px 10px;
}
.badge-panel .uc-panel-head h2,
.badge-detail-panel .uc-panel-head h2{margin:0 0 4px;font-size: 17px;}
.badge-panel .uc-panel-head p,
.badge-detail-panel .uc-panel-head p{margin:0;color:var(--muted,#64748b);font-size:.9rem}

.badge-panel .badge-grid,
.badge-panel .badge-mine-grid,
.badge-panel .badge-section-title,
.badge-panel .badge-wear-row,
.badge-panel .badge-mine-stats,
.badge-panel .badge-stats-row,
.badge-panel > .empty,
.badge-detail-panel .badge-detail-hero{
  margin-left:24px;
  margin-right:24px;
}
.badge-panel .badge-grid{
  padding-bottom:24px;
  gap:16px;
}
.badge-panel .badge-mine-grid{padding-bottom:24px}
.badge-panel .badge-section-title{margin-top:4px;margin-bottom:12px}
.badge-panel .badge-mine-stats{
  margin-top:4px;
  margin-bottom:18px;
  gap:12px;
}
.badge-detail-panel .badge-detail-hero{padding-bottom:24px}

.badge-stats-row{display:flex;gap:12px;flex-wrap:wrap}
.badge-stat{
  flex:1;
  min-width:72px;
  padding:16px 14px;
  border-radius:12px;
  background:rgba(15,23,42,.04);
  text-align:center;
  box-sizing:border-box;
}
.badge-stat b{display:block;font-size:1.2rem;line-height:1.25;margin-bottom:6px}
.badge-stat span{font-size:.78rem;color:var(--muted,#64748b);line-height:1.3}

.badge-grid{
  display:grid;
  grid-template-columns:repeat(4, minmax(0, 1fr));
  gap:14px;
}
@media (max-width:1200px){
  .badge-grid{grid-template-columns:repeat(3, minmax(0, 1fr));}
}
@media (max-width:720px){
  .badge-grid{grid-template-columns:repeat(2, minmax(0, 1fr));}
}
.badge-card{
  display:flex;
  flex-direction:column;
  align-items:center;
  gap:12px;
  padding:18px;
  border:0;
  border-radius:14px;
  background:rgba(15,23,42,.03);
  text-decoration:none;
  color:inherit;
  text-align:center;
  cursor:pointer;
  font:inherit;
  width:100%;
  transition:background .15s ease, transform .15s ease, box-shadow .15s ease;
  position:relative;
  min-height:148px;
  box-sizing:border-box;
  appearance:none;
  -webkit-appearance:none;
}
.badge-card:hover{
  background:rgba(15,23,42,.055);
  transform:translateY(-1px);
}
.badge-card:focus-visible{
  outline:2px solid var(--accent,#0f172a);
  outline-offset:2px;
}
.badge-card-media{
  display:flex;
  align-items:center;
  justify-content:center;
  width:100%;
  min-height:72px;
  padding:4px 0;
  box-sizing:border-box;
}
.badge-card-icon{
  width:auto;
  height:auto;
  max-width:100%;
  max-height:88px;
  object-fit:contain;
  display:block;
  margin-left:auto;
  margin-right:auto;
}
.badge-card-body{
  min-width:0;
  width:100%;
  display:flex;
  flex-direction:column;
  align-items:center;
  gap:4px;
  text-align:center;
}
.badge-card-body strong{font-size:1rem;line-height:1.35}
.badge-card-desc{
  font-size:.84rem;
  color:var(--muted,#64748b);
  display:-webkit-box;
  -webkit-line-clamp:2;
  -webkit-box-orient:vertical;
  overflow:hidden;
  line-height:1.45;
  width:100%;
  text-align:center;
}
.badge-card-meta{font-size:.78rem;color:var(--muted,#94a3b8);margin-top:2px;text-align:center}
.badge-card-actions{
  display:flex;
  align-items:center;
  justify-content:center;
  flex-wrap:wrap;
  gap:8px;
  margin-top:10px;
  width:100%;
}
.badge-action-tip{font-size:.8rem;color:var(--muted,#94a3b8)}
.badge-pill{
  position:absolute;
  top:12px;
  right:12px;
  font-size:.72rem;
  font-style:normal;
  padding:3px 8px;
  border-radius:999px;
  background:#dcfce7;
  color:#166534;
}
.badge-pill.is-inline,
.badge-info-status .badge-pill{position:static}
.badge-pill.wait{background:#fef3c7;color:#92400e}
.badge-pill.manual{background:#e0e7ff;color:#3730a3}

/* 勋章信息弹窗 */
.badge-info-modal[hidden]{display:none!important}
.badge-info-modal.open{display:flex}
.badge-info-panel{
  width:min(420px,100%);
  text-align:left;
  padding:18px 20px 20px;
  display:flex;
  flex-direction:column;
  gap:14px;
  box-sizing:border-box;
}
.badge-info-head{
  display:flex;
  align-items:center;
  gap:12px;
  min-height:32px;
  padding-right:4px;
}
.badge-info-name{
  margin:0;
  flex:1;
  min-width:0;
  font-size:1.1rem;
  font-weight:750;
  line-height:1.35;
  text-align:left;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}
.badge-info-close{
  position:static;
  flex:0 0 auto;
  margin:0;
}
.badge-info-media{
  display:flex;
  align-items:center;
  justify-content:center;
  min-height:110px;
  margin:0;
  padding:14px;
  border-radius:14px;
  background:rgba(15,23,42,.04);
  box-sizing:border-box;
}
.badge-info-media img{
  max-width:160px;
  max-height:100px;
  width:auto;
  height:auto;
  object-fit:contain;
  display:block;
}
.badge-info-body{
  display:flex;
  flex-direction:column;
  gap:10px;
  min-width:0;
}
.badge-info-status{
  display:flex;
  align-items:center;
  flex-wrap:wrap;
  gap:8px;
  min-height:0;
}
.badge-info-status.is-empty{display:none}
.badge-info-desc{
  margin:0;
  color:var(--muted,#64748b);
  font-size:.9rem;
  line-height:1.55;
  white-space:pre-wrap;
}
.badge-info-meta{
  margin:0;
  font-size:.8rem;
  color:var(--muted,#94a3b8);
}
.badge-info-actions{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:10px;
  margin-top:6px;
  width:100%;
  align-items:stretch;
}
.badge-info-actions .badge-action-tip{
  display:flex;
  align-items:center;
  justify-content:center;
  min-height:38px;
  text-align:center;
  padding:0 8px;
  box-sizing:border-box;
}
.badge-info-actions .badge-info-btn,
.badge-info-actions .btn{
  width:100%;
  min-width:0;
  margin:0;
  justify-content:center;
  box-sizing:border-box;
  border-radius:12px;
}

.badge-section-title{margin:8px 0 12px;font-size:1rem}
.badge-mine-grid{display:flex;flex-direction:column;gap:10px}
.badge-mine-card{
  display:flex;
  align-items:center;
  gap:14px;
  padding:14px;
  border-radius:12px;
  background:rgba(15,23,42,.03);
}
.badge-mine-card > a,
.badge-mine-media{
  flex:0 0 auto;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-width:72px;
}
.badge-mine-card img{
  width:auto;
  height:auto;
  max-width:110px;
  max-height:64px;
  object-fit:contain;
  display:block;
}
.badge-mine-card > div{flex:1;min-width:0;display:flex;flex-direction:column;gap:2px}
.badge-mine-card span{font-size:.82rem;color:var(--muted,#64748b)}
.badge-mine-card .btn{flex:0 0 auto}
.badge-mine-card.is-pending{opacity:.85}

.badge-detail-hero{
  display:flex;
  gap:28px;
  align-items:center;
}
.badge-detail-media{
  flex:0 0 auto;
  display:flex;
  align-items:center;
  justify-content:center;
  min-width:120px;
  padding:8px;
}
.badge-detail-icon{
  width:auto;
  height:auto;
  max-width:240px;
  max-height:180px;
  object-fit:contain;
  display:block;
}
.badge-detail-body{min-width:0;flex:1}
.badge-detail-hero h1{margin:0 0 8px;font-size:1.45rem}
.badge-detail-hero p{margin:0 0 12px;color:var(--muted,#64748b);line-height:1.55}
.badge-detail-meta{
  display:flex;
  flex-wrap:wrap;
  gap:10px;
  margin-bottom:10px;
  font-size:.88rem;
  color:var(--muted,#64748b);
}
.badge-cond-tip{font-size:.88rem}
.badge-detail-actions{display:flex;flex-wrap:wrap;gap:8px;margin-top:14px}
.badge-detail-actions .disabled{pointer-events:none;opacity:.65}

/* 右侧勋章专用栏 */
.badge-aside{display:flex;flex-direction:column;gap:14px}
.badge-aside .aside-card{margin:0}
.badge-member-card{padding:16px}
.badge-member-head{
  display:flex;
  align-items:center;
  gap:12px;
  margin-bottom:12px;
}
.badge-member-avatar{
  width:48px;
  height:48px;
  border-radius:50%;
  object-fit:cover;
  flex:0 0 auto;
  background:#e2e8f0;
}
.badge-member-who{min-width:0;display:flex;flex-direction:column;gap:2px}
.badge-member-who strong{font-size:1rem;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.badge-member-who span{font-size:.8rem;color:var(--muted,#64748b)}
.badge-member-coins{
  display:flex;
  gap:12px;
  margin-bottom:12px;
  font-size:.84rem;
  color:var(--muted,#64748b);
}
.badge-member-coins b{color:inherit}
.badge-aside-stats{margin-bottom:0}
.badge-member-guest strong{display:block;margin-bottom:6px;font-size:1rem}
.badge-member-guest p{
  margin:0 0 12px;
  font-size:.86rem;
  color:var(--muted,#64748b);
  line-height:1.5;
}

/* 最近颁发：头像 + 两行文案，自动向上滚动（紧凑） */
.badge-grant-card{padding:14px}
.badge-grant-card .sec-head{margin-bottom:10px}
.badge-grant-marquee{
  height:260px;
  overflow:hidden;
  position:relative;
  mask-image:linear-gradient(180deg,transparent,#000 8%,#000 92%,transparent);
  -webkit-mask-image:linear-gradient(180deg,transparent,#000 8%,#000 92%,transparent);
}
.badge-grant-track{
  display:flex;
  flex-direction:column;
  width:100%;
  animation:badge-grant-up 24s linear infinite;
  will-change:transform;
}
.badge-grant-marquee:hover .badge-grant-track{animation-play-state:paused}
.badge-grant-marquee.is-static .badge-grant-track{animation:none}
.badge-grant-list{
  list-style:none;
  margin:0;
  padding:0;
  flex:0 0 auto;
}
.badge-grant-list li{
  display:block;
  padding:0;
  margin:0 0 15px;
  box-sizing:border-box;
  min-height:0;
  background:transparent;
  border-radius:0;
}
.badge-grant-list li:last-child{margin-bottom:15px}
.badge-grant-line{
  display:grid;
  grid-template-columns:35px minmax(0,1fr);
  grid-template-rows:auto auto;
  column-gap:8px;
  row-gap:1px;
  align-items:center;
  width:100%;
  padding:0;
  background:transparent;
  box-sizing:border-box;
}
.badge-grant-avatar-wrap{
  grid-row:1 / span 2;
  grid-column:1;
  align-self:center;
  width:35px;
  height:35px;
  border-radius:50%;
  overflow:hidden;
  background:#e2e8f0;
}
.badge-grant-avatar{
  display:block;
  width:100%;
  height:100%;
  object-fit:cover;
  border-radius:50%;
}
.badge-grant-body{
  display:contents;
}
.badge-grant-top{
  grid-column:2;
  grid-row:1;
  display:flex;
  align-items:center;
  gap:6px;
  min-width:0;
}
.badge-grant-who{
  flex:1;
  min-width:0;
  font-size:.8rem;
  font-weight:650;
  line-height:1.2;
  color:var(--text-soft,#334155);
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}
.badge-grant-time{
  flex:0 0 auto;
  margin:0;
  font-size:.62rem;
  font-weight:400;
  line-height:1.2;
  color:var(--muted,#94a3b8);
  white-space:nowrap;
}
.badge-grant-act{
  grid-column:2;
  grid-row:2;
  display:block;
  min-width:0;
  font-size:.72rem;
  font-weight:400;
  line-height:1.2;
  color:var(--muted,#64748b);
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}
@keyframes badge-grant-up{
  from{transform:translateY(0)}
  to{transform:translateY(-50%)}
}

.badge-rank-list,.badge-top-list{list-style:none;margin:0;padding:0}
.badge-rank-list li{
  display:flex;
  align-items:center;
  gap:10px;
  padding:10px 0;
  border-bottom:1px solid rgba(15,23,42,.06);
}
.badge-rank-list li:last-child{border-bottom:0}
.badge-rank-list img{
  width:auto;
  height:auto;
  max-width:42px;
  max-height:28px;
  object-fit:contain;
  flex:0 0 auto;
}
.badge-rank-list > li > div{min-width:0;flex:1}
.badge-rank-list strong{display:block;font-size:.9rem}
.badge-rank-list span,.badge-rank-list em{
  display:block;
  font-size:.76rem;
  color:var(--muted,#64748b);
  font-style:normal;
}
.badge-top-list li{
  display:flex;
  align-items:center;
  gap:10px;
  padding:10px 0;
  border-bottom:1px solid rgba(15,23,42,.06);
}
.badge-top-list li:last-child{border-bottom:0}
.badge-top-rank{
  width:22px;
  height:22px;
  border-radius:6px;
  background:rgba(15,23,42,.06);
  display:inline-flex;
  align-items:center;
  justify-content:center;
  font-size:.75rem;
  flex:0 0 auto;
}
.badge-top-rank.is-top{background:#fef3c7;color:#92400e;font-weight:600}
.badge-top-list a{
  flex:1;
  min-width:0;
  text-decoration:none;
  color:inherit;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}
.badge-top-list b{
  font-size:.88rem;
  flex:0 0 auto;
  color:var(--muted,#64748b);
}
.empty-inline{color:var(--muted,#94a3b8);font-size:.88rem;padding:8px 0;list-style:none}

@media (max-width:960px){
  .badge-aside{width:100%;max-width:none}
  .badge-panel .uc-panel-head{flex-direction:column;align-items:flex-start}
}
@media (max-width:720px){
  .badge-detail-hero{flex-direction:column;align-items:flex-start}
  .badge-panel .uc-panel-head{flex-direction:column;align-items:flex-start}
}
