.wp-chatroom-container {
    display: flex;
    max-width: 1200px;
    margin: 20px auto;
    border: 1px solid #ddd;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.chatroom-sidebar {
    width: 300px;
    background-color: #f8f9fa;
    border-right: 1px solid #ddd;
    display: flex;
    flex-direction: column;
}

.chatroom-groups {
    padding: 15px;
}

.chatroom-groups h3 {
    margin-top: 0;
    padding-bottom: 10px;
    border-bottom: 1px solid #ddd;
}

.create-group-btn {
    width: 100%;
    padding: 10px;
    background-color: #007cba;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    margin-bottom: 15px;
    transition: background-color 0.3s;
}

.create-group-btn:hover {
    background-color: #006ba1;
}

.groups-list {
    max-height: calc(100vh - 150px);
    overflow-y: auto;
}

.chat-group {
    padding: 10px;
    border-radius: 4px;
    margin-bottom: 10px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.chat-group:hover, .chat-group.active {
    background-color: #e9ecef;
}

.chat-group h4 {
    margin: 0 0 5px 0;
    font-size: 16px;
}

.chat-group p {
    margin: 0;
    font-size: 13px;
    color: #666;
}

.chatroom-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    height: 80vh;
}

.chatroom-header {
    padding: 15px;
    background-color: #f8f9fa;
    border-bottom: 1px solid #ddd;
}

.current-group-name {
    margin: 0;
    font-size: 18px;
}

.chatroom-messages {
    flex: 1;
    padding: 15px;
    overflow-y: auto;
    background-color: #fff;
}

.chat-message {
    margin-bottom: 15px;
    display: flex;
    max-width: 80%;
}

.own-message {
    margin-left: auto;
    flex-direction: row-reverse;
}

.message-avatar img {
    border-radius: 50%;
    width: 40px;
    height: 40px;
}

.message-content {
    margin: 0 10px;
    flex: 1;
}

.own-message .message-content {
    text-align: right;
}

.message-header {
    margin-bottom: 5px;
}

.message-author {
    font-weight: bold;
    margin-right: 10px;
}

.message-time {
    font-size: 12px;
    color: #666;
}

.message-text {
    padding: 8px 12px;
    border-radius: 18px;
    background-color: #f1f1f1;
    display: inline-block;
}

.own-message .message-text {
    background-color: #007cba;
    color: white;
}

.chatroom-input-area {
    padding: 15px;
    border-top: 1px solid #ddd;
    background-color: #f8f9fa;
}

.message-tools {
    margin-bottom: 10px;
}

/* 隐藏emoji按钮 */
.emoji-btn {
    display: none !important;
}

/* 附件上传按钮样式 */
.file-upload-btn {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer !important;
    margin-right: 15px;
    user-select: none;
    transition: transform 0.1s;
}

.file-upload-btn:hover {
    transform: scale(1.1);
}

.file-upload-btn:active {
    transform: scale(0.95);
}

/* 修复文件输入框样式（防止意外交互） */
.file-upload {
    display: none !important;
    position: absolute;
    z-index: -1;
}

/* 上传中状态样式 */
.file-upload-btn[style*="opacity: 0.5"] {
    cursor: wait !important;
    transform: none !important;
}

.message-input {
    width: calc(100% - 80px);
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: 20px;
    resize: none;
    height: 40px;
    vertical-align: middle;
}

.send-message-btn {
    width: 60px;
    height: 40px;
    border: none;
    border-radius: 20px;
    background-color: #007cba;
    color: white;
    cursor: pointer;
    vertical-align: middle;
    transition: background-color 0.3s;
}

.send-message-btn:hover {
    background-color: #006ba1;
}

/* 模态框样式 */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.4);
}

.modal-content {
    background-color: #fefefe;
    margin: 15% auto;
    padding: 20px;
    border: 1px solid #888;
    width: 80%;
    max-width: 500px;
    border-radius: 8px;
}

.close-modal {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.close-modal:hover {
    color: black;
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
}

.form-group input, .form-group textarea {
    width: 100%;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.submit-group {
    background-color: #007cba;
    color: white;
    border: none;
    padding: 10px 15px;
    border-radius: 4px;
    cursor: pointer;
}

/* 附件样式 */
.message-attachment {
    margin-top: 8px;
}

.attachment-image {
    max-width: 300px;
    max-height: 200px;
    border-radius: 8px;
}

.attachment-audio, .attachment-document, .attachment-pdf {
    display: inline-flex;
    align-items: center;
    padding: 8px 12px;
    background-color: #f1f1f1;
    border-radius: 8px;
    margin-top: 5px;
}

.own-message .attachment-audio, 
.own-message .attachment-document, 
.own-message .attachment-pdf {
    background-color: #e6f2ff;
}

.attachment-icon {
    margin-right: 10px;
    font-size: 20px;
}

.attachment-name {
    margin-left: 10px;
    font-size: 14px;
}

.attachment-video {
    max-width: 400px;
    max-height: 300px;
    border-radius: 8px;
    margin-top: 5px;
}

/* URL卡片样式 */
.url-card {
    border: 1px solid #ddd;
    border-radius: 8px;
    overflow: hidden;
    margin-top: 8px;
    display: inline-block;
    max-width: 400px;
}

.url-card a {
    text-decoration: none;
    color: inherit;
    display: flex;
}

.url-card img {
    width: 100px;
    height: 100px;
    object-fit: cover;
}

.url-info {
    padding: 10px;
    flex: 1;
}

.url-info h4 {
    margin: 0 0 5px 0;
    font-size: 16px;
}

.url-info p {
    margin: 0 0 5px 0;
    font-size: 14px;
    color: #666;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.url-info span {
    font-size: 12px;
    color: #999;
}

/* 上传状态提示样式 */
.temp-uploading {
    text-align: center;
    color: #666;
    font-style: italic;
    margin: 10px 0;
    padding: 8px;
    background-color: #f8f9fa;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.temp-uploading:hover {
    background-color: #e9ecef;
}

/* 错误提示样式 */
.error {
    text-align: center;
    color: #dc3232;
    padding: 10px;
    margin: 10px 0;
    background-color: #fff5f5;
    border-radius: 4px;
    border: 1px solid #ffe3e3;
}

.no-group-selected, .no-messages, .no-groups {
    text-align: center;
    color: #666;
    padding: 20px;
}

.loading {
    text-align: center;
    color: #666;
    padding: 20px;
}