/* StockX 滚动条修复 - 统一使用浏览器滚动条 */
/* 策略调整：移除侧边栏 Fixed 定位，改为 Flex 布局，避免移动端缩放导致的高度过高问题 */

/* 确保主容器为 Flex 布局，高度自适应 */
.app-container {
    display: flex !important;
    min-height: auto !important;
    height: auto !important;
    position: relative !important;
    overflow: visible !important;
}

/* 侧边栏：取消 Fixed，跟随文档流 */
.sidebar {
    position: static !important;
    /* 改为 static 以参与 Flex 布局 */
    width: var(--sidebar-width) !important;
    height: auto !important;
    min-height: 100vh;
    /* 保证至少占满一屏(PC端体验)，但在移动端缩放时可能会很长，不过比 fixed 到底部要好 */
    /* 如果用户非常介意空白，可以改为 min-height: auto，但会导致 PC 端背景截断。
       鉴于用户抱怨的是 "右侧下方有很大的一个空白面积"，这里的 min-height: 100vh 
       在移动端缩放时确实可能导致 2600px 高度。
       为了彻底解决用户的 "空白" 痛点，我们暂时尝试 min-height: auto，
       或者依靠 Flex Stretch 只要右侧有内容，左侧就会拉伸。
    */
    min-height: auto !important;
    flex-shrink: 0 !important;
    display: flex !important;
    flex-direction: column !important;
    overflow: visible !important;
    z-index: 100 !important;
    border-right: 1px solid var(--border-color-light) !important;
}

/* 主内容区域：移除 margin-left，因为现在是 Flex 左右排列 */
.main-content {
    flex: 1 !important;
    margin-left: 0 !important;
    min-height: auto !important;
    height: auto !important;
    width: 0 !important;
    /* 防止 Flex 子元素撑开容器 */
    display: flex !important;
    flex-direction: column !important;
    overflow: visible !important;
}

/* 内容区域使用浏览器滚动条 */
.content-area {
    padding: 12px 24px 24px !important;
    background: var(--bg-primary) !important;
    overflow: visible !important;
    height: auto !important;
    min-height: auto !important;
    max-height: none !important;
}

/* 页面内容不限制高度 */
.page-content {
    min-height: auto !important;
    max-height: none !important;
    height: auto !important;
    overflow: visible !important;
}

/* 表格容器只保留横向滚动 */
.table-container {
    overflow-x: auto !important;
    overflow-y: visible !important;
    border-top: 1px solid #e5e7eb;
    width: 100%;
}

/* 移除可能导致内部滚动的设置 */
.content-card {
    background: var(--bg-primary);
    border-radius: var(--border-radius-lg);
    box-shadow: none;
    border: none;
    max-height: none !important;
    height: auto !important;
    min-height: auto !important;
    overflow: visible !important;
}

/* 顶部栏也跟随页面滚动 */
.top-bar {
    height: var(--header-height);
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border-color-light);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    flex-shrink: 0;
    position: static !important;
}

/* 特别针对综合研判页面的聊天容器 */
#judgment-chat-container {
    overflow: visible !important;
    overflow-y: visible !important;
    height: auto !important;
    max-height: none !important;
}