/* 商家端客服聊天 - 工作台风格（冷色，与顾客端暖橙区分） */

#page-chat {
    --ac-bg: #e8eef5;
    --ac-panel: #f4f7fb;
    --ac-surface: #ffffff;
    --ac-line: #d5dee8;
    --ac-text: #1e293b;
    --ac-muted: #64748b;
    --ac-accent: #2563eb;
    --ac-accent-soft: #dbeafe;
    --ac-self-bubble: #bfdbfe;
    --ac-hover: #eef4ff;
    --ac-online: #16a34a;
    --ac-danger: #e11d48;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

#page-chat .admin-chat-page-header {
    flex-shrink: 0;
}

.admin-chat-layout {
    display: flex;
    height: calc(100vh - 140px);
    min-height: 420px;
    background: var(--ac-surface);
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--ac-line);
}

.admin-chat-sidebar {
    width: 300px;
    border-right: 1px solid var(--ac-line);
    display: flex;
    flex-direction: column;
    background: var(--ac-panel);
    min-width: 240px;
    min-height: 0;
}

.admin-chat-tabs {
    display: flex;
    gap: 4px;
    padding: 10px 10px 0;
    flex-shrink: 0;
    background: var(--ac-panel);
}

.admin-chat-tab {
    flex: 1;
    height: 36px;
    border: none;
    border-radius: 10px 10px 0 0;
    background: transparent;
    color: var(--ac-muted);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    position: relative;
}

.admin-chat-tab.active {
    background: var(--ac-surface);
    color: var(--ac-accent);
    box-shadow: 0 -1px 0 var(--ac-surface);
}

.admin-chat-tab.active::after {
    content: '';
    position: absolute;
    left: 18%;
    right: 18%;
    bottom: 0;
    height: 2px;
    border-radius: 2px;
    background: var(--ac-accent);
}

.admin-chat-tab-badge {
    display: inline-block;
    margin-left: 6px;
    min-width: 16px;
    height: 16px;
    padding: 0 5px;
    border-radius: 999px;
    background: var(--ac-danger);
    color: #fff;
    font-size: 10px;
    line-height: 16px;
    text-align: center;
    vertical-align: middle;
    font-weight: 700;
}

.admin-chat-sidebar-title {
    padding: 14px 16px;
    font-weight: 700;
    color: var(--ac-text);
    border-bottom: 1px solid var(--ac-line);
    flex-shrink: 0;
}

.admin-chat-sidebar-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding-right: 10px;
    border-bottom: 1px solid var(--ac-line);
    flex-shrink: 0;
}

.admin-chat-sidebar-head .admin-chat-sidebar-title {
    border-bottom: none;
    flex: 1;
}

.admin-chat-colleague-btn {
    flex-shrink: 0;
    height: 28px;
    padding: 0 10px;
    border: 1px solid var(--ac-line);
    border-radius: 8px;
    background: var(--ac-surface);
    color: var(--ac-accent);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
}

.admin-chat-colleague-panel {
    flex: 1;
    min-height: 0;
    max-height: none;
    overflow: auto;
    border-bottom: none;
    background: var(--ac-surface);
    display: flex;
    flex-direction: column;
}

.admin-chat-colleague-hint {
    padding: 10px 14px 6px;
    font-size: 12px;
    color: var(--ac-muted);
    flex-shrink: 0;
}

.admin-chat-colleague-list {
    padding: 4px 8px 10px;
    flex: 1;
    overflow: auto;
    min-height: 0;
}

.admin-chat-colleague-item {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 10px;
    border: none;
    border-radius: 10px;
    background: transparent;
    cursor: pointer;
    text-align: left;
    flex-shrink: 0;
    min-height: 64px;
    box-sizing: border-box;
}

.admin-chat-colleague-item:hover,
.admin-chat-colleague-item.is-online:hover,
.admin-chat-colleague-item.active {
    background: var(--ac-hover);
}

