:root {
    /*品牌配色*/
    --brand-navy: #1a365d;
    --brand-navy-hover: #2d4a6b;
    --brand-blue: #5a8dee;
    --brand-blue-hover: #4a7bd4;
    --brand-green: #059669;
    --brand-green-hover: #047857;
    --brand-amber: #d97706;
    --page-bg: #f0f2f5;

    /*覆盖 Bootstrap 根级主题色变量,影响 .text-primary/.bg-primary/表单焦点框等直接引用这些变量的样式;
      注意 .btn-primary/.btn-success/.btn-danger 等按钮组件的颜色是编译时写死到组件级变量(--bs-btn-bg等)里的,
      不会跟随这里的根变量变化,需要在下面单独覆盖每个按钮class*/
    --bs-primary: var(--brand-blue);
    --bs-primary-rgb: 90, 141, 238;
    --bs-success: var(--brand-green);
    --bs-success-rgb: 5, 150, 105;
    --bs-danger: #dc2626;
    --bs-danger-rgb: 220, 38, 38;
}

body {
    background-color: var(--page-bg) !important;
}

/* ================= 按钮品牌配色(覆盖组件级变量) ================= */

.btn-primary {
    --bs-btn-bg: var(--brand-blue);
    --bs-btn-border-color: var(--brand-blue);
    --bs-btn-hover-bg: var(--brand-blue-hover);
    --bs-btn-hover-border-color: var(--brand-blue-hover);
    --bs-btn-active-bg: var(--brand-blue-hover);
    --bs-btn-active-border-color: var(--brand-blue-hover);
    --bs-btn-disabled-bg: var(--brand-blue);
    --bs-btn-disabled-border-color: var(--brand-blue);
}

.btn-outline-primary {
    --bs-btn-color: var(--brand-blue);
    --bs-btn-border-color: var(--brand-blue);
    --bs-btn-hover-bg: var(--brand-blue);
    --bs-btn-hover-border-color: var(--brand-blue);
    --bs-btn-active-bg: var(--brand-blue);
    --bs-btn-active-border-color: var(--brand-blue);
}

.btn-success {
    --bs-btn-bg: var(--brand-green);
    --bs-btn-border-color: var(--brand-green);
    --bs-btn-hover-bg: var(--brand-green-hover);
    --bs-btn-hover-border-color: var(--brand-green-hover);
    --bs-btn-active-bg: var(--brand-green-hover);
    --bs-btn-active-border-color: var(--brand-green-hover);
}

.btn-danger {
    --bs-btn-bg: #dc2626;
    --bs-btn-border-color: #dc2626;
    --bs-btn-hover-bg: #b91c1c;
    --bs-btn-hover-border-color: #b91c1c;
    --bs-btn-active-bg: #b91c1c;
    --bs-btn-active-border-color: #b91c1c;
}

/*表单控件focus态边框/阴影颜色,原Bootstrap文件里是写死的旧主题色,这里覆盖成品牌蓝*/
.form-control:focus,
.form-select:focus {
    border-color: var(--brand-blue);
    box-shadow: 0 0 0 .25rem rgba(90, 141, 238, .25);
}

.no-scrollbar::-webkit-scrollbar {
    display: none;
}

/*内容标题栏(页面标题 + 操作按钮)*/
.bg-content-bar {
    background-color: #fff;
}

/*内容卡片背景色;flex-grow让卡片在内容较少时也能撑满页面剩余高度,内容较多时按内容自然撑开*/
.bg-content {
    background-color: #fff;
    border: 1px solid #eef0f2;
    flex: 1 0 auto;
}

/* ================= 顶部Header + 左侧Sidebar 整体布局 =================
   header/sidebar 用 fixed 定位脱离文档流,body 用 padding 让出对应空间,
   这样页面自身的多个顶层div(标题栏、内容卡片)仍然是普通文档流,自然依次纵向排列,
   不能用 CSS Grid 命名区域给多个独立子元素共享同一区域——那样会互相层叠而不是纵向排列。
   body 设为纵向flex容器,让 .bg-content 能用 flex-grow 撑满剩余高度;
   header/sidebar 是 fixed 定位,脱离文档流,不受此影响,不会被拉进flex布局里。 */

