/**
 * ============================================================
 *  bigscreen.css — 生产监控大屏样式
 *  [v2.11.0] 建合电子（监利）有限公司实时生产监控
 *  三等分布局重构：左(不良品) | 中(产量+流水) | 右(考勤+柱状图)
 * ============================================================
 */

/* ===== 页面底色与全屏框架 [v2.9.72] 黑湖深蓝渐变 ===== */
#dashboard {
    background: linear-gradient(135deg, #0a0f1e 0%, #050a15 100%);
    background-color: #0a0f1e;
    padding: 0;
    height: calc(100vh - 50px);
    overflow: hidden !important;
    color: #ffffff;
    position: relative;
}
/* 极淡网格纹理 [v2.9.72] 降低透明度更贴合黑湖 */
#dashboard::before {
    content: '';
    position: absolute; inset: 0;
    background-image:
        linear-gradient(rgba(42,98,181,0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(42,98,181,0.03) 1px, transparent 1px);
    background-size: 40px 40px;
    pointer-events: none; z-index: 0;
}
#dashboard > * { position: relative; z-index: 1; }

/* ===== 顶部标题栏 [v2.9.72] 黑湖风格简化 ===== */
.bs-header {
    text-align: center;
    padding: 10px 24px 8px;
    position: relative;
    background: linear-gradient(180deg, rgba(10,20,50,0.95) 0%, rgba(5,10,21,0.6) 100%);
    border-bottom: 1px solid rgba(42,98,181,0.3);
}
.bs-header::before { display: none; }
.bs-header::after { display: none; }
.bs-title {
    font-size: 18px;
    font-weight: 600;
    color: #ffffff;
    letter-spacing: 4px;
    font-family: 'Microsoft YaHei', -apple-system, sans-serif;
    margin: 0;
}
.bs-header-right {
    position: absolute;
    right: 24px; top: 50%;
    transform: translateY(-50%);
    display: flex; align-items: center; gap: 14px;
}
.bs-update-time { font-size: 12px; color: #9aa3b2; font-family: Consolas, Monaco, monospace; }
.bs-btn-fullscreen {
    background: rgba(42,98,181,0.15);
    border: 1px solid rgba(42,98,181,0.4);
    color: #9aa3b2; padding: 4px 14px;
    border-radius: 4px; font-size: 12px;
    cursor: pointer; transition: all 0.2s;
}
.bs-btn-fullscreen:hover { background: rgba(42,98,181,0.3); color: #ffffff; }

/* ===== [v2.11.0] 主体网格：三等分 1:1:1 ===== */
.bs-body {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    grid-template-rows: 55fr 45fr;
    gap: 8px;
    padding: 8px 10px;
    height: calc(100vh - 96px);
    overflow: hidden;
}
.bs-col-left   { grid-column: 1; grid-row: 1; display: flex; flex-direction: column; gap: 6px; min-height: 0; }
.bs-col-center { grid-column: 2; grid-row: 1; display: flex; flex-direction: column; gap: 6px; min-height: 0; }
.bs-col-right  { grid-column: 3; grid-row: 1; display: flex; flex-direction: column; gap: 6px; min-height: 0; }
.bs-col-bottom { grid-column: 1 / -1; grid-row: 2; min-height: 0; }

/* ===== 统一模块卡片 [v2.9.72] 黑湖半透明深蓝底+内发光阴影 ===== */
.bs-module {
    background: rgba(10,20,50,0.85);
    border: 1px solid rgba(42,98,181,0.4);
    border-radius: 6px;
    position: relative;
    overflow: hidden;
    display: flex; flex-direction: column;
    flex: 1; min-height: 0;
    box-shadow: inset 0 0 20px rgba(10,20,50,0.3), 0 0 15px rgba(42,98,181,0.08);
}
/* 四角切角装饰 [v2.9.72] 黑湖无此效果，移除 */
.bs-module::before, .bs-module::after { display: none; }
/* 标题栏 [v2.9.72] 黑湖深蓝渐变背景条 */
.bs-module-title-bar {
    position: relative;
    padding: 8px 16px;
    background: linear-gradient(90deg, #0a1e4d 0%, #051230 60%, transparent 100%);
    border-bottom: 1px solid rgba(42,98,181,0.3);
    flex-shrink: 0;
}
.bs-module-title-bar::before { display: none; }
.bs-module-title {
    font-size: 16px; font-weight: 600;
    color: #ffffff; letter-spacing: 2px;
    display: flex; align-items: center; gap: 8px;
}
.bs-module-title .bs-arrow-l { color: rgba(42,98,181,0.6); font-size: 10px; }
.bs-module-title .bs-arrow-r { color: rgba(42,98,181,0.6); font-size: 10px; margin-left: auto; }
.bs-module-body {
    padding: 8px 12px;
    flex: 1; overflow: hidden;
    display: flex; flex-direction: column;
    min-height: 0;
}
/* 统一滚动条：[v2.11.2] 隐藏滚动条 + 滚动事件隔离 + 触摸滚动支持 */
.bs-scroll-y {
    overflow-y: auto;
    scrollbar-width: none;
    overscroll-behavior: contain;
    touch-action: pan-y;
}
.bs-scroll-y::-webkit-scrollbar { display: none; }

/* ===== 模块：今日总产量 [v2.11.1] 自适应布局+常规字体 ===== */
.bs-output-hero { text-align: center; padding: clamp(4px, 1.5vh, 8px) 0 2px; flex-shrink: 0; }
.bs-output-label { font-size: clamp(10px, 1.2vh, 12px); color: #9aa3b2; margin-bottom: 2px; letter-spacing: 1px; }
.bs-output-value {
    font-size: clamp(32px, 5vh, 64px); font-weight: 700;
    color: #00e5ff; line-height: 1;
    font-family: -apple-system, 'Segoe UI', 'Microsoft YaHei', sans-serif;
}
.bs-output-unit { font-size: clamp(12px, 1.4vh, 16px); color: #9aa3b2; margin-left: 4px; font-weight: 400; }
.bs-mini-cards {
    display: grid; grid-template-columns: repeat(4, 1fr);
    gap: clamp(3px, 0.6vh, 6px); margin-top: clamp(3px, 0.6vh, 6px); flex-shrink: 0;
}
.bs-mini-card {
    background: rgba(10,20,50,0.85);
    border: 1px solid rgba(42,98,181,0.35);
    border-radius: 6px; padding: clamp(4px, 0.8vh, 8px) clamp(2px, 0.4vw, 4px);
    text-align: center;
    position: relative;
    transition: border-color 0.2s;
}
.bs-mini-card:hover { border-color: rgba(42,98,181,0.6); }
.bs-mini-card .bs-mc-label { font-size: clamp(9px, 1.1vh, 12px); color: #9aa3b2; margin-bottom: clamp(2px, 0.3vh, 4px); }
.bs-mini-card .bs-mc-value {
    font-size: clamp(16px, 2.5vh, 28px); font-weight: 700;
    color: #ffffff;
    font-family: -apple-system, 'Segoe UI', 'Microsoft YaHei', sans-serif;
}
.bs-mini-card .bs-mc-value.bs-red { color: #ef5350; }

/* 实时报工流水 [v2.9.73] 确保最小高度+自动滚动 */
.bs-stream-section { flex: 1; min-height: 80px; display: flex; flex-direction: column; overflow: hidden; }
.bs-stream-wrap {
    flex: 1; overflow: hidden; position: relative; min-height: 0;
}
.bs-stream-scroll {
    height: 100%; overflow-y: auto;
    scrollbar-width: none;
    overscroll-behavior: contain;
    touch-action: pan-y;
}
.bs-stream-scroll::-webkit-scrollbar { display: none; }

/* ===== 考勤异常明细列表 [v2.11.0] 独立全宽列表 ===== */
.bs-attend-detail-table {
    width: 100%; border-collapse: collapse;
    table-layout: fixed; font-size: 13px;
}
.bs-attend-detail-table thead th {
    position: sticky; top: 0; z-index: 2;
    background: rgba(10,20,50,0.98);
    color: #ffffff; font-weight: 600;
    padding: 6px 6px; text-align: left;
    border-bottom: 1px solid rgba(42,98,181,0.3);
    white-space: nowrap; font-size: 13px;
    letter-spacing: 0.5px;
}
.bs-attend-detail-table tbody td {
    padding: 5px 6px; color: #ffffff;
    border-bottom: 1px solid rgba(42,98,181,0.08);
    white-space: nowrap; overflow: hidden;
    text-overflow: ellipsis; font-size: 13px;
}
.bs-attend-detail-table tbody tr:nth-child(odd) { background: rgba(10,30,77,0.3); }
.bs-attend-detail-table tbody tr:nth-child(even) { background: rgba(5,18,48,0.15); }
.bs-attend-detail-table tbody tr:hover { background: rgba(42,98,181,0.15); }
/* [v2.9.72] 异常类型颜色 - 黑湖标准色 */
.bs-at-late { color: #ffa726; font-weight: 600; }
.bs-at-absent { color: #ef5350; font-weight: 600; }
.bs-at-early { color: #ffd54f; font-weight: 600; }
.bs-at-leave { color: #42a5f5; font-weight: 600; }
/* 明细滚动容器 [v2.9.70] 隐藏滚动条 */
.bs-attend-scroll {
    flex: 1; overflow-y: auto; min-height: 0;
    scrollbar-width: none;
    overscroll-behavior: contain;
    touch-action: pan-y;
}
.bs-attend-scroll::-webkit-scrollbar { display: none; }

/* ===== 考勤状态横向柱状图 [v2.11.1] ===== */
.bs-attend-bar-section { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.bs-bar-chart-wrap {
    flex: 1; min-height: 0;
    display: flex; flex-direction: column; justify-content: center;
    gap: clamp(4px, 0.8vh, 8px);
    padding: 4px 8px;
}
/* 每一行：标签 + 柱条 + 数值 */
.bs-bar-row {
    display: flex; align-items: center; gap: 8px;
}
.bs-bar-row-label {
    width: 36px; flex-shrink: 0;
    font-size: clamp(10px, 1.1vh, 12px); color: #9aa3b2;
    text-align: right; letter-spacing: 0.5px;
}
.bs-bar-track {
    flex: 1; height: clamp(14px, 1.8vh, 22px);
    background: rgba(42,98,181,0.1);
    border-radius: 3px; overflow: hidden;
}
.bs-bar-fill-h {
    height: 100%; border-radius: 3px;
    transition: width 0.6s ease;
    box-shadow: 0 0 6px rgba(42,98,181,0.12);
}
.bs-bar-row-count {
    width: 32px; flex-shrink: 0;
    font-size: clamp(11px, 1.2vh, 13px); font-weight: 700;
    color: #ffffff; text-align: left;
    font-family: -apple-system, 'Segoe UI', 'Microsoft YaHei', sans-serif;
}
.bs-bar-legend {
    flex-shrink: 0;
    display: flex; justify-content: center; gap: 14px; flex-wrap: wrap;
    padding: 6px 0 2px;
    border-top: 1px solid rgba(42,98,181,0.12);
}
.bs-bar-legend-item {
    display: flex; align-items: center; gap: 5px;
    font-size: 11px; color: #9aa3b2;
}
.bs-bar-legend-dot {
    width: 10px; height: 10px; border-radius: 2px; flex-shrink: 0;
}
.bs-bar-legend-count {
    color: #ffffff; font-weight: 600;
    font-family: -apple-system, 'Segoe UI', 'Microsoft YaHei', sans-serif;
}

/* 不良品实时明细滚动容器 */
.bs-defect-detail-section { flex: 1; display: flex; flex-direction: column; min-height: 0; overflow: hidden; }
.bs-defect-scroll {
    flex: 1; overflow-y: auto; min-height: 0;
    scrollbar-width: none;
    overscroll-behavior: contain;
    touch-action: pan-y;
}
.bs-defect-scroll::-webkit-scrollbar { display: none; }
/* 不良数量列红色高亮 */
#bs-defect-body td.bs-defect-qty { color: #ef5350; font-weight: 600; font-family: -apple-system, 'Segoe UI', 'Microsoft YaHei', sans-serif; }
/* [v2.11.1] 产品料号列取消截断，完整显示 */
#bs-defect-table tbody td:first-child {
    white-space: normal; overflow: visible; text-overflow: unset;
    word-break: break-all;
}

/* 不良品Top不良项统计 */
.bs-defect-top-items {
    flex-shrink: 0;
    display: flex; flex-wrap: wrap; gap: 4px;
    padding-top: 6px; margin-top: 4px;
    border-top: 1px solid rgba(42,98,181,0.15);
}
.bs-defect-top-item {
    display: inline-flex; align-items: center; gap: 4px;
    background: rgba(10,20,50,0.6);
    border: 1px solid rgba(42,98,181,0.2);
    border-radius: 3px; padding: 2px 8px;
    font-size: 11px; color: #9aa3b2;
}
.bs-defect-top-item .bs-dti-name { color: #ffffff; }
.bs-defect-top-item .bs-dti-count {
    color: #ef5350; font-weight: 600;
    font-family: 'JetBrains Mono', Consolas, Monaco, monospace;
}

/* 不良品折线图 */
.bs-defect-section { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.bs-line-chart-wrap { flex: 1; min-height: 0; position: relative; }
.bs-line-chart-wrap canvas { width: 100% !important; height: 100% !important; }

/* ===== 工单概览 [v2.9.77] 布局修复+列宽精准分配 ===== */
.bs-order-section { height: 100%; display: flex; flex-direction: column; overflow: hidden; }
.bs-order-table-wrap {
    flex: 1; overflow-y: auto; min-height: 0;
    scrollbar-width: none;
    overscroll-behavior: contain;
    touch-action: pan-y;
}
.bs-order-table-wrap::-webkit-scrollbar { display: none; }

.bs-order-table {
    width: 100%; border-collapse: collapse;
    table-layout: fixed; font-size: 13px;
}
.bs-order-table thead th {
    position: sticky; top: 0; z-index: 2;
    background: rgba(10,20,50,0.98);
    color: #ffffff; font-weight: 600;
    padding: 0 6px; text-align: left;
    border-bottom: 1px solid rgba(42,98,181,0.3);
    white-space: nowrap; font-size: 13px;
    height: 36px; line-height: 36px;
    overflow: hidden; text-overflow: ellipsis;
    letter-spacing: 0.5px;
}
.bs-order-table tbody td {
    padding: 4px 6px; color: #ffffff;
    border-bottom: 1px solid rgba(42,98,181,0.08);
    white-space: nowrap; overflow: hidden;
    text-overflow: ellipsis;
    height: 80px; vertical-align: middle;
}
/* [v2.9.84] 生产进度列(第3列)：允许环形节点完整显示 */
.bs-order-table tbody td:nth-child(3) {
    white-space: normal; overflow: visible;
    text-overflow: unset; padding: 2px;
}
/* [v2.9.77] 数值列右对齐+等宽字体 */
.bs-order-table th.bs-td-right,
.bs-order-table td.bs-td-right {
    text-align: right; padding-right: 10px;
    font-family: 'JetBrains Mono', Consolas, Monaco, monospace;
}
/* [v2.9.77] 状态列居中 */
.bs-order-table th.bs-td-center,
.bs-order-table td.bs-td-center {
    text-align: center; padding: 0;
}
.bs-order-table tbody tr:nth-child(odd) { background: rgba(10,30,77,0.3); }
.bs-order-table tbody tr:nth-child(even) { background: rgba(5,18,48,0.15); }
.bs-order-table tbody tr:hover { background: rgba(42,98,181,0.15); }

/* [v2.9.74] 状态标签 - 黑湖精确参数：1px边框+透明底+3px圆角 */
.bs-status-tag {
    display: inline-block; padding: 2px 8px;
    border-radius: 3px; font-size: 12px; font-weight: 400;
}
.bs-status-tag.bs-active { 
    background: transparent; color: #00c853; 
    border: 1px solid #00c853; 
}
.bs-status-tag.bs-pending { 
    background: transparent; color: #ffa726; 
    border: 1px solid #ffa726; 
}
.bs-status-tag.bs-done { 
    background: transparent; color: #0091ea; 
    border: 1px solid #0091ea; 
}

/* [v2.9.84] 工艺路线环形进度节点 - 48px环形+80px单元+黑湖风格 */
.bs-process-nodes {
    display: flex; align-items: flex-start;
    overflow-x: auto; overflow-y: hidden;
    max-width: 100%;
    padding: 6px 8px 4px;
    scrollbar-width: thin;
    scrollbar-color: rgba(42,98,181,0.35) transparent;
}
.bs-process-nodes::-webkit-scrollbar {
    height: 4px; display: block;
}
.bs-process-nodes::-webkit-scrollbar-track {
    background: transparent;
}
.bs-process-nodes::-webkit-scrollbar-thumb {
    background: rgba(42,98,181,0.35); border-radius: 2px;
}
.bs-process-nodes::-webkit-scrollbar-thumb:hover {
    background: rgba(42,98,181,0.6);
}
/* [v2.9.84] 每个工序单元固定80px：上方48px环形 + 下方工序名 */
.bs-pnode {
    display: flex; flex-direction: column;
    align-items: center; flex-shrink: 0;
    width: 80px; position: relative;
    padding-top: 2px;
}
/* [v2.11.1] 工序连接线：独立元素，固定宽度+两端留白 */
.bs-pnode-line {
    width: 12px; flex-shrink: 0;
    height: 1px;
    background: rgba(255,255,255,0.2);
    align-self: flex-start;
    margin-top: 26px; /* 与圆环中线对齐 */
    margin-left: 4px;
    margin-right: 4px;
}
.bs-pnode-line.bs-line-done {
    background: #00D8FF;
    opacity: 0.5;
}
/* [v2.9.84] 环形进度条外圈：48px直径，conic-gradient按百分填充 */
.bs-pnode-ring {
    width: 48px; height: 48px;
    border-radius: 50%;
    background: conic-gradient(#00D8FF 0deg, rgba(255,255,255,0.12) 0deg);
    display: flex; align-items: center; justify-content: center;
    position: relative; flex-shrink: 0;
    z-index: 1;
}
/* [v2.9.84] 环形内圈遮罩：40px直径，挖空形成4px环宽 */
.bs-pnode-ring::after {
    content: '';
    position: absolute;
    width: 40px; height: 40px;
    border-radius: 50%;
    background: rgba(8,16,38,0.95);
}
/* [v2.9.84] 环内百分比数字：20px白色加粗，居中 */
.bs-pnode-pct {
    position: relative; z-index: 1;
    font-size: 20px; font-weight: 700;
    color: #ffffff;
    line-height: 1;
}
/* [v2.9.84] 超产状态：环形仍蓝，数字红色高亮 */
.bs-pnode-pct.bs-over {
    color: #FF4D4F;
}
/* [v2.9.84] 工序名称：14px白色，单行省略 */
.bs-pnode-name {
    font-size: 14px; color: #ffffff; font-weight: 400;
    margin-top: 8px; max-width: 76px;
    overflow: hidden; text-overflow: ellipsis;
    white-space: nowrap; text-align: center;
    line-height: 1.2;
}

/* ===== 通用表格样式 [v2.9.72] 表头纯白+行高36px ===== */
.bs-table {
    width: 100%; border-collapse: collapse;
    table-layout: fixed; font-size: 13px;
}
.bs-table thead th {
    background: rgba(10,20,50,0.98);
    color: #ffffff; font-weight: 600;
    padding: 8px 10px; text-align: left;
    border-bottom: 1px solid rgba(42,98,181,0.3);
    white-space: nowrap; font-size: 13px;
    position: sticky; top: 0; z-index: 1;
    letter-spacing: 0.5px;
}
.bs-table tbody td {
    padding: 8px 10px; color: #ffffff;
    border-bottom: 1px solid rgba(42,98,181,0.08);
    white-space: nowrap; overflow: hidden;
    text-overflow: ellipsis;
}
.bs-table tbody tr:nth-child(odd) { background: rgba(10,30,77,0.3); }
.bs-table tbody tr:nth-child(even) { background: rgba(5,18,48,0.15); }
.bs-table tbody tr:hover { background: rgba(42,98,181,0.15); }

/* 状态标签 [v2.9.72] 黑湖标准绿底 */
.bs-approval-tag {
    display: inline-block; padding: 3px 10px;
    border-radius: 4px; font-size: 12px; font-weight: 600;
}
.bs-approval-tag.bs-ok { background: #00c853; color: #ffffff; }
.bs-approval-tag.bs-wait { background: #ffa726; color: #ffffff; }

/* ===== 动效 ===== */
@keyframes bsFadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
.bs-module { animation: bsFadeIn 0.6s ease forwards; }
.bs-col-left .bs-module:nth-child(1) { animation-delay: 0.1s; }
.bs-col-left .bs-module:nth-child(2) { animation-delay: 0.15s; }
.bs-col-center .bs-module:nth-child(1) { animation-delay: 0.2s; }
.bs-col-center .bs-module:nth-child(2) { animation-delay: 0.22s; }
.bs-col-right .bs-module:nth-child(1) { animation-delay: 0.25s; }
.bs-col-right .bs-module:nth-child(2) { animation-delay: 0.3s; }
.bs-col-bottom .bs-module { animation-delay: 0.35s; }

/* ===== 空数据提示 ===== */
.bs-empty {
    text-align: center; color: #5a7098;
    font-size: 14px; padding: 20px 0;
}
