html, body {
    margin: 0;
    padding: 0;
    height: 100%;
    overflow: hidden;
}
.message-input {
    white-space: pre-wrap; /* 允许换行 */
    overflow-wrap: break-word; /* 处理长单词的换行 */
    height: auto; /* 根据内容自适应高度 */
    max-height: calc(3 * 1.5em); /* 限制最大高度为3行 */
    resize: none; /* 禁止用户手动调整大小（可选） */
    overflow-y: auto; /* 添加滚动条 */
}
.message {
    padding: 8px 12px;
    margin-bottom: 8px;
    border-radius: 8px;
    max-width: 80%;
    white-space: pre-wrap; /* 允许换行 */
    word-wrap: break-word; /* 处理长单词的换行 */
}

.message.system {
    background-color: #f3f4f6;
    color: #6b7280;
    text-align: center;
    font-style: italic;
    margin-left: auto;
    margin-right: auto;
}

.message.self {
    background-color: #6b98e0;
    color: white;
    margin-left: auto;
}

.message.other {
    background-color: #e5e7eb;
    color: #1f2937;
    margin-right: auto;
}

.timestamp {
    font-size: 0.75rem;
    color: #6b7280;
    margin-top: 2px;
}

#chat-messages {
    padding: 1rem;
    background-color: #f9fafb;
    border-radius: 0.5rem;
    height: calc(100% - 60px);
    min-height: 0;
}

#user-list {
    min-height: 0;
}

.user-item {
    padding: 0.5rem;
    border-radius: 0.375rem;
    background-color: #f3f4f6;
    margin-bottom: 0.5rem;
}

.user-item.self {
    cursor: context-menu;
    position: relative;
}

#context-menu {
    position: fixed;
    z-index: 1000;
    background: white;
    border: 1px solid #e5e7eb;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    border-radius: 0.5rem;
}

/* 模态框动画 */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

#ai-modal {
    animation: fadeIn 0.2s ease-out;
}

#ai-modal > div {
    animation: slideIn 0.2s ease-out;
}

#ai-modal textarea {
    resize: none;
    transition: all 0.2s;
}

#ai-modal textarea:focus {
    border-color: #8b5cf6;
}

/* 禁止背景滚动 */
body.modal-open {
    overflow: hidden;
}