body.app-body {
    /*顶栏56px(页签栏已并入顶栏,不再单独占行)*/
    padding-top: 56px;
    padding-left: 232px;
    min-height: 100vh;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
}

/*页面第一个内容区块与顶栏的间距统一收紧为8px(首区块原本带m-3/mt-3=12px,显空)。
  body前两个子元素是header/aside标签,第一个div即各页面首个内容区块(标题栏/白卡/欢迎卡);
  必须用!important——Bootstrap的m-3/mt-3工具类自带!important会覆盖普通声明*/
body.app-body > div:first-of-type {
    margin-top: 8px !important;
}

.app-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 56px;
    z-index: 1030;
    background-color: #5a8dee;
    box-shadow: 0 1px 3px rgba(0, 0, 0, .08);
    display: flex;
    align-items: center;
    /*三段从左到右:平台名/页签栏/用户区;页签栏靠左紧贴平台名,用户区margin-left:auto靠右*/
    padding: 0 1.5rem;
}

.app-header .brand {
    color: #fff;
    font-weight: 700;
    font-size: 1.15rem;
    /*平台名不换行、不被页签挤压*/
    white-space: nowrap;
    flex-shrink: 0;
}

/*顶栏右侧(日期/铃铛/用户)不换行、不被页签挤压、靠右对齐*/
.app-header .app-header-right {
    white-space: nowrap;
    flex-shrink: 0;
    margin-left: auto;
}

.app-header #loginName {
    color: #fff;
}

.app-header .btn-link {
    color: #fff;
}

.app-header .btn-link:hover {
    color: #fff;
}

.app-sidebar {
    position: fixed;
    top: 56px;
    left: 0;
    bottom: 0;
    width: 232px;
    overflow-y: auto;
    background-color: #0f172a;
    display: flex;
    flex-direction: column;
    padding: 1rem 0;
    z-index: 1020;
}

.app-sidebar .nav-link {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: .75rem 1.5rem;
    color: #cbd5e1;
    transition: background-color .15s, color .15s;
    cursor: pointer;
}

/*细滚动条,菜单超长时尽量少占位,保证选中项蓝底基本顶满*/
.app-sidebar::-webkit-scrollbar {
    width: 6px;
}

.app-sidebar::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, .2);
    border-radius: 3px;
}

.app-sidebar .nav-link:hover {
    background-color: var(--brand-navy-hover);
    color: #fff;
}

.app-sidebar .nav-link.active {
    background-color: var(--brand-blue);
    color: #fff;
}

/* 侧边栏分组标题(组内无可见菜单项时由JS整组隐藏) */
.app-sidebar .nav-group-title {
    padding: 1rem 1.5rem .35rem;
    font-size: 12px;
    color: #64748b;
    letter-spacing: .05em;
}

.app-sidebar .nav-group-title:first-child {
    padding-top: 0;
}

/* ================= 顶部多页签栏(嵌在顶栏内,页签紧贴顶栏下边框) ================= */
.app-tabs {
    flex: 1 1 auto;
    min-width: 0;
    /*页签栏整体最大宽度,超出后内部横向滚动,不挤压平台名和右侧用户区*/
    max-width: 45%;
    height: 100%;
    margin: 0 .75rem;
    display: flex;
    align-items: flex-end;
    gap: 4px;
}

.app-tabs-track {
    display: flex;
    align-items: flex-end;
    gap: 6px;
    /*不撑满可用宽度,收缩到内容宽度,使右箭头紧跟最后一个页签;
      页签过多时仍可收缩并横向滚动*/
    flex: 0 1 auto;
    min-width: 0;
    height: 100%;
    overflow-x: auto;
    scrollbar-width: none;
}

.app-tabs-track::-webkit-scrollbar {
    display: none;
}

.app-tab {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 32px;
    padding: 0 14px;
    border-radius: 6px 6px 0 0;
    background: rgba(255, 255, 255, .18);
    color: #fff;
    font-size: 13px;
    cursor: pointer;
    white-space: nowrap;
    user-select: none;
    flex-shrink: 0;
    /*单个页签最大宽度,超长省略,防止挤压平台名/右侧用户区换行*/
    max-width: 160px;
}

