@charset "UTF-8";
/**
 * 后台管理系统 - 移动端浏览器适配
 */

html {
  -webkit-text-size-adjust: 100%;
  -ms-text-size-adjust: 100%;
}

@media screen and (max-width: 1024px) {
  body {
    overflow-x: hidden;
  }

  body.sidebar-open {
    overflow: hidden;
    position: fixed;
    width: 100%;
  }

  .sidebar-mask {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.45);
    z-index: 1050;
  }

  body.sidebar-open .sidebar-mask {
    display: block;
  }

  /* 顶部导航按钮：加大触控区域并统一对齐 */
  .tpl-header-fluid {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 50px;
    padding-left: 4px;
    padding-right: 8px;
    box-sizing: border-box;
  }

  .tpl-header-left {
    display: flex;
    align-items: center;
    flex-shrink: 0;
  }

  .tpl-header-fluid > .am-fl,
  .tpl-header-fluid > .am-fr,
  .tpl-header-left > .am-fl {
    float: none !important;
  }

  .tpl-header-button.switch-button,
  .tpl-header-button.refresh-button {
    float: none !important;
    flex-shrink: 0;
    display: flex !important;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    min-width: 48px;
    min-height: 48px;
    margin: 0 !important;
    padding: 0 !important;
    line-height: 1 !important;
    box-sizing: border-box;
    -webkit-tap-highlight-color: rgba(0, 0, 0, 0.08);
    touch-action: manipulation;
  }

  .tpl-header-button.switch-button .iconfont,
  .tpl-header-button.refresh-button .iconfont {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    font-size: 24px;
    line-height: 1;
  }

  .tpl-header-navbar {
    flex: 1;
    min-width: 0;
    float: none !important;
    margin-left: auto;
  }

  .tpl-header-navbar ul {
    display: flex;
    justify-content: flex-end;
    align-items: center;
  }

  .tpl-header-navbar a {
    min-height: 44px;
    line-height: 44px;
    display: flex;
    align-items: center;
  }

  /* 商户后台：固定侧栏抽屉 */
  .tpl-g > .left-sidebar {
    top: 50px;
    left: -320px !important;
    z-index: 1100;
    width: auto;
    max-width: min(100vw - 24px, 320px);
    height: calc(100% - 50px);
    box-shadow: 2px 0 12px rgba(0, 0, 0, 0.15);
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    transition: left 0.3s ease;
  }

  .tpl-g > .left-sidebar.sidebar-open {
    left: 0 !important;
  }

  .tpl-g > .left-sidebar .sidebar-nav {
    width: 168px;
    flex-shrink: 0;
  }

  .tpl-g > .left-sidebar .sidebar-nav-link a {
    min-height: 48px;
    line-height: 1.35;
    padding: 12px 14px;
    font-size: 15px;
    display: flex;
    align-items: center;
  }

  .tpl-g > .left-sidebar .sidebar-nav-link-logo {
    flex-shrink: 0;
    margin-right: 10px !important;
    font-size: 18px !important;
    width: 22px;
  }

  .tpl-g > .left-sidebar .left-sidebar-second {
    width: 152px;
    flex-shrink: 0;
    padding-top: 12px;
  }

  .tpl-g > .left-sidebar .left-sidebar-second .sidebar-second-item a,
  .tpl-g > .left-sidebar .left-sidebar-second .sidebar-second-item .sidebar-third-item a {
    min-height: 48px;
    line-height: 48px;
    padding-left: 18px;
    font-size: 15px;
  }

  .tpl-g > .left-sidebar .left-sidebar-second .sidebar-second-title {
    height: auto;
    line-height: 1.4;
    padding: 14px 18px;
    font-size: 15px;
  }

  .tpl-g > .left-sidebar .left-sidebar-second .sidebar-second-item .sidebar-third-item .sidebar-third-nav-sub a {
    min-height: 44px;
    line-height: 44px;
    padding-left: 28px;
    font-size: 14px;
  }

  .tpl-content-wrapper {
    margin-left: 0 !important;
    padding-left: 12px;
    padding-right: 12px;
    padding-top: 8px;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }

  .tpl-content-wrapper.no-sidebar-second {
    margin-left: 0 !important;
  }

  .tpl-header {
    padding-left: 0;
  }

  /* 超管后台：侧栏改为抽屉 */
  .tpl-content-wrapper.dis-flex {
    display: block !important;
    max-width: none;
    width: 100%;
    margin: 50px 0 0;
    padding: 0 12px 20px;
  }

  .tpl-content-wrapper > .left-sidebar {
    position: fixed;
    top: 50px;
    left: -280px;
    bottom: 0;
    width: 260px !important;
    flex-basis: auto !important;
    z-index: 1100;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 12px 0 24px;
    border-radius: 0;
    transition: left 0.3s ease;
    box-shadow: 2px 0 12px rgba(0, 0, 0, 0.15);
  }

  .tpl-content-wrapper > .left-sidebar.sidebar-open {
    left: 0;
  }

  .tpl-content-wrapper > .row-content {
    flex-basis: 100% !important;
    width: 100%;
    max-width: 100%;
    padding: 12px 0;
  }

  .tpl-header .switch-button,
  .tpl-header .refresh-button {
    display: flex !important;
    align-items: center;
    justify-content: center;
  }
}

