/**
 * MBT 系统看板公共样式
 * 所有看板页面共享的基础样式和响应式布局
 */

/* ===== 全局重置 ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: "Microsoft YaHei", "PingFang SC", sans-serif;
}

body {
    background: linear-gradient(135deg, #0c1b33 0%, #1a3a5f 100%);
    color: #ffffff;
    min-height: 100vh;
    overflow: hidden; /* ✅ 禁止页面整体滚动，只允许卡片内滚动 */
    cursor: auto;
}

body.fullscreen-mode {
    cursor: none;
}

/* ===== 粒子画布 ===== */
#particles-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    pointer-events: none;
}

/* ===== 主容器 ===== */
.dashboard-container {
    height: 100vh; /* ✅ 改为固定高度，而非min-height */
    width: 100%;
    padding: 12px 15px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    position: relative;
    z-index: 1;
    transition: all 0.3s ease;
    overflow: hidden; /* ✅ 禁止容器滚动 */
}

/* ===== 头部样式 ===== */
.header {
    background: rgba(26, 44, 92, 0.8);
    border-radius: 10px;
    padding: 16px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(77, 171, 247, 0.3);
    backdrop-filter: blur(10px);
    flex-shrink: 0;
    min-height: 68px;
    max-height: 84px;
}

.title-container {
    display: flex;
    align-items: center;
    gap: 12px;
}

.title-icon {
    font-size: 28px;
    color: #4dabf7;
    cursor: pointer;
    transition: all 0.3s ease;
    padding: 5px;
    border-radius: 6px;
}

.title-icon:hover {
    color: #a5d8ff;
    background: rgba(77, 171, 247, 0.15);
    transform: scale(1.1);
}

.title-icon:active {
    transform: scale(0.95);
}

.main-title {
    font-size: clamp(16px, 2.2vw, 30px);  /* ✅ 连续自适应：窄屏16px→宽屏30px */
    font-weight: 700;
    background: linear-gradient(90deg, #4dabf7, #339af0);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    line-height: 1.2;
}

.main-title-en {
    font-size: 12px;  /* ✅ 恢复标准字体大小 */
    color: #a5d8ff;
    margin-top: 2px;
}

.header-controls {
    display: flex;
    gap: 10px; /* ✅ 减小间距，节省空间 */
    align-items: center;
}

/* ✅ 页眉图标按钮强制正方形（防止被通用.btn样式中的padding/min-width覆盖）*/
.header-controls .btn {
    width: 36px;
    height: 36px;
    min-width: 36px;
    min-height: 36px;
    padding: 0;
}

.time-display {
    text-align: right;
    font-size: 13px;
    color: #a5d8ff;
    line-height: 1.3;
}

/* ===== 按钮样式 ===== */
.btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px; /* ✅ 固定宽度，保持正方形 */
    height: 36px; /* ✅ 固定高度，保持正方形 */
    min-width: 36px; /* ✅ 防止被压缩 */
    min-height: 36px; /* ✅ 防止被拉伸 */
    background: rgba(77, 171, 247, 0.15);
    border: 1px solid rgba(77, 171, 247, 0.2);
    border-radius: 8px; /* ✅ 稍微增大圆角 */
    cursor: pointer;
    color: #a5d8ff;
    font-size: 14px; /* ✅ 稍微增大图标 */
    transition: all 0.3s ease;
    flex-shrink: 0; /* ✅ 关键：防止被flex拉伸 */
    box-shadow: none;
    padding: 0;
}

.btn:hover {
    background: rgba(77, 171, 247, 0.3);
    border-color: #4dabf7;
    color: #4dabf7;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(77, 171, 247, 0.2);
}

/* ===== KPI 卡片 ===== */
.kpi-row {
    display: grid;
    gap: 12px; /* ✅ 增加间距，提升视觉舒适度 */
    flex-shrink: 0;
    
    /* ✅ 智能列数：根据屏幕宽度自动调整（6/4/3/2/1列） */
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    
    /* ✅ 弹性高度：不再限制最大高度，让内容自然撑开 */
    min-height: 110px;
}

.kpi-card {
    background: rgba(26, 44, 92, 0.6);
    border-radius: 10px;
    padding: 12px 15px; /* ✅ 优化内边距，平衡空间利用 */
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(77, 171, 247, 0.2);
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 100px; /* ✅ 保证最小高度 */
}

.kpi-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
    border-color: rgba(77, 171, 247, 0.4);
}

.kpi-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.kpi-title {
    font-size: clamp(13px, 1.4vw, 15px); /* ✅ 字体自适应：最小13px，理想1.4vw，最大15px */
    color: #a5d8ff;
    display: flex;
    align-items: center;
    gap: 8px;
}

.kpi-icon {
    width: 26px; /* ✅ 优化图标尺寸 */
    height: 26px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: clamp(13px, 1.2vw, 15px); /* ✅ 图标字体自适应 */
    flex-shrink: 0;
}

