/* 全局重置 - 移除所有元素的默认边距和内边距，设置盒模型为border-box，移除移动端点击高亮 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

/* 设置HTML和body元素占满整个视口，隐藏溢出，设置字体和背景色 */
html, body {
    width: 100%;
    height: 100%;
    overflow: hidden;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #000;
    color: #fff;
}

/* 加载界面样式 - 全屏黑色背景，居中显示加载内容 */
#loadingScreen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #000;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

/* 加载图标样式 - 大号绿色字体 */
.loading-logo {
    font-size: 3rem;
    color: #4CAF50;
    margin-bottom: 1rem;
}

/* 加载文字样式 - 灰色提示文字 */
.loading-text {
    color: #999;
    margin-bottom: 2rem;
}

/* 主容器 - 使用flex垂直布局占满整个屏幕 */
.app-container {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
}

/* 头部区域 - 深色渐变背景，左右两侧布局 */
.app-header {
    padding: 10px 20px;
    background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}

/* Logo区域 - 图标和文字水平排列 */
.logo {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Logo图标 - 绿色视频图标 */
.logo-icon {
    font-size: 24px;
    color: #4CAF50;
}

/* Logo文字 - 加粗的标题文字 */
.logo-text {
    font-size: 18px;
    font-weight: bold;
}

/* 设备数量显示区域 - 蓝色图标和文字 */
.device-status {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: #2196F3; /* 使用蓝色，与在线人数绿色区分 */
}

/* 设备图标 - 脉动动画效果 */
.device-icon {
    animation: pulse 2s infinite;
}

/* 设备数量显示框 - 半透明蓝色背景，圆角边框 */
.device-count {
    background: rgba(33, 150, 243, 0.2);
    padding: 2px 8px;
    border-radius: 10px;
    border: 1px solid rgba(33, 150, 243, 0.3);
    cursor: help;
    position: relative;
}

/* 设备数量悬停时显示工具提示 */
.device-count:hover .device-tooltip {
    display: block;
}

/* 在线人数显示区域 - 绿色图标和文字 */
.online-status {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: #4CAF50;
}

/* 在线人数图标 - 脉动动画效果 */
.online-icon {
    animation: pulse 2s infinite;
}

/* 在线人数显示框 - 半透明绿色背景，圆角边框 */
.online-count {
    background: rgba(76, 175, 80, 0.2);
    padding: 2px 8px;
    border-radius: 10px;
    border: 1px solid rgba(76, 175, 80, 0.3);
    cursor: help;
    position: relative;
}

/* 在线人数悬停时显示工具提示 */
.online-count:hover .online-tooltip {
    display: block;
}

/* 工具提示框共用样式 - 黑色半透明背景，绝对定位在计数器下方 */
.device-tooltip, .online-tooltip {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    background: rgba(0, 0, 0, 0.9);
    color: white;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 11px;
    white-space: nowrap;
    z-index: 1000;
    border: 1px solid #333;
}

/* 工具提示框箭头 - 使用CSS三角形实现 */
.device-tooltip:before, .online-tooltip:before {
    content: '';
    position: absolute;
    top: -5px;
    right: 10px;
    width: 10px;
    height: 10px;
    background: rgba(0, 0, 0, 0.9);
    transform: rotate(45deg);
    border-left: 1px solid #333;
    border-top: 1px solid #333;
}

/* 脉动动画 - 用于图标闪烁效果 */
@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* 头部右侧容器，用于并排显示设备和在线人数 */
.header-right {
    display: flex;
    align-items: center;
    gap: 15px;
}

/* 主内容区 - 使用flex布局占满剩余空间 */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

/* 视频区域 - 电脑端占主内容区的60%高度，黑色背景 */
.video-area {
    flex: 0.8; /* 调整为80%高度 */
    background: #000;
    position: relative;
    overflow: hidden; /* 新增：防止视频溢出 */
}

/* 视频容器 - 占满整个视频区域，使用flex顶部对齐 */
.video-container {
    width: 100%;
    height: 100%;
    position: relative; /* 修改为relative，使子元素可以绝对定位 */
    display: flex;
    align-items: flex-start; /* 修改：顶部对齐，不居中 */
    justify-content: center;
    background: #000;
    overflow: auto; /* 新增：允许滚动 */
    -webkit-overflow-scrolling: touch; /* 移动端平滑滚动 */
}

/* 2. 添加竖屏视频专用样式 */
.video-container.portrait-video-mode {
    overflow-y: auto !important;
    overflow-x: hidden !important;
    scroll-behavior: smooth; /* 平滑滚动 */
}


/* 3. 修改#tcplayer-container的高度控制 */
#tcplayer-container.portrait-mode {
    height: auto !important;
    min-height: 100% !important;
    max-height: none !important; /* 移除最大高度限制 */
}

