/**
 * IM前端模块样式 - 暗黑生化风格
 * 完整版：好友列表、群列表、弹窗、聊天窗口
 */

/* ===== 好友/战队/群列表容器 ===== */
.friend-list {
    position: relative;
    display: flex;
    flex-direction: column;
}

.friend-list .tabs {
    display: flex;
    gap: 0;
    margin-bottom: 10px;
    border-bottom: 1px solid #333;
    flex-shrink: 0;
}

.friend-list .tabs button {
    flex: 1;
    padding: 8px 12px;
    background: transparent;
    border: none;
    color: #888;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
    border-bottom: 2px solid transparent;
}

.friend-list .tabs button:hover {
    color: #fff;
    background: rgba(255,255,255,0.05);
}

.friend-list .tabs button.active {
    color: #ff4444;
    border-bottom-color: #ff4444;
}

.friend-list .tabs button i {
    margin-right: 4px;
}

/* ===== 列表区域 ===== */
.im-list-area {
    flex: 1;
    min-height: 150px;
    max-height: none;
    overflow-y: auto;
    position: relative;
}

.im-list-area::-webkit-scrollbar {
    width: 4px;
}

.im-list-area::-webkit-scrollbar-thumb {
    background: #444;
    border-radius: 2px;
}

/* ===== 底部工具栏 ===== */
.im-bottom-bar {
    display: flex;
    gap: 6px;
    padding: 10px 8px;
    background: rgba(0,0,0,0.3);
    border-top: 1px solid #333;
    flex-shrink: 0;
}

.im-bottom-bar .im-btn {
    flex: 1;
    padding: 8px 6px;
    background: rgba(255,255,255,0.05);
    border: 1px solid #333;
    border-radius: 6px;
    color: #ccc;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
}

.im-bottom-bar .im-btn:hover {
    background: rgba(255,68,68,0.15);
    border-color: rgba(255,68,68,0.4);
    color: #ff4444;
    transform: translateY(-1px);
}

.im-bottom-bar .im-btn i {
    font-size: 16px;
}

.im-bottom-bar .im-btn-text {
    font-size: 11px;
    white-space: nowrap;
}

/* ===== 加载/空状态 ===== */
.im-loading,
.im-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 30px 20px;
    color: #666;
    font-size: 13px;
}

.im-loading i {
    font-size: 24px;
    margin-bottom: 10px;
    color: #ff4444;
}

.im-empty i {
    font-size: 32px;
    margin-bottom: 10px;
    opacity: 0.5;
}

.im-empty p {
    margin: 0;
}

/* ===== 用户列表（好友 + 群成员通用） ===== */
.im-user-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 2px;
}

.im-user-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    background: rgba(255,255,255,0.03);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid transparent;
    position: relative;
    margin-bottom: 4px;
}

.im-user-item:hover {
    background: rgba(255,255,255,0.06);
    border-color: rgba(255,68,68,0.3);
    transform: translateX(2px);
}

.im-user-item.online {
    background: rgba(68,204,68,0.03);
}

.im-user-item.online:hover {
    background: rgba(68,204,68,0.08);
    border-color: rgba(68,204,68,0.3);
}

.im-user-item.offline {
    opacity: 0.7;
}

/* 在线好友列表增强 - 覆盖默认的online/offline样式 */
.im-user-item.friend-online {
    background: rgba(46, 204, 113, 0.05);
    opacity: 1;
}

.im-user-item.friend-online:hover {
    background: rgba(46, 204, 113, 0.12);
    border-color: rgba(46, 204, 113, 0.3);
}

.im-user-item.friend-offline {
    opacity: 1;
}

.im-user-item.friend-offline .im-user-name {
    color: #777;
}

.im-user-item.friend-offline .im-user-avatar img {
    filter: grayscale(100%) brightness(0.6);
    opacity: 0.7;
}

.im-user-item.friend-offline .im-user-meta {
    color: #555;
}

.im-user-item.friend-online .im-user-name {
    color: #fff;
}

.im-user-item .im-user-online-text {
    color: #2ecc71;
    font-size: 12px;
    font-weight: 400;
}

.im-user-item.friend-offline .im-user-online-text {
    color: #999;
}

.im-user-avatar {
    position: relative;
    width: 40px;
    height: 40px;
    flex-shrink: 0;
    cursor: pointer;
}

.im-user-info {
    cursor: pointer;
}

.im-user-avatar img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #333;
}

.im-user-status-dot {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 2px solid #1a1a1a;
}

.im-user-status-dot.online {
    background: #44cc44;
    box-shadow: 0 0 6px rgba(68,204,68,0.6);
}

.im-user-status-dot.gaming {
    background: #ff4444;
    box-shadow: 0 0 6px rgba(255,68,68,0.6);
}

.im-user-status-dot.offline {
    background: #666;
}

.im-user-info {
    flex: 1;
    min-width: 0;
}

