/**
 * 弹幕系统样式
 * vd-dm- 前缀命名
 */

/* ==================== 弹幕面板容器 ==================== */
.vd-dm-panel {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 9;
    pointer-events: none;
    transition: opacity 0.25s;
}

/* 有弹出层展开时提升层级，覆盖 action-bar(12) 和 bottom-info(11) */
.vd-dm-panel.vd-dm-popup-open {
    z-index: 13;
}

.vd-dm-panel.vd-dm-hidden {
    opacity: 0;
    pointer-events: none !important;
}

/* ==================== 底部发送栏 ==================== */
.vd-dm-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    pointer-events: auto;
    background: linear-gradient(transparent, rgba(0,0,0,0.6));
}

/* 弹幕开关 */
.vd-dm-toggle {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    cursor: pointer;
    color: #fff;
    font-size: 18px;
    transition: all 0.2s;
    position: relative;
}

.vd-dm-toggle:hover {
    background: rgba(255,255,255,0.15);
}

.vd-dm-toggle.vd-dm-off {
    color: rgba(255,255,255,0.4);
}

.vd-dm-toggle.vd-dm-off::after {
    content: '';
    position: absolute;
    width: 22px;
    height: 2px;
    background: rgba(255,255,255,0.5);
    transform: rotate(-45deg);
    border-radius: 1px;
}

/* 弹幕数量 */
.vd-dm-count {
    flex-shrink: 0;
    font-size: 12px;
    color: rgba(255,255,255,0.5);
    min-width: 20px;
}

/* 在线人数 */
.vd-dm-online {
    flex-shrink: 0;
    font-size: 12px;
    color: rgba(255,255,255,0.45);
    display: flex;
    align-items: center;
    gap: 2px;
}

.vd-dm-online i {
    font-size: 14px;
}

.vd-dm-online em {
    font-style: normal;
}

/* 输入框容器 */
.vd-dm-input-wrap {
    flex: 1;
    position: relative;
    display: flex;
    align-items: center;
    height: 36px;
    background: rgba(255,255,255,0.12);
    border-radius: 18px;
    padding: 0 4px 0 12px;
    transition: all 0.2s;
    border: 1px solid transparent;
}

.vd-dm-input-wrap:focus-within {
    background: rgba(255,255,255,0.18);
    border-color: rgba(255,255,255,0.2);
}

.vd-dm-input-wrap input {
    flex: 1;
    min-width: 0;
    background: none;
    border: none;
    outline: none;
    color: #fff;
    font-size: 13px;
    padding: 0;
    line-height: 36px;
}

.vd-dm-input-wrap input::placeholder {
    color: rgba(255,255,255,0.4);
}

/* 颜色预览点 */
.vd-dm-color-dot {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #fff;
    cursor: pointer;
    flex-shrink: 0;
    margin-right: 8px;
    border: 2px solid rgba(255,255,255,0.3);
    transition: transform 0.15s;
}

.vd-dm-color-dot:hover {
    transform: scale(1.15);
}

/* 发送按钮（在输入框内部右侧） */
.vd-dm-send {
    flex-shrink: 0;
    height: 28px;
    padding: 0 14px;
    border-radius: 14px;
    background: transparent;
    color: rgba(255,255,255,0.35);
    font-size: 13px;
    border: none;
    cursor: not-allowed;
    transition: all 0.2s;
    margin-left: 4px;
}

.vd-dm-send.vd-dm-active {
    background: var(--ls-color-primary, #4F8EF7);
    color: #fff;
    cursor: pointer;
}

.vd-dm-send.vd-dm-active:hover {
    filter: brightness(1.1);
}

/* 设置按钮 */
.vd-dm-settings-btn {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    cursor: pointer;
    color: rgba(255,255,255,0.6);
    font-size: 18px;
    transition: all 0.2s;
}

.vd-dm-settings-btn:hover {
    color: #fff;
    background: rgba(255,255,255,0.15);
}

/* ==================== 颜色选择器弹出层 ==================== */
.vd-dm-color-picker {
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%) scale(0.9);
    background: rgba(28,28,32,0.95);
    backdrop-filter: blur(12px);
    border-radius: 12px;
    padding: 14px;
    opacity: 0;
    pointer-events: none;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 8px 32px rgba(0,0,0,0.4);
    min-width: 220px;
    z-index: 30;
}

.vd-dm-color-picker.vd-dm-show {
    opacity: 1;
    pointer-events: auto;
    transform: translateX(-50%) scale(1);
    z-index: 50;
}

.vd-dm-color-picker::after {
    content: '';
    position: absolute;
    bottom: -6px;
    left: 50%;
    transform: translateX(-50%) rotate(45deg);
    width: 12px;
    height: 12px;
    background: rgba(28,28,32,0.95);
}

.vd-dm-color-title {
    font-size: 12px;
    color: rgba(255,255,255,0.5);
    margin-bottom: 10px;
}

.vd-dm-color-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.vd-dm-color-item {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.15s;
    border: 2px solid transparent;
    position: relative;
}

.vd-dm-color-item:hover {
    transform: scale(1.2);
}

.vd-dm-color-item.vd-dm-selected {
    border-color: #fff;
    box-shadow: 0 0 0 2px rgba(255,255,255,0.3);
}

