/**
 * 聊天窗口 - 图片/视频消息与预览（独立样式，仅本面板）
 * 与 chat-window.css 配合，不与其他面板通用
 */
.chat-window-panel .chat-window-msg-media {
    margin-top: 4px;
}
/* 对方消息的图片/视频：左对齐 */
.chat-window-panel .chat-window-msg-image {
    max-width: 220px;
    border-radius: 6px;
    overflow: hidden;
}
/* 自己的消息的图片/视频：右对齐 */
.chat-window-panel .chat-window-message.chat-window-message-is-self .chat-window-msg-image {
    margin-left: auto;
}
.chat-window-panel .chat-window-msg-img-thumb {
    display: block;
    max-width: 100%;
    max-height: 200px;
    object-fit: contain;
    cursor: pointer;
    vertical-align: top;
}
/* 对方消息的视频：左对齐；点击在通用播放器中播放 */
.chat-window-panel .chat-window-msg-video {
    position: relative;
    max-width: 280px;
    border-radius: 6px;
    overflow: hidden;
    cursor: pointer;
}
/* 视频缩略图中央播放图标：大号、居中，便于识别为视频 */
.chat-window-panel .chat-window-msg-video::after {
    content: '\25B6';
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.55);
    color: #fff;
    font-size: 26px;
    line-height: 56px;
    text-align: center;
    padding-left: 6px;
    box-sizing: border-box;
    pointer-events: none;
    z-index: 1;
    font-family: "Microsoft YaHei", "微软雅黑", SimSun, Arial, sans-serif;
}
/* 自己的消息的视频：右对齐 */
.chat-window-panel .chat-window-message.chat-window-message-is-self .chat-window-msg-video {
    margin-left: auto;
}
/* 视频缩略图（封面图），与图片缩略图同规格 */
.chat-window-panel .chat-window-msg-video-thumb {
    display: block;
    max-width: 100%;
    max-height: 200px;
    object-fit: contain;
    cursor: pointer;
    vertical-align: top;
}
/* 兼容旧结构：直接使用 <video> 时 */
.chat-window-panel .chat-window-msg-video-el {
    display: block;
    max-width: 100%;
    max-height: 200px;
    background: var(--cw-bg-deep);
}
/* 视频缩略图加载失败时的占位文字 */
.chat-window-panel .chat-window-msg-video-placeholder {
    display: inline-block;
    min-width: 80px;
    min-height: 60px;
    line-height: 60px;
    text-align: center;
    font-size: 12px;
    color: var(--cw-text-secondary, #666);
    background: var(--cw-bg-deep, #f0f0f0);
    border-radius: 6px;
    cursor: pointer;
}
.chat-window-panel .chat-window-message.chat-window-message-is-self .chat-window-msg-img-thumb,
.chat-window-panel .chat-window-message.chat-window-message-is-self .chat-window-msg-video-thumb,
.chat-window-panel .chat-window-message.chat-window-message-is-self .chat-window-msg-video-el {
    background: transparent;
}
.chat-window-preview-overlay {
    position: fixed;
    inset: 0;
    z-index: 210600;
    display: none;
    align-items: center;
    justify-content: center;
    font-family: "Microsoft YaHei", "微软雅黑", "SimSun", "宋体", Arial, sans-serif;
}
.chat-window-preview-overlay.chat-window-preview-open {
    display: flex;
}
.chat-window-preview-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.75);
    cursor: pointer;
}
.chat-window-preview-wrap {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
    display: flex;
    align-items: center;
    justify-content: center;
}
.chat-window-preview-wrap .chat-window-preview-img {
    max-width: 100%;
    max-height: 90vh;
    object-fit: contain;
    border-radius: 6px;
    cursor: grab;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    transition: transform 0.1s ease-out;
    will-change: transform;
}
.chat-window-preview-wrap .chat-window-preview-img:active {
    cursor: grabbing;
}
/* 确保图片在拖拽和缩放时不会溢出容器 */
.chat-window-preview-wrap {
    overflow: visible;
}
/* 图片预览交互提示（可选，用于提示用户操作） */
.chat-window-preview-overlay.chat-window-preview-open .chat-window-preview-img {
    pointer-events: auto;
}

/* 聊天图片预览 - 绘图标记层（与图片同 transform 容器内，复用 review-annotation-* 样式） */
.chat-window-preview-wrap .chat-window-image-annotation-layer {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    transform-origin: center center;
    z-index: 2;
}
.chat-window-preview-wrap .chat-window-image-annotation-layer.review-annotation-layer-drawing {
    pointer-events: auto;
}