.admin-chat-colleague-avatar {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: var(--ac-accent-soft);
    color: var(--ac-accent);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    position: relative;
    flex-shrink: 0;
}

.admin-chat-session-avatar {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: #c7d2fe;
    color: #3730a3;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    position: relative;
    flex-shrink: 0;
}

/* 有头像时缩略图铺满圆角框，绿点叠在上层 */
.admin-chat-session-avatar .chat-avatar-thumb,
.admin-chat-colleague-avatar .chat-avatar-thumb {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: inherit;
    z-index: 0;
    display: block;
}

.admin-chat-session-avatar .chat-avatar-fallback,
.admin-chat-colleague-avatar .chat-avatar-fallback {
    position: relative;
    z-index: 1;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.admin-chat-session-avatar .admin-chat-dot,
.admin-chat-colleague-avatar .admin-chat-dot {
    z-index: 2;
}

.admin-chat-colleague-meta {
    min-width: 0;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.admin-chat-colleague-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.admin-chat-colleague-name {
    font-size: 14px;
    color: var(--ac-text);
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.admin-chat-colleague-role {
    font-size: 12px;
    color: var(--ac-muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.admin-chat-kind-tag {
    display: inline-block;
    margin-left: 4px;
    padding: 1px 5px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 600;
    vertical-align: middle;
    background: #e0e7ff;
    color: #3730a3;
}

.admin-chat-kind-tag.customer {
    background: #ecfdf5;
    color: #047857;
}

.admin-chat-type-tag.staff {
    background: var(--ac-accent-soft);
    color: #1d4ed8;
}

.admin-chat-session-list {
    flex: 1;
    overflow: auto;
    min-height: 0;
    background: var(--ac-surface);
}

.admin-chat-session-item {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    border: none;
    background: transparent;
    text-align: left;
    cursor: pointer;
    position: relative;
    border-bottom: 1px solid #edf2f7;
    flex-shrink: 0;
    box-sizing: border-box;
    min-height: 64px;
}

.admin-chat-session-item:hover,
.admin-chat-session-item.active {
    background: var(--ac-hover);
}

.admin-chat-dot {
    position: absolute;
    right: -1px;
    bottom: -1px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #94a3b8;
    border: 2px solid #fff;
}

.admin-chat-colleague-avatar .admin-chat-dot {
    right: -2px;
    bottom: -2px;
}

.admin-chat-dot.online {
    background: var(--ac-online);
}

.admin-chat-session-main {
    flex: 1;
    min-width: 0;
}

.admin-chat-session-top {
    display: flex;
    justify-content: space-between;
    gap: 8px;
}

.admin-chat-session-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--ac-text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    max-width: 70%;
}

.admin-chat-type-tag {
    flex-shrink: 0;
    font-size: 10px;
    font-weight: 600;
    color: #1d4ed8;
    background: var(--ac-accent-soft);
    border-radius: 4px;
    padding: 1px 6px;
}

.admin-chat-type-tag.admin {
    color: #7c3aed;
    background: #ede9fe;
}

.admin-chat-session-time {
    font-size: 11px;
    color: #94a3b8;
    flex-shrink: 0;
}

.admin-chat-session-preview {
    margin-top: 4px;
    font-size: 12px;
    color: var(--ac-muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.admin-chat-unread {
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 999px;
    background: var(--ac-danger);
    color: #fff;
    font-size: 11px;
    line-height: 18px;
    text-align: center;
}

.admin-chat-main {
    flex: 1;
    min-width: 0;
    min-height: 0;
    display: flex;
    flex-direction: column;
    background: var(--ac-bg);
}

.admin-chat-empty-state {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--ac-muted);
    text-align: center;
    line-height: 1.7;
    padding: 24px;
}

.admin-chat-room {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

.admin-chat-room-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    background: var(--ac-surface);
    border-bottom: 1px solid var(--ac-line);
    flex-shrink: 0;
}

.admin-chat-back-btn {
    display: none;
    border: none;
    background: #eef2f7;
    color: #475569;
    width: 36px;
    height: 36px;
    border-radius: 10px;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    padding: 0;
}

.admin-chat-peer-info {
    flex: 1;
    min-width: 0;
}

.admin-chat-peer-name {
    font-size: 16px;
    font-weight: 700;
    color: var(--ac-text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.admin-chat-peer-sub {
    font-size: 12px;
    color: var(--ac-muted);
    margin-top: 2px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.admin-chat-publish-btn {
    flex-shrink: 0;
    margin-right: 8px;
    height: 32px;
    padding: 0 10px;
    border: 1px solid var(--ac-line);
    border-radius: 8px;
    background: var(--ac-surface);
    color: var(--ac-accent);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
}

.admin-chat-publish-btn.is-on {
    background: var(--ac-accent-soft);
    border-color: #93c5fd;
    color: #1d4ed8;
}

.admin-chat-call-btns {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

.admin-chat-call-btn {
    width: 36px;
    height: 36px;
    border: 1px solid var(--ac-line);
    background: var(--ac-surface);
    border-radius: 10px;
    color: var(--ac-accent);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 0;
}

.admin-chat-call-btn:active {
    background: var(--ac-hover);
}

.admin-chat-msgs {
    flex: 1;
    overflow: auto;
    padding: 14px 10px;
    min-height: 0;
    -webkit-overflow-scrolling: touch;
}

/* 与顾客端共用的气泡结构（chat-common.js 渲染）
 * 微信式：行宽随内容收缩，对方贴左、自己贴右（勿把行拉成近全宽，否则短消息会漂中间） */
.admin-chat-msgs .chat-msg-row {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    gap: 8px;
    margin-bottom: 12px;
    width: fit-content;
    max-width: 75%;
    box-sizing: border-box;
}

.admin-chat-msgs .chat-msg-avatar {
    width: 40px;
    height: 40px;
    border-radius: 4px;
    background: #e0e7ff;
    color: #3730a3;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 16px;
    flex-shrink: 0;
    overflow: hidden;
    position: relative;
    padding: 0;
    border: none;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.admin-chat-msgs .chat-msg-avatar .chat-avatar-thumb {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: inherit;
    display: block;
    pointer-events: none;
}

.admin-chat-msgs .chat-msg-avatar .chat-avatar-fallback {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

.admin-chat-msgs .chat-msg-main {
    display: flex;
    flex-direction: column;
    min-width: 0;
    /* 相对聊天区收缩，避免用 100vw 把侧栏也算进去 */
    max-width: 420px;
}

.admin-chat-msgs .chat-msg-sender {
    font-size: 11px;
    color: #94a3b8;
    margin-bottom: 3px;
    padding: 0 2px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.chat-msg-role-tag {
    display: inline-block;
    padding: 0 5px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 700;
    line-height: 16px;
    background: #e0e7ff;
    color: #3730a3;
}

.chat-msg-role-tag.customer {
    background: #ecfdf5;
    color: #047857;
}

.chat-msg-role-tag.staff {
    background: var(--ac-accent-soft);
    color: #1d4ed8;
}

.admin-chat-msgs .chat-msg-row.self {
    margin-left: auto;
    margin-right: 0;
}

.admin-chat-msgs .chat-msg-row.self .chat-msg-main {
    align-items: flex-end;
}

.admin-chat-msgs .chat-msg-row.self .chat-msg-sender {
    justify-content: flex-end;
}

.admin-chat-msgs .chat-msg-row.peer {
    margin-left: 0;
    margin-right: auto;
}

.admin-chat-msgs .chat-msg-row.peer .chat-msg-main {
    align-items: flex-start;
}

/* 自己侧通话不显示名字行；对端（含共享专线顾客）要显示「顾客/商家」标签 */
.admin-chat-msgs .chat-msg-row.is-call.self .chat-msg-sender {
    display: none;
}

.admin-chat-msgs .chat-msg-row.is-call.peer .chat-msg-sender {
    display: flex;
}

.admin-chat-msgs .chat-bubble {
    padding: 10px 12px;
    border-radius: 14px;
    background: var(--ac-surface);
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
    word-break: break-word;
}

.admin-chat-msgs .chat-msg-row.self .chat-bubble {
    background: var(--ac-self-bubble);
}

.admin-chat-msgs .chat-bubble-text {
    font-size: 15px;
    line-height: 1.45;
    color: var(--ac-text);
}

.admin-chat-msgs .chat-msg-time-divider {
    width: 100%;
    max-width: 100%;
    text-align: center;
    margin: 16px 0 12px;
    clear: both;
}

.admin-chat-msgs .chat-msg-time-divider span {
    display: inline-block;
    font-size: 12px;
    color: #b2b2b2;
    line-height: 1.2;
    font-weight: 400;
    letter-spacing: 0.02em;
    background: none;
    padding: 0;
    border-radius: 0;
}

.admin-chat-msgs .chat-msg-time {
    display: none;
}

.admin-chat-msgs .chat-msg-system {
    text-align: center;
    margin: 10px 0;
    max-width: 100%;
}

.admin-chat-msgs .chat-msg-system span {
    display: inline-block;
    background: rgba(15, 23, 42, 0.06);
    color: var(--ac-muted);
    font-size: 12px;
    padding: 4px 10px;
    border-radius: 999px;
}

.admin-chat-msgs .chat-bubble-call {
    display: inline-flex !important;
    align-items: center;
    gap: 8px;
    padding: 10px 14px !important;
}

.admin-chat-msgs .chat-msg-image {
    max-width: 160px;
    max-height: 200px;
    width: auto;
    height: auto;
    object-fit: cover;
    border-radius: 10px;
    display: block;
    cursor: zoom-in;
    background: #e2e8f0;
}

.admin-chat-msgs .chat-voice-wrap {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    max-width: 100%;
}

.admin-chat-msgs .chat-voice-unread {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #fa5151;
    flex-shrink: 0;
    align-self: center;
}

.admin-chat-msgs .chat-voice-sec {
    flex-shrink: 0;
    font-size: 13px;
    font-weight: 600;
    color: var(--ac-muted);
    font-variant-numeric: tabular-nums;
    line-height: 1;
    min-width: 1.2em;
}

.admin-chat-msgs .chat-voice-bubble {
    appearance: none;
    -webkit-appearance: none;
    border: none;
    outline: none;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 40px;
    padding: 10px 14px;
    border-radius: 10px;
    background: var(--ac-surface);
    color: var(--ac-text);
    cursor: pointer;
    box-sizing: border-box;
    justify-content: flex-start;
}

.admin-chat-msgs .chat-msg-row.self .chat-voice-bubble {
    background: var(--ac-self-bubble);
    color: var(--ac-text);
    justify-content: flex-end;
}

.admin-chat-msgs .chat-msg-row.peer .chat-voice-bubble {
    justify-content: flex-start;
}

.admin-chat-msgs .chat-voice-speaker {
    display: inline-flex;
    line-height: 0;
    flex-shrink: 0;
}

.admin-chat-msgs .chat-msg-row.self .chat-voice-speaker {
    transform: scaleX(-1);
}

.admin-chat-msgs .chat-voice-bars {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    height: 16px;
    flex: 1;
    min-width: 28px;
}

.admin-chat-msgs .chat-voice-bars i {
    display: block;
    width: 3px;
    border-radius: 999px;
    background: currentColor;
    opacity: 0.55;
}

.admin-chat-msgs .chat-voice-bars i:nth-child(1) {
    height: 7px;
}

.admin-chat-msgs .chat-voice-bars i:nth-child(2) {
    height: 12px;
}

.admin-chat-msgs .chat-voice-bars i:nth-child(3) {
    height: 9px;
}

.admin-chat-msgs .chat-voice-bars i:nth-child(4) {
    height: 15px;
}

.admin-chat-msgs .chat-voice-bubble.playing .chat-voice-bars i {
    animation: chatVoicePlayBarAdmin 0.85s ease-in-out infinite;
    opacity: 0.9;
}

.admin-chat-msgs .chat-voice-bubble.playing .chat-voice-bars i:nth-child(2) {
    animation-delay: 0.12s;
}

.admin-chat-msgs .chat-voice-bubble.playing .chat-voice-bars i:nth-child(3) {
    animation-delay: 0.24s;
}

.admin-chat-msgs .chat-voice-bubble.playing .chat-voice-bars i:nth-child(4) {
    animation-delay: 0.36s;
}

@keyframes chatVoicePlayBarAdmin {
    0%, 100% {
        transform: scaleY(0.45);
    }
    50% {
        transform: scaleY(1);
    }
}

.admin-chat-msgs .chat-msg-row.is-voice {
    max-width: 75%;
}

.admin-chat-footer {
    flex-shrink: 0;
    background: var(--ac-surface);
    border-top: 1px solid var(--ac-line);
    padding-bottom: env(safe-area-inset-bottom, 0px);
}

.admin-chat-emotion {
    height: min(40vh, 340px);
    max-height: min(40vh, 340px);
    overflow: auto;
    background: #f7f7f7;
    border-bottom: 1px solid var(--ac-line);
}

.admin-chat-emotion .chat-emotion-panel {
    grid-template-columns: repeat(10, minmax(0, 1fr));
    gap: 6px 4px;
    padding: 14px 12px 20px;
}

.admin-chat-emotion .chat-emotion-item {
    padding: 12px 6px;
}

.admin-chat-emotion .chat-emotion-item img {
    width: 40px;
    height: 40px;
}

.admin-chat-footer .chat-quote-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px 0;
    background: var(--ac-surface);
}

.admin-chat-composer {
    display: flex;
    align-items: flex-end;
    gap: 6px;
    padding: 8px 10px 10px;
}

.admin-chat-tool {
    border: none;
    background: #eef2f7;
    color: #475569;
    width: 40px;
    height: 40px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    padding: 0;
    line-height: 0;
}

.admin-chat-tool:hover {
    background: var(--ac-accent-soft);
    color: var(--ac-accent);
}

.admin-chat-tool.recording {
    background: #fee2e2;
    color: var(--ac-danger);
}

.admin-chat-composer textarea {
    flex: 1;
    min-width: 0;
    min-height: 40px;
    max-height: 132px;
    height: 40px;
    overflow-y: hidden;
    resize: none;
    border: 1px solid var(--ac-line);
    border-radius: 12px;
    padding: 10px 12px;
    font-family: inherit;
    font-size: 15px;
    line-height: 1.35;
    background: #f8fafc;
    box-sizing: border-box;
}

.admin-chat-send {
    border: none;
    border-radius: 12px;
    height: 40px;
    padding: 0 14px;
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    color: #fff;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    flex-shrink: 0;
}

.admin-chat-empty {
    padding: 40px 16px;
    text-align: center;
    color: var(--ac-muted);
    font-size: 14px;
    line-height: 1.6;
}

.admin-chat-empty span {
    font-size: 12px;
}

.menu-item .admin-chat-menu-badge {
    display: inline-block;
    margin-left: 6px;
    min-width: 16px;
    height: 16px;
    padding: 0 5px;
    border-radius: 999px;
    background: var(--ac-danger);
    color: #fff;
    font-size: 10px;
    line-height: 16px;
    text-align: center;
    vertical-align: middle;
}

/* 手机 / APK：整页贴满可视区域；避开 100vh 偶发算错导致上下顶满、输入框被备案条压住 */
@media (max-width: 860px) {
    /* 聊天页打开时：隐藏底部备案（fixed），否则输入栏会被顶住/盖住 */
    body.admin-chat-open {
        overflow: hidden;
    }

    body.admin-chat-open .site-icp-footer {
        display: none !important;
    }

    body.admin-chat-open #page-chat {
        position: fixed;
        left: 0;
        right: 0;
        top: 0;
        bottom: 0;
        z-index: 40;
        width: auto;
        height: auto !important;
        max-height: none !important;
        margin: 0 !important;
        padding: 0;
        padding-top: env(safe-area-inset-top, 0px);
        padding-bottom: env(safe-area-inset-bottom, 0px);
        box-sizing: border-box;
        display: flex !important;
        flex-direction: column;
        overflow: hidden;
        background: var(--ac-bg);
    }

    #page-chat {
        display: flex;
        flex-direction: column;
        min-height: 0;
        background: var(--ac-bg);
    }

    #page-chat .admin-chat-page-header {
        margin: 0;
        padding: 10px 12px;
        background: var(--ac-surface);
        border-bottom: 1px solid var(--ac-line);
        flex-shrink: 0;
    }

    #page-chat .admin-chat-page-header h2 {
        font-size: 1.1rem;
    }

    .admin-chat-layout {
        flex: 1;
        min-height: 0;
        height: auto;
        flex-direction: column;
        border-radius: 0;
        border: none;
    }

    .admin-chat-sidebar {
        width: 100%;
        min-width: 0;
        flex: 1;
        max-height: none;
        border-right: none;
        overflow: auto;
        -webkit-overflow-scrolling: touch;
    }

    /* 手机未进会话：不显示右侧大块空提示，列表占满全屏 */
    .admin-chat-layout:not(.admin-chat-layout--chatting) .admin-chat-main {
        display: none;
    }

    .admin-chat-layout--chatting .admin-chat-sidebar {
        display: none;
    }

    .admin-chat-layout--chatting .admin-chat-main {
        display: flex;
        flex: 1;
        min-height: 0;
    }

    .admin-chat-back-btn {
        display: inline-flex;
    }

    .admin-chat-footer {
        /* 整页已垫 safe-area，这里不再重复加，避免偶发双倍空白或错位 */
        padding-bottom: 0;
    }

    .admin-chat-composer {
        gap: 4px;
        padding: 8px 8px 10px;
    }

    .admin-chat-tool {
        width: 36px;
        height: 36px;
        border-radius: 10px;
    }

    .admin-chat-tool svg {
        width: 20px;
        height: 20px;
    }

    .admin-chat-composer textarea {
        min-height: 36px;
        height: 36px;
        max-height: 132px;
        font-size: 16px;
        padding: 8px 10px;
    }

    .admin-chat-send {
        height: 36px;
        padding: 0 12px;
    }

    .admin-chat-call-btn {
        width: 34px;
        height: 34px;
    }

    .admin-chat-empty-state {
        padding: 20px 16px;
        font-size: 14px;
    }

    /* 同事区占满侧栏，与顾客会话列表一致，不再半截裁切 */
    .admin-chat-colleague-panel {
        max-height: none;
        overflow: auto;
        flex: 1;
    }

    .admin-chat-session-list {
        flex: 1;
        overflow: auto;
        min-height: 0;
    }

    /* 安卓：消息贴左右边，行宽随内容 */
    .admin-chat-msgs .chat-msg-row {
        max-width: 82%;
    }

    .admin-chat-msgs .chat-msg-main {
        max-width: min(320px, calc(100vw - 88px));
    }

    .admin-chat-msgs .chat-msg-row.is-voice {
        max-width: 82%;
    }
}

@media (min-width: 861px) {
    .admin-chat-back-btn {
        display: none !important;
    }

    /* PC 微信同款：气泡略宽，仍贴左右边 */
    .admin-chat-msgs {
        padding: 16px 12px;
    }

    .admin-chat-msgs .chat-msg-row {
        max-width: 58%;
    }

    .admin-chat-msgs .chat-msg-main {
        max-width: 480px;
    }

    .admin-chat-msgs .chat-msg-row.is-voice {
        max-width: 58%;
    }
}
