/**
 * 聊天窗口 - @提及功能独立样式（仅本面板使用）
 * 功能：@提及输入弹窗、@消息气泡、右下角收到@通知弹窗
 * 符合开发规范：chat-window-mention-* 前缀，独立文件，≤400行
 */

/* ==================== @提及按钮高亮 ==================== */

.chat-window-mention-btn {
    color: var(--cw-text-secondary, #8a8a8a);
    transition: color 0.15s, background 0.15s;
}

.chat-window-mention-btn:hover {
    color: #f5a623;
    background: rgba(245, 166, 35, 0.08);
    border-radius: 4px;
}

.chat-window-mention-btn.is-disabled {
    opacity: 0.35;
    pointer-events: none;
}

/* ==================== @提及输入弹窗 ==================== */

.chat-window-mention-modal {
    position: fixed;
    inset: 0;
    z-index: 1200;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: "Microsoft YaHei", "微软雅黑", "SimSun", "宋体", "Arial", sans-serif;
}

.chat-window-mention-modal[hidden] {
    display: none;
}

.chat-window-mention-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.38);
    cursor: pointer;
}

.chat-window-mention-dialog {
    position: relative;
    z-index: 1;
    background: #ffffff;
    border-radius: 10px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.18);
    width: 360px;
    max-width: calc(100vw - 40px);
    overflow: hidden;
    animation: cwMentionFadeIn 0.18s ease;
}