.im-user-name {
    color: #fff;
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.im-user-badges {
    display: inline-flex;
    gap: 4px;
    flex-shrink: 0;
}

.im-badge {
    display: inline-flex;
    align-items: center;
    padding: 1px 5px;
    border-radius: 8px;
    font-size: 10px;
    font-weight: 500;
    line-height: 14px;
}

.im-badge-gm {
    background: linear-gradient(135deg, #ff6600, #ff3300);
    color: #fff;
    box-shadow: 0 0 4px rgba(255,102,0,0.4);
}

.im-badge-online {
    background: rgba(68,204,68,0.2);
    color: #44cc44;
}

.im-badge-leader {
    background: linear-gradient(135deg, #ffaa00, #ff8800);
    color: #000;
}

.im-badge-admin {
    background: rgba(68,136,255,0.2);
    color: #4488ff;
}

.im-user-meta {
    display: flex;
    gap: 8px;
    font-size: 11px;
    color: #888;
    align-items: center;
    flex-wrap: wrap;
}

.im-user-meta i {
    margin-right: 3px;
}

.im-user-meta span {
    display: inline-flex;
    align-items: center;
    gap: 2px;
}

.im-user-meta .im-clan-tag {
    color: #c0392b;
}

.im-user-item.friend-offline .im-user-meta span {
    opacity: 0.6;
}

.im-user-action {
    color: #666;
    font-size: 16px;
    transition: color 0.2s;
    flex-shrink: 0;
    cursor: pointer;
}

.im-user-item:hover .im-user-action {
    color: #ff4444;
}

/* ===== 弹窗/模态框通用样式 ===== */
.im-modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.7);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.im-modal-overlay.show {
    display: flex;
    animation: imFadeIn 0.2s ease;
}

/* 支持多层弹窗堆叠 */
.im-modal-overlay:nth-of-type(2) { z-index: 10000; }
.im-modal-overlay:nth-of-type(3) { z-index: 10001; }
.im-modal-overlay:nth-of-type(4) { z-index: 10002; }
.im-modal-overlay:nth-of-type(5) { z-index: 10003; }

@keyframes imFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes imSlideUp {
    from { transform: translateY(20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.im-modal {
    background: #1a1a1a;
    border: 1px solid #333;
    border-radius: 12px;
    width: 400px;
    max-width: 90vw;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 10px 40px rgba(0,0,0,0.6);
    animation: imSlideUp 0.25s ease;
}

.im-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    background: linear-gradient(135deg, #2a1a1a, #1a1a1a);
    border-bottom: 1px solid #333;
}

.im-modal-title {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #fff;
    font-size: 15px;
    font-weight: 500;
}

.im-modal-title i {
    color: #ff4444;
}

.im-modal-close {
    width: 28px;
    height: 28px;
    background: rgba(255,255,255,0.1);
    border: none;
    border-radius: 50%;
    color: #aaa;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.im-modal-close:hover {
    background: #ff4444;
    color: #fff;
}

.im-modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 18px;
}

.im-modal-body::-webkit-scrollbar {
    width: 4px;
}

.im-modal-body::-webkit-scrollbar-thumb {
    background: #444;
    border-radius: 2px;
}

.im-modal-footer {
    display: flex;
    gap: 10px;
    padding: 14px 18px;
    border-top: 1px solid #333;
    background: #151515;
}

.im-btn-primary,
.im-btn-secondary,
.im-btn-danger {
    flex: 1;
    padding: 10px 18px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
    font-weight: 500;
}

.im-btn-primary {
    background: linear-gradient(135deg, #ff4444, #cc2222);
    color: #fff;
}

.im-btn-primary:hover {
    transform: scale(1.02);
    box-shadow: 0 0 15px rgba(255,68,68,0.4);
}

.im-btn-secondary {
    background: rgba(255,255,255,0.1);
    color: #ccc;
    border: 1px solid #444;
}

.im-btn-secondary:hover {
    background: rgba(255,255,255,0.15);
    color: #fff;
}

.im-btn-danger {
    background: linear-gradient(135deg, #cc3333, #991111);
    color: #fff;
}

.im-btn-danger:hover {
    background: linear-gradient(135deg, #dd4444, #aa2222);
}

/* ===== 表单样式 ===== */
.im-form-group {
    margin-bottom: 14px;
}

.im-form-label {
    display: block;
    color: #ccc;
    font-size: 13px;
    margin-bottom: 6px;
}

.im-form-input,
.im-form-select,
.im-form-textarea {
    width: 100%;
    padding: 10px 14px;
    background: #222;
    border: 1px solid #333;
    border-radius: 8px;
    color: #fff;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s;
    box-sizing: border-box;
}

.im-form-input:focus,
.im-form-select:focus,
.im-form-textarea:focus {
    border-color: #ff4444;
}

.im-form-textarea {
    resize: vertical;
    min-height: 80px;
}

/* ===== 搜索框 ===== */
.im-search-box {
    position: relative;
    margin-bottom: 14px;
}

.im-search-box input {
    width: 100%;
    padding: 10px 14px 10px 36px;
    background: #222;
    border: 1px solid #333;
    border-radius: 8px;
    color: #fff;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s;
    box-sizing: border-box;
}

.im-search-box input:focus {
    border-color: #ff4444;
}

.im-search-box i {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #666;
}

/* ===== 聊天窗口 ===== */
.im-chat-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.7);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.im-chat-overlay.show {
    display: flex;
}

.im-chat-container {
    width: 420px;
    max-width: 92vw;
    height: 560px;
    max-height: 85vh;
    background: #1a1a1a;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 10px 40px rgba(0,0,0,0.5);
    border: 1px solid #333;
    transition: width 0.3s ease;
    position: relative;
}

/* 主体区域: 左侧(消息+输入) + 右侧边栏 */
.im-chat-main {
    flex: 1;
    display: flex;
    flex-direction: row;
    overflow: hidden;
    min-height: 0;
}

.im-chat-left {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-width: 0;
}

/* 聊天消息区域 */
.im-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-height: 0;
}

/* 通用隐藏类 */
.im-hidden {
    display: none !important;
}

/* 侧边栏基础样式 - 默认隐藏 */
.im-chat-sidebar {
    flex: 0 0 220px;
    width: 220px;
    min-width: 220px;
    background: #151515;
    border-left: 1px solid #333;
    display: none;
    flex-direction: column;
    height: 100%;
}

/* 群聊时显示群成员侧边栏 */
.im-chat-container-group .im-sidebar-group {
    display: flex;
}

/* 单聊时显示战绩侧边栏 */
.im-chat-container-private .im-sidebar-stats {
    display: flex;
}

.im-sidebar-section {
    border-bottom: 1px solid #333;
    display: flex;
    flex-direction: column;
}

.im-sidebar-section:last-child {
    border-bottom: none;
    flex: 1;
    overflow: hidden;
}

.im-sidebar-header {
    padding: 10px 14px;
    background: rgba(0,0,0,0.3);
    color: #ccc;
    font-size: 12px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 6px;
    border-bottom: 1px solid #333;
    flex-shrink: 0;
}

.im-sidebar-header i {
    color: #ff4444;
    font-size: 12px;
}

.im-members-count-inline {
    margin-left: auto;
    color: #666;
    font-size: 11px;
}

.im-sidebar-body {
    padding: 10px 14px;
    font-size: 13px;
    color: #ddd;
    max-height: 150px;
    overflow-y: auto;
}

.im-sidebar-announcement .im-sidebar-body {
    min-height: 60px;
}

.im-announcement-text {
    line-height: 1.6;
    white-space: pre-wrap;
    word-break: break-all;
    color: #ffaa00;
}

/* 群成员列表（侧边栏样式） */
.im-members-body {
    max-height: none;
    overflow-y: auto;
    flex: 1;
    padding: 6px;
}

.im-member-list {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.im-sidebar-member {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.15s;
}

.im-sidebar-member:hover {
    background: rgba(255,255,255,0.05);
}

.im-sidebar-member-avatar {
    position: relative;
    width: 32px;
    height: 32px;
    flex-shrink: 0;
}

.im-sidebar-member-avatar img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid #333;
}

.im-sidebar-member-info {
    flex: 1;
    min-width: 0;
}

.im-sidebar-member-name {
    font-size: 13px;
    color: #ddd;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: flex;
    align-items: center;
    gap: 4px;
}

.im-sidebar-member.online .im-sidebar-member-name {
    color: #44cc44;
}

.im-sidebar-member.offline {
    opacity: 0.6;
}

/* 选中成员标签样式 */
.im-selected-tag {
    display: inline-block;
    padding: 2px 8px;
    background: rgba(255,68,68,0.2);
    border: 1px solid rgba(255,68,68,0.4);
    border-radius: 10px;
    color: #ff6666;
    font-size: 11px;
    margin: 2px;
}

.im-selected-tags {
    max-height: 60px;
    overflow-y: auto;
}

/* 列表区域滚动优化 */
.im-list-area {
    flex: 1;
    min-height: 150px;
    max-height: none;
    overflow-y: auto;
    overflow-x: hidden;
    position: relative;
}

.im-user-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 2px;
    overflow-y: auto;
    max-height: 100%;
}

/* 响应式群聊 */
@media (max-width: 768px) {
    .im-chat-container-group,
    .im-chat-container-private {
        width: 95vw;
        height: 90vh;
    }
    .im-chat-sidebar {
        width: 180px;
    }
}

.im-chat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    background: linear-gradient(135deg, #2a1a1a, #1a1a1a);
    border-bottom: 1px solid #333;
    flex-shrink: 0;
}

.im-chat-title {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #fff;
    font-size: 15px;
    font-weight: 500;
}

.im-chat-title i {
    color: #ff4444;
}

.im-chat-close {
    width: 32px;
    height: 32px;
    background: rgba(255,255,255,0.1);
    border: none;
    border-radius: 50%;
    color: #aaa;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.im-chat-close:hover {
    background: #ff4444;
    color: #fff;
}

.im-chat-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-height: 0;
}

/* 群公告区域 */
.im-chat-announcement {
    padding: 10px 16px;
    background: rgba(255,170,0,0.08);
    border-bottom: 1px solid rgba(255,170,0,0.2);
    color: #ffaa00;
    font-size: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.im-chat-announcement i {
    font-size: 14px;
}

.im-chat-announcement-text {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* 群成员列表 */
.im-chat-members-bar {
    padding: 8px 12px;
    background: rgba(0,0,0,0.3);
    border-bottom: 1px solid #333;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
    font-size: 12px;
    color: #888;
}

.im-chat-members-bar .im-member-avatars {
    display: flex;
    gap: -6px;
    flex: 1;
    overflow: hidden;
}

.im-chat-members-bar .im-member-avatars img {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 2px solid #1a1a1a;
    margin-right: -6px;
    object-fit: cover;
}

.im-chat-members-bar .im-members-count {
    color: #666;
    font-size: 11px;
}

.im-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-height: 0;
}

.im-chat-messages::-webkit-scrollbar {
    width: 6px;
}

.im-chat-messages::-webkit-scrollbar-thumb {
    background: #444;
    border-radius: 3px;
}

.im-chat-loading,
.im-chat-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: #666;
    font-size: 13px;
}

.im-chat-loading i {
    font-size: 24px;
    margin-bottom: 10px;
    color: #ff4444;
}

.im-chat-empty i {
    font-size: 36px;
    margin-bottom: 10px;
    opacity: 0.5;
}

/* ===== 消息样式 - 无气泡扁平风格 ===== */
.im-message {
    max-width: 100%;
    word-wrap: break-word;
    display: flex;
    flex-direction: column;
}

.im-message-header {
    font-size: 12px;
    color: #888;
    margin-bottom: 4px;
    display: flex;
    gap: 8px;
    align-items: center;
}

.im-message-sender {
    font-weight: 600;
    color: #ddd;
    cursor: pointer;
    transition: color 0.2s;
}

.im-message-sender:hover {
    color: #ff4444;
}

.im-sender-leader {
    color: #ffaa00;
}

.im-sender-admin {
    color: #4488ff;
}

.im-message.mine {
    align-self: flex-end;
    align-items: flex-end;
}

.im-message.mine .im-message-header {
    justify-content: flex-end;
}

.im-message.other {
    align-self: flex-start;
    align-items: flex-start;
}

.im-message.other .im-message-header {
    justify-content: flex-start;
}

.im-message-content {
    padding: 4px 0;
    font-size: 14px;
    line-height: 1.6;
}

.im-message.mine .im-message-content {
    color: #fff;
}

.im-message.other .im-message-content {
    color: #ddd;
}

.im-message.system {
    align-self: center;
    max-width: 100%;
}

.im-message.system .im-message-content {
    background: rgba(255,170,0,0.1);
    color: #ffaa00;
    font-size: 12px;
    padding: 8px 16px;
    border-radius: 4px;
    text-align: center;
}

/* 系统红包/礼物：居中显示，但保留红包/礼物的原有交互样式 */
.im-message.system-attach {
    align-self: center;
    max-width: 100%;
}
.im-message.system-attach .im-message-header {
    justify-content: center;
}

.im-system-notice {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

.im-system-type {
    display: inline-block;
    background: rgba(255, 170, 0, 0.2);
    color: #ffaa00;
    padding: 2px 8px;
    border-radius: 3px;
    font-weight: 500;
}

.im-system-attach {
    color: #ff8866;
    font-size: 11px;
}

.im-system-content {
    color: #ffaa00;
    line-height: 1.5;
}

.im-gift-message {
    display: flex;
    align-items: center;
    gap: 6px;
}

.im-gift-message i {
    font-size: 18px;
    color: #ffaa00;
}

/* ===== 输入区域 ===== */
.im-chat-toolbar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    background: #1a1a1a;
    border-top: 1px solid #2a2a2a;
    flex-shrink: 0;
}

.im-toolbar-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: 1px solid #333;
    background: #252525;
    border-radius: 8px;
    cursor: pointer;
    color: #bbb;
    font-size: 16px;
    transition: all 0.2s;
}

.im-toolbar-btn:hover {
    background: linear-gradient(135deg, #ff4444, #cc2222);
    border-color: #ff4444;
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(255, 68, 68, 0.3);
}

#imAtBtn {
    color: #4488ff;
}

#imAtBtn:hover {
    background: linear-gradient(135deg, #4488ff, #2266dd);
    border-color: #4488ff;
    color: #fff;
    box-shadow: 0 4px 12px rgba(68, 136, 255, 0.3);
}

.im-chat-input-area {
    display: flex;
    gap: 10px;
    padding: 14px;
    background: #151515;
    flex-shrink: 0;
}

.im-chat-input-area textarea {
    flex: 1;
    background: #222;
    border: 1px solid #333;
    border-radius: 8px;
    padding: 10px 14px;
    color: #fff;
    font-size: 14px;
    resize: none;
    outline: none;
    transition: border-color 0.2s;
    font-family: inherit;
}

.im-chat-input-area textarea:focus {
    border-color: #ff4444;
}

.im-chat-send {
    width: 44px;
    height: 44px;
    background: linear-gradient(135deg, #ff4444, #cc2222);
    border: none;
    border-radius: 8px;
    color: #fff;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.im-chat-send:hover {
    transform: scale(1.05);
    box-shadow: 0 0 15px rgba(255,68,68,0.4);
}

.im-chat-send:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* ===== 表情面板 - QQ早期风格 ===== */
.im-emoji-btn {
    width: 36px;
    height: 36px;
    background: #252525;
    border: 1px solid #333;
    border-radius: 8px;
    color: #bbb;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    font-size: 16px;
}

.im-emoji-btn:hover {
    background: linear-gradient(135deg, #ff4444, #cc2222);
    border-color: #ff4444;
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(255, 68, 68, 0.3);
}

.im-emoji-panel {
    position: absolute;
    bottom: 218px;
    left: 14px;
    width: 300px;
    max-height: 260px;
    background: #f5f5f5;
    border: 1px solid #bbb;
    border-radius: 6px;
    padding: 8px;
    display: none;
    z-index: 100;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
}

.im-emoji-panel.show {
    display: flex;
    flex-direction: column;
}

.im-emoji-grid {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 2px;
    padding: 4px;
    overflow-y: auto;
    max-height: 200px;
}

.im-emoji-item {
    width: 32px;
    height: 32px;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s;
    overflow: hidden;
    background: #fff;
    border: 1px solid #ddd;
}

.im-emoji-item:hover {
    background: #e8e8e8;
    border-color: #bbb;
}

.im-emoji-item img {
    width: 26px;
    height: 26px;
    object-fit: contain;
}

/* QQ风格表情底部翻页 */
.im-emoji-footer {
    grid-column: 1 / -1;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 8px 2px;
    border-top: 1px solid #ddd;
    margin-top: 4px;
    font-size: 12px;
    color: #666;
}

.im-emoji-footer button {
    background: transparent;
    border: 1px solid #ccc;
    border-radius: 3px;
    color: #555;
    padding: 2px 8px;
    cursor: pointer;
    font-size: 11px;
}

.im-emoji-footer button:hover {
    background: #ddd;
}

.im-emoji-footer .page-info {
    flex: 1;
    text-align: center;
}

/* @提及选择器 */
.im-mention-picker {
    font-size: 14px;
    color: #333;
}

.im-mention-picker .im-mention-item {
    display: flex;
    align-items: center;
    padding: 8px 12px;
    cursor: pointer;
    transition: background 0.15s;
}

.im-mention-picker .im-mention-item:hover {
    background: #f0f7ff;
}

.im-mention-picker .im-mention-item img {
    border-radius: 50%;
}

/* @提及高亮 */
.im-mention-highlight {
    color: #4488ff;
    font-weight: 500;
    background: rgba(68, 136, 255, 0.1);
    padding: 1px 4px;
    border-radius: 3px;
}

/* 聊天容器相对定位 */
.im-chat-container {
    position: relative;
}

/* 表情消息样式 */
.im-message-content img,
.im-inline-emoji {
    max-width: 100px;
    max-height: 100px;
    border-radius: 8px;
    display: inline-block;
    vertical-align: middle;
    margin: 2px;
}

.im-inline-emoji {
    width: 28px;
    height: 28px;
    max-width: 28px;
    max-height: 28px;
    object-fit: contain;
    border-radius: 4px;
}

/* ===== 状态标签样式 ===== */
.im-status-tag {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    padding: 1px 6px;
    border-radius: 3px;
    font-size: 10px;
    font-weight: 500;
    line-height: 14px;
    margin-left: 4px;
}

.im-status-gaming {
    background: rgba(231, 76, 60, 0.2);
    color: #e74c3c;
    border: 1px solid rgba(231, 76, 60, 0.4);
}

.im-status-idle {
    background: rgba(46, 204, 113, 0.2);
    color: #2ecc71;
    border: 1px solid rgba(46, 204, 113, 0.4);
}

.im-status-offline {
    background: rgba(149, 165, 166, 0.2);
    color: #95a5a6;
    border: 1px solid rgba(149, 165, 166, 0.4);
}

/* 群成员/好友游戏状态标签 */
.im-member-status {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-size: 10px;
    padding: 1px 5px;
    border-radius: 2px;
    margin-right: 4px;
}

.im-member-status.gaming {
    background: rgba(231, 76, 60, 0.15);
    color: #e74c3c;
}

.im-member-status.idle {
    background: rgba(46, 204, 113, 0.15);
    color: #2ecc71;
}

.im-member-status.offline {
    background: rgba(149, 165, 166, 0.15);
    color: #7f8c8d;
}

/* ===== Toast提示（基础布局定义，颜色样式请见下方"Toast提示增强"） ===== */
.im-toast {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(-100px);
    padding: 12px 24px;
    border-radius: 8px;
    color: #fff;
    font-size: 14px;
    z-index: 10000;
    opacity: 0;
    transition: all 0.3s;
    pointer-events: none;
}

.im-toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* 颜色样式已迁移至下方"Toast提示增强"section统一管理 */
.im-toast.success { /* see enhanced section below */ }
.im-toast.error   { /* see enhanced section below */ }
.im-toast.info    { /* see enhanced section below */ }

/* ===== 未读消息徽章 ===== */
.msg-badge {
    display: inline-block;
    min-width: 18px;
    height: 18px;
    line-height: 18px;
    padding: 0 5px;
    background: #ff4444;
    color: #fff;
    font-size: 11px;
    border-radius: 9px;
    text-align: center;
    margin-left: 6px;
    animation: imPulse 1.5s infinite;
}

@keyframes imPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

/* ===== 群选择器样式 ===== */
.im-group-selector {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.im-group-tabs {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
    padding: 4px;
    background: rgba(255,255,255,0.03);
    border-radius: 6px;
}

.im-group-tab {
    flex: 1;
    min-width: 80px;
    padding: 6px 10px;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 4px;
    color: #888;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.im-group-tab:hover {
    color: #fff;
    background: rgba(255,255,255,0.05);
}

.im-group-tab.active {
    color: #ff4444;
    border-color: rgba(255,68,68,0.4);
    background: rgba(255,68,68,0.1);
}

.im-group-tab i {
    margin-right: 4px;
}

.im-group-content {
    min-height: 200px;
}

/* ===== 紧凑战队选择器（下拉选择） ===== */
.im-group-compact {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    background: rgba(255,255,255,0.03);
    border-radius: 6px;
    margin-bottom: 8px;
    flex-shrink: 0;
}

.im-group-compact-title {
    font-size: 12px;
    color: #888;
    white-space: nowrap;
}

.im-group-select {
    flex: 1;
    min-width: 0;
    padding: 4px 8px;
    background: rgba(0,0,0,0.4);
    border: 1px solid #333;
    border-radius: 4px;
    color: #fff;
    font-size: 12px;
    cursor: pointer;
    outline: none;
}

.im-group-select:focus {
    border-color: rgba(255,68,68,0.4);
}

.im-group-select option {
    background: #1a1a1a;
    color: #fff;
}

/* ===== 工具栏按钮（样式已移至上方统一维护） ===== */

/* ===== 礼物功能 ===== */
.im-gift-modal {
    padding: 0;
}

.im-gift-search {
    padding: 10px 15px;
    border-bottom: 1px solid #eee;
}

.im-gift-search .im-form-input {
    width: 100%;
    padding: 6px 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.im-gift-list {
    max-height: 250px;
    overflow-y: auto;
    padding: 10px;
}

.im-gift-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 8px;
}

.im-gift-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 8px;
    border: 2px solid transparent;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.15s;
    background: #f8f8f8;
}

.im-gift-item:hover {
    background: #e8f0fe;
    border-color: #c0d8ff;
}

.im-gift-item.selected {
    background: #e0efff;
    border-color: #4488ff;
}

.im-gift-item-icon {
    width: 70px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.im-gift-item-icon img {
    max-width: 100%;
    max-height: 100%;
    border-radius: 4px;
}

.im-gift-item-icon i {
    font-size: 28px;
    color: #aaa;
}

.im-gift-item-name {
    font-size: 12px;
    text-align: center;
    color: #333;
    word-break: break-all;
    margin-bottom: 2px;
}

.im-gift-item-cat-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.im-gift-item-cat {
    font-size: 10px;
    color: #999;
}

.im-gift-item-count {
    font-size: 10px;
    color: #4488ff;
    font-weight: 500;
}

.im-gift-form {
    padding: 10px 15px;
    border-top: 1px solid #eee;
}

.im-gift-preview {
    margin-top: 10px;
}

.im-gift-preview-item {
    display: flex;
    align-items: center;
    padding: 8px;
    background: #f8f8f8;
    border-radius: 6px;
}

.im-gift-preview-item img {
    width: 100px;
    height: 40px;
    border-radius: 4px;
    margin-right: 10px;
}

.im-gift-preview-name {
    font-weight: 500;
    color: #333;
}

.im-gift-preview-desc {
    font-size: 12px;
    color: #888;
}

/* 礼物消息样式 */
.im-gift-message {
    display: inline-flex;
    align-items: center;
    padding: 8px 12px;
    background: linear-gradient(135deg, #ffecd2 0%, #fcb69f 100%);
    border-radius: 12px;
    color: #8b4513;
    font-size: 14px;
}

.im-gift-message i {
    margin-right: 6px;
    font-size: 18px;
}

/* ===== 红包功能 ===== */
.im-redpack-modal {
    padding: 15px;
}

.im-redpack-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

.im-redpack-tab {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px;
    border: 2px solid #eee;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.15s;
    font-size: 14px;
    color: #666;
}

.im-redpack-tab:hover {
    border-color: #fcb69f;
}

.im-redpack-tab.active {
    border-color: #ff6b6b;
    background: #fff5f5;
    color: #ff6b6b;
}

.im-redpack-balance {
    font-size: 12px;
    color: #888;
    margin-top: 4px;
}

.im-redpack-hint {
    font-size: 12px;
    color: #888;
    margin-top: 4px;
}

.im-redpack-total {
    margin-top: 10px;
    padding: 10px;
    background: #fff5f5;
    border-radius: 6px;
    text-align: center;
    color: #ff6b6b;
    font-weight: 500;
}

/* 红包消息样式 */
.im-redpack-message {
    display: inline-block;
    padding: 10px 14px;
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a6f 100%);
    border-radius: 12px;
    color: #fff;
    cursor: pointer;
    transition: transform 0.15s;
}

.im-redpack-message:hover {
    transform: scale(1.05);
}

.im-redpack-message .redpack-icon {
    font-size: 20px;
    margin-right: 6px;
}

.im-redpack-message .redpack-text {
    font-weight: 500;
}

.im-redpack-message .redpack-claimed {
    opacity: 0.7;
}

.im-redpack-message.redpack-expired {
    opacity: 0.6;
    filter: grayscale(0.5);
}

.im-redpack-message.redpack-expired .redpack-text {
    color: #888;
}

.im-redpack-message.redpack-expired .redpack-icon {
    color: #666;
}

/* 红包详情 */
.im-redpack-detail {
    padding: 20px;
    text-align: center;
}

.im-redpack-detail-header {
    margin-bottom: 20px;
}

.im-redpack-detail-amount {
    font-size: 36px;
    font-weight: 600;
    color: #ff6b6b;
    margin-bottom: 8px;
}

.im-redpack-detail-sender {
    font-size: 14px;
    color: #333;
    margin-bottom: 4px;
}

.im-redpack-detail-msg {
    font-size: 12px;
    color: #888;
}

.im-redpack-claim-btn {
    padding: 12px 40px;
    font-size: 16px;
    border-radius: 24px;
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a6f 100%);
    border: none;
    color: #fff;
    cursor: pointer;
    transition: transform 0.15s;
}

.im-redpack-claim-btn:hover {
    transform: scale(1.05);
}

.im-redpack-detail-tip {
    font-size: 14px;
    color: #888;
    padding: 10px;
}

.im-redpack-detail-progress {
    font-size: 12px;
    color: #aaa;
    margin-top: 6px;
}

.im-redpack-detail-refund {
    font-size: 12px;
    color: #ff8866;
    margin-top: 8px;
    padding: 6px 10px;
    background: rgba(255, 68, 68, 0.08);
    border-radius: 4px;
    border-left: 3px solid #ff4444;
}

.im-redpack-detail-expire {
    font-size: 11px;
    color: #666;
    margin-top: 6px;
    font-style: italic;
}

/* ===== 抢礼物消息卡片 ===== */
.im-grabgift-message {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: linear-gradient(135deg, #3a1f1f 0%, #5a2d2d 100%);
    border: 1px solid rgba(255, 100, 100, 0.3);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 220px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.im-grabgift-message:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(255, 68, 68, 0.3);
    border-color: rgba(255, 100, 100, 0.6);
}

.im-grabgift-message.grabgift-claimed {
    opacity: 0.55;
    background: linear-gradient(135deg, #2a2a2a 0%, #3a3a3a 100%);
    cursor: default;
}

.im-grabgift-message.grabgift-claimed:hover {
    transform: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.im-grabgift-icon {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: linear-gradient(135deg, #ff4444, #cc0000);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 22px;
    box-shadow: 0 0 12px rgba(255, 68, 68, 0.5);
    flex-shrink: 0;
}

.im-grabgift-message.grabgift-claimed .im-grabgift-icon {
    background: linear-gradient(135deg, #555, #333);
    box-shadow: none;
}

.im-grabgift-body {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.im-grabgift-title {
    font-size: 14px;
    color: #fff;
    font-weight: 500;
}

.im-grabgift-action {
    font-size: 12px;
    color: #ff8866;
}

.im-grabgift-message.grabgift-claimed .im-grabgift-action {
    color: #888;
}

/* ===== 详情弹窗TAB切换 ===== */
.im-detail-tabs {
    display: flex;
    border-bottom: 1px solid #333;
    margin-bottom: 16px;
    flex-shrink: 0;
}

.im-detail-tab {
    flex: 1;
    padding: 10px 12px;
    text-align: center;
    color: #888;
    font-size: 13px;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: all 0.2s;
}

.im-detail-tab:hover {
    color: #ccc;
    background: rgba(255, 255, 255, 0.03);
}

.im-detail-tab.active {
    color: #ff4444;
    border-bottom-color: #ff4444;
}

.im-detail-content {
    min-height: 200px;
    max-height: 50vh;
    overflow-y: auto;
}

.im-detail-pane {
    display: none;
    animation: imFadeIn 0.2s ease;
}

.im-detail-pane.active {
    display: block;
}

/* ===== 礼物详情样式 ===== */
.im-gift-detail-header {
    text-align: center;
    padding: 20px 16px;
}

.im-gift-detail-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 12px;
    border-radius: 50%;
    background: linear-gradient(135deg, #ff4444, #cc0000);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 32px;
    box-shadow: 0 0 20px rgba(255, 68, 68, 0.4);
}

.im-gift-detail-name {
    font-size: 18px;
    font-weight: 600;
    color: #fff;
    margin-bottom: 4px;
}

.im-gift-detail-count {
    font-size: 14px;
    color: #ff8866;
    margin-bottom: 8px;
}

.im-gift-detail-sender {
    font-size: 12px;
    color: #888;
}

.im-gift-detail-tip {
    text-align: center;
    font-size: 13px;
    color: #888;
    padding: 16px;
}

.im-gift-claim-btn {
    display: block;
    margin: 16px auto 0;
    padding: 12px 36px;
    font-size: 15px;
    border-radius: 24px;
    background: linear-gradient(135deg, #ff4444 0%, #cc0000 100%);
    border: none;
    color: #fff;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 2px 12px rgba(255, 68, 68, 0.4);
}

.im-gift-claim-btn:hover {
    transform: translateY(-2px) scale(1.03);
    box-shadow: 0 4px 20px rgba(255, 68, 68, 0.6);
}

.im-gift-claim-btn i {
    margin-right: 6px;
}

/* ===== 领取记录列表 ===== */
.im-records-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 4px 0;
}

.im-record-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 8px;
    transition: all 0.2s;
}

.im-record-item:hover {
    background: rgba(255, 68, 68, 0.08);
    border-color: rgba(255, 68, 68, 0.2);
}

.im-record-avatar {
    width: 36px;
    height: 36px;
    flex-shrink: 0;
}

.im-record-avatar img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 2px solid #333;
    object-fit: cover;
}

.im-record-info {
    flex: 1;
    min-width: 0;
}

.im-record-name {
    font-size: 13px;
    color: #fff;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.im-record-time {
    font-size: 11px;
    color: #666;
    margin-top: 2px;
}

.im-record-amount {
    font-size: 14px;
    color: #ff8866;
    font-weight: 600;
    flex-shrink: 0;
}

/* ===== 响应式 ===== */
@media (max-width: 768px) {
    .im-chat-container {
        width: 100%;
        height: 100%;
        max-width: 100vw;
        max-height: 100vh;
        border-radius: 0;
    }
    
    .im-message {
        max-width: 90%;
    }
    
    .im-modal {
        width: 95vw;
        max-height: 90vh;
    }
    
    .im-bottom-bar .im-btn-text {
        font-size: 10px;
    }
}

/* ===== 空好友提示优化 ===== */
.im-empty-hint {
    text-align: center;
    color: #555;
    font-size: 12px;
    margin-top: 4px;
}

/* 好友/群列表分组标题 */
.im-section-title {
    font-size: 11px;
    color: #666;
    text-transform: uppercase;
    padding: 8px 4px 4px;
    letter-spacing: 0.5px;
}

/* 状态设置开关样式 */
.im-switch {
    position: relative;
    width: 40px;
    height: 22px;
    background: #333;
    border-radius: 11px;
    cursor: pointer;
    transition: background 0.2s;
}

.im-switch.on {
    background: #ff4444;
}

.im-switch::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 18px;
    height: 18px;
    background: #fff;
    border-radius: 50%;
    transition: transform 0.2s;
}

.im-switch.on::after {
    transform: translateX(18px);
}

/* 群成员邀请列表 */
.im-invite-list {
    max-height: 250px;
    overflow-y: auto;
}

.im-invite-list .im-user-item {
    padding: 8px 10px;
}

.im-invite-list .im-check {
    position: absolute;
    right: 12px;
    width: 20px;
    height: 20px;
    border: 2px solid #555;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: transparent;
    font-size: 12px;
}

.im-invite-list .im-check.checked {
    border-color: #ff4444;
    background: #ff4444;
    color: #fff;
}

/* ===== 在线状态脉冲动画 ===== */
@keyframes online-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(68,204,68,0.6); }
    50% { box-shadow: 0 0 0 4px rgba(68,204,68,0); }
}

.im-user-status-dot.online {
    animation: online-pulse 2s infinite;
}

/* ===== 群公告增强样式 ===== */
.im-chat-announcement {
    position: relative;
}

.im-chat-announcement-text {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ===== 群成员栏增强 ===== */
.im-chat-members-bar {
    position: relative;
}

.im-chat-members-bar .im-member-avatars img:hover {
    z-index: 10;
    transform: scale(1.15);
    transition: transform 0.2s;
}

/* ===== 表单元素美化 ===== */
.im-form-input,
.im-form-textarea {
    width: 100%;
    padding: 10px 12px;
    background: rgba(0,0,0,0.4);
    border: 1px solid #444;
    border-radius: 6px;
    color: #fff;
    font-size: 13px;
    transition: all 0.2s;
}

.im-form-input:focus,
.im-form-textarea:focus {
    outline: none;
    border-color: #ff4444;
    background: rgba(0,0,0,0.6);
    box-shadow: 0 0 0 2px rgba(255,68,68,0.15);
}

.im-form-label {
    display: block;
    color: #ccc;
    font-size: 13px;
    font-weight: 500;
    margin-bottom: 6px;
}

.im-form-group {
    margin-bottom: 16px;
}

/* ===== Toast提示增强 ===== */
.im-toast {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(-100px);
    padding: 14px 28px 14px 20px;
    background: linear-gradient(135deg, rgba(20, 20, 30, 0.98), rgba(15, 15, 25, 0.98)) !important;
    border: 1px solid rgba(192, 57, 43, 0.3);
    border-left: 4px solid #888;
    border-radius: 8px;
    color: #e0e0e0 !important;
    font-size: 13px;
    font-weight: 500;
    z-index: 10000;
    opacity: 0;
    transition: all 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 8px 32px rgba(0,0,0,0.6), 0 0 20px rgba(192, 57, 43, 0.1);
    backdrop-filter: blur(10px);
    max-width: 85%;
    word-break: break-word;
    display: flex;
    align-items: center;
    gap: 10px;
    pointer-events: none;
}

.im-toast::before {
    font-family: FontAwesome;
    font-size: 16px;
    flex-shrink: 0;
    width: 20px;
    text-align: center;
}

.im-toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.im-toast.success {
    background: linear-gradient(135deg, rgba(20, 20, 30, 0.98), rgba(15, 15, 25, 0.98)) !important;
    border-color: rgba(76, 175, 80, 0.5) !important;
    border-left-color: #4caf50 !important;
    color: #66bb6a !important;
}
.im-toast.success::before {
    content: "\f058";
    color: #4caf50;
}

.im-toast.error {
    background: linear-gradient(135deg, rgba(25, 15, 15, 0.98), rgba(20, 10, 10, 0.98)) !important;
    border-color: rgba(255, 82, 82, 0.5) !important;
    border-left-color: #e74c3c !important;
    color: #ff8a80 !important;
}
.im-toast.error::before {
    content: "\f06a";
    color: #ff5252;
    animation: im-toast-error-pulse 0.8s ease-in-out infinite alternate;
}

@keyframes im-toast-error-pulse {
    0% { text-shadow: 0 0 5px rgba(255, 82, 82, 0.5); }
    100% { text-shadow: 0 0 15px rgba(255, 82, 82, 0.9); }
}

.im-toast.info {
    background: linear-gradient(135deg, rgba(20, 20, 30, 0.98), rgba(15, 15, 25, 0.98)) !important;
    border-color: rgba(68, 136, 255, 0.5) !important;
    border-left-color: #4488ff !important;
    color: #82b1ff !important;
}
.im-toast.info::before {
    content: "\f05a";
    color: #4488ff;
}

/* ===== 空状态图标增强 ===== */
.im-empty {
    text-align: center;
    padding: 40px 20px;
    color: #666;
}

.im-empty i {
    font-size: 48px;
    margin-bottom: 12px;
    opacity: 0.4;
}

.im-empty p {
    font-size: 14px;
    margin: 4px 0;
}

/* ===== 加载动画 ===== */
.im-loading {
    text-align: center;
    padding: 20px;
    color: #666;
    font-size: 13px;
}

.im-loading i {
    color: #ff4444;
    margin-right: 6px;
}

/* ===== 聊天消息空状态 ===== */
.im-chat-empty {
    text-align: center;
    padding: 60px 20px;
    color: #555;
}

.im-chat-empty i {
    font-size: 48px;
    margin-bottom: 12px;
    opacity: 0.3;
}

.im-chat-empty p {
    font-size: 14px;
}

/* ===== 聊天加载状态 ===== */
.im-chat-loading {
    text-align: center;
    padding: 40px;
    color: #666;
    font-size: 13px;
}

/* ===== 群选择器样式 ===== */
.im-group-selector {
    padding: 4px;
}

.im-group-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 10px;
}

.im-group-tab {
    flex: 1;
    padding: 8px 10px;
    background: rgba(255,255,255,0.03);
    border: 1px solid #333;
    border-radius: 6px;
    color: #888;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.im-group-tab:hover {
    background: rgba(255,255,255,0.06);
    color: #fff;
}

.im-group-tab.active {
    background: rgba(255,68,68,0.15);
    border-color: #ff4444;
    color: #ff4444;
}

.im-group-tab i {
    margin-right: 4px;
}

/* ===== 响应式优化 ===== */
@media (max-width: 480px) {
    .im-user-item {
        padding: 8px;
    }
    
    .im-user-name {
        font-size: 13px;
    }
    
    .im-user-meta {
        font-size: 10px;
    }
    
    .im-bottom-bar .im-btn {
        padding: 6px 4px;
        font-size: 11px;
    }
    
    .im-bottom-bar .im-btn i {
        font-size: 14px;
    }
}

/* ===== QQ风格群聊窗口 - 暗黑生化版 ===== */

/* 群聊容器 */
.im-chat-container-group,
.im-chat-container-private {
    width: 820px;
    max-width: 95vw;
    height: 600px;
}

/* 群聊/单聊头部标题栏 - QQ风格 */
.im-chat-container-group .im-chat-header,
.im-chat-container-private .im-chat-header {
    background: linear-gradient(135deg, #2a1a1a 0%, #1a1515 100%);
    padding: 12px 18px;
    border-bottom: 2px solid #333;
    position: relative;
}

.im-chat-container-group .im-chat-header::after,
.im-chat-container-private .im-chat-header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, #ff4444, transparent);
}

/* 群聊标题 - 可点击打开群主页 */
.im-chat-container-group .im-chat-title,
.im-chat-container-private .im-chat-title {
    cursor: pointer;
    transition: all 0.2s;
}

.im-chat-container-group .im-chat-title:hover,
.im-chat-container-private .im-chat-title:hover {
    color: #ff4444;
    text-shadow: 0 0 10px rgba(255,68,68,0.5);
}

/* 群聊消息区域背景 */
.im-chat-container-group .im-chat-messages {
    background: #0d0d0d;
}

/* 单聊消息区域背景 */
.im-chat-container-private .im-chat-messages {
    background: #0d0d0d;
}

/* 群聊右侧边栏 - QQ风格 */
.im-chat-container-group .im-sidebar-group {
    flex: 0 0 240px;
    width: 240px;
    min-width: 240px;
    background: linear-gradient(180deg, #1a1a1a 0%, #141414 100%);
    border-left: 1px solid #333;
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
}

/* 群公告区域 */
.im-chat-container-group .im-sidebar-announcement {
    border-bottom: 1px solid #333;
    background: rgba(255,170,0,0.03);
}

.im-chat-container-group .im-sidebar-announcement .im-sidebar-header {
    background: linear-gradient(90deg, rgba(255,170,0,0.15) 0%, rgba(255,170,0,0.05) 100%);
    border-bottom: 1px solid rgba(255,170,0,0.3);
}

.im-chat-container-group .im-sidebar-announcement .im-sidebar-header i {
    color: #ffaa00;
}

.im-chat-container-group .im-sidebar-announcement .im-sidebar-body {
    max-height: 120px;
    min-height: 80px;
}

/* 群成员区域 */
.im-chat-container-group .im-sidebar-members {
    flex: 1;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.im-chat-container-group .im-sidebar-members .im-sidebar-header {
    background: linear-gradient(90deg, rgba(255,68,68,0.15) 0%, rgba(255,68,68,0.05) 100%);
    border-bottom: 1px solid rgba(255,68,68,0.3);
}

.im-chat-container-group .im-sidebar-members .im-sidebar-header i {
    color: #ff4444;
}

.im-chat-container-group .im-members-body {
    flex: 1;
    overflow-y: auto;
    padding: 8px;
}

/* 群成员项 - QQ风格 */
.im-chat-container-group .im-sidebar-member {
    padding: 10px 8px;
    margin-bottom: 2px;
    border-radius: 4px;
    transition: all 0.15s;
}

.im-chat-container-group .im-sidebar-member:hover {
    background: rgba(255,68,68,0.1);
    transform: translateX(2px);
}

.im-chat-container-group .im-sidebar-member-avatar {
    width: 30px;
    height: 30px;
}

.im-chat-container-group .im-sidebar-member-avatar img {
    border: 1px solid #444;
}

.im-chat-container-group .im-sidebar-member-name {
    font-size: 12px;
}

.im-chat-container-group .im-sidebar-member.online .im-sidebar-member-name {
    color: #44cc44;
}

.im-chat-container-group .im-sidebar-member.offline {
    opacity: 0.5;
}

.im-chat-container-group .im-member-status-gaming {
    background: rgba(255,68,68,0.2);
    color: #ff6666;
}

/* ===== 好友战绩侧边栏样式 ===== */
.im-sidebar-stats {
    flex: 0 0 220px;
    width: 220px;
    min-width: 220px;
    background: linear-gradient(180deg, #1a1a1a 0%, #141414 100%);
    border-left: 1px solid #333;
    display: none;
    flex-direction: column;
}

.im-sidebar-stats .im-sidebar-header {
    background: linear-gradient(90deg, rgba(255,170,0,0.15) 0%, rgba(255,170,0,0.05) 100%);
    border-bottom: 1px solid rgba(255,170,0,0.3);
}

.im-sidebar-stats .im-sidebar-header i {
    color: #ffaa00;
}

.im-sidebar-stats .im-sidebar-body {
    flex: 1;
    overflow-y: auto;
    padding: 12px;
}

/* 战绩3x3网格 */
.im-stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.im-stat-icon-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 10px 4px;
    background: linear-gradient(135deg, rgba(255,68,68,0.06), rgba(255,255,255,0.02));
    border: 1px solid rgba(255,68,68,0.15);
    border-radius: 8px;
    transition: all 0.2s;
}

.im-stat-icon-item:hover {
    border-color: rgba(255,68,68,0.35);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255,68,68,0.15);
}

.im-stat-icon-box {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    font-size: 14px;
}

.im-stat-icon-box.kills { background: rgba(255,68,68,0.2); color: #ff6666; }
.im-stat-icon-box.deaths { background: rgba(150,150,150,0.2); color: #aaa; }
.im-stat-icon-box.kd { background: rgba(255,170,0,0.2); color: #ffaa00; }
.im-stat-icon-box.wins { background: rgba(34,170,68,0.2); color: #44cc44; }
.im-stat-icon-box.losses { background: rgba(255,68,68,0.15); color: #ff4444; }
.im-stat-icon-box.headshots { background: rgba(155,89,182,0.2); color: #bf66e6; }
.im-stat-icon-box.level { background: rgba(255,170,0,0.15); color: #ffcc44; }
.im-stat-icon-box.points { background: rgba(255,170,0,0.2); color: #ffaa00; }
.im-stat-icon-box.score { background: rgba(68,136,255,0.2); color: #4488ff; }

.im-stat-icon-value {
    font-size: 11px;
    color: #ddd;
    font-weight: 600;
    text-align: center;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ===== QQ风格底部输入区 (暗黑生化版) ===== */
.im-chat-bottom {
    display: flex;
    flex-direction: column;
    background: #1a1a1a;
    border-top: 1px solid #333;
    flex-shrink: 0;
}

.im-chat-bottom .im-chat-toolbar {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: #1e1e1e;
    border-bottom: 1px solid #333;
    flex-shrink: 0;
}

.im-chat-bottom .im-toolbar-btn,
.im-chat-bottom .im-emoji-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    border-radius: 6px;
    cursor: pointer;
    color: #aaa;
    font-size: 15px;
    transition: all 0.2s;
}

.im-chat-bottom .im-toolbar-btn:hover,
.im-chat-bottom .im-emoji-btn:hover {
    background: rgba(255,68,68,0.15);
    color: #ff4444;
    transform: scale(1.1);
}

.im-chat-bottom .im-chat-input-area {
    padding: 8px 12px 4px 12px;
    background: #1a1a1a;
}

.im-chat-bottom .im-chat-input-area textarea {
    width: 100%;
    background: #222;
    border: 1px solid #333;
    border-radius: 6px;
    padding: 10px 12px;
    color: #eee;
    font-size: 14px;
    resize: none;
    outline: none;
    transition: border-color 0.2s;
    font-family: inherit;
    line-height: 1.5;
    height: 110px;
}

.im-chat-bottom .im-chat-input-area textarea:focus {
    border-color: #ff4444;
    box-shadow: 0 0 8px rgba(255,68,68,0.2);
}

.im-chat-bottom .im-chat-send-row {
    display: flex;
    justify-content: flex-end;
    padding: 4px 12px 10px 12px;
    background: #1a1a1a;
}

.im-chat-bottom .im-chat-send {
    min-width: 90px;
    height: 34px;
    background: linear-gradient(135deg, #ff4444 0%, #cc2222 100%);
    border: none;
    border-radius: 6px;
    color: #fff;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 13px;
    font-weight: 500;
    padding: 0 20px;
}

.im-chat-bottom .im-chat-send:hover {
    background: linear-gradient(135deg, #ff5555 0%, #dd3333 100%);
    box-shadow: 0 0 12px rgba(255,68,68,0.4);
    transform: translateY(-1px);
}

.im-chat-bottom .im-chat-send:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* ===== 用户资料卡弹窗 - 暗黑生化风格 ===== */
.im-profile-modal {
    width: 400px;
    max-width: 92vw;
}

.im-profile-modal-content {
    max-height: 520px;
    display: flex;
    flex-direction: column;
}

/* 资料卡头部 */
.im-profile-header {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 24px 20px 20px;
    background: linear-gradient(135deg, #2a1a1a 0%, #1a1515 100%);
    border-bottom: 1px solid rgba(255,68,68,0.3);
    position: relative;
}

.im-profile-header::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, #ff4444, transparent);
}

.im-profile-avatar {
    width: 76px;
    height: 76px;
    border-radius: 50%;
    overflow: visible;
    border: 2px solid #ff4444;
    box-shadow: 0 0 20px rgba(255,68,68,0.35);
    position: relative;
    flex-shrink: 0;
}

.im-profile-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

.im-profile-status-badge {
    position: absolute;
    bottom: -4px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 11px;
    padding: 2px 10px;
    border-radius: 10px;
    white-space: nowrap;
    box-shadow: 0 2px 8px rgba(0,0,0,0.4);
}

.im-profile-status-badge.online {
    background: linear-gradient(135deg, #22aa44, #118833);
    color: #fff;
}

.im-profile-status-badge.offline {
    background: linear-gradient(135deg, #666, #444);
    color: #ccc;
}

.im-profile-status-badge.gaming {
    background: linear-gradient(135deg, #ff4444, #cc2222);
    color: #fff;
    animation: pulse-status 1.5s infinite;
}

.im-profile-status-badge.idle {
    background: linear-gradient(135deg, #44aacc, #2288aa);
    color: #fff;
}

@keyframes pulse-status {
    0%, 100% { box-shadow: 0 2px 8px rgba(255,68,68,0.4); }
    50% { box-shadow: 0 2px 16px rgba(255,68,68,0.7); }
}

.im-profile-info {
    flex: 1;
    min-width: 0;
}

.im-profile-name {
    font-size: 18px;
    font-weight: 700;
    color: #fff;
    margin-bottom: 4px;
    text-shadow: 0 0 10px rgba(255,68,68,0.3);
}

.im-profile-id {
    font-size: 12px;
    color: #888;
    margin-bottom: 10px;
}

.im-profile-meta {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.im-profile-level {
    font-size: 11px;
    padding: 3px 10px;
    background: linear-gradient(135deg, rgba(255,68,68,0.2), rgba(255,68,68,0.1));
    border: 1px solid rgba(255,68,68,0.3);
    border-radius: 10px;
    color: #ff6666;
    font-weight: 600;
}

.im-profile-points {
    font-size: 12px;
    color: #ffaa00;
    display: flex;
    align-items: center;
    gap: 4px;
}

.im-profile-points i {
    color: #ffaa00;
}

/* TAB按钮 */
.im-profile-tabs {
    display: flex;
    background: #161616;
    border-bottom: 1px solid #333;
    flex-shrink: 0;
}

.im-profile-tab {
    flex: 1;
    padding: 12px 8px;
    background: transparent;
    border: none;
    color: #777;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
    border-bottom: 2px solid transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-family: inherit;
}

.im-profile-tab:hover {
    color: #ccc;
    background: rgba(255,255,255,0.03);
}

.im-profile-tab.active {
    color: #ff4444;
    border-bottom-color: #ff4444;
    background: rgba(255,68,68,0.08);
    text-shadow: 0 0 8px rgba(255,68,68,0.4);
}

.im-profile-tab i {
    font-size: 14px;
}

/* TAB内容区 */
.im-profile-body {
    flex: 1;
    overflow-y: auto;
    padding: 16px 18px;
    background: #111;
}

.im-profile-tab-pane {
    display: none;
}

.im-profile-tab-pane.active {
    display: block;
    animation: fadeIn 0.25s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(5px); }
    to { opacity: 1; transform: translateY(0); }
}

/* 个人信息 */
.im-info-list {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.im-info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 11px 0;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

.im-info-row:last-child {
    border-bottom: none;
}

.im-info-label {
    color: #888;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.im-info-label i {
    color: #ff4444;
    width: 16px;
    text-align: center;
}

.im-info-value {
    color: #fff;
    font-size: 13px;
    font-weight: 500;
}

.im-status-online { color: #44cc44 !important; }
.im-status-offline { color: #777 !important; }
.im-status-gaming { color: #ff4444 !important; }
.im-status-idle { color: #44aacc !important; }

.im-member-status.idle {
    background: rgba(68, 170, 204, 0.15);
    color: #44aacc;
}

/* 收藏列表 */
.im-favorite-list {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.im-favorite-item {
    padding: 10px 8px;
    background: linear-gradient(135deg, rgba(255,68,68,0.05), rgba(255,255,255,0.02));
    border: 1px solid rgba(255,68,68,0.15);
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    transition: all 0.2s;
}

.im-favorite-item:hover {
    background: linear-gradient(135deg, rgba(255,68,68,0.12), rgba(255,68,68,0.05));
    border-color: rgba(255,68,68,0.4);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255,68,68,0.15);
}

.im-favorite-item img {
    width: 40px;
    height: 40px;
    border-radius: 4px;
}

.im-favorite-item-name {
    font-size: 11px;
    color: #ddd;
    text-align: center;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.im-favorite-item-count {
    font-size: 11px;
    color: #ffaa00;
    font-weight: 600;
}

.im-favorite-empty {
    text-align: center;
    padding: 40px 20px;
    color: #555;
    font-size: 13px;
}

.im-favorite-empty::before {
    content: '\f006';
    font-family: FontAwesome;
    display: block;
    font-size: 40px;
    margin-bottom: 12px;
    color: #333;
}

/* 收藏视频卡片 */
.im-favorite-video-list {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    max-height: 360px;
    overflow-y: auto;
}

.im-favorite-video-card {
    background: linear-gradient(135deg, rgba(255,68,68,0.05), rgba(255,255,255,0.02));
    border: 1px solid rgba(255,68,68,0.15);
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.2s;
}

.im-favorite-video-card:hover {
    background: linear-gradient(135deg, rgba(255,68,68,0.12), rgba(255,68,68,0.05));
    border-color: rgba(255,68,68,0.4);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255,68,68,0.15);
}

.im-favorite-video-cover {
    position: relative;
    width: 100%;
    padding-top: 56.25%;
    background: #1a1a1a;
    overflow: hidden;
}

.im-favorite-video-cover img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.im-favorite-video-duration {
    position: absolute;
    right: 6px;
    bottom: 6px;
    background: rgba(0,0,0,0.75);
    color: #fff;
    font-size: 11px;
    padding: 2px 6px;
    border-radius: 4px;
}

.im-favorite-video-info {
    padding: 10px;
}

.im-favorite-video-title {
    font-size: 12px;
    color: #eee;
    line-height: 1.4;
    max-height: 2.8em;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    margin-bottom: 6px;
}

.im-favorite-video-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 11px;
    color: #888;
}

.im-favorite-video-author {
    max-width: 50%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.im-favorite-video-views {
    display: flex;
    align-items: center;
    gap: 4px;
}

/* 战绩卡片 */
.im-stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.im-stat-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 12px;
    background: linear-gradient(135deg, rgba(255,68,68,0.06), rgba(255,255,255,0.02));
    border: 1px solid rgba(255,68,68,0.15);
    border-radius: 10px;
    transition: all 0.2s;
}

.im-stat-card:hover {
    border-color: rgba(255,68,68,0.35);
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(255,68,68,0.12);
}

.im-stat-card.highlight {
    background: linear-gradient(135deg, rgba(255,68,68,0.15), rgba(255,68,68,0.05));
    border-color: rgba(255,68,68,0.4);
}

.im-stat-icon {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    background: rgba(255,68,68,0.15);
    color: #ff4444;
    font-size: 18px;
    flex-shrink: 0;
}

.im-stat-icon.deaths { background: rgba(150,150,150,0.15); color: #aaa; }
.im-stat-icon.kd { background: rgba(255,170,0,0.15); color: #ffaa00; }
.im-stat-icon.wins { background: rgba(34,170,68,0.15); color: #44cc44; }
.im-stat-icon.losses { background: rgba(255,68,68,0.15); color: #ff6666; }
.im-stat-icon.headshots { background: rgba(155,89,182,0.15); color: #bf66e6; }

.im-stat-info {
    flex: 1;
    min-width: 0;
}

.im-stat-value {
    font-size: 20px;
    font-weight: 700;
    color: #fff;
    line-height: 1.2;
}

.im-stat-card.highlight .im-stat-value {
    color: #ffaa00;
}

.im-stat-label {
    font-size: 12px;
    color: #888;
    margin-top: 2px;
}

/* ===== 群主页弹窗 ===== */
.im-group-page {
    width: 450px;
    max-width: 90vw;
}

.im-group-banner {
    height: 100px;
    background: linear-gradient(135deg, #2a1a1a 0%, #1a1a1a 50%, #2a1a2a 100%);
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.im-group-banner::after {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='60' height='60' viewBox='0 0 60 60'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ff4444' fill-opacity='0.05'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4m-3-7a8 8 0 100-16 8 8 0 000 16z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    opacity: 0.5;
}

.im-group-avatar-lg {
    width: 64px;
    height: 64px;
    border-radius: 8px;
    border: 2px solid #ff4444;
    box-shadow: 0 0 20px rgba(255,68,68,0.4);
    z-index: 1;
}

.im-group-body {
    padding: 20px;
}

.im-group-name-lg {
    font-size: 20px;
    font-weight: 600;
    color: #fff;
    text-align: center;
    margin-bottom: 8px;
}

.im-group-meta {
    display: flex;
    justify-content: center;
    gap: 16px;
    margin-bottom: 16px;
}

.im-group-meta-item {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 13px;
    color: #888;
}

.im-group-meta-item i {
    color: #ff4444;
}

.im-group-desc {
    padding: 12px;
    background: rgba(255,255,255,0.03);
    border: 1px solid #333;
    border-radius: 6px;
    color: #ccc;
    font-size: 13px;
    line-height: 1.6;
    margin-bottom: 16px;
}

.im-group-members-section {
    margin-top: 12px;
}

.im-group-members-title {
    font-size: 13px;
    color: #888;
    margin-bottom: 8px;
}

.im-group-members-preview {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.im-group-member-chip {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    background: rgba(255,255,255,0.03);
    border: 1px solid #333;
    border-radius: 16px;
    font-size: 12px;
    color: #ddd;
}

.im-group-member-chip img {
    width: 20px;
    height: 20px;
    border-radius: 50%;
}

/* ===== 暗黑生化滚动条美化 ===== */
.im-chat-messages::-webkit-scrollbar,
.im-sidebar-body::-webkit-scrollbar,
.im-members-body::-webkit-scrollbar,
.im-profile-body::-webkit-scrollbar,
.im-gift-list::-webkit-scrollbar,
.im-emoji-grid::-webkit-scrollbar,
.im-chat-input-area textarea::-webkit-scrollbar,
.im-history-list::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

.im-chat-messages::-webkit-scrollbar-track,
.im-sidebar-body::-webkit-scrollbar-track,
.im-members-body::-webkit-scrollbar-track,
.im-profile-body::-webkit-scrollbar-track,
.im-gift-list::-webkit-scrollbar-track,
.im-emoji-grid::-webkit-scrollbar-track,
.im-chat-input-area textarea::-webkit-scrollbar-track,
.im-history-list::-webkit-scrollbar-track {
    background: rgba(0,0,0,0.3);
    border-radius: 3px;
}

.im-chat-messages::-webkit-scrollbar-thumb,
.im-sidebar-body::-webkit-scrollbar-thumb,
.im-members-body::-webkit-scrollbar-thumb,
.im-profile-body::-webkit-scrollbar-thumb,
.im-gift-list::-webkit-scrollbar-thumb,
.im-emoji-grid::-webkit-scrollbar-thumb,
.im-chat-input-area textarea::-webkit-scrollbar-thumb,
.im-history-list::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #ff4444 0%, #cc2222 100%);
    border-radius: 3px;
    transition: background 0.2s;
}

.im-chat-messages::-webkit-scrollbar-thumb:hover,
.im-sidebar-body::-webkit-scrollbar-thumb:hover,
.im-members-body::-webkit-scrollbar-thumb:hover,
.im-profile-body::-webkit-scrollbar-thumb:hover,
.im-gift-list::-webkit-scrollbar-thumb:hover,
.im-emoji-grid::-webkit-scrollbar-thumb:hover,
.im-chat-input-area textarea::-webkit-scrollbar-thumb:hover,
.im-history-list::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, #ff6666 0%, #dd3333 100%);
}

/* 暗黑生化通用滚动条 */
.im-modal-body::-webkit-scrollbar,
.im-modal::-webkit-scrollbar {
    width: 8px;
}

.im-modal-body::-webkit-scrollbar-track,
.im-modal::-webkit-scrollbar-track {
    background: #1a1a1a;
}

.im-modal-body::-webkit-scrollbar-thumb,
.im-modal::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #ff4444 0%, #cc2222 100%);
    border-radius: 4px;
}

.im-modal-body::-webkit-scrollbar-thumb:hover,
.im-modal::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, #ff6666 0%, #dd3333 100%);
}

/* ===== 礼物窗口暗黑生化风格 ===== */
.im-gift-modal {
    background: #1a1a1a;
}

.im-gift-search {
    background: #1a1a1a;
    border-bottom: 1px solid #333;
}

.im-gift-search .im-form-input {
    background: rgba(0,0,0,0.4);
    border-color: #444;
    color: #fff;
}

.im-gift-search .im-form-input:focus {
    border-color: #ff4444;
}

.im-gift-list {
    background: #151515;
}

.im-gift-item {
    background: rgba(255,255,255,0.03);
    border-color: #333;
}

.im-gift-item:hover {
    background: rgba(255,68,68,0.1);
    border-color: #ff4444;
}

.im-gift-item.selected {
    background: rgba(255,68,68,0.2);
    border-color: #ff4444;
    box-shadow: 0 0 15px rgba(255,68,68,0.3);
}

.im-gift-item-name {
    color: #ddd;
}

.im-gift-item-icon i {
    color: #ff4444;
}

.im-gift-item-count {
    color: #44cc44;
}

.im-gift-form {
    background: #1a1a1a;
    border-top: 1px solid #333;
}

.im-gift-preview-item {
    background: rgba(255,68,68,0.1);
    border: 1px solid rgba(255,68,68,0.2);
}

.im-gift-preview-name {
    color: #fff;
}

.im-gift-preview-desc {
    color: #888;
}

/* ===== 暗黑生化模态框 ===== */
.im-modal {
    background: linear-gradient(135deg, #1a1a1a 0%, #151515 100%);
    border: 1px solid #333;
    box-shadow: 0 20px 60px rgba(0,0,0,0.5), 0 0 30px rgba(255,68,68,0.1);
}

.im-modal-header {
    background: linear-gradient(135deg, #2a1a1a 0%, #1a1a1a 100%);
    border-bottom: 1px solid #333;
    position: relative;
}

.im-modal-header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, #ff4444, transparent);
}

.im-modal-title {
    color: #fff;
}

.im-modal-close {
    color: #888;
}

.im-modal-close:hover {
    background: #ff4444;
    color: #fff;
}

.im-modal-body {
    background: #151515;
}

.im-modal-footer {
    background: #1a1a1a;
    border-top: 1px solid #333;
}

/* ===== 暗黑生化按钮 ===== */
.im-btn-primary {
    background: linear-gradient(135deg, #ff4444 0%, #cc2222 100%);
    border: none;
    color: #fff;
    padding: 10px 24px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s;
    box-shadow: 0 4px 12px rgba(255,68,68,0.3);
}

.im-btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(255,68,68,0.4);
}

.im-btn-secondary {
    background: rgba(255,255,255,0.05);
    border: 1px solid #444;
    color: #ccc;
    padding: 10px 24px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s;
}

.im-btn-secondary:hover {
    background: rgba(255,255,255,0.1);
    border-color: #666;
    color: #fff;
}

/* 消息发送者可点击 */
.im-message-sender {
    cursor: pointer;
    transition: color 0.2s;
}

.im-message-sender:hover {
    color: #ff4444 !important;
    text-decoration: underline;
}

/* 群成员状态点 */
.im-sidebar-member-status {
    position: absolute;
    bottom: 2px;
    right: 2px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    border: 1px solid #1a1a1a;
}

.im-sidebar-member-status.online {
    background: #44cc44;
}

.im-sidebar-member-status.offline {
    background: #666;
}

.im-sidebar-member-status.gaming {
    background: #ff4444;
    animation: gaming-pulse 1.5s infinite;
}

@keyframes gaming-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(255,68,68,0.6); }
    50% { box-shadow: 0 0 0 3px rgba(255,68,68,0); }
}

/* ===== 字体设置面板 ===== */
.im-font-panel {
    position: fixed;
    background: #1e1e1e;
    border: 1px solid #333;
    border-radius: 8px;
    padding: 14px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.5);
    display: none;
    z-index: 10001;
    min-width: 220px;
}

.im-font-panel.show {
    display: block;
}

.im-font-panel-section {
    margin-bottom: 12px;
}

.im-font-panel-section:last-child {
    margin-bottom: 0;
}

.im-font-panel-title {
    font-size: 12px;
    color: #999;
    margin-bottom: 8px;
    text-align: left;
}

.im-font-size-options {
    display: flex;
    gap: 6px;
}

.im-font-size-btn {
    padding: 6px 12px;
    background: #2a2a2a;
    border: 1px solid #333;
    border-radius: 6px;
    color: #ccc;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
}

.im-font-size-btn:hover {
    background: #333;
    border-color: #555;
}

.im-font-size-btn.active {
    background: rgba(255,68,68,0.2);
    border-color: #ff4444;
    color: #ff4444;
}

.im-font-color-options {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
}

.im-font-color-btn {
    width: 28px;
    height: 28px;
    border: 2px solid transparent;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    padding: 0;
}

.im-font-color-btn:hover {
    transform: scale(1.1);
}

.im-font-color-btn.active {
    border-color: #fff;
    box-shadow: 0 0 8px rgba(255,255,255,0.5);
}

/* ===== 聊天记录弹窗 ===== */
.im-history-modal-content {
    display: flex;
    flex-direction: column;
    height: 500px;
    gap: 12px;
}

.im-history-search {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

.im-history-search .im-form-input {
    flex: 1;
}

.im-history-search-btn {
    padding: 0 16px;
    background: linear-gradient(135deg, #2a2a2a, #1f1f1f);
    border: 1px solid #333;
    border-radius: 8px;
    color: #ccc;
    cursor: pointer;
    transition: all 0.25s;
}

.im-history-search-btn:hover {
    background: linear-gradient(135deg, #333, #2a2a2a);
    border-color: #ff4444;
    color: #ff4444;
    box-shadow: 0 0 8px rgba(255, 68, 68, 0.2);
}

.im-history-list {
    flex: 1;
    overflow-y: auto;
    padding: 10px;
    background: linear-gradient(180deg, #121212 0%, #0e0e0e 100%);
    border: 1px solid #2a2a2a;
    border-radius: 8px;
    scrollbar-width: thin;
    scrollbar-color: #cc2222 rgba(0,0,0,0.3);
}

.im-history-item {
    display: flex;
    gap: 12px;
    padding: 12px;
    margin-bottom: 6px;
    background: linear-gradient(135deg, rgba(255, 68, 68, 0.03) 0%, rgba(255, 68, 68, 0.01) 100%);
    border: 1px solid rgba(255, 68, 68, 0.08);
    border-radius: 10px;
    transition: all 0.2s;
}

.im-history-item:hover {
    background: linear-gradient(135deg, rgba(255, 68, 68, 0.08) 0%, rgba(255, 68, 68, 0.03) 100%);
    border-color: rgba(255, 68, 68, 0.25);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.im-history-date {
    font-size: 11px;
    color: #888;
    margin-bottom: 6px;
    font-weight: 500;
}

.im-history-avatar {
    flex-shrink: 0;
}

.im-history-avatar img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px solid rgba(255, 68, 68, 0.3);
    box-shadow: 0 0 8px rgba(0, 0, 0, 0.4);
    object-fit: cover;
}

.im-history-content {
    flex: 1;
    min-width: 0;
}

.im-history-sender {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
}

.im-history-name {
    font-size: 13px;
    color: #ff6b6b;
    font-weight: 600;
    letter-spacing: 0.3px;
}

.im-history-time {
    font-size: 11px;
    color: #777;
    font-family: 'Consolas', 'Monaco', monospace;
}

.im-history-msg {
    font-size: 13px;
    color: #e0e0e0;
    line-height: 1.6;
    word-break: break-word;
    background: rgba(0, 0, 0, 0.25);
    padding: 8px 12px;
    border-radius: 6px;
    border-left: 2px solid rgba(255, 68, 68, 0.3);
}

.im-history-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
    padding: 0 8px;
}

.im-history-page {
    font-size: 12px;
    color: #999;
}

/* ===== 好友申请按钮样式 ===== */
.im-btn-success {
    background: linear-gradient(135deg, #2ecc71, #27ae60);
    color: #fff;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
}

.im-btn-success:hover {
    background: linear-gradient(135deg, #36d77f, #2dbb62);
    box-shadow: 0 0 12px rgba(46, 204, 113, 0.4);
}

.im-btn-sm {
    padding: 5px 12px !important;
    font-size: 12px !important;
    border-radius: 5px !important;
    flex: none !important;
}

/* ===== TAB选项卡样式 ===== */
.im-tab-bar {
    display: flex;
    gap: 0;
    margin-bottom: 14px;
    border-bottom: 2px solid rgba(255, 255, 255, 0.06);
}

.im-tab-btn {
    flex: 1;
    padding: 10px 14px;
    background: transparent;
    border: none;
    color: #888;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    position: relative;
}

.im-tab-btn:hover {
    color: #ccc;
    background: rgba(255, 255, 255, 0.03);
}

.im-tab-btn.active {
    color: #ff6464;
    border-bottom-color: #ff4444;
    font-weight: 500;
}

.im-tab-badge {
    display: inline-block;
    min-width: 16px;
    height: 16px;
    line-height: 16px;
    padding: 0 4px;
    background: #ff4444;
    color: #fff;
    font-size: 10px;
    border-radius: 8px;
    text-align: center;
    margin-left: 2px;
}

.im-tab-content {
    min-height: 200px;
}

/* ===== 好友申请列表样式 ===== */
.im-req-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 400px;
    overflow-y: auto;
}

.im-req-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 8px;
    transition: all 0.2s;
}

.im-req-item:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(192, 57, 43, 0.2);
}

.im-req-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
    background: #333;
}

.im-req-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.im-req-info {
    flex: 1;
    min-width: 0;
}

.im-req-name {
    font-size: 14px;
    color: #e0e0e0;
    font-weight: 500;
    margin-bottom: 2px;
}

.im-req-msg {
    font-size: 12px;
    color: #999;
    margin-bottom: 2px;
    word-break: break-word;
}

.im-req-time {
    font-size: 11px;
    color: #666;
}

.im-req-actions {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
}

.im-req-status {
    font-size: 12px;
    padding: 4px 10px;
    border-radius: 4px;
    white-space: nowrap;
}

.im-req-status.accepted {
    color: #2ecc71;
    background: rgba(46, 204, 113, 0.1);
}

.im-req-status.rejected {
    color: #777;
    background: rgba(149, 165, 166, 0.1);
}

.im-history-name {
    font-size: 13px;
    color: #4488ff;
    font-weight: 500;
}

.im-history-time {
    font-size: 11px;
    color: #666;
}

.im-history-msg {
    font-size: 13px;
    color: #ddd;
    line-height: 1.5;
    word-break: break-word;
}

.im-history-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
    padding: 0 8px;
}

.im-history-page {
    font-size: 12px;
    color: #999;
}