/**
 * LightSNS Chat - DreamsChat Style
 * 四栏布局：图标导航 | 会话列表 | 聊天区 | 详情面板
 */

/* ============================================================
   CSS 变量
   ============================================================ */
:root {
    --lsc-primary: #6338F6;
    --lsc-primary-hover: #5429E0;
    --lsc-primary-light: #F0EBFE;
    --lsc-primary-rgb: 99, 56, 246;
    --lsc-bg: #F8F9FB;
    --lsc-bg-white: #FFFFFF;
    --lsc-text: #141B27;
    --lsc-text-sub: #434952;
    --lsc-text-muted: #72767D;
    --lsc-border: #E8E8E9;
    --lsc-border-light: #F1F2F4;
    --lsc-bubble-self: var(--lsc-primary);
    --lsc-bubble-self-text: #FFFFFF;
    --lsc-bubble-other: #e7eaf0;
    --lsc-bubble-other-text: #141B27;
    --lsc-success: #0CC68C;
    --lsc-danger: #FD3A55;
    --lsc-warning: #FFC107;
    --lsc-nav-w: 72px;
    --lsc-sidebar-w: 380px;
    --lsc-panel-w: 320px;
    --lsc-shadow: 0 1px 5px 1px rgba(243,243,243,1);
    --lsc-shadow-md: 0 4px 16px rgba(0,0,0,0.08);
    --lsc-transition: 0.2s ease;
    --lsc-radius: 12px;
    --lsc-radius-sm: 6px;
    --lsc-radius-md: 8px;
}

/* ============================================================
   Reset & Base（限定在聊天页面内）
   ============================================================ */
.ls-chat-app *, .ls-chat-app *::before, .ls-chat-app *::after { box-sizing: border-box; }
body:has(.ls-chat-app) { margin: 0; padding: 0; background: var(--lsc-bg); overflow: hidden; }
.ls-chat-app a { color: inherit; text-decoration: none; }
.ls-chat-app button { font-family: inherit; cursor: pointer; }
.ls-chat-app h1,.ls-chat-app h2,.ls-chat-app h3,.ls-chat-app h4,.ls-chat-app h5,.ls-chat-app h6,.ls-chat-app p { margin: 0; }
.ls-chat-app ul { list-style: none; margin: 0; padding: 0; }
.ls-chat-app img { max-width: 100%; vertical-align: middle; }
.ls-hidden { display: none !important; }

.ls-chat-app .emotion-type-big_img {
    width: 22px;
    height: 22px;
}

/* ============================================================
   主容器 - 四栏 flex
   ============================================================ */
.ls-chat-app {
    display: flex;
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    overflow: hidden;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1000;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 14px;
    line-height: 1.5;
    color: var(--lsc-text);
    background: var(--lsc-bg);
}

/* ============================================================
   左侧图标导航栏
   ============================================================ */
.ls-chat-nav {
    width: var(--lsc-nav-w);
    min-width: var(--lsc-nav-w);
    height: 100vh;
    height: 100dvh;
    background: var(--lsc-bg-white);
    border-right: 1px solid var(--lsc-border);
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px 0;
    z-index: 10;
    box-shadow: var(--lsc-shadow);
}

.ls-chat-nav-menu {
    flex: 1;
}

.ls-chat-nav-list {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.ls-chat-nav-list li {
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--lsc-radius-md);
    cursor: pointer;
    transition: all var(--lsc-transition);
    position: relative;
}

.ls-chat-nav-list li a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    color: var(--lsc-text-muted);
    transition: color var(--lsc-transition);
}

.ls-chat-nav-list li:hover {
    background: rgba(var(--lsc-primary-rgb), 0.15);
}

.ls-chat-nav-list li:hover a {
    color: var(--lsc-primary);
}

.ls-chat-nav-list li.ls-active {
    background: var(--lsc-primary);
}

.ls-chat-nav-list li.ls-active a {
    color: #FFFFFF;
}

.ls-chat-nav-list li i {
    font-size: 22px;
}

/* 导航栏未读总数红点 */
.ls-chat-nav-badge {
    position: absolute;
    top: -6px;
    right: -6px;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    background: var(--lsc-danger);
    color: #FFF;
    font-size: 10px;
    font-weight: 600;
    line-height: 16px;
    text-align: center;
    border-radius: 10px;
    box-sizing: border-box;
    pointer-events: none;
    z-index: 2;
}

.ls-chat-nav-badge.ls-hidden {
    display: none;
}

.ls-chat-nav-bottom {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

/* ============================================================
   中间会话列表栏
   ============================================================ */
.ls-chat-sidebar {
    width: var(--lsc-sidebar-w);
    min-width: var(--lsc-sidebar-w);
    height: 100vh;
    height: 100dvh;
    background: var(--lsc-bg);
    border-right: 1px solid var(--lsc-border);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.ls-chat-sidebar-tabs {
    flex: 1;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.ls-chat-tab-pane {
    display: none;
    flex-direction: column;
    flex: 1;
    overflow: hidden;
}

.ls-chat-tab-pane.ls-active {
    display: flex;
}

/* ----- 侧边栏头部 ----- */
.ls-chat-sidebar-header {
    padding: 24px 24px 0;
    flex-shrink: 0;
    transition: padding 0.25s ease;
}

.ls-scrolled .ls-chat-sidebar-header {
    padding-top: 12px;
}

.ls-chat-sidebar-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    max-height: 40px;
    overflow: hidden;
    transition: max-height 0.25s ease, margin-bottom 0.25s ease, opacity 0.25s ease;
    opacity: 1;
}

.ls-scrolled .ls-chat-sidebar-title {
    max-height: 0;
    margin-bottom: 0;
    opacity: 0;
}

.ls-chat-sidebar-title h4 {
    font-size: 20px;
    font-weight: 700;
    color: var(--lsc-text);
}

.ls-chat-sidebar-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.ls-chat-app a.ls-chat-action-btn {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--lsc-primary);
    color: #FFFFFF;
    border-radius: var(--lsc-radius-sm);
    font-size: 16px;
    transition: all var(--lsc-transition);
}

.ls-chat-app a.ls-chat-action-btn:hover {
    background: var(--lsc-primary-hover);
    color: #FFFFFF;
}

/* ----- 搜索框 ----- */
.ls-chat-search {
    margin-bottom: 16px;
}

.ls-chat-search-box {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--lsc-bg-white);
    border: 1px solid var(--lsc-border);
    border-radius: var(--lsc-radius-md);
    padding: 0 14px;
    height: 42px;
    transition: all var(--lsc-transition);
}

.ls-chat-search-box:focus-within {
    border-color: var(--lsc-primary);
    box-shadow: 0 0 0 3px rgba(var(--lsc-primary-rgb), 0.1);
}

.ls-chat-search-box > i {
    font-size: 16px;
    color: var(--lsc-text-muted);
    flex-shrink: 0;
}

.ls-chat-search-box input {
    flex: 1;
    border: none;
    outline: none;
    background: transparent;
    font-size: 14px;
    color: var(--lsc-text);
}

.ls-chat-search-box input::placeholder {
    color: var(--lsc-text-muted);
}

.ls-chat-search-clear {
    cursor: pointer;
    color: var(--lsc-text-muted);
    transition: color var(--lsc-transition);
}

.ls-chat-search-clear:hover {
    color: var(--lsc-text);
}

/* ----- 在线联系人横向滚动 ----- */
.ls-chat-online-bar {
    padding: 0 24px 12px;
    flex-shrink: 0;
    border-bottom: 1px solid var(--lsc-border-light);
}

.ls-chat-online-title {
    margin-bottom: 12px;
}

.ls-chat-online-title h5 {
    font-size: 14px;
    font-weight: 600;
    color: var(--lsc-text-sub);
}

.ls-chat-online-list {
    display: flex;
    gap: 16px;
    overflow-x: auto;
    padding-bottom: 4px;
}

.ls-chat-online-list::-webkit-scrollbar {
    height: 0;
}

.ls-chat-online-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
    cursor: pointer;
}

.ls-chat-online-item .ls-online-avatar {
    position: relative;
    width: 48px;
    height: 48px;
}

.ls-chat-online-item .ls-online-avatar img {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
    display: block;
}

.ls-chat-online-item .ls-online-avatar::after {
    content: '';
    position: absolute;
    bottom: 2px;
    right: 2px;
    width: 12px;
    height: 12px;
    background: var(--lsc-success);
    border-radius: 50%;
    border: 2px solid var(--lsc-bg);
}

.ls-chat-online-item .ls-online-name {
    font-size: 12px;
    color: var(--lsc-text-sub);
    max-width: 56px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    text-align: center;
}

/* ----- 会话列表标题 ----- */
.ls-chat-list-header {
    padding: 16px 24px 8px;
    flex-shrink: 0;
}

.ls-chat-list-header h5 {
    font-size: 14px;
    font-weight: 600;
    color: var(--lsc-text-sub);
}

/* ----- 会话列表 ----- */
.ls-chat-session-list {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    overscroll-behavior: contain;
    padding: 0 12px 12px 20px;
}

.ls-chat-session-list::-webkit-scrollbar { width: 4px; }
.ls-chat-session-list::-webkit-scrollbar-track { background: transparent; }
.ls-chat-session-list::-webkit-scrollbar-thumb { background: transparent; border-radius: 50px; transition: background 0.3s; }
.ls-chat-session-list.ls-scrolling::-webkit-scrollbar-thumb { background: rgba(0,0,0,0.08); }
.ls-chat-session-list.ls-scrolling::-webkit-scrollbar-thumb:hover { background: rgba(0,0,0,0.15); }

/* ----- 单个会话项 ----- */
.ls-chat-session-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    cursor: pointer;
    transition: all var(--lsc-transition);
    position: relative;
    user-select: none;
    border-radius: var(--lsc-radius);
    margin-bottom: 8px;
    background: var(--lsc-bg-white);
    box-shadow: var(--lsc-shadow);
}

.ls-chat-session-item:hover {
    box-shadow: 0 0 0 2px rgba(var(--lsc-primary-rgb), 0.5) inset;
}

.ls-chat-session-item.ls-active {
    background: rgba(var(--lsc-primary-rgb), 0.12);
    box-shadow: 0 0 0 2px rgba(var(--lsc-primary-rgb), 0.8) inset;
}

.ls-chat-session-item.ls-top {
    background: #eeeeee;
}

.ls-chat-session-item.ls-top.ls-active {
    background: rgba(var(--lsc-primary-rgb), 0.12);
    box-shadow: 0 0 0 2px rgba(var(--lsc-primary-rgb), 0.8) inset;
}

/* 会话头像 */
.ls-chat-session-avatar {
    position: relative;
    flex-shrink: 0;
    width: 48px;
    height: 48px;
}

.ls-chat-session-avatar > img {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
    display: block;
}

.ls-chat-group-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: linear-gradient(135deg, #E8DFFE, #D0BFFF);
    display: flex;
    align-items: center;
    justify-content: center;
}

.ls-chat-group-avatar i { font-size: 22px; color: var(--lsc-primary); }

/* 未读角标 */
.ls-chat-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    background: var(--lsc-danger);
    color: #FFF;
    font-size: 11px;
    font-weight: 600;
    line-height: 14px;
    text-align: center;
    border-radius: 15px;
    border: 2px solid var(--lsc-bg-white);
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
}

.ls-chat-badge-dot {
    position: absolute;
    top: 0;
    right: 0;
    width: 8px;
    height: 8px;
    background: #B9BBBE;
    border-radius: 50%;
    border: 2px solid var(--lsc-bg-white);
    z-index: 2;
}

