/* V4版工业风深蓝灰背景 */
body {
    height: 100vh !important;
    overflow: hidden !important; /* 禁止body滚动，让内部容器独立滚动 */
}

/* Override Bootstrap's default dark navbar to make it transparent */
.navbar.bg-dark {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    height: 50px !important;
    min-height: 50px !important;
    z-index: 1050; /* 提升z-index以确保在最顶层 */
}

/* 工业风格网格背景纹理 */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: 20px 20px;
    pointer-events: none;
    z-index: -1;
}

/* 主要卡片容器深色背景优化 */
.card {
    box-shadow: 0 6px 12px rgba(0,0,0,0.4) !important;
}

/* --- NEW TITLE & DATETIME STYLES --- */
.display-super {
    font-size: 2.75rem !important; /* Increased by 25% from 2.2rem */
}

.dashboard-title {
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.7) !important;
    font-weight: 700 !important;
}

.dashboard-datetime {
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.7) !important;
    font-size: 1.1rem; /* Slightly increased for balance */
    font-weight: 500;
}
/* --- END NEW STYLES --- */

/* 标题文字在深色背景上的优化 */
h1, h2, h4, h5, h6 {
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3) !important;
}

/* 看板标题深色主题 */
.navbar-brand {
    color: rgba(255,255,255,0.95) !important;
}

/* Theme Switcher Button */
#theme-switcher {
    color: rgba(255, 255, 255, 0.6) !important;
    transition: color 0.2s ease-in-out !important;
    font-size: 1.1rem;
}
#theme-switcher:hover {
    color: #ffffff !important;
}

/* 页面切换样式 - 卡片式设计 */
.page-content {
    display: none;
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
}

.page-content.active {
    display: block;
    opacity: 1;
}

/* 页面切换卡片样式 */
.page-switch-card, .nav-pills .nav-link {
    cursor: pointer !important;
    transition: all 0.3s ease !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    border-radius: 12px !important; /* 与右侧统计按钮圆角一致 */
    border: none !important; /* 移除边框 */
    padding: 0.5rem 1rem !important; /* 标准选项卡内边距 */
    font-size: 1rem !important; /* 标准选项卡字体大小 */
}

/* 统一激活状态的样式 */
.page-switch-card.active, .nav-pills .nav-link.active {
    background-color: #2c3e50 !important;
    border-color: #0097e6 !important;
    color: white !important;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3), 0 1px 3px rgba(0, 0, 0, 0.2) !important;
}

/* 未激活状态的样式 */
.nav-pills .nav-link:not(.active) {
    background-color: rgba(108, 117, 125, 0.5) !important;
    color: rgba(255,255,255,0.7) !important;
}
.nav-pills .nav-link:not(.active):hover {
    background-color: rgba(134, 142, 150, 0.6) !important;
}

.page-switch-card .page-icon, .nav-pills .nav-link .fas {
    font-size: 1.1rem !important; /* 调整图标大小 */
    margin-right: 0.5rem !important; /* 图标和文字间距 */
}

/* Unified blue border effect for active page switch buttons */
.page-switch-card.active {
    border: 2px solid #00BFFF !important;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3), 0 1px 3px rgba(0, 0, 0, 0.2) !important;
}

/* --- UNIFIED 3D SHADOW EFFECT for non-active status cards --- */
.status-stat-card, .page-switch-card {
    border-radius: 12px !important;
    cursor: pointer !important;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3), 0 1px 3px rgba(0, 0, 0, 0.2) !important;
    height: 52px !important; /* 统一新高度 */
    transition: all 0.3s ease !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

/* 统计按钮的特定样式 */
.status-stat-card {
    width: 84px !important; /* 新宽度，再缩小约8% */
}

/* 切换按钮的特定样式 */
.page-switch-card {
    width: 84px !important; /* 与统计按钮宽度一致 */
    padding: 0 !important; /* 移除内边距以统一尺寸 */
}

.page-switch-card.active {
    background-color: #2c3e50 !important;
    color: white !important;
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.4) !important;
    transform: translateY(-2px);
}

.page-switch-card:not(.active) {
    background-color: rgba(108, 117, 125, 0.5) !important;
    color: rgba(255,255,255,0.7) !important;
}

.page-switch-card:not(.active):hover {
    background-color: rgba(134, 142, 150, 0.6) !important;
}

