/**
 * Qwen3-Omni-Flash 全模态实时通话样式
 * 创建时间：2026-01-23
 */

/* 通话模态框 */
.omni-call-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(180deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    z-index: 10000;
    display: none;
    flex-direction: column;
}

.omni-call-modal.active {
    display: flex;
}

.omni-call-modal.minimized {
    display: none;
}

.omni-call-container {
    display: flex;
    flex-direction: column;
    height: 100%;
    max-width: 600px;
    margin: 0 auto;
    width: 100%;
}

/* 顶部状态栏 */
.omni-call-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    padding-top: max(16px, env(safe-area-inset-top));
    background: rgba(0, 0, 0, 0.3);
}

.call-status {
    display: flex;
    align-items: center;
    gap: 8px;
}

.call-status-dot {
    width: 10px;
    height: 10px;
    background: #4CAF50;
    border-radius: 50%;
    animation: statusPulse 2s infinite;
}

@keyframes statusPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.call-status-text {
    color: white;
    font-size: 14px;
    font-weight: 500;
}

.call-duration {
    color: rgba(255, 255, 255, 0.9);
    font-size: 18px;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

.call-minimize-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

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

/* 视频区域 */
.omni-call-video-area {
    flex: 1;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 280px;
    overflow: hidden;
}

/* AI头像动画 */
.remote-video-container {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
}

.ai-avatar-animation {
    text-align: center;
}

.ai-avatar-circle {
    position: relative;
    width: 160px;
    height: 160px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ai-avatar-icon {
    width: 120px;
    height: 120px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 60px;
    position: relative;
    z-index: 2;
    box-shadow: 0 10px 40px rgba(102, 126, 234, 0.4);
}

.ai-avatar-wave {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 120px;
    height: 120px;
    border-radius: 50%;
    border: 3px solid rgba(102, 126, 234, 0.5);
    transform: translate(-50%, -50%);
    opacity: 0;
}

.ai-avatar-animation.speaking .ai-avatar-wave {
    animation: avatarWave 1.5s infinite ease-out;
}

.ai-avatar-wave.delay-1 {
    animation-delay: 0.5s;
}

.ai-avatar-wave.delay-2 {
    animation-delay: 1s;
}

@keyframes avatarWave {
    0% {
        width: 120px;
        height: 120px;
        opacity: 0.6;
    }
    100% {
        width: 200px;
        height: 200px;
        opacity: 0;
    }
}

.ai-avatar-name {
    margin-top: 20px;
    color: white;
    font-size: 18px;
    font-weight: 600;
}

/* 本地视频小窗 */
.local-video-container {
    position: absolute;
    bottom: 20px;
    right: 20px;
    width: 120px;
    height: 160px;
    border-radius: 16px;
    overflow: hidden;
    background: #000;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
    border: 2px solid rgba(255, 255, 255, 0.2);
}

.local-video-container video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transform: scaleX(-1); /* 镜像 */
}

.local-video-label {
    position: absolute;
    bottom: 8px;
    left: 8px;
    background: rgba(0, 0, 0, 0.6);
    color: white;
    padding: 4px 8px;
    border-radius: 8px;
    font-size: 12px;
}

.switch-camera-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: none;
    background: rgba(0, 0, 0, 0.5);
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* 对话记录区 */
.omni-call-transcript {
    flex: 0 0 auto;
    max-height: 180px;
    overflow-y: auto;
    padding: 15px 20px;
    background: rgba(0, 0, 0, 0.3);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.transcript-welcome {
    text-align: center;
    color: rgba(255, 255, 255, 0.7);
    padding: 20px 0;
}

.transcript-welcome p {
    margin: 0;
    font-size: 15px;
}

.transcript-tips {
    font-size: 12px !important;
    margin-top: 8px !important;
    opacity: 0.6;
}

.transcript-msg {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 12px;
    animation: transcriptIn 0.3s ease;
}

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

.transcript-avatar {
    font-size: 20px;
    flex-shrink: 0;
}

.transcript-content {
    flex: 1;
}

.transcript-label {
    display: block;
    font-size: 11px;
    color: rgba(255, 255, 255, 0.5);
    margin-bottom: 2px;
}

.transcript-text {
    color: white;
    font-size: 14px;
    line-height: 1.5;
}

.transcript-msg.user .transcript-text {
    color: #90CAF9;
}

.transcript-msg.system .transcript-text {
    color: rgba(255, 255, 255, 0.6);
    font-style: italic;
}

/* 输入区域 */
.omni-call-input-area {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 20px;
    background: rgba(0, 0, 0, 0.4);
}

/* 麦克风按钮 */
.omni-mic-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: none;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
    flex-shrink: 0;
}

.omni-mic-btn:hover {
    transform: scale(1.05);
}

.omni-mic-btn.listening {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    animation: micPulse 1s infinite;
}

@keyframes micPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

.omni-text-input {
    flex: 1;
    padding: 12px 16px;
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s;
}

.omni-text-input::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

.omni-text-input:focus {
    border-color: #667eea;
}

.omni-send-text-btn,
.omni-image-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: none;
    background: rgba(255, 255, 255, 0.15);
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.omni-send-text-btn:hover,
.omni-image-btn:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: scale(1.05);
}

