:root {
            --primary-color: #3498db;
            --secondary-color: #2c3e50;
            --background-color: #f8f9fa;
            --card-bg-color: #ffffff;
            --text-color: #333333;
            --border-color: #e0e0e0;
        }
        .dashboard-header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1000; /* 确保导航栏始终显示在其他元素上方 */
  background-color: #2c3e50; /* 保持原有背景色 */
}

        /* 为导出图片添加的样式 */
        .exporting-image .grid-stack > .grid-stack-item > .grid-stack-item-content {
            overflow: visible !important; /* 防止网格项裁剪内容 */
        }

        .exporting-image .card-widget {
            box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1) !important;
        }

        /* 可折叠侧边栏样式 */
        .sidebar {
            transition: width 0.3s ease;
            position: fixed;
            height: calc(100vh - 60px);
            width: 250px;
            overflow-y: auto;
        }

        .sidebar.collapsed {
            width: 60px;
        }

        .sidebar-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 15px;
        }

        .sidebar-controls {
            display: flex;
            gap: 5px;
        }

        .sidebar-menu li {
            position: relative;
            display: flex;
            align-items: center;
            padding: 10px 15px;
            transition: all 0.2s;
        }

        .sidebar-menu .nav-text {
            margin-left: 10px;
            transition: opacity 0.3s;
        }

        .sidebar.collapsed .nav-text {
            opacity: 0;
            width: 0;
            display: none;
        }

        .menu-item-controls {
            position: absolute;
            right: 10px;
            display: flex;
            gap: 5px;
        }

        .main-content {
            transition: margin-left 0.3s ease;
            margin-left: 250px;
        }

        .main-content.expanded {
            margin-left: 60px;
        }

        .edit-mode-controls {
            padding: 10px;
        }

        /* 编辑模式下菜单项的样式 */
        .edit-mode .sidebar-menu li {
            padding-right: 80px;
        }

        .edit-mode .menu-item-controls {
            display: flex !important;
        }

        /* 为内容区域添加上边距，防止被固定导航栏遮挡 */
        .main-content {
  padding-top: 60px; /* 调整此值以匹配导航栏的实际高度 */
}
        body {
            font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
            background-color: var(--background-color);
            color: var(--text-color);
            overflow-x: hidden;
        }

        .dashboard-header {
            background-color: var(--secondary-color);
            color: white;
            padding: 15px 0;
            box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
        }

        .dashboard-title {
            font-weight: 600;
            margin: 0;
            font-size: 1.5rem;
            padding-left: 6em;  /* 这个属性控制标题自定义数据大屏的左边距 */
        }

        .sidebar {
            background-color: var(--secondary-color);
            color: white;
            height: 100vh;
            position: fixed;
            width: 200px;  /* 侧边栏宽度 */
            z-index: 1000;
            transition: all 0.3s;
            overflow-y: auto;
        }

        .sidebar.collapsed {
            width: 60px;
        }

        .sidebar-header {
            padding: 15px;
            border-bottom: 1px solid rgba(255, 255, 255, 0.1);
        }

        .sidebar-menu {
            list-style: none;
            padding: 0;
            margin: 0;
        }

        .sidebar-menu li {
            padding: 10px 15px;
            border-bottom: 1px solid rgba(255, 255, 255, 0.05);
            cursor: pointer;
            transition: all 0.2s;
        }

        .sidebar-menu li:hover {
            background-color: rgba(255, 255, 255, 0.1);
        }

        .sidebar-menu li.active {
            background-color: var(--primary-color);
        }

        .sidebar-menu i {
            margin-right: 10px;
            width: 20px;
            text-align: center;
        }

        .main-content {
            margin-left: 200px;
            padding: 20px;
            transition: all 0.3s;
        }

        .main-content.expanded {
            margin-left: 60px;
        }

        .card-widget {
            background: var(--card-bg-color);
            border-radius: 5px;
            box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
            overflow: hidden;
            height: 100%;
        }

        .card-header {
            padding: 10px 15px;
            background-color: var(--primary-color);
            color: white;
            font-weight: 500;
            border-bottom: 1px solid var(--border-color);
            display: flex;
            justify-content: space-between;
            align-items: center;
        }

        .card-header .btn-sm {
            padding: 2px 5px;
            font-size: 0.75rem;
        }

        .card-body {
    padding: 0.5rem;
    height: calc(100% - 40px);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

        .grid-stack-item-content {
            overflow: visible !important;
        }

        /* 确保canvas能完全填充容器 */
        .chart-container canvas {
            width: 100% !important;
            height: 100% !important;
}

        .grid-stack > .grid-stack-item > .grid-stack-item-content {
            overflow: visible !important; /* 防止网格项裁剪内容 */
        }

        .chart-container {
    width: 100%;
    height: 100%;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}

        /* KPI Cards 样式 */
        .kpi-card {
            text-align: center;
            padding: 15px;
            height: 100%;
            display: flex;
            flex-direction: column;
            justify-content: center;
            overflow: visible !important;
        }

        .kpi-value {
            font-size: 4rem;   /* 增加字体/子号大小 */
            font-weight: 600;
            color: var(--primary-color);
            white-space: nowrap;
            overflow: visible;
        }

        .kpi-title {
            font-size: 0.9rem;
            color: #666;
            margin-top: 5px;
            overflow: visible;
        }

        /* 确保卡片内容容器不出现滚动条 */
        .card-widget .card-body {
    padding: 15px;
    overflow: visible;  /* 改为visible，防止内容被裁剪 */
    height: auto;      /* 让高度自动调整 */
    flex: 1;           /* 添加flex属性使其能伸展填充空间 */
    display: flex;
    flex-direction: column;
    position: relative;
}

        /* 数据管理面板样式 */
        .data-panel {
            position: fixed;
            right: -500px;
            top: 60px;
            width: 500px;
            height: calc(100vh - 60px);
            background-color: var(--card-bg-color);
            box-shadow: -2px 0 10px rgba(0, 0, 0, 0.1);
            z-index: 1050;
            transition: all 0.3s;
            overflow-y: auto;
            padding: 20px;
        }

        .data-panel.open {
            right: 0;
        }

        .close-panel {
            position: absolute;
            top: 10px;
            right: 10px;
            cursor: pointer;
            font-size: 1.2rem;
            border: 0;
            background: transparent;
            color: inherit;
            padding: 4px;
            line-height: 1;
        }

        /* 图表编辑对话框 */
        .modal-dialog.modal-xl {
            max-width: 90%;
        }

        /* 页面加载动画 */
        .loading {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background-color: rgba(255, 255, 255, 0.8);
            display: flex;
            justify-content: center;
            align-items: center;
            z-index: 2000;
        }

        .spinner-border {
            width: 3rem;
            height: 3rem;
        }

        /* 深色主题样式 */
        .dark-theme {
            --primary-color: #5e9dff;
            --secondary-color: #1a2a3a;
            --background-color: #121212;
            --card-bg-color: #1e1e1e;
            --text-color: #e0e0e0;
            --border-color: #333333;
        }

        .dark-theme .card-widget {
            background-color: var(--card-bg-color);
            color: var(--text-color);
        }

        .dark-theme .modal-content {
            background-color: var(--card-bg-color);
            color: var(--text-color);
        }

        .dark-theme .form-control,
        .dark-theme .form-select,
        .dark-theme .input-group-text {
            background-color: #2a2a2a;
            color: var(--text-color);
            border-color: var(--border-color);
        }

        /* 页面导航样式 */
        .dashboard-pages {
            display: none;
        }

        .dashboard-pages.active {
            display: block;
        }

        /* 响应式调整 */
        @media (max-width: 992px) {
            .sidebar {
                width: 60px;
            }

            .sidebar .nav-text {
                display: none;
            }

            .main-content {
                margin-left: 60px;
            }

            .data-panel {
                width: 100%;
            }
        }

        @media (max-width: 576px) {
            .main-content {
                margin-left: 0;
                padding: 10px;
            }

            .sidebar {
                display: none;
            }

        }

        /* 可拖动的分隔线样式 */
        .sidebar-resizer {
            width: 8px;
            height: 100%;
            position: fixed;
            left: 250px;
            top: 60px;
            background-color: transparent;
            cursor: ew-resize;
            z-index: 1010;
            transition: background-color 0.2s;
        }

        .sidebar-resizer:hover,
        .sidebar-resizer.dragging {
            background-color: rgba(100, 100, 100, 0.3);
        }

        .sidebar.collapsed + .sidebar-resizer {
            left: 60px;
        }

        /* KPI字号自定义样式 */
        .kpi-size-sm { font-size: 2.5rem !important; } /* 小 */
        .kpi-size-md { font-size: 4rem !important; }   /* 中 */
        .kpi-size-lg { font-size: 6rem !important; }   /* 大 */
        .kpi-size-xl { font-size: 8rem !important; }   /* 巨大 */

/* 轻量化上线版界面覆盖 */
:root {
    --primary-color: #2563eb;
    --secondary-color: #26394c;
    --background-color: #f4f7fb;
    --card-bg-color: #ffffff;
    --text-color: #1f2937;
    --border-color: #d8e0ea;
    --muted-text: #667085;
    --success-color: #0f9f6e;
    --panel-shadow: 0 18px 45px rgba(15, 23, 42, 0.14);
}

body {
    background: var(--background-color);
    color: var(--text-color);
}

.dashboard-header {
    height: 64px;
    padding: 0;
    background: #ffffff;
    color: var(--text-color);
    border-bottom: 1px solid var(--border-color);
    box-shadow: 0 1px 8px rgba(15, 23, 42, 0.05);
}

.dashboard-header .container-fluid,
.dashboard-header .row {
    height: 100%;
}

.dashboard-title {
    padding-left: 0;
    font-size: 1.28rem;
    line-height: 1.15;
    letter-spacing: 0;
    color: #172033;
}

.dashboard-subtitle {
    margin-top: 3px;
    font-size: 0.78rem;
    color: var(--muted-text);
}

#toggle-sidebar {
    border-color: var(--border-color);
    color: #334155;
    background: #f8fafc;
}

