/* ==========================================================================
   中视华凯 · 手机版样式（2026-10-29 新增）
   --------------------------------------------------------------------------
   所有规则都以 html.m-view 前缀限定：
   · 只有在手机/触摸窄屏访问（或手动切到手机版）时才给 <html> 加 .m-view
   · 电脑版访问时 <html> 上没有 .m-view，本文件的规则一条都不会命中
   所以电脑端的排版、字号、间距、组件样式完全不受影响。
   ========================================================================== */

/* ---------- 全局：手机版容器 ---------- */
html.m-view body { background: #f2f4f8; font-size: 14px; }
/* 2026-11-02 兜底：任何残留的超宽元素都不允许把页面撑出横向滚动 */
html.m-view, html.m-view body { overflow-x: hidden; }
html.m-view .page-content {
  max-width: 100%;
  padding: 12px 12px calc(122px + env(safe-area-inset-bottom, 0px));
}
html.m-view .topbar-inner { height: 52px; padding: 0 14px; gap: 10px; }
html.m-view .topbar-brand .brand-img { height: 30px; }
html.m-view .topbar-nav { display: none; }              /* 主导航收进底部 tab */
html.m-view #btn-signout { display: none; }             /* 退出登录移到「更多」 */
html.m-view .user-chip { font-size: 12.5px; }
html.m-view #btn-view-mode { font-size: 12px; padding: 6px 10px; }

/* 登录页 */
html.m-view .auth-wrap { padding: 24px 14px; align-items: flex-start; }
html.m-view .auth-card { width: 100%; max-width: 100%; padding: 24px 18px; }
html.m-view .brand-logo .brand-img-lg { height: 64px; }

/* 内页（日报/周报/记录等桌面版视图）基础兜底：不重排，但保证能横滑看清、不挤爆 */
html.m-view .page-head { flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
html.m-view .page-title { font-size: 17px; }
html.m-view .toolbar { flex-wrap: wrap; gap: 8px; justify-content: flex-start; }
html.m-view .toolbar select { min-width: 128px; }
html.m-view .table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
/* 2026-11-02 修复：1fr 的隐含 min-width:auto 会被 nowrap 行撑宽整个 grid，
   导致手机 layout viewport 被撑到 400+px，看起来像"没识别手机版"（要左右滑）。
   改用 minmax(0,1fr) 并锁死容器最小宽度。 */
html.m-view .board-grid { grid-template-columns: minmax(0, 1fr) !important; min-width: 0; }
html.m-view .tile-card, html.m-view .center-card { min-width: 0; max-width: 100%; overflow: hidden; }
html.m-view table.dt { font-size: 12px; }
html.m-view .modal-root { padding: 12px; align-items: flex-end; }
html.m-view .modal { width: 100%; max-width: 100%; max-height: 86vh; border-radius: 16px 16px 0 0; }

/* 要事统筹页工具栏：手机上三个按钮固定一行、等比例缩小（2026-10-30 用户要求） */
html.m-view #sch-toolbar { display: flex; flex-wrap: nowrap; width: 100%; gap: 8px; margin-top: 10px; }
html.m-view #sch-toolbar .btn {
  flex: 1 1 0; min-width: 0; white-space: nowrap; text-align: center;
  padding: 9px 4px; font-size: 13px;
}

/* ---------- 底部导航 ---------- */
.m-tabbar { display: none; }
html.m-view .m-tabbar {
  display: block;
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 60;
  background: rgba(255, 255, 255, 0.97);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  border-top: 1px solid #e6e9f0;
  padding-bottom: env(safe-area-inset-bottom, 0px);
  box-shadow: 0 -2px 12px rgba(16, 24, 40, 0.06);
}
html.m-view .m-tabbar-row { display: flex; height: 56px; }
html.m-view .m-tab {
  flex: 1; border: 0; background: none; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  color: #8a93a3; font-size: 11px; padding: 0; -webkit-tap-highlight-color: transparent;
}
html.m-view .m-tab-icon { font-size: 19px; line-height: 1; }
html.m-view .m-tab.active { color: #3b5bdb; font-weight: 600; }
html.m-view .m-switch {
  display: block; width: 100%; border: 0; border-top: 1px solid #eef1f6;
  background: #f7f9fc; color: #5c636e; font-size: 12px; padding: 9px 0;
  cursor: pointer; -webkit-tap-highlight-color: transparent;
}
html.m-view .m-switch:active { background: #eef2ff; color: #3b5bdb; }

/* ---------- 「更多」抽屉 ---------- */
.m-more-mask {
  position: fixed; inset: 0; z-index: 90;
  background: rgba(17, 24, 39, 0.42);
  display: flex; align-items: flex-end;
}
.m-more-sheet {
  width: 100%; background: #fff; border-radius: 18px 18px 0 0;
  padding: 18px 16px calc(14px + env(safe-area-inset-bottom, 0px));
  animation: mSheetUp 0.18s ease-out;
}
@keyframes mSheetUp { from { transform: translateY(18px); opacity: 0.6; } to { transform: none; opacity: 1; } }
.m-more-head { display: flex; align-items: baseline; gap: 8px; padding: 2px 4px 14px; }
.m-more-head b { font-size: 16px; color: #1f2937; }
.m-more-head span { font-size: 12px; color: #8a93a3; }
.m-more-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.m-more-item {
  border: 0; background: #f7f9fc; border-radius: 12px; padding: 14px 10px;
  font-size: 13.5px; color: #1f2937; text-align: left; cursor: pointer;
  display: flex; align-items: center; gap: 8px; -webkit-tap-highlight-color: transparent;
}
.m-more-item span { font-size: 17px; }
.m-more-item:active { background: #eef2ff; }
.m-more-acts { display: flex; gap: 10px; margin-top: 12px; }
.m-more-act {
  flex: 1; border: 1px solid #e5e7eb; background: #fff; border-radius: 12px;
  padding: 12px 0; font-size: 13.5px; color: #1f2937; cursor: pointer;
}
.m-more-act.danger { color: #c0261f; border-color: #f3d3d3; background: #fff7f7; }
.m-more-cancel {
  width: 100%; margin-top: 10px; border: 0; background: #f1f3f6; color: #5c636e;
  border-radius: 12px; padding: 12px 0; font-size: 13.5px; cursor: pointer;
}

/* ==========================================================================
   手机版首页（.mh-*）
   ========================================================================== */
html.m-view .mh-loading { text-align: center; color: #9aa1ab; font-size: 13px; padding: 56px 0; }

html.m-view .mh-hero {
  background: #3b5bdb; color: #fff; border-radius: 16px;
  padding: 16px 18px 15px; margin-bottom: 12px;
  box-shadow: 0 6px 16px rgba(59, 91, 219, 0.22);
}
html.m-view .mh-hello { font-size: 19px; font-weight: 700; letter-spacing: 0.5px; }
html.m-view .mh-hero-sub { font-size: 12.5px; opacity: 0.88; margin-top: 6px; }

html.m-view .mh-card {
  background: #fff; border-radius: 14px; padding: 14px 14px 12px;
  margin-bottom: 12px; box-shadow: 0 1px 3px rgba(16, 24, 40, 0.07);
}
html.m-view .mh-card-head {
  display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 11px;
}
html.m-view .mh-card-title { font-size: 14.5px; font-weight: 700; color: #1f2937; }
html.m-view .mh-pill {
  font-size: 11.5px; padding: 3px 9px; border-radius: 999px;
  background: #f1f3f6; color: #5c636e; white-space: nowrap;
}
html.m-view .mh-pill.warn { background: #fdeaea; color: #c0261f; }
html.m-view .mh-pill.ok { background: #e8f6ee; color: #1a7f4b; }

html.m-view .mh-stats { display: flex; gap: 8px; }
html.m-view .mh-stat {
  flex: 1; text-align: center; padding: 11px 4px 9px;
  background: #f7f9fc; border-radius: 10px;
}
html.m-view .mh-stat b { display: block; font-size: 24px; font-weight: 800; color: #d0342c; line-height: 1.1; }
html.m-view .mh-stat span { display: block; font-size: 11.5px; color: #6b7280; margin-top: 4px; }
html.m-view .mh-stat em { display: block; font-size: 11px; color: #9aa1ab; font-style: normal; margin-top: 2px; }

html.m-view .mh-bar { height: 6px; background: #eef1f6; border-radius: 6px; overflow: hidden; margin: 2px 0 9px; }
html.m-view .mh-bar.big { height: 8px; }
html.m-view .mh-bar i { display: block; height: 100%; background: #3b5bdb; border-radius: 6px; }

html.m-view .mh-miss { font-size: 12px; color: #c0261f; line-height: 1.65; }
html.m-view .mh-miss.all { background: #fdf1f1; border-radius: 8px; padding: 8px 10px; margin-bottom: 10px; }
html.m-view .mh-miss.ok { color: #1a7f4b; background: #eefaf3; border-radius: 8px; padding: 8px 10px; margin-bottom: 10px; }

html.m-view .mh-grp { border-top: 1px dashed #e8ebf1; padding-top: 10px; margin-top: 10px; }
html.m-view .mh-grp-head {
  display: flex; justify-content: space-between; align-items: baseline;
  font-size: 12.5px; color: #4b5563; margin-bottom: 7px;
}
html.m-view .mh-grp-head b { font-size: 12.5px; color: #1f2937; }

html.m-view .mh-todo { display: flex; gap: 10px; padding: 10px 0; border-bottom: 1px solid #f1f3f6; }
html.m-view .mh-todo:last-of-type { border-bottom: 0; }
html.m-view .mh-todo-time { flex: 0 0 76px; font-size: 12px; font-weight: 600; color: #3b5bdb; line-height: 1.5; }
html.m-view .mh-todo-body { flex: 1; min-width: 0; }
html.m-view .mh-todo-title { font-size: 13.5px; color: #1f2937; line-height: 1.45; }
html.m-view .mh-todo-meta { font-size: 11.5px; color: #8a93a3; margin-top: 3px; }
html.m-view .mh-todo.over .mh-todo-time { color: #9aa1ab; }
html.m-view .mh-todo.over .mh-todo-title { color: #9aa1ab; }
html.m-view .mh-empty { font-size: 12.5px; color: #9aa1ab; padding: 8px 0; }

html.m-view .mh-more {
  width: 100%; margin-top: 11px; padding: 11px 0; font-size: 13px; font-weight: 600;
  color: #3b5bdb; background: #f4f7ff; border: 0; border-radius: 10px; cursor: pointer;
}
html.m-view .mh-quick { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 14px; }
html.m-view .mh-quick button {
  background: #fff; border: 0; border-radius: 12px; padding: 14px 8px;
  font-size: 13px; color: #1f2937; cursor: pointer;
  box-shadow: 0 1px 3px rgba(16, 24, 40, 0.07);
}
html.m-view .mh-quick button span { display: block; font-size: 20px; margin-bottom: 5px; }
html.m-view .m-foot, html.m-view .mh-foot { text-align: center; font-size: 11px; color: #adb5bd; padding: 4px 0 6px; }

/* 手机版里主管日报提醒条：加大点击区域 */
html.m-view .submit-alert { margin-bottom: 12px; }
html.m-view .sa-item { padding: 10px 12px; font-size: 13px; }

/* ---------- 日况总览页按钮重排（2026-11-02 用户要求，仅手机版） ----------
   ① 新建项目 + 日期选择 + 选择日期：一行等比例缩小
   ② 填写日报 / 我的日报 / 部门日报 / 生成日报：两行两列
   ③ 返回首页：独占一行 */
html.m-view .dt-toolbar { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-start; }
html.m-view .dt-toolbar .tb-group { display: flex; gap: 8px; align-items: stretch; margin: 0; }
/* 2026-11-02 20:20 用户要求：新建项目独占一行（同返回首页），日期+选择日期占两列 */
html.m-view .dt-toolbar .tb-group:first-child {
  flex: 1 1 100%; display: grid; grid-template-columns: 1fr 1fr; gap: 8px;
}
html.m-view .dt-toolbar .tb-group:first-child #btn-new-project { grid-column: 1 / -1; }
html.m-view .dt-toolbar .tb-group:first-child .btn,
html.m-view .dt-toolbar .tb-group:first-child input[type="date"] {
  width: 100%; min-width: 0; padding: 10px 4px; font-size: 13.5px;
  white-space: nowrap; text-align: center;
}
/* 2026-11-02 20:20 用户要求：填写日报/我的日报样式与生成日报一致（深蓝底白字） */
html.m-view .dt-toolbar #btn-new-daily,
html.m-view .dt-toolbar #dt-mode-mine { background: var(--primary); color: #fff; }
html.m-view .dt-toolbar .tb-group:nth-child(2) { flex: 1 1 100%; display: grid; grid-template-columns: 1fr 1fr; }
html.m-view .dt-toolbar .tb-group:nth-child(2) .btn {
  width: 100%; min-width: 0; padding: 10px 4px; font-size: 13.5px;
  white-space: nowrap; text-align: center;
}
html.m-view .dt-toolbar .tb-group:nth-child(2) #btn-back-home { grid-column: 1 / -1; }

/* ---------- 弹窗表单字号（2026-11-02 20:58 用户要求，仅手机版） ----------
   员工姓名「卞晨珏（媒介渠道中心）」与 label「该项目日报（今日工作内容/进展/问题）」
   不再折到第二行：整体缩小字号，姓名值不换行。 */
html.m-view .modal .field label { font-size: 13px; margin-bottom: 4px; }
html.m-view .modal .static-value { font-size: 13.5px; padding: 8px 0; white-space: nowrap; }

/* ---------- 弹窗底部按钮（2026-11-02 21:00 用户要求，仅手机版） ----------
   「＋ 添加事项」「取消/保存/发送」文字不再折行：不换行 + 缩小字号内边距 */
html.m-view .modal .modal-actions .btn,
html.m-view .modal .qd-actions .btn {
  white-space: nowrap; flex: 0 0 auto;
  padding: 10px 14px; font-size: 13.5px;
}

/* ---------- 日报页按钮统一样式（2026-11-02 21:16 用户要求，仅手机版） ----------
   工具栏操作按钮统一深蓝底白字（生成日报此前是浅色）；部门日报有未提交时保持红色警示 */
html.m-view .dt-toolbar #btn-gen-daily,
html.m-view .dt-toolbar #btn-gen-report,
html.m-view .dt-toolbar #dt-mode-all,
html.m-view .dt-toolbar #btn-dept-daily:not(.dept-red) { background: var(--primary); color: #fff; }