.page-switch-card .btn-icon {
    font-size: 1.5rem !important;
}

.page-switch-card .btn-label {
    display: inline !important; /* 默认显示文字 */
    font-size: 1rem;
}

/* --- REVISED CONTROLS CONTAINER STYLES --- */
#top-controls-container {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap; /* 默认横排，不换行 */
    justify-content: space-between; /* 两端对齐 */
    align-items: center;
    padding-bottom: 0.5rem; /* 恢复原有的padding */
}

#page-container {
    margin-top: 0; /* 恢复 margin-top */
}

#view-switcher-container {
    display: flex;
    flex-direction: row; /* 改为横向排列 */
    flex-shrink: 0;
    gap: 8px;
}

#stats-buttons-container {
    display: grid;
    gap: 8px;
    grid-template-columns: repeat(6, 84px); /* 默认6列，适应横排 */
    justify-content: center; /* 居中对齐 */
}

/* 在小屏幕上，改为垂直堆叠并居中 */
@media (max-width: 800px) {
    #top-controls-container {
        flex-wrap: wrap; /* 允许换行 */
        justify-content: center; /* 居中对齐 */
        gap: 1.5rem; /* 添加间距 */
    }

    #view-switcher-container {
        flex-direction: column; /* 在小屏幕上垂直排列 */
    }

    #stats-buttons-container {
        grid-template-columns: repeat(3, 84px); /* 在小屏幕上改为3列 */
        justify-content: center; /* 确保居中 */
    }

    /* 同时调整切换按钮本身的外观 */
    .page-switch-card {
        width: 52px !important; /* 缩小为与新高度一致的正方形 */
        padding: 0 !important;
    }

    .page-switch-card .btn-label {
        display: none !important; /* 隐藏文字 */
    }
}

/* 更小屏幕的优化 */
@media (max-width: 600px) {
    #stats-buttons-container {
        grid-template-columns: repeat(2, 84px); /* 在更小屏幕上改为2列 */
        gap: 6px; /* 减少间距 */
    }
    
    .status-stat-card {
        width: 80px !important; /* 稍微缩小宽度 */
    }
}
/* --- END REVISED CONTROLS CONTAINER STYLES --- */

/* 响应式设计：小屏幕下的样式 */
@media (max-width: 767.98px) {
    #top-controls-wrapper .d-flex {
        justify-content: center !important; /* 在小屏幕上，两行按钮都居中 */
    }

    .page-switch-card {
        width: 52px !important; /* 缩小为与新高度一致的正方形 */
        padding: 0 !important;
    }

    .page-switch-card .btn-label {
        display: none !important; /* 隐藏文字 */
    }
}

/* 修复响应式菜单的层级和宽度问题 */
@media (max-width: 991.98px) {
    #navbarNav.collapsing,
    #navbarNav.show {
        position: absolute;
        top: 50px; /* 定位在导航栏下方 */
        right: 10px; /* 距离右侧有一定边距 */
        width: auto; /* 宽度自适应内容 */
        min-width: 250px; /* 保证最小宽度 */
        background-color: #2c3e50 !important;
        padding: 1rem;
        border-radius: 0.5rem;
        box-shadow: 0 8px 16px rgba(0,0,0,0.3);
        z-index: 1100; /* 确保在最顶层 */
    }
}

/* --- NEW CARD GRID LAYOUT --- */
#card-grid-container {
    display: grid;
    gap: 0.75rem; /* 调整列间距 */
    padding: 0.25rem 0; /* 减小内边距 */
    
    /* Default: 1 column for very narrow screens */
    grid-template-columns: repeat(1, 1fr);
}

