body, html {
    margin: 0;
    padding: 0;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: white;
}

/* 样式更新：定位电量显示框在右上角 */
.battery-box {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 10px;
    background-color: rgba(0, 0, 0, 0.7);
    color: white;
    font-size: 16px;
    border-radius: 5px;
}

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

video {
    width: auto;
    height: 100%;
    object-fit: contain;
}

.play-button {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    padding: 10px 20px;
    font-size: 20px;
    background-color: rgba(255, 255, 255, 0.7);
    border: none;
    border-radius: 5px;
    cursor: pointer;
    display: none; /* Initially hidden */
}

video.progress-bar {
    display: none;
}

.img-box{
    position: absolute;
    top: 3%;
    left: 1%;
    width: 30%;
    /*height: 997px;
    background-color: rgba(0, 255, 0, 1);*/ 
    border-radius: 10px;
    font-family: Arial, sans-serif;
    overflow: hidden;
    object-fit: contain; 
    text-align: center;
    font-weight: bolder;
}
.img-box img {
    width: 100%;
    height: 100%;
    object-fit: cover;  /* 保证图片完整显示 */
}
.dot{
    position: absolute;
    width:4px;
    height:4px;
    border-radius: 50%;
    position: absolute;

}
.chat-box {
    position: absolute;
    top: 55%;
    right: 2%;
    width: 375px;
    background-color: rgba(0, 0, 0, 0.5);
    border-radius: 10px;
    padding: 10px;
    color: white;
    font-family: Arial, sans-serif;
    overflow-y: auto;
    max-height: 60%;
}

.warn-box {
    position: absolute;
    top: 1%;
    left: 2%;
    width: 100px;
    border-radius: 10px;
    color: red;
    font-family: Arial, sans-serif;
    overflow-y: auto;
    font-weight: bolder;
}
.chat-message {
    margin: 10px 0;
}

.chat-message.you {
    text-align: left;
}

.chat-message.jiaojiao {
    text-align: right;
}

/* 修改ASR控制位置 */
.asr-control {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 1000;
    text-align: center;
}

.asr-button {
    background-color: #4CAF50;/* 绿色表示就绪 */
    color: white;
    border: none;
    padding: 15px 30px;
    border-radius: 30%;
    cursor: pointer;
    font-size: 16px;
    margin: 5px;
    width: 80px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
    transition: all 0.3s ease;
}

.asr-button:hover {
    background-color: #45a049;
    transform: scale(1.05);
}

.asr-button:disabled {
    background-color: #cccccc;
    cursor: not-allowed;
    transform: none;
}

.asr-button.recording {
    background-color: #f44336;/* 红色表示录音中 */
    animation: pulse 1.5s infinite;
}

.asr-button.generating {
    background-color: #2196F3; /* 蓝色表示生成中 */
    animation: pulse 1.5s infinite;
}

.asr-status {
    color: white;
    background-color: rgba(0,0,0,0.7);
    padding: 5px 10px;
    border-radius: 10px;
    font-size: 10px;
    margin-top: 10px;
    min-width: 100px;
}

.latency-info {
    color: #ff6b6b;
    background-color: rgba(0,0,0,0.7);
    padding: 5px 10px;
    border-radius: 10px;
    font-size: 10px;
    margin-top: 5px;
}
/* 添加AI生成标识样式 */
.ai-generated-notice {
    position: fixed;
    bottom: 10px;
    right: 10px;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.6);
    background-color: rgba(0, 0, 0, 0.3);
    padding: 6px 8px;
    border-radius: 4px;
    z-index: 1000;
    font-family: Arial, sans-serif;
    line-height: 1.4;
    text-align: center;
}

.ai-generated-notice .en {
    display: block;
    margin-bottom: 2px;
}

.ai-generated-notice .zh {
    display: block;
    font-size: 11px;
}

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

#video-container {
    position: fixed;
    width: 100%;
    height: 100%;
} 

#show_video{
    display: block; margin: 0 auto; width: 100%;
    position: absolute;left: 0;top: 0;visibility: visible;
}
#temp_video {
    display: block; margin: 0 auto; width: 100%;
    position: absolute;left: 0;top: 0;visibility: hidden;

}

#start_video {
    display: block; margin: 0 auto; width: 100%;
    position: absolute;left: 0;top: 0;visibility: hidden;

}

#mid_video {
    display: block; margin: 0 auto; width: 100%;
    position: absolute;left: 0;top: 0;visibility: hidden;

}
#end_video {
    display: block; margin: 0 auto; width: 100%;
    position: absolute;left: 0;top: 0;visibility: hidden;

}

/* 移动设备覆盖层样式 */
#mobile-start-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.8);
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    color: white;
    flex-direction: column;
    font-family: Arial, sans-serif;
}

#mobile-start-btn {
    padding: 15px 30px;
    font-size: 18px;
    background: #4CAF50;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
}

/* 移动设备响应式设计 */
@media (max-width: 768px) {
    #video-container {
        position: fixed;
        width: 100%;
        height: 100vh;
        overflow: hidden;
    }
    
    #show_video, #temp_video, #start_video {
        width: 100% !important;
        height: 100% !important;
        object-fit: cover;
    }
    
    /* 移动端ASR按钮位置调整到最右边 */
    .asr-control {
        position: absolute;
        bottom: 20px;
        right: 20px;
        left: auto; /* 确保不会继承左侧定位 */
        transform: none; /* 移除居中变换 */
        z-index: 1000;
    }
    
    .asr-button {
        width: 70px;
        height: 70px;
        font-size: 14px;
        padding: 12px 20px;
    }
    
    .chat-box {
        font-size: 14px;
        max-height: 100px;
        bottom: 100px;
        width: 90% !important;
        right: 5% !important;
        top: auto; /* 移除顶部定位 */
    }
    
    .warn-box {
        font-size: 16px;
        top: 10px;
        left: 10px;
        bottom: auto;
    }
    
    .ai-generated-notice {
        font-size: 10px;
        bottom: 5px;
        right: 5px;
    }
    
    /* 移动端状态信息调整 */
    .asr-status {
        font-size: 9px;
        padding: 4px 8px;
        min-width: 80px;
    }
    
    .latency-info {
        font-size: 9px;
        padding: 4px 8px;
    }
}

/* 防止移动浏览器默认全屏 */
video {
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    -khtml-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

/* iOS Safari 特定样式 */
@supports (-webkit-touch-callout: none) {
    video {
        -webkit-overflow-scrolling: touch;
    }
}

/* 超小屏幕设备适配 */
@media (max-width: 480px) {
    .asr-control {
        bottom: 15px;
        right: 15px;
    }
    
    .asr-button {
        width: 60px;
        height: 60px;
        font-size: 12px;
        padding: 10px 15px;
    }
    
    .chat-box {
        font-size: 12px;
        max-height: 80px;
        bottom: 90px;
    }
    
    .warn-box {
        font-size: 14px;
    }
}
