/* 昭行传媒后台 · 移动端外壳
 *
 * 走「注入」而不是重编译：qkbad 是预构建 chunk，没有源码工程。
 * 只在 body.qkb-mobile（手机宽度 / 移动 UA）下生效，桌面端完全不受影响。
 * 负责三件事：① 收掉桌面侧栏与顶栏，换成移动顶栏 + 底部 Tab；
 *            ② 把总览页的网格拉成单列/两列的移动版；
 *            ③ 给通知中心 / 提醒设置面板提供样式（结构由 qkb-mobile.js 生成）。
 */

body.qkb-mobile {
  --qm-bg: #f4f6fa;
  --qm-card: #ffffff;
  --qm-text: #1f2733;
  --qm-sub: #6b7785;
  --qm-line: #e8ecf2;
  --qm-brand: #1d6fff;
  --qm-brand-soft: #eaf1ff;
  --qm-danger: #f5222d;
  --qm-mask: rgba(16, 22, 34, .42);
}
html.dark body.qkb-mobile {
  --qm-bg: #14161b;
  --qm-card: #1c1f27;
  --qm-text: #e6e9ef;
  --qm-sub: #8b94a3;
  --qm-line: #2a2f3a;
  --qm-brand: #4a8bff;
  --qm-brand-soft: #1e2a44;
  --qm-mask: rgba(0, 0, 0, .55);
}

/* ---------- 收掉桌面骨架 ---------- */
body.qkb-mobile .adm-side { display: none !important; }
body.qkb-mobile .adm-top { display: none !important; }
body.qkb-mobile .adm-body {
  padding-left: 14px !important;
  padding-right: 14px !important;
  padding-top: 58px !important;
  padding-bottom: calc(68px + env(safe-area-inset-bottom, 0px)) !important;
  background: var(--qm-bg);
}
body.qkb-mobile .adm-body > * { max-width: 100%; }
/* 后台自带的右下角页面缩放浮层，手机上会压住卡片，直接收掉 */
body.qkb-mobile .zoom-dock { display: none !important; }

/* 禁用原生下拉刷新（浏览器 / WebView overscroll 手势），避免上滑误触刷新；
   移动端刷新统一走顶栏「刷新」按钮，应用内重拉数据、不整页重载 */
html.qkb-mobile, body.qkb-mobile,
body.qkb-mobile .adm-body, body.qkb-mobile #app,
body.qkb-mobile .qm-business, body.qkb-mobile .qm-mine, body.qkb-mobile .qm-sheet {
  overscroll-behavior-y: none;
  -webkit-overflow-scrolling: auto;
}
.qm-refresh { transition: transform .2s; }
.qm-refresh.is-spin { animation: qm-spin .6s linear infinite; }
@keyframes qm-spin { to { transform: rotate(360deg); } }

