/* ===================== 评论飘屏弹幕 ===================== */

.dm-layer {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 46vh;
  overflow: hidden;
  pointer-events: none;
  z-index: 60;
  opacity: 0.92;
  transition: opacity 0.35s ease;
  contain: layout style;
}

.dm-layer.dm-dim {
  opacity: 0.14;
}

.dm-item {
  position: absolute;
  left: 0;
  top: 0;
  display: inline-flex;
  align-items: center;
  max-width: 78vw;
  padding: 5px 14px;
  border-radius: 999px;
  color: #fff;
  font-size: 14px;
  line-height: 1.45;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  background: rgba(24, 24, 30, 0.36);
  backdrop-filter: blur(7px);
  -webkit-backdrop-filter: blur(7px);
  box-shadow: 0 3px 12px rgba(0, 0, 0, 0.14);
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.45);
  will-change: transform;
}

.dm-item .dm-nick {
  flex: none;
  margin-right: 2px;
  color: #ffcd7a;
  font-weight: 600;
}

.dm-item .dm-text {
  overflow: hidden;
  text-overflow: ellipsis;
}

/* 右下角开关 */
.dm-toggle {
  position: fixed;
  left: 18px;
  bottom: 26px;
  z-index: 101;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 50%;
  background: rgba(32, 32, 40, 0.55);
  color: #fff;
  cursor: pointer;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.18);
  transition: transform 0.25s ease, background 0.25s ease, opacity 0.25s ease;
}

.dm-toggle:hover {
  transform: scale(1.08);
  background: rgba(50, 50, 60, 0.72);
}

.dm-toggle.is-off {
  opacity: 0.6;
}

.dm-toggle.is-off::after {
  content: "";
  position: absolute;
  width: 24px;
  height: 2px;
  border-radius: 2px;
  background: #ff6b6b;
  transform: rotate(-45deg);
}

/* 移动端：轨道更少、字号更小、避开底部 */
@media screen and (max-width: 768px) {
  .dm-layer {
    height: 32vh;
  }

  .dm-item {
    padding: 4px 11px;
    font-size: 12px;
    max-width: 86vw;
  }

  .dm-toggle {
    left: 12px;
    bottom: 18px;
    width: 36px;
    height: 36px;
  }
}
