body {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
}
.chatroom-container {
    display: flex;
    height: calc(100vh - 100px);
    gap: 0;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* 左侧聊天室列表 */
.room-list-panel {
    width: 320px;
    background: linear-gradient(180deg, rgba(26, 26, 46, 0.95) 0%, rgba(22, 33, 62, 0.95) 100%);
    border-right: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    flex-direction: column;
}
.room-list-header {
    padding: 20px;
    background: linear-gradient(135deg, #e94560 0%, #ff6b6b 100%);
    color: white;
    font-size: 1.2rem;
    font-weight: 600;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.room-list-header .admin-link {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    padding: 6px 12px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 20px;
    transition: all 0.3s;
}
.room-list-header .admin-link:hover {
    background: rgba(255, 255, 255, 0.25);
    color: white;
}
.room-search {
    padding: 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}
.room-search input {
    width: 100%;
    padding: 12px 15px;
    border: none;
    border-radius: 25px;
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    font-size: 0.9rem;
    outline: none;
    transition: all 0.3s;
}
.room-search input:focus {
    background: rgba(255, 255, 255, 0.12);
    box-shadow: 0 0 0 2px rgba(233, 69, 96, 0.3);
}
.room-search input::placeholder {
    color: rgba(255, 255, 255, 0.4);
}
.room-list {
    flex: 1;
    overflow-y: auto;
    padding: 10px;
}
.room-item {
    padding: 15px;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s;
    margin-bottom: 8px;
    border: 1px solid transparent;
}
.room-item:hover {
    background: rgba(233, 69, 96, 0.15);
    border-color: rgba(233, 69, 96, 0.3);
}
.room-item.active {
    background: linear-gradient(135deg, rgba(233, 69, 96, 0.25) 0%, rgba(255, 107, 107, 0.15) 100%);
    border-color: rgba(233, 69, 96, 0.5);
}
.room-item.not-joined {
    opacity: 0.7;
}
.room-name-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 5px;
}
.room-name {
    font-weight: 600;
    color: #fff;
    font-size: 1rem;
    display: flex;
    align-items: center;
    gap: 8px;
}
.room-name .join-badge {
    font-size: 0.7rem;
    padding: 2px 8px;
    background: linear-gradient(135deg, #00d2d3, #54a0ff);
    border-radius: 10px;
    color: white;
}
.unread-badge {
    min-width: 24px;
    height: 24px;
    border-radius: 12px;
    background: rgba(255, 107, 107, 0.9);
    color: white;
    font-size: 0.75rem;
    font-weight: 600;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 0 6px;
}
.unread-badge.visible {
    display: inline-flex;
}
.room-desc {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.5);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* 右侧聊天区域 */
.chat-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: linear-gradient(180deg, rgba(15, 52, 96, 0.95) 0%, rgba(22, 33, 62, 0.95) 100%);
}
.chat-header {
    padding: 20px 25px;
    background: rgba(0, 0, 0, 0.2);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.chat-room-info h2 {
    color: #fff;
    font-size: 1.3rem;
    margin: 0 0 5px 0;
}
.chat-room-info p {
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.9rem;
    margin: 0;
}
.chat-actions {
    display: flex;
    gap: 10px;
}
.btn-manage-members {
    padding: 10px 16px;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    cursor: pointer;
    transition: all 0.2s ease;
}
.btn-manage-members:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(233, 69, 96, 0.6);
    color: #ffe2e2;
}
.btn-join, .btn-leave {
    padding: 10px 20px;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s;
}
.btn-join {
    background: linear-gradient(135deg, #00d2d3, #54a0ff);
    color: white;
}
.btn-join:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(0, 210, 211, 0.4);
}
.btn-leave {
    background: rgba(255, 107, 107, 0.2);
    color: #ff6b6b;
    border: 1px solid rgba(255, 107, 107, 0.3);
}
.btn-leave:hover {
    background: rgba(255, 107, 107, 0.3);
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 15px;
}
.message {
    max-width: 70%;
    animation: fadeIn 0.3s ease;
    position: relative;
}
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}
.message.own {
    align-self: flex-end;
}
.message.other {
    align-self: flex-start;
}
.message-bubble {
    padding: 12px 18px;
    border-radius: 18px;
    position: relative;
    overflow: visible;
}
.message.own .message-bubble {
    background: linear-gradient(135deg, #e94560, #ff6b6b);
    color: white;
    border-bottom-right-radius: 4px;
}
.message.other .message-bubble {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    border-bottom-left-radius: 4px;
}
.message.recalled .message-bubble {
    background: rgba(255, 255, 255, 0.05);
    color: rgba(255, 255, 255, 0.6);
    font-style: italic;
}
.message-sender {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.5);
    margin-bottom: 5px;
}
.message-sender-info {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}
.message-sender-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(255, 255, 255, 0.15);
    background: rgba(255, 255, 255, 0.05);
}
.message-sender-name {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.75);
    font-weight: 500;
}
.message-content {
    line-height: 1.5;
    word-break: break-word;
}
.message-time {
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.4);
    margin-top: 5px;
    text-align: right;
}
.message.own .message-time {
    color: rgba(255, 255, 255, 0.7);
}
.message-menu {
    position: absolute;
    top: 8px;
    right: 8px;
    z-index: 10;
}
.message-menu-trigger {
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.6);
    cursor: pointer;
    font-size: 1rem;
    padding: 4px;
}
.message-menu-dropdown {
    position: absolute;
    top: 24px;
    right: 0;
    background: rgba(15, 52, 96, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    min-width: 140px;
    display: none;
    flex-direction: column;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4);
    z-index: 20;
}
.message-menu.open .message-menu-dropdown {
    display: flex;
}
.message.other .message-menu-dropdown {
    left: 0;
    right: auto;
}
.message-menu-item {
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.85);
    padding: 10px 15px;
    text-align: left;
    font-size: 0.85rem;
    cursor: pointer;
}
.message-menu-item:hover {
    background: rgba(233, 69, 96, 0.2);
}
.message.recalled .message-menu {
    display: none;
}