/* 视频占位符 - 当没有摄像头时显示的文字提示 */
.video-placeholder {
    color: #666;
    text-align: center;
    padding-top: 20px; /* 增加上边距 */
}

/* 摄像头选择区域 - 调整位置，整体下移5px */
.camera-controls {
    padding: 8px 20px; /* 上下内边距从10px减少到8px，下移2px */
    background: rgba(0,0,0,0.9);
    border-top: 1px solid #333;
    border-bottom: 1px solid #333;
    flex-shrink: 0; /* 固定高度，不收缩 */
    margin-top: 5px; /* 整体下移5px */
    position: relative; /* 为提示文字添加相对定位 */
}

/* 添加摄像头选择提示文字容器 */
.camera-hint-container {
    text-align: center;
    margin-bottom: 5px; /* 与按钮的间距 */
    height: 15px; /* 固定高度，防止布局抖动 */
    display: flex;
    align-items: center;
    justify-content: center;
}

/* 摄像头选择提示文字 */
.camera-hint-text {
    color: #FFD700;
    font-size: 11px;
    display: inline-block;
    padding: 2px 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    white-space: nowrap; /* 防止换行 */
}

/* 摄像头选择器 - 水平滚动布局 */
.camera-selector {
    display: flex;
    gap: 8px; /* 从10px减少到8px，紧凑布局 */
    overflow-x: auto;
    padding-bottom: 5px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin; /* Firefox滚动条 */
    scrollbar-color: #4CAF50 transparent; /* Firefox滚动条颜色 */
}

/* 自定义滚动条样式 - 适用于WebKit浏览器 */
.camera-selector::-webkit-scrollbar {
    height: 4px;
}

.camera-selector::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
}

.camera-selector::-webkit-scrollbar-thumb {
    background: #4CAF50;
    border-radius: 2px;
}

/* 摄像头按钮 - 缩小5px */
.camera-btn {
    flex: 0 0 auto;
    padding: 8px 16px; /* 从10px 20px调整为8px 16px，缩小5px */
    background: #333;
    color: white;
    border: none;
    border-radius: 20px;
    font-size: 13px; /* 从14px减小到13px */
    cursor: pointer;
    min-height: 40px; /* 从44px减少到40px，缩小5px */
    transition: all 0.3s;
    position: relative;
}

.camera-btn:hover:not(.disabled) {
    background: #444;
}
    
.camera-btn.active {
    background: #4CAF50;
}

.camera-btn.disabled {
    background: #666;
    color: #999;
    cursor: not-allowed;
    opacity: 0.6;
}

/* 备注显示区域 - note-display的下边继续延长20px，并确保内部文字居中 */
.note-display {
    flex: 0.1; /* 从0.08增加到0.1，继续延长框架高度20px */
    background: #1a1a1a;
    padding: 2px 20px;
    border-top: 1px solid #333;
    display: flex;
    align-items: center; /* 确保垂直居中 */
    justify-content: center; /* 确保水平居中 */
    min-height: 40px; /* 从35px增加到40px，延长20px */
    font-size: 12px;
    margin-bottom: 10px; /* 与contact-display顶部保持10px间距 */
}

/* 备注文字 - 确保在延长后的框架中居中显示 */
.note-text {
    color: #aaa;
    font-size: 13px;
    text-align: center;
    width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    line-height: 1.5; /* 添加行高确保更好的垂直居中 */
}

/* 无备注时的提示文字 - 斜体灰色文字 */
.no-note {
    color: #666;
    font-style: italic;
}

/* 店主联系方式区域 - 取消删除contact-display的上边框，整体上移30px */
.contact-display {
    flex: 0.07; /* 从0.08调整为0.07，缩短高度 */
    background: rgba(0, 0, 0, 0.8);
    padding: 2px 20px; /* 从4px 20px调整为2px 20px，上下各缩短2.5px */
    /* 移除了border-top属性，取消上边框 */
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px; /* 从4px减少到2px */
    min-height: 30px; /* 从35px减少到30px，缩短5px */
    transform: translateY(-10px); /* 从translateY(20px)调整为translateY(-10px)，整体上移30px */
}

/* 按钮容器 */
.contact-buttons {
    display: flex;
    gap: 8px;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
}