/* 2 columns for most phones */
@media (min-width: 370px) {
    #card-grid-container {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* 3 columns for large phones and small tablets */
@media (min-width: 768px) {
    #card-grid-container {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* 4 columns for tablets and foldable screens */
@media (min-width: 992px) {
    #card-grid-container {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* 6 columns for desktops */
@media (min-width: 1400px) {
    #card-grid-container {
        grid-template-columns: repeat(6, 1fr);
    }
}
/* --- END CARD GRID LAYOUT --- */

/* 确保统计按钮内的文字始终横向排列 */
.status-stat-card .card-body {
    padding: 0 0.25rem !important; /* 减少水平内边距以腾出空间 */
    white-space: nowrap;          /* 强制不换行 */
    overflow: hidden;             /* 隐藏溢出的内容 */
    text-overflow: ellipsis;      /* 对溢出的文本显示省略号 */
    display: flex !important;     /* 确保flex布局 */
    align-items: center !important; /* 垂直居中 */
    justify-content: center !important; /* 水平居中 */
    min-width: 0;                 /* 允许flex项目收缩 */
}

/* 统计按钮内的标签和数字样式优化 */
.status-stat-card .stat-label-large {
    font-size: 0.85rem !important; /* 稍微减小字体 */
    margin-right: 0.25rem !important; /* 减少右边距 */
    flex-shrink: 0;               /* 防止标签被压缩 */
}

.status-stat-card .stat-number-large {
    font-size: 1.1rem !important; /* 数字字体稍大 */
    font-weight: 900 !important;  /* 黑体 */
    flex-shrink: 0;               /* 防止数字被压缩 */
}

/* 卡片标题栏紧凑样式 */
.card-header {
    padding: 0.18rem 0.75rem !important; /* 减少卡片标题栏的上下内边距 */
    font-size: 0.85rem !important; /* 进一步减小字体大小 */
    min-height: 1.8rem !important; /* 固定最小高度（减少10%） */
    max-height: 1.8rem !important; /* 固定最大高度（减少10%） */
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
}

.card-header h5 {
    font-size: 0.85rem !important; /* 进一步减小标题字体大小 */
    margin-bottom: 0 !important;
    line-height: 1.2 !important; /* 设置更紧凑的行高 */
    height: 0.9rem !important; /* 固定高度（减少10%） */
    overflow: hidden !important; /* 防止文字溢出 */
    white-space: nowrap !important; /* 防止换行 */
    text-overflow: ellipsis !important; /* 超出部分显示省略号 */
}

.card-header .badge {
    font-size: 0.85rem !important; /* 与卡片标题栏h5字体大小一致 */
    padding: 0.15em 0.4em !important; /* 调整内边距以适应字体大小 */
    height: 1.2rem !important; /* 固定高度 */
    line-height: 1.2rem !important; /* 固定行高 */
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

/* 通用徽章样式 - 确保所有主题一致 */
.card-header.status-header .badge {
    font-size: 0.85rem !important; /* 与卡片标题栏h5字体大小一致 */
    padding: 0.15em 0.4em !important; /* 调整内边距以适应字体大小 */
    border-radius: 4px !important; /* 统一圆角 */
}

/* 设备名字体样式 */
.card-title {
    font-size: 1.1rem !important;
    font-weight: 600 !important;
    line-height: 1.3 !important;
    margin-bottom: 0.75rem !important;
    color: rgba(255, 255, 255, 0.95) !important;
}

/* 通用页面切换卡片样式 - 确保所有主题一致 */
.page-switch-card {
    background-color: rgba(108, 117, 125, 0.5) !important;
    border-color: rgba(108, 117, 125, 0.6) !important;
    color: rgba(255,255,255,0.7) !important;
}
.page-switch-card:hover {
    background-color: rgba(134, 142, 150, 0.6) !important;
    border-color: rgba(134, 142, 150, 0.7) !important;
}
.page-switch-card.active {
    background-color: #2c3e50 !important;
    border-color: #0097e6 !important;
    color: white !important;
}

/* 状态统计卡片颜色与辉光 */
.status-stat-card.status-在产 { background-color: #28a745 !important; border-color: #1e7e34 !important; color: #ffffff !important; }
.status-stat-card.status-换产 { background-color: #ffc107 !important; border-color: #e0a800 !important; color: #ffffff !important; }
.status-stat-card.status-空闲 { background-color: #fd7e14 !important; border-color: #dc6414 !important; color: #ffffff !important; }
.status-stat-card.status-待修 { background-color: #dc3545 !important; border-color: #c82333 !important; color: #ffffff !important; }
.status-stat-card.status-在修 { background-color: #17a2b8 !important; border-color: #117a8b !important; color: #ffffff !important; }
.status-stat-card.status-待料 { background-color: #ffc107 !important; border-color: #e0a800 !important; color: #ffffff !important; }
.status-stat-card.status-empty { background-color: #6c757d !important; border-color: #5a6268 !important; color: #ffffff !important; }

/* 统计按钮文字颜色 - 确保数字和标签都有正确的颜色 */
.status-stat-card .stat-number-large {
    color: inherit !important;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3) !important;
    font-weight: 900 !important; /* 黑体 */
    transition: all 0.2s ease !important; /* 添加过渡效果 */
}

.status-stat-card .stat-label-large {
    color: inherit !important;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3) !important;
    font-weight: 900 !important; /* 黑体 */
    transition: all 0.2s ease !important; /* 添加过渡效果 */
}

/* 统计按钮悬停效果 */
.status-stat-card:hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.4), 0 2px 4px rgba(0, 0, 0, 0.3) !important;
    transition: all 0.3s ease !important;
}

/* 统计按钮点击效果 */
.status-stat-card:active {
    transform: translateY(0) !important;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3) !important;
    transition: all 0.1s ease !important;
}

/* 脉冲动画 */
@keyframes pulse {
    0% { box-shadow: 0 4px 8px rgba(0,0,0,0.1), 0 0 0 0 rgba(40, 167, 69, 0.7); }
    70% { box-shadow: 0 4px 8px rgba(0,0,0,0.1), 0 0 0 10px rgba(40, 167, 69, 0); }
    100% { box-shadow: 0 4px 8px rgba(0,0,0,0.1), 0 0 0 0 rgba(40, 167, 69, 0); }
}
.pulse-animation { animation: pulse 2s infinite; }

/* 通用文字/图标颜色 */
.small, small { color: rgba(255,255,255,0.7) !important; }
.text-muted { color: rgba(255,255,255,0.6) !important; }
strong, b { color: rgba(255,255,255,0.95) !important; }
.text-success { color: rgba(40, 167, 69, 0.9) !important; }
.text-warning { color: rgba(255, 193, 7, 0.9) !important; }
.text-danger { color: rgba(220, 53, 69, 0.9) !important; }
.text-info { color: rgba(23, 162, 184, 0.9) !important; }

/* --- 自定义滚动条样式 (适用于Webkit浏览器) --- */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 10px;
    border: 1px solid rgba(0, 0, 0, 0.3);
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.5);
}

::-webkit-scrollbar-corner {
    background: transparent;
}

/* --- 列表视图行颜色样式 --- */
/* 默认行文字颜色，确保在彩色背景下可读 */
#page-1 .table tbody tr td {
    color: rgba(255, 255, 255, 0.9) !important;
}

/* 行背景色：使用卡片标题栏的颜色，但饱和度/透明度更低以适应大面积背景 */
#page-1 .table tbody tr.status-在产 { background-color: rgba(40, 167, 69, 0.15) !important; }
#page-1 .table tbody tr.status-待修 { background-color: rgba(220, 53, 69, 0.15) !important; }
#page-1 .table tbody tr.status-空闲 { background-color: rgba(253, 126, 20, 0.15) !important; }
#page-1 .table tbody tr.status-待料 { background-color: rgba(255, 193, 7, 0.15) !important; }
#page-1 .table tbody tr.status-换产 { background-color: rgba(255, 193, 7, 0.15) !important; }
#page-1 .table tbody tr.status-在修 { background-color: rgba(23, 162, 184, 0.15) !important; }

/* 悬停时稍微加深背景色 */
#page-1 .table tbody tr.status-在产:hover { background-color: rgba(40, 167, 69, 0.25) !important; }
#page-1 .table tbody tr.status-待修:hover { background-color: rgba(220, 53, 69, 0.25) !important; }
#page-1 .table tbody tr.status-空闲:hover { background-color: rgba(253, 126, 20, 0.25) !important; }
#page-1 .table tbody tr.status-待料:hover { background-color: rgba(255, 193, 7, 0.25) !important; }
#page-1 .table tbody tr.status-换产:hover { background-color: rgba(255, 193, 7, 0.25) !important; }
#page-1 .table tbody tr.status-在修:hover { background-color: rgba(23, 162, 184, 0.25) !important; }


/* 状态徽章：与卡片标题栏的徽章完全统一 */
#page-1 .table .badge {
    background-color: #22334a !important;
    border: none;
    font-size: 0.8rem;
    padding: 0.2em 0.5em;
}
#page-1 .table .badge.status-在产 { color: #28a745 !important; }
#page-1 .table .badge.status-待修 { color: #dc3545 !important; }
#page-1 .table .badge.status-空闲 { color: #fd7e14 !important; }
#page-1 .table .badge.status-待料 { color: #ffc107 !important; }
#page-1 .table .badge.status-换产 { color: #ffc107 !important; }
#page-1 .table .badge.status-在修 { color: #17a2b8 !important; }

/* --- 移动设备响应式样式 (屏幕宽度 < 768px) --- */
@media (max-width: 767.98px) {
    /* 隐藏大标题以节省空间 */
    .col-12.col-xl-5 {
        display: none !important;
    }
    
    /* 移动端覆盖桌面端的状态行背景色 */
    #page-1 .table tbody tr.status-在产,
    #page-1 .table tbody tr.status-待修,
    #page-1 .table tbody tr.status-空闲,
    #page-1 .table tbody tr.status-待料,
    #page-1 .table tbody tr.status-换产,
    #page-1 .table tbody tr.status-在修 {
        background-color: rgba(44, 62, 80, 0.8) !important;
    }
    
    /* 将表格转换为卡片布局 */
    #sortable-table {
        border-collapse: collapse;
        width: 100%;
        background: transparent;
    }
    #sortable-table thead {
        display: none; /* 隐藏桌面版的表头 */
    }
    #sortable-table tr {
        display: block;
        margin-bottom: 0.75rem;
        border-radius: 10px;
        overflow: hidden;
        box-shadow: 0 3px 6px rgba(0,0,0,0.3);
        background-color: rgba(44, 62, 80, 0.8);
        border: 1px solid rgba(255, 255, 255, 0.1);
        color: rgba(255, 255, 255, 0.9) !important;
    }
    #sortable-table td {
        display: block;
        text-align: left;
        padding: 0.5rem 0.75rem;
        padding-left: 45%;
        position: relative;
        border: none;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
        font-size: 0.85rem;
        line-height: 1.3;
        min-height: 2rem;
        max-height: 2rem;
        color: rgba(255, 255, 255, 0.9) !important;
        overflow: hidden;
        display: flex;
        align-items: center;
        justify-content: flex-end;
    }
    #sortable-table td:last-child {
        border-bottom: 0;
        border-radius: 0 0 10px 10px;
    }
    #sortable-table td:first-child {
        border-radius: 10px 10px 0 0;
        font-weight: bold;
        background-color: rgba(255, 255, 255, 0.05);
    }
    #sortable-table td::before {
        content: attr(data-label);
        position: absolute;
        left: 0.75rem;
        top: 50%;
        transform: translateY(-50%);
        width: 40%;
        padding-right: 0.5rem;
        text-align: left;
        font-weight: bold;
        color: rgba(255,255,255,0.8) !important;
        font-size: 0.8rem;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    /* 针对完成率进度条的特殊调整 */
    #sortable-table td[data-label="完成率"] {
        padding: 0.6rem 0.75rem;
        min-height: 2.4rem;
        max-height: 2.4rem;
    }
    #sortable-table td[data-label="完成率"] .progress {
        width: 100%;
        height: 18px;
        margin-top: 0.1rem;
        border-radius: 9px;
        background-color: rgba(255, 255, 255, 0.15);
        border: 1px solid rgba(255, 255, 255, 0.1);
        overflow: hidden;
        box-shadow: inset 0 1px 2px rgba(0,0,0,0.1);
    }
    #sortable-table td[data-label="完成率"] .progress-bar {
        font-size: 0.75rem;
        font-weight: bold;
        line-height: 18px;
        text-align: center;
        border-radius: 9px;
        background: linear-gradient(45deg, #007bff, #0056b3);
        box-shadow: 0 2px 4px rgba(0,123,255,0.3);
        transition: width 0.3s ease;
    }
    
    /* 不同完成率的进度条颜色 */
    #sortable-table td[data-label="完成率"] .progress-bar[style*="width: 100%"] {
        background: linear-gradient(45deg, #28a745, #1e7e34);
        box-shadow: 0 2px 4px rgba(40,167,69,0.3);
    }
    #sortable-table td[data-label="完成率"] .progress-bar[aria-valuenow="0"] {
        background: linear-gradient(45deg, #6c757d, #545b62);
        box-shadow: 0 2px 4px rgba(108,117,125,0.3);
    }
    
    /* 状态徽章在移动端的优化 */
    #sortable-table td[data-label="状态"] .badge {
        font-size: 0.8rem !important;
        padding: 0.25rem 0.6rem !important;
        border-radius: 6px !important;
        font-weight: bold !important;
        text-transform: none !important;
        box-shadow: 0 1px 3px rgba(0,0,0,0.2) !important;
        border: none !important;
    }
    
    /* 移动端状态徽章颜色优化 - 使用更高优先级的选择器 */
    #sortable-table td[data-label="状态"] .badge.status-在产 {
        background-color: #28a745 !important;
        color: white !important;
    }
    #sortable-table td[data-label="状态"] .badge.status-待修 {
        background-color: #dc3545 !important;
        color: white !important;
    }
    #sortable-table td[data-label="状态"] .badge.status-空闲 {
        background-color: #fd7e14 !important;
        color: white !important;
    }
    #sortable-table td[data-label="状态"] .badge.status-待料 {
        background-color: #ffc107 !important;
        color: #212529 !important;
    }
    #sortable-table td[data-label="状态"] .badge.status-换产 {
        background-color: #ffc107 !important;
        color: #212529 !important;
    }
    #sortable-table td[data-label="状态"] .badge.status-在修 {
        background-color: #17a2b8 !important;
        color: white !important;
    }
    
    /* 确保移动端状态徽章完全覆盖桌面端样式 */
    #page-1 .table .badge {
        background-color: transparent !important;
    }
    
    #page-1 .table .badge.status-在产 { 
        background-color: #28a745 !important;
        color: white !important; 
    }
    #page-1 .table .badge.status-待修 { 
        background-color: #dc3545 !important;
        color: white !important; 
    }
    #page-1 .table .badge.status-空闲 { 
        background-color: #fd7e14 !important;
        color: white !important; 
    }
    #page-1 .table .badge.status-待料 { 
        background-color: #ffc107 !important;
        color: #212529 !important; 
    }
    #page-1 .table .badge.status-换产 { 
        background-color: #ffc107 !important;
        color: #212529 !important; 
    }
    #page-1 .table .badge.status-在修 { 
        background-color: #17a2b8 !important;
        color: white !important; 
    }
    
    /* 机台号突出显示 */
    #sortable-table td[data-label="机台号"] {
        font-size: 0.9rem;
        font-weight: bold;
        color: #00BFFF !important;
    }
    
    /* 设备名称优化 */
    #sortable-table td[data-label="设备名称"] {
        font-size: 0.85rem;
        font-weight: 600;
        color: rgba(255, 255, 255, 0.95) !important;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    
    /* 移动端触摸优化 */
    #sortable-table tr {
        cursor: pointer;
        transition: all 0.2s ease;
    }
    #sortable-table tr:hover,
    #sortable-table tr:active {
        transform: translateY(-1px);
        box-shadow: 0 6px 12px rgba(0,0,0,0.4);
    }
    
    /* 移动端数值字段对齐优化 */
    #sortable-table td[data-label="计划产量"],
    #sortable-table td[data-label="实际产量"] {
        font-weight: 600;
        color: #00BFFF !important;
    }
    
    /* 移动端时间字段优化 */
    #sortable-table td[data-label="最后更新"] {
        font-family: 'Courier New', monospace;
        font-size: 0.8rem;
        color: rgba(255, 255, 255, 0.7) !important;
    }
    
    /* 移动端操作员字段优化 */
    #sortable-table td[data-label="操作员"] {
        color: rgba(255, 255, 255, 0.9) !important;
    }
    
    /* 移动端产品和工序字段优化 */
    #sortable-table td[data-label="产品"],
    #sortable-table td[data-label="工序"] {
        color: rgba(255, 255, 255, 0.9) !important;
    }
    
    /* 移动端空数据状态优化 */
    #sortable-table td:empty::after {
        content: "—";
        color: rgba(255, 255, 255, 0.4) !important;
        font-style: italic;
    }

    /* 移动端页面内容区域优化 */
    #page-1 {
        padding: 0.5rem;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    /* 移动端表格容器优化 */
    #page-1 .table-responsive {
        border: none;
        box-shadow: none;
    }
    
    /* 移动端卡片间距优化 */
    #sortable-table tr:last-child {
        margin-bottom: 0;
    }
    
    /* 移动端数据标签优化 */
    #sortable-table td[data-label="操作员"]:empty::after {
        content: "未分配";
        font-style: italic;
        color: rgba(255, 255, 255, 0.5) !important;
    }
    
    #sortable-table td[data-label="产品"]:empty::after,
    #sortable-table td[data-label="工序"]:empty::after {
        content: "N/A";
        font-style: italic;
        color: rgba(255, 255, 255, 0.5) !important;
    }

    /* --- 移动端导航菜单主题化 --- */
    #dashboard-v4-page .navbar-collapse {
        background-color: #2c3e50 !important; /* 深蓝背景 */
        padding: 1rem;
        border-radius: 0 0 8px 8px;
        border-top: 1px solid rgba(255, 255, 255, 0.2);
    }
    #dashboard-v4-page .navbar-nav .nav-link {
        color: rgba(255, 255, 255, 0.85) !important;
        padding: 0.75rem 0.5rem;
    }
    #dashboard-v4-page .navbar-nav .nav-link:hover {
        color: #ffffff !important;
    }
    #dashboard-v4-page .dropdown-menu {
        background-color: #34495e !important;
        border: 1px solid rgba(255, 255, 255, 0.2);
    }
    #dashboard-v4-page .dropdown-item {
        color: rgba(255, 255, 255, 0.85) !important;
    }
    #dashboard-v4-page .dropdown-item:hover {
        background-color: rgba(255, 255, 255, 0.1);
        color: #ffffff !important;
    }

    /* 在小屏幕上为展开的导航菜单添加坚实的背景 */
    #navbarNav.show {
        background-color: #2c3e50 !important; /* 使用主题中的深色作为坚实背景 */
        padding: 1rem;
        margin-top: 0.5rem;
        border-radius: 0.25rem;
        border: 1px solid rgba(255, 255, 255, 0.1);
        z-index: 1050; /* 确保菜单在所有元素之上 */
    }
} 

