* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    color: #f1f1f1;
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
}

/* 认证界面样式 */
.auth-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 90vh;
}

.auth-box {
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    padding: 40px;
    width: 100%;
    max-width: 450px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.auth-box h1 {
    text-align: center;
    margin-bottom: 10px;
    color: #6ee7b7;
    font-size: 2.2rem;
}

.subtitle {
    text-align: center;
    margin-bottom: 30px;
    color: #cbd5e1;
    font-size: 0.9rem;
}

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

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: #cbd5e1;
    font-weight: 500;
}

.form-group input {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    color: #f1f1f1;
    font-size: 1rem;
    transition: all 0.3s;
}

.form-group input:focus {
    outline: none;
    border-color: #6ee7b7;
    box-shadow: 0 0 0 2px rgba(110, 231, 183, 0.2);
}

.btn {
    display: block;
    width: 100%;
    padding: 12px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-primary {
    background: linear-gradient(135deg, #6ee7b7 0%, #3b82f6 100%);
    color: #1e293b;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(59, 130, 246, 0.4);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: #f1f1f1;
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.15);
}

.auth-switch {
    text-align: center;
    margin-top: 20px;
    color: #94a3b8;
}

.auth-switch a {
    color: #6ee7b7;
    text-decoration: none;
    font-weight: 600;
}

.auth-switch a:hover {
    text-decoration: underline;
}

.auth-notice {
    margin-top: 30px;
    padding: 15px;
    background: rgba(59, 130, 246, 0.1);
    border-radius: 8px;
    border-left: 4px solid #3b82f6;
    font-size: 0.85rem;
    color: #cbd5e1;
}

.auth-notice i {
    margin-right: 8px;
    color: #6ee7b7;
}

/* 聊天界面样式 */
.chat-container {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    overflow: hidden;
    height: calc(100vh - 40px);
    display: flex;
    flex-direction: column;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.chat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 30px;
    background: rgba(0, 0, 0, 0.2);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.header-left h2 {
    color: #6ee7b7;
    margin-bottom: 5px;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 15px;
    color: #94a3b8;
    font-size: 0.9rem;
}

.online-count {
    background: rgba(59, 130, 246, 0.2);
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.8rem;
}

#logout-btn {
    width: auto;
    padding: 8px 20px;
}

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

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

.panel-header {
    padding: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.panel-header h3 {
    font-size: 1.1rem;
    color: #cbd5e1;
}

.users-list {
    flex: 1;
    overflow-y: auto;
    padding: 15px;
    list-style: none;
}

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

.user-item:hover {
    background: rgba(255, 255, 255, 0.1);
}

.user-item.active {
    background: rgba(59, 130, 246, 0.2);
    border-left: 3px solid #3b82f6;
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, #6ee7b7 0%, #3b82f6 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 12px;
    font-weight: bold;
    color: #1e293b;
}

.user-name {
    flex: 1;
    font-weight: 500;
}

.chat-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.messages-container {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
}

.messages {
    display: flex;
    flex-direction: column;
}

.message {
    margin-bottom: 20px;
    max-width: 75%;
    animation: fadeIn 0.3s ease;
}

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

.message.sent {
    align-self: flex-end;
}

.message.received {
    align-self: flex-start;
}

.message-header {
    display: flex;
    align-items: center;
    margin-bottom: 5px;
}

.message-sender {
    font-weight: 600;
    color: #6ee7b7;
    margin-right: 10px;
}

.message-time {
    font-size: 0.8rem;
    color: #94a3b8;
}

.message-content {
    padding: 12px 16px;
    border-radius: 12px;
    position: relative;
    word-break: break-word;
    line-height: 1.4;
}

.message.sent .message-content {
    background: linear-gradient(135deg, #6ee7b7 0%, #3b82f6 100%);
    color: #1e293b;
    border-top-right-radius: 4px;
}

.message.received .message-content {
    background: rgba(255, 255, 255, 0.1);
    color: #f1f1f1;
    border-top-left-radius: 4px;
}

.message-actions {
    position: absolute;
    top: -10px;
    right: 10px;
    background: rgba(0, 0, 0, 0.7);
    border-radius: 20px;
    padding: 5px;
    display: none;
    z-index: 10;
}

.message:hover .message-actions {
    display: flex;
}

.message-action-btn {
    background: none;
    border: none;
    color: #cbd5e1;
    cursor: pointer;
    padding: 5px 8px;
    border-radius: 4px;
    font-size: 0.8rem;
    transition: all 0.2s;
}

.message-action-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #f1f1f1;
}

.message.recalled .message-content {
    background: rgba(255, 255, 255, 0.05);
    color: #94a3b8;
    font-style: italic;
}

.quote-container {
    background: rgba(255, 255, 255, 0.05);
    border-left: 3px solid #6ee7b7;
    padding: 8px 12px;
    margin-bottom: 8px;
    border-radius: 4px;
}

.quote-sender {
    font-weight: 600;
    color: #6ee7b7;
    font-size: 0.9rem;
}

.quote-text {
    color: #cbd5e1;
    font-size: 0.9rem;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.quote-preview {
    padding: 10px 20px;
    background: rgba(59, 130, 246, 0.1);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.quote-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

#quote-text {
    color: #cbd5e1;
    font-size: 0.9rem;
}

.cancel-quote {
    background: none;
    border: none;
    color: #94a3b8;
    cursor: pointer;
    padding: 5px;
    border-radius: 4px;
    transition: all 0.2s;
}

.cancel-quote:hover {
    color: #f1f1f1;
    background: rgba(255, 255, 255, 0.1);
}

.message-input-container {
    padding: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: flex-end;
}

.input-actions {
    display: flex;
    margin-right: 10px;
}

.btn-icon {
    background: rgba(255, 255, 255, 0.05);
    border: none;
    color: #cbd5e1;
    width: 40px;
    height: 40px;
    border-radius: 8px;
    cursor: pointer;
    margin-right: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.btn-icon:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #f1f1f1;
}

#message-input {
    flex: 1;
    padding: 12px 15px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    color: #f1f1f1;
    font-size: 1rem;
    resize: none;
    max-height: 120px;
    transition: all 0.3s;
}

#message-input:focus {
    outline: none;
    border-color: #6ee7b7;
    box-shadow: 0 0 0 2px rgba(110, 231, 183, 0.2);
}

#send-btn {
    width: auto;
    padding: 12px 30px;
    margin-left: 15px;
}