@keyframes cwMentionFadeIn {
    from { opacity: 0; transform: translateY(-12px) scale(0.97); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

.chat-window-mention-header {
    padding: 16px 20px 0;
    border-bottom: 1px solid #f0f0f0;
    padding-bottom: 12px;
}

.chat-window-mention-modal-title {
    font-size: 15px;
    font-weight: 700;
    color: #222222;
    margin: 0;
    font-family: "Microsoft YaHei", "微软雅黑", "SimSun", "宋体", "Arial", sans-serif;
}

.chat-window-mention-body {
    padding: 16px 20px;
}

/* 单聊：仅显示输入框 */
.chat-window-mention-dialog.is-group .chat-window-mention-single-wrap {
    display: none;
}

.chat-window-mention-dialog:not(.is-group) .chat-window-mention-body-inner {
    display: none;
}

/* 群聊弹窗：宽度约 560px，左右分栏 */
.chat-window-mention-dialog.is-group {
    width: 560px;
    max-width: calc(100vw - 40px);
}

.chat-window-mention-body-inner {
    display: flex;
    flex-direction: row;
    gap: 16px;
    min-height: 220px;
}

.chat-window-mention-members {
    flex: 0 0 42%;
    display: flex;
    flex-direction: column;
    gap: 8px;
    border: 1px solid #e8e8e8;
    border-radius: 8px;
    padding: 10px;
    background: #fafafa;
    max-height: 260px;
}

.chat-window-mention-members-search {
    flex-shrink: 0;
    width: 100%;
    box-sizing: border-box;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    padding: 6px 10px;
    font-size: 12px;
    font-family: "Microsoft YaHei", "微软雅黑", "SimSun", "宋体", "Arial", sans-serif;
    color: #333333;
}

.chat-window-mention-members-search:focus {
    outline: none;
    border-color: #f5a623;
}

.chat-window-mention-members-all {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: #555555;
    cursor: pointer;
    font-family: "Microsoft YaHei", "微软雅黑", "SimSun", "宋体", "Arial", sans-serif;
}

.chat-window-mention-members-all-cb {
    cursor: pointer;
}

.chat-window-mention-members-count {
    flex-shrink: 0;
    font-size: 11px;
    color: #f5a623;
    font-family: "Microsoft YaHei", "微软雅黑", "SimSun", "宋体", "Arial", sans-serif;
}

.chat-window-mention-members-list {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    min-height: 0;
}

.chat-window-mention-members-list::-webkit-scrollbar {
    width: 4px;
}

.chat-window-mention-members-list::-webkit-scrollbar-thumb {
    background: rgba(245, 166, 35, 0.4);
    border-radius: 2px;
}

.chat-window-mention-member-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 8px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
    font-family: "Microsoft YaHei", "微软雅黑", "SimSun", "宋体", "Arial", sans-serif;
    color: #333333;
}

.chat-window-mention-member-item:hover {
    background: rgba(245, 166, 35, 0.1);
}

.chat-window-mention-member-item input[type="checkbox"] {
    flex-shrink: 0;
    cursor: pointer;
}

.chat-window-mention-member-item .chat-window-mention-member-name {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.chat-window-mention-editor {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.chat-window-mention-editor .chat-window-mention-input {
    flex: 1;
    min-height: 120px;
}

.chat-window-mention-input {
    width: 100%;
    box-sizing: border-box;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    padding: 10px 12px;
    font-size: 13px;
    font-family: "Microsoft YaHei", "微软雅黑", "SimSun", "宋体", "Arial", sans-serif;
    color: #333333;
    background: #f9f9f9;
    resize: none;
    outline: none;
    transition: border-color 0.15s, background 0.15s;
    line-height: 1.6;
}

.chat-window-mention-input:focus {
    border-color: #f5a623;
    background: #ffffff;
}

.chat-window-mention-input::placeholder {
    color: #b0b0b0;
    font-size: 13px;
}

.chat-window-mention-footer {
    padding: 0 20px 16px;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.chat-window-mention-cancel-btn,
.chat-window-mention-send-btn {
    font-family: "Microsoft YaHei", "微软雅黑", "SimSun", "宋体", "Arial", sans-serif;
    font-size: 13px;
    padding: 7px 20px;
    border-radius: 5px;
    border: none;
    cursor: pointer;
    transition: background 0.15s, opacity 0.15s;
    line-height: 1.4;
}

.chat-window-mention-cancel-btn {
    background: #f0f0f0;
    color: #555555;
}

.chat-window-mention-cancel-btn:hover {
    background: #e4e4e4;
}

.chat-window-mention-send-btn {
    background: #f5a623;
    color: #ffffff;
    font-weight: 600;
}

.chat-window-mention-send-btn:hover {
    background: #e0951a;
}

.chat-window-mention-send-btn:disabled {
    opacity: 0.55;
    pointer-events: none;
}

/* ==================== @消息气泡样式 ==================== */

/* 自己发送的@消息 - 右侧橙色气泡 */
.chat-window-message.is-self .chat-window-msg-mention {
    display: inline-block;
    background: linear-gradient(135deg, #f5a623 0%, #f08c10 100%);
    color: #ffffff;
    border-radius: 12px 4px 12px 12px;
    padding: 8px 13px;
    font-size: 13px;
    line-height: 1.6;
    word-break: break-word;
    max-width: 280px;
    box-shadow: 0 2px 6px rgba(240, 140, 16, 0.28);
}

/* 对方发送的@消息 - 左侧浅橙色气泡 */
.chat-window-message:not(.is-self) .chat-window-msg-mention {
    display: inline-block;
    background: linear-gradient(135deg, #fff5e6 0%, #ffeac4 100%);
    color: #7a4a00;
    border: 1px solid #f5c98a;
    border-radius: 4px 12px 12px 12px;
    padding: 8px 13px;
    font-size: 13px;
    line-height: 1.6;
    word-break: break-word;
    max-width: 280px;
    box-shadow: 0 1px 4px rgba(245, 166, 35, 0.15);
}

/* @标记高亮部分 */
.chat-window-mention-tag {
    font-weight: 700;
    margin-right: 3px;
}

.chat-window-message.is-self .chat-window-mention-tag {
    color: rgba(255, 255, 255, 0.9);
}

.chat-window-message:not(.is-self) .chat-window-mention-tag {
    color: #c07700;
}

/* @消息已读/未读状态标记 */
.chat-window-mention-read-status {
    font-size: 10px;
    margin-top: 3px;
    text-align: right;
    font-family: "Microsoft YaHei", "微软雅黑", "SimSun", "宋体", "Arial", sans-serif;
    transition: color 0.2s;
}

.chat-window-mention-read-status.is-read {
    color: #f5a623;
}

.chat-window-mention-read-status.is-unread {
    color: #b0b0b0;
}

/* ==================== 右下角@通知弹窗 ==================== */

.chat-window-mention-notify {
    position: fixed;
    right: 20px;
    bottom: 24px;
    z-index: 1500;
    width: 300px;
    max-width: calc(100vw - 40px);
    font-family: "Microsoft YaHei", "微软雅黑", "SimSun", "宋体", "Arial", sans-serif;
    animation: cwMentionNotifySlideIn 0.22s ease;
}

@keyframes cwMentionNotifySlideIn {
    from { opacity: 0; transform: translateY(18px) scale(0.96); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

.chat-window-mention-notify-inner {
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.18), 0 0 0 1px rgba(0,0,0,0.06);
    overflow: hidden;
}

.chat-window-mention-notify-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 14px 8px;
    border-bottom: 1px solid #f5f5f5;
    background: linear-gradient(to right, #fff8ee, #ffffff);
}


.chat-window-mention-notify-name {
    font-size: 13px;
    font-weight: 700;
    color: #333333;
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.chat-window-mention-notify-name::before {
    content: "@提醒 · ";
    font-weight: 400;
    color: #f5a623;
    font-size: 12px;
}

.chat-window-mention-notify-body {
    padding: 10px 14px;
    font-size: 13px;
    color: #555555;
    line-height: 1.6;
    max-height: 80px;
    overflow-y: auto;
    overflow-x: hidden;
    word-break: break-word;
    padding-right: 10px;
}

/* 细滚动条美化（Webkit） */
.chat-window-mention-notify-body::-webkit-scrollbar {
    width: 3px;
}

.chat-window-mention-notify-body::-webkit-scrollbar-track {
    background: transparent;
}

.chat-window-mention-notify-body::-webkit-scrollbar-thumb {
    background: rgba(245, 166, 35, 0.4);
    border-radius: 2px;
}

.chat-window-mention-notify-body::-webkit-scrollbar-thumb:hover {
    background: rgba(245, 166, 35, 0.85);
}

.chat-window-mention-notify-actions {
    display: flex;
    gap: 10px;
    padding: 10px 14px 12px;
    background: #fafafa;
    border-top: 1px solid #f0f0f0;
}

.chat-window-mention-notify-read-btn,
.chat-window-mention-notify-close-btn {
    flex: 1;
    padding: 8px 0;
    font-family: "Microsoft YaHei", "微软雅黑", "SimSun", "宋体", "Arial", sans-serif;
    font-size: 13px;
    font-weight: 600;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.15s, transform 0.1s, box-shadow 0.15s;
    line-height: 1.4;
}

.chat-window-mention-notify-read-btn {
    background: linear-gradient(135deg, #f5a623 0%, #f08c10 100%);
    color: #ffffff;
    box-shadow: 0 2px 6px rgba(240, 140, 16, 0.35);
}

.chat-window-mention-notify-read-btn:hover {
    background: linear-gradient(135deg, #f0a020 0%, #e07d08 100%);
    box-shadow: 0 3px 10px rgba(240, 140, 16, 0.45);
    transform: translateY(-1px);
}

.chat-window-mention-notify-read-btn:active {
    transform: translateY(0);
    box-shadow: 0 1px 4px rgba(240, 140, 16, 0.3);
}

.chat-window-mention-notify-close-btn {
    background: #f0f0f0;
    color: #555555;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.chat-window-mention-notify-close-btn:hover {
    background: #e6e6e6;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
    transform: translateY(-1px);
}

.chat-window-mention-notify-close-btn:active {
    transform: translateY(0);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}
