.gfm-datatable {
  table-layout: auto; /* 固定表格布局 */
  width: 100%; /* 确保表格宽度为100% */
  word-break: break-word; /* 允许单词断行 */
  overflow-wrap: break-word; /* 兼容性更好的断行方式 */
  white-space: normal; /* 允许内容换行 */
}
/* 确保表头内容不会覆盖右侧排序三角形（适配换行/截断） */
.gfm-datatable-th,
.gfm-datatable-th-action {
  position: relative;
  box-sizing: border-box; /* 确保 padding 生效在布局内 */
  vertical-align: middle;
}

.gfm-datatable-th {
  --gfm-sort-gap: 0.3rem;
  min-width: calc(1.8rem + var(--gfm-sort-gap)); /* 确保有足够空间显示排序图标 */
}

/* 让任何直接子元素保持在图标下面，不与伪元素重叠 */
.gfm-datatable-th > * {
  padding-right: var(--gfm-sort-gap);
  z-index: 1;
  max-width: calc(100% - var(--gfm-sort-gap));
  display: block;
  /* 保证换行时不会溢出到右侧图标区域 */
  align-items: center;
  flex-wrap: wrap;
  overflow: hidden;
  word-break: break-word;
  overflow-wrap: break-word;
}

/* 调整排序三角的位置，适应更大的 gap */
.gfm-datatable-th::before,
.gfm-datatable-th::after {
  content: "";
  position: absolute;
  right: 0.25rem; /* 保持，但确保不与文字重叠 */
  border-left: 0.2rem solid transparent;
  border-right: 0.2rem solid transparent;
  pointer-events: none;
  z-index: 2;
}

/* 可选：如果表头内部使用了 span/div 作为 label，适配性的安全规则 */
.gfm-datatable-th .gfm-th-label,
.gfm-datatable-th span,
.gfm-datatable-th div {
  display: block;
  padding-right: 0; /* 使用父元素的 padding 保留空间，避免子元素额外撑宽 */
}

.gfm-datatable-th::before {
  top: calc(50% - 0.45rem);
  border-bottom: 0.35rem solid #adb5bd;
}

.gfm-datatable-th::after {
  top: calc(50% + 0.05rem);
  border-top: 0.35rem solid #adb5bd;
}

.gfm-datatable-th.gfm-sort-asc::before {
  border-bottom-color: #0d6efd;
}

.gfm-datatable-th.gfm-sort-asc::after {
  border-top-color: #adb5bd;
}

.gfm-datatable-th.gfm-sort-desc::before {
  border-bottom-color: #adb5bd;
}

.gfm-datatable-th.gfm-sort-desc::after {
  border-top-color: #0d6efd;
}
.gfm-datatable thead.sticky-top {
  border-bottom: 1px solid #dee2e6 !important; /* 确保滚动时下边框可见 */
  /* 可选：添加阴影增强视觉分隔 */
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1) !important;
}

.gfm-datatable-th-action {
  width: 70px !important; 
  max-width: 70px !important;
  overflow: visible !important; /* 确保内容不溢出 */
  white-space: nowrap !important;
  text-align: center;
  padding: 0 !important;
}

.gfm-datatable-td-action {
  width: 70px !important; 
  max-width: 70px !important;
  overflow: visible !important; /* 确保内容不溢出 */
  white-space: nowrap !important;
  text-align: center;
  vertical-align: top;
  padding: 0 !important;
}

.gfm-datatable .dropdown-menu {
  min-width: 200px; /* 确保菜单宽度不小于 200px，不受 td 90px 限制 */
  z-index: 1055; /* 高于 table 和其他元素 */
  position: absolute; /* 保持绝对定位，浮于 table 上 */
  white-space: nowrap; /* 防止菜单项换行 */
}

.gfm-datatable .dropdown-item {
  font-size: 1rem; /* 默认字体大小 */
}

@media (max-width: 767px) {
  .gfm-datatable .dropdown-item {
    font-size: 1.1rem; /* 手机上增大字体 */
  }
}

.gfm-link {
  color: blue;
  text-decoration: none;
  background-color: transparent;
  border: none;
  padding: 0;
}
.gfm-link:hover,
.gfm-link:focus {
  color: blue;
  text-decoration: underline;
}
.gfm-select-input-label {
  display: flex;
  flex-direction: column;
  width: 100%;
  align-items: top;
}
.gfm-select-input-inline {
  display: flex;
  flex-direction: row;
  width: 100%;
  align-items: stretch;
}