.chat-input-area {
    padding: 20px;
    background: rgba(0, 0, 0, 0.2);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    gap: 15px;
    align-items: flex-end;
}
.chat-input-area textarea {
    flex: 1;
    padding: 15px 20px;
    border: none;
    border-radius: 25px;
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    font-size: 1rem;
    resize: none;
    max-height: 120px;
    outline: none;
    font-family: inherit;
    transition: all 0.3s;
}
.chat-input-area textarea:focus {
    background: rgba(255, 255, 255, 0.12);
    box-shadow: 0 0 0 2px rgba(233, 69, 96, 0.3);
}
.chat-input-area textarea::placeholder {
    color: rgba(255, 255, 255, 0.4);
}
.btn-send {
    width: 50px;
    height: 50px;
    border: none;
    border-radius: 50%;
    background: linear-gradient(135deg, #e94560, #ff6b6b);
    color: white;
    cursor: pointer;
    font-size: 1.2rem;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
}
.btn-send:hover {
    transform: scale(1.1);
    box-shadow: 0 5px 20px rgba(233, 69, 96, 0.5);
}
.btn-send:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* 空状态 */
.empty-chat {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: rgba(255, 255, 255, 0.4);
}
.empty-chat-icon {
    font-size: 4rem;
    margin-bottom: 20px;
}
.empty-chat-text {
    font-size: 1.1rem;
}

/* 连接状态 */
.connection-status {
    padding: 8px 15px;
    font-size: 0.8rem;
    text-align: center;
    display: none;
}
.connection-status.connecting {
    background: rgba(255, 193, 7, 0.2);
    color: #ffc107;
    display: block;
}
.connection-status.connected {
    background: rgba(40, 167, 69, 0.2);
    color: #28a745;
    display: block;
}
.connection-status.disconnected {
    background: rgba(220, 53, 69, 0.2);
    color: #dc3545;
    display: block;
}
.chat-alert-bar {
    padding: 10px 20px;
    font-size: 0.85rem;
    display: none;
    background: rgba(255, 193, 7, 0.15);
    color: #ffc107;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}
.chat-alert-bar.error {
    background: rgba(220, 53, 69, 0.2);
    color: #ffb3b8;
}
.chat-alert-bar.info {
    background: rgba(0, 210, 211, 0.15);
    color: #00d2d3;
}

/* 成员管理模态框 */
.member-modal-mask {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1200;
    backdrop-filter: blur(4px);
}
.member-modal {
    background: linear-gradient(180deg, rgba(17, 24, 39, 0.98) 0%, rgba(15, 23, 42, 0.96) 100%);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 14px;
    width: 520px;
    max-width: 90vw;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.45);
    color: #fff;
}
.member-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.member-modal-header h3 {
    margin: 0;
    font-size: 1.1rem;
}
.member-modal-close {
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.8);
    font-size: 1.2rem;
    cursor: pointer;
}
.member-modal-body {
    padding: 12px 20px 18px 20px;
}
.member-hint {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 10px;
}
.member-list {
    max-height: 360px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.member-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
}
.member-info {
    display: flex;
    align-items: center;
    gap: 10px;
}
.member-avatar-wrap {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.06);
    background: rgba(255, 255, 255, 0.02);
    display: flex;
    align-items: center;
    justify-content: center;
}
.member-avatar {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    object-fit: cover;
}
.member-text {
    display: flex;
    flex-direction: column;
}
.member-name {
    font-weight: 600;
}
.member-role-tag {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.7);
}
.member-role-tag.owner {
    color: #ffb347;
}
.member-role-tag.moderator {
    color: #3dd598;
}
.member-role-tag.member {
    color: rgba(255, 255, 255, 0.55);
}
.member-toggle {
    display: flex;
    align-items: center;
    gap: 6px;
    color: rgba(255, 255, 255, 0.85);
    font-weight: 600;
}
.member-toggle input[type="checkbox"] {
    width: 18px;
    height: 18px;
}
.member-toggle.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}
.member-empty {
    text-align: center;
    padding: 30px 0;
    color: rgba(255, 255, 255, 0.5);
}
.member-loading {
    margin-top: 12px;
    display: flex;
    align-items: center;
    gap: 10px;
    color: rgba(255, 255, 255, 0.8);
}

/* 导航栏调整 */
.navbar {
    background: rgba(26, 26, 46, 0.95);
    backdrop-filter: blur(10px);
}
.navbar-brand {
    color: #e94560 !important;
}
.navbar-nav a {
    color: rgba(255, 255, 255, 0.8) !important;
}
.navbar-nav a:hover {
    color: #e94560 !important;
}

/* 滚动条样式 */
.room-list::-webkit-scrollbar,
.chat-messages::-webkit-scrollbar {
    width: 6px;
}
.room-list::-webkit-scrollbar-track,
.chat-messages::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
}
.room-list::-webkit-scrollbar-thumb,
.chat-messages::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
}
.room-list::-webkit-scrollbar-thumb:hover,
.chat-messages::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* 响应式 */
@media (max-width: 768px) {
    .chatroom-container {
        flex-direction: column;
        height: calc(100vh - 80px);
    }
    .room-list-panel {
        width: 100%;
        height: 200px;
    }
    .message {
        max-width: 85%;
    }
}