.toolbar-actions {
    gap: 8px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.toolbar-actions .btn {
    margin-right: 0 !important;
    border-radius: 6px;
    font-weight: 600;
    line-height: 1.25;
    border: 1px solid transparent;
}

.toolbar-actions .btn-light {
    background: #ffffff;
    border-color: var(--border-color);
    color: #172033;
}

.toolbar-actions .btn-secondary {
    background: #64748b;
}

.toolbar-actions .btn-info {
    background: #0ea5e9;
    border-color: #0ea5e9;
    color: #ffffff;
}

.sidebar {
    top: 64px;
    width: 200px;
    height: calc(100vh - 64px);
    background: #26394c;
    box-shadow: inset -1px 0 rgba(255, 255, 255, 0.04);
}

.sidebar-header {
    min-height: 58px;
    padding: 14px 16px;
}

.sidebar-header h5 {
    font-size: 1rem;
    font-weight: 700;
}

.sidebar-menu li {
    min-height: 46px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    font-weight: 600;
}

.sidebar-menu li.active {
    background: #3298d9;
}

.sidebar-resizer {
    top: 64px;
    left: 200px;
}

.main-content {
    min-height: 100vh;
    margin-left: 200px;
    padding: 88px 24px 24px;
}

.main-content.expanded {
    margin-left: 60px;
}

.dashboard-pages > h2 {
    margin: 0 0 16px !important;
    font-size: 1.15rem;
    font-weight: 700;
    color: #253044;
}

.empty-dashboard {
    min-height: calc(100vh - 160px);
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px dashed #c6d2df;
    background: #ffffff;
    border-radius: 8px;
}

.empty-dashboard-inner {
    max-width: 560px;
    padding: 36px 24px;
    text-align: center;
}

.empty-dashboard-icon {
    width: 58px;
    height: 58px;
    margin: 0 auto 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: #e8f2ff;
    color: var(--primary-color);
    font-size: 1.5rem;
}

.empty-dashboard h3 {
    margin-bottom: 10px;
    font-size: 1.45rem;
    font-weight: 750;
    color: #172033;
}

.empty-dashboard p {
    margin: 0 auto 20px;
    color: var(--muted-text);
    line-height: 1.75;
}

.empty-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
}

