.ac-game-chatroom {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1000;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
}

.ac-game-chatroom-container {
    display: grid;
    grid-template-rows: 60px 1fr 65px;
    grid-template-columns: 280px 1fr;
    width: 90%;
    max-width: 1000px;
    height: 85%;
    background: #ededed;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

/* 头部标题栏 */
.ac-game-chatroom-header {
    grid-column: 1 / -1;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
    background: #f7f7f7;
    border-bottom: 1px solid #d6d6d6;
}

.ac-game-chatroom-header h2 {
    margin: 0;
    color: #333;
    font-size: 18px;
    font-weight: normal;
}

.ac-game-chatroom-close {
    padding: 5px 10px;
    background: transparent;
    border: none;
    color: #999;
    font-size: 24px;
    cursor: pointer;
    transition: all 0.2s;
}

.ac-game-chatroom-close:hover {
    color: #333;
}

/* 左侧在线用户列表 */
.ac-game-chatroom-online-users {
    grid-row: 2 / 4;
    background: #fafafa;
    border-right: 1px solid #d6d6d6;
    overflow-y: auto;
}

.ac-game-chatroom-online-users h3 {
    margin: 0;
    padding: 15px 20px 10px;
    color: #999;
    font-size: 13px;
    font-weight: normal;
    border-bottom: 1px solid #e7e7e7;
}

.ac-game-chatroom-users-list {
    padding: 10px 0;
}

.ac-game-chatroom-user {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 20px;
    cursor: pointer;
    transition: all 0.2s;
}

.ac-game-chatroom-user:hover {
    background: #e9e9e9;
}

.ac-game-chatroom-user img {
    width: 40px;
    height: 40px;
    border-radius: 4px;
    object-fit: cover;
}

.ac-game-chatroom-user span {
    color: #333;
    font-size: 14px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* 消息显示区域 */
.ac-game-chatroom-messages {
    display: flex;
    flex-direction: column;
    gap: 15px;
    padding: 20px;
    background: #f5f5f5;
    overflow-y: auto;
}

/* 消息容器 */
.ac-game-chatroom-message {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    max-width: 70%;
    animation: slideIn 0.3s ease;
}

.ac-game-chatroom-message.message-self {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.ac-game-chatroom-message.message-other {
    align-self: flex-start;
}

.ac-game-chatroom-message.system-message {
    align-self: center;
    max-width: none;
    margin: 5px 0;
}

/* 消息气泡 */
.message-bubble {
    position: relative;
    padding: 10px 15px;
    max-width: 100%;
    border-radius: 10px;
    word-wrap: break-word;
}

.message-self .message-bubble {
    background: #95ec69;
    border-top-right-radius: 4px;
}

.message-other .message-bubble {
    background: white;
    border-top-left-radius: 4px;
}

.message-self .message-bubble::after {
    content: '';
    position: absolute;
    top: 10px;
    right: -8px;
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 8px 0 8px 8px;
    border-color: transparent transparent transparent #95ec69;
}

.message-other .message-bubble::after {
    content: '';
    position: absolute;
    top: 10px;
    left: -8px;
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 8px 8px 8px 0;
    border-color: transparent white transparent transparent;
}

.system-message .message-bubble {
    padding: 5px 12px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 15px;
    color: white;
    font-size: 12px;
}

/* 用户名和消息内容 */
.message-info {
    display: flex;
    flex-direction: column;
    gap: 5px;
    max-width: 400px;
}

.message-username {
    margin-bottom: 2px;
    color: #999;
    font-size: 12px;
}

.message-self .message-username {
    text-align: right;
}

.message-content {
    margin: 0;
    color: #333;
    font-size: 14px;
    line-height: 1.5;
}

/* 头像样式 */
.message-avatar {
    position: relative;
    flex-shrink: 0;
    width: 35px;
    height: 35px;
    border-radius: 4px;
    object-fit: cover;
    cursor: pointer;
}

.message-avatar:hover::after {
    content: attr(title);
    position: absolute;
    bottom: -20px;
    left: 50%;
    z-index: 10;
    transform: translateX(-50%);
    padding: 2px 8px;
    background: rgba(0, 0, 0, 0.8);
    border-radius: 4px;
    color: white;
    font-size: 12px;
    white-space: nowrap;
}

/* 输入区域 */
.ac-game-chatroom-input-area {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 15px 20px;
    background: #f7f7f7;
    border-top: 1px solid #d6d6d6;
}

.ac-game-chatroom-input {
    flex: 1;
    padding: 10px 15px;
    background: white;
    border: 1px solid #d6d6d6;
    border-radius: 5px;
    font-size: 14px;
    outline: none;
    transition: all 0.2s;
}

.ac-game-chatroom-input:focus {
    border-color: #4caf50;
}

.ac-game-chatroom-send {
    padding: 10px 25px;
    background: #07c160;
    border: none;
    border-radius: 5px;
    color: white;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
}

.ac-game-chatroom-send:hover:not(:disabled) {
    background: #06a652;
}

.ac-game-chatroom-send:disabled {
    background: #ccc;
    cursor: not-allowed;
}

/* 动画效果 */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 滚动条样式 */
.ac-game-chatroom-messages::-webkit-scrollbar,
.ac-game-chatroom-users-list::-webkit-scrollbar {
    width: 6px;
}

.ac-game-chatroom-messages::-webkit-scrollbar-track,
.ac-game-chatroom-users-list::-webkit-scrollbar-track {
    background: transparent;
}

.ac-game-chatroom-messages::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 3px;
}

.ac-game-chatroom-users-list::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 3px;
}

.ac-game-chatroom-messages::-webkit-scrollbar-thumb:hover,
.ac-game-chatroom-users-list::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.3);
}