/* ==================== 全站聊天室 ==================== */

/* 头部 */
.jinsom-module-widget-world-chat .ls-widget-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.jinsom-module-widget-world-chat .ls-widget-header h3 {
    display: flex;
    align-items: center;
    gap: 6px;
}
.jinsom-module-widget-world-chat .ls-widget-header h3 i {
    color: var(--ls-color-primary, #6366f1);
}
.jinsom-module-widget-world-chat-status {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 12px;
    color: var(--ls-text-3, #999);
    background: var(--ls-bg-2, #f5f5f5);
    padding: 3px 10px 3px 8px;
    border-radius: 20px;
}
.jinsom-module-widget-world-chat-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #22c55e;
    box-shadow: 0 0 0 2px rgba(34, 197, 94, 0.2);
    animation: jinsom-module-widget-world-chat-pulse 2s ease-in-out infinite;
}
@keyframes jinsom-module-widget-world-chat-pulse {
    0%, 100% { box-shadow: 0 0 0 2px rgba(34, 197, 94, 0.2); }
    50% { box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.1); }
}

/* 消息区域 */
.jinsom-module-widget-world-chat-body {
    overflow-y: auto;
    overflow-x: hidden;
    overscroll-behavior: contain;
}
.jinsom-module-widget-world-chat-body::-webkit-scrollbar {
    width: 4px;
}
.jinsom-module-widget-world-chat-body::-webkit-scrollbar-track {
    background: transparent;
}
.jinsom-module-widget-world-chat-body::-webkit-scrollbar-thumb {
    background: transparent;
    border-radius: 4px;
    transition: background 0.2s;
}
.jinsom-module-widget-world-chat-body:hover::-webkit-scrollbar-thumb {
    background: var(--ls-border-light, rgba(0,0,0,0.08));
}
.jinsom-module-widget-world-chat-messages {
    display: flex;
    flex-direction: column;
    gap: 1px;
    padding: 8px 6px;
    min-height: 100%;
}

/* 单条消息 */
.jinsom-module-widget-world-chat-msg {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 10px 8px;
    transition: background 0.15s;
}
.jinsom-module-widget-world-chat-msg.is-new {
    animation: jinsom-module-widget-world-chat-fadein 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
.jinsom-module-widget-world-chat-msg:hover {
    background: var(--ls-bg-2, rgba(0,0,0,0.025));
}
@keyframes jinsom-module-widget-world-chat-fadein {
    from { opacity: 0; transform: translateY(8px) scale(0.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

/* 头像容器（含认证角标） */
.jinsom-module-widget-world-chat-avatar-wrap {
    position: relative;
    flex-shrink: 0;
    width: 32px;
    height: 32px;
}
.jinsom-module-widget-world-chat-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    cursor: pointer;
    transition: transform 0.15s;
}
.jinsom-module-widget-world-chat-avatar:hover {
    transform: scale(1.08);
}
/* 认证角标定位到头像右下角 */
.jinsom-module-widget-world-chat-avatar-wrap .ls-avatar-verify {
    position: absolute;
    right: -2px;
    bottom: -2px;
    line-height: 1;
}

/* 消息内容 */
.jinsom-module-widget-world-chat-content {
    flex: 1;
    min-width: 0;
}

/* meta 行：昵称 + 标记 + 时间靠右 */
.jinsom-module-widget-world-chat-meta {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-bottom: 2px;
    line-height: 1;
}
.jinsom-module-widget-world-chat-name {
    font-size: 12px;
    font-weight: 600;
    color: var(--ls-text-2, #555);
    cursor: pointer;
    max-width: 90px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex-shrink: 0;
    transition: color 0.15s;
}
.jinsom-module-widget-world-chat-name:hover {
    color: var(--ls-color-primary, #6366f1);
}

/* 标记区域（等级 + VIP） */
.jinsom-module-widget-world-chat-badges {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    flex-shrink: 0;
    line-height: 1;
    vertical-align: middle;
}
.jinsom-module-widget-world-chat-badges img {
    height: 14px;
    vertical-align: middle;
}

/* 时间靠右 */
.jinsom-module-widget-world-chat-time {
    font-size: 10px;
    color: var(--ls-text-4, #ccc);
    flex-shrink: 0;
    margin-left: auto;
    white-space: nowrap;
}

/* 消息文本 */
.jinsom-module-widget-world-chat-text {
    font-size: 13px;
    line-height: 1.6;
    color: var(--ls-text-1, #333);
    word-break: break-word;
}
.jinsom-module-widget-world-chat-text img.jinsom-emoji,
.jinsom-module-widget-world-chat-text img.emotion-type-img {
    width: 20px;
    height: 20px;
    vertical-align: text-bottom;
    margin: 0 1px;
}

/* 自己的消息 */
.jinsom-module-widget-world-chat-msg.is-self .jinsom-module-widget-world-chat-name {
    color: var(--ls-color-primary, #6366f1);
}

/* 系统消息 */
.jinsom-module-widget-world-chat-system {
    text-align: center;
    padding: 6px 0;
    font-size: 11px;
    color: var(--ls-text-4, #ccc);
}
.jinsom-module-widget-world-chat-system i {
    margin-right: 3px;
    font-size: 12px;
}

/* 输入区域 */
.jinsom-module-widget-world-chat-footer {
    padding: 8px 12px 10px;
    border-top: 1px solid var(--ls-border-light, rgba(0,0,0,0.05));
}
.jinsom-module-widget-world-chat-input-wrap {
    display: flex;
    flex-direction: column;
    gap: 4px;
    background: var(--ls-bg-2, #f7f7f8);
    border: 1px solid transparent;
    border-radius: 12px;
    padding: 8px 10px 6px;
    transition: all 0.2s;
}
.jinsom-module-widget-world-chat-input-wrap:focus-within {
    background: var(--ls-bg-1, #fff);
    border-color: var(--ls-color-primary-alpha, rgba(99,102,241,0.3));
    box-shadow: 0 0 0 3px rgba(99,102,241,0.08);
}

/* 编辑器 */
.jinsom-module-widget-world-chat-editor {
    min-height: 20px;
    max-height: 60px;
    overflow-y: auto;
    font-size: 13px;
    line-height: 1.5;
    color: var(--ls-text-1, #333);
    outline: none;
    word-break: break-word;
}
.jinsom-module-widget-world-chat-editor:empty::before {
    content: attr(placeholder);
    color: var(--ls-text-4, #bbb);
    pointer-events: none;
}
.jinsom-module-widget-world-chat-editor img.jinsom-emoji,
.jinsom-module-widget-world-chat-editor img.emotion-type-img {
    width: 20px;
    height: 20px;
    vertical-align: text-bottom;
    margin: 0 1px;
}
.jinsom-module-widget-world-chat-editor::-webkit-scrollbar {
    width: 3px;
}
.jinsom-module-widget-world-chat-editor::-webkit-scrollbar-thumb {
    background: rgba(0,0,0,0.08);
    border-radius: 3px;
}

/* 工具栏 */
.jinsom-module-widget-world-chat-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.jinsom-module-widget-world-chat-toolbar-left {
    display: flex;
    align-items: center;
    gap: 4px;
}
.jinsom-module-widget-world-chat-emoji-btn,
.jinsom-module-widget-world-chat-send-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: none;
    cursor: pointer;
    transition: all 0.15s;
    padding: 0;
}
.jinsom-module-widget-world-chat-emoji-btn {
    width: 28px;
    height: 28px;
    font-size: 18px;
    color: var(--ls-text-4, #bbb);
    border-radius: 6px;
}
.jinsom-module-widget-world-chat-emoji-btn:hover {
    color: var(--ls-color-primary, #6366f1);
    background: rgba(99,102,241,0.08);
}
.jinsom-module-widget-world-chat-send-btn {
    width: 28px;
    height: 28px;
    font-size: 14px;
    color: #fff;
    background: var(--ls-color-primary, #6366f1);
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(99,102,241,0.3);
}
.jinsom-module-widget-world-chat-send-btn:hover {
    background: var(--ls-color-primary-dark, #4f46e5);
    box-shadow: 0 2px 6px rgba(99,102,241,0.4);
    transform: translateY(-1px);
}
.jinsom-module-widget-world-chat-send-btn:active {
    transform: translateY(0);
    box-shadow: 0 1px 2px rgba(99,102,241,0.3);
}

/* 字数统计 */
.jinsom-module-widget-world-chat-counter {
    font-size: 11px;
    color: var(--ls-text-4, #ccc);
    font-variant-numeric: tabular-nums;
    user-select: none;
}
.jinsom-module-widget-world-chat-counter.is-warn {
    color: #f59e0b;
}
.jinsom-module-widget-world-chat-counter.is-over {
    color: #ef4444;
    font-weight: 600;
}

/* 未登录提示 */
.jinsom-module-widget-world-chat-login-tip {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 16px;
    font-size: 13px;
    color: var(--ls-text-4, #bbb);
    border-top: 1px solid var(--ls-border-light, rgba(0,0,0,0.05));
}
.jinsom-module-widget-world-chat-login-tip i {
    font-size: 16px;
}

/* 空状态 */
.jinsom-module-widget-world-chat-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 1;
    min-height: 100%;
    gap: 10px;
    color: var(--ls-text-4, #ccc);
    font-size: 13px;
    margin: auto 0;
}
.jinsom-module-widget-world-chat-empty i {
    font-size: 40px;
    opacity: 0.3;
}