/* 会话信息 */
.ls-chat-session-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.ls-chat-session-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.ls-chat-session-name { font-size: 15px; font-weight: 600; color: var(--lsc-text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; min-width: 0; }
.ls-chat-session-time { font-size: 12px; color: var(--lsc-text-muted); flex-shrink: 0; }
.ls-chat-session-bottom { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.ls-chat-session-msg { font-size: 13px; color: var(--lsc-text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; min-width: 0; }
.ls-chat-session-msg img {
    height: 22px;
    width: 22px;
}
.ls-chat-session-icons { display: flex; align-items: center; gap: 4px; flex-shrink: 0; }
.ls-chat-session-icons i { font-size: 14px; color: var(--lsc-text-muted); }

/* 空状态 */
.ls-chat-empty-sessions, .ls-chat-empty-tip, .ls-chat-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    color: var(--lsc-text-muted);
}

.ls-chat-empty-sessions i, .ls-chat-empty-tip i, .ls-chat-empty i { font-size: 48px; margin-bottom: 12px; opacity: 0.3; }
.ls-chat-empty-sessions p, .ls-chat-empty-tip p, .ls-chat-empty p { font-size: 14px; }

.ls-chat-blocked-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: var(--lsc-text-muted);
    text-align: center;
    padding: 40px 20px;
}

.ls-chat-blocked-wrap i {
    font-size: 56px;
    margin-bottom: 16px;
    opacity: 0.25;
}

.ls-chat-blocked-wrap p {
    font-size: 15px;
    line-height: 1.6;
}

.ls-chat-error-btn {
    margin-top: 16px;
    padding: 8px 24px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    background: var(--lsc-primary, #1890ff);
    color: #fff;
    transition: opacity 0.2s;
}
.ls-chat-error-btn:hover {
    opacity: 0.85;
}

.ls-chat-join-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    color: var(--lsc-text-muted);
    font-size: 13px;
}

.ls-chat-join-loading p {
    margin-top: 12px;
}

/* 联系人列表 / 群聊列表 / 在线用户列表 */
.ls-chat-contact-list,
.ls-chat-group-list,
.ls-chat-online-users {
    flex: 1;
    overflow-y: auto;
    padding: 0 12px 12px;
}

/* ----- 关注列表项 ----- */
.ls-chat-contact-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: var(--lsc-radius-md);
    cursor: pointer;
    transition: background var(--lsc-transition);
}

.ls-chat-contact-item:hover {
    background: var(--lsc-bg-white);
}

.ls-chat-contact-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.ls-chat-contact-name {
    font-size: 14px;
    font-weight: 500;
    color: var(--lsc-text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ls-chat-contact-desc {
    font-size: 12px;
    color: var(--lsc-text-muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ls-chat-contact-chat-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    color: var(--lsc-text-muted);
    border-radius: 50%;
    cursor: pointer;
    transition: all var(--lsc-transition);
    flex-shrink: 0;
}

.ls-chat-contact-chat-btn:hover {
    background: var(--lsc-primary-light);
    color: var(--lsc-primary);
}

.ls-chat-contact-chat-btn i {
    font-size: 16px;
}

.ls-chat-list-loading {
    display: flex;
    justify-content: center;
    padding: 40px 0;
}

/* 聊天消息区加载动画居中 */
.ls-chat-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 200px;
    width: 100%;
}

.ls-chat-list-loading-sm {
    display: block;
    text-align: center;
    padding: 12px 0;
    font-size: 12px;
    color: var(--lsc-text-muted);
}


/* ============================================================
   聊天主区域
   ============================================================ */
.ls-chat-main {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    position: relative;
    background: var(--lsc-bg-white);
}

/* ----- 未选择聊天占位 ----- */
.ls-chat-placeholder {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--lsc-bg);
}

.ls-chat-placeholder-inner {
    text-align: center;
    color: var(--lsc-text-muted);
}

.ls-chat-placeholder-inner i {
    font-size: 72px;
    opacity: 0.15;
    display: block;
    margin-bottom: 20px;
    color: var(--lsc-primary);
}

.ls-chat-placeholder-inner h3 {
    font-size: 20px;
    font-weight: 600;
    color: var(--lsc-text);
    margin-bottom: 8px;
}

.ls-chat-placeholder-inner p {
    font-size: 14px;
    color: var(--lsc-text-muted);
}

/* ----- 聊天头部 ----- */
.ls-chat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 20px;
    min-height: 64px;
    background: var(--lsc-bg-white);
    border-bottom: 1px solid var(--lsc-border);
    box-shadow: var(--lsc-shadow);
    flex-shrink: 0;
    z-index: 2;
}

.ls-chat-header-user {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
    cursor: pointer;
}

.ls-chat-header-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.ls-chat-header-name {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 16px;
    font-weight: 700;
    color: var(--lsc-text);
    overflow: hidden;
    white-space: nowrap;
}
.ls-chat-header-name > span:first-child {
    overflow: hidden;
    text-overflow: ellipsis;
    flex-shrink: 1;
    min-width: 0;
}

.ls-chat-header-status {
    font-size: 12px;
    color: var(--lsc-success);
}

.ls-chat-header-actions {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
}

.ls-chat-header-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: none;
    background: transparent;
    border-radius: 50%;
    color: var(--lsc-text-muted);
    cursor: pointer;
    transition: all var(--lsc-transition);
}

.ls-chat-header-btn:hover {
    background: var(--lsc-bg);
    color: var(--lsc-text);
}

.ls-chat-header-btn i {
    font-size: 18px;
}

/* ----- 更多操作下拉菜单 ----- */
.ls-chat-header-more {
    position: relative;
}

.ls-chat-more-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 6px;
    min-width: 180px;
    background: var(--lsc-bg-white);
    border: 1px solid var(--lsc-border);
    border-radius: var(--lsc-radius);
    box-shadow: var(--lsc-shadow-md);
    padding: 6px 0;
    z-index: 10020;
    animation: ls-chat-menu-in 0.12s ease;
}

/* ============================================================
   消息区域
   ============================================================ */
.ls-chat-messages {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    overscroll-behavior: contain;
    min-height: 0;
    background: var(--lsc-bg);
}

.ls-chat-messages::-webkit-scrollbar { width: 4px; }
.ls-chat-messages::-webkit-scrollbar-track { background: transparent; }
.ls-chat-messages::-webkit-scrollbar-thumb { background: rgba(0,0,0,0.08); border-radius: 50px; }
.ls-chat-messages::-webkit-scrollbar-thumb:hover { background: rgba(0,0,0,0.15); }

.ls-chat-messages-inner {
    padding: 20px 24px;
    display: flex;
    flex-direction: column;
}

/* ----- 回到底部按钮 ----- */
.ls-chat-scroll-bottom {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 50%;
    background: var(--lsc-primary);
    color: #fff;
    box-shadow: 0 2px 8px rgba(var(--lsc-primary-rgb), 0.25);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--lsc-transition);
    margin-bottom: 2px;
}

.ls-chat-scroll-bottom:hover {
    background: var(--lsc-primary-hover);
    box-shadow: 0 4px 12px rgba(var(--lsc-primary-rgb), 0.4);
}

.ls-chat-scroll-bottom i {
    font-size: 18px;
}

.ls-chat-scroll-badge {
    font-size: 12px;
    font-weight: 600;
    line-height: 1;
    white-space: nowrap;
}

/* ----- 加载更多 ----- */
.ls-chat-load-more {
    text-align: center;
    padding: 12px 0 20px;
}

.ls-chat-load-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 20px;
    border: 1px solid var(--lsc-border);
    background: var(--lsc-bg-white);
    border-radius: 25px;
    font-size: 13px;
    color: var(--lsc-text-sub);
    cursor: pointer;
    transition: all var(--lsc-transition);
}

.ls-chat-load-btn:hover {
    border-color: var(--lsc-primary);
    color: var(--lsc-primary);
    box-shadow: 0 2px 8px rgba(var(--lsc-primary-rgb), 0.15);
}

.ls-chat-load-btn i { font-size: 14px; }

/* ----- 消息列表 ----- */
.ls-chat-msg-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

/* ----- 时间分割线 ----- */
.ls-chat-msg-time-divider {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px 0 12px;
    user-select: none;
}

.ls-chat-msg-time-divider span {
    font-size: 12px;
    font-weight: 500;
    color: var(--lsc-text-muted);
    background: var(--lsc-border-light);
    padding: 3px 16px;
    border-radius: 15px;
}

/* ----- 系统消息 ----- */
/* 系统消息 - 见文件末尾统一样式 */

/* ============================================================
   单条消息
   ============================================================ */
.ls-chat-msg {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 8px 0;
    max-width: 100%;
}

/* 消息头像可点击 */
.ls-chat-msg .ls-avatar { cursor: pointer; }

/* 消息体 */
.ls-chat-msg-body {
    max-width: 65%;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

/* 发送者名称 */
.ls-chat-msg-name {
    font-size: 12px;
    color: var(--lsc-text-muted);
    padding-left: 4px;
    font-weight: 500;
}

/* 消息内容包裹（气泡 + 三点按钮） */
.ls-chat-msg-content-wrap {
    display: flex;
    align-items: center;
    gap: 4px;
}

.ls-chat-msg.ls-self .ls-chat-msg-content-wrap {
    flex-direction: row-reverse;
}

.ls-chat-msg-more-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border: none;
    background: transparent;
    color: var(--lsc-text-muted);
    border-radius: 50%;
    cursor: pointer;
    opacity: 0.4;
    transition: opacity 0.15s ease, background 0.15s ease;
    flex-shrink: 0;
    padding: 0;
}

.ls-chat-msg-more-btn i {
    font-size: 16px;
}

.ls-chat-msg:hover .ls-chat-msg-more-btn {
    opacity: 0.7;
}

.ls-chat-msg-more-btn:hover {
    opacity: 1 !important;
    background: var(--lsc-border-light);
    color: var(--lsc-text);
}

/* 消息气泡 */
.ls-chat-msg-bubble {
    padding: 12px 16px;
    border-radius: 16px 16px 16px 0;
    background: var(--lsc-bubble-other);
    color: var(--lsc-bubble-other-text);
    font-size: 15px;
    line-height: 1.6;
    word-break: break-word;
    position: relative;
    max-width: 420px;
}

/* noBubble 类型（图片/视频/位置/红包/转账/文件）不在气泡内，无需 :has() 规则 */

/* 消息时间 */
.ls-chat-msg-time {
    font-size: 11px;
    color: var(--lsc-text-muted);
    padding-left: 4px;
    opacity: 0;
    transition: opacity var(--lsc-transition);
}

.ls-chat-msg:hover .ls-chat-msg-time {
    opacity: 1;
}

/* ============================================================
   自己发的消息（.ls-self）
   ============================================================ */
.ls-chat-msg.ls-self {
    flex-direction: row-reverse;
}

.ls-chat-msg.ls-self .ls-chat-msg-body {
    align-items: flex-end;
}

.ls-chat-msg.ls-self .ls-chat-msg-name {
    padding-left: 0;
    padding-right: 4px;
    text-align: right;
}

.ls-chat-msg.ls-self .ls-chat-msg-bubble {
    background: var(--lsc-bubble-self);
    color: var(--lsc-bubble-self-text);
    border-radius: 16px 16px 0 16px;
}

.ls-chat-msg.ls-self .ls-chat-msg-time {
    padding-left: 0;
    padding-right: 4px;
    text-align: right;
}

.ls-chat-msg.ls-self .ls-chat-msg-bubble a {
    color: rgba(255, 255, 255, 0.9);
    text-decoration: underline;
}

.ls-chat-msg-bubble a {
    color: var(--lsc-primary);
    text-decoration: none;
}

.ls-chat-msg-bubble a:hover {
    text-decoration: underline;
}

/* ============================================================
   消息类型：文本
   ============================================================ */
.ls-chat-msg-text {
    white-space: pre-wrap;
}

.ls-chat-msg-text.ls-empty-msg {
    color: var(--lsc-text-muted);
    font-style: italic;
}

/* ============================================================
   消息类型：图片
   ============================================================ */
.ls-chat-msg-image {
    padding: 0;
    background: transparent;
    overflow: hidden;
    border-radius: var(--lsc-radius);
    cursor: pointer;
    position: relative;
}

.ls-chat-msg-image img {
    display: block;
    max-width: 280px;
    max-height: 320px;
    border-radius: var(--lsc-radius);
    object-fit: cover;
    transition: opacity var(--lsc-transition);
}

.ls-chat-msg-image img:hover {
    opacity: 0.9;
}

.ls-chat-msg.ls-self .ls-chat-msg-image {
    background: transparent;
}

/* ============================================================
   消息类型：语音（微信风格，不使用气泡包裹）
   ============================================================ */
