/*
 * LinsGeek ERP —— 标准表格（el-table）手机卡片版（配合 42-table-cards.js）
 * 只在手机宽度、被 JS 标记为 data-lg-tc 的表格上生效；电脑/平板不受影响。
 * 回滚：删除 42-table-cards.css + 42-table-cards.js。
 */
body.lg-tcards .el-table[data-lg-tc] {
  --el-table-border-color: transparent; --el-table-bg-color: transparent; --el-table-tr-bg-color: transparent;
  background: transparent !important; height: auto !important; max-height: none !important;
  min-width: 0 !important; width: 100% !important; overflow: visible !important;
}
body.lg-tcards [data-lg-xscroll]:has(> .el-table[data-lg-tc]),
body.lg-tcards [data-lg-xscroll]:has(.el-table[data-lg-tc]) { overflow-x: visible !important; }
body.lg-tcards .el-table[data-lg-tc] .el-table__inner-wrapper { height: auto !important; }
body.lg-tcards .el-table[data-lg-tc] .el-table__inner-wrapper::before,
body.lg-tcards .el-table[data-lg-tc] .el-table__border-left-patch,
body.lg-tcards .el-table[data-lg-tc]::before,
body.lg-tcards .el-table[data-lg-tc]::after { display: none !important; }
/* 表头不显示（每格前面有列名） */
body.lg-tcards .el-table[data-lg-tc] .el-table__header-wrapper,
body.lg-tcards .el-table[data-lg-tc] .el-table__fixed-header-wrapper { display: none !important; }
/* 表体：取消固定高度和横向滚动 */
body.lg-tcards .el-table[data-lg-tc] .el-table__body-wrapper,
body.lg-tcards .el-table[data-lg-tc] .el-table__body-wrapper .el-scrollbar,
body.lg-tcards .el-table[data-lg-tc] .el-table__body-wrapper .el-scrollbar__wrap {
  height: auto !important; max-height: none !important; overflow: visible !important;
}
body.lg-tcards .el-table[data-lg-tc] .el-scrollbar__bar { display: none !important; }
body.lg-tcards .el-table[data-lg-tc] table.el-table__body { display: block; width: 100% !important; table-layout: auto; }
body.lg-tcards .el-table[data-lg-tc] table.el-table__body colgroup { display: none; }
body.lg-tcards .el-table[data-lg-tc] table.el-table__body tbody { display: block; }

/* 一行 = 一张卡片 */
body.lg-tcards .el-table[data-lg-tc] tr.el-table__row {
  display: flex; flex-direction: column; position: relative;
  margin: 0 0 12px; padding: 6px 14px 4px;
  background: #fff !important; border: 1px solid rgba(15, 35, 30, .08); border-radius: 16px;
  box-shadow: 0 1px 2px rgba(16,24,40,.04), 0 8px 22px -16px rgba(13,123,109,.25);
}
body.lg-tcards .el-table[data-lg-tc] tr.el-table__row:hover > td { background: transparent !important; }
body.lg-tcards .el-table[data-lg-tc] tr.el-table__row > td {
  display: flex; align-items: flex-start; gap: 12px;
  width: auto !important; min-width: 0 !important; max-width: none !important;
  position: static !important; left: auto !important; right: auto !important;
  padding: 8px 0 !important; border: 0 !important; border-top: 1px dashed rgba(15,35,30,.08) !important;
  background: transparent !important; box-shadow: none !important; text-align: left !important;
}
body.lg-tcards .el-table[data-lg-tc] tr.el-table__row > td:first-child,
body.lg-tcards .el-table[data-lg-tc] tr.el-table__row > td[data-lg-role="sel"] + td { border-top: 0 !important; }
/* 列名 */
body.lg-tcards .el-table[data-lg-tc] tr.el-table__row > td[data-lg-label]:not([data-lg-label=""])::before {
  content: attr(data-lg-label); flex: 0 0 92px; max-width: 40%;
  font-size: 12px; line-height: 1.6; font-weight: 600; color: #8a9794; padding-top: 1px;
  overflow-wrap: anywhere;
}
body.lg-tcards .el-table[data-lg-tc] tr.el-table__row > td > .cell {
  flex: 1 1 auto; min-width: 0; padding: 0 !important; width: auto !important;
  white-space: normal !important; overflow-wrap: anywhere; word-break: normal; line-height: 1.6;
  text-overflow: clip; overflow: visible; display: block;
}
body.lg-tcards .el-table[data-lg-tc] tr.el-table__row > td > .cell .el-tooltip,
body.lg-tcards .el-table[data-lg-tc] tr.el-table__row > td > .cell.el-tooltip { white-space: normal !important; width: auto !important; }
/* 勾选框：卡片右上角 */
body.lg-tcards .el-table[data-lg-tc] tr.el-table__row > td[data-lg-role="sel"] {
  position: absolute !important; top: 8px; right: 12px !important; left: auto !important;
  width: auto !important; padding: 0 !important; border: 0 !important; z-index: 1;
}
body.lg-tcards .el-table[data-lg-tc] tr.el-table__row > td[data-lg-role="sel"]::before { display: none !important; }
body.lg-tcards .el-table[data-lg-tc] tr.el-table__row:has(> td[data-lg-role="sel"]) > td:nth-child(2) { padding-right: 32px !important; }
/* 操作按钮：卡片底部一行 */
body.lg-tcards .el-table[data-lg-tc] tr.el-table__row > td[data-lg-role="ops"] {
  order: 99; margin: 4px -14px -4px; padding: 8px 14px 10px !important;
  background: #fafcfb !important; border-radius: 0 0 16px 16px;
}
body.lg-tcards .el-table[data-lg-tc] tr.el-table__row > td[data-lg-role="ops"]::before { display: none !important; }
body.lg-tcards .el-table[data-lg-tc] tr.el-table__row > td[data-lg-role="ops"] > .cell {
  display: flex !important; flex-wrap: wrap; align-items: center; gap: 6px 16px;
}
body.lg-tcards .el-table[data-lg-tc] tr.el-table__row > td[data-lg-role="ops"] .el-button { margin: 0 !important; }
/* 空状态、展开行保持原样 */
body.lg-tcards .el-table[data-lg-tc] .el-table__empty-block { width: 100% !important; background: #fff; border-radius: 16px; }
body.lg-tcards .el-table[data-lg-tc] tr:not(.el-table__row) { display: block; }
body.lg-tcards .el-table[data-lg-tc] tr:not(.el-table__row) > td { display: block; width: auto !important; }