/* 功能按钮样式 */
.contact-btn {
    padding: 4px 15px; /* 从5px 15px调整为4px 15px */
    border-radius: 20px;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 500;
    color: white;
    transition: all 0.3s ease;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    min-width: 90px;
    justify-content: center;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* 微信好友按钮 */
.wechat-btn {
    background: linear-gradient(135deg, #2dc100 0%, #1ea700 100%);
}

.wechat-btn:hover {
    background: linear-gradient(135deg, #28a800 0%, #189500 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(45, 193, 0, 0.3);
}

/* 支付宝好友按钮 */
.alipay-btn {
    background: linear-gradient(135deg, #0099ff 0%, #0066cc 100%);
}

.alipay-btn:hover {
    background: linear-gradient(135deg, #0088ee 0%, #0055bb 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 153, 255, 0.3);
}

/* 电话按钮样式 */
.phone-btn {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a52 100%);
}

.phone-btn:hover {
    background: linear-gradient(135deg, #ff5252 0%, #e53935 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(255, 107, 107, 0.3);
}

/* 聊天提示文字容器 - 黑色半透明背景，圆角，毛玻璃效果 */
.chat-hint-container {
    position: absolute;
    background: rgba(0, 0, 0, 0.7);
    border-radius: 8px;
    padding: 10px 15px;
    pointer-events: auto;
    z-index: 1002;
    backdrop-filter: blur(5px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    display: none; /* 默认隐藏 */
    width: auto; /* 自适应宽度 */
    /* 关键修复：添加默认定位，确保不继承其他样式 */
    top: 20px;
    left: 20px;
}

/* 聊天提示文字 - 白色文字，绿色强调部分 */
.chat-hint-text {
    color: #ffffff;
    font-size: 12px;
    line-height: 1.4;
    margin: 0;
}

/* 提示文字中的强调部分 - 绿色加粗 */
.chat-hint-text .important {
    color: #4CAF50;
    font-weight: bold;
}

/* 聊天输入框容器 - 黑色半透明背景，位于底部 */
.chat-input-container {
    position: absolute;
    bottom: 20px;
    background: rgba(0, 0, 0, 0.85);
    border-radius: 8px;
    padding: 12px 15px;
    display: none;
    pointer-events: auto;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

/* 聊天输入区域 - 垂直排列的子元素 */
.chat-input-area {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* 聊天文本输入框 - 半透明背景，白色文字，可垂直调整大小 */
.chat-text-input {
    padding: 12px 15px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 4px;
    color: white;
    font-size: 14px;
    resize: vertical;
    min-height: 60px;
    max-height: 120px;
    width: 100%; /* 确保输入框占满容器 */
}

/* 输入框聚焦样式 - 绿色边框和阴影 */
.chat-text-input:focus {
    outline: none;
    border-color: #4CAF50;
    box-shadow: 0 0 0 2px rgba(76, 175, 80, 0.2);
}

/* 聊天按钮区域 - 上下排列的取消和发送按钮 */
.chat-input-buttons {
    display: flex;
    flex-direction: column; /* 改为列布局 */
    gap: 8px;
    width: 100px; /* 固定按钮区域宽度 */
    margin-left: 10px; /* 与输入框的间距 */
}

/* 按钮容器 - 输入框和按钮的水平排列 */
.chat-buttons-container {
    display: flex;
    align-items: flex-start;
}

/* 输入框容器 - 占据剩余空间 */
.chat-input-wrapper {
    flex: 1;
    min-width: 0; /* 防止flex子元素溢出 */
}

/* 取消和发送按钮共用样式 - 圆角按钮 */
.chat-send-btn, .chat-cancel-btn {
    padding: 10px 15px;
    border-radius: 4px;
    border: none;
    cursor: pointer;
    font-size: 13px;
    font-weight: bold;
    transition: all 0.2s ease;
    text-align: center;
    width: 100%; /* 按钮宽度占满容器 */
}

/* 发送按钮 - 绿色背景，白色文字 */
.chat-send-btn {
    background: #4CAF50;
    color: white;
    order: 2; /* 发送按钮在下 */
}

/* 发送按钮悬停效果 - 深绿色，轻微上移 */
.chat-send-btn:hover:not(:disabled) {
    background: #45a049;
    transform: translateY(-1px);
}

/* 禁用状态的发送按钮 - 灰色背景，不可点击 */
.chat-send-btn:disabled {
    background: #666;
    cursor: not-allowed;
    transform: none;
}

/* 取消按钮 - 半透明白色背景，灰色文字 */
.chat-cancel-btn {
    background: rgba(255, 255, 255, 0.1);
    color: #aaa;
    order: 1; /* 取消按钮在上 */
}

/* 取消按钮悬停效果 - 增加透明度 */
.chat-cancel-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* 聊天消息容器 - 黑色半透明渐变背景，位于输入框上方 */
.chat-messages-container {
    position: absolute;
    bottom: 100px; /* 在输入框上方 */
    left: 20px;
    max-height: 200px;
    overflow-y: auto;
    overflow-x: hidden;
    pointer-events: auto;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.9), rgba(0, 0, 0, 0.7));
    border-radius: 8px 8px 0 0;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(5px);
    padding: 10px 15px;
    display: none !important; /* 强制隐藏 */
    flex-direction: column;
    gap: 5px;
    opacity: 0; /* 完全透明 */
    visibility: hidden; /* 不可见 */
}

/* 聊天触发按钮 - 圆形按钮，位于右上角 */
.chat-toggle-btn {
    position: absolute;
    top: 30px; /* 同步下移两行字 */
    right: 20px; /* 右侧位置 */
    width: 40px;
    height: 40px;
    background: rgba(0, 0, 0, 0.7);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    pointer-events: auto;
    z-index: 1001;
    border: 2px solid rgba(255, 255, 255, 0.3);
    color: white;
    font-size: 18px;
    transition: all 0.3s ease;
}

/* 聊天按钮悬停效果 - 放大并旋转 */
.chat-toggle-btn:hover {
    background: rgba(0, 0, 0, 0.9);
    transform: scale(1.1) rotate(10deg);
}

/* 视频聊天浮层 - 覆盖整个视频区域，用于显示聊天相关元素 */
.video-chat-overlay {
    position: absolute;
    z-index: 1000;
    pointer-events: none;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    display: flex;
    flex-direction: column;
    justify-content: flex-end; /* 从底部开始 */
}

/* 单条聊天消息样式 - 黑色半透明背景，左侧绿色边框 */
.chat-message-item {
    margin: 2px 0;
    padding: 6px 10px;
    background: rgba(0, 0, 0, 0.6);
    border-radius: 6px;
    border-left: 2px solid #4CAF50;
    animation: fadeIn 0.3s ease;
    word-break: break-word;
    opacity: 0.9;
    transition: opacity 0.5s ease;
    max-width: 85%; /* 限制消息宽度，不占用过多空间 */
}

/* 淡出状态的聊天消息 - 降低透明度 */
.chat-message-item.fading {
    opacity: 0.3;
}

/* 聊天消息用户 - 绿色加粗文字 */
.chat-message-user {
    font-weight: bold;
    color: #4CAF50;
    font-size: 12px;
    margin-bottom: 3px;
}

/* 聊天消息文本 - 白色文字 */
.chat-message-text {
    color: #ffffff;
    font-size: 13px; /* 稍微减小字体 */
    line-height: 1.4;
}

/* 聊天消息时间 - 灰色小字，右对齐 */
.chat-message-time {
    color: #aaaaaa;
    font-size: 9px; /* 减小时间字体 */
    text-align: right;
    margin-top: 3px;
}

/* 淡入动画 - 用于新消息显示 */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 0.9; transform: translateY(0); }
}

/* 状态栏 - status-bar整体上移30px */
.status-bar {
    flex: 0.04;
    padding: 2px 20px;
    background: rgba(0,0,0,0.9);
    border-top: 1px solid #333;
    font-size: 11px;
    color: #aaa;
    display: flex;
    flex-shrink: 0;
    align-items: center;
    justify-content: center;
    flex-wrap: nowrap;
    gap: 15px;
    min-height: 15px;
    transform: translateY(-15px); /* 从translateY(15px)调整为translateY(-15px)，整体上移30px */
}

/* 页脚内容容器 - 水平排列的店铺信息、版权信息和联系方式 */
.footer-content {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: nowrap;
    gap: 20px;
}

/* 店铺名称 - 白色加粗文字 */
.shop-name {
    color: #aaa;
    font-weight: 500;
}

/* 版权信息 - 灰色文字 */
.copyright-text {
    color: #aaa;
}

/* 联系方式 - 水平排列的电话图标和号码 */
.contact-info {
    display: flex;
    align-items: center;
    gap: 5px;
}

/* 电话图标 - 绿色 */
.phone-icon {
    color: #4CAF50;
}

/* 分隔符 - 灰色竖线 */
.footer-separator {
    color: #666;
}

/* 聊天消息容器的滚动条样式 */
.chat-messages-container::-webkit-scrollbar {
    width: 6px;
}

/* 聊天消息容器滚动条轨道 */
.chat-messages-container::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}

/* 聊天消息容器滚动条滑块 - 半透明绿色 */
.chat-messages-container::-webkit-scrollbar-thumb {
    background: rgba(76, 175, 80, 0.5);
    border-radius: 3px;
}

/* 聊天消息容器滚动条滑块悬停效果 - 加深绿色 */
.chat-messages-container::-webkit-scrollbar-thumb:hover {
    background: rgba(76, 175, 80, 0.7);
}

/* ==================== TCPlayer样式优化 ==================== */

/* TCPlayer播放器容器 */
#tcplayer-container {
    width: 100% !important;
    height: 100% !important;
    background: #000 !important;
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    z-index: 2 !important;
}

/* TCPlayer内部视频容器 */
.video-js {
    width: 100% !important;
    height: 100% !important;
    background: #000 !important;
    position: relative !important;
    overflow: hidden !important;
}

/* 视频元素 - 横屏视频默认contain */
.video-js .vjs-tech {
    object-fit: contain !important;
    width: 100% !important;
    height: 100% !important;
}

/* 4. 竖屏视频时，视频元素的自适应高度 */
.portrait-video .vjs-tech {
    object-fit: cover !important;
    width: 100% !important;
    height: auto !important; /* 竖屏视频高度自适应 */
}

/* 竖屏视频全屏时的样式 */
.video-js.portrait-video.vjs-fullscreen .vjs-tech {
    object-fit: cover !important; /* 竖屏全屏时：填满屏幕 */
}

/* 5. 全屏时恢复固定高度 */
.vjs-fullscreen .portrait-video .vjs-tech {
    height: 100% !important; /* 全屏时填满屏幕 */
}

/* 6. 确保滚动条样式不影响视频 */
.video-container::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

.video-container::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}

.video-container::-webkit-scrollbar-thumb {
    background: rgba(76, 175, 80, 0.5);
    border-radius: 3px;
}

.video-container::-webkit-scrollbar-thumb:hover {
    background: rgba(76, 175, 80, 0.7);
}

/* 横屏视频全屏时的样式 */
.video-js.vjs-fullscreen .vjs-tech {
    object-fit: contain !important; /* 横屏视频全屏：保持比例 */
}

/* 隐藏TCPlayer的Logo水印 */
.video-js .vjs-watermark {
    display: none !important;
}

/* TCPlayer控制栏样式调整 */
.video-js .vjs-control-bar {
    background: rgba(0, 0, 0, 0.7) !important;
}

/* 手机端TCPlayer特殊设置 */
@media (max-width: 768px) {
    #tcplayer-container {
        min-width: 100vw !important;
        min-height: 320px !important;
        max-height: 450px !important;
        position: absolute !important;
        top: 50% !important;
        left: 50% !important;
        transform: translate(-50%, -50%) !important;
    }
    
    .video-js {
        min-width: 100vw !important;
        min-height: 320px !important;
        max-height: 450px !important;
    }
    
    .video-container.portrait-video-mode {
        -webkit-overflow-scrolling: touch !important;
    }

    #tcplayer-container.portrait-mode {
        min-height: 100vh !important; /* 手机端确保足够高度 */
    }
    
    
}

