:root {
            --primary: #c41e3a;
            --primary-dark: #9a1830;
            --primary-light: #fde8ec;
            --secondary: #1a3a5c;
            --secondary-light: #e8f0f8;
            --success: #0f9d58;
            --warning: #e65100;
            --info: #1565c0;
            --gray-50: #fafafa;
            --gray-100: #f5f5f5;
            --gray-200: #eeeeee;
            --gray-300: #e0e0e0;
            --gray-400: #bdbdbd;
            --gray-500: #9e9e9e;
            --gray-600: #757575;
            --gray-700: #616161;
            --gray-800: #424242;
            --gray-900: #212121;
            --white: #ffffff;
            --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
            --shadow: 0 1px 3px rgba(0,0,0,0.1);
            --shadow-md: 0 4px 6px rgba(0,0,0,0.07);
            --shadow-lg: 0 10px 15px rgba(0,0,0,0.1);
            --radius-sm: 4px;
            --radius: 8px;
            --radius-lg: 12px;
        }

        * { margin: 0; padding: 0; box-sizing: border-box; }

        html {
            height: 100%;
            overflow: hidden;
        }

        @supports (height: 100dvh) {
            html {
                height: 100dvh;
                max-height: 100dvh;
            }
        }

        body {
            font-family: 'PingFang SC', 'Microsoft YaHei', 'Noto Sans SC', sans-serif;
            background: var(--gray-100);
            color: var(--gray-800);
            line-height: 1.5;
            font-size: 14px;
            height: 100%;
            overflow: hidden;
            display: flex;
            flex-direction: column;
        }

        /* ===== Header ===== */
        .header {
            flex-shrink: 0;
            background: linear-gradient(135deg, var(--secondary) 0%, #0d2137 100%);
            color: var(--white);
            padding: 0 32px;
            height: 60px;
            display: flex;
            justify-content: space-between;
            align-items: center;
            box-shadow: var(--shadow-lg);
            position: sticky;
            top: 0;
            z-index: 100;
        }

        .header-brand {
            display: flex;
            align-items: center;
            gap: 12px;
        }

        .header-logo {
            width: 36px;
            height: 36px;
            background: var(--primary);
            border-radius: var(--radius);
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 20px;
        }

        .header-title {
            font-size: 18px;
            font-weight: 600;
            letter-spacing: 0.5px;
        }

        .header-subtitle {
            font-size: 12px;
            opacity: 0.7;
            margin-top: 2px;
        }

        .header-actions {
            display: flex;
            align-items: center;
            gap: 12px;
        }

        .header-user {
            display: flex;
            align-items: center;
            gap: 8px;
            padding: 6px 12px;
            background: rgba(255,255,255,0.1);
            border-radius: var(--radius);
            font-size: 13px;
        }

        .header-user .avatar {
            width: 28px;
            height: 28px;
            border-radius: 50%;
            background: var(--primary);
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 12px;
        }

        /* ===== Buttons ===== */
        .btn {
            padding: 8px 16px;
            border: none;
            border-radius: var(--radius-sm);
            cursor: pointer;
            font-size: 13px;
            font-weight: 500;
            display: inline-flex;
            align-items: center;
            gap: 6px;
            transition: all 0.2s;
            white-space: nowrap;
        }

        .btn:hover { transform: translateY(-1px); }
        .btn:active { transform: translateY(0); }

        .btn-primary {
            background: var(--primary);
            color: var(--white);
        }
        .btn-primary:hover { background: var(--primary-dark); }

        .btn-secondary {
            background: var(--secondary);
            color: var(--white);
        }

        .btn-outline {
            background: transparent;
            color: var(--gray-600);
            border: 1px solid var(--gray-300);
        }
        .btn-outline:hover {
            background: var(--gray-100);
            border-color: var(--gray-400);
        }

        .btn-ghost {
            background: transparent;
            color: var(--gray-500);
        }
        .btn-ghost:hover { background: rgba(0,0,0,0.05); }

        .btn-sm { padding: 5px 10px; font-size: 12px; }

        /* ===== Layout ===== */
        .layout {
            flex: 1;
            min-height: 0;
            display: flex;
            align-items: stretch;
            overflow: hidden;
        }

        /* ===== Sidebar ===== */
        .sidebar {
            flex-shrink: 0;
            width: 240px;
            align-self: stretch;
            background: var(--white);
            border-right: 1px solid var(--gray-200);
            padding: 16px 0;
            display: flex;
            flex-direction: column;
            min-height: 0;
            overflow-x: hidden;
            overflow-y: hidden;
        }

        .sidebar-section {
            padding: 0 16px;
            margin-bottom: 8px;
        }

        .sidebar-section-title {
            font-size: 11px;
            font-weight: 600;
            color: var(--gray-400);
            text-transform: uppercase;
            letter-spacing: 0.5px;
            padding: 8px 12px;
        }

        .nav-item {
            display: flex;
            align-items: center;
            gap: 10px;
            padding: 10px 12px;
            margin: 2px 8px;
            border-radius: var(--radius-sm);
            cursor: pointer;
            font-size: 13px;
            color: var(--gray-700);
            transition: all 0.15s;
            border: none;
            background: none;
            width: calc(100% - 16px);
            text-align: left;
        }

        .nav-item:hover {
            background: var(--gray-100);
            color: var(--gray-900);
        }

        .nav-item.active {
            background: var(--primary-light);
            color: var(--primary);
            font-weight: 600;
        }

        .nav-item .icon {
            font-size: 15px;
            width: 22px;
            text-align: center;
            display: inline-block;
        }

        .nav-item .badge {
            margin-left: auto;
            background: var(--primary);
            color: white;
            font-size: 10px;
            padding: 2px 6px;
            border-radius: 10px;
            font-weight: 600;
        }

        .sidebar-footer {
            margin-top: auto;
            padding: 10px 12px 14px;
            border-top: 1px solid var(--gray-200);
            background: linear-gradient(180deg, var(--white) 0%, var(--gray-50) 100%);
        }

        .data-source-card {
            border-radius: var(--radius);
            border: 1px solid var(--gray-200);
            background: var(--white);
            box-shadow: var(--shadow-sm);
            overflow: hidden;
            border-left: 3px solid var(--gray-300);
            transition: border-left-color 0.2s, box-shadow 0.2s;
        }

        .data-source-card--loaded {
            border-left-color: var(--primary);
            box-shadow: var(--shadow);
        }

        .data-source-card__top {
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 8px;
            padding: 8px 10px 0;
        }

        .data-source-card__label {
            font-size: 10px;
            font-weight: 700;
            letter-spacing: 0.08em;
            text-transform: uppercase;
            color: var(--gray-400);
        }

        .data-source-card__action {
            font-size: 11px;
            font-weight: 600;
            color: var(--primary);
            background: none;
            border: none;
            padding: 2px 6px;
            border-radius: var(--radius-sm);
            cursor: pointer;
            transition: background 0.15s, color 0.15s;
        }

        .data-source-card__action:hover {
            background: var(--primary-light);
            color: var(--primary-dark);
        }

        .data-source-card__action:focus-visible {
            outline: 2px solid var(--primary);
            outline-offset: 1px;
        }

        .data-source-card__action[hidden] {
            display: none !important;
        }

        .data-source-card__main {
            display: flex;
            align-items: flex-start;
            gap: 10px;
            padding: 10px 10px 12px;
            min-height: 56px;
        }

        .data-source-card__icon-wrap {
            flex-shrink: 0;
            width: 40px;
            height: 40px;
            border-radius: 10px;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 17px;
            background: var(--gray-100);
            color: var(--gray-500);
            transition: background 0.2s, color 0.2s;
        }

        .data-source-card--loaded .data-source-card__icon-wrap {
            background: var(--primary-light);
            color: var(--primary);
        }

        .data-source-card__text {
            flex: 1;
            min-width: 0;
        }

        .data-source-primary {
            font-size: 12px;
            font-weight: 600;
            color: var(--gray-800);
            line-height: 1.35;
            overflow: hidden;
            text-overflow: ellipsis;
            display: -webkit-box;
            -webkit-line-clamp: 2;
            -webkit-box-orient: vertical;
            word-break: break-all;
        }

        .data-source-card--empty .data-source-primary {
            color: var(--gray-600);
        }

        .data-source-sub {
            margin-top: 4px;
            font-size: 11px;
            line-height: 1.45;
            color: var(--gray-500);
        }

        .data-source-sub[hidden] {
            display: none !important;
        }

        .sidebar-data-delete-btn {
            flex-shrink: 0;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            width: 28px;
            height: 28px;
            padding: 0;
            border: none;
            border-radius: var(--radius-sm);
            background: transparent;
            color: var(--gray-400);
            cursor: pointer;
            transition: color 0.15s, background 0.15s;
        }

        .sidebar-data-delete-btn:hover {
            color: var(--danger, #c53030);
            background: rgba(197, 48, 48, 0.08);
        }

        .sidebar-data-delete-btn:focus-visible {
            outline: 2px solid var(--primary);
            outline-offset: 2px;
        }

        /* ===== Main Content ===== */
        .main {
            flex: 1;
            min-width: 0;
            min-height: 0;
            padding: 24px;
            overflow-y: auto;
        }

        .page-header {
            margin-bottom: 24px;
        }

        .page-header h2 {
            font-size: 20px;
            font-weight: 600;
            color: var(--gray-900);
            margin-bottom: 4px;
        }

        .page-header p {
            font-size: 13px;
            color: var(--gray-500);
        }

        /* 标题行左侧文案 + 右侧筛选项（质量概览） */
        .page-header--with-filters {
            display: flex;
            justify-content: space-between;
            align-items: center;
            gap: 16px 24px;
            flex-wrap: wrap;
        }

        .page-header-text {
            flex: 0 1 auto;
            min-width: 200px;
        }

        .page-header--with-filters .filter-bar--title-inline {
            flex: 1 1 auto;
            justify-content: flex-end;
            margin-bottom: 0;
            max-width: 100%;
            padding: 0;
            gap: 10px;
        }

        .page-header--with-filters .filter-bar--title-inline .filter-group select {
            min-width: 118px;
        }

        .page-header--with-filters .filter-bar--title-inline #dashYearFilter {
            min-width: 104px;
        }

        @media (max-width: 1100px) {
            .page-header--with-filters .filter-bar--title-inline {
                justify-content: flex-start;
                flex-basis: 100%;
            }
        }

        /* 承办单位 / 问题类型下拉：文案较长时限定宽度，避免撑破筛选行 */
        #dashUnitFilter,
        #unitDetailSelect,
        #queryUnitFilter,
        #dashProblemFilter,
        #unitProblemFilter,
        #procProblemFilter,
        #queryProblemFilter {
            max-width: 240px;
            min-width: 0;
            width: auto;
        }

        .page-header--with-filters .filter-bar--title-inline #dashUnitFilter,
        .page-header--with-filters .filter-bar--title-inline #dashProblemFilter {
            max-width: 200px;
        }

        /* ===== Cards ===== */
        .card {
            background: var(--white);
            border-radius: var(--radius);
            box-shadow: var(--shadow-sm);
            border: 1px solid var(--gray-200);
        }

        .card-header {
            padding: 16px 20px;
            border-bottom: 1px solid var(--gray-100);
            display: flex;
            justify-content: space-between;
            align-items: center;
        }

        .card-header h3 {
            font-size: 14px;
            font-weight: 600;
            color: var(--gray-800);
            display: flex;
            align-items: center;
            gap: 8px;
        }

        .card-header h3::before {
            content: '';
            width: 3px;
            height: 16px;
            background: var(--primary);
            border-radius: 2px;
        }

        .card-body {
            padding: 20px;
        }

        /* ===== Stats Grid ===== */
        .stats-grid {
            display: grid;
            grid-template-columns: repeat(4, 1fr);
            gap: 12px;
            margin-bottom: 18px;
        }

        .stat-item {
            background: var(--white);
            border-radius: var(--radius);
            padding: 20px;
            box-shadow: var(--shadow-sm);
            border: 1px solid var(--gray-200);
            transition: all 0.2s;
        }

        .stat-item:hover {
            box-shadow: var(--shadow-md);
            transform: translateY(-2px);
        }

        /* 统计卡片：左图标 + 右文案，压低行高 */
        .stats-grid .stat-item {
            display: flex;
            flex-direction: row;
            align-items: center;
            gap: 12px;
            padding: 12px 14px;
        }
        .stats-grid .stat-text {
            flex: 1;
            min-width: 0;
            display: flex;
            flex-direction: column;
            justify-content: center;
            gap: 2px;
        }

        .stat-item .stat-icon {
            width: 40px;
            height: 40px;
            border-radius: var(--radius);
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 18px;
            flex-shrink: 0;
        }
        .stats-grid .stat-item .stat-icon {
            width: 36px;
            height: 36px;
            font-size: 16px;
        }

        .stat-item.blue .stat-icon { background: #e3f2fd; }
        .stat-item.red .stat-icon { background: #ffebee; }
        .stat-item.orange .stat-icon { background: #fff3e0; }
        .stat-item.green .stat-icon { background: #e8f5e9; }

        .stat-item .stat-change {
            font-size: 11px;
            font-weight: 600;
            padding: 2px 6px;
            border-radius: 4px;
        }

        .stat-change.up { color: var(--success); background: #e8f5e9; }
        .stat-change.down { color: var(--primary); background: #ffebee; }

        .stat-item .stat-value {
            font-size: 28px;
            font-weight: 700;
            color: var(--gray-900);
            margin-bottom: 4px;
        }
        .stats-grid .stat-item .stat-value {
            font-size: 22px;
            margin-bottom: 0;
            line-height: 1.15;
        }

        .stat-item .stat-label {
            font-size: 13px;
            color: var(--gray-500);
        }
        .stats-grid .stat-item .stat-label {
            font-size: 12px;
            line-height: 1.25;
        }

        /* ===== Charts Grid ===== */
        .charts-grid {
            display: grid;
            grid-template-columns: repeat(2, 1fr);
            gap: 20px;
            margin-bottom: 24px;
        }

        /* 概览：合并图整行占满；下方两图顶部对齐 */
        .charts-grid--dashboard-main {
            align-items: start;
        }

        /* 承办单位×问题合并图：高度由 pairedUnitChartsHeight 写入 style */
        .chart-box--dashboard-cross-tab {
            min-height: 320px;
        }
        .chart-container {
            background: var(--white);
            border-radius: var(--radius);
            box-shadow: var(--shadow-sm);
            border: 1px solid var(--gray-200);
            overflow: hidden;
        }

        .chart-container.full-width {
            grid-column: 1 / -1;
        }

        .chart-header {
            padding: 16px 20px;
            border-bottom: 1px solid var(--gray-100);
            display: flex;
            justify-content: space-between;
            align-items: center;
        }

        .chart-header h4 {
            font-size: 14px;
            font-weight: 600;
            color: var(--gray-800);
        }

        .chart-actions {
            display: flex;
            gap: 6px;
        }

        .chart-box {
            width: 100%;
            height: 320px;
            padding: 10px;
        }

        /* 单位分析页：案件分布柱图高度由 JS 按单位数量动态设置 */
        .chart-box--unit-overview-bar {
            min-height: 260px;
        }

        /* 概览同排两张横向条形图（问题类型 / 检察官排名）：统一高度 */
        .chart-box--dash-row-chart {
            height: 420px;
        }

        .dashboard-data-hint {
            margin-bottom: 16px;
        }
        .dashboard-data-hint-inner {
            display: flex;
            align-items: flex-start;
            gap: 10px;
            padding: 12px 16px;
            background: var(--secondary-light);
            border: 1px solid var(--gray-200);
            border-radius: var(--radius);
            border-left: 4px solid var(--secondary);
            color: var(--gray-700);
            font-size: 13px;
            line-height: 1.55;
        }
        .dashboard-data-hint-inner i {
            color: var(--secondary);
            margin-top: 2px;
        }

        .chart-empty-msg {
            display: flex;
            align-items: center;
            justify-content: center;
            min-height: 200px;
            padding: 24px;
            box-sizing: border-box;
            color: var(--gray-500);
            font-size: 13px;
            text-align: center;
            line-height: 1.65;
        }
        .chart-empty-msg a {
            color: var(--primary);
            margin-left: 6px;
            text-decoration: none;
            font-weight: 600;
            white-space: nowrap;
        }
        .chart-empty-msg a:hover {
            text-decoration: underline;
        }

        /* ===== Tables ===== */
        .table-wrap {
            overflow-x: auto;
            border-radius: var(--radius);
        }

        table {
            width: 100%;
            border-collapse: collapse;
            font-size: 13px;
        }

        thead {
            background: var(--gray-50);
        }

        th {
            padding: 12px 16px;
            text-align: left;
            font-weight: 600;
            color: var(--gray-700);
            border-bottom: 2px solid var(--gray-200);
            white-space: nowrap;
            font-size: 12px;
            text-transform: uppercase;
            letter-spacing: 0.3px;
        }

        td {
            padding: 12px 16px;
            border-bottom: 1px solid var(--gray-100);
            color: var(--gray-800);
            max-width: 300px;
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
        }

        tr:hover td {
            background: var(--primary-light);
        }

        .table-footer {
            padding: 12px 16px;
            display: flex;
            justify-content: space-between;
            align-items: center;
            border-top: 1px solid var(--gray-100);
        }

        /* ===== Pagination ===== */
        .pagination {
            display: flex;
            gap: 4px;
        }

        .pagination button {
            padding: 5px 10px;
            border: 1px solid var(--gray-200);
            background: var(--white);
            border-radius: var(--radius-sm);
            cursor: pointer;
            font-size: 12px;
            color: var(--gray-600);
            transition: all 0.15s;
        }

        .pagination button:hover:not(:disabled) {
            border-color: var(--primary);
            color: var(--primary);
        }

        .pagination button.active {
            background: var(--primary);
            color: white;
            border-color: var(--primary);
        }

        .pagination button:disabled {
            opacity: 0.4;
            cursor: not-allowed;
        }

        /* ===== Filters ===== */
        .filter-bar {
            display: flex;
            gap: 10px;
            margin-bottom: 20px;
            flex-wrap: wrap;
            align-items: center;
            background: transparent;
            border: none;
            box-shadow: none;
            padding: 0;
        }

        .filter-group {
            display: flex;
            flex-direction: row;
            align-items: center;
            gap: 8px;
        }

        .filter-group select,
        .filter-group input {
            padding: 6px 10px;
            border: 1px solid var(--gray-300);
            border-radius: var(--radius-sm);
            font-size: 13px;
            color: var(--gray-700);
            background: transparent;
            outline: none;
        }

        .filter-group select:focus,
        .filter-group input:focus {
            border-color: var(--primary);
        }

        .search-box {
            position: relative;
            flex: 1;
            max-width: 400px;
        }

        .search-box input {
            width: 100%;
            padding: 8px 12px 8px 36px;
            border: 1px solid var(--gray-300);
            border-radius: var(--radius-sm);
            font-size: 13px;
            outline: none;
        }

        .search-box::before {
            content: '\9906';
            position: absolute;
            left: 12px;
            top: 50%;
            transform: translateY(-50%);
            font-size: 12px;
            opacity: 0.5;
        }

        /* ===== Alerts ===== */
        .alert {
            padding: 12px 16px;
            border-radius: var(--radius-sm);
            margin-bottom: 16px;
            display: flex;
            align-items: center;
            gap: 10px;
            font-size: 13px;
        }

        .alert-success { background: #e8f5e9; color: #2e7d32; border: 1px solid #c8e6c9; }
        .alert-warning { background: #fff3e0; color: #e65100; border: 1px solid #ffe0b2; }
        .alert-danger { background: #ffebee; color: #c62828; border: 1px solid #ffcdd2; }
        .alert-info { background: #e3f2fd; color: #1565c0; border: 1px solid #bbdefb; }

        /* Toast：fixed 栈，不占文档流，避免页面跳动 */
        .toast-container {
            position: fixed;
            top: 72px;
            right: 24px;
            left: auto;
            width: min(420px, calc(100vw - 48px));
            max-height: calc(100vh - 96px);
            overflow-y: auto;
            z-index: 5000;
            display: flex;
            flex-direction: column;
            gap: 10px;
            align-items: stretch;
            pointer-events: none;
        }

        .toast-container .toast-item {
            pointer-events: auto;
            margin-bottom: 0;
            flex-shrink: 0;
            box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1), 0 2px 8px rgba(0, 0, 0, 0.06);
            border-radius: var(--radius);
        }

        @media (max-width: 768px) {
            .toast-container {
                top: auto;
                bottom: max(24px, env(safe-area-inset-bottom, 0px));
                right: 16px;
                left: 16px;
                width: auto;
                max-height: 45vh;
            }
        }

        /* ===== Tags ===== */
        .tag {
            display: inline-flex;
            align-items: center;
            padding: 3px 8px;
            border-radius: 4px;
            font-size: 11px;
            font-weight: 600;
        }

        .tag-red { background: #ffebee; color: #c62828; }
        .tag-orange { background: #fff3e0; color: #e65100; }
        .tag-green { background: #e8f5e9; color: #2e7d32; }
        .tag-blue { background: #e3f2fd; color: #1565c0; }

        /* ===== Upload Area ===== */
        .upload-zone {
            border: 2px dashed var(--gray-300);
            border-radius: var(--radius-lg);
            padding: 40px;
            text-align: center;
            background: var(--gray-50);
            transition: all 0.2s;
            cursor: pointer;
        }

        .upload-zone:hover {
            border-color: var(--primary);
            background: var(--primary-light);
        }

        .upload-zone .upload-icon {
            font-size: 40px;
            margin-bottom: 12px;
        }

        .upload-zone h3 {
            font-size: 15px;
            color: var(--gray-800);
            margin-bottom: 4px;
        }

        .upload-zone p {
            font-size: 12px;
            color: var(--gray-500);
        }

        /* ===== Tabs ===== */
        .tabs {
            display: flex;
            gap: 4px;
            margin-bottom: 20px;
            border-bottom: 2px solid var(--gray-200);
        }

        .tab-btn {
            padding: 10px 16px;
            border: none;
            background: none;
            font-size: 13px;
            color: var(--gray-500);
            cursor: pointer;
            border-bottom: 2px solid transparent;
            margin-bottom: -2px;
            font-weight: 500;
            transition: all 0.2s;
        }

        .tab-btn:hover {
            color: var(--gray-700);
        }

        .tab-btn.active {
            color: var(--primary);
            border-bottom-color: var(--primary);
        }

        .tab-panel { display: none; }
        .tab-panel.active { display: block; }

        /* ===== Empty State ===== */
        .empty-state {
            text-align: center;
            padding: 60px 20px;
            color: var(--gray-400);
        }

        .empty-state .icon {
            font-size: 48px;
            margin-bottom: 16px;
        }

        .empty-state h3 {
            font-size: 16px;
            color: var(--gray-600);
            margin-bottom: 8px;
        }

        .empty-state p {
            font-size: 13px;
        }

        /* ===== Footer ===== */
        .footer {
            flex-shrink: 0;
            padding: 16px 24px;
            border-top: 1px solid var(--gray-200);
            background: var(--gray-100);
            display: flex;
            justify-content: space-between;
            align-items: center;
            font-size: 11px;
            color: var(--gray-400);
        }

        .footer-links {
            display: flex;
            gap: 16px;
        }

        .footer-links a {
            color: var(--gray-400);
            text-decoration: none;
        }

        .footer-links a:hover {
            color: var(--gray-600);
        }

        /* ===== Utilities ===== */
        .hidden { display: none !important; }
        .flex { display: flex; }
        .items-center { align-items: center; }
        .justify-between { justify-content: space-between; }
        .gap-2 { gap: 8px; }
        .gap-4 { gap: 16px; }
        .mb-4 { margin-bottom: 16px; }
        .mt-4 { margin-top: 16px; }
        .text-sm { font-size: 12px; }
        .text-muted { color: var(--gray-500); }
        .font-medium { font-weight: 500; }

        /* ===== Responsive ===== */
        @media (max-width: 1024px) {
            .stats-grid { grid-template-columns: repeat(2, 1fr); }
            .charts-grid { grid-template-columns: 1fr; }
            .sidebar { width: 200px; }
        }

        @media (max-width: 768px) {
            .stats-grid { grid-template-columns: 1fr; }
            .sidebar { display: none; }
            .header { padding: 0 16px; }
            .main { padding: 16px; }
        }

        /* ===== Loading ===== */
        .loading {
            display: inline-block;
            width: 16px;
            height: 16px;
            border: 2px solid var(--gray-200);
            border-top-color: var(--primary);
            border-radius: 50%;
            animation: spin 0.6s linear infinite;
        }

        @keyframes spin { to { transform: rotate(360deg); } }

        /* ===== Progress Bar ===== */
        .progress-bar {
            height: 4px;
            background: var(--gray-200);
            border-radius: 2px;
            overflow: hidden;
            margin-top: 12px;
        }

        .progress-bar .fill {
            height: 100%;
            background: var(--primary);
            border-radius: 2px;
            transition: width 0.3s;
        }

        /* ===== UI Redesign Enhancements ===== */

        /* Smooth page transitions */
        .page {
            animation: fadeIn 0.3s ease-out;
        }
        @keyframes fadeIn {
            from { opacity: 0; transform: translateY(8px); }
            to { opacity: 1; transform: translateY(0); }
        }

        /* Enhanced stat cards with gradient backgrounds */
        .stat-item {
            position: relative;
            overflow: hidden;
            border: 1px solid rgba(0,0,0,0.04);
            padding: 22px 22px 20px;
        }
        .stat-item::before {
            content: '';
            position: absolute;
            top: 0; right: 0;
            width: 80px; height: 80px;
            background: radial-gradient(circle, rgba(255,255,255,0.15) 0%, transparent 70%);
            border-radius: 50%;
            transform: translate(20px, -20px);
        }
        .stat-item.blue { background: linear-gradient(135deg, #fff 0%, #e3f2fd 100%); border-left: 4px solid #1565c0; }
        .stat-item.red { background: linear-gradient(135deg, #fff 0%, #ffebee 100%); border-left: 4px solid #c41e3a; }
        .stat-item.orange { background: linear-gradient(135deg, #fff 0%, #fff3e0 100%); border-left: 4px solid #e65100; }
        .stat-item.green { background: linear-gradient(135deg, #fff 0%, #e8f5e9 100%); border-left: 4px solid #2e7d32; }

        /* 勿用全局 .stat-icon 覆盖图标尺寸；由各上下文选择器控制 */

        /* Enhanced chart containers */
        .chart-container {
            transition: transform 0.2s, box-shadow 0.2s;
            border: 1px solid var(--gray-200);
        }
        .chart-container:hover {
            transform: translateY(-2px);
            box-shadow: var(--shadow-md);
        }
        .chart-header {
            background: linear-gradient(to right, var(--gray-50), transparent);
            margin: 0;
            padding: 14px 20px;
            border-bottom: 1px solid var(--gray-100);
        }
        .chart-header h4 {
            font-size: 14px;
            color: var(--secondary);
            font-weight: 600;
            display: flex;
            align-items: center;
            gap: 8px;
        }
        .chart-header h4::before {
            content: '';
            width: 3px; height: 16px;
            background: var(--primary);
            border-radius: 2px;
        }

        /* 筛选条：无卡片底、下拉透明底，与页面背景一体 */
        .filter-bar {
            background: transparent;
            border: none;
            box-shadow: none;
            border-radius: 0;
            padding: 0;
            display: flex;
            flex-wrap: wrap;
            align-items: center;
            gap: 10px;
        }
        .filter-group {
            display: flex;
            flex-direction: row;
            align-items: center;
            gap: 8px;
        }
        .filter-group select,
        .filter-group input {
            padding: 6px 10px;
            border: 1.5px solid var(--gray-300);
            border-radius: var(--radius-sm);
            font-size: 13px;
            background: transparent;
            min-width: 120px;
            transition: border-color 0.15s, box-shadow 0.15s;
        }

        .filter-bar--dashboard:not(.filter-bar--title-inline) {
            margin-bottom: 20px;
        }
        .filter-bar--dashboard .filter-group select {
            min-width: 152px;
        }
        .filter-bar--dashboard #dashYearFilter {
            min-width: 128px;
        }
        .filter-group select:focus,
        .filter-group input:focus {
            border-color: var(--primary);
            box-shadow: 0 0 0 3px rgba(196,30,58,0.08);
            outline: none;
        }
        .search-box {
            position: relative;
            flex: 1;
            max-width: 400px;
        }
        .search-box input {
            width: 100%;
            padding: 8px 12px 8px 32px;
            border: 1.5px solid var(--gray-300);
            border-radius: var(--radius-sm);
            font-size: 13px;
            background: transparent;
            transition: border-color 0.15s, box-shadow 0.15s;
        }
        .search-box input:focus {
            border-color: var(--primary);
            box-shadow: 0 0 0 3px rgba(196,30,58,0.08);
            outline: none;
        }
        .search-box::before {
            content: '\f002';
            font-family: 'Font Awesome 6 Free';
            font-weight: 900;
            position: absolute;
            left: 10px;
            top: 50%;
            transform: translateY(-50%);
            font-size: 12px;
            color: var(--gray-400);
        }

        /* Enhanced table */
        .table-wrap table {
            border-collapse: separate;
            border-spacing: 0;
        }
        .table-wrap th {
            background: linear-gradient(to bottom, var(--gray-100), var(--gray-50));
            font-weight: 600;
            font-size: 12px;
            text-transform: uppercase;
            letter-spacing: 0.3px;
            color: var(--gray-600);
            padding: 10px 14px;
            border-bottom: 2px solid var(--gray-300);
        }
        .table-wrap td {
            padding: 10px 14px;
            border-bottom: 1px solid var(--gray-100);
            transition: background 0.1s;
        }
        .table-wrap tbody tr:hover td {
            background: var(--primary-light);
        }
        .table-wrap tbody tr:nth-child(even) td {
            background: rgba(0,0,0,0.01);
        }
        .table-wrap tbody tr:nth-child(even):hover td {
            background: var(--primary-light);
        }

        /* Enhanced pagination */
        .pagination button {
            min-width: 32px;
            height: 32px;
            padding: 0 8px;
            border: 1px solid var(--gray-300);
            background: var(--white);
            border-radius: var(--radius-sm);
            cursor: pointer;
            font-size: 13px;
            transition: all 0.15s;
            color: var(--gray-700);
        }
        .pagination button:hover:not(:disabled) {
            border-color: var(--primary);
            color: var(--primary);
            background: var(--primary-light);
        }
        .pagination button.active {
            background: var(--primary);
            color: var(--white);
            border-color: var(--primary);
        }
        .pagination button:disabled {
            opacity: 0.4;
            cursor: not-allowed;
        }

        /* Enhanced buttons */
        .btn {
            transition: all 0.15s;
            position: relative;
            overflow: hidden;
        }
        .btn::after {
            content: '';
            position: absolute;
            top: 50%; left: 50%;
            width: 0; height: 0;
            background: rgba(255,255,255,0.2);
            border-radius: 50%;
            transform: translate(-50%, -50%);
            transition: width 0.3s, height 0.3s;
        }
        .btn:active::after {
            width: 200px; height: 200px;
        }
        .btn-primary { background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%); }
        .btn-primary:hover { background: linear-gradient(135deg, var(--primary-dark) 0%, #7a1325 100%); transform: translateY(-1px); box-shadow: 0 4px 12px rgba(196,30,58,0.3); }
        .btn-outline:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-light); transform: translateY(-1px); }

        /* Enhanced sidebar nav */
        .nav-item {
            position: relative;
            overflow: hidden;
        }
        .nav-item::before {
            content: '';
            position: absolute;
            left: 0; top: 0; bottom: 0;
            width: 3px;
            background: var(--primary);
            transform: scaleY(0);
            transition: transform 0.2s;
        }
        .nav-item.active::before,
        .nav-item:hover::before {
            transform: scaleY(1);
        }
        .nav-item.active {
            background: linear-gradient(to right, var(--primary-light), transparent);
            font-weight: 600;
        }

        /* Upload zone enhancement */
        .upload-area {
            transition: all 0.25s;
            position: relative;
            overflow: hidden;
        }
        .upload-area::before {
            content: '';
            position: absolute;
            top: -50%; left: -50%;
            width: 200%; height: 200%;
            background: radial-gradient(circle, rgba(196,30,58,0.03) 0%, transparent 60%);
            opacity: 0;
            transition: opacity 0.3s;
        }
        .upload-area:hover::before {
            opacity: 1;
        }
        .upload-area:hover {
            border-color: var(--primary);
            background: var(--primary-light);
            transform: translateY(-2px);
            box-shadow: var(--shadow-md);
        }

        /* Card header enhancement */
        .card-header {
            background: linear-gradient(to right, var(--gray-50), var(--white));
            border-bottom: 1px solid var(--gray-200);
        }
        .card-header h3 {
            color: var(--secondary);
            font-weight: 600;
        }

        /* Tag enhancements */
        .tag {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            min-width: 32px;
            height: 22px;
            padding: 0 8px;
            border-radius: 11px;
            font-size: 11px;
            font-weight: 600;
            letter-spacing: 0.3px;
        }
        .tag-red { background: linear-gradient(135deg, #ffebee, #ffcdd2); color: #b71c1c; }
        .tag-orange { background: linear-gradient(135deg, #fff3e0, #ffe0b2); color: #e65100; }
        .tag-blue { background: linear-gradient(135deg, #e3f2fd, #bbdefb); color: #1565c0; }

        /* Empty state enhancement */
        .empty-state {
            padding: 60px 20px;
            text-align: center;
            color: var(--gray-400);
        }
        .empty-state .icon {
            width: 64px; height: 64px;
            background: linear-gradient(135deg, var(--gray-100), var(--gray-200));
            border-radius: 50%;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            font-size: 24px;
            color: var(--gray-400);
            margin-bottom: 16px;
        }
        .empty-state h3 {
            color: var(--gray-600);
            font-size: 16px;
            margin-bottom: 8px;
        }

        /* Toast 动画（仅用于浮层提示） */
        .toast-container .alert.toast-item {
            border-left: 4px solid transparent;
            animation: toastSlideIn 0.28s ease-out;
        }
        @keyframes toastSlideIn {
            from { opacity: 0; transform: translateY(-10px); }
            to { opacity: 1; transform: translateY(0); }
        }
        .toast-container .toast-item.alert-success { border-left-color: var(--success); }
        .toast-container .toast-item.alert-danger { border-left-color: var(--primary); }
        .toast-container .toast-item.alert-info { border-left-color: var(--info); }
        .toast-container .toast-item.alert-warning { border-left-color: var(--warning); }

        /* Footer enhancement */
        .footer {
            flex-shrink: 0;
            background: linear-gradient(to right, var(--gray-50), var(--gray-100));
            border-top: 1px solid var(--gray-200);
        }

        /* ========== 案件查询页（布局对齐质量概览；搜索/重置独占最右一组） ========== */
        #page-query .page-header--query .page-header-text {
            max-width: min(560px, 100%);
        }

        #page-query .query-conditions-summary {
            margin-top: 8px;
            font-size: 13px;
            line-height: 1.55;
            color: var(--gray-600);
        }

        #page-query .query-conditions-summary:empty {
            display: none;
        }

        #page-query .query-summary-active {
            color: var(--gray-600);
        }

        #page-query .query-page-filter-bar.filter-bar--title-inline {
            justify-content: flex-start;
            align-items: center;
            flex-wrap: wrap;
            gap: 10px;
            padding: 0;
        }

        #page-query .query-page-search {
            flex: 1 1 200px;
            min-width: 160px;
            max-width: min(380px, 100%);
        }

        #page-query .query-page-search input {
            padding-top: 8px;
            padding-bottom: 8px;
            font-size: 13px;
        }

        #page-query .query-page-filter-bar .filter-group select {
            padding-left: 8px;
            padding-right: 22px;
            font-size: 12px;
        }

        #page-query .query-page-filter-bar #queryYearFilter {
            width: 92px;
            max-width: 92px;
        }

        #page-query .query-page-filter-bar #queryProsecutorFilter {
            width: 118px;
            max-width: 118px;
        }

        #page-query .query-page-filter-bar #queryUnitFilter {
            width: 128px;
            max-width: 128px;
        }

        #page-query .query-page-filter-bar #queryProblemFilter {
            width: 138px;
            max-width: 138px;
        }

        #page-query .query-filter-export {
            flex-shrink: 0;
        }

        #page-query .query-page-actions {
            display: flex;
            align-items: center;
            gap: 8px;
            flex-shrink: 0;
            margin-left: auto;
            padding-left: 12px;
            border-left: 1px solid var(--gray-200);
        }

        #page-query .query-result-card {
            border: 1px solid var(--gray-200);
            border-radius: var(--radius);
            overflow: hidden;
            box-shadow: var(--shadow-sm);
            margin-top: 8px;
        }

        #page-query .query-export-btn {
            display: inline-flex;
            align-items: center;
            gap: 6px;
            white-space: nowrap;
            padding: 5px 12px;
        }

        #page-query .query-export-btn .query-export-text {
            font-size: 12px;
        }

        #page-query .query-table-panel {
            background: var(--white);
        }

        #page-query .query-table-scroll {
            overflow-x: auto;
            overflow-y: visible;
            border-top: 1px solid var(--gray-100);
        }

        #page-query table.query-data-table {
            font-size: 13px;
        }

        #page-query table.query-data-table thead th {
            position: sticky;
            top: 0;
            z-index: 2;
            background: linear-gradient(to bottom, var(--gray-100), var(--gray-50));
            box-shadow: 0 1px 0 var(--gray-200);
            padding: 11px 14px;
            white-space: nowrap;
        }

        #page-query table.query-data-table td {
            max-width: 280px;
            vertical-align: top;
            padding: 10px 14px;
        }

        #page-query table.query-data-table td:nth-child(6),
        #page-query table.query-data-table td:nth-child(7) {
            max-width: 360px;
        }

        #page-query mark.query-hit {
            background: #fff3e0;
            color: var(--gray-900);
            padding: 0 2px;
            border-radius: 2px;
        }

        #page-query .query-table-footer {
            display: flex;
            justify-content: space-between;
            align-items: center;
            flex-wrap: wrap;
            padding: 12px 18px;
            background: var(--gray-50);
            border-top: 1px solid var(--gray-200);
            gap: 12px;
        }

        #page-query .query-footer-bar {
            display: flex;
            align-items: center;
            flex-wrap: wrap;
            gap: 10px 14px;
            margin-left: auto;
        }

        #page-query .query-footer-pagesize {
            font-size: 12px;
            padding: 5px 8px;
            min-width: 108px;
            max-width: 130px;
            font-variant-numeric: tabular-nums;
        }

        #page-query .query-result-count {
            font-size: 13px;
            color: var(--gray-600);
            font-variant-numeric: tabular-nums;
        }

        #page-query .query-pagination.pagination {
            margin-left: 0;
        }

        @media (max-width: 1100px) {
            #page-query .page-header--with-filters .query-page-filter-bar {
                flex-basis: 100%;
                justify-content: flex-start;
            }
        }

        /* Responsive filter bar */
        @media (max-width: 768px) {
            .filter-bar { flex-direction: column; align-items: stretch; }
            .filter-group select, .filter-group input { width: 100%; }
            .search-box { max-width: none; }
            #page-query .query-page-filter-bar.filter-bar--title-inline {
                align-items: stretch;
                gap: 10px;
            }
            #page-query .query-page-search {
                flex: 1 1 100%;
                max-width: none;
                min-width: 0;
            }
            #page-query .query-page-filter-bar #queryYearFilter,
            #page-query .query-page-filter-bar #queryProsecutorFilter,
            #page-query .query-page-filter-bar #queryUnitFilter,
            #page-query .query-page-filter-bar #queryProblemFilter {
                width: 100%;
                max-width: none;
            }
            #page-query .query-page-filter-bar .filter-group {
                flex: 1 1 calc(50% - 6px);
                min-width: min(160px, 100%);
            }
            #page-query .query-filter-export {
                flex: 1 1 100%;
                margin-left: 0;
            }
            #page-query .query-export-btn {
                width: 100%;
                justify-content: center;
            }
            #page-query .query-page-actions {
                margin-left: 0;
                flex: 1 1 100%;
                justify-content: flex-end;
                padding-left: 0;
                padding-top: 10px;
                margin-top: 4px;
                border-left: none;
                border-top: 1px dashed var(--gray-200);
            }
            #page-query .query-table-footer {
                flex-direction: column;
                align-items: stretch;
            }
            #page-query .query-footer-bar {
                margin-left: 0;
                flex-direction: column;
                align-items: stretch;
            }
            #page-query .query-footer-pagesize {
                max-width: none;
                width: 100%;
            }
            #page-query .query-pagination {
                justify-content: center;
            }
        }

        /* ===== Export center page ===== */
        .export-page-hint {
            display: flex;
            align-items: flex-start;
            gap: 10px;
            padding: 12px 16px;
            margin-bottom: 20px;
            background: var(--secondary-light);
            border: 1px solid var(--gray-300);
            border-radius: var(--radius);
            font-size: 13px;
            color: var(--secondary);
        }

        .export-page-hint .fa-info-circle {
            margin-top: 2px;
            flex-shrink: 0;
        }

        .export-options-grid {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
            gap: 20px;
            margin-bottom: 24px;
        }

        .export-option-card .card-body {
            display: flex;
            flex-direction: column;
            height: 100%;
            padding: 20px;
        }

        .export-option-icon {
            width: 44px;
            height: 44px;
            border-radius: var(--radius);
            background: var(--primary-light);
            color: var(--primary);
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 20px;
            margin-bottom: 14px;
        }

        .export-option-icon--raw {
            background: #e8f5e9;
            color: #2e7d32;
        }

        .export-option-title {
            font-size: 16px;
            font-weight: 600;
            color: var(--gray-900);
            margin-bottom: 8px;
        }

        .export-option-desc {
            font-size: 13px;
            color: var(--gray-600);
            line-height: 1.55;
            flex: 1;
            margin-bottom: 16px;
        }

        .export-option-btn {
            align-self: flex-start;
        }

        .export-option-btn:disabled {
            opacity: 0.45;
            cursor: not-allowed;
            pointer-events: none;
        }

        .export-page-note {
            border: 1px dashed var(--gray-300);
            background: var(--gray-50);
        }

        .export-page-note-body {
            padding: 16px 20px;
            font-size: 13px;
            color: var(--gray-600);
            line-height: 1.6;
        }

        .export-page-note-body strong {
            display: block;
            color: var(--gray-800);
            margin-bottom: 6px;
        }

        .export-page-note-body p {
            margin: 0;
        }