/* ==========================================================================
   执行端（员工 / 设计师 / 财务 / 老板 / 分包商 / 业主）
   移动优先，桌面端自动放宽为双列
   ========================================================================== */

.m-app {
  --m-primary: #1b3a5c;
  --m-accent: #c99342;
  min-height: 100vh;
  background: #f2f4f8;
  display: flex;
  flex-direction: column;
  padding-bottom: 62px;   /* 给底部导航留位置 */
}

/* -------------------------------- 顶部栏 -------------------------------- */

.m-top {
  position: sticky; top: 0; z-index: 50;
  background: linear-gradient(135deg, #12263d 0%, #1b3a5c 60%, #24507c 100%);
  color: #fff; padding: 14px 16px 18px;
}
.m-top-row { display: flex; align-items: center; gap: 12px; }
.m-top-title { font-size: 17px; font-weight: 600; letter-spacing: .3px; }
.m-top-sub { font-size: 12px; color: rgba(255,255,255,.62); margin-top: 3px; }
.m-avatar {
  width: 38px; height: 38px; border-radius: 12px; background: rgba(255,255,255,.16);
  display: flex; align-items: center; justify-content: center; font-size: 15px; font-weight: 600;
  border: 1px solid rgba(255,255,255,.2); flex-shrink: 0;
}
.m-icon-btn {
  width: 34px; height: 34px; border-radius: 10px; background: rgba(255,255,255,.12);
  border: 1px solid rgba(255,255,255,.16); color: #fff; display: flex; align-items: center;
  justify-content: center; cursor: pointer; font-size: 15px; flex-shrink: 0;
}
.m-icon-btn:active { background: rgba(255,255,255,.24); }

/* 顶部指标条 */
.m-kpis { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin-top: 14px; }
.m-kpi {
  background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.12);
  border-radius: 10px; padding: 9px 11px; backdrop-filter: blur(4px);
}
.m-kpi .k { font-size: 11px; color: rgba(255,255,255,.6); }
.m-kpi .v { font-size: 17px; font-weight: 600; margin-top: 3px; font-variant-numeric: tabular-nums; }
.m-kpi .v small { font-size: 11px; font-weight: 400; color: rgba(255,255,255,.6); margin-left: 2px; }

/* -------------------------------- 内容区 -------------------------------- */

.m-body { flex: 1; padding: 12px 12px 20px; }