.empty-actions .btn {
    border-radius: 6px;
    font-weight: 600;
}

.data-panel {
    top: 64px;
    height: calc(100vh - 64px);
    box-shadow: var(--panel-shadow);
}

.data-panel {
    width: min(520px, 100vw);
    right: min(-520px, -100vw);
}

.card-widget {
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: 0 8px 22px rgba(15, 23, 42, 0.08);
}

.card-header {
    background: #2563eb;
    border-bottom: 0;
}

.help-modal .modal-header {
    align-items: flex-start;
}

.modal-subtitle {
    margin-top: 3px;
    font-size: 0.86rem;
    color: var(--muted-text);
}

.help-section {
    padding: 14px 0;
    border-bottom: 1px solid #edf1f6;
}

.help-section h6 {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    font-size: 1rem;
    font-weight: 750;
}

.help-section h6 span {
    width: 24px;
    height: 24px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: #e8f2ff;
    color: var(--primary-color);
    font-size: 0.8rem;
}

.help-section p {
    margin: 0;
    color: #4b5563;
    line-height: 1.75;
}

.help-tips {
    margin-top: 18px;
    padding: 12px 14px;
    border-radius: 8px;
    background: #f0fdf4;
    color: #166534;
}

@media (max-width: 1100px) {
    .dashboard-subtitle {
        display: none;
    }

    .toolbar-actions .btn {
        padding-inline: 8px;
    }
}

