/* emlog 弹幕互动表态 — 前台样式 */

.dm-react-wrap {
  margin: 14px 0 18px;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "PingFang SC", "Microsoft YaHei", sans-serif;
  --dm-bg: #faf7f2;
  --dm-stage: #0f172a;
  --dm-accent: #7c3aed;
}
.dm-react-inner {
  background: linear-gradient(180deg, #fffefb 0%, var(--dm-bg) 100%);
  border-radius: 14px;
  padding: 12px 12px 10px;
  box-shadow: 0 4px 18px rgba(15, 23, 42, 0.06), 0 1px 0 rgba(255, 255, 255, 0.8) inset;
  border: 1px solid rgba(226, 232, 240, 0.9);
}

.dm-stage-head {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  margin-bottom: 8px;
}

.dm-stage-title {
  font-weight: 700;
  font-size: 14px;
  color: #334155;
  letter-spacing: 0.04em;
}

/* 外层：弹幕开/关时切换高度，避免整块区域过高 */
.dm-stage-shell {
  position: relative;
  border-radius: 12px;
  overflow: hidden;
}

.dm-stage {
  position: relative;
  height: 100px;
  background: radial-gradient(ellipse at 30% 20%, rgba(124, 58, 237, 0.15), transparent 55%),
    linear-gradient(145deg, #1e293b 0%, #0f172a 100%);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06);
}

/* 舞台右上角：两个按钮横排 */
.dm-stage-controls {
  position: absolute;
  top: 6px;
  right: 8px;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 5px;
  pointer-events: auto;
  background: rgba(15, 23, 42, 0.7);
  border-radius: 8px;
  padding: 2px 6px;
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
}

/* 自动滚动胶囊 */
.dm-auto-scroll-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin: 0;
  padding: 4px 8px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  background: rgba(15, 23, 42, 0.55);
  color: #f8fafc;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.02em;
  line-height: 1.2;
  cursor: pointer;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
  transition: background 0.15s ease, border-color 0.15s ease;
  white-space: nowrap;
}

.dm-auto-scroll-pill input {
  width: 11px;
  height: 11px;
  accent-color: #a78bfa;
  cursor: pointer;
  margin: 0;
  padding: 0;
  vertical-align: middle;
}

.dm-auto-scroll-txt {
  pointer-events: none;
}

/* 自动滚动关闭时：胶囊变灰提示可暂停 */
.dm-react-wrap:not(.dm-auto-scroll-on) .dm-auto-scroll-pill {
  background: rgba(100, 116, 139, 0.5);
  border-color: rgba(148, 163, 184, 0.35);
}

/* 悬停暂停按钮 */
.dm-hover-pause-btn {
  position: static;
  margin: 0;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  background: rgba(15, 23, 42, 0.55);
  color: #f8fafc;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
  line-height: 1.2;
  cursor: default;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
  transition: background 0.15s ease, border-color 0.15s ease;
  pointer-events: auto;
}

.dm-hover-pause-btn:hover,
.dm-hover-pause-btn:focus-visible {
  background: rgba(30, 41, 59, 0.85);
  border-color: rgba(255, 255, 255, 0.4);
  outline: none;
}

.dm-hover-pause-btn:focus-visible {
  box-shadow: 0 0 0 2px rgba(167, 139, 250, 0.45);
}

/* 自动滚动开启时，悬停暂停按钮不可用（鼠标变为默认） */
.dm-react-wrap.dm-auto-scroll-on .dm-hover-pause-btn {
  cursor: default;
  opacity: 0.6;
}

/* 舞台暂停状态 */
.dm-stage.dm-paused .dm-bullet {
  animation-play-state: paused !important;
}

/* 关闭整个弹幕模块 */
.dm-react-wrap.dm-panel-hidden > .dm-react-inner {
  display: none;
}

.dm-panel-reopen {
  padding: 8px 12px 0;
}

.dm-btn-show-panel {
  width: 100%;
  padding: 10px 16px;
  border: 1px dashed #cbd5e1;
  border-radius: 10px;
  background: #f8fafc;
  color: #64748b;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.05);
  transition: background 0.15s ease, border-color 0.15s ease;
  -webkit-tap-highlight-color: transparent;
}

.dm-btn-show-panel:hover {
  background: #fff;
  border-color: #94a3b8;
  color: #475569;
}

.dm-btn-show-panel:focus-visible {
  outline: 2px solid #a78bfa;
  outline-offset: 2px;
}

.dm-bullet {
  --dm-react: #7c3aed;
  position: absolute;
  right: -12px;
  display: flex;
  align-items: center;
  gap: 5px;
  max-width: min(96%, 720px);
  padding: 3px 5px 3px 7px;
  border-radius: 999px;
  font-size: 12px;
  line-height: 1.3;
  background: rgba(15, 23, 42, 0.55);
  color: #f8fafc;
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
  /* 动画完全由 JS requestAnimationFrame 驱动，避免 transform 被 overflow:hidden 截不断 */
  overflow: hidden;
}

.dm-bullet-track {
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: 5px;
  min-width: 0;
  flex: 1 1 auto;
}

.dm-b-avatar {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  border: 1px solid rgba(255, 255, 255, 0.35);
  background: rgba(148, 163, 184, 0.35);
}

.dm-bullet.dm-vip .dm-b-avatar {
  border-color: rgba(167, 139, 250, 0.75);
}

.dm-b-left {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.dm-b-emoji {
  font-size: 1.05em;
  line-height: 1;
}

.dm-b-label {
  font-weight: 700;
  white-space: nowrap;
}

.dm-b-name {
  font-size: 0.92em;
  font-weight: 500;
  color: rgba(248, 250, 252, 0.72);
  white-space: nowrap;
  flex-shrink: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 6.5em;
}

.dm-b-msg {
  font-size: 0.92em;
  color: rgba(248, 250, 252, 0.88);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1 1 auto;
  min-width: 0;
  max-width: min(52vw, 36em);
}

.dm-b-like {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 2px;
  margin: 0;
  padding: 2px 6px 2px 5px;
  border: none;
  border-radius: 999px;
  background: rgba(254, 226, 226, 0.95);
  color: #b91c1c;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  line-height: 1.2;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
  -webkit-tap-highlight-color: transparent;
}

.dm-b-like:hover {
  filter: brightness(0.97);
}

.dm-b-heart {
  font-size: 11px;
  line-height: 1;
}

.dm-b-like-n {
  font-variant-numeric: tabular-nums;
  min-width: 0.6em;
}

.dm-react-wrap.dm-no-color .dm-bullet {
  background: rgba(30, 41, 59, 0.75);
  border-color: rgba(148, 163, 184, 0.35);
}

.dm-react-wrap.dm-no-color .dm-bullet.dm-vip {
  background: #fff;
  border-color: #c4b5fd;
}

.dm-react-wrap.dm-big .dm-bullet {
  font-size: 14px;
  padding: 4px 6px 4px 9px;
}

.dm-react-wrap.dm-big .dm-b-like {
  font-size: 14px;
  padding: 4px 10px;
}

/* VIP 专属弹幕：白底 + 彩色描边（与参考图一致） */
.dm-bullet.dm-vip {
  background: #fff !important;
  color: #1e293b;
  border-width: 2px;
  border-color: var(--dm-react, #7c3aed);
  box-shadow: 0 2px 14px rgba(124, 58, 237, 0.35), 0 0 0 1px rgba(255, 255, 255, 0.06) inset;
}

.dm-bullet.dm-vip .dm-b-emoji,
.dm-bullet.dm-vip .dm-b-label {
  color: var(--dm-react, #7c3aed);
}

.dm-bullet.dm-vip .dm-b-name {
  color: #64748b;
}

.dm-bullet.dm-vip .dm-b-msg {
  color: #475569;
}

.dm-react-wrap.dm-no-vipfx .dm-bullet.dm-vip {
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.08);
}

.dm-react-wrap:not(.dm-no-vipfx) .dm-bullet.dm-vip {
  animation-name: dm-pulse;
  animation-duration: 2.2s;
  animation-timing-function: ease-in-out;
  animation-iteration-count: infinite;
}

@keyframes dm-pulse {
  0%,
  100% {
    filter: brightness(1);
  }
  50% {
    filter: brightness(1.25);
  }
}

/* 情绪雷达：顶栏可点击展开/收起 */
.dm-radar-block {
  margin-top: 8px;
  padding: 0;
  background: transparent;
  border: none;
  box-shadow: none;
}

.dm-radar-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  margin: 0;
  padding: 8px 10px;
  text-align: left;
  font: inherit;
  cursor: pointer;
  border-radius: 10px;
  border: 1px solid rgba(220, 212, 200, 0.95);
  background: linear-gradient(180deg, #fdfaf5 0%, #f5f0e8 100%);
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
  transition: background 0.15s ease, box-shadow 0.15s ease;
  -webkit-tap-highlight-color: transparent;
}

.dm-radar-bar:hover {
  background: linear-gradient(180deg, #fffefb 0%, #faf6ef 100%);
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.07);
}

.dm-radar-bar:focus {
  outline: 2px solid #a78bfa;
  outline-offset: 2px;
}

.dm-radar-name {
  font-weight: 700;
  font-size: 13px;
  color: #3d3429;
  letter-spacing: 0.04em;
}

.dm-radar-toggle-icon {
  flex: 0 0 auto;
  width: 26px;
  height: 26px;
  border-radius: 8px;
  background: #e8e4dc;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.65);
}

.dm-radar-toggle-icon::before {
  content: '';
  display: block;
  width: 0;
  height: 0;
  border-style: solid;
  border-width: 5px 0 5px 7px;
  border-color: transparent transparent transparent #52525b;
  margin-left: 2px;
  transition: transform 0.2s ease;
}

.dm-radar-block:not(.dm-radar-collapsed) .dm-radar-toggle-icon::before {
  transform: rotate(90deg);
  margin-left: 0;
}

.dm-radar-panel {
  margin-top: 6px;
  padding: 10px 10px 8px;
  background: linear-gradient(180deg, #fffdfb 0%, #f8f4ee 100%);
  border-radius: 12px;
  border: 1px solid rgba(226, 220, 210, 0.95);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.dm-radar-block.dm-radar-collapsed .dm-radar-panel {
  display: none;
}

.dm-radar-head {
  display: flex;
  align-items: baseline;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(226, 232, 240, 0.85);
}

.dm-radar-summary {
  font-size: 12px;
  color: #64748b;
}

.dm-radar-layout {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: center;
  gap: 14px 18px;
}

.dm-radar-err {
  margin: 0 0 10px;
  padding: 8px 10px;
  font-size: 13px;
  color: #b91c1c;
  background: #fef2f2;
  border-radius: 8px;
  border: 1px solid #fecaca;
}

.dm-radar-chart-wrap {
  flex: 0 0 auto;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.7);
  padding: 6px;
  box-shadow: 0 2px 12px rgba(15, 23, 42, 0.06);
}

.dm-radar-canvas {
  display: block;
  max-width: 100%;
  height: auto;
  vertical-align: middle;
}

.dm-radar-legend {
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: 12px;
  color: #475569;
  min-width: 140px;
}

.dm-radar-legend li {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 3px 0;
  border-bottom: 1px dashed rgba(226, 232, 240, 0.9);
}

.dm-lg-l {
  font-weight: 600;
  color: #334155;
}

.dm-lg-r {
  color: #64748b;
  font-variant-numeric: tabular-nums;
}

.dm-quick {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 8px;
  margin-top: 8px;
  padding-bottom: 10px;
  overflow: visible;
  position: relative;
  z-index: 0;
}

.dm-qbtn {
  --dm-q-accent: #64748b;
  position: relative;
  border: 1px solid rgba(255, 255, 255, 0.42);
  cursor: pointer;
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 13px;
  font-weight: 600;
  color: #fff;
  box-shadow: 0 2px 10px rgba(15, 23, 42, 0.1);
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease, filter 0.18s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.dm-qbtn-inner {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  pointer-events: none;
}

.dm-q-emoji {
  font-size: 1.05em;
  line-height: 1;
}

.dm-qbtn-tip {
  position: absolute;
  left: 50%;
  top: calc(100% + 6px);
  transform: translateX(-50%) translateY(2px);
  margin: 0;
  padding: 5px 10px;
  font-size: 12px;
  font-weight: 600;
  color: #334155;
  background: #fff;
  border-radius: 6px;
  border: 1px solid rgba(226, 232, 240, 0.95);
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.12);
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.16s ease, transform 0.16s ease, visibility 0.16s;
  z-index: 20;
}

@media (hover: hover) {
  .dm-qbtn:hover:not(:disabled) {
    transform: scale(1.05);
    z-index: 5;
    border-color: var(--dm-q-accent);
    box-shadow: 0 8px 22px rgba(15, 23, 42, 0.18), 0 0 0 1px var(--dm-q-accent);
    filter: brightness(1.03);
  }

  .dm-qbtn:hover:not(:disabled) .dm-qbtn-tip {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
  }
}

.dm-qbtn:focus-visible:not(:disabled) {
  outline: none;
  transform: scale(1.05);
  z-index: 5;
  border-color: var(--dm-q-accent);
  box-shadow: 0 8px 22px rgba(15, 23, 42, 0.18), 0 0 0 2px rgba(255, 255, 255, 0.85), 0 0 0 4px var(--dm-q-accent);
}

.dm-qbtn:focus-visible:not(:disabled) .dm-qbtn-tip {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

.dm-qbtn:active:not(:disabled) {
  transform: scale(0.98);
  filter: brightness(0.97);
}

.dm-qbtn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
  filter: none;
}

.dm-qbtn:disabled .dm-qbtn-tip {
  display: none;
}

.dm-custom-row {
  display: flex;
  align-items: stretch;
  gap: 8px;
  margin-top: 8px;
  flex-wrap: nowrap;
}

.dm-vip-badge {
  flex: 0 0 auto;
  align-self: center;
  background: linear-gradient(180deg, #f39c3d, #e67e22);
  color: #fff;
  font-weight: 800;
  font-size: 10px;
  padding: 6px 8px;
  border-radius: 6px;
  letter-spacing: 0.04em;
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.08);
}

.dm-custom-input {
  flex: 1 1 auto;
  min-width: 0;
  border-radius: 8px;
  border: 1px solid #e8e0d8;
  padding: 7px 10px;
  font-size: 13px;
  background: #fff;
  box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.04);
}

.dm-send-btn {
  flex: 0 0 auto;
  border: none;
  border-radius: 8px;
  padding: 7px 16px;
  font-weight: 700;
  color: #fff;
  background: #4a5d4e;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(74, 93, 78, 0.35);
  touch-action: manipulation;
}

.dm-send-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.dm-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.dm-toolbar {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid rgba(232, 224, 214, 0.95);
  font-size: 12px;
  color: #475569;
}

.dm-toolbar-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 8px;
}

.dm-btn-close-dm {
  flex: 0 0 auto;
  padding: 5px 10px;
  font-size: 12px;
  font-weight: 600;
  color: #334155;
  background: #fff;
  border: 1px solid #dcd4c8;
  border-radius: 8px;
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.05);
  transition: background 0.15s ease, border-color 0.15s ease;
}

.dm-btn-close-dm:hover {
  background: #faf8f5;
  border-color: #cfc4b8;
}

.dm-style-box {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  padding: 5px 10px;
  background: #f3ece4;
  border: 1px solid #e5dcd2;
  border-radius: 8px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.65);
}

