.custom-scrollbar::-webkit-scrollbar {
    width: 4px;
}

.custom-scrollbar::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 10px;
}

/* 消息状态勾选图标样式 */
.msg-status-check {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 14px;
    height: 14px;
    border: 1.5px solid #1890ff;
    border-radius: 50%;
    color: #1890ff;
    font-size: 8px;
    margin-right: 4px;
}

/* 拖拽手柄样式 (高度调整) */
.resizer-h {
    cursor: row-resize;
    height: 5px;
    background: transparent;
    width: 100%;
    position: absolute;
    top: -2px;
    left: 0;
    z-index: 20;
}

.resizer-h:hover {
    background: rgba(24, 144, 255, 0.1);
}

.menu-active {
    background-color: rgba(59, 130, 246, 0.06) !important;
    border: 1px solid rgba(59, 130, 246, 0.22) !important;
    position: relative !important;
}

/* 选中项左侧发光的天蓝色指示小竖条 (高度约占一半 44%) */
.menu-active::before {
    content: "" !important;
    position: absolute !important;
    left: 0 !important;
    top: 28% !important;
    height: 44% !important;
    width: 3.5px !important;
    background-color: #3b82f6 !important;
    border-radius: 0 4px 4px 0 !important;
    box-shadow: 0 0 8px rgba(59, 130, 246, 0.4) !important;
}

/* 激活状态字和图标均显示为亮天蓝色 */
.menu-active, 
.menu-active span, 
.menu-active svg {
    color: #3b82f6 !important;
}

/* 导航栏图标呼吸动效与胶囊化 */
.sidebar-btn {
    border: 1px solid transparent !important;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

.sidebar-btn svg {
    transition: color 0.2s, transform 0.2s !important;
}

.sidebar-btn:hover {
    transform: translateY(-0.5px);
}

.sidebar-btn:hover svg {
    transform: scale(1.04);
}

/* 坐席兜底字母头像 - 升级为极光流光微立体徽章 */
.avatar-fallback {
    position: absolute !important;
    inset: 0 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    border-radius: 9999px !important;
    background: linear-gradient(135deg, #c084fc 0%, #818cf8 50%, #6366f1 100%) !important;
    color: #ffffff !important;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif !important;
    font-weight: 600 !important;
    font-size: 14px !important;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.15) !important;
    user-select: none !important;
    box-shadow: inset 0 1px 2px rgba(255, 255, 255, 0.2), 0 3px 8px rgba(99, 102, 241, 0.25) !important;
    z-index: 10 !important;
}

/* ==========================================
   🌐 侧边栏深色/浅色自适应主题 (高保真隔离)
   ========================================== */

/* --- 💡 1. 浅色模式导航栏 (SaaS Light Glass) --- */
aside.theme-light {
    background-color: #ffffff !important;
    border-right: 1px solid #e2e8f0 !important;
}
aside.theme-light #topAgentName {
    color: #1e293b !important;
}
aside.theme-light #topAgentStatusText {
    color: #0f766e !important;
    font-weight: 500 !important;
}
/* 浅色未激活状态：深灰字与深灰图标 */
aside.theme-light .sidebar-btn {
    color: #64748b !important;
}
aside.theme-light .sidebar-btn svg {
    color: #64748b !important;
}
aside.theme-light .sidebar-btn:hover {
    background-color: #f1f5f9 !important;
    color: #0f172a !important;
}
aside.theme-light .sidebar-btn:hover svg {
    color: #0f172a !important;
}
aside.theme-light #avatarBtn:hover {
    background-color: #f8fafc !important;
    border-color: #e2e8f0 !important;
}
aside.theme-light #contactSupportBtn {
    color: #0284c7 !important;
    border: 1px solid rgba(14, 165, 233, 0.1) !important;
}
aside.theme-light #contactSupportBtn:hover {
    background-color: rgba(14, 165, 233, 0.05) !important;
    color: #0369a1 !important;
}
aside.theme-light #contactSupportBtn i {
    color: #0284c7 !important;
}

