/* ============================================================
 * APP/移动端 webview 适配样式
 * 触发条件：<html class="app-mobile">（由 index.html 内联脚本
 *           检测 URL 参数 appmobile=1 或窄屏时添加）
 * 设计原则：只做窄屏布局修正，不动颜色/业务样式；
 *           不影响 PC 端任何表现；关键属性 !important 防被覆盖。
 * 覆盖目标：element-ui 2.x + vue-element-admin 布局
 * ============================================================ */

/* ---------- 1. 布局与导航 ---------- */
html.app-mobile {
  font-size: 14px;
  -webkit-text-size-adjust: 100%;
}
/* 主内容区留白收窄（vue-element-admin 的 app-main 默认 padding 20px） */
html.app-mobile .app-main {
  padding: 10px !important;
}
/* 手机端面包屑无用（有汉堡按钮+系统返回），隐藏腾空间 */
html.app-mobile .breadcrumb-container {
  display: none !important;
}
html.app-mobile .navbar {
  height: 46px;
  line-height: 46px;
}
html.app-mobile .navbar .hamburger-container {
  line-height: 46px;
}
html.app-mobile .right-menu {
  height: 46px;
}
html.app-mobile .right-menu .el-avatar {
  width: 28px;
  height: 28px;
  vertical-align: middle;
}
html.app-mobile .right-menu .el-dropdown-link {
  font-size: 13px;
  max-width: 120px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  display: inline-block;
  vertical-align: middle;
}
/* 侧边栏抽屉：保证遮罩和宽度正确（框架 mobile 模式已处理，这里兜底） */
html.app-mobile .sidebar-container {
  width: 210px !important;
}
html.app-mobile .main-container {
  margin-left: 0 !important;
}

/* ---------- 2. 列表卡片/容器 ---------- */
html.app-mobile .el-card__body {
  padding: 10px !important;
}
html.app-mobile .box-card,
html.app-mobile .el-card {
  margin-bottom: 10px;
}

/* ---------- 3. 筛选区/工具栏：强制换行、全宽、按钮重排 ---------- */
/* 洗护等页面使用的 .app-toptool（el-row type=flex） */
html.app-mobile .app-toptool {
  display: block !important;
  margin-bottom: 6px;
}
html.app-mobile .app-toptool .el-col {
  width: 100% !important;
  max-width: 100% !important;
  flex: 0 0 100% !important;
  margin-bottom: 8px;
}
html.app-mobile .app-toptool .btn-group {
  float: none !important;
  display: flex;
  flex-wrap: wrap;
}
/* 通用 filter-container */
html.app-mobile .filter-container {
  margin: 0 0 10px !important;
  line-height: normal;
}
html.app-mobile .filter-container .el-input,
html.app-mobile .filter-container .el-select,
html.app-mobile .filter-container .el-date-editor,
html.app-mobile .filter-container .el-cascader {
  width: 100% !important;
  margin: 0 0 8px 0 !important;
}
html.app-mobile .filter-container .el-button,
html.app-mobile .app-toptool .el-button {
  margin: 4px 8px 4px 0 !important;
}

/* ---------- 4. 数据表格：缩小行距、保留横滑、操作按钮不挤 ---------- */
html.app-mobile .el-table {
  font-size: 12px !important;
}
html.app-mobile .el-table th.el-table__cell,
html.app-mobile .el-table td.el-table__cell {
  padding: 6px 0 !important;
}
html.app-mobile .el-table .cell {
  padding-left: 6px;
  padding-right: 6px;
  line-height: 1.4;
}
/* 表头与操作按钮不换行，避免列被压成一竖条；内容列仍可换行 */
html.app-mobile .el-table th .cell {
  white-space: nowrap;
}
html.app-mobile .el-table .el-button--mini {
  white-space: nowrap;
  padding: 7px 10px;
  margin: 2px 0;
}
/* iOS 横滑顺滑 */
html.app-mobile .el-table__body-wrapper,
html.app-mobile .el-table__header-wrapper {
  -webkit-overflow-scrolling: touch;
}
/* 表格底部分页信息不要被滚动区域裁切 */
html.app-mobile .el-table__body-wrapper {
  overflow-x: auto;
}

/* ---------- 5. 弹窗/对话框：近全宽、内容可滚、表单顶置 ---------- */
html.app-mobile .el-dialog {
  width: 92% !important;
  max-width: 92% !important;
  margin: 5vh auto !important;
}
html.app-mobile .el-dialog__header {
  padding: 14px 16px 8px !important;
}
html.app-mobile .el-dialog__title {
  font-size: 15px;
}
html.app-mobile .el-dialog__body {
  padding: 12px 14px 16px !important;
  max-height: 68vh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
html.app-mobile .el-dialog__footer {
  padding: 8px 14px 16px !important;
}
/* MessageBox（确认框） */
html.app-mobile .el-message-box {
  width: 86% !important;
  max-width: 86% !important;
}
/* Popover/下拉类浮层最小宽度限制，避免超出屏幕 */
html.app-mobile .el-popper {
  max-width: 90vw;
}

/* ---------- 6. 弹窗内表单：label 顶置、控件全宽、栅格堆叠 ---------- */
html.app-mobile .el-dialog .el-form-item__label,
html.app-mobile .el-form--label-top .el-form-item__label {
  float: none !important;
  display: block;
  text-align: left !important;
  padding: 0 0 4px !important;
}
html.app-mobile .el-dialog .el-form-item__content {
  margin-left: 0 !important;
}
html.app-mobile .el-dialog .el-select,
html.app-mobile .el-dialog .el-date-editor,
html.app-mobile .el-dialog .el-cascader,
html.app-mobile .el-dialog .el-input {
  width: 100% !important;
}
/* 弹窗内 el-row 双列表单在窄屏统一堆叠 */
html.app-mobile .el-dialog .el-row .el-col {
  width: 100% !important;
  max-width: 100% !important;
  flex: 0 0 100% !important;
}
/* 内联表单同样竖排 */
html.app-mobile .el-form--inline .el-form-item {
  display: block;
  margin-right: 0;
  margin-bottom: 12px;
}
html.app-mobile .el-form--inline .el-form-item__content {
  margin-left: 0 !important;
}

/* ---------- 7. 分页：居中，隐藏挤位的总条数/跳转 ---------- */
html.app-mobile .pagination,
html.app-mobile .el-pagination {
  margin-top: 12px;
  text-align: center;
  white-space: normal;
  padding: 4px 0;
}
html.app-mobile .el-pagination__total,
html.app-mobile .el-pagination__jump {
  display: none !important;
}
html.app-mobile .el-pagination .el-pager li {
  min-width: 28px;
}

/* ---------- 8. 通用热区与控件 ---------- */
html.app-mobile .el-button {
  border-radius: 6px;
}
html.app-mobile .el-button--mini {
  min-height: 30px;
}
/* 顶部通知（新订单播报）收窄，避免遮挡 */
html.app-mobile .el-notification {
  width: 90vw !important;
  max-width: 320px !important;
  right: 5vw !important;
}
/* 页签/单选按钮组可横滑，不换行溢出 */
html.app-mobile .el-tabs__nav-wrap::after {
  display: none;
}
/* 描述列表（详情页 el-descriptions）允许横滑 */
html.app-mobile .el-descriptions__body {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
html.app-mobile .el-descriptions__table {
  min-width: 480px;
}