.ls-chat-msg-voice {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 80px;
    max-width: 240px;
    padding: 10px 14px;
    cursor: pointer;
    user-select: none;
    border-radius: var(--lsc-radius);
    background: var(--lsc-bubble-other);
}

.ls-chat-msg.ls-self .ls-chat-msg-voice {
    background: var(--lsc-bubble-self);
    flex-direction: row-reverse;
}

.ls-chat-msg-voice .ls-voice-bars {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 3px;
    height: 18px;
}

.ls-chat-msg.ls-self .ls-chat-msg-voice .ls-voice-bars {
    justify-content: flex-start;
}

.ls-chat-msg-voice .ls-voice-bars span {
    display: block;
    width: 3px;
    border-radius: 3px;
    background: rgba(0, 0, 0, 0.2);
}

.ls-chat-msg-voice .ls-voice-bars span:nth-child(1) { height: 8px; }
.ls-chat-msg-voice .ls-voice-bars span:nth-child(2) { height: 14px; }
.ls-chat-msg-voice .ls-voice-bars span:nth-child(3) { height: 10px; }

.ls-chat-msg.ls-self .ls-chat-msg-voice .ls-voice-bars span {
    background: rgba(255, 255, 255, 0.5);
}

.ls-chat-msg-voice .ls-voice-duration {
    font-size: 13px;
    color: var(--lsc-text-muted);
    flex-shrink: 0;
}

.ls-chat-msg.ls-self .ls-chat-msg-voice .ls-voice-duration {
    color: rgba(255, 255, 255, 0.8);
}

.ls-chat-msg-voice.ls-playing .ls-voice-bars span {
    animation: ls-voice-wave-anim 0.6s ease-in-out infinite alternate;
}

@keyframes ls-voice-wave-anim {
    0% { transform: scaleY(0.4); }
    100% { transform: scaleY(1); }
}

/* ============================================================
   消息类型：视频
   ============================================================ */
.ls-chat-msg-video {
    padding: 0;
    background: transparent;
    border-radius: var(--lsc-radius);
    overflow: hidden;
    position: relative;
    cursor: pointer;
    display: inline-block;
}

.ls-chat-msg-video img {
    display: block;
    max-width: 280px;
    max-height: 240px;
    object-fit: cover;
    border-radius: var(--lsc-radius);
}

.ls-chat-msg-video .ls-video-play {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.2);
    transition: transform var(--lsc-transition);
}

.ls-chat-msg-video:hover .ls-video-play {
    transform: translate(-50%, -50%) scale(1.1);
}

.ls-chat-msg-video .ls-video-play i {
    font-size: 22px;
    color: var(--lsc-primary);
    margin-left: 2px;
}

.ls-chat-msg-video .ls-video-duration {
    position: absolute;
    bottom: 8px;
    right: 8px;
    font-size: 12px;
    color: #FFFFFF;
    background: rgba(0, 0, 0, 0.5);
    padding: 2px 8px;
    border-radius: 10px;
}

.ls-chat-msg.ls-self .ls-chat-msg-video {
    background: transparent;
}

/* 图片消息自己和对方样式统一 */

/* ============================================================
   消息类型：文件
   ============================================================ */
.ls-chat-msg-file {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 220px;
    max-width: 320px;
    padding: 14px 16px;
    border-radius: var(--lsc-radius);
    background: var(--lsc-bg-white);
    border: 1px solid var(--lsc-border);
    cursor: pointer;
    transition: all var(--lsc-transition);
    position: relative;
}

.ls-chat-msg-file:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.ls-chat-msg-file .ls-file-icon {
    width: 42px;
    height: 42px;
    border-radius: var(--lsc-radius-md);
    background: var(--lsc-primary-light);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.ls-chat-msg-file .ls-file-icon i {
    font-size: 20px;
}

.ls-chat-msg-file .ls-file-info {
    flex: 1;
    min-width: 0;
}

.ls-chat-msg-file .ls-file-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--lsc-text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    display: block;
}

.ls-chat-msg-file .ls-file-size {
    font-size: 12px;
    color: var(--lsc-text-muted);
    margin-top: 2px;
    display: block;
}

.ls-chat-msg-file .ls-file-download {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--lsc-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all var(--lsc-transition);
}

.ls-chat-msg-file .ls-file-download:hover {
    background: var(--lsc-primary);
}

.ls-chat-msg-file .ls-file-download i {
    font-size: 16px;
    color: var(--lsc-text-sub);
}

.ls-chat-msg-file .ls-file-download:hover i {
    color: #FFFFFF;
}

/* 文件下载中旋转动画 */
.ls-downloading i {
    animation: ls-spin 1s linear infinite;
}

@keyframes ls-spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* 文件消息自己和对方样式统一（noBubble 模式下不需要特殊样式） */

/* ============================================================
   消息类型：位置
   ============================================================ */
.ls-chat-msg-location {
    padding: 0;
    border-radius: var(--lsc-radius);
    overflow: hidden;
    cursor: pointer;
    width: 280px;
    background: var(--lsc-bg-white);
    border: 1px solid var(--lsc-border);
    transition: box-shadow var(--lsc-transition);
}

.ls-chat-msg-location:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.ls-chat-msg-location .ls-location-map {
    width: 100%;
    height: 140px;
    overflow: hidden;
}

.ls-chat-msg-location .ls-location-map img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.ls-chat-msg-location .ls-location-info {
    padding: 10px 14px;
    display: flex;
    align-items: flex-start;
    gap: 8px;
}

.ls-chat-msg-location .ls-location-icon {
    font-size: 18px;
    color: var(--lsc-danger);
    flex-shrink: 0;
    margin-top: 1px;
}

.ls-chat-msg-location .ls-location-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--lsc-text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    display: block;
}

.ls-chat-msg-location .ls-location-addr {
    font-size: 12px;
    color: var(--lsc-text-muted);
    margin-top: 2px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    display: block;
}

/* 位置消息自己和对方样式统一 */

/* ============================================================
   消息类型：红包
   ============================================================ */
