* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', 'Microsoft YaHei', sans-serif;
}

body {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    color: #f0f0f0;
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    height: 95vh;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 20px;
    overflow: hidden;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.header {
    background: linear-gradient(90deg, #0f3460, #533483);
    padding: 20px 30px;
    text-align: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.header h1 {
    font-size: 2.2rem;
    margin-bottom: 5px;
    color: #fff;
}

.header h1 i {
    margin-right: 10px;
    color: #4cc9f0;
}

#user-status {
    font-size: 0.9rem;
    color: #aaa;
}

.chat-container {
    display: flex;
    flex: 1;
    overflow: hidden;
}

.sidebar {
    width: 250px;
    background: rgba(0, 0, 0, 0.2);
    padding: 20px;
    border-right: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    flex-direction: column;
}

.user-setup {
    margin-bottom: 25px;
    padding-bottom: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.user-setup input {
    width: 100%;
    padding: 12px 15px;
    margin-bottom: 10px;
    border: none;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    font-size: 1rem;
}

.user-setup input:focus {
    outline: 2px solid #4cc9f0;
    background: rgba(255, 255, 255, 0.15);
}

.user-setup button {
    width: 100%;
    padding: 12px;
    background: linear-gradient(90deg, #4cc9f0, #4361ee);
    color: white;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-weight: 600;
    font-size: 1rem;
    transition: all 0.3s;
}

.user-setup button:hover {
    background: linear-gradient(90deg, #4361ee, #3a0ca3);
    transform: translateY(-2px);
}

.user-setup button:active {
    transform: translateY(0);
}

.online-users h3 {
    font-size: 1.2rem;
    margin-bottom: 15px;
    color: #4cc9f0;
    display: flex;
    align-items: center;
}

.online-users h3 i {
    margin-right: 8px;
}

#users-list {
    list-style: none;
    max-height: 300px;
    overflow-y: auto;
}

#users-list li {
    padding: 10px 15px;
    margin-bottom: 8px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    display: flex;
    align-items: center;
    transition: all 0.2s;
}

#users-list li:hover {
    background: rgba(255, 255, 255, 0.1);
}

#users-list li i {
    margin-right: 10px;
    color: #4cc9f0;
}

.main-chat {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 20px;
}

.messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background: rgba(0, 0, 0, 0.1);
    border-radius: 15px;
    margin-bottom: 20px;
    display: flex;
    flex-direction: column;
}

.message {
    margin-bottom: 15px;
    padding: 12px 18px;
    border-radius: 15px;
    max-width: 70%;
    word-wrap: break-word;
    animation: fadeIn 0.3s;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.message.sent {
    align-self: flex-end;
    background: linear-gradient(135deg, #4361ee, #3a0ca3);
    border-bottom-right-radius: 5px;
}

.message.received {
    align-self: flex-start;
    background: rgba(255, 255, 255, 0.1);
    border-bottom-left-radius: 5px;
}

.message-header {
    font-weight: 600;
    margin-bottom: 5px;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
}

.message-header i {
    margin-right: 8px;
}

.message.sent .message-header {
    color: #a5d8ff;
}

.message.received .message-header {
    color: #4cc9f0;
}

.message-content {
    font-size: 1rem;
    line-height: 1.4;
}

.message-time {
    font-size: 0.7rem;
    opacity: 0.7;
    text-align: right;
    margin-top: 5px;
}

.system-message {
    text-align: center;
    padding: 10px;
    background: rgba(76, 201, 240, 0.1);
    border-radius: 10px;
    margin-bottom: 20px;
    color: #a5d8ff;
    font-size: 0.9rem;
}

.system-message i {
    margin-right: 8px;
}

.message-input {
    display: flex;
    gap: 10px;
}

.message-input input {
    flex: 1;
    padding: 15px 20px;
    border: none;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    font-size: 1rem;
}

.message-input input:focus {
    outline: 2px solid #4cc9f0;
    background: rgba(255, 255, 255, 0.15);
}

.message-input input:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.message-input button {
    padding: 0 30px;
    background: linear-gradient(90deg, #4361ee, #3a0ca3);
    color: white;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    font-weight: 600;
    font-size: 1rem;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.message-input button:hover:not(:disabled) {
    background: linear-gradient(90deg, #3a0ca3, #7209b7);
    transform: translateY(-2px);
}

.message-input button:active:not(:disabled) {
    transform: translateY(0);
}

.message-input button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.message-input button i {
    margin-right: 8px;
}

.footer {
    padding: 15px;
    text-align: center;
    background: rgba(0, 0, 0, 0.3);
    color: #888;
    font-size: 0.9rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

/* 滚动条样式 */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: rgba(76, 201, 240, 0.5);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(76, 201, 240, 0.7);
}

/* 响应式设计 */
@media (max-width: 768px) {
    .sidebar {
        width: 200px;
        padding: 15px;
    }
    
    .header h1 {
        font-size: 1.8rem;
    }
    
    .message {
        max-width: 85%;
    }
}

@media (max-width: 576px) {
    .chat-container {
        flex-direction: column;
    }
    
    .sidebar {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    }
    
    .container {
        height: auto;
        min-height: 100vh;
    }
}