.m-sec { margin-bottom: 14px; }
.m-sec-title {
  display: flex; align-items: center; gap: 8px; margin: 0 2px 9px;
  font-size: 13.5px; font-weight: 600; color: #46536a;
}
.m-sec-title .line { flex: 1; height: 1px; background: #e4e9f0; }
.m-sec-title .more { font-size: 12px; color: #7a869a; font-weight: 400; }

/* 卡片 */
.m-card {
  background: #fff; border-radius: 12px; padding: 14px;
  box-shadow: 0 1px 2px rgba(28,36,48,.05), 0 4px 14px rgba(28,36,48,.04);
  margin-bottom: 10px;
}
.m-card.tap { cursor: pointer; transition: transform .12s, box-shadow .12s; }
.m-card.tap:active { transform: scale(.985); }
.m-card-head { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 10px; }
.m-card-title { font-size: 15px; font-weight: 600; line-height: 1.45; }
.m-card-sub { font-size: 12px; color: #7a869a; margin-top: 3px; }

/* 快捷功能网格 */
.m-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.m-grid.col3 { grid-template-columns: repeat(3, 1fr); }
.m-grid.col2 { grid-template-columns: repeat(2, 1fr); }
.m-tile {
  background: #fff; border-radius: 12px; padding: 12px 6px 10px; text-align: center;
  cursor: pointer; box-shadow: 0 1px 2px rgba(28,36,48,.05);
  transition: transform .12s; position: relative;
}
.m-tile:active { transform: scale(.94); }
.m-tile .ic {
  width: 38px; height: 38px; margin: 0 auto 7px; border-radius: 11px;
  display: flex; align-items: center; justify-content: center; font-size: 18px;
  background: #eef3f9;
}
.m-tile .nm { font-size: 11.5px; color: #46536a; line-height: 1.3; }
.m-tile .dot {
  position: absolute; top: 7px; right: 7px; min-width: 17px; height: 17px; padding: 0 4px;
  background: #e0574d; color: #fff; border-radius: 9px; font-size: 10.5px;
  display: flex; align-items: center; justify-content: center; font-weight: 600;
}
.m-tile.t1 .ic { background: #e9f2fc; }
.m-tile.t2 .ic { background: #e6f7f1; }
.m-tile.t3 .ic { background: #fdf2e2; }
.m-tile.t4 .ic { background: #efecff; }
.m-tile.t5 .ic { background: #fdeceb; }
.m-tile.t6 .ic { background: #fbf3e4; }

/* 列表行 */
.m-row {
  display: flex; align-items: center; gap: 11px; padding: 13px 14px; background: #fff;
  border-bottom: 1px solid #f1f4f8; cursor: pointer;
}
.m-row:first-child { border-radius: 12px 12px 0 0; }
.m-row:last-child { border-bottom: none; border-radius: 0 0 12px 12px; }
.m-list { background: #fff; border-radius: 12px; overflow: hidden; box-shadow: 0 1px 2px rgba(28,36,48,.05); }
.m-row .ic {
  width: 34px; height: 34px; border-radius: 10px; display: flex; align-items: center;
  justify-content: center; font-size: 16px; background: #eef3f9; flex-shrink: 0;
}
.m-row .tx { flex: 1; min-width: 0; }
.m-row .tx b { display: block; font-size: 13.5px; font-weight: 500; line-height: 1.45; }
.m-row .tx span { font-size: 11.5px; color: #7a869a; display: block; margin-top: 2px; }
.m-row .rt { font-size: 12px; color: #7a869a; text-align: right; flex-shrink: 0; }
.m-row .rt b { color: #1c2430; font-size: 13.5px; }
.m-row .arrow { color: #c7cfda; font-size: 16px; flex-shrink: 0; }

/* 金额 */
.m-amount { font-variant-numeric: tabular-nums; }
.m-amount.in { color: #17a673; }
.m-amount.out { color: #e08b2e; }
.m-amount.strong { font-weight: 600; font-size: 15px; }

/* 底部导航 */
.m-tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 60; background: #fff;
  border-top: 1px solid #e4e9f0; display: flex; padding: 6px 0 max(6px, env(safe-area-inset-bottom));
  box-shadow: 0 -2px 14px rgba(28,36,48,.06);
}
.m-tab {
  flex: 1; text-align: center; padding: 4px 0; cursor: pointer; position: relative;
  color: #8b95a6; font-size: 10.5px;
}
.m-tab .ti { font-size: 19px; display: block; margin-bottom: 2px; }
.m-tab.active { color: var(--m-primary); font-weight: 600; }
.m-tab .dot {
  position: absolute; top: 0; right: 50%; margin-right: -20px;
  min-width: 16px; height: 16px; padding: 0 4px; background: #e0574d; color: #fff;
  border-radius: 8px; font-size: 10px; display: flex; align-items: center; justify-content: center;
}

/* 进度条 */
.m-bar { height: 6px; background: #eef1f6; border-radius: 4px; overflow: hidden; }
.m-bar > i { display: block; height: 100%; border-radius: 4px; background: linear-gradient(90deg, #24507c, #c99342); }
.m-bar.green > i { background: linear-gradient(90deg, #14a06d, #4fd1a5); }

/* 节点进度（横向步骤） */
.m-steps { display: flex; gap: 6px; overflow-x: auto; padding: 4px 0 8px; }
.m-step {
  flex-shrink: 0; min-width: 92px; background: #f8fafc; border: 1px solid #e4e9f0;
  border-radius: 10px; padding: 9px 10px;
}
.m-step.done { background: #e6f7f1; border-color: #c8ece0; }
.m-step.doing { background: #fbf3e4; border-color: #eddfc2; }
.m-step .n { font-size: 11.5px; font-weight: 600; color: #46536a; }
.m-step .d { font-size: 10.5px; color: #7a869a; margin-top: 3px; }
.m-step.done .n { color: #0d7d55; }
.m-step.doing .n { color: #98702a; }

/* 表单 */
.m-field { margin-bottom: 13px; }
.m-field label { display: block; font-size: 12.5px; color: #46536a; margin-bottom: 6px; font-weight: 500; }
.m-field input, .m-field select, .m-field textarea {
  width: 100%; padding: 11px 12px; border: 1px solid #e4e9f0; border-radius: 10px;
  font-size: 14px; font-family: inherit; background: #fff; color: #1c2430; box-sizing: border-box;
}
.m-field input:focus, .m-field select:focus, .m-field textarea:focus {
  outline: none; border-color: #24507c; box-shadow: 0 0 0 3px rgba(36,80,124,.1);
}
.m-field textarea { min-height: 76px; resize: vertical; }
.m-field .hint { font-size: 11.5px; color: #8b95a6; margin-top: 5px; line-height: 1.6; }

/* 按钮 */
.m-btn {
  display: flex; align-items: center; justify-content: center; gap: 6px; width: 100%;
  padding: 12px; border-radius: 11px; border: 1px solid #e4e9f0; background: #fff;
  color: #1c2430; font-size: 14.5px; font-weight: 500; cursor: pointer; font-family: inherit;
}
.m-btn:active { transform: scale(.99); }
.m-btn.primary { background: #1b3a5c; border-color: #1b3a5c; color: #fff; }
.m-btn.gold { background: #c99342; border-color: #c99342; color: #fff; }
.m-btn.danger { background: #fff; border-color: #f3c9c5; color: #e0574d; }
.m-btn.sm { padding: 8px 12px; font-size: 13px; width: auto; }
.m-btn:disabled { opacity: .5; }
.m-btn-row { display: flex; gap: 9px; }

/* 标签 */
.m-tag {
  display: inline-flex; align-items: center; padding: 2px 8px; border-radius: 20px;
  font-size: 11px; font-weight: 500; white-space: nowrap;
}
.m-tag.gray { background: #f1f3f7; color: #46536a; }
.m-tag.blue { background: #e9f2fc; color: #1f6bb8; }
.m-tag.green { background: #e6f7f1; color: #0d7d55; }
.m-tag.red { background: #fdeceb; color: #c0392b; }
.m-tag.orange { background: #fdf2e2; color: #b06f16; }
.m-tag.purple { background: #efecff; color: #5a44cc; }
.m-tag.gold { background: #fbf3e4; color: #98702a; }

/* 键值列表 */
.m-kv { font-size: 13px; }
.m-kv-row { display: flex; padding: 8px 0; border-bottom: 1px dashed #eef1f6; gap: 12px; }
.m-kv-row:last-child { border-bottom: none; }
.m-kv-row .k { color: #7a869a; width: 92px; flex-shrink: 0; }
.m-kv-row .v { flex: 1; color: #1c2430; word-break: break-all; }

/* 空状态 / 加载 */
.m-empty { text-align: center; padding: 46px 20px; color: #8b95a6; font-size: 13px; }
.m-empty .ic { font-size: 34px; opacity: .35; margin-bottom: 10px; }
.m-loading { padding: 50px; text-align: center; color: #8b95a6; font-size: 13px; }

/* 底部弹层（表单） */
.m-sheet-mask {
  position: fixed; inset: 0; background: rgba(18,38,61,.45); z-index: 200;
  display: flex; align-items: flex-end; animation: mFade .16s;
}
@keyframes mFade { from { opacity: 0 } to { opacity: 1 } }
.m-sheet {
  background: #fff; width: 100%; border-radius: 16px 16px 0 0; max-height: 92vh;
  display: flex; flex-direction: column; animation: mUp .2s;
}
@keyframes mUp { from { transform: translateY(24px); opacity: .7 } to { transform: none; opacity: 1 } }
.m-sheet-head {
  padding: 16px 16px 12px; border-bottom: 1px solid #eef1f6; display: flex; align-items: center; gap: 10px;
}
.m-sheet-head h3 { margin: 0; font-size: 16px; flex: 1; }
.m-sheet-head .x { font-size: 22px; color: #8b95a6; cursor: pointer; line-height: 1; padding: 0 4px; }
.m-sheet-body { padding: 16px; overflow-y: auto; flex: 1; }
.m-sheet-foot { padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); border-top: 1px solid #eef1f6; display: flex; gap: 10px; }
.m-sheet-foot .m-btn { flex: 1; }

/* 提示 */
.m-toast-root {
  position: fixed; top: 16px; left: 50%; transform: translateX(-50%); z-index: 300;
  display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none;
}
.m-toast {
  background: rgba(28,36,48,.92); color: #fff; padding: 10px 16px; border-radius: 10px;
  font-size: 13px; max-width: 86vw; animation: mFade .18s;
}
.m-toast.ok { background: rgba(13,125,85,.95); }
.m-toast.err { background: rgba(192,57,43,.95); }

/* 提示条 */
.m-note {
  background: #fbf3e4; border: 1px solid #eddfc2; color: #8a6a33; border-radius: 10px;
  padding: 10px 12px; font-size: 12px; line-height: 1.75; margin-bottom: 12px;
}
.m-note.blue { background: #e9f2fc; border-color: #cfe3f8; color: #1f5f9e; }

/* 审批流程步骤（竖排） */
.m-flow { position: relative; padding-left: 22px; }
.m-flow::before { content: ""; position: absolute; left: 7px; top: 8px; bottom: 8px; width: 2px; background: #eef1f6; }
.m-flow-item { position: relative; padding-bottom: 14px; }
.m-flow-item::before {
  content: ""; position: absolute; left: -19px; top: 4px; width: 9px; height: 9px;
  border-radius: 50%; background: #fff; border: 2px solid #c7cfda;
}
.m-flow-item.done::before { border-color: #17a673; background: #17a673; }
.m-flow-item.pending::before { border-color: #c99342; background: #c99342; box-shadow: 0 0 0 3px rgba(201,147,66,.18); }
.m-flow-item.rejected::before { border-color: #e0574d; background: #e0574d; }
.m-flow-item .n { font-size: 13px; font-weight: 600; display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.m-flow-item .c { font-size: 12px; color: #46536a; background: #f8fafc; padding: 7px 10px; border-radius: 8px; margin-top: 5px; line-height: 1.7; }
.m-flow-item .t { font-size: 11px; color: #8b95a6; margin-top: 4px; }

/* --------------------------- 桌面端 / 平板 --------------------------- */

@media (min-width: 720px) {
  .m-app { padding-bottom: 0; }
  .m-top { padding: 18px 24px 22px; }
  .m-kpis { grid-template-columns: repeat(4, 1fr); }
  .m-body { padding: 18px 24px 30px; max-width: 1180px; margin: 0 auto; width: 100%; }
  .m-grid { grid-template-columns: repeat(6, 1fr); }
  .m-grid.col3 { grid-template-columns: repeat(4, 1fr); }

  /* 桌面端把底部导航变成左侧竖排 */
  .m-tabbar {
    position: fixed; left: 0; top: 0; bottom: 0; width: 84px; flex-direction: column;
    border-top: none; border-right: 1px solid #e4e9f0; padding: 14px 0; gap: 6px;
  }
  .m-tab { padding: 12px 0; font-size: 11px; }
  .m-tab .ti { font-size: 21px; }
  .m-tab .dot { right: 12px; margin-right: 0; }
  .m-app { padding-left: 84px; }
  .m-sheet-mask { align-items: center; justify-content: center; }
  .m-sheet { max-width: 620px; border-radius: 16px; }
  .m-list { display: grid; grid-template-columns: repeat(2, 1fr); }
  .m-row:nth-child(odd) { border-right: 1px solid #f1f4f8; }
}
