/* 合并单元格样式（不使用背景色） */
.cell-merged {
  font-weight: 500;
  vertical-align: middle !important;
}

/* 确保空单元格有最小高度（避免合并后的行塌陷）*/
/* 不强制设置 height，让 Element-UI 自己管理行高，避免固定列错位 */
.el-table .cell:empty::after {
  content: '\00a0';
}

/* 可编辑列（颜色由组件配置决定，这里只设置通用样式） */
.cell-editable {
  user-select: none;
}

/* ==================== Windows Excel 风格样式 ==================== */

/* 1. 表头样式 - 使用更深的颜色模拟 Excel */
.el-excel-table-wrapper.el-table thead {
  color: #000000 !important;
  font-weight: bold !important;
}

.el-excel-table-wrapper.el-table th.el-table__cell {
  background-color: #eef3f8 !important;
  color: #000000 !important;
  font-weight: bold !important;
}

.el-excel-table-wrapper.el-table thead.is-group th.el-table__cell {
  background-color: #eef3f8 !important;
}

/* 2. 边框颜色覆盖 - 使用更深的灰色使边框更明显 */
.el-excel-table-wrapper.el-table td.el-table__cell {
  border-bottom-color: #a0a0a0 !important;
  border-right-color: #a0a0a0 !important;
}

.el-excel-table-wrapper.el-table th.el-table__cell {
  border-bottom-color: #a0a0a0 !important;
  border-right-color: #a0a0a0 !important;
}

.el-excel-table-wrapper.el-table th.el-table__cell.is-leaf {
  border-bottom-color: #a0a0a0 !important;
}

.el-excel-table-wrapper.el-table--border .el-table__cell {
  border-right-color: #a0a0a0 !important;
}

.el-excel-table-wrapper.el-table--border,
.el-excel-table-wrapper.el-table--group {
  border-color: #a0a0a0 !important;
}

/* 覆盖伪元素边框线颜色 */
.el-excel-table-wrapper.el-table::before {
  background-color: #a0a0a0 !important;
}

.el-excel-table-wrapper.el-table--border::after,
.el-excel-table-wrapper.el-table--group::after {
  background-color: #a0a0a0 !important;
}

.el-excel-table-wrapper.el-table .el-table__fixed::before,
.el-excel-table-wrapper.el-table .el-table__fixed-right::before {
  background-color: #a0a0a0 !important;
}

.el-excel-table-wrapper.el-table .el-table__fixed-right-patch {
  border-bottom-color: #a0a0a0 !important;
}

.el-excel-table-wrapper.el-table .el-table__column-resize-proxy {
  border-left-color: #a0a0a0 !important;
}

/* 表头分组时的边框 */
.el-excel-table-wrapper.el-table thead.is-group th.el-table__cell {
  border-bottom-color: #a0a0a0 !important;
  border-right-color: #a0a0a0 !important;
}

/* 3. 总计行样式 - 使用更深的背景色 */
.el-excel-table-wrapper.el-table .el-table__footer-wrapper tbody td.el-table__cell {
  background-color: #eef3f8 !important;
  font-weight: bold !important;
  color: #000000 !important;
  border-top-color: #a0a0a0 !important;
}

.el-excel-table-wrapper.el-table .el-table__footer-wrapper tbody td .cell {
  font-weight: bold !important;
  color: #000000 !important;
}

/* 4. 固定列的总计行边框和样式 */
.el-excel-table-wrapper.el-table .el-table__fixed-footer-wrapper tbody td.el-table__cell {
  border-top-color: #a0a0a0 !important;
  background-color: #eef3f8 !important;
  color: #000000 !important;
  font-weight: bold !important;
  border-bottom-color: #a0a0a0 !important;
  border-right-color: #a0a0a0 !important;
}

/* 右固定列的总计行 */
.el-excel-table-wrapper.el-table .el-table__fixed-right-wrapper .el-table__footer-wrapper tbody td.el-table__cell {
  border-top-color: #a0a0a0 !important;
  background-color: #eef3f8 !important;
  color: #000000 !important;
  font-weight: bold !important;
  border-bottom-color: #a0a0a0 !important;
  border-left-color: #a0a0a0 !important;
}

/* 取消表格所有hover样式 */
/* 取消行的 hover */
.el-table--enable-row-hover .el-table__body tr:hover > td.el-table__cell,
.el-table__body tr.hover-row > td.el-table__cell {
  background-color: transparent !important;
}

/* 保留单元格的 hover (增加权重以覆盖行 hover 样式) */
.el-table--enable-row-hover .el-table__body tr td.el-table__cell:hover {
  background-color: #f5f7fa !important;
}

/* ==================== 公式高亮样式（必须放在最后以覆盖表头样式） ==================== */
.el-excel-table-wrapper.el-table th.el-table__cell.formula-highlight {
  background-color: #ffd966 !important;
  transition: background-color 0.3s ease;
}

.el-excel-table-wrapper.el-table th.el-table__cell.formula-highlight .cell {
  color: var(--formula-highlight-color, #cd7533) !important;
  font-weight: bold;
}