@media (max-width: 768px) {
    .dashboard-header {
        height: auto;
        min-height: 64px;
        padding: 8px 0;
    }

    .dashboard-title {
        font-size: 1.05rem;
    }

    .toolbar-actions {
        margin-top: 8px;
        justify-content: flex-start;
    }

    .sidebar {
        top: 74px;
    }

    .main-content {
        margin-left: 60px;
        padding: 116px 12px 16px;
    }

    .empty-dashboard {
        min-height: 420px;
    }
}

/* 现代化视觉增强 */
body {
    background: linear-gradient(180deg, #f7f9fc 0%, #eef3f8 100%);
}

.dashboard-header {
    backdrop-filter: blur(12px);
    background: rgba(255, 255, 255, 0.92);
}

.sidebar {
    background: linear-gradient(180deg, #172435 0%, #20354a 100%);
}

.sidebar-menu li {
    margin: 4px 8px;
    border: 0;
    border-radius: 7px;
}

.sidebar-menu li:hover {
    background: rgba(255, 255, 255, 0.09);
}

.sidebar-menu li.active {
    background: linear-gradient(135deg, #2f9be8, #2563eb);
    box-shadow: inset 0 1px rgba(255, 255, 255, 0.18);
}

.main-content {
    background: transparent;
}

.empty-dashboard {
    background:
        linear-gradient(#fff, #fff) padding-box,
        linear-gradient(135deg, rgba(37, 99, 235, .22), rgba(14, 165, 233, .12)) border-box;
    border: 1px solid transparent;
    box-shadow: 0 20px 60px rgba(15, 23, 42, 0.08);
}

.empty-dashboard-inner {
    transform: translateY(-8px);
}

.modal-content {
    border: 1px solid rgba(216, 224, 234, 0.86);
    border-radius: 8px;
    box-shadow: 0 28px 80px rgba(15, 23, 42, 0.28);
    overflow: hidden;
}

.modal-header {
    background: #ffffff;
    border-bottom: 1px solid #edf1f6;
    padding: 18px 22px;
}

.modal-title {
    font-weight: 800;
    color: #172033;
    letter-spacing: 0;
}

.modal-body {
    background: #f8fafc;
}

.modal-footer {
    background: #ffffff;
    border-top: 1px solid #edf1f6;
}

.form-label {
    margin-bottom: 6px;
    font-weight: 700;
    color: #334155;
}

.form-control,
.form-select {
    border-color: #d8e0ea;
    border-radius: 8px;
    min-height: 38px;
}

.form-control:focus,
.form-select:focus {
    border-color: #60a5fa;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.14);
}

.btn {
    border-radius: 7px;
    font-weight: 650;
}

#chartEditModal .modal-dialog {
    max-width: min(1120px, calc(100vw - 48px));
}

#chartEditModal .modal-body {
    padding: 20px;
}

#chartEditModal .row {
    --bs-gutter-x: 20px;
}

#chartEditModal .col-md-6 > .mb-3,
#chartEditModal #barLineAreaConfig,
#chartEditModal #pieDonutConfig,
#chartEditModal #radarConfig {
    padding: 14px;
    margin-bottom: 12px !important;
    background: #ffffff;
    border: 1px solid #e4eaf1;
    border-radius: 8px;
}