.gfm-select .badge {
  --bs-badge-padding-y: .5rem;  /* Bootstrap 5.3 变量 */
  padding-block: .5rem;         /* 兜底，非变量时也生效 */
  line-height: 1.15;
}
.gfm-select .btn-close-s {
  transform: scale(1.1);
}
.gfm-form-control {
  display: flex;
  border: 1px solid #ddd;
  border-radius: 0;
  padding: 0;
}
.gfm-form-control:first-of-type {
  border-top-left-radius: 0.375rem; /* 左上圆角 */
  border-bottom-left-radius: 0.375rem; /* 左下圆角 */
}
.gfm-form-control:last-of-type {
  border-top-right-radius: 0.375rem; /* 右上圆角 */
  border-bottom-right-radius: 0.375rem; /* 右下圆角 */
}
.gfm-form-control:not(:last-of-type) {
  border-right: none; /* 移除中间元素的右边框 */
}

.gfm-select, 
.gfm-select-input,
.gfm-selected,
.gfm-select-placeholder {
  box-sizing: border-box !important; /* 确保边框和内边距计入总宽度 */
}

.gfm-select {
  width: 100%;
  max-width: 100%;
  position: relative;
}

.gfm-selected {
  width: 100%;
  max-width: 100%;
  align-items: center;
  justify-content: space-between;
  display: flex;
  overflow: hidden;
  position: relative;
}

.gfm-select-options {
  position: absolute;
  top: 100%;
  left: 0;
  z-index: 1045;
  background-color: white;
  border: 1px solid #ddd;
  border-radius: 0.375rem;
  box-shadow: 0 0.25rem 0.5rem rgba(0, 0, 0, 0.1);
  width: 100%;
  max-height: 200px;
  overflow-y: auto;
  font-size: smaller;
  padding: 5px;
}

.gfm-select-options--with-search {
  display: flex;
  flex-direction: column;
  overflow-y: hidden;
  max-height: var(--gfm-select-options-max-height, 18rem);
}

.gfm-select-options--with-search .gfm-select-options-scroll {
  flex: 1 1 auto;
  overflow-y: auto;
}

.gfm-select-search-fixed {
  flex: 0 0 auto;
  margin-bottom: 0.5rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
  background: var(--bs-body-bg, #fff);
}

.gfm-select-placeholder {
  flex-grow: 1;
  align-items: center;
  color: #6c757d;
  margin-left: 12px;
  display: flex;
  flex-wrap: wrap;
  row-gap: 5px;
  column-gap: 5px;
  padding-top: 5px;
  padding-bottom: 5px;
  width: 100%;
}

.gfm-select-error {
  color: red;
  font-size: smaller;
}

.gfm-select-button {
  flex-shrink: 0;
  width: auto;
}

.gfm-select-all,
.gfm-select-none,
.gfm-select-reset {
  flex-shrink: 0;
  width: auto;
}

.gfm-title {
  font-style: bold;
  font-size: x-large;
  text-align: start;
  margin-top: 20pt;
  margin-bottom: 2pt;
}

.gfm-tab {
  font-size: small;
  width: 100%;
}

.gfm-tab-menu {
  font-size: small;
}
.gfm-tab-content {
  font-size: small;
  border: 1px solid #ddd;
  border-top: none;
  padding: 0.5rem;
}

.gfm-pc-search{
  font-size: small;
}

.gfm-pc-btn {
  border-style: groove;
  border:#ddd 1px solid;
  width: auto;
  font-size: x-small;
}
.gfm-pc-btn.active {
  color: white;
  background-color: blue;
}

.gfm-pc-list {
  max-height: 200px;
  overflow-y: auto;
  padding: 0.5rem 0; /* 上下内边距 */
  width: 100%;
}

.gfm-tooltip-longtext {
  --bs-tooltip-bg: white;
  --bs-tooltip-color: black;
  --bs-tooltip-max-width: 300px;
  --bs-tooltip-opacity: 1;
  border: 1px solid #ddd !important;
  box-shadow: 0 0.25rem 0.5rem rgba(0, 0, 0, 0.1) !important;
  font-size: small !important;
}

.gfm-tooltip-longtext .tooltip-inner {
  text-align: start;
}