@media screen and (min-width: 1025px) {
  .tpl-header .switch-button.switch-button--admin {
    display: none !important;
  }

  .sidebar-mask {
    display: none !important;
  }
}

@media screen and (max-width: 768px) {
  /* 登录页：避免 100% 高度垂直居中把表单推出首屏 */
  html,
  body.page-login-v3 {
    height: auto;
    min-height: 100%;
  }

  body.page-login-v3:before {
    height: 100vh;
    height: 100svh;
  }

  body.page-login-v3 .container {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    min-height: 100svh;
    height: auto;
    padding: 16px 12px;
    padding-top: max(16px, env(safe-area-inset-top));
    padding-bottom: max(16px, env(safe-area-inset-bottom));
    box-sizing: border-box;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  body.page-login-v3 .container:before {
    display: none;
  }

  body.page-login-v3 .login-body {
    display: block;
    width: 100% !important;
    max-width: 400px;
    margin: 0 auto;
    padding: 36px 24px 28px;
    box-sizing: border-box;
    flex-shrink: 0;
  }

  body.page-login-v3 .login-form {
    margin: 28px 0 16px;
  }

  body.page-login-v3 .login-form .form-group {
    margin: 20px 0;
  }

  body.page-login-v3 .login-form input,
  body.page-login-v3 .login-form button {
    min-height: 44px;
    font-size: 16px;
  }

  .tpl-header-fluid {
    padding-left: 8px;
    padding-right: 8px;
  }

  .tpl-header-navbar a {
    padding: 0 10px;
    font-size: 13px;
  }

  .tpl-header-navbar-welcome span {
    max-width: 72px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    display: inline-block;
    vertical-align: bottom;
  }

  .row-content {
    padding: 10px 0 !important;
  }

  .widget-head {
    padding: 10px 12px;
  }

  .widget-body {
    padding: 0 8px 12px;
  }

  .page-header-heading {
    font-size: 16px;
  }

  /* 栅格在窄屏下纵向堆叠 */
  .row-content [class*="am-u-"],
  .toolbar-form [class*="am-u-"] {
    width: 100% !important;
    float: none !important;
    max-width: 100%;
  }

  .page_toolbar .am-form-group,
  .toolbar-form .am-form-group {
    max-width: 100%;
    margin-bottom: 8px;
  }

  .page_toolbar .am-fr,
  .toolbar-form .am-fr {
    float: none !important;
    width: 100%;
  }

  .tpl-form-input,
  .am-form input[type="text"],
  .am-form input[type="password"],
  .am-form input[type="number"],
  .am-form input[type="tel"],
  .am-form input[type="email"],
  .am-form select,
  .am-form textarea,
  .am-selected {
    max-width: 100% !important;
    box-sizing: border-box;
  }

  .am-btn-toolbar .am-btn-group {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
  }

  .am-btn-toolbar .am-btn-group > .am-btn {
    margin-right: 0;
    margin-bottom: 6px;
  }

  /* 表格横向滚动 */
  .table-responsive-wrap {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin-bottom: 12px;
  }

  .table-responsive-wrap > .am-table {
    min-width: 560px;
    margin-bottom: 0;
  }

  /* 弹层适配 */
  .layui-layer {
    max-width: calc(100vw - 24px) !important;
  }

  .layui-layer-dialog {
    width: auto !important;
    min-width: 280px;
  }

  /* 文件库、DIY 等宽面板 */
  .file-library,
  .am-modal-bd {
    max-width: 100%;
    overflow-x: auto;
  }

  .am-pagination {
    flex-wrap: wrap;
    justify-content: center;
  }

  .am-pagination li {
    margin-bottom: 4px;
  }

  /* 商业内容审核：手机卡片列表 */
  .biz-audit-cards {
    display: block;
  }

  .biz-audit-table-wrap {
    display: none;
  }

  .biz-audit-card {
    background: #fff;
    border: 1px solid #e8e8e8;
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 12px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
  }

  .biz-audit-card__title {
    font-size: 15px;
    font-weight: 600;
    line-height: 1.4;
    margin-bottom: 8px;
    word-break: break-word;
  }

  .biz-audit-card__meta {
    font-size: 12px;
    color: #888;
    margin-bottom: 4px;
  }

  .biz-audit-card__meta span {
    margin-right: 8px;
  }

  .biz-audit-card__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
  }

  .biz-audit-card__actions .am-btn {
    flex: 1;
    min-width: 72px;
    text-align: center;
    padding: 8px 12px;
    font-size: 14px;
  }

  .toolbar-form .am-u-sm-12 {
    margin-bottom: 8px;
  }

  /* 表单：标签与输入纵向排列 */
  .am-form-group .am-form-label,
  .am-form-group label.am-form-label {
    width: 100% !important;
    text-align: left !important;
    float: none !important;
    margin-bottom: 6px;
    padding-top: 0;
  }

  .am-form-group [class*="am-u-sm-"],
  .am-form-group [class*="am-u-end"],
  .am-form-group [class*="am-u-push"],
  .am-form-group [class*="am-sm-push"] {
    margin-left: 0 !important;
    width: 100% !important;
    float: none !important;
    max-width: 100%;
  }

  .am-form-group .am-btn,
  .widget-body > .am-btn,
  .widget-body .am-btn-group .am-btn {
    min-height: 44px;
    line-height: 1.4;
    padding: 10px 16px;
  }

  .am-scrollable-horizontal {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin-bottom: 12px;
  }

  .am-scrollable-horizontal > .am-table {
    min-width: 640px;
    margin-bottom: 0;
  }

  /* 分类页双栏堆叠 */
  .widget-body > .am-u-sm-12.am-u-md-6 {
    width: 100% !important;
    float: none !important;
    margin-bottom: 16px;
  }

  .tips .pre {
    font-size: 12px;
    line-height: 1.5;
    word-break: break-word;
  }

  .widget-title {
    font-size: 16px;
    word-break: break-word;
  }

  /* 文件上传、封面图 */
  .uploader-list .file-item img {
    max-width: 100%;
    height: auto;
  }
}

@media screen and (min-width: 1025px) {
  .biz-audit-cards {
    display: none;
  }
}

/* 数据选择弹窗页 */
body.select-data {
  padding: 12px;
  box-sizing: border-box;
  overflow-x: hidden;
}

body.select-data .page_toolbar {
  margin-bottom: 12px;
}

@media screen and (max-width: 414px) {
  .tpl-header-navbar .iconfont + span,
  .tpl-header-navbar li.am-text-sm a .iconfont {
    margin-right: 0;
  }

  .tpl-header-navbar li.am-text-sm a {
    font-size: 12px;
    padding: 0 8px;
  }
}