.omni-send-text-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

/* 底部控制栏 */
.omni-call-controls {
    display: flex;
    justify-content: space-around;
    align-items: center;
    padding: 20px;
    padding-bottom: max(20px, env(safe-area-inset-bottom));
    background: rgba(0, 0, 0, 0.4);
}

.call-control-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 12px 16px;
    border: none;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    color: white;
    cursor: pointer;
    transition: all 0.2s;
    min-width: 70px;
}

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

.call-control-btn svg {
    width: 24px;
    height: 24px;
}

.call-control-btn span {
    font-size: 11px;
    opacity: 0.8;
}

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

.call-control-btn.muted svg,
.call-control-btn.disabled svg {
    opacity: 0.5;
}

.call-control-btn.end-call {
    background: linear-gradient(135deg, #F44336 0%, #D32F2F 100%);
    min-width: 80px;
}

.call-control-btn.end-call:hover {
    background: linear-gradient(135deg, #D32F2F 0%, #B71C1C 100%);
    transform: scale(1.05);
}

/* 浮动按钮 */
.omni-call-float-btn {
    position: fixed;
    bottom: 100px;
    right: 20px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    box-shadow: 0 4px 20px rgba(102, 126, 234, 0.5);
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 9999;
    animation: floatBtnPulse 2s infinite;
}

@keyframes floatBtnPulse {
    0%, 100% { box-shadow: 0 4px 20px rgba(102, 126, 234, 0.5); }
    50% { box-shadow: 0 4px 30px rgba(102, 126, 234, 0.8); }
}

.omni-call-float-btn span {
    font-size: 20px;
    line-height: 1;
}

.float-btn-duration {
    font-size: 10px !important;
    color: white;
    margin-top: 2px;
}

.float-btn-pulse {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 2px solid rgba(102, 126, 234, 0.5);
    animation: floatPulseWave 2s infinite;
}

@keyframes floatPulseWave {
    0% { transform: scale(1); opacity: 1; }
    100% { transform: scale(1.5); opacity: 0; }
}

/* Toast提示 */
.omni-toast {
    position: fixed;
    bottom: 150px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 12px 24px;
    border-radius: 25px;
    font-size: 14px;
    z-index: 10002;
    animation: omniToastIn 0.3s ease;
}

@keyframes omniToastIn {
    from { opacity: 0; transform: translate(-50%, 20px); }
    to { opacity: 1; transform: translate(-50%, 0); }
}

/* 移动端适配 */
@media (max-width: 480px) {
    .omni-call-container {
        max-width: 100%;
    }
    
    .ai-avatar-circle {
        width: 140px;
        height: 140px;
    }
    
    .ai-avatar-icon {
        width: 100px;
        height: 100px;
        font-size: 50px;
    }
    
    @keyframes avatarWave {
        0% {
            width: 100px;
            height: 100px;
            opacity: 0.6;
        }
        100% {
            width: 160px;
            height: 160px;
            opacity: 0;
        }
    }
    
    .local-video-container {
        width: 100px;
        height: 130px;
        bottom: 15px;
        right: 15px;
    }
    
    .omni-call-transcript {
        max-height: 140px;
        padding: 12px 15px;
    }
    
    .omni-call-input-area {
        padding: 10px 15px;
    }
    
    .omni-text-input {
        padding: 10px 14px;
        font-size: 14px;
    }
    
    .omni-send-text-btn,
    .omni-image-btn {
        width: 40px;
        height: 40px;
    }
    
    .call-control-btn {
        padding: 10px 12px;
        min-width: 60px;
    }
    
    .call-control-btn svg {
        width: 22px;
        height: 22px;
    }
    
    .call-control-btn span {
        font-size: 10px;
    }
}

/* 横屏适配 */
@media (orientation: landscape) and (max-height: 500px) {
    .omni-call-video-area {
        min-height: 150px;
    }
    
    .ai-avatar-circle {
        width: 100px;
        height: 100px;
    }
    
    .ai-avatar-icon {
        width: 70px;
        height: 70px;
        font-size: 35px;
    }
    
    .local-video-container {
        width: 80px;
        height: 100px;
    }
    
    .omni-call-transcript {
        max-height: 80px;
    }
}

/* ==================== 图片上传和诊断相关样式 ==================== */

/* 附件按钮 */
.omni-attach-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: none;
    background: rgba(255, 255, 255, 0.15);
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    flex-shrink: 0;
}

.omni-attach-btn:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: scale(1.05);
}