/* VIP 专属标识 */
.vd-dm-color-item.vd-dm-vip-only::after {
    content: '';
    position: absolute;
    top: -2px;
    right: -2px;
    width: 8px;
    height: 8px;
    background: linear-gradient(135deg, #FFD700, #FFA500);
    border-radius: 50%;
    border: 1px solid rgba(28,28,32,0.95);
}

/* 弹幕模式选择 */
.vd-dm-mode-row {
    display: flex;
    gap: 6px;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid rgba(255,255,255,0.08);
}

.vd-dm-mode-item {
    flex: 1;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    cursor: pointer;
    color: rgba(255,255,255,0.5);
    font-size: 16px;
    transition: all 0.15s;
    background: rgba(255,255,255,0.06);
}

.vd-dm-mode-item:hover {
    background: rgba(255,255,255,0.12);
    color: rgba(255,255,255,0.8);
}

.vd-dm-mode-item.vd-dm-selected {
    background: var(--ls-color-primary, #4F8EF7);
    color: #fff;
}

/* ==================== 设置面板 ==================== */
.vd-dm-settings {
    position: absolute;
    bottom: calc(100% + 8px);
    right: 16px;
    background: rgba(28,28,32,0.95);
    backdrop-filter: blur(12px);
    border-radius: 12px;
    padding: 16px 18px;
    opacity: 0;
    pointer-events: none;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    transform: translateY(8px);
    box-shadow: 0 8px 32px rgba(0,0,0,0.4);
    width: 260px;
    z-index: 30;
}

.vd-dm-settings.vd-dm-show {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
    z-index: 50;
}

.vd-dm-settings-title {
    font-size: 13px;
    font-weight: 600;
    color: #fff;
    margin-bottom: 14px;
}

/* 设置项 */
.vd-dm-setting-item {
    margin-bottom: 14px;
}

.vd-dm-setting-item:last-child {
    margin-bottom: 0;
}

.vd-dm-setting-label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.vd-dm-setting-name {
    font-size: 12px;
    color: rgba(255,255,255,0.7);
}

.vd-dm-setting-value {
    font-size: 12px;
    color: rgba(255,255,255,0.4);
    min-width: 36px;
    text-align: right;
}

/* 滑块 */
.vd-dm-slider {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 4px;
    border-radius: 2px;
    background: rgba(255,255,255,0.15);
    outline: none;
    cursor: pointer;
}

.vd-dm-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #fff;
    cursor: pointer;
    box-shadow: 0 1px 4px rgba(0,0,0,0.3);
    transition: transform 0.1s;
}

.vd-dm-slider::-webkit-slider-thumb:hover {
    transform: scale(1.2);
}

.vd-dm-slider::-moz-range-thumb {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #fff;
    cursor: pointer;
    border: none;
    box-shadow: 0 1px 4px rgba(0,0,0,0.3);
}

/* 区域选择按钮组 */
.vd-dm-area-btns {
    display: flex;
    gap: 6px;
}

.vd-dm-area-btn {
    flex: 1;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    cursor: pointer;
    font-size: 11px;
    color: rgba(255,255,255,0.5);
    background: rgba(255,255,255,0.06);
    transition: all 0.15s;
}

.vd-dm-area-btn:hover {
    background: rgba(255,255,255,0.12);
    color: rgba(255,255,255,0.8);
}

.vd-dm-area-btn.vd-dm-selected {
    background: var(--ls-color-primary, #4F8EF7);
    color: #fff;
}

/* ==================== 弹幕面板显示 ==================== */
.vd-dm-bar {
    opacity: 1;
    z-index: 12;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* 输入框聚焦时保持显示 */
.vd-dm-bar:focus-within {
    opacity: 1;
    z-index: 12;
}

/* ==================== 弹幕信息弹窗 ==================== */
.vd-dm-popover {
    position: fixed;
    z-index: 9999;
    background: rgba(28,28,32,0.96);
    backdrop-filter: blur(16px);
    border-radius: 12px;
    padding: 14px 16px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.5);
    min-width: 220px;
    max-width: 300px;
    opacity: 0;
    transform: scale(0.92);
    transition: opacity 0.18s, transform 0.18s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
}

.vd-dm-popover.vd-dm-show {
    opacity: 1;
    transform: scale(1);
    pointer-events: auto;
}

/* 用户信息行 */
.vd-dm-pop-user {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.vd-dm-pop-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.vd-dm-pop-name {
    font-size: 13px;
    font-weight: 600;
    color: #fff;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
    min-width: 0;
}

.vd-dm-pop-vip {
    flex-shrink: 0;
}

/* 弹幕内容 */
.vd-dm-pop-content {
    font-size: 13px;
    color: rgba(255,255,255,0.85);
    line-height: 1.5;
    word-break: break-word;
    margin-bottom: 10px;
    padding: 8px 10px;
    background: rgba(255,255,255,0.06);
    border-radius: 6px;
}

/* 弹幕元信息 */
.vd-dm-pop-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 11px;
    color: rgba(255,255,255,0.4);
    margin-bottom: 10px;
}

.vd-dm-pop-meta i {
    font-size: 12px;
    margin-right: 2px;
}

/* 操作按钮行 */
.vd-dm-pop-actions {
    display: flex;
    gap: 6px;
    padding-top: 10px;
    border-top: 1px solid rgba(255,255,255,0.08);
}

.vd-dm-pop-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    height: 30px;
    border-radius: 6px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.15s;
    border: none;
    outline: none;
    background: rgba(255,255,255,0.08);
    color: rgba(255,255,255,0.7);
}

.vd-dm-pop-btn:hover {
    background: rgba(255,255,255,0.15);
    color: #fff;
}

.vd-dm-pop-btn i {
    font-size: 14px;
}

.vd-dm-pop-btn.vd-dm-pop-report {
    color: rgba(255,100,100,0.8);
}

.vd-dm-pop-btn.vd-dm-pop-report:hover {
    background: rgba(255,80,80,0.15);
    color: #ff6464;
}

.vd-dm-pop-btn.vd-dm-pop-delete {
    color: rgba(255,80,80,0.8);
}

.vd-dm-pop-btn.vd-dm-pop-delete:hover {
    background: rgba(255,80,80,0.15);
    color: #ff5050;
}