/* Active filter styling for status cards - unified with page switch buttons */
.status-stat-card.active-filter {
    border: 2px solid #00BFFF !important;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3), 0 1px 3px rgba(0, 0, 0, 0.2) !important;
    /* 移除过渡动画，避免呼吸效应 */
    position: relative !important;
    z-index: 10 !important;
}

/* Dim non-active status cards when one is selected */
.status-stat-card.dimmed {
    opacity: 0.4 !important;
    filter: brightness(0.6) !important;
    /* 移除过渡动画，避免呼吸效应 */
}

/* Ensure the active filter effect overrides all status-specific styles */
.status-stat-card.active-filter.status-在产,
.status-stat-card.active-filter.status-待修,
.status-stat-card.active-filter.status-空闲,
.status-stat-card.active-filter.status-待料,
.status-stat-card.active-filter.status-换产,
.status-stat-card.active-filter.status-在修,
.status-stat-card.active-filter.status-empty {
    border: 2px solid #00BFFF !important;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3), 0 1px 3px rgba(0, 0, 0, 0.2) !important;
}

.page-switch-card.active {
    background-color: #2c3e50 !important;
    color: white !important;
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.4) !important;
    transform: translateY(-2px);
}

.page-switch-card:not(.active) {
    background-color: rgba(108, 117, 125, 0.5) !important;
    color: rgba(255,255,255,0.7) !important;
}

.page-switch-card:not(.active):hover {
    background-color: rgba(134, 142, 150, 0.6) !important;
}

.page-switch-card .fas {
    font-size: 1.5rem !important;
}

/* --- COLUMN SELECTOR BUTTON STYLES --- */
#column-selector-container .col-btn {
    --bs-btn-padding-y: .15rem;
    --bs-btn-padding-x: .4rem;
    --bs-btn-font-size: .75rem;
    color: rgba(255, 255, 255, 0.6);
    background-color: transparent;
    border-color: rgba(255, 255, 255, 0.2);
    transition: all 0.2s ease-in-out;
}

#column-selector-container .col-btn:hover {
    background-color: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.4);
    color: white;
}

#column-selector-container .col-btn.active {
    background-color: #00BFFF;
    border-color: #00BFFF;
    color: white;
    transform: scale(1.05);
}

/* 确保移动菜单中的列数按钮是白色的 */
.navbar-collapse .col-btn {
    color: white !important;
}
/* --- END COLUMN SELECTOR STYLES --- */ 