.ls-chat-msg-redbag {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 18px 18px 14px;
    min-width: 220px;
    max-width: 280px;
    background: linear-gradient(135deg, #FA5151 0%, #E84040 100%);
    border-radius: var(--lsc-radius);
    cursor: pointer;
    transition: opacity var(--lsc-transition);
}

.ls-chat-msg-redbag::before {
    content: '';
    position: absolute;
    top: -20px;
    right: -20px;
    width: 80px;
    height: 80px;
    background: radial-gradient(circle, rgba(255,215,0,0.12) 0%, transparent 70%);
    pointer-events: none;
}
.ls-chat-msg-redbag:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(207,19,34,0.3); }
.ls-chat-msg-redbag:active { transform: scale(0.98); }
.ls-chat-msg-redbag .ls-redbag-icon {
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin-right: 10px;
}
.ls-chat-msg-redbag .ls-redbag-icon i {
    font-size: 28px;
    color: #FFD700;
    filter: drop-shadow(0 1px 2px rgba(0,0,0,0.15));
}
.ls-chat-msg-redbag .ls-redbag-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
    gap: 3px;
}
.ls-chat-msg-redbag .ls-redbag-title {
    font-size: 14px;
    color: #fff;
    line-height: 1.3;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 160px;
}
.ls-chat-msg-redbag .ls-redbag-desc {
    font-size: 11px;
    color: rgba(255,255,255,0.6);
}
.ls-chat-msg-redbag.ls-redbag-received { opacity: 0.82; }
.ls-chat-msg-redbag.ls-redbag-disabled {
    background: linear-gradient(135deg, #C4A0A0 0%, #B89090 100%) !important;
    cursor: default;
}
.ls-chat-msg-redbag.ls-redbag-disabled:hover { transform: none; box-shadow: none; }
.ls-chat-msg-redbag.ls-redbag-disabled:active { transform: none; }
.ls-chat-msg-redbag.ls-redbag-disabled .ls-redbag-icon i { color: rgba(255,255,255,0.45); }
.ls-chat-msg-redbag.ls-redbag-disabled .ls-redbag-title { color: rgba(255,255,255,0.8); }
.ls-chat-msg-redbag.ls-redbag-disabled .ls-redbag-desc { color: rgba(255,255,255,0.45); }

/* ============================================================
   消息类型：转账（微信风格 - 橙黄色卡片）
   ============================================================ */
.ls-chat-msg-transfer {
    display: flex;
    flex-direction: column;
    min-width: 240px;
    max-width: 260px;
    border-radius: 4px;
    cursor: pointer;
    overflow: hidden;
    transition: transform 0.15s, box-shadow 0.15s;
    background: var(--ls-card-bg, #fff);
    box-shadow: 0 1px 2px rgba(0,0,0,0.06);
}
.ls-chat-msg-transfer:hover { transform: translateY(-1px); box-shadow: 0 3px 10px rgba(0,0,0,0.1); }
.ls-chat-msg-transfer:active { transform: scale(0.98); }

/* 上半部分：橙黄色主体 */
.ls-chat-msg-transfer .ls-transfer-body {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 12px;
    background: linear-gradient(135deg, #F9A825 0%, #F57F17 100%);
}
.ls-chat-msg-transfer .ls-transfer-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    flex-shrink: 0;
}
.ls-chat-msg-transfer .ls-transfer-icon i {
    font-size: 32px;
    color: #FFFFFF;
}
.ls-chat-msg-transfer .ls-transfer-info {
    display: flex;
    flex-direction: column;
    gap: 3px;
    overflow: hidden;
    flex: 1;
    min-width: 0;
}
.ls-chat-msg-transfer .ls-transfer-desc {
    font-size: 14px;
    color: #FFFFFF;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 160px;
    line-height: 1.3;
}
.ls-chat-msg-transfer .ls-transfer-amount {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.75);
    font-weight: normal;
}

/* 下半部分：底栏 */
.ls-chat-msg-transfer .ls-transfer-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 12px;
    background: var(--ls-card-bg, #fff);
}
.ls-chat-msg-transfer .ls-transfer-label {
    font-size: 11px;
    color: var(--lsc-text-tertiary, #999);
    display: flex;
    align-items: center;
    gap: 3px;
}
.ls-chat-msg-transfer .ls-transfer-label i { font-size: 12px; }
.ls-chat-msg-transfer .ls-transfer-status {
    font-size: 11px;
    color: var(--lsc-text-tertiary, #999);
}

/* 已完成状态（已收款/已退还/已过期）— 淡黄色 */
.ls-chat-msg-transfer.ls-transfer-disabled { cursor: default; opacity: 0.75; }
.ls-chat-msg-transfer.ls-transfer-disabled .ls-transfer-body {
    background: linear-gradient(135deg, #F9C97A 0%, #E8B86A 100%);
}
.ls-chat-msg-transfer.ls-transfer-disabled:hover { transform: none; box-shadow: 0 1px 2px rgba(0,0,0,0.06); }
.ls-chat-msg-transfer.ls-transfer-disabled:active { transform: none; }

/* ============================================================
   引用消息样式（气泡下方、时间上方）
   ============================================================ */
.ls-chat-msg-quote-ref {
    display: block;
    padding: 8px 12px;
    margin-top: 6px;
    background: #ECEEF2;
    border-left: 3px solid #C5C9D2;
    border-radius: 0 var(--lsc-radius-sm) var(--lsc-radius-sm) 0;
    font-size: 12px;
}

.ls-chat-msg-quote-ref .ls-quote-name {
    font-weight: 600;
    display: block;
    margin-bottom: 2px;
    color: #555;
}

.ls-chat-msg-quote-ref .ls-quote-text {
    color: #777;
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* 引用中的图片/视频缩略图 */
.ls-chat-msg-quote-ref .ls-quote-media {
    display: inline-block;
    position: relative;
    width: 60px;
    height: 60px;
    border-radius: 4px;
    overflow: hidden;
    cursor: pointer;
    vertical-align: middle;
    margin-top: 4px;
}
.ls-chat-msg-quote-ref .ls-quote-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.ls-chat-msg-quote-ref .ls-quote-media-video i {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #fff;
    font-size: 20px;
    text-shadow: 0 1px 3px rgba(0,0,0,.4);
    pointer-events: none;
}

/* 输入框引用缩略图 */
.ls-chat-quote-thumb {
    display: inline-block;
    width: 36px;
    height: 36px;
    border-radius: 4px;
    overflow: hidden;
    flex-shrink: 0;
}
.ls-chat-quote-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* 自己发的引用也用同样的浅灰色 */


/* ============================================================
   输入区域
   ============================================================ */
.ls-chat-input-area {
    background: var(--lsc-bg-white);
    border-top: 1px solid var(--lsc-border);
    flex-shrink: 0;
    padding: 12px 24px 16px;
}

/* ----- 引用消息预览 ----- */
.ls-chat-quote {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
    padding: 10px 14px;
    background: var(--lsc-bg);
    border-left: 3px solid var(--lsc-primary);
    border-radius: 0 var(--lsc-radius-sm) var(--lsc-radius-sm) 0;
    animation: ls-chat-quote-in 0.15s ease;
}

@keyframes ls-chat-quote-in {
    from { opacity: 0; transform: translateY(4px); }
    to { opacity: 1; transform: translateY(0); }
}

.ls-chat-quote-content {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.ls-chat-quote-name {
    font-size: 12px;
    font-weight: 600;
    color: var(--lsc-primary);
}

.ls-chat-quote-text {
    font-size: 12px;
    color: var(--lsc-text-muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ls-chat-quote-close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border: none;
    background: transparent;
    border-radius: 50%;
    color: var(--lsc-text-muted);
    cursor: pointer;
    flex-shrink: 0;
    transition: all var(--lsc-transition);
}

.ls-chat-quote-close:hover {
    background: var(--lsc-border);
    color: var(--lsc-text);
}

.ls-chat-quote-close i { font-size: 14px; }

/* ----- 输入框容器 ----- */
.ls-chat-input-wrap {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.ls-chat-input-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.ls-chat-input-tools {
    display: flex;
    align-items: center;
    gap: 4px;
}

.ls-chat-tool-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: none;
    background: transparent;
    border-radius: 50%;
    color: var(--lsc-text-muted);
    cursor: pointer;
    transition: all var(--lsc-transition);
}

.ls-chat-tool-btn:hover {
    background: var(--lsc-bg);
    color: var(--lsc-text-sub);
}

.ls-chat-tool-btn:active {
    background: var(--lsc-border);
}

.ls-chat-tool-btn.ls-recording {
    background: var(--lsc-danger);
    color: #FFFFFF;
    animation: ls-recording-pulse 1.5s ease-in-out infinite;
}

@keyframes ls-recording-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(253, 58, 85, 0.4); }
    50% { box-shadow: 0 0 0 8px rgba(253, 58, 85, 0); }
}

.ls-chat-tool-btn i { font-size: 18px; }

/* ----- 编辑器 ----- */
.ls-chat-editor-row {
    display: flex;
    align-items: flex-end;
    gap: 8px;
}

.ls-chat-voice-btn {
    flex-shrink: 0;
    margin-bottom: 2px;
}

/* ----- 录音面板 ----- */
.ls-chat-record-panel {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    gap: 16px;
}

.ls-record-visual {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 0;
}

.ls-record-wave {
    display: flex;
    align-items: center;
    gap: 3px;
    height: 32px;
}

.ls-record-wave span {
    display: block;
    width: 3px;
    border-radius: 3px;
    background: var(--lsc-danger);
    animation: ls-record-wave-anim 0.8s ease-in-out infinite alternate;
}

.ls-record-wave span:nth-child(1)  { height: 8px;  animation-delay: 0s; }
.ls-record-wave span:nth-child(2)  { height: 16px; animation-delay: 0.1s; }
.ls-record-wave span:nth-child(3)  { height: 24px; animation-delay: 0.2s; }
.ls-record-wave span:nth-child(4)  { height: 18px; animation-delay: 0.3s; }
.ls-record-wave span:nth-child(5)  { height: 28px; animation-delay: 0.15s; }
.ls-record-wave span:nth-child(6)  { height: 12px; animation-delay: 0.25s; }
.ls-record-wave span:nth-child(7)  { height: 22px; animation-delay: 0.35s; }
.ls-record-wave span:nth-child(8)  { height: 14px; animation-delay: 0.05s; }
.ls-record-wave span:nth-child(9)  { height: 20px; animation-delay: 0.2s; }
.ls-record-wave span:nth-child(10) { height: 10px; animation-delay: 0.3s; }

@keyframes ls-record-wave-anim {
    0%   { transform: scaleY(0.3); }
    100% { transform: scaleY(1); }
}

.ls-record-timer {
    font-size: 20px;
    font-weight: 500;
    color: var(--lsc-danger);
    font-variant-numeric: tabular-nums;
    flex-shrink: 0;
}

.ls-record-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

.ls-record-cancel,
.ls-record-send {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--lsc-transition);
}

.ls-record-cancel {
    background: var(--lsc-bg-hover);
    color: var(--lsc-text-muted);
}

.ls-record-cancel:hover {
    background: var(--lsc-border);
    color: var(--lsc-text-primary);
}

.ls-record-cancel i {
    font-size: 20px;
}

.ls-record-send {
    background: var(--lsc-primary);
    color: #FFFFFF;
}

.ls-record-send:hover {
    opacity: 0.9;
}

.ls-record-send i {
    font-size: 18px;
}

.ls-chat-editor {
    width: 100%;
    min-height: 44px;
    max-height: 150px;
    padding: 10px 16px;
    border: none;
    border-radius: var(--lsc-radius-md);
    background: var(--lsc-bg);
    font-size: 15px;
    line-height: 1.6;
    color: var(--lsc-text);
    outline: none;
    overflow-y: auto;
    word-break: break-word;
    transition: background var(--lsc-transition);
}

.ls-chat-editor:focus {
    background: #F0F1F3;
}

.ls-chat-editor:empty::before {
    content: attr(placeholder);
    color: var(--lsc-text-muted);
    pointer-events: none;
}

.ls-chat-editor::-webkit-scrollbar { width: 4px; }
.ls-chat-editor::-webkit-scrollbar-track { background: transparent; }
.ls-chat-editor::-webkit-scrollbar-thumb { background: rgba(0,0,0,0.08); border-radius: 50px; }

/* ----- 发送按钮 ----- */
.ls-chat-send-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 24px;
    border: none;
    background: var(--lsc-primary);
    color: #FFFFFF;
    font-size: 14px;
    font-weight: 500;
    border-radius: var(--lsc-radius-sm);
    cursor: pointer;
    transition: all var(--lsc-transition);
    flex-shrink: 0;
}

.ls-chat-send-btn:hover:not(:disabled) {
    background: var(--lsc-primary-hover);
    box-shadow: 0 4px 12px rgba(var(--lsc-primary-rgb), 0.3);
}

.ls-chat-send-btn:active:not(:disabled) {
    transform: scale(0.97);
}

.ls-chat-send-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.ls-chat-send-btn i { font-size: 16px; }

/* ============================================================
   右侧面板
   ============================================================ */
.ls-chat-panel {
    width: var(--lsc-panel-w);
    min-width: var(--lsc-panel-w);
    background: var(--lsc-bg-white);
    border-left: 1px solid var(--lsc-border);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: ls-chat-panel-in 0.2s ease;
}

@keyframes ls-chat-panel-in {
    from { opacity: 0; transform: translateX(20px); }
    to { opacity: 1; transform: translateX(0); }
}

.ls-chat-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    height: 64px;
    min-height: 64px;
    border-bottom: 1px solid var(--lsc-border);
    flex-shrink: 0;
}

.ls-chat-panel-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--lsc-text);
}

.ls-chat-panel-close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    border-radius: 50%;
    color: var(--lsc-text-muted);
    cursor: pointer;
    transition: all var(--lsc-transition);
}

.ls-chat-panel-close:hover {
    background: var(--lsc-bg);
    color: var(--lsc-text);
}

.ls-chat-panel-close i { font-size: 18px; }

.ls-chat-panel-body {
    flex: 1;
    overflow-y: auto;
    padding: 24px 20px;
}

.ls-chat-panel-body::-webkit-scrollbar { width: 4px; }
.ls-chat-panel-body::-webkit-scrollbar-thumb { background: rgba(0,0,0,0.08); border-radius: 50px; }

/* 面板用户信息 */
.ls-chat-panel-user {
    text-align: center;
}

.ls-chat-panel-avatar-wrap {
    position: relative;
    display: inline-block;
    margin-bottom: 16px;
}

.ls-chat-panel-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    display: block;
    box-shadow: var(--ls-shadow-md);
}

.ls-chat-panel-verify {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--lsc-bg-white);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 1px 4px rgba(0,0,0,0.1);
}

.ls-chat-panel-verify img {
    width: 16px;
    height: 16px;
}

.ls-chat-panel-name-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-bottom: 4px;
    flex-wrap: wrap;
}

.ls-chat-panel-name {
    font-size: 18px;
    font-weight: 700;
    color: var(--lsc-text);
}

.ls-chat-panel-meta {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-bottom: 8px;
    font-size: 12px;
    color: var(--lsc-text-muted);
}

.ls-chat-panel-id {
    background: var(--lsc-bg);
    padding: 2px 8px;
    border-radius: 10px;
    font-family: monospace;
}

.ls-chat-panel-desc {
    font-size: 13px;
    color: var(--lsc-text-muted);
    margin-bottom: 20px;
    line-height: 1.5;
}

.ls-chat-panel-actions {
    margin-bottom: 24px;
}

.ls-chat-app a.ls-chat-panel-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 20px;
    background: var(--lsc-primary);
    color: #FFFFFF;
    border-radius: 25px;
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
    transition: all var(--lsc-transition);
}

.ls-chat-app a.ls-chat-panel-link:hover {
    background: var(--lsc-primary-hover);
    box-shadow: 0 4px 12px rgba(var(--lsc-primary-rgb), 0.3);
    color: #FFFFFF;
}

.ls-chat-panel-link i { font-size: 16px; }

/* 面板会话设置 */
.ls-chat-panel-settings {
    border-top: 1px solid var(--lsc-border-light);
    padding-top: 16px;
}

.ls-chat-panel-setting-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 4px;
    cursor: pointer;
    border-radius: var(--lsc-radius-sm);
    transition: background var(--lsc-transition);
}

.ls-chat-panel-setting-item:hover {
    background: var(--lsc-bg);
}

.ls-chat-panel-setting-item > span {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: var(--lsc-text-sub);
}

.ls-chat-panel-setting-item > span > i {
    font-size: 18px;
    color: var(--lsc-text-muted);
}

/* 开关组件 */
.ls-chat-switch {
    position: relative;
    display: inline-block;
    width: 40px;
    height: 22px;
    flex-shrink: 0;
}

.ls-chat-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.ls-chat-switch-slider {
    position: absolute;
    cursor: pointer;
    top: 0; left: 0; right: 0; bottom: 0;
    background: var(--lsc-border);
    border-radius: 22px;
    transition: background 0.2s;
}

.ls-chat-switch-slider::before {
    content: '';
    position: absolute;
    width: 18px;
    height: 18px;
    left: 2px;
    bottom: 2px;
    background: #fff;
    border-radius: 50%;
    transition: transform 0.2s;
    box-shadow: 0 1px 3px rgba(0,0,0,0.15);
}

.ls-chat-switch input:checked + .ls-chat-switch-slider {
    background: var(--lsc-primary);
}

.ls-chat-switch input:checked + .ls-chat-switch-slider::before {
    transform: translateX(18px);
}

/* ============================================================
   图片预览弹窗
   ============================================================ */
.ls-chat-lightbox {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10010;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ls-chat-lightbox-mask {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    animation: ls-chat-fade-in 0.2s ease;
}

@keyframes ls-chat-fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

.ls-chat-lightbox-body {
    position: relative;
    z-index: 1;
    max-width: 90vw;
    max-height: 90vh;
    animation: ls-chat-zoom-in 0.25s ease;
}

@keyframes ls-chat-zoom-in {
    from { opacity: 0; transform: scale(0.92); }
    to { opacity: 1; transform: scale(1); }
}

.ls-chat-lightbox-body img {
    display: block;
    max-width: 90vw;
    max-height: 90vh;
    object-fit: contain;
    border-radius: var(--lsc-radius-md);
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.4);
}

