/* PIGRAV_Release_Version/dimensions_analysis/basic_single_statistics/basic_single_statistics.css */

/* 新增：并列布局容器 */
.stats-layout-container {
    display: flex; /* 使用 Flexbox */
    gap: 40px; /* 修改：增大两个模块之间的间距 */
    align-items: flex-start; /* 顶部对齐 */
}

/* 修改：历史记录容器的宽度 */
.waterfall-container {
    max-height: 55vh; /* 保持历史记录的高度限制和滚动 */
    overflow-y: auto;
    overflow-x: auto;
    border: 3px solid #444;
    border-radius: 6px;
    /* 修改：移除 max-width 和 margin，使用 flex-basis 控制宽度 */
    /* max-width: 35%; */
    /* margin-left: 0; */
    /* margin-right: auto; */
    flex-basis: 40%; /* 历史记录占基础宽度的 40% */
    flex-shrink: 0; /* 不允许收缩 */
    margin-bottom: 0; /* 移除底部边距，由父容器控制 */
    display: grid;
    gap: 0;
    background-color: #333333;
    scrollbar-width: auto;
    scrollbar-color: #1e90ff #3a3a3a;
}

/* 保持滚动条样式 */
/* 新增：WebKit 滚动条样式 for waterfall */
.waterfall-container::-webkit-scrollbar {
    width: 20px;
    height: 20px;
}

.waterfall-container::-webkit-scrollbar-track {
    background: #3a3a3a;
    border-radius: 0px;
}

.waterfall-container::-webkit-scrollbar-thumb {
    background-color: #1e90ff;
    border-radius: 0 !important;
    border: 1px solid #3a3a3a !important;
    background-clip: content-box !important;
}

.waterfall-container::-webkit-scrollbar-thumb:hover {
    background-color: #46a3ff;
}

.waterfall-container::-webkit-scrollbar-corner {
    background: #2c2c2c;
}

/* 保持历史记录表格内部样式 */
/* 表头行样式 */
.draw-history-header {
    display: contents;
    font-weight: bold;
    position: sticky;
    top: 0;
    background-color: #3a3f47;
    z-index: 10;
}

/* 表头单元格样式 */
.header-cell {
    padding: 8px 4px;
    font-size: 13px;
    text-align: center;
    border-bottom: 1px solid #555;
    border-right: 1px solid #444;
    /* 修改：确保表头文字在深色背景上可见 */
    color: #fff;
    white-space: nowrap;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
}
.header-cell:last-child {
    border-right: none; /* 最后一列无右边框 */
}

/* 历史记录行样式 (原 waterfall-item) */
.waterfall-item {
    display: contents; /* 让其子元素参与外部 Grid 布局 */
}

/* 单元格样式 (通用) */
.draw-history-cell {
    padding: 6px 4px;
    text-align: center;
    border-bottom: 1px solid #4a4f57;
    border-right: 1px solid #444;
    /* 恢复：浅色文字 */
    color: #ccc;
    white-space: nowrap;
    align-self: center;
}

/* 最后一列单元格无右边框 */
.draw-history-cell:last-child {
    border-right: none;
}

/* 期号单元格特定样式 */
.draw-history-cell.draw-number {
    /* 恢复：较暗的浅色 */
    color: #aaa;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
    font-size: 14px;
}

/* 数字单元格特定样式 */
.draw-history-cell.number {
    /* 恢复：主要的浅色文字 */
    color: #e0e0e0;
    font-family: 'Courier New', Courier, monospace;
    font-size: 1.1em;
    font-weight: bold;
}

/* 新增：可编辑单元格样式 */
.editable-cell {
    min-height: 1.5em;
    cursor: text;
    font-family: 'Courier New', Courier, monospace;
    font-size: 1.1em;
    font-weight: bold;
    /* 恢复：空单元格的浅灰色 */
    color: #999;
    /* 修改：尝试增加垂直 padding */
    padding: 7px 4px;
    text-align: center;
    border-bottom: 1px solid #4a4f57;
    border-right: 1px solid #444;
    align-self: center;
    white-space: nowrap;
}

/* 最后一列可编辑单元格无右边框 */
.editable-cell:last-child {
    border-right: none;
}