.app-tab span {
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
}

.app-tab:hover {
    background: rgba(255, 255, 255, .28);
}

.app-tab.active {
    background: #f0f2f5;
    color: #4a7bd4;
    font-weight: 500;
}

.app-tab .tab-close {
    font-size: 14px;
    line-height: 1;
}

.app-tab .tab-close:hover {
    color: #dc2626;
}

.app-tab.active .tab-close:hover {
    color: #dc2626;
}

/*左右滚动箭头固定在最左/最右端,与页签同高贴底,图标与页签文字同一水平线*/
.app-tabs-btn {
    color: #fff;
    cursor: pointer;
    padding: 0 6px;
    flex-shrink: 0;
    opacity: .8;
    align-self: flex-end;
    height: 32px;
    display: inline-flex;
    align-items: center;
}

.app-tabs-btn:hover {
    opacity: 1;
}

/* ================= 状态徽章 ================= */

/* ElementUI Tag 风格:浅底 + 同色细边框 + 彩色文字,圆角小胶囊 */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: .3rem;
    padding: 0 .55rem;
    height: 22px;
    border-radius: 4px;
    border: 1px solid transparent;
    font-size: .75rem;
    font-weight: 400;
    white-space: nowrap;
}

/* 徽章与顶部统计卡同色系:灰#8a94a6 蓝#7ba5f0 绿#059669 橙#d97706 浅红#e07b7b 青#0d9488 */
.status-badge-gray {
    background-color: #edeff3;
    border-color: #d7dce4;
    color: #5b6472;
}

.status-badge-blue {
    background-color: #e8f0fe;
    border-color: #c5d8f8;
    color: #3560ad;
}

.status-badge-green {
    background-color: #e1f5ec;
    border-color: #bfe9d7;
    color: #059669;
}

.status-badge-amber {
    background-color: #fdf3e3;
    border-color: #f3ddb4;
    color: #b45309;
}

.status-badge-red {
    background-color: #fbecec;
    border-color: #f2cccc;
    color: #b05252;
}

.status-badge-cyan {
    background-color: #e2f5f2;
    border-color: #bfe6e0;
    color: #0f766e;
}

@keyframes ajax-mask-animation {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

.ajax-mask {
    position: fixed;
    width: 100vw;
    height: 100vh;
    top: 0;
    left: 0;
    background-color: #00000055;
    z-index: 9999999;
    text-align: center;
    padding-top: calc(50vh - 60px);
}

.ajax-mask-animation {
    animation: ajax-mask-animation 5s linear infinite;
    width: 100px;
    height: 100px;
    border: 4px dashed white;
    border-radius: 50%;
    display: inline-block;
}

/*jquery.datatable的背景色禁用*/
.table > :not(caption) > * > * {
    background-color: unset;
}

/* ================= 统计卡(首页工作台/各列表页搜索区上方通用) ================= */
.stat-card {
    background: #fff;
    border: 1px solid #eef0f2;
    border-radius: 8px;
    padding: 16px 18px 14px;
    height: 100%;
    transition: transform .15s, box-shadow .15s;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, .08);
}

.stat-card-label {
    font-size: 13px;
    color: #6b7280;
}

.stat-card-value {
    font-size: 30px;
    font-weight: 800;
    color: #111827;
    line-height: 1.25;
}

.stat-card-desc {
    font-size: 12px;
    color: #9ca3af;
}

.stat-card-desc .desc-dot {
    font-size: 10px;
    margin-right: 4px;
}

.stat-card .progress {
    height: 4px;
    background-color: #f3f4f6;
}

/* ================= 列表页统计卡(彩色实心大色块,同参考系统) ================= */
.stat-card-solid {
    border-radius: 8px;
    padding: 16px 18px;
    height: 100%;
    color: #fff;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    transition: transform .15s, box-shadow .15s;
}

.stat-card-solid:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, .18);
}

.stat-card-solid .solid-label {
    font-size: 13px;
    opacity: .85;
}

.stat-card-solid .solid-value {
    font-size: 30px;
    font-weight: 800;
    line-height: 1.25;
}

.stat-card-solid .solid-desc {
    font-size: 12px;
    opacity: .75;
}