.emoji-picker {
    position: absolute;
    bottom: 100px;
    right: 30px;
    width: 300px;
    background: rgba(30, 41, 59, 0.95);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    z-index: 1000;
}

.emoji-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.emoji-header h4 {
    color: #cbd5e1;
}

.emoji-list {
    display: flex;
    flex-wrap: wrap;
    padding: 15px;
}

.emoji {
    font-size: 1.5rem;
    padding: 8px;
    cursor: pointer;
    transition: all 0.2s;
    border-radius: 8px;
}

.emoji:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: scale(1.2);
}

.message-menu {
    position: absolute;
    background: rgba(30, 41, 59, 0.95);
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    z-index: 1000;
    min-width: 150px;
}

.message-menu ul {
    list-style: none;
}

.message-menu li {
    padding: 12px 15px;
    cursor: pointer;
    display: flex;
    align-items: center;
    transition: all 0.2s;
    color: #cbd5e1;
}

.message-menu li:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #f1f1f1;
}

.message-menu li i {
    margin-right: 10px;
    width: 20px;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .chat-main {
        flex-direction: column;
    }
    
    .users-panel {
        width: 100%;
        height: 200px;
        border-right: none;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    }
    
    .message {
        max-width: 90%;
    }
    
    .emoji-picker {
        width: 250px;
        right: 10px;
    }
}

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

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

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

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}