.dm-style-item {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  user-select: none;
  font-size: 12px;
  color: #334155;
  margin: 0;
  font-weight: 500;
}

.dm-style-item input {
  width: 16px;
  height: 16px;
  accent-color: #2563eb;
  cursor: pointer;
}

.dm-member-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 5px 12px;
  font-size: 12px;
  font-weight: 600;
  color: #475569;
  background: #fff;
  border: 1px solid #e0d8ce;
  border-radius: 999px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
  min-height: 30px;
  white-space: nowrap;
}

.dm-member-pill.dm-pill-vip {
  color: #7c3aed;
  border-color: #ddd6fe;
  background: linear-gradient(180deg, #faf5ff 0%, #fff 100%);
}

.dm-clear-admin {
  margin-left: auto;
  border: none;
  border-radius: 8px;
  padding: 5px 10px;
  font-size: 12px;
  font-weight: 600;
  color: #fff;
  background: #a94442;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(169, 68, 66, 0.25);
}

.dm-clear-admin:hover {
  background: #953a38;
}

.dm-toolbar-login-hint {
  margin-left: auto;
  font-size: 12px;
  color: #64748b;
  line-height: 1.45;
  padding: 2px 0;
}

.dm-hint-login,
.dm-hint-deny {
  margin: 10px 0 0;
  font-size: 13px;
  color: #64748b;
}

.dm-hint-vip-link {
  margin: 8px 0 0;
  font-size: 13px;
}

.dm-hint-vip-link a {
  color: #7c3aed;
  font-weight: 600;
}

.dm-extra-buy {
  margin-top: 12px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.dm-buy-extra {
  border: 1px solid #cbd5e1;
  background: #fff;
  border-radius: 10px;
  padding: 8px 14px;
  font-size: 13px;
  cursor: pointer;
}

.dm-buy-meta {
  font-size: 12px;
  color: #94a3b8;
}

@media (max-width: 640px) {
  .dm-stage {
    height: 100px;
  }
  .dm-stage-controls {
    top: 5px;
    right: 5px;
    gap: 4px;
  }
  .dm-auto-scroll-pill {
    padding: 3px 6px;
    font-size: 9px;
  }
  .dm-hover-pause-btn {
    padding: 3px 8px;
    font-size: 10px;
  }
  .dm-qbtn {
    padding: 8px 14px;
    font-size: 14px;
    min-height: 40px;
  }
  .dm-custom-row {
    flex-wrap: wrap;
  }
  .dm-send-btn {
    min-height: 44px;
    padding-left: 20px;
    padding-right: 20px;
  }
  .dm-custom-input {
    font-size: 16px; /* 避免 iOS 缩放 */
    min-width: 140px;
  }
  .dm-toolbar-row {
    flex-direction: column;
    align-items: stretch;
  }
  .dm-toolbar-login-hint {
    margin-left: 0;
    order: 5;
  }
  .dm-clear-admin {
    margin-left: 0;
    width: 100%;
    padding: 12px;
  }
  .dm-member-pill {
    justify-content: flex-start;
    width: 100%;
  }
  .dm-panel-reopen {
    padding: 6px 0 0;
  }
}

/* 关闭弹幕时隐藏整个 dm-react-inner，显示 dm-panel-reopen */