/* --- 恢复：点击高亮样式 --- */
.highlight-0 { background-color: #f08080 !important; color: #000 !important; } /* LightCoral */
.highlight-1 { background-color: #add8e6 !important; color: #000 !important; } /* LightBlue */
.highlight-2 { background-color: #90ee90 !important; color: #000 !important; } /* LightGreen */
.highlight-3 { background-color: #ffd700 !important; color: #000 !important; } /* Gold */
.highlight-4 { background-color: #ffa07a !important; color: #000 !important; } /* LightSalmon */
.highlight-5 { background-color: #87cefa !important; color: #000 !important; } /* LightSkyBlue */
.highlight-6 { background-color: #f5deb3 !important; color: #000 !important; } /* Wheat */
.highlight-7 { background-color: #dda0dd !important; color: #000 !important; } /* Plum */
.highlight-8 { background-color: #7fffd4 !important; color: #000 !important; } /* Aquamarine */
.highlight-9 { background-color: #ffb6c1 !important; color: #000 !important; } /* LightPink */

/* 瀑布流加载更多提示 */
.waterfall-loader {
    grid-column: 1 / -1; /* 跨越所有列 */
    text-align: center;
    padding: 10px;
    color: #888;
    font-style: italic;
    font-size: 12px;
    border-bottom: none; /* 加载提示下方不需要边框 */
}

/* 错误消息样式 */
.error-message {
    text-align: center;
    padding: 15px;
    color: #f8d7da; /* 浅红色文字 */
    background-color: #721c24; /* 深红色背景 */
    border: 1px solid #f5c6cb;
    border-radius: 4px;
    margin: 10px 0;
}

/* 确保内容占位符是定位上下文 */
.standard-dimension-content-placeholder {
    position: relative;
}

/* --- 移除：旧的单位遗漏统计模块样式 --- */
/* 
.omission-stats-container { ... } 
.omission-table { ... } 
.omission-header { ... } 
.omission-header-cell { ... } 
.omission-row { ... } 
.omission-cell { ... } 
.omission-cell.digit-label { ... } 
.omission-cell.current-omission { ... } 
.omission-cell.max-omission { ... } 
.omission-loading-placeholder { ... } 
*/ 

/* --- 新增：单位遗漏表格样式 --- */

/* 新增：设置遗漏统计容器占据剩余空间 */
#single-omission-container {
    flex-grow: 1; /* 占据剩余的横向空间 */
    min-width: 0; /* 防止内容溢出时无限增大 */
    margin-top: -72px; /* 新增：向上移动 30px */
}

/* 新增：容器悬停时显示标题 (复用通用组件的逻辑) */
#single-omission-container:hover .odl-module-title {
    opacity: 1;
}

/* 新增：模块标题样式 (复用通用组件的样式) */
.odl-module-title {
    color: #cccccc; 
    margin-bottom: 10px; 
    text-align: center; /* 保持居中 */
    font-size: 1.6em; 
    font-weight: normal; 
    opacity: 0; /* 默认隐藏 */
    transition: opacity 0.3s ease-in-out;
}

/* 表格包裹容器 (复用通用组件的样式，确保存在) */
.odl-table-wrapper {
    max-width: 120%;
    overflow-x: auto;
    /* --- 修改：恢复垂直滚动并设置高度 --- */
    overflow-y: auto; 
    height: 55vh; /* 设置与左侧瀑布流相同的高度 */ 
    border-radius: 6px;
    border: 3px solid #444; /* 新增：添加与左侧瀑布流一致的边框 */
    /* --- Custom Scrollbar Styles (Targeting the wrapper) --- */
    scrollbar-width: auto; 
    scrollbar-color: #1e90ff #3a3a3a; 
}

.odl-table-wrapper::-webkit-scrollbar {
    width: 20px; 
    height: 20px; 
}

.odl-table-wrapper::-webkit-scrollbar-track {
    background: #3a3a3a; 
    border-radius: 0px; 
}

.odl-table-wrapper::-webkit-scrollbar-thumb {
    background-color: #1e90ff; 
    border-radius: 0 !important; 
    border: 1px solid #3a3a3a !important; 
    background-clip: content-box !important; 
}

.odl-table-wrapper::-webkit-scrollbar-thumb:hover {
    background-color: #46a3ff; 
}

.odl-table-wrapper::-webkit-scrollbar-corner {
    background: #2c2c2c; 
}

/* 单位遗漏表格本身 */
.single-omission-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 600px; /* 根据内容调整最小宽度 */
    font-size: 0.9em;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
}

/* 单位遗漏表格的表头和单元格通用样式 */
.single-omission-table th,
.single-omission-table td {
    padding: 7.35px 8px;
    text-align: center;
    border: 1px solid #444;
    white-space: nowrap;
}

/* 单位遗漏表格表头单元格 */
.single-omission-table th {
    background-color: #3a3a3a;
    color: #1e90ff;
    font-weight: bold;
    font-size: 1.1em;
}

/* 单位遗漏表格固定表头 */
.single-omission-table thead {
    position: sticky;
    top: 0;
    z-index: 2;
    background-color: #3a3a3a;
}

/* 单位遗漏表格固定表头第一列 */
.single-omission-table thead th:first-child {
    position: sticky;
    left: 0;
    z-index: 3;
    background-color: #333333; /* 修改：与左侧表格背景色统一 */
}

/* 单位遗漏表格表体行悬停效果 */
.single-omission-table tbody tr:hover {
    background-color: #454545;
    transition: background-color 0.2s ease;
}

/* 单位遗漏表格第一列：数字单元格 */
.single-omission-value-cell {
    background-color: #333333; /* 修改：与左侧表格背景色统一 */
    color: #ffffff;
    font-weight: bold;
    position: sticky;
    left: 0;
    z-index: 1;
}

/* 单位遗漏表格高亮单元格 */
.single-omission-highlight {
    background-color: #b33939; /* 暗红色 */
    color: #ffffff;
    font-weight: bold;
}

/* 新增：历史最大值文字颜色 */
.historical-max-value {
    color: #FF6347; /* 番茄红，或者您希望的其他红色 */
    /* 可选：如果需要稍微小一点 */
    /* font-size: 0.9em; */
}

/* 新增：当前遗漏最大值高亮单元格 */
.max-current-omission-highlight {
    background-color: #dc3545 !important; /* 更亮的红色，使用 !important 确保覆盖 */
    color: #ffffff !important;
}

/* 加载提示和无数据提示 (复用通用样式) */
.omission-loading-placeholder,
.odl-no-data {
    color: #aaaaaa;
    font-style: italic;
    padding: 20px;
    text-align: center;
}

/* --- 新增：横向遗漏统计布局和表格样式 --- */

/* 横向遗漏整体容器 */
#horizontal-omission-container {
    display: flex;
    flex-direction: column; /* 内部模块垂直排列 */
    gap: 10px; /* 修改：大幅减小默认垂直间距 */
    margin-top: 30px; /* 与上方模块的间距 (保持) */
    width: 100%; /* 占据父容器宽度 */
}

/* --- 新增：分拆模式表格的并列布局容器 --- */
.split-horizontal-layout-container {
    display: flex;
    flex-wrap: wrap;
    gap: 20px; /* 恢复表格之间的 gap */
    justify-content: flex-start;
    /* 移除：默认不设置上方间距 */
    /* margin-top: 50px; */ 
    /* 新增：为 margin-top 添加过渡 */
    transition: margin-top 0.4s ease;
}

/* 新增：当父容器悬停时，给分拆布局容器添加上边距 */
.divider-split-wrapper:hover .split-horizontal-layout-container {
    margin-top: 20px; /* 修改：减小悬停时的下方间距 */
}

/* 单个横向表格的包裹容器 */
.horizontal-omission-table-wrapper {
    /* 修改：移除 width，让 Flexbox 控制 */
    /* width: 97.5%; */ 
    border: 2px solid #555; /* 修改：稍微加粗边框 */
    border-radius: 4px;
    padding: 15px;
    background-color: #2e2e2e; /* 稍暗的背景 */
    /* white-space: nowrap; */ /* 移除：允许内部表格内容根据需要换行 */
    /* 新增：Flexbox 子项设置，每个占约 1/3 宽度，允许收缩 */
    flex: 1 1 calc(33.333% - 20px); /* 基础占 1/3，允许收缩，减去 gap */
    min-width: 280px; /* 修改：将最小宽度从 300px 减小到 280px */
    box-sizing: border-box; /* 包含 padding 和 border */
    /* overflow-x: auto; */ /* 根据用户反馈移除滚动条方案 */
}

/* --- 新增：包裹分割线和分拆表格的容器 --- */
.divider-split-wrapper {
    padding-top: 20px; /* 修改：增大上方固定间距，让分割线视觉下移 */
    /* 移除：下方间距由子元素控制 */
    /* padding-bottom: 50px; */ 
}

/* --- 修改：分拆模式分割线样式 --- */
.split-mode-divider {
    display: flex;
    align-items: center;
    text-align: center;
    color: #888;
    /* 修改：默认隐藏，margin 始终为 0 */
    opacity: 0;
    max-height: 0;
    margin-top: 0; /* 确保为 0 */
    margin-bottom: 0; /* 确保为 0 */
    overflow: hidden;
    width: 100%;
    /* 修改：确保只过渡 opacity 和 max-height */
    transition: opacity 0.4s ease, max-height 0.4s ease;
}

/* 修改：分割线可见时的样式 (只改变 opacity 和 max-height) */
.divider-split-wrapper:hover .split-mode-divider {
    opacity: 1;
    max-height: 100px; /* 恢复高度 */
    /* 移除：确认不设置 margin */
    /* margin-top: 80px; */
    /* margin-bottom: 25px; */
}

.split-mode-divider::before,
.split-mode-divider::after {
    content: '';            /* 必须设置 content */
    flex-grow: 1;           /* 占据剩余空间 */
    height: 3px;            /* 线条粗细 (保持) */
    background-color: #333; /* 线条颜色 (保持) */
    margin: 0 5px;         /* 线条与文字的间距 (保持) */
}

.split-mode-divider span {
    white-space: nowrap;    /* 防止文字换行 */
    font-weight: bold;      /* 文字加粗 */
    /* 修改：将文字颜色改为图示的蓝色 */
    color: #007bff; /* 示例：Bootstrap 默认蓝色，或更接近图片的 #1e90ff */
    font-size: 1.5em;       /* 保持再次增大文字 */
    padding: 0 10px;        /* 文字左右内边距 (可选) */
}

/* 横向表格子标题 */
.horizontal-omission-title {
    /* 修改：将颜色从蓝色改为更亮的灰色 */
    color: #cccccc; /* 例如浅灰色 */
    text-align: center;
    margin-bottom: 18px; /* 修改：减小标题和表格之间的垂直间距 */
    font-size: 1.2em;
    font-weight: bold;
}

/* 横向表格通用样式 */
.horizontal-omission-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95em;
}

/* 横向表格单元格和表头通用样式 */
.horizontal-omission-table th,
.horizontal-omission-table td {
    border: 1px solid #444;
    padding: 7px 4px; /* 修改：减小左右padding，为内容腾出空间 */
    text-align: center;
    white-space: normal; /* 新增：确保单元格内容可以换行 */
}

/* 横向表格表头 */
.horizontal-omission-table th {
    background-color: #404040; /* 修改：表头背景稍亮一点 */
    color: #ccc;
    font-weight: normal;
}

/* 横向表格数据单元格 */
.horizontal-omission-table td {
    background-color: #333;
    color: #e0e0e0;
}

/* 修改：移除类型列样式，添加新的行标签样式 */
.horizontal-omission-table td.type-label-cell {
    background-color: #383838; /* 类型列背景 */
    color: #1e90ff; /* 类型列文字颜色 */
    font-weight: bold;
    width: 45px; /* 修改：将宽度从 90px 减小到 45px */
    position: sticky;
    left: 0;
    z-index: 1; /* 数据单元格 z-index */
    /* 新增：垂直居中对齐合并后的单元格文本 */
    vertical-align: middle;
}

/* 新增：当前遗漏行的背景色 */
.horizontal-omission-table td.current-omission-rows-bg {
    background-color: #2a2a2a; /* 根据截图设置的深灰色 */
}

/* 当前横向遗漏最大值高亮 */
.max-current-horizontal-omission {
    /* 修改：将背景色改为绿色 */
    background-color: #28a745 !important; /* 绿色 */
    color: #fff !important; /* 文字改为白色以便在绿色背景上阅读 */
    font-weight: bold;
}

/* 修改：高亮类名，并调整样式 */
.overall-max-historical-horizontal {
    background-color: #dc3545 !important; /* 红色 */
    color: #fff !important;
    font-weight: bold;
}

/* 历史最大遗漏表格特定样式 (不再需要，因为结构统一了) */
/* 
.horizontal-omission-table-wrapper.historical-omission .horizontal-omission-table th:first-child,
.horizontal-omission-table-wrapper.historical-omission .horizontal-omission-table td:first-child {
    width: 40%; 
}

.horizontal-omission-table-wrapper.historical-omission .horizontal-omission-table th:last-child,
.horizontal-omission-table-wrapper.historical-omission .horizontal-omission-table td:last-child {
    width: 60%; 
}
*/

/* --- 新增：调整特定行的样式 --- */

/* 第一排（当前-数字）和 第三排（历史-数字）的数据单元格文字颜色 */
.horizontal-omission-table tbody tr:nth-child(1) td:not(.type-label-cell),
.horizontal-omission-table tbody tr:nth-child(3) td:not(.type-label-cell) {
    color: #1e90ff; /* 蓝色 */
    font-size: 1.15em; /* 字体放大 */
    font-weight: bold; /* 加粗 */
}

/* 第二排（当前-遗漏）和 第四排（历史-遗漏）的数据单元格字体放大加粗 */
.horizontal-omission-table tbody tr:nth-child(2) td:not(.type-label-cell),
.horizontal-omission-table tbody tr:nth-child(4) td:not(.type-label-cell) {
    /* 修改：进一步缩小字体 */
    font-size: 1.0em; /* 再次缩小字体 (原为 1.1em) */
    font-weight: normal; /* 保持移除加粗 */
    /* 注意：高亮样式可能会覆盖这里的颜色和加粗，这是预期的 */
}

/* --- 移除：不再需要历史 top10 表格的特定样式 --- */ 