.ls-chat-lightbox-toolbar {
    position: absolute;
    top: 0;
    right: -60px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.ls-chat-lightbox-close,
.ls-chat-lightbox-download {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.15);
    color: #FFFFFF;
    cursor: pointer;
    transition: all var(--lsc-transition);
    backdrop-filter: blur(8px);
}

.ls-chat-lightbox-close:hover,
.ls-chat-lightbox-download:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: scale(1.05);
}

.ls-chat-lightbox-close i,
.ls-chat-lightbox-download i {
    font-size: 20px;
}

/* ============================================================
   右键菜单
   ============================================================ */
.ls-chat-context-menu,
.ls-chat-session-menu {
    position: fixed;
    z-index: 10020;
    min-width: 170px;
    background: var(--lsc-bg-white);
    border: 1px solid var(--lsc-border);
    border-radius: var(--lsc-radius);
    box-shadow: var(--lsc-shadow-md);
    padding: 6px 0;
    animation: ls-chat-menu-in 0.12s ease;
}

@keyframes ls-chat-menu-in {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}

.ls-chat-context-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 18px;
    font-size: 14px;
    color: var(--lsc-text);
    cursor: pointer;
    transition: background var(--lsc-transition);
    user-select: none;
    white-space: nowrap;
}

.ls-chat-context-item:hover {
    background: var(--lsc-bg);
}

.ls-chat-context-item:active {
    background: var(--lsc-border-light);
}

.ls-chat-context-item i {
    font-size: 16px;
    color: var(--lsc-text-sub);
    width: 16px;
    text-align: center;
}

.ls-chat-context-item[data-action="delete"] {
    color: var(--lsc-danger);
}

.ls-chat-context-item[data-action="delete"] i {
    color: var(--lsc-danger);
}

.ls-chat-context-item[data-action="delete"]:hover {
    background: #FEF2F2;
}

/* ============================================================
   消息发送状态
   ============================================================ */
.ls-chat-msg-status {
    display: inline-flex;
    align-items: center;
    font-size: 12px;
    margin-top: 2px;
}

.ls-chat-msg-status.ls-sending::after {
    content: '';
    display: inline-block;
    width: 12px;
    height: 12px;
    border: 2px solid var(--lsc-text-muted);
    border-top-color: transparent;
    border-radius: 50%;
    animation: ls-chat-spin 0.8s linear infinite;
}

@keyframes ls-chat-spin {
    to { transform: rotate(360deg); }
}

/* ============================================================
   上传进度条 & 失败状态
   ============================================================ */

/* 进度条：与 .ls-chat-msg-content-wrap 同级，在内容下方 */
.ls-chat-upload-progress {
    margin-top: 6px;
    height: 4px;
    background: var(--lsc-border);
    border-radius: 2px;
    overflow: hidden;
    width: calc(100% - 28px);
}

.ls-chat-upload-bar {
    height: 100%;
    background: var(--lsc-primary);
    border-radius: 2px;
    transition: width 0.3s ease;
}

.ls-chat-upload-fail {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 6px;
    font-size: 12px;
    color: var(--lsc-danger);
    padding-left: 4px;
}

.ls-chat-msg.ls-self .ls-chat-upload-fail {
    padding-left: 0;
    padding-right: 4px;
    justify-content: flex-end;
}

.ls-chat-upload-fail i {
    font-size: 16px;
}

/* ============================================================
   群聊列表
   ============================================================ */
.ls-chat-group-list {
    overflow-y: auto;
    flex: 1;
}

.ls-chat-group-item {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    cursor: pointer;
    transition: all var(--lsc-transition);
    border-radius: var(--lsc-radius);
    margin: 0 8px 6px;
    background: var(--lsc-bg-white);
    box-shadow: var(--lsc-shadow);
}

.ls-chat-group-item:hover {
    box-shadow: 0 0 0 2px rgba(var(--lsc-primary-rgb), 0.5) inset;
}

.ls-chat-group-item.ls-active {
    background: rgba(var(--lsc-primary-rgb), 0.12);
    box-shadow: 0 0 0 2px rgba(var(--lsc-primary-rgb), 0.8) inset;
}

.ls-chat-group-item-avatar {
    width: 42px;
    height: 42px;
    border-radius: 10px;
    overflow: hidden;
    flex-shrink: 0;
    margin-right: 12px;
}

.ls-chat-group-item-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.ls-chat-group-avatar-placeholder {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #E8DFFE, #D0BFFF);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--lsc-primary);
    font-size: 20px;
    border-radius: 10px;
}

.ls-chat-group-item-info {
    flex: 1;
    min-width: 0;
}

