/* 通用工具类 - 避免重复样式 */

/* ===== 文本截断 ===== */

/* 单行文本截断 - 三重类名提高特异性到 0,0,3,0 */
.text-truncate.text-truncate.text-truncate {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}

/* 多行文本截断（2行）- 使用更高特异性和兼容性写法 */
.text-clamp-2.text-clamp-2.text-clamp-2 {
  display: block;
  display: -webkit-box !important;
  display: -moz-box !important;
  -webkit-box-orient: vertical !important;
  -moz-box-orient: vertical !important;
  -webkit-line-clamp: 2 !important;
  overflow: hidden !important;
  word-break: break-word;
  line-height: 1.5;
  max-height: calc(1.5em * 2); /* 备用方案：限制最大高度 */
}

/* 针对 project-open p 的特殊覆盖 */
.project-open p.text-clamp-2 {
  display: -webkit-box !important;
  -webkit-box-orient: vertical !important;
  -webkit-line-clamp: 2 !important;
  overflow: hidden !important;
  word-break: break-word !important;
  line-height: 1.8 !important;
  height: 40px !important;
  max-height: 40px !important;
}

/* 多行文本截断（3行）- 三重类名提高特异性到 0,0,3,0 */
.text-clamp-3.text-clamp-3.text-clamp-3 {
  display: block;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  overflow: hidden;
  word-break: break-word;
  line-height: 1.5;
}

/* ===== Flex 布局辅助 ===== */

/* Flex 子元素支持文本截断 */
.flex-truncate {
  min-width: 0;
  flex: 1;
}

/* ===== 组件特异性修复 ===== */

/* 修复后代选择器覆盖工具类的问题 */
.saved-item > button:first-child .text-truncate,
.job-row > span.text-truncate,
.experiment-item strong.text-truncate,
.experiment-item small.text-truncate,
.batch-preflight-item strong.text-truncate,
#account-chip span.text-truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}

/* ===== 间距系统 ===== */

.card-padding-sm { padding: 12px; }
.card-padding-md { padding: 16px; }
.card-padding-lg { padding: 20px; }

.card-spacing { margin-bottom: 12px; }
.card-spacing-lg { margin-bottom: 16px; }

/* ===== 表单控件增强 ===== */

.input-comfortable {
  padding: 10px 12px !important;
}

.textarea-comfortable {
  padding: 12px 14px !important;
}
