/* 
 * 移动端响应式修复
 * 使用触摸设备检测而非单纯基于屏幕宽度
 * 避免移动端横屏时误切换到PC端
 */

/* 替换原有的移动端响应式查询 */
/* 使用 (hover: none) and (pointer: coarse) 来检测触摸设备 */

@media (hover: none) and (pointer: coarse) {
    /* 1. 侧边栏抽屉效果 */
    .sidebar {
        position: fixed !important;
        top: 0; left: 0; bottom: 0;
        width: 280px !important;
        max-width: 85vw !important;
        transform: translateX(-100%) !important;
        transition: transform 0.3s ease-in-out !important;
        box-shadow: 2px 0 15px rgba(0,0,0,0.5) !important;
    }
    .sidebar.open { transform: translateX(0) !important; }
    .mobile-menu-btn { display: flex !important; }
    
    /* 2. 聊天头部左移 */
    .chat-header-left { padding-left: 40px; }
    
    /* 3. 移动端标题自动换行 */
    #chatTitle,
    .chat-header-left h2 {
        white-space: normal !important;
        overflow: visible !important;
        text-overflow: clip !important;
        word-wrap: break-word !important;
        line-height: 1.4 !important;
    }
    
    .chat-header-left {
        align-items: flex-start !important;
        min-width: 0 !important;
    }
    
    /* 4. 隐藏"摘要模型"选择器 */
    .model-selector:has(#compressModelSelect) {
        display: none !important;
    }
}

@media (hover: none) and (pointer: coarse) {
    /* 隐藏历史条数栏和自动压缩栏 */
    .history-bar,
    .compress-bar {
        display: none !important;
    }
}