.ls-chat-group-item-name {
    font-size: 14px;
    font-weight: 500;
    color: var(--lsc-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ls-chat-group-item-meta {
    font-size: 12px;
    color: var(--lsc-text-light);
    margin-top: 2px;
}

.ls-chat-group-item-meta span + span {
    margin-left: 8px;
}

/* 群聊分类 tab */
.ls-chat-group-tabs {
    display: flex;
    padding: 0 12px 8px;
    gap: 0;
    border-bottom: 1px solid var(--lsc-border);
    margin-bottom: 20px;
}

.ls-chat-group-tab {
    flex: 1;
    text-align: center;
    padding: 6px 0;
    font-size: 12px;
    color: var(--lsc-text-light);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: color 0.2s, border-color 0.2s;
    text-decoration: none;
}

.ls-chat-group-tab:hover {
    color: var(--lsc-text);
}

.ls-chat-group-tab.ls-active {
    font-size: 14px;
    color: var(--lsc-primary);
    font-weight: 600;
}

/* 群聊列表角色标签 */
.ls-group-item-role {
    display: inline-block;
    font-size: 10px;
    padding: 1px 4px;
    border-radius: 3px;
    margin-left: 6px;
    vertical-align: middle;
    line-height: 1.4;
    font-weight: normal;
}

.ls-group-item-role.ls-role-owner {
    color: #e6a23c;
    background: rgba(230, 162, 60, 0.1);
}

.ls-group-item-role.ls-role-admin {
    color: var(--lsc-primary);
    background: rgba(var(--lsc-primary-rgb, 64, 128, 255), 0.1);
}

.ls-group-item-joined {
    display: inline-block;
    font-size: 10px;
    padding: 1px 4px;
    border-radius: 3px;
    margin-left: 6px;
    vertical-align: middle;
    line-height: 1.4;
    font-weight: normal;
    color: var(--lsc-success);
    background: rgba(12, 198, 140, 0.1);
}

/* 聊天设置弹窗 */
.ls-chat-settings-modal {
    padding: 4px 0;
}

.ls-chat-settings-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px;
    margin-bottom: 8px;
    border-radius: 10px;
    background: var(--lsc-bg-light, #f8f9fa);
    transition: background 0.15s;
}

.ls-chat-settings-item:last-child {
    margin-bottom: 0;
}

.ls-chat-settings-left {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
    flex: 1;
}

.ls-chat-settings-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 17px;
}

.ls-chat-settings-icon.blue {
    background: rgba(59, 130, 246, 0.1);
    color: #3b82f6;
}

.ls-chat-settings-icon.green {
    background: rgba(16, 185, 129, 0.1);
    color: #10b981;
}

.ls-chat-settings-info {
    min-width: 0;
}

.ls-chat-settings-label {
    font-size: 14px;
    font-weight: 500;
    color: var(--lsc-text);
    line-height: 1.3;
}

.ls-chat-settings-desc {
    font-size: 12px;
    color: var(--lsc-text-light);
    margin-top: 2px;
    line-height: 1.4;
}

.ls-chat-settings-select {
    appearance: none;
    -webkit-appearance: none;
    border: 1px solid var(--lsc-border);
    border-radius: 8px;
    padding: 6px 30px 6px 10px;
    font-size: 13px;
    color: var(--lsc-text);
    background: var(--lsc-bg, #fff) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23999' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E") no-repeat right 10px center;
    cursor: pointer;
    outline: none;
    transition: border-color 0.15s;
    flex-shrink: 0;
}

.ls-chat-settings-select:hover {
    border-color: var(--lsc-primary);
}

.ls-chat-settings-select:focus {
    border-color: var(--lsc-primary);
    box-shadow: 0 0 0 2px rgba(var(--lsc-primary-rgb, 99, 102, 241), 0.15);
}

/* 群聊消息发送者昵称 */
.ls-chat-msg-name {
    font-size: 12px;
    color: var(--lsc-text-light);
    margin-bottom: 4px;
    padding-left: 2px;
    display: flex;
    align-items: center;
    gap: 4px;
    flex-wrap: wrap;
}

/* 消息昵称旁的徽章（等级/VIP/头衔） */
.ls-chat-msg-badges {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    vertical-align: middle;
}
.ls-chat-msg-badges .ls-mark {
    font-size: 10px;
    line-height: 1;
    padding: 1px 4px;
    transform: scale(0.9);
    transform-origin: left center;
}




/* ============================================================
   Firefox 滚动条兼容
   ============================================================ */
.ls-chat-session-list,
.ls-chat-contact-list,
.ls-chat-group-list {
    scrollbar-width: thin;
    scrollbar-color: transparent transparent;
}
.ls-chat-session-list.ls-scrolling,
.ls-chat-contact-list.ls-scrolling,
.ls-chat-group-list.ls-scrolling {
    scrollbar-color: rgba(0,0,0,0.08) transparent;
}
.ls-chat-messages,
.ls-chat-editor,
.ls-chat-panel-body {
    scrollbar-width: thin;
    scrollbar-color: rgba(0,0,0,0.08) transparent;
}

/* 关注列表 / 群聊列表滚动条 */
.ls-chat-contact-list::-webkit-scrollbar,
.ls-chat-group-list::-webkit-scrollbar { width: 4px; }
.ls-chat-contact-list::-webkit-scrollbar-track,
.ls-chat-group-list::-webkit-scrollbar-track { background: transparent; }
.ls-chat-contact-list::-webkit-scrollbar-thumb,
.ls-chat-group-list::-webkit-scrollbar-thumb { background: transparent; border-radius: 50px; transition: background 0.3s; }
.ls-chat-contact-list.ls-scrolling::-webkit-scrollbar-thumb,
.ls-chat-group-list.ls-scrolling::-webkit-scrollbar-thumb { background: rgba(0,0,0,0.08); }
.ls-chat-contact-list.ls-scrolling::-webkit-scrollbar-thumb:hover,
.ls-chat-group-list.ls-scrolling::-webkit-scrollbar-thumb:hover { background: rgba(0,0,0,0.15); }

/* ============================================================
   表情面板 + LSEditor（聊天页独立引入，不依赖 comment.css）
   ============================================================ */
.ls-emoji-panel {
    width: 360px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.12), 0 2px 8px rgba(0,0,0,0.06);
    overflow: hidden;
    border: 1px solid #e4e4e7;
}

.ls-emoji-tabs {
    display: flex;
    gap: 0;
    padding: 0 6px;
    border-bottom: 1px solid #f4f4f5;
    overflow-x: auto;
}

.ls-emoji-tabs::-webkit-scrollbar { display: none; }

.ls-emoji-tab {
    padding: 8px 10px;
    cursor: pointer;
    font-size: 13px;
    color: #71717a;
    white-space: nowrap;
    border-bottom: 2px solid transparent;
    transition: all 0.15s;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ls-emoji-tab:hover { color: #18181b; }

.ls-emoji-tab.active {
    color: var(--lsc-primary);
    border-bottom-color: var(--lsc-primary);
}

.ls-emoji-tab img { width: 20px; height: 20px; vertical-align: middle; }

.ls-emoji-body {
    padding: 8px;
    max-height: 240px;
    overflow-y: auto;
}

.ls-emoji-body::-webkit-scrollbar { width: 4px; }
.ls-emoji-body::-webkit-scrollbar-thumb { background: rgba(0,0,0,0.08); border-radius: 2px; }

.ls-emoji-group {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(36px, 1fr));
    gap: 2px;
}

.ls-emoji-group[data-type="text"] {
    grid-template-columns: repeat(auto-fill, minmax(auto, max-content));
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.ls-emoji-item {
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border-radius: 6px;
    transition: background 0.1s;
}

.ls-emoji-item:hover { background: #f4f4f5; }

.ls-emoji-img { width: 100%; aspect-ratio: 1; padding: 3px; }
.ls-emoji-img img { width: 100%; height: 100%; object-fit: contain; }

.ls-emoji-text {
    padding: 4px 8px;
    font-size: 13px;
    color: #18181b;
    border-radius: 6px;
    background: #f4f4f5;
}

/* LSEditor */
.ls-editor:empty:not(:focus)::before {
    content: attr(data-placeholder);
    color: #a1a1aa;
    pointer-events: none;
}

.ls-editor .ls-emoji {
    width: auto;
    height: 1.4em;
    vertical-align: middle;
    margin: 0 1px;
}

/* 聊天气泡中的表情 */
.ls-chat-msg-bubble .ls-emoji {
    width: auto;
    height: 1.4em;
    vertical-align: middle;
    margin: 0 1px;
}

/* 关注列表选中态 */
.ls-chat-contact-item.ls-active {
    background: var(--lsc-primary-light);
}

/* ============================================================
   打印样式
   ============================================================ */

/* ============================================================
   聊天记录面板
   ============================================================ */
.ls-chat-history-panel {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.ls-chat-history-search {
    position: sticky;
    top: -24px;
    margin: -24px -20px 0;
    padding: 24px 20px 12px;
    background: var(--lsc-bg-white);
    z-index: 2;
}

.ls-chat-history-date {
    font-size: 12px;
    font-weight: 600;
    color: var(--lsc-text-muted);
    padding: 12px 0 6px;
    border-bottom: 1px solid var(--lsc-border-light);
    margin-bottom: 4px;
}

.ls-chat-history-item {
    display: flex;
    gap: 10px;
    padding: 10px 0;
    cursor: pointer;
    border-radius: var(--lsc-radius-sm);
    transition: background var(--lsc-transition);
}

.ls-chat-history-item:hover {
    background: var(--lsc-bg);
}

.ls-chat-history-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.ls-chat-history-info {
    flex: 1;
    min-width: 0;
}

.ls-chat-history-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 2px;
}

.ls-chat-history-name {
    font-size: 13px;
    font-weight: 500;
    color: var(--lsc-text);
}

.ls-chat-history-time {
    font-size: 11px;
    color: var(--lsc-text-muted);
    flex-shrink: 0;
}

.ls-chat-history-content {
    font-size: 13px;
    color: var(--lsc-text-muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ls-chat-history-item.ls-chat-history-system {
    justify-content: center;
    align-items: center;
    gap: 6px;
    cursor: default;
    padding: 6px 0;
}

.ls-chat-history-item.ls-chat-history-system:hover {
    background: transparent;
}

.ls-chat-history-system-text {
    font-size: 12px;
    color: var(--lsc-text-muted);
    display: flex;
    align-items: center;
    gap: 4px;
}

.ls-chat-history-system-text i {
    font-size: 14px;
}

.ls-chat-history-item.ls-chat-history-system .ls-chat-history-time {
    font-size: 11px;
}

.ls-chat-history-more {
    text-align: center;
    padding: 12px 0;
}

/* ============================================================
   粘贴图片确认弹窗
   ============================================================ */
.ls-chat-paste-dialog {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10030;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ls-chat-paste-mask {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
}

.ls-chat-paste-content {
    position: relative;
    z-index: 1;
    width: 480px;
    max-width: 90vw;
    background: var(--lsc-bg-white);
    border-radius: var(--lsc-radius);
    box-shadow: var(--lsc-shadow-md);
    animation: ls-chat-zoom-in 0.2s ease;
}

.ls-chat-paste-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--lsc-border);
    font-size: 15px;
    font-weight: 600;
    color: var(--lsc-text);
}

.ls-chat-paste-close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border: none;
    background: transparent;
    border-radius: 50%;
    color: var(--lsc-text-muted);
    cursor: pointer;
    transition: all var(--lsc-transition);
}

.ls-chat-paste-close:hover {
    background: var(--lsc-bg);
    color: var(--lsc-text);
}

.ls-chat-paste-preview {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 16px 20px;
    max-height: 300px;
    overflow-y: auto;
}

.ls-paste-img-item {
    position: relative;
    width: 100px;
    height: 100px;
    border-radius: var(--lsc-radius-md);
    overflow: hidden;
    border: 1px solid var(--lsc-border);
}

.ls-paste-img-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.ls-paste-img-remove {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 22px;
    height: 22px;
    border: none;
    background: rgba(0, 0, 0, 0.5);
    color: #fff;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    opacity: 0;
    transition: opacity var(--lsc-transition);
}

.ls-paste-img-item:hover .ls-paste-img-remove {
    opacity: 1;
}

.ls-chat-paste-input-wrap {
    padding: 0 20px 16px;
}

.ls-chat-paste-input {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--lsc-border);
    border-radius: var(--lsc-radius-md);
    font-size: 14px;
    color: var(--lsc-text);
    outline: none;
    background: var(--lsc-bg);
    transition: border-color var(--lsc-transition);
}

.ls-chat-paste-input:focus {
    border-color: var(--lsc-primary);
}

.ls-chat-paste-input::placeholder {
    color: var(--lsc-text-muted);
}

.ls-chat-paste-footer {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    padding: 0 20px 16px;
}

.ls-chat-paste-cancel,
.ls-chat-paste-confirm {
    padding: 8px 20px;
    border: none;
    border-radius: var(--lsc-radius-sm);
    font-size: 14px;
    cursor: pointer;
    transition: all var(--lsc-transition);
}

.ls-chat-paste-cancel {
    background: var(--lsc-bg);
    color: var(--lsc-text-sub);
}

.ls-chat-paste-cancel:hover {
    background: var(--lsc-border);
}

.ls-chat-paste-confirm {
    background: var(--lsc-primary);
    color: #fff;
}

.ls-chat-paste-confirm:hover {
    background: var(--lsc-primary-hover);
}
/* ============================================================
   视频播放弹窗
   ============================================================ */
.ls-chat-video-dialog {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10010;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ls-chat-video-body {
    position: relative;
    z-index: 1;
    max-width: 90vw;
    max-height: 90vh;
    animation: ls-chat-zoom-in 0.25s ease;
}

.ls-chat-video-body video {
    display: block;
    max-width: 90vw;
    max-height: 90vh;
    border-radius: var(--lsc-radius-md);
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.4);
    outline: none;
}

/* ============================================================
   位置弹窗
   ============================================================ */
.ls-chat-location-dialog {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10030;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ls-chat-location-content {
    position: relative;
    z-index: 1;
    width: 560px;
    max-width: 90vw;
    background: var(--lsc-bg-white);
    border-radius: var(--lsc-radius);
    box-shadow: var(--lsc-shadow-md);
    animation: ls-chat-zoom-in 0.2s ease;
    overflow: hidden;
}

.ls-chat-location-addr {
    padding: 0 20px 12px;
    font-size: 13px;
    color: var(--lsc-text-muted);
}

.ls-chat-location-map-wrap {
    width: 100%;
    height: 360px;
    background: var(--lsc-bg);
}

.ls-chat-location-map-wrap iframe {
    width: 100%;
    height: 100%;
    border: none;
}

.ls-chat-location-no-img {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--lsc-text-muted);
}
.ls-chat-location-no-img i { font-size: 48px; margin-bottom: 8px; }
.ls-chat-location-no-img p { font-size: 14px; }


/* ==================== 创建群聊弹窗 ==================== */

.ls-create-group {
    display: flex;
    flex-direction: column;
    max-height: 480px;
}

.ls-create-group-selected {
    padding: 0 0 10px;
    border-bottom: 1px solid var(--lsc-border);
}

.ls-create-group-selected-list {
    display: flex;
    gap: 8px;
    padding: 4px 0;
    overflow-x: auto;
    min-height: 48px;
    align-items: center;
}

.ls-cg-selected-item {
    position: relative;
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    overflow: visible;
    cursor: pointer;
}

.ls-cg-selected-item img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
}

.ls-cg-selected-remove {
    position: absolute;
    top: -4px;
    right: -4px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--lsc-danger, #f56c6c);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    opacity: 0;
    transition: opacity 0.15s;
}

.ls-cg-selected-item:hover .ls-cg-selected-remove {
    opacity: 1;
}

.ls-create-group-count {
    font-size: 12px;
    color: var(--lsc-text-muted);
    margin-top: 6px;
}

.ls-create-group-search {
    padding: 10px 0;
}

.ls-create-group-list {
    flex: 1;
    overflow-y: auto;
    max-height: 320px;
    min-height: 120px;
}

.ls-cg-user {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 6px;
    border-radius: var(--lsc-radius-sm, 6px);
    cursor: pointer;
    transition: background 0.15s;
}

.ls-cg-user:hover {
    background: var(--lsc-bg-hover, rgba(0,0,0,0.04));
}

.ls-cg-user-disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.ls-cg-user-disabled:hover {
    background: transparent;
}

.ls-cg-checkbox {
    position: relative;
    display: flex;
    align-items: center;
    cursor: pointer;
}

.ls-cg-checkbox input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.ls-cg-check-mark {
    width: 18px;
    height: 18px;
    border: 2px solid var(--lsc-border-dark, #c0c4cc);
    border-radius: 4px;
    transition: all 0.15s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ls-cg-checkbox input:checked + .ls-cg-check-mark {
    background: var(--lsc-primary);
    border-color: var(--lsc-primary);
}

.ls-cg-checkbox input:checked + .ls-cg-check-mark::after {
    content: '';
    width: 5px;
    height: 9px;
    border: solid #fff;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
    margin-top: -2px;
}

.ls-cg-user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.ls-cg-user-name {
    font-size: 14px;
    color: var(--lsc-text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ==================== 群聊详情面板 ==================== */

.ls-group-info-panel {
    padding: 0;
}

.ls-group-info-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px 16px 16px;
    text-align: center;
}

.ls-group-info-avatar {
    width: 64px;
    height: 64px;
    border-radius: 12px;
    object-fit: cover;
    margin-bottom: 10px;
}

.ls-group-info-avatar-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--lsc-primary), #7c5ce0);
    color: #fff;
    font-size: 28px;
}

.ls-group-info-name-row {
    display: flex;
    align-items: center;
    gap: 6px;
}

.ls-group-info-name {
    font-size: 16px;
    font-weight: 600;
    color: var(--lsc-text);
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ls-group-info-edit-btn {
    background: none;
    border: none;
    color: var(--lsc-text-muted);
    cursor: pointer;
    padding: 2px 4px;
    font-size: 14px;
    border-radius: 4px;
    transition: color 0.15s, background 0.15s;
}

.ls-group-info-edit-btn:hover {
    color: var(--lsc-primary);
    background: var(--lsc-bg-hover, rgba(0,0,0,0.04));
}

.ls-group-info-meta {
    font-size: 12px;
    color: var(--lsc-text-muted);
    margin-top: 4px;
}

.ls-group-info-section {
    padding: 12px 16px;
    border-top: 1px solid var(--lsc-border);
}

.ls-group-info-section-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 13px;
    font-weight: 600;
    color: var(--lsc-text);
    margin-bottom: 10px;
}

.ls-group-info-notice {
    font-size: 13px;
    color: var(--lsc-text-secondary, #666);
    line-height: 1.5;
    word-break: break-all;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.ls-text-muted {
    color: var(--lsc-text-muted) !important;
}

/* 群成员网格 - 见文件末尾统一样式 */

/* 群聊操作按钮 */
.ls-group-info-actions {
    padding: 16px;
    border-top: 1px solid var(--lsc-border);
}

.ls-btn-block {
    display: block;
    width: 100%;
}

.ls-btn-warning {
    background: #e6a23c;
    color: #fff;
    border: none;
    padding: 8px 16px;
    border-radius: var(--lsc-radius-sm, 6px);
    cursor: pointer;
    font-size: 14px;
    transition: opacity 0.15s;
}

.ls-btn-warning:hover {
    opacity: 0.85;
}

.ls-btn-danger {
    background: var(--lsc-danger, #f56c6c);
    color: #fff;
    border: none;
    padding: 8px 16px;
    border-radius: var(--lsc-radius-sm, 6px);
    cursor: pointer;
    font-size: 14px;
    transition: opacity 0.15s;
}

.ls-btn-danger:hover {
    opacity: 0.85;
}

/* 会话列表群聊头像 */
.ls-chat-group-avatar-img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
}

/* 弹窗按钮 */
.ls-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 20px;
    border-radius: var(--lsc-radius-sm, 6px);
    font-size: 14px;
    cursor: pointer;
    transition: opacity 0.15s;
    border: none;
    line-height: 1.4;
}

.ls-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.ls-btn-default {
    background: var(--lsc-bg);
    color: var(--lsc-text);
    border: 1px solid var(--lsc-border);
}

.ls-btn-default:hover:not(:disabled) {
    background: var(--lsc-bg-hover, rgba(0,0,0,0.04));
}

.ls-btn-primary {
    background: var(--lsc-primary);
    color: #fff;
}

.ls-btn-primary:hover:not(:disabled) {
    opacity: 0.85;
}

/* ============================================================
   群聊会话标识
   ============================================================ */
.ls-chat-session-group-tag {
    position: absolute;
    bottom: -1px;
    right: -1px;
    width: 18px;
    height: 18px;
    background: var(--lsc-primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--lsc-bg-white);
}

.ls-chat-session-group-tag i {
    font-size: 10px;
    color: #fff;
}

.ls-chat-session-avatar {
    position: relative;
    flex-shrink: 0;
}

/* ============================================================
   系统消息样式优化
   ============================================================ */
.ls-chat-msg-system {
    text-align: center;
    padding: 12px 0;
    user-select: none;
}

.ls-chat-msg-system span {
    font-size: 12px;
    color: var(--lsc-text-muted);
    background: rgba(0, 0, 0, 0.04);
    padding: 5px 16px;
    border-radius: 20px;
    line-height: 1.6;
    display: inline-block;
    max-width: 80%;
    word-break: break-all;
}

/* ============================================================
   群聊公告栏
   ============================================================ */
.ls-chat-notice-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: linear-gradient(135deg, #FFF8E1 0%, #FFF3CD 100%);
    border-bottom: 1px solid #FFE082;
    flex-shrink: 0;
    animation: noticeSlideIn 0.3s ease;
}

@keyframes noticeSlideIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

.ls-chat-notice-bar > i {
    font-size: 16px;
    color: #F59E0B;
    flex-shrink: 0;
}

.ls-chat-notice-text {
    flex: 1;
    font-size: 13px;
    color: #92400E;
    cursor: pointer;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ls-chat-notice-text:hover {
    text-decoration: underline;
}

.ls-chat-notice-close {
    background: none;
    border: none;
    padding: 2px;
    color: #92400E;
    opacity: 0.5;
    cursor: pointer;
    flex-shrink: 0;
}

.ls-chat-notice-close:hover {
    opacity: 1;
}

/* 公告全文弹窗 */
.ls-group-notice-full {
    padding: 16px;
    font-size: 14px;
    line-height: 1.8;
    color: var(--lsc-text);
    max-height: 400px;
    overflow-y: auto;
    word-break: break-all;
}

/* ============================================================
   全员禁言提示
   ============================================================ */
.ls-chat-header-mute-tag {
    display: flex;
    align-items: center;
    flex-shrink: 0;
    gap: 3px;
    color: #DC2626;
    font-size: 11px;
    background: #FEF2F2;
    padding: 1px 6px;
    border-radius: 3px;
    white-space: nowrap;
}

.ls-chat-header-mute-tag i {
    font-size: 13px;
}

.ls-chat-mute-tip {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 16px 10px;
    background: #FEF2F2;
    color: #DC2626;
    font-size: 13px;
    border-top: 1px solid #FECACA;
    flex-shrink: 0;
}

.ls-chat-mute-tip i {
    font-size: 16px;
}

.ls-group-mute-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    color: #DC2626;
    background: #FEF2F2;
    padding: 2px 10px;
    border-radius: 12px;
    margin-top: 4px;
}

.ls-group-mute-badge i {
    font-size: 13px;
}

/* ============================================================
   群头像上传按钮
   ============================================================ */
.ls-group-info-avatar-wrap {
    position: relative;
    display: inline-block;
}

.ls-group-avatar-upload-btn {
    position: absolute;
    top: -5px;
    right: -10px;
    width: 26px;
    height: 26px;
    background: var(--lsc-primary);
    color: #fff;
    border: 2px solid var(--lsc-bg-white);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.15s;
}

.ls-group-avatar-upload-btn:hover {
    background: var(--lsc-primary-hover);
    transform: scale(1.1);
}

/* ============================================================
   群成员网格优化
   ============================================================ */
.ls-group-members-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 8px;
    padding: 8px 0;
}

.ls-group-member-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    cursor: pointer;
    padding: 6px 2px;
    border-radius: var(--lsc-radius-sm);
    transition: background 0.15s;
    position: relative;
    min-width: 0;
}

.ls-group-member-item img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.ls-group-member-avatar-wrap {
    position: relative;
    width: 40px;
    height: 40px;
    flex-shrink: 0;
}

.ls-group-member-avatar-wrap img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
}

/* 群主/管理员角色徽章（头像右上角） */
.ls-group-role-badge {
    position: absolute;
    top: -2px;
    right: -2px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    border: 1.5px solid #fff;
    z-index: 1;
}

.ls-group-role-badge.ls-role-owner {
    background: #FF9500;
    color: #fff;
}

.ls-group-role-badge.ls-role-admin {
    background: var(--lsc-primary);
    color: #fff;
}

.ls-group-role-badge i {
    font-size: 9px;
}

/* 邀请按钮（虚线圆圈） */
.ls-group-member-add-circle {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1.5px dashed var(--lsc-border);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--lsc-text-muted);
    font-size: 18px;
    transition: all 0.15s;
}

