/* 随圆枪法 KOOK 机器人管理后台 —— 全局美化补丁（在 element-plus.css 之后引入） */

/* ---- 表格操作列：收紧按钮间距，防止换行 ---- */
.el-table .cell .el-button + .el-button { margin-left: 4px; }
.el-table .cell .el-button--small { padding: 5px 10px; }

/* ---- 表格观感：浅色表头、加粗标题 ---- */
.el-table { --el-table-header-bg-color: #fafbfc; }
.el-table th.el-table__cell { font-weight: 600; color: #4b5563; }

/* ---- 圆角统一：卡片 / 对话框 / 弹窗 ---- */
.el-card { border-radius: 8px; }
.el-dialog { border-radius: 10px; }
.el-dialog__header { border-bottom: 1px solid #f0f2f5; margin-right: 0; padding-bottom: 14px; }
.el-message-box { border-radius: 10px; }

/* ---- 页面工具条（表格上方按钮区） ---- */
.toolbar { margin-bottom: 12px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
/* 通用工具条：搜索框 + 按钮组，移动端自动换行且搜索框占满整行 */
.page-toolbar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.page-toolbar .toolbar-search { width: 300px; }
.page-toolbar .el-button { flex-shrink: 0; margin-left: 0; }

/* ---- 描述列表间距优化 ---- */
.el-descriptions__label { color: #6b7280 !important; }

/* ---- 下拉弹层：任何情况下不超出视口，且不小于触发控件宽度 ---- */
.el-select-dropdown { max-width: 94vw; }
.el-select-dropdown .el-select-dropdown__item { max-width: 94vw; overflow: hidden; text-overflow: ellipsis; }

/* ==================== 移动端适配（≤768px） ==================== */
/* 说明：Element Plus 的对话框/抽屉宽度由内联样式控制，这里用 !important 统一覆盖；
   .nav-drawer 是主框架的手机导航抽屉，保持固定窄宽，不参与全宽化。 */
@media (max-width: 768px) {
  /* 弹层全宽化 */
  .el-dialog { width: 94% !important; margin-top: 5vh !important; }
  .el-drawer.rtl:not(.nav-drawer),
  .el-drawer.ltr:not(.nav-drawer) { width: 92% !important; }
  .el-message-box { width: 92vw !important; }
  .el-message { min-width: 0 !important; max-width: 92vw; }
  /* 表单：标签顶置、控件全宽（覆盖 label-width 内联样式） */
  .el-form-item { display: block; }
  .el-form-item__label { width: auto !important; justify-content: flex-start;
                         margin-bottom: 4px !important; height: auto; line-height: 1.4; }
  .el-form-item__content { margin-left: 0 !important; }
  .el-form .el-select,
  .el-form .el-input-number,
  .el-form .el-date-editor { width: 100% !important; }
  /* 分页 / 描述列表允许换行收缩 */
  .el-pagination { flex-wrap: wrap; row-gap: 6px; }
  .el-descriptions { font-size: 12px; }
  /* 工具条：搜索框独占整行，按钮自动换行 */
  .page-toolbar .toolbar-search { width: 100% !important; }
  /* 表格：允许横向滚动，单元格不挤压换行 */
  .el-table { width: 100%; }
  .el-table .el-table__body-wrapper,
  .el-table .el-table__header-wrapper { overflow-x: auto; }
  /* 窄屏下解除固定列的吸附效果：EP 2.6+ 用 sticky 实现 fixed 列，
     窄屏时吸附列会遮盖中间内容；改为随表格横向滚动自然展示。
     注意选择器优先级必须压过 EP 自带的 !important 规则 */
  .el-table .el-table__body-wrapper tr td.el-table-fixed-column--right,
  .el-table .el-table__body-wrapper tr td.el-table-fixed-column--left,
  .el-table .el-table__header-wrapper tr th.el-table-fixed-column--right,
  .el-table .el-table__header-wrapper tr th.el-table-fixed-column--left {
    position: static !important;
    box-shadow: none !important;
  }
  /* 兼容旧版 EP 的克隆表实现（当前未使用，防御保留） */
  .el-table__fixed-right,
  .el-table__fixed { display: none !important; }
  .el-table__fixed-right-patch { display: none !important; }
  /* 卡片留白收紧，给表格更多空间 */
  .el-card__body { padding: 12px; }
  /* 页签头允许横向滚动，避免挤压变形 */
  .el-tabs__nav-wrap { overflow-x: auto; }
}