#chartEditModal .card {
    border: 1px solid #e4eaf1;
    border-radius: 8px;
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.08);
    overflow: hidden;
}

#chartEditModal .card-header {
    background: #ffffff;
    color: #172033;
    border-bottom: 1px solid #e4eaf1;
    font-weight: 800;
}

#chartEditModal .card-body {
    height: auto;
    min-height: 0;
    background: #ffffff;
}

.chart-preview-container {
    position: relative;
    width: 100%;
    height: 330px !important;
    min-height: 330px;
}

.chart-preview-container canvas {
    display: block;
    width: 100% !important;
    height: 100% !important;
}

.chart-preview-empty {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    color: #64748b;
    font-weight: 700;
    text-align: center;
    border: 1px dashed #cbd5e1;
    border-radius: 8px;
    background: #f8fafc;
}

.chart-preview-empty.d-none {
    display: none;
}

.widget-empty-state {
    position: absolute;
    inset: 12px;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 18px;
    border: 1px dashed #cbd5e1;
    border-radius: 8px;
    background: rgba(248, 250, 252, 0.94);
    color: #64748b;
    font-size: 14px;
    font-weight: 700;
    text-align: center;
    line-height: 1.5;
}

.y-axis-group,
.radar-value-group,
.axis-range-options {
    align-items: center;
    padding: 8px;
    background: #f8fafc;
    border: 1px solid #edf1f6;
    border-radius: 8px;
}

.axis-range-options .form-text {
    display: block;
    margin-top: 8px;
}

@media (max-width: 576px) {
    .dashboard-header {
        position: sticky;
        min-height: 0;
    }

    .dashboard-header .row {
        display: grid;
        grid-template-columns: auto minmax(0, 1fr);
        row-gap: 8px;
    }

    .dashboard-header .row > .col-auto:last-child {
        grid-column: 1 / -1;
        width: 100%;
    }

    .dashboard-title {
        padding-left: 0;
        font-size: 1rem;
        white-space: normal;
    }

    .toolbar-actions {
        display: grid !important;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
        width: 100%;
        align-items: stretch !important;
    }

    .toolbar-actions .btn {
        width: 100%;
        margin-right: 0 !important;
        white-space: nowrap;
    }

    .sidebar,
    .sidebar-resizer {
        display: none;
    }

    .main-content,
    .main-content.expanded {
        margin-left: 0;
        padding: 16px 10px 24px;
    }

    .data-panel {
        left: auto;
        right: -100%;
        width: 100%;
    }

    .data-panel.open {
        right: 0;
    }

    #chartEditModal .modal-dialog {
        max-width: calc(100vw - 16px);
        margin: 8px;
    }

    #chartEditModal .modal-body {
        padding: 12px;
    }
}
    