.ls-group-member-add:hover .ls-group-member-add-circle {
    border-color: var(--lsc-primary);
    color: var(--lsc-primary);
    background: var(--lsc-primary-light);
}

.ls-group-member-name {
    font-size: 11px;
    color: var(--lsc-text-sub);
    text-align: center;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 100%;
}

/* 查看全部成员按钮 */
.ls-group-view-all-members {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    width: 100%;
    padding: 8px;
    background: none;
    border: 1px dashed var(--lsc-border);
    border-radius: var(--lsc-radius-sm);
    color: var(--lsc-primary);
    font-size: 13px;
    cursor: pointer;
    transition: all 0.15s;
    margin-top: 4px;
}

.ls-group-view-all-members:hover {
    background: var(--lsc-primary-light);
    border-color: var(--lsc-primary);
}

/* ============================================================
   全部成员面板（右侧覆盖详情面板）
   ============================================================ */
.ls-group-members-panel {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.ls-group-members-panel-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 14px 16px;
    border-bottom: 1px solid var(--lsc-border-light);
    font-size: 14px;
    font-weight: 500;
    flex-shrink: 0;
}

.ls-group-members-panel-back {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border: none;
    background: none;
    border-radius: var(--lsc-radius-sm);
    color: var(--lsc-text-sub);
    font-size: 18px;
    cursor: pointer;
    transition: all 0.15s;
}

.ls-group-members-panel-back:hover {
    background: rgba(0, 0, 0, 0.05);
    color: var(--lsc-text);
}

.ls-group-members-panel-list {
    flex: 1;
    overflow-y: auto;
    padding: 4px 0;
}

.ls-group-members-panel-list::-webkit-scrollbar { width: 4px; }
.ls-group-members-panel-list::-webkit-scrollbar-track { background: transparent; }
.ls-group-members-panel-list::-webkit-scrollbar-thumb { background: rgba(0,0,0,0.1); border-radius: 50px; }
.ls-group-members-panel-list::-webkit-scrollbar-thumb:hover { background: rgba(0,0,0,0.2); }

.ls-group-members-loading {
    text-align: center;
    padding: 12px 0;
    font-size: 12px;
    color: var(--lsc-text-muted);
}

/* ============================================================
   全部成员弹窗
   ============================================================ */
.ls-group-all-members {
    max-height: 450px;
    overflow-y: auto;
    padding: 8px 0;
}

.ls-group-all-member-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    cursor: pointer;
    transition: background 0.15s;
    border-radius: var(--lsc-radius-sm);
}

.ls-group-all-member-item:hover {
    background: rgba(0, 0, 0, 0.03);
}

.ls-group-all-member-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

/* 全部成员列表头像容器（用于在线绿点定位） */
.ls-group-all-member-avatar-wrap {
    position: relative;
    flex-shrink: 0;
    width: 40px;
    height: 40px;
}
.ls-group-all-member-avatar-wrap .ls-group-all-member-avatar {
    width: 100%;
    height: 100%;
}

.ls-group-all-member-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.ls-group-all-member-name {
    font-size: 14px;
    color: var(--lsc-text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ls-group-all-member-time {
    font-size: 12px;
    color: var(--lsc-text-muted);
}

/* 全部成员列表 - 角色/禁言标签 */
.ls-group-role-tag {
    display: inline-block;
    font-size: 10px;
    padding: 1px 5px;
    border-radius: 3px;
    margin-left: 4px;
    vertical-align: middle;
    line-height: 1.4;
    font-weight: 500;
}

.ls-group-role-tag.ls-role-owner {
    color: #e6a23c;
    background: rgba(230, 162, 60, 0.1);
}

.ls-group-role-tag.ls-role-admin {
    color: var(--lsc-primary);
    background: rgba(var(--lsc-primary-rgb, 64, 128, 255), 0.1);
}

.ls-group-role-tag.ls-role-muted {
    color: var(--lsc-danger);
    background: rgba(var(--lsc-danger-rgb, 245, 63, 63), 0.1);
}

.ls-group-role-tag.ls-role-muted i {
    font-size: 10px;
    margin-right: 1px;
}

/* 被禁言成员行 */
.ls-group-all-member-item.ls-member-muted .ls-group-all-member-time {
    color: var(--lsc-danger);
}

/* ============================================================
   管理入口
   ============================================================ */
.ls-group-info-manage {
    padding: 8px 0;
}

.ls-group-manage-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    width: 100%;
    padding: 10px 14px;
    background: none;
    border: 1px solid var(--lsc-border);
    border-radius: var(--lsc-radius-sm);
    color: var(--lsc-text-sub);
    font-size: 13px;
    cursor: pointer;
    transition: all 0.15s;
    margin-bottom: 10px;
}

.ls-group-manage-btn:hover {
    background: rgba(0, 0, 0, 0.03);
    border-color: var(--lsc-text-muted);
}

.ls-group-manage-btn i {
    font-size: 16px;
}

/* ============================================================
   黑名单弹窗
   ============================================================ */
.ls-group-blacklist {
    max-height: 400px;
    overflow-y: auto;
    padding: 8px 0;
}

.ls-group-blacklist-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    border-bottom: 1px solid var(--lsc-border-light);
}

.ls-group-blacklist-item:last-child {
    border-bottom: none;
}

.ls-group-blacklist-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.ls-group-blacklist-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.ls-group-blacklist-name {
    font-size: 14px;
    color: var(--lsc-text);
}

.ls-group-blacklist-time {
    font-size: 12px;
    color: var(--lsc-text-muted);
}

.ls-btn-sm {
    padding: 4px 12px;
    font-size: 12px;
}

/* ============================================================
   发起群聊弹窗优化（滚动条）
   ============================================================ */
.ls-create-group-list::-webkit-scrollbar { width: 4px; }
.ls-create-group-list::-webkit-scrollbar-track { background: transparent; }
.ls-create-group-list::-webkit-scrollbar-thumb { background: rgba(0,0,0,0.1); border-radius: 50px; }
.ls-create-group-list::-webkit-scrollbar-thumb:hover { background: rgba(0,0,0,0.2); }

.ls-group-all-members::-webkit-scrollbar { width: 4px; }
.ls-group-all-members::-webkit-scrollbar-track { background: transparent; }
.ls-group-all-members::-webkit-scrollbar-thumb { background: rgba(0,0,0,0.1); border-radius: 50px; }

