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

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

.container {
    width: 100%;
    height: 100vh;
    position: relative;
}

/* 屏幕切换 */
.screen {
    display: none;
    width: 100%;
    height: 100%;
}

.screen.active {
    display: flex;
}

/* 登录界面 */
#loginScreen {
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.login-box {
    background: white;
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    max-width: 450px;
    width: 100%;
}

.login-box h1 {
    text-align: center;
    margin-bottom: 10px;
    font-size: 32px;
    color: #667eea;
}

.subtitle {
    text-align: center;
    color: #666;
    margin-bottom: 30px;
    font-size: 14px;
}

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

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

.form-group input {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.3s;
}

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

.btn {
    width: 100%;
    padding: 14px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

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

.btn-secondary {
    width: 100%;
    padding: 12px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    background: white;
    color: #666;
}

.btn-secondary:hover {
    border-color: #999;
    color: #333;
    transform: translateY(-1px);
}

.info-box {
    margin-top: 30px;
    padding: 20px;
    background: #f5f5f5;
    border-radius: 8px;
    font-size: 14px;
}

.info-box p {
    margin-bottom: 8px;
    color: #555;
}

.info-box p:last-child {
    margin-bottom: 0;
}

/* 通话界面 */
#callScreen {
    flex-direction: column;
    background: #1a1a2e;
}

/* 状态栏 */
.status-bar {
    display: flex;
    justify-content: space-around;
    align-items: center;
    padding: 15px 20px;
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    flex-wrap: wrap;
}

.status-item {
    display: flex;
    align-items: center;
    margin: 5px 10px;
}

.status-label {
    color: #aaa;
    font-size: 13px;
    margin-right: 8px;
}

.status-value {
    color: white;
    font-weight: 600;
    font-size: 14px;
    padding: 4px 12px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 12px;
}

.status-connected {
    background: rgba(76, 175, 80, 0.3) !important;
    color: #4caf50 !important;
}

.status-disconnected {
    background: rgba(244, 67, 54, 0.3) !important;
    color: #f44336 !important;
}

.status-connecting {
    background: rgba(255, 193, 7, 0.3) !important;
    color: #ffc107 !important;
}

.status-encrypted {
    background: rgba(33, 150, 243, 0.3) !important;
    color: #2196f3 !important;
}

/* 网络统计样式 */
#networkStats {
    font-family: 'Courier New', monospace;
    font-size: 12px;
    cursor: help;
    background: rgba(156, 39, 176, 0.3) !important;
    color: #9c27b0 !important;
}

/* 移动端网络统计优化 */
@media (max-width: 768px) {
    #networkStats {
        font-size: 11px;
    }
}

/* 视频容器 - 微信风格画中画 */
.video-container {
    flex: 1;
    position: relative;
    background: #000;
    overflow: hidden;
}

/* 主视频（大画面） */
.video-wrapper {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #000;
}

.video-wrapper video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* 主视频包装器 */
.remote-video-wrapper {
    z-index: 1;
}

/* 小窗口（画中画） */
.local-video-wrapper {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 120px;
    height: 160px;
    z-index: 10;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.local-video-wrapper:hover {
    transform: scale(1.05);
    border-color: rgba(255, 255, 255, 0.6);
}

.local-video-wrapper:active {
    transform: scale(0.95);
}

/* 移动端适配 */
@media (max-width: 768px) {
    .local-video-wrapper {
        width: 100px;
        height: 133px;
        top: 80px;
        right: 15px;
    }
}

.video-wrapper video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    background: #000;
}

.video-placeholder {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
}

.video-placeholder.hidden {
    display: none;
}

.placeholder-content {
    text-align: center;
}

.avatar {
    font-size: 80px;
    margin-bottom: 20px;
    opacity: 0.5;
}

.placeholder-content p {
    color: rgba(255, 255, 255, 0.7);
    font-size: 18px;
}

.video-label {
    position: absolute;
    bottom: 10px;
    left: 10px;
    background: rgba(0, 0, 0, 0.6);
    color: white;
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
    z-index: 5;
}

/* 小窗口内的标签样式 */
.local-video-wrapper .video-label {
    font-size: 9px;
    padding: 2px 6px;
    bottom: 5px;
    left: 5px;
}

/* 画面切换动画 */
.video-wrapper {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* 移动端触摸优化 */
@media (max-width: 768px) {
    .local-video-wrapper {
        -webkit-tap-highlight-color: transparent;
    }
    
    .local-video-wrapper:active {
        transform: scale(0.95);
    }
}

/* 控制按钮 */
.controls {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    gap: 15px;
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(10px);
    position: relative;
    z-index: 20;
}

.control-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 70px;
    height: 70px;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 14px;
}

.control-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
}

.control-btn:active {
    transform: scale(0.9);
}

.control-btn.active {
    background: rgba(76, 175, 80, 0.3);
    border: 2px solid rgba(76, 175, 80, 0.6);
}

.control-btn.muted {
    background: rgba(244, 67, 54, 0.3);
}

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

.control-btn:disabled:hover {
    transform: none;
}

.control-btn .icon {
    font-size: 24px;
    margin-bottom: 4px;
}

.control-btn .label {
    font-size: 11px;
    font-weight: 600;
}

.btn-danger {
    background: rgba(244, 67, 54, 0.8) !important;
}

.btn-danger:hover {
    background: rgba(244, 67, 54, 1) !important;
}

/* 移动端按钮优化 */
@media (max-width: 768px) {
    .controls {
        padding: 15px 10px;
        gap: 8px;
        flex-wrap: wrap;
    }
    
    .control-btn {
        width: 60px;
        height: 60px;
    }
    
    .control-btn .icon {
        font-size: 22px;
    }
    
    .control-btn .label {
        font-size: 9px;
    }
}

/* 小屏幕按钮调整 */
@media (max-width: 480px) {
    .control-btn {
        width: 55px;
        height: 55px;
    }
    
    .control-btn .icon {
        font-size: 20px;
    }
    
    .control-btn .label {
        font-size: 8px;
    }
}

/* 日志区域 */
.log-container {
    background: rgba(0, 0, 0, 0.5);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    max-height: 200px;
}

.log-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 20px;
    background: rgba(0, 0, 0, 0.3);
    color: white;
    font-weight: 600;
    font-size: 14px;
}

.btn-small {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: white;
    padding: 4px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
}

.btn-small:hover {
    background: rgba(255, 255, 255, 0.2);
}

.log-content {
    max-height: 0;
    overflow-y: auto;
    transition: max-height 0.3s;
    font-family: 'Courier New', monospace;
    font-size: 12px;
}

.log-content.expanded {
    max-height: 150px;
}

.log-entry {
    padding: 6px 20px;
    color: #aaa;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.log-entry.info {
    color: #2196f3;
}

.log-entry.success {
    color: #4caf50;
}

.log-entry.warning {
    color: #ff9800;
}

.log-entry.error {
    color: #f44336;
}

.log-timestamp {
    color: #666;
    margin-right: 10px;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .login-box {
        padding: 30px 20px;
    }

    .status-bar {
        font-size: 12px;
    }

    .control-btn {
        width: 60px;
        height: 60px;
    }

    .control-btn .icon {
        font-size: 24px;
    }

    .control-btn .label {
        font-size: 10px;
    }
}

