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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

/* 登录页面样式 */
.landing-page {
    width: 100%;
    max-width: 500px;
    animation: fadeIn 0.5s ease;
}

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

.landing-box {
    background: white;
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}

.landing-box h1 {
    color: #333;
    font-size: 2rem;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.landing-box .subtitle {
    color: #666;
    margin-bottom: 30px;
}

.tab-buttons {
    display: flex;
    gap: 10px;
    margin-bottom: 30px;
    border-bottom: 2px solid #eee;
    padding-bottom: 10px;
}

.tab-btn {
    flex: 1;
    padding: 12px;
    border: none;
    background: none;
    font-size: 1rem;
    cursor: pointer;
    color: #666;
    transition: all 0.3s;
}

.tab-btn.active {
    color: #667eea;
    font-weight: bold;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
    animation: slideIn 0.3s ease;
}

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

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

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

.input-group input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 1rem;
    transition: all 0.3s;
}

.input-group input:focus {
    outline: none;
    border-color: #667eea;
}

.primary-btn {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 1.1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all 0.3s;
}

.primary-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(102, 126, 234, 0.3);
}

.info-note {
    margin-top: 30px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 10px;
    color: #666;
    text-align: center;
}

/* 主聊天室样式 */
.chat-container {
    width: 100%;
    max-width: 1200px;
    height: 80vh;
    background: white;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    display: flex;
    flex-direction: column;
    animation: fadeIn 0.5s ease;
}

/* 顶部栏 */
.top-bar {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 15px 20px;
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.room-info {
    display: flex;
    align-items: center;
    gap: 20px;
}

.room-info span {
    display: flex;
    align-items: center;
    gap: 5px;
}

.copy-btn {
    background: rgba(255,255,255,0.2);
    border: none;
    color: white;
    padding: 5px 10px;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s;
}

.copy-btn:hover {
    background: rgba(255,255,255,0.3);
}

.remote-status {
    display: flex;
    align-items: center;
    gap: 5px;
    background: rgba(255,255,255,0.2);
    padding: 5px 15px;
    border-radius: 20px;
}

/* 主内容区 */
.main-content {
    flex: 1;
    display: flex;
    overflow: hidden;
}

/* 聊天区域 */
.chat-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: #f8f9fa;
    border-right: 1px solid #dee2e6;
}

.chat-header {
    padding: 15px 20px;
    background: white;
    border-bottom: 1px solid #dee2e6;
}

.chat-header h3 {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #333;
    font-size: 1.1rem;
}

.messages-box {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.message {
    max-width: 80%;
    padding: 10px 15px;
    border-radius: 15px;
    position: relative;
    animation: messageIn 0.3s ease;
    word-wrap: break-word;
}

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

.message.self {
    align-self: flex-end;
    background: #667eea;
    color: white;
    border-bottom-right-radius: 5px;
}

.message.other {
    align-self: flex-start;
    background: white;
    color: #333;
    border-bottom-left-radius: 5px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.message.system {
    align-self: center;
    background: #e9ecef;
    color: #666;
    font-size: 0.9rem;
    max-width: 60%;
    text-align: center;
}

.message-meta {
    font-size: 0.7rem;
    margin-top: 5px;
    opacity: 0.7;
}

/* 图片消息样式 */
.message-content.image-message {
    padding: 5px;
    background: transparent;
}

.chat-image {
    max-width: 200px;
    max-height: 150px;
    border-radius: 8px;
    cursor: pointer;
    transition: transform 0.2s;
}

.chat-image:hover {
    transform: scale(1.05);
}

/* 全屏图片预览 */
.image-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 20000;
}

.image-container {
    position: relative;
    max-width: 90%;
    max-height: 90%;
}

.image-container img {
    max-width: 100%;
    max-height: 90vh;
    object-fit: contain;
    border-radius: 8px;
}

.image-container .close-btn {
    position: absolute;
    top: -40px;
    right: -40px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
}

.image-container .close-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg);
}

/* 聊天输入区 */
.chat-input-area {
    display: flex;
    gap: 10px;
    padding: 15px 20px;
    background: white;
    border-top: 1px solid #dee2e6;
}

.chat-input-area input {
    flex: 1;
    padding: 10px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 25px;
    font-size: 0.95rem;
    transition: all 0.3s;
}

.chat-input-area input:focus {
    outline: none;
    border-color: #667eea;
}

.action-btn {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    border: none;
    background: #6c757d;
    color: white;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
}

.action-btn:hover {
    background: #5a6268;
    transform: scale(1.1);
}

.send-btn {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    border: none;
    background: #667eea;
    color: white;
    cursor: pointer;
    transition: all 0.3s;
}

.send-btn:hover {
    background: #5a6fd6;
    transform: scale(1.1);
}

.send-btn:disabled,
.action-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* 语音控制区域 */
.voice-section {
    width: 300px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 20px;
    display: flex;
    flex-direction: column;
}

.voice-card {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 30px 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    color: white;
    height: 100%;
}

.voice-avatar {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.voice-status {
    font-size: 1rem;
    text-align: center;
    padding: 5px 15px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 20px;
}

.voice-controls {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
}

.voice-btn {
    width: 100%;
    padding: 12px;
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.voice-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.voice-btn:not(:disabled):hover {
    transform: translateY(-2px);
}

.call-btn {
    background: #28a745;
    color: white;
}

.call-btn:not(:disabled):hover {
    background: #218838;
    box-shadow: 0 5px 15px rgba(40, 167, 69, 0.3);
}

.end-call-btn {
    background: #dc3545;
    color: white;
}

.end-call-btn:not(:disabled):hover {
    background: #c82333;
    box-shadow: 0 5px 15px rgba(220, 53, 69, 0.3);
}

.participant-info {
    margin-top: auto;
    width: 100%;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
}

.participant {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px;
    border-radius: 8px;
    margin-bottom: 5px;
}

.participant.self {
    background: rgba(255, 255, 255, 0.1);
}

.participant.remote {
    background: rgba(255, 255, 255, 0.05);
}

/* 移动端适配 */
@media (max-width: 768px) {
    body {
        padding: 10px;
    }

    .chat-container {
        height: 95vh;
    }

    .main-content {
        flex-direction: column;
    }

    .chat-section {
        height: 60%;
        border-right: none;
        border-bottom: 1px solid #dee2e6;
    }

    .voice-section {
        width: 100%;
        height: 40%;
        padding: 15px;
    }

    .voice-card {
        padding: 20px 15px;
    }

    .voice-avatar {
        width: 70px;
        height: 70px;
        font-size: 2rem;
    }

    .top-bar {
        flex-direction: column;
        gap: 10px;
        align-items: flex-start;
    }

    .room-info {
        flex-wrap: wrap;
        gap: 10px;
    }

    .chat-image {
        max-width: 150px;
        max-height: 120px;
    }
}

@media (max-width: 480px) {
    .landing-box {
        padding: 30px 20px;
    }

    .landing-box h1 {
        font-size: 1.5rem;
    }

    .message {
        max-width: 90%;
        font-size: 0.9rem;
    }

    .chat-input-area {
        padding: 10px;
    }

    .action-btn, .send-btn {
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }

    .voice-btn {
        padding: 10px;
        font-size: 0.9rem;
    }
}