/* 小屏幕手机TCPlayer特殊设置 */
@media (max-width: 480px) {
    #tcplayer-container {
        min-width: 100vw !important;
        min-height: 280px !important;
        max-height: 380px !important;
    }
    
    .video-js {
        min-width: 100vw !important;
        min-height: 280px !important;
        max-height: 380px !important;
    }
}

/* 手机横屏模式TCPlayer特殊设置 */
@media (max-width: 768px) and (orientation: landscape) {
    #tcplayer-container {
        min-height: 350px !important;
        max-height: 500px !important;
    }
    
    .video-js {
        min-height: 350px !important;
        max-height: 500px !important;
    }
}

/* 电脑端布局 - 屏幕宽度大于768px时应用 */
@media (min-width: 769px) {
    /* 电脑端：聊天提示在按钮左侧，自适应宽度 */
    .chat-hint-container {
        top: 60px !important; /* 与按钮对齐 */
        right: 70px  !important; /* 按钮左侧，留出按钮空间 */
        left: auto !important; /* 移除左侧定位 */
        max-width: 300px; /* 最大宽度限制 */
    }
    
    /* 电脑端：输入框宽度占整个视频宽度的20%，靠右 */
    .chat-input-container {
        right: 20px;
        width: 20%; /* 占整个视频宽度的20% */
    }
    
    /* 电脑端：消息框宽度调整为30% */
    .chat-messages-container {
        width: 30%; /* 消息框宽度调整为30% */
    }
}