.ls-group-blacklist::-webkit-scrollbar { width: 4px; }
.ls-group-blacklist::-webkit-scrollbar-track { background: transparent; }
.ls-group-blacklist::-webkit-scrollbar-thumb { background: rgba(0,0,0,0.1); border-radius: 50px; }

.ls-group-notice-full::-webkit-scrollbar { width: 4px; }
.ls-group-notice-full::-webkit-scrollbar-track { background: transparent; }
.ls-group-notice-full::-webkit-scrollbar-thumb { background: rgba(0,0,0,0.1); border-radius: 50px; }

/* 公告区域点击样式 */
.ls-group-notice-clickable {
    cursor: pointer;
    transition: color 0.15s;
}

.ls-group-notice-clickable:hover {
    color: var(--lsc-primary);
}

.ls-text-link {
    color: var(--lsc-primary);
    font-size: 12px;
}

/* ==================== 聊天记录中的通话消息 ==================== */

.ls-chat-msg-call {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    border-radius: 12px;
    background: var(--lsc-card-bg, #fff);
    border: 1px solid var(--lsc-border, #eee);
    cursor: default;
    min-width: 160px;
}
.ls-call-msg-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
}
.ls-call-msg-text {
    font-size: 13px;
    color: var(--lsc-text-secondary, #666);
    line-height: 1.4;
}

/* 通话完成 - 绿色图标 */
.ls-call-completed .ls-call-msg-icon {
    background: rgba(46, 213, 115, 0.1);
    color: #2ED573;
}
/* 未接/拒绝/取消/忙线 - 红色图标 */
.ls-call-rejected .ls-call-msg-icon,
.ls-call-missed .ls-call-msg-icon,
.ls-call-cancelled .ls-call-msg-icon,
.ls-call-busy .ls-call-msg-icon {
    background: rgba(255, 71, 87, 0.1);
    color: #FF4757;
}

/* 挂断/拒绝图标旋转 135° 模拟挂断电话 */
.ls-call-icon-hangup {
    display: inline-block;
    transform: rotate(135deg);
}

/* ==================== 群聊邀请卡片 ==================== */

.ls-chat-msg-group-invite {
    width: 260px;
    border-radius: 12px;
    background: var(--lsc-bg-card, #fff);
    border: 1px solid var(--lsc-border, rgba(0,0,0,0.06));
    overflow: hidden;
}

.ls-gi-body {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px;
}

.ls-gi-avatar {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    object-fit: cover;
    flex-shrink: 0;
}

.ls-gi-avatar-default {
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--lsc-primary-light, rgba(79,70,229,0.08));
    color: var(--lsc-primary, #4F46E5);
    font-size: 22px;
}

.ls-gi-info {
    flex: 1;
    min-width: 0;
}

.ls-gi-group-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--lsc-text, #1a1a1a);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ls-gi-inviter {
    font-size: 12px;
    color: var(--lsc-text-secondary, #888);
    margin-top: 3px;
}

.ls-gi-actions {
    display: flex;
    gap: 8px;
    padding: 0 14px 14px;
    justify-content: flex-end;
}

.ls-gi-actions .ls-btn-sm {
    padding: 5px 14px;
    font-size: 12px;
    border-radius: 6px;
}

.ls-gi-status {
    padding: 8px 14px 14px;
    font-size: 12px;
    text-align: center;
    display: flex;
    justify-content: center;
    align-items: center;
}

.ls-gi-status i {
    font-size: 16px;
}

.ls-gi-accepted {
    color: #10B981;
}

.ls-gi-rejected {
    color: #888;
}

.ls-gi-expired {
    color: #F59E0B;
}

/* ==================== 入群审批 ==================== */

/* 角标（通用：面板按钮 + 右上角 info 按钮） */
.ls-group-apply-badge,
.ls-group-apply-header-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    background: var(--lsc-danger);
    color: #FFF;
    font-size: 11px;
    font-weight: 600;
    line-height: 18px;
    border-radius: 9px;
    white-space: nowrap;
}

.ls-group-apply-badge {
    margin-left: 6px;
}

.ls-group-apply-header-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    border: 2px solid var(--lsc-bg-white);
    z-index: 2;
}

/* 审批列表 */
.ls-group-apply-list {
    max-height: 400px;
    overflow-y: auto;
}

.ls-group-apply-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid var(--lsc-border);
}

.ls-group-apply-item:last-child {
    border-bottom: none;
}

.ls-group-apply-user {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    min-width: 0;
}

.ls-group-apply-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    flex-shrink: 0;
    object-fit: cover;
}

.ls-group-apply-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.ls-group-apply-name {
    font-size: 14px;
    font-weight: 500;
    color: var(--lsc-text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ls-group-apply-msg {
    font-size: 12px;
    color: var(--lsc-text-secondary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ls-group-apply-time {
    font-size: 11px;
    color: var(--lsc-text-muted);
}

.ls-group-apply-actions {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
    margin-left: 10px;
}

/* ============================================================
   @提醒功能
   ============================================================ */

/* @选人面板 */
.ls-chat-mention-panel {
    position: absolute;
    bottom: 100%;
    left: 0;
    right: 0;
    max-height: 240px;
    overflow-y: auto;
    background: var(--lsc-bg-white);
    border: 1px solid var(--lsc-border);
    border-radius: var(--lsc-radius-sm);
    box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.08);
    z-index: 10;
}

.ls-chat-mention-panel::-webkit-scrollbar { width: 4px; }
.ls-chat-mention-panel::-webkit-scrollbar-track { background: transparent; }
.ls-chat-mention-panel::-webkit-scrollbar-thumb { background: rgba(0, 0, 0, 0.1); border-radius: 50px; }

.ls-chat-mention-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    cursor: pointer;
    transition: background var(--lsc-transition);
}

.ls-chat-mention-item:hover,
.ls-chat-mention-item.ls-active {
    background: var(--lsc-primary-light);
}

.ls-chat-mention-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.ls-chat-mention-all-icon {
    width: 28px;
    height: 28px;
    line-height: 28px;
    text-align: center;
    background: var(--lsc-primary-light);
    color: var(--lsc-primary);
    border-radius: 50%;
    font-size: 16px;
    flex-shrink: 0;
}

.ls-chat-mention-name {
    font-size: 13px;
    color: var(--lsc-text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* @标签（编辑器内） */
.ls-chat-at-tag {
    color: var(--lsc-primary);
    background: var(--lsc-primary-light);
    padding: 1px 4px;
    border-radius: 3px;
    font-size: inherit;
    user-select: none;
}

/* @标记（消息气泡内，不加特殊颜色） */
.ls-chat-at-highlight {
    cursor: default;
}

/* 会话列表 @标记 */
.ls-chat-at-badge {
    color: #ff5722;
    font-size: 11px;
    font-weight: 500;
    white-space: nowrap;
}

/* @消息导航条 - 浮动胶囊样式 */
.ls-chat-mention-bar {
    position: sticky;
    top: 8px;
    z-index: 5;
    display: flex;
    align-items: center;
    gap: 8px;
    width: fit-content;
    margin: 0 auto 4px;
    padding: 7px 14px;
    background: #f6aa14;
    color: rgba(255, 255, 255, 0.9);
    font-size: 13px;
    cursor: pointer;
    border-radius: 20px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.15);
    transition: transform 0.2s, box-shadow 0.2s;
}

.ls-chat-mention-bar:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

.ls-chat-mention-bar .remix-icon {
    font-size: 15px;
}

.ls-chat-mention-bar-count {
    font-weight: 600;
    color: #fff;
}

.ls-chat-mention-bar-btn {
    margin-left: 4px;
    padding: 2px 10px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 12px;
    font-size: 12px;
    color: #fff;
    transition: background 0.2s;
}

.ls-chat-mention-bar-btn:hover {
    background: rgba(255, 255, 255, 0.25);
}

.ls-chat-mention-bar-close {
    margin-left: 2px;
    font-size: 15px;
    cursor: pointer;
    opacity: 0.7;
    transition: opacity 0.2s;
}

.ls-chat-mention-bar-close:hover {
    opacity: 1;
}

/* 消息高亮闪烁（跳转定位时） */
.ls-chat-msg-highlight {
    animation: mention-flash 2s ease;
}

@keyframes mention-flash {
    0%, 50% { background: var(--lsc-primary-light); }
    100% { background: transparent; }
}

/* ==================== 群文件面板 ==================== */
.ls-group-files-panel {
    padding: 0;
}

.ls-group-file-item {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    cursor: pointer;
    transition: background .15s;
    border-bottom: 1px solid var(--lsc-border, rgba(0,0,0,.06));
}

.ls-group-file-item:hover {
    background: var(--lsc-hover, rgba(0,0,0,.03));
}

.ls-group-file-icon {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    background: var(--lsc-primary-light, rgba(var(--lsc-primary-rgb, 64,128,255), .1));
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 18px;
    color: var(--lsc-primary, #4080ff);
}

.ls-group-file-info {
    flex: 1;
    min-width: 0;
    margin: 0 12px;
}

.ls-group-file-name {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: var(--lsc-text, #1a1a1a);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ls-group-file-meta {
    display: block;
    font-size: 11px;
    color: var(--lsc-text-3, #999);
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ls-group-file-download {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    color: var(--lsc-text-3, #999);
    transition: all .15s;
}

.ls-group-file-item:hover .ls-group-file-download {
    color: var(--lsc-primary, #4080ff);
    background: var(--lsc-primary-light, rgba(var(--lsc-primary-rgb, 64,128,255), .08));
}

.ls-group-files-more {
    padding: 12px;
    text-align: center;
}

/* ==================== 群相册面板 ==================== */
.ls-group-images-panel {
    padding: 8px;
}

.ls-group-images-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 4px;
}

.ls-group-image-item {
    position: relative;
    aspect-ratio: 1;
    overflow: hidden;
    border-radius: 4px;
    cursor: pointer;
    background: var(--lsc-bg-2, #f5f5f5);
}

.ls-group-image-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .2s;
}

.ls-group-image-item:hover img {
    transform: scale(1.05);
}

.ls-group-images-grid .ls-chat-empty-tip {
    grid-column: 1 / -1;
}

.ls-group-images-grid .ls-chat-list-loading {
    grid-column: 1 / -1;
}

/* ==================== 分享卡片消息（微信风格） ==================== */

.ls-chat-msg-share {
    display: block;
    width: 240px;
    border-radius: 8px;
    background: var(--lsc-bg-card, #fff);
    border: 1px solid var(--lsc-border, rgba(0,0,0,0.06));
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    transition: background .15s;
}

.ls-chat-msg-share:hover {
    background: var(--lsc-hover, #fafafa);
}

/* 主体：左文右图 */
.ls-chat-share-body {
    display: flex;
    gap: 10px;
    padding: 12px;
    align-items: flex-start;
}

.ls-chat-share-text {
    flex: 1;
    min-width: 0;
}

.ls-chat-share-title {
    font-size: 13px;
    font-weight: 500;
    color: var(--lsc-text, #1a1a1a);
    line-height: 1.45;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    word-break: break-all;
}

.ls-chat-share-desc {
    font-size: 12px;
    color: var(--lsc-text-secondary, #999);
    margin-top: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* 缩略图 */
.ls-chat-share-thumb {
    width: 44px;
    height: 44px;
    border-radius: 6px;
    overflow: hidden;
    flex-shrink: 0;
    position: relative;
    background: #f0f0f0;
}

.ls-chat-share-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.ls-chat-share-thumb-user {
    border-radius: 50%;
}

.ls-chat-share-thumb-video::after {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,.15);
}

.ls-chat-share-dur {
    position: absolute;
    bottom: 2px;
    right: 2px;
    font-size: 9px;
    color: #fff;
    background: rgba(0,0,0,.55);
    padding: 0 3px;
    border-radius: 2px;
    line-height: 14px;
    z-index: 1;
}

/* 底部来源条 */
.ls-chat-share-bottom {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 0 12px 10px;
    font-size: 11px;
    color: var(--lsc-text-secondary, #999);
}

.ls-chat-share-bottom i {
    font-size: 12px;
}

.ls-chat-share-from {
    margin-left: auto;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 80px;
}