/* 图片预览区 */
.omni-preview-area {
    display: none;
    padding: 10px 20px;
    background: rgba(0, 0, 0, 0.3);
}

.omni-preview-area.active {
    display: block;
}

.omni-preview-item {
    position: relative;
    display: inline-block;
}

.omni-preview-img {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 12px;
    border: 2px solid #667eea;
}

.omni-preview-remove {
    position: absolute;
    top: -8px;
    right: -8px;
    width: 24px;
    height: 24px;
    background: #ff4757;
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.omni-preview-type {
    position: absolute;
    bottom: 4px;
    left: 4px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 2px 8px;
    border-radius: 8px;
    font-size: 10px;
}

/* 消息中的图片 */
.transcript-image {
    max-width: 120px;
    max-height: 90px;
    border-radius: 8px;
    margin-bottom: 6px;
    cursor: pointer;
    display: block;
}

/* 诊断选择模态框 */
.omni-diagnosis-modal {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 100;
}

.omni-diagnosis-modal.active {
    display: flex;
}

.omni-diagnosis-options {
    background: #1a1a2e;
    border-radius: 20px;
    padding: 24px;
    width: 90%;
    max-width: 320px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

.omni-diagnosis-title {
    text-align: center;
    font-size: 18px;
    font-weight: 600;
    color: white;
    margin-bottom: 20px;
}

.omni-diagnosis-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    padding: 16px;
    margin-bottom: 12px;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
    border: 2px solid rgba(102, 126, 234, 0.3);
    border-radius: 14px;
    cursor: pointer;
    transition: all 0.2s;
    color: white;
}

.omni-diagnosis-option:hover {
    border-color: #667eea;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.2) 0%, rgba(118, 75, 162, 0.2) 100%);
    transform: translateY(-2px);
}

.omni-diagnosis-option .option-icon {
    font-size: 32px;
    margin-bottom: 8px;
}

.omni-diagnosis-option .option-text {
    font-size: 15px;
    font-weight: 600;
}

.omni-diagnosis-option .option-desc {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.6);
    margin-top: 4px;
}

.omni-diagnosis-cancel {
    width: 100%;
    padding: 14px;
    margin-top: 8px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 12px;
    font-size: 15px;
    color: rgba(255, 255, 255, 0.7);
    cursor: pointer;
    transition: background 0.2s;
}

.omni-diagnosis-cancel:hover {
    background: rgba(255, 255, 255, 0.15);
}

/* 相机模态框 */
.omni-camera-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    z-index: 10001;
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.omni-camera-modal.active {
    display: flex;
}

.omni-camera-title {
    color: white;
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 20px;
}

.omni-camera-video {
    max-width: 100%;
    max-height: 55vh;
    border-radius: 16px;
    background: #000;
}

.omni-camera-preview {
    max-width: 100%;
    max-height: 55vh;
    border-radius: 16px;
    display: none;
}

.omni-camera-actions {
    margin-top: 24px;
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    justify-content: center;
}

.omni-camera-btn {
    padding: 14px 28px;
    border: none;
    border-radius: 25px;
    font-size: 15px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 6px;
}

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

.omni-camera-btn.primary:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.omni-camera-btn.secondary {
    background: rgba(255, 255, 255, 0.15);
    color: white;
}

.omni-camera-btn.secondary:hover {
    background: rgba(255, 255, 255, 0.25);
}

/* 移动端相机适配 */
@media (max-width: 480px) {
    .omni-camera-video,
    .omni-camera-preview {
        max-height: 50vh;
    }
    
    .omni-camera-btn {
        padding: 12px 20px;
        font-size: 14px;
    }
    
    .omni-diagnosis-options {
        padding: 20px;
    }
    
    .omni-diagnosis-option {
        padding: 14px;
    }
    
    .omni-attach-btn {
        width: 40px;
        height: 40px;
    }
}