/* 手机端布局 - 屏幕宽度小于等于768px时应用 */
@media (max-width: 768px) {
    /* 头部区域调整 - 减小内边距 */
    .app-header {
        padding: 8px 15px;
    }
    
    /* Logo文字调整 - 减小字体大小 */
    .logo-text {
        font-size: 16px;
    }
    
    /* 设备和在线状态调整 - 减小字体大小 */
    .device-status, .online-status {
        font-size: 11px;
    }
    
    /* 头部右侧容器调整 - 减小元素间距 */
    .header-right {
        gap: 10px;
    }
    
    /* 视频区域保持较大比例 */
    .video-area {
        flex: 0.6; /* 保持60%高度 */
    }
    
    /* 备注显示区域调整 - note-display的下边继续延长20px */
    .note-display {
        flex: 0.1; /* 从0.08增加到0.1 */
        padding: 1px 15px;
        min-height: 35px; /* 从30px增加到35px，延长5px */
        margin-bottom: 10px; /* 与contact-display顶部保持10px间距 */
    }
    
    /* 备注文字在手机端确保居中 */
    .note-text {
        line-height: 1.5; /* 添加行高确保更好的垂直居中 */
    }
    
    /* 摄像头选择区域调整 - 手机端 */
    .camera-controls {
        padding: 6px 15px; /* 手机端内边距更小 */
        margin-top: 3px; /* 手机端下移距离稍小 */
    }
    
    /* 手机端提示文字 */
    .camera-hint-text {
        font-size: 10px; /* 手机端字体更小 */
        padding: 1px 6px;
    }
    
    /* 摄像头选择器在手机端 */
    .camera-selector {
        gap: 6px; /* 手机端间距更小 */
    }
    
    /* 手机端摄像头按钮 */
    .camera-btn {
        padding: 6px 12px; /* 手机端按钮更小 */
        font-size: 12px; /* 手机端字体更小 */
        min-height: 36px; /* 手机端高度更小 */
    }
    
    /* 店主联系方式区域调整 - 取消删除contact-display的上边框，整体上移30px */
    .contact-display {
        flex: 0.07; /* 从0.08调整为0.07 */
        padding: 2px 15px; /* 从3px 15px调整为2px 15px */
        gap: 2px; /* 从3px减少到2px */
        min-height: 25px; /* 从30px减少到25px，缩短5px */
        transform: translateY(-10px); /* 从translateY(20px)调整为translateY(-10px)，整体上移30px */
    }
    
    /* 按钮容器 */
    .contact-buttons {
        gap: 6px;
    }
    
    /* 功能按钮样式 */
    .contact-btn {
        padding: 3px 12px; /* 从4px 12px调整为3px 12px */
        font-size: 11px;
        min-width: 80px;
    }
    
    /* 状态栏调整 - status-bar整体上移30px */
    .status-bar {
        flex: 0.04;
        font-size: 10px;
        padding: 1px 10px;
        gap: 8px;
        min-height: 12px;
        transform: translateY(-15px); /* 从translateY(15px)调整为translateY(-15px)，整体上移30px */
    }
    
    /* 手机端：聊天提示在按钮左侧，宽度由文字内容决定 */
    .chat-hint-container {
        top: 30px !important; /* 手机端适当下移 */
        right: 60px !important; /* 按钮左侧，留出按钮空间 */
        left: auto !important; /* 移除左侧定位 */
        max-width: none !important; /* 移除最大宽度限制 */
        width: fit-content !important; /* 宽度由文字内容决定 */
        min-width: 0; /* 允许容器缩小到内容最小宽度 */
    }
    
    /* 手机端提示文字 - 减小字体，防止换行 */
    .chat-hint-text {
        font-size: 11px;
        white-space: nowrap; /* 防止文字换行 */
    }
    
    /* 手机端：输入框占满宽度的70%并居中 */
    .chat-input-container {
        left: 50% !important;
        transform: translateX(-50%) !important;
        width: 70% !important; /* 强制宽度为70% */
        right: auto !important;
    }
    
    /* 手机端输入框容器 - 占满父容器宽度 */
    .chat-input-wrapper {
        width: 100% !important; /* 输入框宽度占满容器的70% */
    }
    
    /* 手机端文本输入框 - 调整高度和字体大小 */
    .chat-text-input {
        min-height: 50px;
        font-size: 13px;
        width: 100% !important; /* 确保输入框占满父容器 */
    }
    
    /* 手机端：消息框占满宽度 */
    .chat-messages-container {
        width: calc(100% - 20px) !important; /* 强制宽度 */
        left: 10px !important;
        right: 10px !important;
        bottom: 120px; /* 手机端调整位置 */
        max-height: 150px;
    }
    
    /* 手机端：调整按钮区域宽度 */
    .chat-input-buttons {
        width: 80px; /* 手机端按钮区域稍小 */
    }
    
    /* 手机端按钮 - 调整内边距和字体大小 */
    .chat-send-btn, .chat-cancel-btn {
        padding: 8px 12px;
        font-size: 12px;
    }
    
    /* 手机端聊天按钮 - 调整位置和大小 */
    .chat-toggle-btn {
        top: 35px !important; /* 手机端同步下移 */
        right: 10px;
        width: 35px;
        height: 35px;
        font-size: 16px;
    }
    
    /* 页脚内容调整 - 减小元素间距 */
    .footer-content {
        gap: 10px;
    }
}