/* ---------- 移动顶栏 ---------- */
.qm-header {
  position: fixed; top: 0; left: 0; right: 0; height: 58px;
  display: flex; align-items: center; gap: 4px; padding: 0 8px;
  background: var(--qm-card); border-bottom: 1px solid var(--qm-line);
  z-index: 9002; box-sizing: border-box;
}
.qm-title {
  flex: 1; min-width: 0; font-size: 17px; font-weight: 600; color: var(--qm-text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding-left: 2px;
}
.qm-ico {
  width: 38px; height: 38px; flex: 0 0 auto; border: 0; background: none; padding: 0;
  display: inline-flex; align-items: center; justify-content: center; border-radius: 10px;
  color: var(--qm-text); cursor: pointer; -webkit-tap-highlight-color: transparent;
}
.qm-ico:active { background: var(--qm-brand-soft); }
.qm-ico svg { width: 22px; height: 22px; display: block; }
.qm-bell { position: relative; }
.qm-bell .qm-badge {
  position: absolute; top: 3px; right: 3px; min-width: 16px; height: 16px; padding: 0 4px;
  border-radius: 9px; background: var(--qm-danger); color: #fff; font-size: 10px; line-height: 16px;
  text-align: center; display: none; box-sizing: border-box;
}

/* ---------- 底部 Tab ---------- */
.qm-tabs {
  position: fixed; left: 0; right: 0; bottom: 0; display: flex;
  background: var(--qm-card); border-top: 1px solid var(--qm-line);
  z-index: 9002; padding-bottom: env(safe-area-inset-bottom, 0px);
}
.qm-tab {
  flex: 1; height: 56px; display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: 3px; border: 0; background: none; padding: 0;
  color: var(--qm-sub); font-size: 11px; cursor: pointer; -webkit-tap-highlight-color: transparent;
}
.qm-tab svg { width: 22px; height: 22px; display: block; }
.qm-tab.is-on { color: var(--qm-brand); }
.qm-tab:active { opacity: .7; }

/* ---------- 遮罩 / 抽屉 ---------- */
.qm-mask {
  position: fixed; inset: 0; background: var(--qm-mask); z-index: 9500;
  display: none; opacity: 0; transition: opacity .2s;
}
.qm-mask.is-on { display: block; opacity: 1; }
.qm-drawer {
  position: fixed; top: 0; bottom: 0; left: 0; width: 78%; max-width: 320px;
  background: var(--qm-card); z-index: 9600; overflow-y: auto;
  transform: translateX(-102%); transition: transform .24s ease;
  box-shadow: 2px 0 18px rgba(0, 0, 0, .16); -webkit-overflow-scrolling: touch;
}
.qm-drawer.is-on { transform: none; }
.qm-drawer-hd {
  padding: 20px 16px 16px; border-bottom: 1px solid var(--qm-line);
  font-size: 16px; font-weight: 600; color: var(--qm-text);
}
.qm-drawer-hd small { display: block; margin-top: 4px; font-size: 12px; font-weight: 400; color: var(--qm-sub); }
.qm-grp { padding: 14px 16px 6px; font-size: 12px; color: var(--qm-sub); }
.qm-drawer a {
  display: flex; align-items: center; height: 46px; padding: 0 16px;
  color: var(--qm-text); text-decoration: none; font-size: 14px;
  border-bottom: 1px solid var(--qm-line);
}
.qm-drawer a.is-on { color: var(--qm-brand); background: var(--qm-brand-soft); }

/* ---------- 通知中心 / 提醒设置 面板 ---------- */
.qm-sheet {
  position: fixed; left: 0; right: 0; top: 58px; z-index: 9400;
  background: var(--qm-card); border-radius: 0 0 16px 16px;
  max-height: calc(100vh - 58px - 68px); overflow-y: auto; -webkit-overflow-scrolling: touch;
  box-shadow: 0 14px 30px rgba(0, 0, 0, .18);
  transform: translateY(-10px); opacity: 0; visibility: hidden;
  transition: opacity .18s, transform .18s, visibility .18s;
}
.qm-sheet.is-on { transform: none; opacity: 1; visibility: visible; }

.qm-sec { padding: 14px 14px 4px; }
.qm-sec + .qm-sec { border-top: 8px solid var(--qm-bg); }
.qm-sec-hd { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.qm-sec-t { font-size: 16px; font-weight: 600; color: var(--qm-text); }
.qm-btn-s {
  height: 30px; padding: 0 12px; border-radius: 15px; border: 1px solid var(--qm-line);
  background: var(--qm-card); color: var(--qm-sub); font-size: 12px; cursor: pointer;
}
.qm-btn-s:active { background: var(--qm-brand-soft); }

.qm-ni { display: flex; gap: 10px; padding: 12px 0; border-bottom: 1px solid var(--qm-line); }
.qm-ni:last-child { border-bottom: 0; }
.qm-ni-ic {
  width: 34px; height: 34px; border-radius: 9px; flex: 0 0 auto;
  display: flex; align-items: center; justify-content: center; color: #fff; font-size: 16px;
}
.qm-ni-bd { flex: 1; min-width: 0; }
.qm-ni-t { font-size: 14px; font-weight: 600; color: var(--qm-text); line-height: 1.4; }
.qm-ni-d { font-size: 12px; color: var(--qm-sub); margin-top: 3px; line-height: 1.55; }
.qm-ni-m { font-size: 11px; color: var(--qm-sub); margin-top: 5px; }
.qm-empty { padding: 26px 0; text-align: center; font-size: 13px; color: var(--qm-sub); }
.qm-ft { font-size: 12px; color: var(--qm-sub); padding: 10px 0 2px; border-top: 1px solid var(--qm-line); margin-top: 4px; }

.qm-row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 13px 0; border-bottom: 1px solid var(--qm-line);
  font-size: 14px; color: var(--qm-text);
}
.qm-row:last-of-type { border-bottom: 0; }
.qm-v { font-size: 13px; color: var(--qm-sub); }
.qm-sw { position: relative; width: 46px; height: 27px; flex: 0 0 auto; }
.qm-sw input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.qm-sw i { position: absolute; inset: 0; border-radius: 14px; background: #d5dae2; transition: .2s; }
.qm-sw i:after {
  content: ""; position: absolute; top: 3px; left: 3px; width: 21px; height: 21px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .22); transition: .2s;
}
.qm-sw input:checked + i { background: var(--qm-brand); }
.qm-sw input:checked + i:after { transform: translateX(19px); }

.qm-note { font-size: 11.5px; color: var(--qm-sub); line-height: 1.75; padding: 12px 0 2px; }
.qm-acts { display: flex; gap: 10px; padding: 12px 0 16px; }
.qm-btn {
  flex: 1; height: 44px; border-radius: 10px; border: 0; font-size: 14px; font-weight: 500;
  cursor: pointer; -webkit-tap-highlight-color: transparent;
}
.qm-btn--main { background: #f2a1a1; color: #fff; }
.qm-btn--main:active { background: #ec8f8f; }
.qm-btn--sub { background: #eef1f5; color: #3a4553; }
html.dark .qm-btn--sub { background: #2a2f3a; color: #d5dae2; }
.qm-btn--pri { background: #2f9e6e; color: #fff; }
.qm-btn--pri:active { background: #27885e; }
.qm-btn--warn { background: #e07a7a; color: #fff; }
.qm-btn--warn:active { background: #cf6a6a; }
.qm-det-ro { color: #9aa3b0; font-size: 12.5px; line-height: 1.5; }
html.dark .qm-det-ro { color: #8a93a2; }
.qm-btn:disabled { opacity: .6; }

/* ---------- 总览页移动化：网格改两列/单列 ---------- */
body.qkb-mobile .g-page-head { flex-direction: column; align-items: stretch; gap: 10px; }
body.qkb-mobile .g-stat-grid { grid-template-columns: 1fr 1fr !important; gap: 10px !important; }
body.qkb-mobile .ov-grid { grid-template-columns: 1fr !important; }
body.qkb-mobile .big-card,
body.qkb-mobile .dash-lic { width: 100% !important; max-width: 100% !important; box-sizing: border-box; }
body.qkb-mobile .el-card,
body.qkb-mobile .el-table { max-width: 100% !important; }
body.qkb-mobile .g-page-head .el-date-editor {
  width: 100% !important; flex: 1 1 100% !important; min-width: 0 !important;
}

/* ---------- 只读条（低频页移动端仅查看） ---------- */
.qm-ro-banner {
  position: fixed; left: 0; right: 0; top: 58px; z-index: 9001;
  height: 34px; display: flex; align-items: center; justify-content: center;
  background: var(--qm-brand-soft); color: var(--qm-brand);
  font-size: 12px; padding: 0 14px; text-align: center;
  transform: translateY(-120%); transition: transform .2s; box-sizing: border-box;
}
.qm-ro-banner.is-on { transform: none; }
body.qkb-mobile.qkb-readonly .adm-body {
  padding-top: 92px !important;
}

/* ---------- 我的 → 修改密码表单 ---------- */
.qm-form { padding: 8px 0 2px; }
.qm-form label {
  display: block; font-size: 13px; color: var(--qm-sub); margin: 12px 0 6px;
}
.qm-form input {
  width: 100%; height: 44px; box-sizing: border-box; padding: 0 12px;
  border: 1px solid var(--qm-line); border-radius: 10px; background: var(--qm-bg);
  color: var(--qm-text); font-size: 15px; -webkit-tap-highlight-color: transparent;
}
.qm-form input:focus { border-color: var(--qm-brand); outline: none; }
.qm-err { min-height: 18px; font-size: 12px; color: var(--qm-danger); padding: 8px 0 0; }

/* ---------- 业务列表页：移动端表格保底（横向滚动 + 触控友好） ---------- */
body.qkb-mobile .el-table { width: 100% !important; font-size: 12px; background: transparent; }
body.qkb-mobile .el-table::before { display: none; }
body.qkb-mobile .el-table .cell { padding: 10px 8px; line-height: 1.4; }
body.qkb-mobile .el-table th.el-table__cell .cell { font-size: 12px; color: var(--qm-sub); font-weight: 600; }
body.qkb-mobile .el-table .el-table__row td.el-table__cell { background: var(--qm-card); }
body.qkb-mobile .el-table__body-wrapper { overflow-x: auto; -webkit-overflow-scrolling: touch; }
/* 卡片化容器：让表格像卡片一样有圆角与留白 */
body.qkb-mobile .adm-body > .el-card,
body.qkb-mobile .adm-body > div > .el-card { border-radius: 14px; }

/* 轻量 Toast（模拟提醒等反馈用，避免依赖 element 的消息组件） */
.qm-toast {
  position: fixed; left: 50%; bottom: calc(86px + env(safe-area-inset-bottom, 0px));
  transform: translateX(-50%) translateY(8px); max-width: 82vw;
  background: rgba(22, 28, 40, .92); color: #fff; font-size: 13px; line-height: 1.5;
  padding: 10px 16px; border-radius: 20px; z-index: 9700; opacity: 0; pointer-events: none;
  transition: opacity .2s, transform .2s; text-align: center;
}
.qm-toast.is-on { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---------- 我的：独立整页（不再浮在业务页上） ---------- */
.qm-page {
  position: fixed; left: 0; right: 0; top: 58px;
  bottom: calc(56px + env(safe-area-inset-bottom, 0px));
  z-index: 9300; background: var(--qm-bg); overflow-y: auto; -webkit-overflow-scrolling: touch;
  padding: 12px 0 8px; display: none;
}
body.qkb-mobile.qkb-mine-on #qm-mine { display: block; }
body.qkb-mobile.qkb-mine-on .adm-body { display: none !important; }

/* ---------- 业务卡片层：替代手机上挤成一团的桌面表格 ---------- */
body.qkb-mobile.qkb-cards .adm-body > *:not(#qm-business) { display: none !important; }
.qm-biz { padding: 0; }
.qm-fbar { position: sticky; top: 0; z-index: 6; background: var(--qm-bg); padding: 8px 0 4px; }
.qm-frow { display: flex; gap: 8px; padding: 0 2px; }
.qm-fsel { flex: 0 0 auto; height: 38px; border: 1px solid var(--qm-line); border-radius: 9px; background: var(--qm-card); color: var(--qm-text); font-size: 13px; padding: 0 6px; }
.qm-fin { flex: 1; min-width: 0; height: 38px; box-sizing: border-box; padding: 0 12px; border: 1px solid var(--qm-line); border-radius: 9px; background: var(--qm-card); color: var(--qm-text); font-size: 14px; }
.qm-fin:focus { border-color: var(--qm-brand); outline: none; }
.qm-fbtn { flex: 0 0 auto; height: 38px; padding: 0 16px; border: 0; border-radius: 9px; background: var(--qm-brand); color: #fff; font-size: 14px; cursor: pointer; }
.qm-chips { display: flex; flex-wrap: wrap; gap: 8px; padding: 10px 2px 2px; }
.qm-chip { height: 30px; padding: 0 14px; border: 1px solid var(--qm-line); border-radius: 15px; background: var(--qm-card); color: var(--qm-sub); font-size: 13px; cursor: pointer; }
.qm-chip.is-on { border-color: var(--qm-brand); color: var(--qm-brand); background: var(--qm-brand-soft); }
.qm-list { padding: 4px 0 8px; }
.qm-card { background: var(--qm-card); border-radius: 14px; padding: 14px; margin: 10px 0; box-shadow: 0 2px 10px rgba(0, 0, 0, .04); }
.qm-card-hd { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.qm-card-t { font-size: 16px; font-weight: 600; color: var(--qm-text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.qm-tag { flex: 0 0 auto; height: 22px; padding: 0 9px; border-radius: 11px; font-size: 12px; line-height: 22px; }
.qm-tag--ok { background: #e7f7ec; color: #18a058; }
.qm-tag--danger { background: #fdecec; color: #f5222d; }
.qm-tag--warn { background: #fff4e6; color: #fa8c16; }
.qm-tag--info { background: #eef1f5; color: #6b7785; }
html.dark .qm-tag--ok { background: #16351f; color: #4cd07d; }
html.dark .qm-tag--danger { background: #3a1a1c; color: #ff7470; }
html.dark .qm-tag--warn { background: #3a2a14; color: #ffae4d; }
html.dark .qm-tag--info { background: #2a2f3a; color: #aab3c2; }
.qm-kvs { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 12px; }
.qm-kv { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.qm-kv span { font-size: 11px; color: var(--qm-sub); }
.qm-kv b { font-size: 14px; color: var(--qm-text); word-break: break-all; font-weight: 500; }
.qm-card-ft { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--qm-line); }
.qm-ft-i { font-size: 12px; color: var(--qm-sub); }
.qm-ft-i b { font-size: 15px; font-weight: 700; margin-left: 2px; }
.qm-gold { color: var(--qm-brand) !important; }
.qm-in { color: #18a058; }
.qm-out { color: #f5222d; }
.qm-card-sub { margin-top: 8px; font-size: 11px; color: var(--qm-sub); }
/* 紧凑卡片：好友尽量4行、用户2层 */
.qm-card--agent, .qm-card--stream { padding: 9px 12px; margin: 7px 0; }
.qm-card--agent .qm-card-hd, .qm-card--stream .qm-card-hd { margin-bottom: 5px; }
.qm-crow { display: flex; flex-wrap: wrap; gap: 3px 14px; font-size: 12px; color: var(--qm-sub); line-height: 1.5; margin-top: 2px; }
.qm-crow span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.qm-crow--gold span { color: var(--qm-brand); font-weight: 600; font-size: 13px; }
.qm-card--agent .qm-card-sub { margin-top: 5px; }
.qm-crow2 { display: flex; align-items: center; gap: 10px; margin-top: 4px; font-size: 12px; line-height: 1.6; }
.qm-c2-l { flex: 1 1 auto; min-width: 0; color: var(--qm-sub); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.qm-c2-r { flex: 0 0 auto; display: flex; gap: 10px; }
.qm-c2-r b { color: var(--qm-brand); font-weight: 600; font-size: 13px; white-space: nowrap; }
.qm-hd-l { display: flex; align-items: center; gap: 8px; flex: 1 1 auto; min-width: 0; }
.qm-hd-l .qm-card-t { flex: 0 1 auto; min-width: 0; }
.qm-card-id { flex: 0 1 auto; min-width: 0; font-size: 11px; color: var(--qm-sub); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.qm-card--stream .qm-card-t { font-size: 14px; }
.qm-card--stream .qm-crow2 { font-size: 11px; }
.qm-card--stream .qm-c2-r b { font-size: 12px; }
.qm-more { text-align: center; padding: 6px 0 10px; }
.qm-more-btn { height: 40px; padding: 0 22px; border: 1px solid var(--qm-line); border-radius: 20px; background: var(--qm-card); color: var(--qm-text); font-size: 13px; cursor: pointer; }
.qm-more-t { font-size: 12px; color: var(--qm-sub); }
.qm-empty2 { padding: 30px 0; text-align: center; font-size: 13px; color: var(--qm-sub); }

/* ---------- 详情底部弹层 ---------- */
.qm-det-mask { position: fixed; inset: 0; background: var(--qm-mask); z-index: 9650; display: none; opacity: 0; transition: opacity .2s; }
.qm-det-mask.is-on { display: block; opacity: 1; }
.qm-det { position: fixed; left: 0; right: 0; bottom: 0; z-index: 9660; background: var(--qm-card); border-radius: 16px 16px 0 0; max-height: 80vh; overflow-y: auto; -webkit-overflow-scrolling: touch; transform: translateY(100%); transition: transform .24s ease; box-shadow: 0 -10px 30px rgba(0, 0, 0, .18); padding-bottom: env(safe-area-inset-bottom, 0px); }
.qm-det.is-on { transform: none; }
.qm-det-hd { position: sticky; top: 0; display: flex; align-items: center; justify-content: space-between; padding: 15px 16px; border-bottom: 1px solid var(--qm-line); background: var(--qm-card); }
.qm-det-hd span { font-size: 16px; font-weight: 600; color: var(--qm-text); }
.qm-det-close { width: 32px; height: 32px; border: 0; background: none; color: var(--qm-sub); font-size: 24px; line-height: 1; cursor: pointer; }
.qm-det-bd { padding: 6px 16px 14px; }
.qm-drow { display: flex; align-items: baseline; justify-content: space-between; gap: 14px; padding: 11px 0; border-bottom: 1px solid var(--qm-line); font-size: 13px; }
.qm-drow:last-child { border-bottom: 0; }
.qm-drow span { color: var(--qm-sub); flex: 0 0 auto; }
.qm-drow b { color: var(--qm-text); text-align: right; word-break: break-all; font-weight: 500; }
.qm-copy { margin-left: 8px; height: 24px; padding: 0 9px; border: 1px solid var(--qm-line); border-radius: 12px; background: var(--qm-bg); color: var(--qm-brand); font-size: 11px; vertical-align: middle; cursor: pointer; }
.qm-det-ft { padding: 12px 16px 18px; font-size: 12px; color: var(--qm-sub); background: var(--qm-brand-soft); }

/* 详情弹层内的操作按钮：编辑 / 充值扣款 / 发通知 */
.qm-det-acts { display: flex; gap: 8px; }
.qm-det-acts .qm-btn { flex: 1; height: 38px; font-size: 13px; }

/* 操作表单（编辑好友 / 充值扣款 / 发送通知） */
.qm-act { max-height: 88vh; }
.qm-form { display: flex; flex-direction: column; gap: 10px; padding: 10px 0 4px; }
.qm-f-row { display: flex; flex-direction: column; gap: 4px; }
.qm-f-row > span { font-size: 12px; color: var(--qm-sub); }
.qm-f-in {
  width: 100%; box-sizing: border-box; height: 40px; padding: 0 12px; border: 1px solid var(--qm-line);
  border-radius: 8px; background: var(--qm-bg); color: var(--qm-text); font-size: 14px;
  -webkit-appearance: none; appearance: none;
}
.qm-f-row--area .qm-f-in { height: auto; padding: 10px 12px; line-height: 1.5; resize: vertical; }
.qm-f-in:focus { outline: none; border-color: var(--qm-brand); background: var(--qm-card); }
.qm-form-tip { font-size: 13px; color: var(--qm-text); padding: 2px 0 4px; }
.qm-radio { display: flex; gap: 18px; padding: 2px 0 4px; }
.qm-radio label { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; color: var(--qm-text); }
.qm-form-err { min-height: 18px; margin-top: 6px; font-size: 12px; color: var(--qm-danger); }
.qm-act-submit { width: 100%; height: 44px; background: var(--qm-brand); color: #fff; }
