/* Admin theme primary swatch (#316AFF) */
.theme-colors .switch-select .color-input.color-primary-6 {
  background-color: #316AFF;
}

/* 全局 body 背景 + 默认主题色 #316AFF */
:root {
  --body-bg-rgb: 253, 253, 253;
  --default-body-bg-color: #f3f7f9;
  --primary-rgb: 49, 106, 255;
}
body {
  background-color: #f3f7f9;
}

/* DataTables 分页/长度/跳页：与 btn-sm 接近 */
.dataTables_wrapper .tp-dt-top {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 0.75rem;
}
.dataTables_wrapper .tp-dt-footer {
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid var(--default-border, #f3f3f3);
  align-items: center;
}
.dataTables_wrapper .tp-dt-pager {
  gap: 0.5rem 0.75rem;
}
.dataTables_wrapper .tp-dt-pager .dataTables_length {
  margin: 0;
}
.dataTables_wrapper .tp-dt-pager .dataTables_paginate {
  margin: 0;
}
.dataTables_wrapper .dataTables_paginate .pagination .page-link {
  padding: 0.25rem 0.5rem;
  font-size: 0.7875rem;
  line-height: 1.5;
  min-width: 2rem;
  text-align: center;
}
.dataTables_wrapper .dataTables_length,
.dataTables_wrapper .dataTables_filter,
.dataTables_wrapper .dataTables_info {
  font-size: 0.7875rem;
}
.dataTables_wrapper .dataTables_filter,
div.dataTables_wrapper div.dataTables_filter {
  text-align: end !important;
  float: none;
  margin-left: auto;
  padding-left: 0;
}
.dataTables_wrapper .dataTables_length label,
.dataTables_wrapper .dataTables_filter label {
  margin-bottom: 0;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  flex-wrap: wrap;
}
.dataTables_wrapper .dataTables_length select {
  font-size: 0.7875rem;
  padding: 0.25rem 1.75rem 0.25rem 0.5rem;
  height: calc(1.5em + 0.5rem + 2px);
  line-height: 1.5;
  border-radius: 0.25rem;
}
.dataTables_wrapper .dataTables_filter input {
  font-size: 0.7875rem;
  padding: 0.25rem 0.5rem;
  height: calc(1.5em + 0.5rem + 2px);
  line-height: 1.5;
  margin-left: 0 !important;
  margin-inline-start: 0 !important;
}
.dataTables_wrapper .dataTables_filter input::placeholder {
  color: #8c9097;
  opacity: 1;
}
.dataTables_wrapper .tp-dt-jump {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.7875rem;
  white-space: nowrap;
  margin-inline-start: 0.25rem;
}
.dataTables_wrapper .tp-dt-jump .form-control {
  width: 3.5rem;
  display: inline-block;
  padding: 0.25rem 0.35rem;
  font-size: 0.7875rem;
  height: calc(1.5em + 0.5rem + 2px);
  line-height: 1.5;
}
.dataTables_wrapper .dataTables_paginate {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 0.35rem;
}
.dataTables_wrapper .dataTables_info {
  padding-top: 0;
  display: flex;
  align-items: center;
  min-height: 31px;
}

/* 列表表格单元格更紧凑 */
.dataTables_wrapper table.dataTable > :not(caption) > * > * {
  padding: 0.4rem 0.55rem;
}

/* 表头用不透明底色，滚动时内容不会透出来 */
.dataTables_wrapper table.dataTable thead > tr > th,
.dataTables_wrapper .dataTables_scrollHead table thead > tr > th,
.table thead.table-primary > tr > th {
  --bs-table-bg: color-mix(in srgb, rgb(var(--primary-rgb)) 10%, #fff);
  background-color: color-mix(in srgb, rgb(var(--primary-rgb)) 10%, #fff) !important;
  color: var(--default-text-color, #000);
}

/* 侧栏导航文字放大 */
.app-sidebar .side-menu__label {
  font-size: 0.90rem;
  line-height: 1.25;
}
.app-sidebar .slide-menu.child1 .side-menu__item,
.app-sidebar .slide-menu.child2 .side-menu__item,
.app-sidebar .slide-menu.child3 .side-menu__item {
  font-size: 0.92rem;
}
.app-sidebar .side-menu__icon {
  font-size: 1.25rem;
  width: 1.25rem;
  height: 1.25rem;
}
.app-sidebar .side-menu__angle {
  font-size: 0.95rem;
}
.app-sidebar .slide__category .category-name {
  font-size: 0.72rem;
}

.app-sidebar .slide-menu.child1 .side-menu__item:before,
.app-sidebar .slide-menu.child2 .side-menu__item:before,
.app-sidebar .slide-menu.child3 .side-menu__item:before,
.app-sidebar .slide-menu.child1 .side-menu__item:hover:before,
.app-sidebar .slide-menu.child2 .side-menu__item:hover:before,
.app-sidebar .slide-menu.child3 .side-menu__item:hover:before,
.app-sidebar .slide-menu.child1 .side-menu__item.active:before,
.app-sidebar .slide-menu.child2 .side-menu__item.active:before,
.app-sidebar .slide-menu.child3 .side-menu__item.active:before {
  display: none !important;
  content: none !important;
}

/* 弹窗打开时避免滚动条消失导致页面左右抖动 */
body.modal-open {
  padding-right: 0 !important;
  overflow: hidden;
}
body.modal-open .app-header,
body.modal-open .app-sidebar {
  padding-right: 0 !important;
}

/* 权限规则树：连接线 + 折叠 */
.tp-rule-tree-wrap {
  border: 1px solid var(--default-border, #f3f3f3);
  border-radius: 0.35rem;
  padding: 0.75rem 1rem;
  background: #fff;
}
.tp-rule-tree {
  --tp-tree-indent: 1.5rem;
  --tp-tree-toggle: 1.25rem;
  list-style: none;
  margin: 0;
  padding: 0;
  position: relative;
}
.tp-rule-tree .tp-rule-tree {
  padding-left: var(--tp-tree-indent);
  margin-left: 0.65rem;
  border-left: 1px solid #d7dde5;
}
.tp-rule-tree__item {
  position: relative;
  margin: 0;
  padding: 0.1rem 0;
}
/* 横线：从竖线接到子节点文字左侧 */
.tp-rule-tree .tp-rule-tree > .tp-rule-tree__item::before {
  content: "";
  position: absolute;
  left: calc(-1 * var(--tp-tree-indent));
  top: 1rem;
  width: calc(var(--tp-tree-indent) + var(--tp-tree-toggle) + 0.2rem);
  border-top: 1px solid #d7dde5;
  z-index: 0;
  pointer-events: none;
}
/* 末项切断多余竖线 */
.tp-rule-tree .tp-rule-tree > .tp-rule-tree__item:last-child::after {
  content: "";
  position: absolute;
  left: calc(-1 * var(--tp-tree-indent));
  top: 1.05rem;
  bottom: 0;
  width: 1px;
  background: #fff;
  z-index: 0;
  pointer-events: none;
}
.tp-rule-tree__row {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 0.2rem;
  min-height: 2rem;
}
.tp-rule-tree__toggle {
  flex: 0 0 var(--tp-tree-toggle);
  width: var(--tp-tree-toggle);
  height: var(--tp-tree-toggle);
  padding: 0;
  border: 0;
  background: #fff;
  color: #6c757d;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  border-radius: 0.2rem;
}
.tp-rule-tree__toggle:not(.is-leaf):hover {
  background: rgba(var(--primary-rgb), 0.08);
  color: rgb(var(--primary-rgb));
}
.tp-rule-tree__toggle i {
  font-size: 1.1rem;
  transition: transform 0.15s ease;
}
.tp-rule-tree__toggle.is-leaf {
  background: transparent;
  visibility: visible;
  pointer-events: none;
}
.tp-rule-tree__item.is-collapsed > .tp-rule-tree__row .tp-rule-tree__toggle i {
  transform: rotate(-90deg);
}
.tp-rule-tree__item.is-collapsed > .tp-rule-tree__children {
  display: none;
}
.tp-rule-tree__node {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.3rem 0.55rem;
  border-radius: 0.3rem;
  color: var(--default-text-color, #333);
  text-decoration: none;
  line-height: 1.3;
  background: #fff;
}
.tp-rule-tree__node:hover {
  background: rgba(var(--primary-rgb), 0.06);
  color: inherit;
}
.tp-rule-tree__node.active {
  background: rgba(var(--primary-rgb), 0.12);
  color: rgb(var(--primary-rgb));
}
.tp-rule-tree__node .badge {
  font-weight: 500;
}

/* 权限组勾选树 */
.tp-rule-tree__check {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.25rem 0.45rem;
  border-radius: 0.3rem;
  background: #fff;
  min-width: 0;
}
.tp-rule-tree__check .form-check-input {
  margin-top: 0;
  flex-shrink: 0;
}
.tp-rule-tree__check .form-check-label {
  cursor: pointer;
  line-height: 1.35;
  word-break: break-all;
}
.tp-rule-tree__check:hover {
  background: rgba(var(--primary-rgb), 0.06);
}

/* 权限组勾选树：不显示折叠箭头占位可略缩 */
.tp-rule-tree-wrap--check .tp-rule-tree__toggle.is-leaf {
  flex: 0 0 0.55rem;
  width: 0.55rem;
  visibility: hidden;
}
.tp-rule-tree-wrap--check .tp-rule-tree .tp-rule-tree > .tp-rule-tree__item::before {
  width: calc(var(--tp-tree-indent) + 0.55rem);
}

/* 内容区铺满头部以下的视口，表格超出后在内部滚动 */
html:has(.page),
body:has(.page) {
  height: 100%;
  overflow: hidden;
}
.page {
  display: flex !important;
  flex-direction: column !important;
  justify-content: flex-start !important;
  height: 100vh !important;
  min-height: 100vh !important;
  overflow: hidden !important;
}
.main-content.app-content {
  flex: 1 1 auto;
  display: flex !important;
  flex-direction: column !important;
  height: calc(100vh - 3.75rem) !important;
  min-height: 0 !important;
  max-height: calc(100vh - 3.75rem);
  margin-block-end: 0 !important;
  overflow: hidden !important;
}
.main-content.app-content > .container-fluid {
  flex: 1 1 auto;
  height: 100%;
  min-height: 0;
  overflow: hidden;
  display: flex !important;
  flex-direction: column !important;
  box-sizing: border-box;
}
.main-content.app-content > .container-fluid > .card.custom-card,
.main-content.app-content > .container-fluid > .row,
.main-content.app-content > .container-fluid > .res-panel,
.main-content.app-content > .container-fluid > .diag-report {
  flex: 1 1 auto;
  min-height: 0;
  height: auto;
  margin-bottom: 0 !important;
  background: #fff;
  border-radius: 12px;
  padding: 16px 18px 18px;
}
.main-content.app-content > .container-fluid > .row {
  overflow: auto;
}
.main-content.app-content > .container-fluid > .card.custom-card {
  display: flex !important;
  flex-direction: column !important;
  overflow: hidden;
}
.main-content.app-content > .container-fluid > .card.custom-card > .card-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  display: flex;
  flex-direction: column;
}
.main-content.app-content > .container-fluid > .card.custom-card:has(table) > .card-body {
  overflow: hidden;
}
.main-content.app-content > .container-fluid > .card.custom-card:has(table) .table-responsive,
.main-content.app-content > .container-fluid > .card.custom-card:has(table) .dataTables_wrapper {
  flex: 1 1 auto;
  min-height: 0;
  height: auto;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.dataTables_wrapper > .row:not(.tp-dt-top):not(.tp-dt-footer) {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
}
.dataTables_wrapper > .row:not(.tp-dt-top):not(.tp-dt-footer) thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background-color: color-mix(in srgb, rgb(var(--primary-rgb)) 10%, #fff) !important;
}
.dataTables_wrapper:has(.dataTables_empty) > .row:not(.tp-dt-top):not(.tp-dt-footer),
.dataTables_wrapper:has(.dataTables_empty) > .row:not(.tp-dt-top):not(.tp-dt-footer) > [class*="col-"] {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
  height: 100%;
}
.dataTables_wrapper:has(.dataTables_empty) table.dataTable,
.dataTables_wrapper:has(.dataTables_empty) table.dataTable tbody,
.dataTables_wrapper:has(.dataTables_empty) table.dataTable tr,
.dataTables_wrapper:has(.dataTables_empty) td.dataTables_empty {
  height: 100%;
}
table.dataTable td.dataTables_empty {
  border-bottom: 0;
  color: #98a2b3;
  vertical-align: middle !important;
  background: url("../../public/null.png") center calc(50% - 28px) / 168px auto no-repeat;
  padding-top: 168px !important;
}
#notice-page-list {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
}
.tp-empty,
.res-empty {
  flex: 1 1 auto;
  min-height: 240px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: #98a2b3;
  text-align: center;
}
.tp-empty img,
.res-empty img {
  width: 80px;
  height: auto;
}
.header-balance {
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  line-height: 1;
}

.tp-select { position: relative; width: 100%; }
.tp-select.is-auto { width: auto; display: inline-block; }
.tp-select > select {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  margin: 0 !important;
  padding: 0 !important;
  opacity: 0 !important;
  pointer-events: none !important;
  border: 0 !important;
}
.tp-select-btn {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
  height: 38px;
  border: 1px solid #e9edf6;
  border-radius: 0.35rem;
  background: #fff;
  padding: 0 32px 0 12px;
  font-size: 13px;
  color: #232323;
  text-align: left;
  cursor: pointer;
  line-height: 1.2;
}
.tp-select.is-auto .tp-select-btn { width: auto; }
.tp-select.is-sm .tp-select-btn { height: 31px; font-size: 12px; border-radius: 0.25rem; }
.tp-select.is-pill .tp-select-btn { height: 32px; border-radius: 999px; border-color: #e5e7eb; color: #334155; }
.tp-select-btn span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tp-select-btn.is-placeholder { color: #64748b; }
.tp-select-btn::after {
  content: "";
  position: absolute;
  right: 12px;
  top: 50%;
  width: 12px;
  height: 12px;
  margin-top: -6px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath fill='%2364748b' d='M2.2 4.3 6 8l3.8-3.7-.9-.9L6 6.2 3.1 3.4z'/%3E%3C/svg%3E") center / 12px no-repeat;
  pointer-events: none;
}
.tp-select.is-open .tp-select-btn { border-color: #316aff; }
.tp-select.is-open .tp-select-btn::after { transform: rotate(180deg); }
.tp-select-menu {
  display: none;
  position: absolute;
  z-index: 30;
  top: calc(100% + 4px);
  left: 0;
  min-width: 100%;
  max-height: 240px;
  overflow: auto;
  background: #fff;
  border: 1px solid #e8eef5;
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.12);
  padding: 4px;
}
.tp-select.is-open .tp-select-menu { display: block; }
.tp-select-item {
  display: block;
  width: 100%;
  border: 0;
  background: transparent;
  text-align: left;
  border-radius: 6px;
  padding: 6px 10px;
  font-size: 13px;
  color: #334155;
  white-space: nowrap;
  cursor: pointer;
}
.tp-select-item:hover { background: #f4f7fb; }
.tp-select-item.is-on { background: #eff6ff; color: #316aff; }

/* 控制台等：整页自然滚动，不锁死视口高度 */
html:has(body.tp-page-scroll),
body.tp-page-scroll {
  height: auto !important;
  overflow: auto !important;
}
body.tp-page-scroll .page {
  height: auto !important;
  min-height: 100vh !important;
  overflow: visible !important;
}
body.tp-page-scroll .main-content.app-content {
  flex: none !important;
  height: auto !important;
  max-height: none !important;
  overflow: visible !important;
}
body.tp-page-scroll .main-content.app-content > .container-fluid {
  flex: none !important;
  height: auto !important;
  min-height: 0 !important;
  overflow: visible !important;
  display: block !important;
}
body.tp-page-scroll .main-content.app-content > .container-fluid > .row,
body.tp-page-scroll .main-content.app-content > .container-fluid > .card.custom-card {
  flex: none !important;
  overflow: visible !important;
}
body.tp-page-scroll .main-content.app-content > .container-fluid > .card.custom-card > .card-body {
  overflow: visible !important;
  display: block !important;
}
/* 控制台：区块间距与栅格（避免与列表页「margin-bottom:0」规则打架） */
.tp-console {
  display: flex;
  flex-direction: column;
  gap: 1.75rem;
  padding-bottom: 0.25rem;
}
body.tp-page-scroll .tp-console > .row {
  margin-top: 0 !important;
  margin-bottom: 0 !important;
  --bs-gutter-x: 1.25rem;
  --bs-gutter-y: 1.25rem;
}
.tp-console .row .row {
  --bs-gutter-x: 1rem;
  --bs-gutter-y: 1rem;
}
.tp-console .card.custom-card {
  margin-bottom: 0 !important;
}
body.tp-page-scroll .tp-console .card.custom-card > .card-body {
  display: block !important;
}
.tp-console-stat-row > [class*="col-"] {
  display: flex;
  align-items: stretch;
  min-width: 0;
}
.tp-console-stat-row > [class*="col-"] > a {
  min-width: 0;
}
.tp-console-row1 > [class*="col-"] {
  min-width: 0;
  display: flex;
  align-items: stretch;
}
.tp-console .row .row.tp-console-summary-row {
  --bs-gutter-x: 2rem;
  --bs-gutter-y: 2.25rem;
}
.tp-console .row .row.tp-console-summary-row > [class*="col-"] {
  padding-top: 0.35rem;
  padding-bottom: 0.35rem;
}
.tp-console-row3 > [class*="col-"] {
  min-width: 0;
}

/* 控制台第二行：三块卡片等高固定，内容区内部滚动 */
.tp-console .tp-console-row2 > [class*="col-"] {
  display: flex;
  align-items: stretch;
}
.tp-console .tp-console-panel {
  width: 100%;
  height: 26rem;
  max-height: 26rem;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.tp-console .tp-console-panel > .card-header,
.tp-console .tp-console-panel > .card-footer {
  flex-shrink: 0;
}
.tp-console .tp-console-panel > .card-body {
  flex: 1 1 auto;
  min-height: 0;
}
.tp-console .tp-console-panel > .card-body.tp-console-panel-scroll {
  overflow-y: auto;
  overflow-x: hidden;
}
body.tp-page-scroll .tp-console .tp-console-panel > .card-body.tp-console-panel-scroll {
  overflow-y: auto !important;
}
@media (max-width: 1399.98px) {
  .tp-console .tp-console-row2 > [class*="col-"] {
    min-height: 0;
  }
  .tp-console .tp-console-panel {
    height: 24rem;
    max-height: 24rem;
  }
}