/* 手机横屏布局 - 宽度小于768px且为横屏方向时应用 */
@media (max-width: 768px) and (orientation: landscape) {
    /* 横屏时消息框调整 - 减小最大高度 */
    .chat-messages-container {
        max-height: 120px;
        bottom: 100px;
    }
    
    /* 横屏时输入框调整 - 宽度调整为50% */
    .chat-input-container {
        width: 50% !important; /* 横屏时宽度50% */
    }
    
    /* 横屏时提示框调整 - 最大宽度调整为60% */
    .chat-hint-container {
        max-width: 60% !important; /* 横屏时提示框最大宽度60% */
    }
}

/* 小屏幕手机布局 - 宽度小于480px时应用 */
@media (max-width: 480px) {
    /* 视频区域进一步调整比例 */
    .video-area {
        flex: 0.6; /* 保持60%高度 */
    }
    
    /* 备注显示区域调整 */
    .note-display {
        flex: 0.1; /* 调整为0.1 */
        min-height: 30px; /* 从25px增加到30px，延长5px */
        margin-bottom: 10px; /* 与contact-display顶部保持10px间距 */
    }
    
    /* 备注文字在小屏幕手机确保居中 */
    .note-text {
        line-height: 1.5; /* 添加行高确保更好的垂直居中 */
    }
    
    /* 摄像头选择区域 */
    .camera-controls {
        padding: 5px 10px;
        margin-top: 2px;
    }
    
    /* 提示文字 */
    .camera-hint-text {
        font-size: 9px;
        padding: 1px 4px;
    }
    
    /* 摄像头选择器 */
    .camera-selector {
        gap: 5px;
    }
    
    /* 摄像头按钮 */
    .camera-btn {
        padding: 5px 10px;
        font-size: 11px;
        min-height: 34px;
    }
    
    /* 店主联系方式区域进一步调整 - 取消删除contact-display的上边框，整体上移30px */
    .contact-display {
        padding: 1px 10px; /* 从2px 10px调整为1px 10px */
        gap: 1px; /* 从2px减少到1px */
        min-height: 20px; /* 从25px减少到20px，缩短5px */
        transform: translateY(-10px); /* 从translateY(20px)调整为translateY(-10px)，整体上移30px */
    }
    
    /* 按钮容器 */
    .contact-buttons {
        gap: 4px;
    }
    
    /* 功能按钮样式 */
    .contact-btn {
        padding: 2px 10px; /* 从3px 10px调整为2px 10px */
        font-size: 10px;
        min-width: 70px;
    }
    
    .contact-btn i {
        font-size: 12px;
    }
    
    /* 状态栏进一步调整 - status-bar整体上移30px */
    .status-bar {
        font-size: 9px;
        padding: 1px 8px;
        gap: 6px;
        min-height: 10px;
        transform: translateY(-15px); /* 从translateY(15px)调整为translateY(-15px)，整体上移30px */
    }
    
    /* 提示框内边距调整 - 更紧凑 */
    .chat-hint-container {
        padding: 8px 12px;
    }
    
    /* 提示文字进一步减小字体 */
    .chat-hint-text {
        font-size: 10px;
    }
    
    /* 消息框进一步调整 - 减小最大高度和字体 */
    .chat-messages-container {
        max-height: 120px;
        font-size: 11px;
        padding: 6px 10px;
    }
    
    /* 消息项最大宽度调整 - 增大到95% */
    .chat-message-item {
        max-width: 95%;
    }
    
    /* 消息用户字体进一步减小 */
    .chat-message-user {
        font-size: 11px;
    }
    
    /* 消息文本字体进一步减小 */
    .chat-message-text {
        font-size: 11px;
    }
    
    /* 输入框容器内边距调整 - 更紧凑 */
    .chat-input-container {
        width: 70% !important;
        padding: 8px 10px;
    }
    
    /* 按钮区域宽度进一步减小 */
    .chat-input-buttons {
        width: 70px;
    }
    
    /* 文本输入框调整 - 减小内边距和字体 */
    .chat-text-input {
        padding: 8px 10px;
        min-height: 45px;
        font-size: 12px;
    }
    
    /* 按钮进一步调整 - 减小内边距和字体 */
    .chat-send-btn, .chat-cancel-btn {
        padding: 7px 10px;
        font-size: 11px;
    }
    
    /* 页脚内容进一步调整 - 减小间距 */
    .footer-content {
        gap: 8px;
    }
    
    /* 分隔符隐藏 - 小屏幕不显示竖线分隔符 */
    .footer-separator {
        display: none;
    }
    
    /* 设备和在线状态字体进一步减小 */
    .device-status, .online-status {
        font-size: 10px;
    }
    
    /* 头部右侧容器进一步调整 - 减小间距 */
    .header-right {
        gap: 8px;
    }
    
    /* 聊天按钮进一步调整 - 减小尺寸和字体 */
    .chat-toggle-btn {
        width: 30px;
        height: 30px;
        font-size: 14px;
    }
}