.kpi-icon.blue { background: rgba(77, 171, 247, 0.2); color: #4dabf7; }
.kpi-icon.orange { background: rgba(255, 193, 7, 0.2); color: #ffc107; }
.kpi-icon.red { background: rgba(255, 107, 107, 0.2); color: #ff6b6b; }
.kpi-icon.green { background: rgba(81, 207, 102, 0.2); color: #51cf66; }
.kpi-icon.yellow { background: rgba(255, 193, 7, 0.2); color: #ffc107; }
.kpi-icon.gray { background: rgba(148, 163, 184, 0.2); color: #94a3b8; }

.kpi-value {
    font-size: clamp(22px, 2.8vw, 28px); /* ✅ 数值自适应：最小22px，理想2.8vw，最大28px */
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 3px;
    line-height: 1.2; /* ✅ 优化行高 */
}

.kpi-desc {
    font-size: clamp(9px, 0.9vw, 11px); /* ✅ 描述文字自适应 */
    color: rgba(165, 216, 255, 0.7);
}

.progress-bar {
    width: 100%;
    height: 5px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    margin-top: 6px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    border-radius: 3px;
    transition: width 0.5s ease;
}

.progress-fill.green { background: linear-gradient(90deg, #51cf66, #69db7c); }
.progress-fill.blue { background: linear-gradient(90deg, #339af0, #4dabf7); }
.progress-fill.orange { background: linear-gradient(90deg, #fcc419, #ffd43b); }

/* ===== 图表容器 ===== */
.charts-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 10px;
    flex: 1;
    min-height: 350px;  /* ✅ 调整最小高度 */
    max-height: calc(100vh - 260px); /* ✅ 限制最大高度，防止超出视口 */
    overflow: hidden;
}

/* ✅ 确保所有主要区域都不会导致页面滚动 */
.header,
.kpi-row,
.charts-grid,
.footer {
    overflow: hidden;
}

.chart-card {
    background: rgba(26, 44, 92, 0.6);
    border-radius: 10px;
    padding: 12px 15px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(77, 171, 247, 0.2);
    backdrop-filter: blur(10px);
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
}

/* ✅ 物料清单卡片特殊处理：填充可用空间 */
.chart-card:first-child {
    height: 100%;
}

.chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0;  /* ✅ Excel标签页不需要底部间距 */
    flex-shrink: 0;
    padding-bottom: 8px; /* 底部内边距替代外边距 */
    /* border-bottom: 1px solid rgba(77, 171, 247, 0.2); */ /* ❌ 已移除：标签页现在嵌入表头内 */
}

.chart-title {
    font-size: clamp(13px, 1.4vw, 22px);  /* ✅ 连续自适应：始终比页头标题小3~8px */
    color: #4dabf7;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: none;
    -webkit-background-clip: initial;
    -webkit-text-fill-color: initial;
}

.chart-wrapper {
    flex: 1;
    position: relative;
    min-height: 0;
    overflow: hidden;
}

/* ✅ 图表区域中的卡片自动填充高度 */
.charts-grid .chart-card {
    height: 100%;
}

/* ✅ 全屏自适应布局：表头 + 滚动区域 + 合计行 */
.card-content-wrapper {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 280px); /* ✅ 调整高度，确保不超出视口 */
    min-height: 350px;
    max-height: 65vh; /* ✅ 限制最大高度 */
    overflow: hidden; /* ✅ 防止内容溢出 */
}

/* ✅ 单表结构：通过CSS sticky定位固定表头和合计行（参照ProdOutMonthSummary.html） */

/* 表格滚动区域 */
.table-scroll-container {
    flex: 1;
    overflow-y: auto;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch; /* 移动端优化 */
    background: rgba(15, 30, 60, 0.3);
}

/* 旧版三段式布局样式已废弃 - ProductionProcess.html改用单表结构
   .table-header-fixed, .table-footer-fixed, .header-table, .body-table, .footer-table */

/* 旧版 .table-container 样式保留（兼容其他页面） */
.table-container {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
}

/* 滚动容器 - 内层专门负责滚动 */
.table-scroll-container {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    overflow-x: auto;
    position: relative;
    -webkit-overflow-scrolling: touch; /* 移动端优化 */
}

/* ===== 底部状态栏 ===== */
.footer {
    text-align: center;
    padding: 6px;  /* ✅ 恢复标准padding，与ProdOutMonthSummary一致 */
    color: #a5d8ff;
    font-size: 11px;  /* ✅ 恢复标准字体大小 */
    background: rgba(26, 44, 92, 0.3);
    border-radius: 6px;
    backdrop-filter: blur(10px);
    flex-shrink: 0;
    white-space: nowrap;
    max-height: 40px; /* ✅ 限制页脚高度 */
}

.refresh-indicator {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #51cf66;
    margin-right: 6px;
    animation: pulse-green 2s infinite;
}

.refresh-indicator.error {
    background: #ff6b6b;
    animation: pulse-red 1s infinite;
}

@keyframes pulse-green {
    0%, 100% { box-shadow: 0 0 0 0 rgba(81, 207, 102, 0.4); }
    50% { box-shadow: 0 0 0 4px rgba(81, 207, 102, 0); }
}

@keyframes pulse-red {
    0%, 100% { box-shadow: 0 0 0 0 rgba(255, 107, 107, 0.4); }
    50% { box-shadow: 0 0 0 4px rgba(255, 107, 107, 0); }
}

.api-status-text {
    color: #51cf66;
}

.api-status-text.error {
    color: #ff6b6b;
    margin-right: 5px;
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

.last-update {
    font-size: 11px;
    color: #a5d8ff;
    display: flex;
    align-items: center;
}

.legend-row {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 5px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 11px;
    color: #a5d8ff;
    cursor: pointer;
    transition: all 0.3s ease;
}

.legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

/* ===== 应用手册链接样式 ===== */
.manual-link {
    color: #a5d8ff;
    text-decoration: none;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border-radius: 4px;
    background: rgba(77, 171, 247, 0.1);
    border: 1px solid rgba(77, 171, 247, 0.3);
}

.manual-link:hover {
    color: #4dabf7;
    background: rgba(77, 171, 247, 0.2);
    border-color: rgba(77, 171, 247, 0.5);
    transform: translateY(-1px);
}

.manual-link i {
    font-size: 12px;
}

/* ===== 响应式媒体查询 ===== */

/* Mode 1: 超小屏幕 (≤402px) - 单列KPI */
@media screen and (max-width: 402px) {
    html, body {
        overflow: auto;
    }
    
    body {
        height: auto;
        min-height: 100vh;
    }
    
    .dashboard-container {
        padding: 6px 8px;
        gap: 6px;
        height: auto;
        min-height: 100vh;
    }
    
    .main-title-en {
        display: none !important;
    }
    
    .header {
        padding: 8px 10px;
        min-height: 50px;
    }
    
    /* ✅ 移动端页眉按钮间距优化 */
    .header-controls {
        gap: 6px; /* ✅ 进一步减小间距 */
    }
    
    .title-icon {
        font-size: 18px;
    }
    
    .time-display {
        font-size: 9px;
    }
    
    .header-controls .btn {
        width: 32px;
        height: 32px;
        min-width: 32px;
        min-height: 32px;
        font-size: 12px;
    }
    
    .kpi-row {
        grid-template-columns: 1fr;
        gap: 6px;
        min-height: auto;
    }
    
    .kpi-card {
        padding: 10px;
    }
    
    .kpi-value {
        font-size: 18px;
    }
    
    .kpi-title {
        font-size: 12px;
    }
    
    .kpi-desc {
        font-size: 9px;
    }
    
    .kpi-icon {
        width: 22px;
        height: 22px;
        font-size: 11px;
    }
    
    .charts-grid {
        grid-template-columns: 1fr;
        gap: 6px;
    }
    
    .chart-wrapper {
        min-height: 250px;
    }
    
    .footer {
        font-size: 9px;
        padding: 6px;
    }
}

/* Mode 2: 小屏幕 (403-802px) - 双列KPI */
@media screen and (min-width: 403px) and (max-width: 802px) {
    .kpi-row {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
        min-height: auto;
    }
    
    .kpi-card {
        padding: 12px;
    }
    
    .kpi-value {
        font-size: 22px;
    }
    
    .kpi-title {
        font-size: 13px;
    }
    
    .kpi-desc {
        font-size: 9px;
    }
    
    .kpi-icon {
        width: 24px;
        height: 24px;
        font-size: 13px;
    }
    
    .charts-grid {
        grid-template-columns: 1fr;
        gap: 8px;
    }
    
    /* ✅ 小屏幕下图表卡片固定高度 */
    .charts-grid .chart-card {
        height: auto;
        min-height: 350px;
    }
    
    .chart-wrapper {
        min-height: 280px;
    }
}

/* Mode 2横屏优化: 图表卡片并行布局 */
@media screen and (max-height: 500px) and (orientation: landscape) {
    .charts-grid {
        grid-template-columns: 1fr 1fr;
        gap: 6px;
    }
    
    .chart-card {
        padding: 6px 8px;
        min-height: 0;
    }
    
    .chart-header {
        margin-bottom: 3px;
    }
    
    .chart-title {
        font-size: 10px;
    }
    
    .chart-wrapper {
        min-height: 180px;
        max-height: 220px;
    }
}

/* Mode 3: 中等屏幕 (803-980px) - 四列KPI */
@media screen and (min-width: 803px) and (max-width: 980px) {
    .kpi-row {
        grid-template-columns: repeat(4, 1fr);
    }
    
    .charts-grid {
        grid-template-columns: 2fr 1fr;
    }
}

/* Mode 4: 中大屏幕 (981-1376px) - 默认布局 */
@media screen and (min-width: 981px) and (max-width: 1376px) {
    .dashboard-container {
        padding: 12px 15px;
        gap: 10px;
    }
    
    .kpi-value {
        font-size: 24px;
    }
    
    .chart-wrapper {
        min-height: 240px;
    }
}

/* Mode 5: 大屏幕 (1377-1646px) - 增强显示 */
@media screen and (min-width: 1377px) and (max-width: 1646px) {
    .dashboard-container {
        padding: 15px 20px;
        gap: 12px;
    }
    
    .kpi-value {
        font-size: 28px;
    }
    
    .chart-wrapper {
        min-height: 260px;
    }
}

/* Mode 6: 超大屏幕 (1647-1728px) - 专业显示 */
@media screen and (min-width: 1647px) and (max-width: 1728px) {
    .dashboard-container {
        padding: 18px 25px;
        gap: 15px;
    }
    
    .kpi-value {
        font-size: 30px;
    }
    
    .chart-wrapper {
        min-height: 280px;
    }
}

/* Mode 7: 超宽屏幕 (≥1729px) - 最大化显示 */
@media screen and (min-width: 1729px) {
    .dashboard-container {
        padding: 20px 30px;
        gap: 18px;
    }
    
    .kpi-value {
        font-size: 32px;
    }
    
    .chart-wrapper {
        min-height: 300px;
    }
}

/* Mode 3车载专用 (960x540) - 禁止滚动,固定视口 */
@media screen and (width: 960px) and (height: 540px),
       screen and (min-width: 900px) and (max-width: 1024px) and (min-height: 480px) and (max-height: 600px) {
    
    html, body {
        width: 100vw !important;
        height: 100vh !important;
        overflow: hidden !important;
        touch-action: none !important;
        -webkit-overflow-scrolling: auto !important;
    }

    .dashboard-container {
        width: 100vw !important;
        height: 100vh !important;
        max-height: 540px !important;
        padding: 6px 8px !important;
        gap: 6px !important;
        overflow: hidden !important;
    }

    .header {
        padding: 6px 10px !important;
        min-height: 36px !important;
        max-height: 36px !important;
    }

    .title-container {
        gap: 8px !important;
    }

    .main-title {
        font-size: 15px !important;
        line-height: 1.1 !important;
    }

    .main-title-en {
        display: none !important;
    }

    .title-icon {
        font-size: 18px !important;
    }

    .time-display {
        font-size: 9px !important;
        line-height: 1.2 !important;
    }

    #currentDate,
    #currentTime {
        white-space: nowrap !important;
    }

    .header-controls .btn {
        width: 28px !important;
        height: 28px !important;
        min-width: 28px !important;
        min-height: 28px !important;
        font-size: 11px !important;
        padding: 0 !important;
    }

    .kpi-row {
        grid-template-columns: repeat(4, 1fr) !important;
        gap: 5px !important;
        flex-shrink: 0 !important;
        min-height: 60px !important;
    }

    .kpi-card {
        padding: 6px 8px !important;
    }

    .kpi-header {
        margin-bottom: 3px !important;
    }

    .kpi-title {
        font-size: 10px !important;
    }

    .kpi-value {
        font-size: 14px !important;
    }

    .kpi-desc {
        font-size: 7px !important;
    }

    .kpi-icon {
        width: 18px !important;
        height: 18px !important;
        font-size: 9px !important;
    }

    .progress-bar {
        height: 3px !important;
        margin-top: 3px !important;
    }

    .charts-grid {
        display: grid !important;
        grid-template-columns: 1fr 1fr !important;
        grid-template-rows: 1fr !important;
        gap: 5px !important;
        flex: 1 !important;
        min-height: 0 !important;
        overflow: hidden !important;
    }

    .chart-card {
        padding: 6px 8px !important;
        min-height: 0 !important;
        overflow: hidden !important;
    }

    .chart-header {
        margin-bottom: 4px !important;
        flex-shrink: 0 !important;
    }

    .chart-title {
        font-size: 9px !important;
    }

    .chart-wrapper {
        flex: 1 !important;
        min-height: 0 !important;
        overflow: hidden !important;
    }

    canvas {
        max-height: 100% !important;
        display: block !important;
    }

    .legend-row {
        gap: 6px !important;
        margin-top: 3px !important;
        flex-shrink: 0 !important;
    }

    .legend-item {
        font-size: 7px !important;
    }

    .legend-dot {
        width: 6px !important;
        height: 6px !important;
    }

    html, body,
    .dashboard-container,
    .header,
    .kpi-row,
    .kpi-card,
    .charts-grid,
    .chart-card,
    .chart-wrapper,
    .legend-row {
        overflow: hidden !important;
        touch-action: none !important;
        -webkit-overflow-scrolling: auto !important;
        scrollbar-width: none !important;
    }

    ::-webkit-scrollbar {
        display: none !important;
        width: 0 !important;
        height: 0 !important;
    }

    .footer {
        font-size: 8px !important;
        padding: 3px 6px !important;
        flex-shrink: 0 !important;
        min-height: 22px !important;
        max-height: 22px !important;
        line-height: 1.2 !important;
        white-space: nowrap !important;
        overflow: hidden !important;
    }

    .refresh-indicator {
        width: 5px !important;
        height: 5px !important;
        margin-right: 3px !important;
    }

    canvas {
        display: block !important;
    }
}

/* ===== 物料流转瓶颈监控看板专用样式 ===== */

/* 6列KPI布局 */
.kpi-row-6 {
    grid-template-columns: repeat(6, 1fr);
}

/* ✅ 6个KPI卡片更紧凑 */
.kpi-row-6 .kpi-card {
    padding: 15px 18px;  /* ✅ 恢复标准padding，与ProdOutMonthSummary一致 */
    min-height: 100px;   /* ✅ 恢复标准高度 */
}

/* KPI卡片双指标样式 */
.kpi-card.clickable {
    cursor: pointer;
    transition: all 0.3s ease;
}

.kpi-card.clickable:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
}

.kpi-sub-value {
    font-size: clamp(11px, 1.1vw, 13px); /* ✅ 副值自适应 */
    color: #ffc107;  /* 默认黄色（兼容旧数据） */
    margin-top: 5px;
    font-weight: 500;
    white-space: nowrap; /* ✅ 防止换行 */
    overflow: hidden; /* ✅ 超长时隐藏 */
    text-overflow: ellipsis; /* ✅ 显示省略号 */
}

/* ✅ 新增：滞留时间三级预警色阶 */
.kpi-sub-value.normal {
    color: #52c41a !important;  /* 🟢 绿色：≤12小时，正常流转 */
}

.kpi-sub-value.warning {
    color: #faad14 !important;  /* 🟡 橙色：12-48小时，轻微延迟 */
}

.kpi-sub-value.critical {
    color: #ff4d4f !important;  /* 🔴 红色：>48小时，严重积压 */
}

/* ===== KPI轮播指示器 ===== */
.carousel-indicators {
    display: flex;
    justify-content: center;
    gap: 6px;
    margin-top: 6px;
}

.indicator-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: rgba(165, 216, 255, 0.3);
    transition: all 0.3s ease;
    cursor: pointer;
}

.indicator-dot.active {
    background: #51cf66;
    transform: scale(1.3);
    box-shadow: 0 0 6px rgba(81, 207, 102, 0.6);
}

/* KPI数值淡入淡出动画 */
.kpi-value.fade-transition {
    animation: fadeInOut 0.5s ease;
}

@keyframes fadeInOut {
    0% { opacity: 0; transform: translateY(-5px); }
    100% { opacity: 1; transform: translateY(0); }
}

/* ✅ 表格列对齐工具类已移至 .detail-table 作用域内（见下方），避免全局污染 */

/* 图表内容分割布局 */
.chart-content-split {
    display: flex;
    flex-direction: column;
    height: 100%;
    gap: 10px;
}

.chart-wrapper-small {
    height: 60%;
    position: relative;
}

/* 预警提示区域 */
.warning-hint {
    height: 40%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 15px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    border-left: 4px solid #4dabf7;
}

.warning-hint p {
    margin: 8px 0;
    font-size: 13px;
    color: #a5d8ff;
    text-align: center;
}

.warning-hint i {
    margin-right: 8px;
    color: #4dabf7;
}

/* 蓝色图标样式 */
.kpi-icon.blue {
    color: #36a2eb;
}

/* 响应式适配 */
@media (max-width: 1400px) {
    .kpi-row-6 {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* ✅ 智能自适应布局 - 多断点优化 */
@media (max-width: 1400px) {
    /* 中等屏幕：强制4列，避免过窄 */
    .kpi-row {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (max-width: 1024px) {
    /* 小平板：2列（避免3+1不对称布局） */
    .kpi-row {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .kpi-card {
        padding: 10px 12px;
    }
    
    .kpi-value {
        font-size: clamp(20px, 3vw, 26px);
    }
}

@media (max-width: 768px) {
    /* 手机横屏：2列 */
    .kpi-row {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }
    
    .kpi-card {
        padding: 8px 10px;
        min-height: 90px;
    }
    
    .kpi-icon {
        width: 22px;
        height: 22px;
        font-size: 11px;
    }
    
    .kpi-value {
        font-size: clamp(20px, 3vw, 26px);
    }
    
    .kpi-sub-value {
        font-size: 10px;
    }
}

@media (max-width: 768px) {
    .kpi-row-6 {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .kpi-value {
        font-size: 24px;
    }
    
    .kpi-sub-value {
        font-size: 11px;
    }
}

@media (max-width: 480px) {
    /* 手机竖屏：1列 */
    .kpi-row-6 {
        grid-template-columns: 1fr;
    }
    
    .kpi-row {
        grid-template-columns: 1fr;
        gap: 6px;
    }
    
    .kpi-card {
        padding: 10px 12px;
        min-height: 85px;
    }
    
    .kpi-value {
        font-size: clamp(18px, 2.5vw, 22px);
    }
    
    /* 手机竖屏：页眉标题与控件垂直堆叠各占一行 */
    .header {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
        min-height: auto;
        max-height: none;
        padding: 12px 12px;
    }
    
    .header .title-container {
        gap: 6px;
    }
    
    .header .title-icon {
        font-size: 18px;
        padding: 3px;
    }
    
    .header .main-title-en {
        display: none;
    }
    
    .header .header-controls {
        justify-content: flex-end;
        gap: 6px;
    }
    
    .header .time-display {
        font-size: 10px;
    }
    
    .header .header-controls .btn {
        width: 30px;
        height: 30px;
        min-width: 30px;
        min-height: 30px;
        font-size: 12px;
    }
}

/* ✅ 全屏自适应布局 - 移动端优化 */
@media (max-width: 768px) {
    /* ✅ 横屏模式：禁止页面滚动 */
    @media (orientation: landscape) {
        body, html {
            overflow: hidden;
        }
        
        .dashboard-container {
            height: 100vh;
            overflow: hidden;
        }
    }
    
    /* ✅ 竖屏模式：允许页面滚动，查看全部内容 */
    @media (orientation: portrait) {
        body, html {
            overflow-y: auto; /* ✅ 允许垂直滚动 */
            overflow-x: hidden;
        }
        
        .dashboard-container {
            height: auto; /* ✅ 改为自动高度 */
            min-height: 100vh;
            overflow-y: visible;
        }
        
        /* KPI区域允许自然撑开 */
        .kpi-row {
            min-height: auto;
            max-height: none;
        }
        
        /* 图表区域也允许滚动 */
        .charts-grid {
            max-height: none;
            overflow-y: visible;
        }
        
        /* 物料清单卡片允许滚动 */
        .card-content-wrapper {
            height: auto;
            min-height: 400px;
            max-height: none;
        }
    }
    
    .card-content-wrapper {
        height: calc(100vh - 250px); /* 移动端减少高度 */
        min-height: 300px;
        max-height: 60vh; /* ✅ 限制最大高度 */
    }
    
    .header-table,
    .body-table,
    .footer-table {
        min-width: 1000px; /* 移动端减小最小宽度 */
    }
    
    .header-table th,
    .body-table td,
    .footer-table td {
        padding: 6px 4px; /* 减小内边距 */
        font-size: 12px; /* 减小字体 */
    }
    
    /* ✅ 移动端限制各区域高度 */
    .header {
        max-height: 60px;
    }
    
    .kpi-row {
        /* ✅ 移除max-height限制，让内容自然撑开 */
        min-height: auto;
    }
    
    .charts-grid {
        max-height: calc(100vh - 220px);
    }
}

/* ===== 模态框样式 ===== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    backdrop-filter: blur(4px);
}

.modal-content {
    background: linear-gradient(135deg, #1a3a5f 0%, #0c1b33 100%);
    border-radius: 12px;
    width: 90%;
    max-width: 1400px;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(77, 171, 247, 0.3);
}

.modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid rgba(77, 171, 247, 0.2);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    color: #4dabf7;
    font-size: 20px;
    margin: 0;
}

.modal-header h3 i {
    margin-right: 10px;
}

.modal-close {
    background: transparent;
    border: none;
    color: #a5d8ff;
    font-size: 24px;
    cursor: pointer;
    padding: 4px 8px;
    transition: all 0.3s ease;
}

.modal-close:hover {
    color: #fff;
    transform: scale(1.2);
}

.modal-body {
    padding: 20px 24px;
    flex: 1;
    overflow-y: auto;
}

.modal-summary {
    background: rgba(77, 171, 247, 0.1);
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 16px;
    border-left: 4px solid #4dabf7;
    color: #a5d8ff;
    font-size: 14px;
}

.modal-summary strong {
    color: #4dabf7;
}

.table-container {
    overflow-x: auto;
    border-radius: 8px;
    border: 1px solid rgba(77, 171, 247, 0.2);
}

.detail-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;  /* ✅ 恢复标准字体大小，与ProdOutMonthSummary一致 */
    table-layout: fixed; /* ✅ 固定表格布局，确保列宽精确控制 */
}

.detail-table thead {
    background: rgba(26, 58, 95, 0.95);  /* ✅ 提高不透明度，防止穿透 */
    position: sticky;
    top: 0;
    z-index: 10;
}

.detail-table th {
    padding: 12px 10px;  /* ✅ 恢复标准padding */
    text-align: left;
    color: #4dabf7;
    font-weight: 600;
    white-space: nowrap;
    border-bottom: 2px solid rgba(77, 171, 247, 0.3);
    background: rgba(26, 58, 95, 0.95);  /* ✅ 单元格也设置背景，防止穿透 */
}

.detail-table tbody tr {
    transition: background 0.2s ease;
}

.detail-table tbody tr:hover {
    background: rgba(77, 171, 247, 0.08);
}

/* ✅ 固定底部合计行容器（标准 tfoot 结构） */
.detail-table tfoot {
    position: sticky;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(26, 44, 92, 0.95); /* ✅ 与ProdOutMonthSummary保持一致 */
    border-top: 2px solid rgba(77, 171, 247, 0.3); /* ✅ 与ProdOutMonthSummary保持一致 */
    z-index: 10; /* ✅ 与表头保持一致 */
}

.detail-table tfoot td {
    padding: 12px 10px;
    white-space: nowrap;
    font-weight: 600;
    color: #4dabf7;
}

.detail-table td {
    padding: 10px;  /* ✅ 恢复标准padding */
    border-bottom: 1px solid rgba(77, 171, 247, 0.1);
    color: #e0e0e0;
}

/* ✅ 表格列对齐工具类已废弃 - ProductionProcess.html改用内联样式（参照ProdOutMonthSummary.html）
   原因：内联样式优先级最高，不依赖外部CSS类，避免选择器冲突和优先级问题
   其他页面如需使用，可保留此定义 */
.detail-table th.text-left,
.detail-table td.text-left {
    text-align: left !important;
}

.detail-table th.text-center,
.detail-table td.text-center {
    text-align: center !important;
}

.detail-table th.text-right,
.detail-table td.text-right {
    text-align: right !important;
}

/* 徽章样式 */
.badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

.badge-process {
    background: rgba(77, 171, 247, 0.2);
    color: #4dabf7;
    border: 1px solid rgba(77, 171, 247, 0.4);
}

/* 滞留时长颜色 */
.stuck-hours {
    font-weight: 600;
    padding: 4px 8px;
    border-radius: 4px;
}

.stuck-hours.critical {
    background: rgba(255, 99, 132, 0.2);
    color: #ff6384;
    border: 1px solid rgba(255, 99, 132, 0.4);
}

.stuck-hours.warning {
    background: rgba(255, 206, 86, 0.2);
    color: #ffce56;
    border: 1px solid rgba(255, 206, 86, 0.4);
}

.stuck-hours.caution {
    background: rgba(255, 159, 64, 0.2);
    color: #ff9f40;
    border: 1px solid rgba(255, 159, 64, 0.4);
}

.stuck-hours.normal {
    background: rgba(75, 192, 192, 0.2);
    color: #4bc0c0;
    border: 1px solid rgba(75, 192, 192, 0.4);
}

.modal-footer {
    padding: 16px 24px;
    border-top: 1px solid rgba(77, 171, 247, 0.2);
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

/* 按钮基础样式 */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
    outline: none;
    white-space: nowrap;      /* 禁止文字换行 */
    min-width: 100px;         /* 最小宽度，确保文字不换行 */
}

.btn i {
    font-size: 16px;
}

.btn-secondary {
    background: rgba(108, 117, 125, 0.3);
    border: 1px solid rgba(108, 117, 125, 0.5);
    color: #e0e0e0;
}

.btn-secondary:hover {
    background: rgba(108, 117, 125, 0.5);
    color: #fff;
}

.btn-primary {
    background: rgba(77, 171, 247, 0.3);
    border: 1px solid rgba(77, 171, 247, 0.5);
    color: #4dabf7;
}

.btn-primary:hover {
    background: rgba(77, 171, 247, 0.5);
    color: #fff;
}

/* 物料状态徽章颜色 */
.badge-status-gray {
    background: rgba(128, 128, 128, 0.2);
    color: #808080;
    border: 1px solid rgba(128, 128, 128, 0.4);
}

.badge-status-red {
    background: rgba(255, 99, 132, 0.2);
    color: #ff6384;
    border: 1px solid rgba(255, 99, 132, 0.4);
}

.badge-status-green {
    background: rgba(75, 192, 192, 0.2);
    color: #4bc0c0;
    border: 1px solid rgba(75, 192, 192, 0.4);
}

.badge-status-yellow {
    background: rgba(255, 206, 86, 0.2);
    color: #ffce56;
    border: 1px solid rgba(255, 206, 86, 0.4);
}

.badge-status-blue {
    background: rgba(54, 162, 235, 0.2);
    color: #36a2eb;
    border: 1px solid rgba(54, 162, 235, 0.4);
}

.badge-status-dark-gray {
    background: rgba(108, 117, 125, 0.2);
    color: #6c757d;
    border: 1px solid rgba(108, 117, 125, 0.4);
}

.badge-status-orange {
    background: rgba(255, 159, 64, 0.2);
    color: #ff9f40;
    border: 1px solid rgba(255, 159, 64, 0.4);
}

/* 清单汇总信息样式 */
.chart-summary {
    display: flex;
    gap: 12px;
    font-size: 12px;
    color: #a5d8ff;
}

.summary-badge {
    background: rgba(77, 171, 247, 0.15);
    padding: 4px 10px;
    border-radius: 4px;
    border: 1px solid rgba(77, 171, 247, 0.3);
}

/* 状态切换按钮组 */
.status-toggle-group {
    display: flex;
    gap: 8px;
    margin-left: auto;
}

.status-toggle-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 1px solid rgba(77, 171, 247, 0.3);
    background: rgba(77, 171, 247, 0.1);
    color: #a5d8ff;
    white-space: nowrap;
}

.status-toggle-btn:hover {
    background: rgba(77, 171, 247, 0.2);
    color: #fff;
}

.status-toggle-btn.active {
    background: rgba(77, 171, 247, 0.4);
    border-color: rgba(77, 171, 247, 0.6);
    color: #fff;
    box-shadow: 0 2px 8px rgba(77, 171, 247, 0.3);
}

.status-toggle-btn i {
    font-size: 14px;
}

/* ===== 表头排序与筛选行样式 ===== */

/* 可排序表头 */
.detail-table th.sortable {
    cursor: pointer;
    user-select: none;
    position: relative;
    transition: color 0.2s ease;
}

.detail-table th.sortable:hover {
    color: #a5d8ff;
    background: rgba(77, 171, 247, 0.12);
}

/* 排序指示器（▲▼） */
.detail-table th.sortable::after {
    content: ' \25B4\25BE';
    font-size: 9px;
    color: rgba(165, 216, 255, 0.35);
    margin-left: 3px;
    letter-spacing: -2px;
}

.detail-table th.sort-asc::after {
    content: ' \25B4';
    color: #4dabf7;
}

.detail-table th.sort-desc::after {
    content: ' \25BE';
    color: #4dabf7;
}

/* 筛选行 */
.filter-row td {
    padding: 4px 6px !important;
    background: rgba(20, 40, 75, 0.95) !important;
    border-bottom: 2px solid rgba(77, 171, 247, 0.2) !important;
}

.filter-input,
.filter-select {
    width: 100%;
    padding: 3px 6px;
    border: 1px solid rgba(77, 171, 247, 0.2);
    border-radius: 4px;
    background: rgba(15, 30, 60, 0.6);
    color: #a5d8ff;
    font-size: 11px;
    outline: none;
    transition: border-color 0.2s ease;
}

.filter-input:focus,
.filter-select:focus {
    border-color: #4dabf7;
    background: rgba(15, 30, 60, 0.8);
}

.filter-input::placeholder {
    color: rgba(165, 216, 255, 0.35);
    font-size: 10px;
}

.filter-select {
    cursor: pointer;
}

.filter-select option {
    background: #1a2c5c;
    color: #a5d8ff;
}

.filter-range {
    display: flex;
    gap: 2px;
    align-items: center;
}

.filter-range input {
    width: 45%;
    min-width: 0;
}

.filter-range span {
    color: rgba(165, 216, 255, 0.4);
    font-size: 10px;
    flex-shrink: 0;
}

.filter-clear-btn {
    background: rgba(77, 171, 247, 0.15);
    border: 1px solid rgba(77, 171, 247, 0.25);
    border-radius: 4px;
    color: #a5d8ff;
    font-size: 10px;
    padding: 3px 8px;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s ease;
}

.filter-clear-btn:hover {
    background: rgba(77, 171, 247, 0.3);
    color: #fff;
}

/* ===== 视图切换按钮组 ===== */
.view-toggle-group {
    display: flex;
    gap: 8px;
    margin-right: 12px;
    padding-right: 12px;
    border-right: 1px solid rgba(77, 171, 247, 0.25);
}

.view-toggle-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 1px solid rgba(77, 171, 247, 0.3);
    background: rgba(77, 171, 247, 0.1);
    color: #a5d8ff;
    white-space: nowrap;
}

.view-toggle-btn:hover {
    background: rgba(77, 171, 247, 0.2);
    color: #fff;
}

.view-toggle-btn.active {
    background: rgba(77, 171, 247, 0.4);
    border-color: rgba(77, 171, 247, 0.6);
    color: #fff;
    box-shadow: 0 2px 8px rgba(77, 171, 247, 0.3);
}

.view-toggle-btn i {
    font-size: 14px;
}

/* ✅ 视图切换按钮组分隔线样式 */
.view-toggle-group.section-divider {
    margin-top: 12px; /* 增加上边距，与主标题拉开距离 */
    padding-top: 12px; /* 内边距增强视觉层次 */
    border-top: 1px solid rgba(77, 171, 247, 0.2); /* 顶部细线分隔 */
}

/* ===== 视图切换标签栏（表格顶部，与表头融为一体）===== */
.table-view-tabs {
    display: flex;
    gap: 0;
    padding: 0;
    margin: 0;
    background: rgba(26, 58, 95, 0.95);
    border-bottom: 2px solid rgba(77, 171, 247, 0.3);
}

.table-view-tab {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 18px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    border-right: 1px solid rgba(77, 171, 247, 0.15);
    background: transparent;
    color: #a5d8ff;
    white-space: nowrap;
    font-family: inherit;
}

.table-view-tab:hover {
    background: rgba(77, 171, 247, 0.12);
    color: #fff;
}

.table-view-tab.active {
    background: rgba(77, 171, 247, 0.2);
    color: #fff;
    font-weight: 600;
    box-shadow: inset 0 -2px 0 #4dabf7;
}

.table-view-tab i {
    font-size: 13px;
}

/* ===== 状态标签（责任人汇总视图 - 持有状态列）===== */
.status-tag {
    display: inline-block;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 500;
    margin-right: 3px;
    margin-bottom: 2px;
    white-space: nowrap;
}

.status-tag-gray       { background: rgba(128, 128, 128, 0.2);  color: #aaa;        border: 1px solid rgba(128, 128, 128, 0.3); }
.status-tag-red        { background: rgba(255, 99, 132, 0.2);   color: #ff6384;     border: 1px solid rgba(255, 99, 132, 0.3); }
.status-tag-green      { background: rgba(75, 192, 192, 0.2);   color: #4bc0c0;     border: 1px solid rgba(75, 192, 192, 0.3); }
.status-tag-yellow     { background: rgba(255, 206, 86, 0.2);   color: #ffce56;     border: 1px solid rgba(255, 206, 86, 0.3); }
.status-tag-blue       { background: rgba(54, 162, 235, 0.2);   color: #36a2eb;     border: 1px solid rgba(54, 162, 235, 0.3); }
.status-tag-dark-gray  { background: rgba(108, 117, 125, 0.2);  color: #adb5bd;     border: 1px solid rgba(108, 117, 125, 0.3); }
.status-tag-orange     { background: rgba(255, 159, 64, 0.2);   color: #ff9f40;     border: 1px solid rgba(255, 159, 64, 0.3); }

/* ===== 责任人汇总行可点击样式 ===== */
.operator-summary-row {
    cursor: pointer;
    transition: background 0.2s ease;
}

.operator-summary-row:hover {
    background: rgba(77, 171, 247, 0.12) !important;
}

/* ===== 展开指示器箭头 ===== */
.expand-indicator {
    display: inline-block;
    font-size: 10px;
    transition: transform 0.2s ease;
    color: #4dabf7;
    margin-right: 2px;
}

/* ===== 行内展开子表容器 ===== */
.operator-detail-row {
    background: rgba(15, 30, 60, 0.5) !important;
}

.operator-detail-row:hover {
    background: rgba(15, 30, 60, 0.5) !important;
}

.operator-detail-row > td {
    padding: 0 !important;
    border-bottom: 2px solid rgba(77, 171, 247, 0.2) !important;
}

.operator-detail-wrapper {
    padding: 8px 12px 12px 12px;
    overflow-x: auto;
}

/* ===== 嵌套子表 ===== */
.operator-detail-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
    table-layout: fixed;
    background: rgba(10, 22, 45, 0.6);
    border-radius: 6px;
    overflow: hidden;
    border: 1px solid rgba(77, 171, 247, 0.15);
}

.operator-detail-table thead {
    background: rgba(26, 58, 95, 0.8);
}

.operator-detail-table th {
    padding: 8px 6px;
    text-align: left;
    color: #4dabf7;
    font-weight: 600;
    font-size: 11px;
    white-space: nowrap;
    border-bottom: 1px solid rgba(77, 171, 247, 0.2);
}

.operator-detail-table td {
    padding: 6px 6px;
    border-bottom: 1px solid rgba(77, 171, 247, 0.08);
    color: #d0d8e8;
    font-size: 12px;
}

.operator-detail-table tbody tr:hover {
    background: rgba(77, 171, 247, 0.06);
}

.operator-detail-table tfoot {
    background: rgba(26, 44, 92, 0.7);
    border-top: 1px solid rgba(77, 171, 247, 0.2);
}

.operator-detail-table .detail-summary-row td {
    padding: 8px 6px;
    font-weight: 600;
    color: #4dabf7;
    border-bottom: none;
}

/* 响应式适配 */
@media (max-width: 768px) {
    .modal-content {
        width: 95%;
        max-height: 90vh;
    }
    
    .modal-header h3 {
        font-size: 16px;
    }
    
    /* 窄屏：表格卡片标题与按钮各占一行 */
    .chart-card .chart-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .chart-card .chart-header .main-title {
        width: 100%;
    }
    
    .chart-card .status-toggle-group {
        margin-left: 0;
        flex-wrap: wrap;
    }
    
    .detail-table {
        font-size: 12px;
    }
    
    .detail-table th,
    .detail-table td {
        padding: 8px 6px;
    }
}

/* ===== 工序多选下拉选择器（工序汇总图表用）===== */
.chart-select-group {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.chart-select-group .chart-select-label {
    font-size: 11px;
    color: #a5d8ff;
    white-space: nowrap;
}

/* ===== 自定义多选下拉 ===== */
.cs-dropdown {
    position: relative;
    user-select: none;
}

.cs-dropdown-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    background: rgba(26, 58, 95, 0.8);
    border: 1px solid rgba(77, 171, 247, 0.3);
    border-radius: 4px;
    color: #a5d8ff;
    font-size: 11px;
    cursor: pointer;
    white-space: nowrap;
    max-width: 200px;
    transition: border-color 0.2s;
}

.cs-dropdown-btn:hover {
    border-color: rgba(77, 171, 247, 0.6);
}

.cs-dropdown-btn .cs-arrow {
    font-size: 10px;
    transition: transform 0.2s;
}

.cs-dropdown-btn.cs-open .cs-arrow {
    transform: rotate(180deg);
}

.cs-dropdown-panel {
    display: none;
    position: absolute;
    top: calc(100% + 4px);
    right: 0;
    z-index: 999;
    min-width: 200px;
    max-width: 280px;
    max-height: 260px;
    overflow-y: auto;
    background: rgba(18, 30, 48, 0.97);
    border: 1px solid rgba(77, 171, 247, 0.3);
    border-radius: 6px;
    padding: 4px 0;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
}

.cs-dropdown-panel.cs-open {
    display: block;
}

.cs-dropdown-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    cursor: pointer;
    font-size: 11px;
    color: #a5d8ff;
    transition: background 0.15s;
}

.cs-dropdown-item:hover {
    background: rgba(77, 171, 247, 0.12);
}

.cs-dropdown-item .cs-checkbox {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
    border: 1px solid rgba(77, 171, 247, 0.4);
    border-radius: 3px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 9px;
    color: transparent;
    transition: all 0.15s;
}

.cs-dropdown-item.cs-checked .cs-checkbox {
    background: rgba(77, 171, 247, 0.3);
    border-color: #4dabf7;
    color: #fff;
}

.cs-dropdown-item .cs-item-text {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cs-dropdown-item .cs-item-qty {
    color: rgba(165, 216, 255, 0.5);
    font-size: 10px;
    flex-shrink: 0;
    margin-left: auto;
}

.cs-dropdown-panel::-webkit-scrollbar {
    width: 5px;
}
.cs-dropdown-panel::-webkit-scrollbar-track {
    background: transparent;
}
.cs-dropdown-panel::-webkit-scrollbar-thumb {
    background: rgba(77, 171, 247, 0.3);
    border-radius: 3px;
}

/* 下拉面板内分隔线 */
.cs-dropdown-item.cs-divider {
    border-top: 1px solid rgba(77, 171, 247, 0.1);
    margin-top: 2px;
    padding-top: 8px;
}

/* ✅ 手机竖屏模式标题行高度修复：确保垂直堆叠布局不被后方max-height:60px限制 */
@media (max-width: 480px) {
    .header {
        max-height: none;
    }
}