/*右上角白色半透明圆形底图标*/
.stat-card-solid .solid-icon {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    /*白色圆环图标(模板风格)*/
    background-color: transparent;
    border: 2px solid rgba(255, 255, 255, .55);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 21px;
    flex-shrink: 0;
    margin-left: 12px;
}

/* ================= 列表页三段式白卡(统计卡/搜索行/表格各自独立白卡,灰底间隔,同参考系统) ================= */
.list-card {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(15, 34, 87, .06);
    padding: 15px;
}

/*表格表头/数据行(表头浅灰底区分,行高30px)*/
table.dataTable thead th {
    background-color: #f8fafc !important;
    font-weight: 600;
    height: 30px;
    padding-top: 4px;
    padding-bottom: 4px;
    vertical-align: middle;
    /*表头一律不换行(2026-10-22全局要求),文字过长时由.th-clamp省略号截断*/
    white-space: nowrap;
}

/*表头不换行,超出省略号截断;JS初始化时把表头文字包进span.th-clamp*/
table.dataTable thead th .th-clamp {
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.3;
}

/*编辑页顶部板块Tab:每个按钮文字单行不折行(如"附件目录"不被挤成两行),
  整排放不下时由nav-tabs自身的flex-wrap让按钮整体折到下一行*/
#mainNav .nav-link {
    white-space: nowrap;
    /*左右内边距在Bootstrap默认1rem基础上各减2px;去掉按钮自身圆角和边框*/
    --bs-nav-link-padding-x: 0.875rem;
    border-radius: 0;
    border: 0;
}

/*选中Tab:使用浅青底(比#f7ffff略深,选中态更明显),不画Bootstrap默认的边框激活态*/
#mainNav .nav-link.active {
    background-color: #d9f0f0;
    border: 0;
}

/*去掉Tab栏底部横线,配合无边框按钮使用*/
#mainNav.nav-tabs {
    border-bottom: none;
}

/*隐藏DataTables表头排序箭头(参考系统表头无箭头;排序功能本身保留,初始order照常生效)*/
table.dataTable thead th.sorting:before,
table.dataTable thead th.sorting:after,
table.dataTable thead th.sorting_asc:before,
table.dataTable thead th.sorting_asc:after,
table.dataTable thead th.sorting_desc:before,
table.dataTable thead th.sorting_desc:after,
table.dataTable thead th.sorting_asc_disabled:before,
table.dataTable thead th.sorting_asc_disabled:after,
table.dataTable thead th.sorting_desc_disabled:before,
table.dataTable thead th.sorting_desc_disabled:after {
    display: none !important;
}

table.dataTable tbody td {
    height: 30px;
    vertical-align: middle;
}

/*分页行"共N条"与"N条/页"下拉框垂直居中对齐(去掉DataTables默认padding-top导致的文字下偏)*/
.dataTables_wrapper .dataTables_info {
    padding-top: 0 !important;
    white-space: nowrap;
}

.dataTables_wrapper .dataTables_length label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 0;
    white-space: nowrap;
}

.dataTables_wrapper .dataTables_length select {
    margin: 0;
}

/*分页条按钮:方形带边框,当前页蓝色填充白字;与整体列表风格统一*/
.dataTables_wrapper .dataTables_paginate {
    padding-top: 0;
    margin: 0;
}

.dataTables_wrapper .dataTables_paginate .pagination {
    margin-bottom: 0;
    gap: 4px;
}

.dataTables_wrapper .dataTables_paginate .page-item .page-link {
    min-width: 28px;
    height: 28px;
    padding: 0 8px;
    line-height: 26px;
    text-align: center;
    border: 1px solid #d9d9d9;
    border-radius: 2px;
    color: #333;
    background: #fff;
}

.dataTables_wrapper .dataTables_paginate .page-item.active .page-link {
    background: #5a8dee;
    border-color: #5a8dee;
    color: #fff;
}

.dataTables_wrapper .dataTables_paginate .page-item:not(.active):not(.disabled) .page-link:hover {
    color: #5a8dee;
    border-color: #5a8dee;
    background: #fff;
}

.dataTables_wrapper .dataTables_paginate .page-item.disabled .page-link {
    color: #bfbfbf;
    background: #fff;
}