/* 超小屏幕手机布局 - 宽度小于320px时应用 */
@media (max-width: 320px) {
    /* 视频区域极致调整 */
    .video-area {
        flex: 0.6; /* 保持60%高度 */
    }
    
    /* 提示框极致紧凑 - 最小内边距 */
    .chat-hint-container {
        padding: 6px 10px;
    }
    
    /* 提示文字极致减小 */
    .chat-hint-text {
        font-size: 9px;
    }
    
    /* 消息框极致调整 - 最小高度和内边距 */
    .chat-messages-container {
        max-height: 100px;
        padding: 5px 8px;
    }
    
    /* 输入框容器极致紧凑 - 最小内边距 */
    .chat-input-container {
        padding: 6px 8px;
    }
    
    /* 文本输入框极致调整 - 最小高度和字体 */
    .chat-text-input {
        padding: 6px 8px;
        min-height: 40px;
        font-size: 11px;
    }
    
    /* 按钮区域极致减小 */
    .chat-input-buttons {
        width: 60px;
    }
    
    /* 按钮极致调整 - 最小内边距和字体 */
    .chat-send-btn, .chat-cancel-btn {
        padding: 6px 8px;
        font-size: 10px;
    }
    
    /* 页脚内容极致调整 - 最小间距 */
    .footer-content {
        gap: 5px;
    }
    
    /* 设备和在线状态极致减小 */
    .device-status, .online-status {
        font-size: 9px;
    }
    
    /* 摄像头选择区域极致调整 */
    .camera-controls {
        padding: 4px 8px;
        margin-top: 1px;
    }
    
    /* 提示文字 */
    .camera-hint-text {
        font-size: 8px;
        padding: 1px 3px;
    }
    
    /* 摄像头按钮 */
    .camera-btn {
        padding: 4px 8px;
        font-size: 10px;
        min-height: 30px;
    }
    
    /* 店主联系方式区域极致调整 - 取消删除contact-display的上边框，整体上移30px */
    .contact-display {
        padding: 1px 6px; /* 从3px 6px调整为1px 6px */
        gap: 1px; /* 从2px减少到1px */
        min-height: 15px; /* 从20px减少到15px，缩短5px */
        transform: translateY(-10px); /* 从translateY(20px)调整为translateY(-10px)，整体上移30px */
    }
    
    /* 按钮容器 */
    .contact-buttons {
        gap: 4px;
    }
    
    /* 功能按钮样式 */
    .contact-btn {
        padding: 1px 8px; /* 从3px 8px调整为1px 8px */
        font-size: 9px;
        min-width: 60px;
    }
    
    .contact-btn i {
        font-size: 10px;
    }
    
    /* 状态栏极致调整 - status-bar整体上移30px */
    .status-bar {
        font-size: 9px;
        gap: 5px;
        min-height: 8px;
        transform: translateY(-15px); /* 从translateY(15px)调整为translateY(-15px)，整体上移30px */
    }
}

/* 防止移动端键盘弹出时页面缩放 - iOS特定修复 */
.chat-text-input:focus {
    font-size: 16px !important; /* 防止iOS缩放 */
}

/* 强制隐藏消息容器直到激活 - 防止残留显示 */
.chat-messages-container[style*="display: none"] {
    opacity: 0 !important;
    visibility: hidden !important;
}

/* 确保消息容器激活时完全显示 - 透明度恢复 */
.chat-messages-container[style*="display: flex"] {
    opacity: 1 !important;
    visibility: visible !important;
}