/* --- 🌙 2. 深色模式导航栏 (SaaS Dark Glass) --- */
aside.theme-dark {
    background-color: #0b0f19 !important;
    border-right: 1px solid rgba(255, 255, 255, 0.05) !important;
}
aside.theme-dark #topOnlineDot {
    border-color: #0b0f19 !important; /* 让在线灯的黑框在深色底板下融合 */
}
aside.theme-dark #topAgentName {
    color: #ffffff !important;
}
aside.theme-dark #topAgentStatusText {
    color: #34d399 !important;
}
/* 深色未激活状态：半透明白 */
aside.theme-dark .sidebar-btn {
    color: rgba(255, 255, 255, 0.6) !important;
}
aside.theme-dark .sidebar-btn svg {
    color: rgba(255, 255, 255, 0.55) !important;
}
aside.theme-dark .sidebar-btn:hover {
    background-color: rgba(255, 255, 255, 0.05) !important;
    color: #ffffff !important;
}
aside.theme-dark .sidebar-btn:hover svg {
    color: #ffffff !important;
}
aside.theme-dark #avatarBtn:hover {
    background-color: rgba(255, 255, 255, 0.03) !important;
}
aside.theme-dark #contactSupportBtn {
    color: #8a99ad !important;
}
aside.theme-dark #contactSupportBtn:hover {
    background-color: rgba(255, 255, 255, 0.03) !important;
    color: #3b82f6 !important;
}
aside.theme-dark #contactSupportBtn:hover i {
    color: #3b82f6 !important;
}
aside.theme-dark #contactSupportBtn i {
    color: #8a99ad !important;
}

/* 快捷回复列表富文本预览样式重置 */
.rich-text-preview {
    color: inherit !important;
}

.rich-text-preview p {
    margin: 0 !important;
    display: inline;
    color: inherit !important;
}

.rich-text-preview span {
    color: inherit;
    /* Should allow inline styles to win */
}

.rich-text-preview img {
    display: none;
}

/* WangEditor & Rich Text Links */
.w-e-text-container [contenteditable="true"] a,
.rich-text-preview a,
.chats-msg-box a,
.chats-bubble-msg a,
.pre-form-desc a,
#chatContent a {
    color: #1890ff !important;
    text-decoration: underline !important;
    cursor: pointer !important;
}

/* Chat Bubble Media Constraints */
.chats-bubble-msg img {
    max-width: 300px !important;
    max-height: 300px !important;
    width: auto !important;
    height: auto !important;
    border-radius: 8px;
    cursor: zoom-in;
    display: block;
    margin: 4px 0;
}

.chats-bubble-msg video {
    max-width: 300px !important;
    max-height: 200px !important;
    border-radius: 8px;
    background: #000;
}

/* Notification Badge (Red Dot) */
.nav-badge {
    position: absolute !important;
    top: 6px !important;
    right: 6px !important;
    width: 10px !important;
    height: 10px !important;
    background-color: #ff4d4f !important;
    border-radius: 50% !important;
    border: 1.5px solid #001529 !important;
    box-shadow: 0 0 6px rgba(255, 77, 79, 0.6) !important;
    z-index: 9999 !important;
    pointer-events: none !important;
    display: block !important;
}

.nav-badge.hidden {
    display: none !important;
}

.sidebar-btn {
    position: relative;
}

/* Preserve whitespace and line breaks in chat bubbles */
.chats-bubble-msg {
    white-space: pre-wrap !important;
    word-break: break-word;
}

/* 强制对齐气泡内的快捷参与按钮与原生上侧输入框按钮的尺寸 */
.chats-bubble-msg .quick-btn.tag {
    padding: 6px 16px !important;
    font-size: 12px !important;
    border-radius: 20px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    line-height: 1.5 !important;
    height: 30px !important;
    box-sizing: border-box !important;
    margin-top: 1px !important;
    /* 增加与上方文字的微小间距 */
}