/* ==========================================================================
   算数·弱电 现场端（H5）样式体系
   设计基调与工作台一致：绿主色 #00a86a → 深青 #0f766e；卡片化、大触控区。
   适配：iPhone 刘海/底部横条（safe-area）、375-430px 主流机型、横屏提示。
   ========================================================================== */

:root {
  --m-primary: #00a86a;
  --m-primary-2: #0f766e;
  --m-primary-soft: #e6f7f0;
  --m-bg: #f2f5f4;
  --m-panel: #ffffff;
  --m-border: #e6ebe9;
  --m-text: #14201d;
  --m-muted: #6b7a76;
  --m-faint: #9aa8a4;
  --m-red: #e5484d;
  --m-orange: #e08a00;
  --m-blue: #2b7fff;
  --m-radius: 14px;
  --m-radius-sm: 10px;
  --m-font: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Segoe UI", system-ui, sans-serif;
  --m-shadow: 0 6px 20px rgba(20, 32, 29, .06);
  --m-tabbar: 56px;
  --m-top: env(safe-area-inset-top, 0px);
  --m-bottom: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; margin: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--m-font);
  background: var(--m-bg);
  color: var(--m-text);
  font-size: 15px;
  line-height: 1.5;
  overscroll-behavior-y: none;
}
input, textarea, select, button { font-family: inherit; font-size: inherit; color: inherit; }
input, textarea { -webkit-appearance: none; appearance: none; }
a { color: var(--m-primary-2); }
img { display: block; max-width: 100%; }
[hidden] { display: none !important; }

/* 骨架 --------------------------------------------------------------- */
.sk { background: linear-gradient(90deg, #eef2f1 25%, #e3e9e7 37%, #eef2f1 63%); background-size: 400% 100%; animation: sk 1.2s ease infinite; border-radius: 6px; }
@keyframes sk { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }

/* 登录 --------------------------------------------------------------- */
.m-login {
  min-height: 100dvh;
  background: linear-gradient(168deg, #0f766e 0%, #0b5f5a 42%, #08413f 100%);
  display: flex; flex-direction: column;
  padding: calc(28px + var(--m-top)) 22px calc(24px + var(--m-bottom));
  color: #fff;
  position: relative; overflow: hidden;
}
.m-login::before {
  content: ""; position: absolute; width: 460px; height: 460px; border-radius: 50%;
  background: radial-gradient(circle, rgba(0, 200, 130, .30), transparent 66%);
  top: -190px; right: -170px; pointer-events: none;
}
.m-login::after {
  content: ""; position: absolute; width: 380px; height: 380px; border-radius: 50%;
  background: radial-gradient(circle, rgba(0, 255, 190, .14), transparent 68%);
  bottom: -170px; left: -150px; pointer-events: none;
}
.m-login-head { position: relative; z-index: 1; margin-bottom: 22px; }
.m-brand { display: flex; align-items: center; gap: 10px; font-size: 19px; font-weight: 700; letter-spacing: .5px; }
.m-brand i {
  width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center;
  background: linear-gradient(140deg, #00d18a, #0f766e); font-style: normal; font-size: 17px; font-weight: 800;
  box-shadow: 0 6px 16px rgba(0, 209, 138, .3);
}
.m-login-head h1 { margin: 16px 0 4px; font-size: 25px; letter-spacing: .5px; }
.m-login-head p { margin: 0; font-size: 13px; opacity: .8; }
.m-login-card {
  position: relative; z-index: 1;
  background: rgba(255, 255, 255, .98);
  color: var(--m-text);
  border-radius: 18px; padding: 20px 18px;
  box-shadow: 0 18px 46px rgba(0, 0, 0, .22);
}
.m-login-card h2 { margin: 0 0 14px; font-size: 15px; color: var(--m-muted); font-weight: 600; }
.m-login-input { position: relative; margin-bottom: 12px; }
.m-login-input label { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); font-size: 13px; color: var(--m-faint); pointer-events: none; }
.m-login-input input {
  width: 100%; height: 50px; border: 1px solid var(--m-border); border-radius: 12px;
  padding: 0 13px; background: #f7faf9; outline: none; transition: .18s;
}
.m-login-input input:focus { border-color: var(--m-primary); background: #fff; box-shadow: 0 0 0 3px rgba(0, 168, 106, .12); }
.m-btn {
  width: 100%; height: 50px; border: 0; border-radius: 12px;
  background: linear-gradient(135deg, #00c17c, #0f766e);
  color: #fff; font-size: 16px; font-weight: 600; letter-spacing: 1px;
  box-shadow: 0 8px 20px rgba(0, 168, 106, .28); transition: transform .12s, opacity .12s;
}
.m-btn:active { transform: scale(.975); }
.m-btn:disabled { opacity: .6; }
.m-btn.ghost { background: #fff; color: var(--m-primary-2); border: 1px solid var(--m-border); box-shadow: none; }
.m-btn.danger { background: linear-gradient(135deg, #ff6b6b, #e5484d); box-shadow: 0 8px 20px rgba(229, 72, 77, .26); }
.m-btn.sm { height: 40px; font-size: 14px; border-radius: 10px; }
.m-roles { position: relative; z-index: 1; margin-top: 20px; }
.m-roles-title { font-size: 12px; opacity: .72; margin-bottom: 9px; }
.m-role-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.m-role {
  text-align: left; border: 1px solid rgba(255, 255, 255, .22); border-radius: 12px;
  background: rgba(255, 255, 255, .08); color: #fff; padding: 10px 12px; backdrop-filter: blur(4px);
  transition: .16s;
}
.m-role:active, .m-role.active { background: rgba(255, 255, 255, .2); border-color: rgba(255, 255, 255, .5); }
.m-role strong { display: block; font-size: 14px; }
.m-role span { display: block; font-size: 11px; opacity: .72; margin-top: 2px; }
.m-login-foot { text-align: center; font-size: 12px; opacity: .62; margin-top: auto; padding-top: 22px; position: relative; z-index: 1; }
.m-login-foot a { color: #fff; }

/* 布局 --------------------------------------------------------------- */
.m-app { height: 100vh; height: 100dvh; min-height: 100dvh; overflow: hidden; display: flex; flex-direction: column; }
.m-scroll {
  flex: 1; min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch;
  overscroll-behavior-y: contain;
  padding-bottom: calc(var(--m-tabbar) + var(--m-bottom) + 12px);
}

/* 滚动条：移动端/WebView 隐去（贴近原生 App），桌面预览给一条细窄低对比的
   —— 覆盖 Windows 默认的粗灰条，也避免它在 520px 收窄列里压住卡片右缘 -------- */
.m-scroll::-webkit-scrollbar, .m-detail-body::-webkit-scrollbar,
.m-sheet-body::-webkit-scrollbar, .m-dialog p::-webkit-scrollbar {
  width: 0; height: 0;
}
@media (min-width: 620px) {
  .m-scroll::-webkit-scrollbar, .m-detail-body::-webkit-scrollbar,
  .m-sheet-body::-webkit-scrollbar, .m-dialog p::-webkit-scrollbar {
    width: 6px; height: 6px;
  }
  .m-scroll::-webkit-scrollbar-track, .m-detail-body::-webkit-scrollbar-track,
  .m-sheet-body::-webkit-scrollbar-track, .m-dialog p::-webkit-scrollbar-track {
    background: transparent;
  }
  .m-scroll::-webkit-scrollbar-thumb, .m-detail-body::-webkit-scrollbar-thumb,
  .m-sheet-body::-webkit-scrollbar-thumb, .m-dialog p::-webkit-scrollbar-thumb {
    background: rgba(15, 118, 110, .22); border-radius: 99px;
  }
  .m-scroll::-webkit-scrollbar-thumb:hover, .m-detail-body::-webkit-scrollbar-thumb:hover,
  .m-sheet-body::-webkit-scrollbar-thumb:hover, .m-dialog p::-webkit-scrollbar-thumb:hover {
    background: rgba(15, 118, 110, .45);
  }
}
.m-page-head {
  background: linear-gradient(150deg, #0f766e, #0b5f5a 62%, #0a5450);
  color: #fff; padding: calc(14px + var(--m-top)) 16px 46px;
  position: relative; overflow: hidden; border-radius: 0 0 22px 22px;
}
.m-page-head::after {
  content: ""; position: absolute; width: 260px; height: 260px; border-radius: 50%;
  background: radial-gradient(circle, rgba(0, 209, 138, .34), transparent 68%);
  top: -130px; right: -90px;
}
.m-page-head .m-ph-row { display: flex; align-items: center; justify-content: space-between; position: relative; z-index: 1; }
.m-page-head h2 { margin: 0; font-size: 18px; font-weight: 600; }
.m-page-head .m-ph-sub { font-size: 12px; opacity: .78; margin-top: 3px; }
.m-head-actions { display: flex; align-items: center; gap: 8px; }
.m-icon-btn {
  width: 34px; height: 34px; border-radius: 10px; border: 0; padding: 0;
  background: rgba(255, 255, 255, .16); color: #fff; font-size: 16px;
  display: grid; place-items: center; position: relative;
}
.m-icon-btn:active { background: rgba(255, 255, 255, .3); }
.m-icon-btn[data-badge]::after {
  content: attr(data-badge); position: absolute; top: -4px; right: -4px;
  background: #ff4d4f; color: #fff; font-size: 10px; line-height: 1;
  padding: 3px 5px; border-radius: 99px; border: 1.5px solid #0b5f5a;
}
.m-main { margin-top: -34px; position: relative; z-index: 2; padding: 0 14px; }
.m-section { margin-top: 16px; }
.m-section-title { display: flex; align-items: center; justify-content: space-between; margin: 18px 2px 9px; }
.m-section-title h3 { margin: 0; font-size: 15px; font-weight: 600; }
.m-section-title button { border: 0; background: none; color: var(--m-primary-2); font-size: 13px; padding: 4px; }

/* 卡片 --------------------------------------------------------------- */
.m-card {
  background: var(--m-panel); border-radius: var(--m-radius); padding: 14px;
  box-shadow: var(--m-shadow); border: 1px solid rgba(230, 235, 233, .9);
}
.m-card + .m-card { margin-top: 10px; }
.m-card.flat { box-shadow: none; border: 1px solid var(--m-border); }

/* 首页统计 ----------------------------------------------------------- */
.m-stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.m-stat {
  background: var(--m-panel); border-radius: 12px; padding: 11px 6px; text-align: center;
  box-shadow: var(--m-shadow); border: 1px solid rgba(230, 235, 233, .9); position: relative; overflow: hidden;
}
.m-stat:active { transform: scale(.97); }
.m-stat b { display: block; font-size: 20px; font-weight: 700; letter-spacing: -.5px; color: var(--m-primary-2); font-variant-numeric: tabular-nums; }
.m-stat b.warn { color: var(--m-orange); }
.m-stat b.danger { color: var(--m-red); }
.m-stat span { display: block; font-size: 11px; color: var(--m-muted); margin-top: 2px; }

/* 快捷入口宫格 ------------------------------------------------------- */
.m-quick-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px 2px; }
.m-quick {
  border: 0; background: none; padding: 9px 2px; border-radius: 12px;
  display: flex; flex-direction: column; align-items: center; gap: 6px; position: relative;
}
.m-quick:active { background: #f0f6f4; }
.m-quick i {
  width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center;
  font-style: normal; font-size: 18px; font-weight: 700; color: #fff;
  background: linear-gradient(140deg, #00c17c, #0f766e);
  box-shadow: 0 5px 12px rgba(0, 168, 106, .22);
}
.m-quick.t2 i { background: linear-gradient(140deg, #38b6ff, #1f7ae0); box-shadow: 0 5px 12px rgba(43, 127, 255, .22); }
.m-quick.t3 i { background: linear-gradient(140deg, #ffb44d, #e08a00); box-shadow: 0 5px 12px rgba(224, 138, 0, .22); }
.m-quick.t4 i { background: linear-gradient(140deg, #ff8a8a, #e5484d); box-shadow: 0 5px 12px rgba(229, 72, 77, .22); }
.m-quick.t5 i { background: linear-gradient(140deg, #9d8cff, #6c5ce7); box-shadow: 0 5px 12px rgba(108, 92, 231, .22); }
.m-quick span { font-size: 11.5px; color: var(--m-text); }
.m-quick em {
  position: absolute; top: 4px; right: 50%; margin-right: -30px;
  background: var(--m-red); color: #fff; font-style: normal; font-size: 10px;
  line-height: 1; padding: 3px 5px; border-radius: 99px;
}

/* 单据卡片 ----------------------------------------------------------- */
.m-doc {
  background: var(--m-panel); border-radius: var(--m-radius); padding: 13px 14px;
  box-shadow: var(--m-shadow); border: 1px solid rgba(230, 235, 233, .9);
  display: block; width: 100%; text-align: left;
}
.m-doc + .m-doc { margin-top: 10px; }
.m-doc:active { background: #fafcfb; }
.m-doc-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.m-doc-title { font-size: 15px; font-weight: 600; margin: 0; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.m-doc-no { font-size: 11.5px; color: var(--m-faint); margin-top: 3px; font-variant-numeric: tabular-nums; }
.m-doc-meta { margin-top: 9px; display: flex; flex-direction: column; gap: 4px; }
.m-doc-line { font-size: 12.5px; color: var(--m-muted); display: flex; gap: 6px; align-items: baseline; }
.m-doc-line b { color: var(--m-text); font-weight: 500; }
.m-doc-line i { font-style: normal; color: var(--m-faint); }
.m-doc-foot { margin-top: 11px; padding-top: 10px; border-top: 1px dashed var(--m-border); display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.m-doc-money { font-size: 15px; font-weight: 700; color: var(--m-primary-2); font-variant-numeric: tabular-nums; }
.m-doc-acts { display: flex; gap: 7px; }

/* 状态标签 ----------------------------------------------------------- */
.m-tag {
  display: inline-flex; align-items: center; gap: 4px; font-size: 11.5px; line-height: 1;
  padding: 5px 8px; border-radius: 7px; background: #eef2f1; color: #5b6a66; white-space: nowrap; flex: none;
}
.m-tag.ok { background: #e4f8ee; color: #0b7a4b; }
.m-tag.run { background: #e7f1ff; color: #1f6fd0; }
.m-tag.wait { background: #fff3e0; color: #b56b00; }
.m-tag.bad { background: #fdeaea; color: #c93a3f; }
.m-tag.off { background: #eef2f1; color: #7b8a86; }

/* 分段 / 筛选 -------------------------------------------------------- */
.m-seg {
  display: flex; gap: 4px; background: #e9efed; border-radius: 11px; padding: 4px;
  overflow-x: auto; scrollbar-width: none;
}
.m-seg::-webkit-scrollbar { display: none; }
.m-seg button {
  flex: 1 0 auto; border: 0; background: none; padding: 8px 12px; border-radius: 8px;
  font-size: 13.5px; color: var(--m-muted); white-space: nowrap; transition: .16s;
}
.m-seg button.active { background: #fff; color: var(--m-primary-2); font-weight: 600; box-shadow: 0 2px 6px rgba(20, 32, 29, .08); }
.m-chips { display: flex; gap: 7px; overflow-x: auto; padding: 2px 0; scrollbar-width: none; }
.m-chips::-webkit-scrollbar { display: none; }
.m-chip {
  border: 1px solid var(--m-border); background: #fff; color: var(--m-muted);
  padding: 6px 12px; border-radius: 99px; font-size: 12.5px; white-space: nowrap;
}
.m-chip.active { background: var(--m-primary-soft); border-color: rgba(0, 168, 106, .35); color: var(--m-primary-2); font-weight: 600; }

/* 搜索 --------------------------------------------------------------- */
.m-search { display: flex; gap: 8px; align-items: center; margin: 12px 0 0; }
.m-search input {
  flex: 1; height: 42px; border: 1px solid var(--m-border); border-radius: 11px;
  background: #fff; padding: 0 12px 0 34px; outline: none;
}
.m-search input:focus { border-color: var(--m-primary); }
.m-search { position: relative; }
.m-search::before { content: "🔍"; position: absolute; left: 10px; top: 11px; font-size: 13px; opacity: .5; pointer-events: none; }
.m-search .m-search-btn { height: 42px; padding: 0 14px; border: 0; border-radius: 11px; background: var(--m-panel); color: var(--m-primary-2); box-shadow: var(--m-shadow); font-size: 13px; }

/* 表单 --------------------------------------------------------------- */
.m-field { margin-bottom: 13px; }
.m-field > label { display: block; font-size: 12.5px; color: var(--m-muted); margin-bottom: 6px; }
.m-field > label em { color: var(--m-red); font-style: normal; margin-left: 3px; }
.m-field input, .m-field textarea, .m-field select {
  width: 100%; min-height: 46px; border: 1px solid var(--m-border); border-radius: 11px;
  background: #fff; padding: 11px 12px; outline: none; transition: .16s;
}
.m-field textarea { min-height: 82px; resize: vertical; line-height: 1.55; }
.m-field input:focus, .m-field textarea:focus, .m-field select:focus { border-color: var(--m-primary); box-shadow: 0 0 0 3px rgba(0, 168, 106, .1); }
.m-field input.err, .m-field textarea.err { border-color: var(--m-red); }
.m-field .m-hint { font-size: 11.5px; color: var(--m-faint); margin-top: 5px; }
.m-field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.m-upload-box {
  display: flex; flex-wrap: wrap; gap: 8px;
}
.m-thumb {
  width: 76px; height: 76px; border-radius: 11px; overflow: hidden; position: relative;
  border: 1px solid var(--m-border); background: #f4f7f6;
}
.m-thumb img { width: 100%; height: 100%; object-fit: cover; }
.m-thumb button {
  position: absolute; top: 0; right: 0; width: 20px; height: 20px; border: 0; border-radius: 0 10px 0 8px;
  background: rgba(20, 32, 29, .62); color: #fff; font-size: 12px; line-height: 1; padding: 0;
}
.m-thumb .m-ext { width: 100%; height: 100%; display: grid; place-items: center; font-size: 12px; color: var(--m-muted); }
.m-add-file {
  width: 76px; height: 76px; border-radius: 11px; border: 1px dashed #bfd0cb; background: #f7faf9;
  color: var(--m-faint); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  font-size: 11px; position: relative; overflow: hidden;
}
.m-add-file b { font-size: 20px; font-weight: 400; line-height: 1; }
.m-add-file input { position: absolute; inset: 0; opacity: 0; width: 100%; height: 100%; }

/* 详情 --------------------------------------------------------------- */
.m-detail {
  position: fixed; inset: 0; z-index: 60; background: var(--m-bg);
  display: flex; flex-direction: column;
  animation: slideIn .22s cubic-bezier(.32, .72, 0, 1);
}
@keyframes slideIn { from { transform: translateX(28px); opacity: .4; } to { transform: none; opacity: 1; } }
.m-detail-head {
  background: linear-gradient(150deg, #0f766e, #0a5450);
  color: #fff; padding: calc(12px + var(--m-top)) 14px 20px;
  display: flex; align-items: flex-start; gap: 10px;
}
.m-detail-head .m-back {
  width: 34px; height: 34px; flex: none; border: 0; border-radius: 10px; background: rgba(255, 255, 255, .16);
  color: #fff; font-size: 18px; line-height: 1; display: grid; place-items: center;
}
.m-detail-head h2 { margin: 0; font-size: 16.5px; font-weight: 600; }
.m-detail-head .m-detail-sub { font-size: 12px; opacity: .8; margin-top: 4px; }
.m-detail-body { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 12px 14px calc(84px + var(--m-bottom)); }
.m-detail-group { background: var(--m-panel); border-radius: var(--m-radius); box-shadow: var(--m-shadow); border: 1px solid rgba(230, 235, 233, .9); overflow: hidden; }
.m-detail-group + .m-detail-group { margin-top: 10px; }
.m-detail-group > h4 {
  margin: 0; padding: 12px 14px 8px; font-size: 12.5px; color: var(--m-faint); font-weight: 600;
  letter-spacing: .4px;
}
.m-kv { display: flex; gap: 12px; padding: 9px 14px; font-size: 13.5px; border-top: 1px solid #f2f5f4; align-items: flex-start; }
.m-kv:first-of-type { border-top: 0; }
.m-kv > span { flex: none; width: 84px; color: var(--m-muted); font-size: 12.5px; }
.m-kv > div { flex: 1; min-width: 0; word-break: break-word; }
.m-kv .m-money { color: var(--m-primary-2); font-weight: 700; font-variant-numeric: tabular-nums; }
.m-kv a { color: var(--m-blue); }
.m-kv .m-kv-acts { display: flex; gap: 8px; margin-top: 6px; }
.m-kv .m-kv-acts button { border: 1px solid var(--m-border); background: #fff; border-radius: 8px; padding: 5px 10px; font-size: 12px; color: var(--m-primary-2); }
.m-detail-foot {
  position: absolute; left: 0; right: 0; bottom: 0;
  background: rgba(255, 255, 255, .96); backdrop-filter: blur(10px);
  border-top: 1px solid var(--m-border);
  padding: 10px 14px calc(10px + var(--m-bottom));
  display: flex; gap: 9px;
}
.m-detail-foot .m-btn { flex: 1; }

/* 时间轴 ------------------------------------------------------------- */
.m-timeline { padding: 4px 14px 12px; }
.m-tl-item { position: relative; padding: 0 0 14px 20px; }
.m-tl-item::before { content: ""; position: absolute; left: 3px; top: 5px; width: 8px; height: 8px; border-radius: 50%; background: var(--m-primary); }
.m-tl-item::after { content: ""; position: absolute; left: 6.5px; top: 15px; bottom: 0; width: 1px; background: var(--m-border); }
.m-tl-item:last-child { padding-bottom: 0; }
.m-tl-item:last-child::after { display: none; }
.m-tl-item b { font-size: 13px; }
.m-tl-item p { margin: 3px 0 0; font-size: 12.5px; color: var(--m-muted); }

/* 底部 Tab ----------------------------------------------------------- */
.m-tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 50;
  height: calc(var(--m-tabbar) + var(--m-bottom));
  padding-bottom: var(--m-bottom);
  background: rgba(255, 255, 255, .97); backdrop-filter: blur(12px);
  border-top: 1px solid var(--m-border);
  display: grid; grid-template-columns: repeat(5, 1fr);
}
.m-tab {
  border: 0; background: none; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 2px; color: var(--m-faint); font-size: 10.5px; position: relative; padding: 0;
}
.m-tab i { font-style: normal; font-size: 20px; line-height: 1; }
.m-tab.active { color: var(--m-primary-2); font-weight: 600; }
.m-tab em {
  position: absolute; top: 5px; left: 50%; margin-left: 6px;
  background: #ff4d4f; color: #fff; font-style: normal; font-size: 10px; line-height: 1;
  padding: 2px 5px; border-radius: 99px;
}

/* 弹层 --------------------------------------------------------------- */
.m-mask { position: fixed; inset: 0; z-index: 70; background: rgba(12, 22, 20, .48); animation: fade .18s; }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.m-sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 71;
  background: var(--m-panel); border-radius: 20px 20px 0 0;
  max-height: 88dvh; display: flex; flex-direction: column;
  padding-bottom: var(--m-bottom);
  animation: up .26s cubic-bezier(.32, .72, 0, 1);
}
@keyframes up { from { transform: translateY(100%); } to { transform: none; } }
.m-sheet-head { padding: 16px 18px 10px; display: flex; align-items: center; justify-content: space-between; gap: 10px; flex: none; }
.m-sheet-head h3 { margin: 0; font-size: 16px; font-weight: 600; }
.m-sheet-head button { border: 0; background: none; font-size: 20px; color: var(--m-faint); line-height: 1; padding: 0 2px; }
/* 弹层右上角：最大化 / 关闭。手机上弹层本就铺满，按钮无意义，故只在宽屏显示 */
.m-head-tools { display: flex; align-items: center; gap: 2px; flex: none; }
.m-max-btn { display: none; }
@media (min-width: 620px) {
  .m-max-btn {
    display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 9px;
    border: 1px solid var(--m-border); background: #fff; color: var(--m-primary); font-size: 13px;
  }
  .m-max-btn.on { background: var(--m-primary-soft); border-color: #bfe0d2; }
}
/* 最大化：底部弹层铺满视口，签字区跟着长高，方便平板上签字与长表单填写 */
.m-sheet.m-max { max-height: 100dvh; height: 100dvh; border-radius: 0; padding-bottom: 0; }
.m-dialog.m-max { max-width: 100%; }
.m-dialog.m-max p { max-height: none; }
.m-sign.m-max { height: 100dvh; border-radius: 0; display: flex; flex-direction: column; }
.m-sign.m-max .m-sign-pad { flex: 1; height: auto; max-height: none; }
.m-sheet-body { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 2px 18px 8px; }
.m-sheet-foot { flex: none; padding: 12px 18px 14px; display: flex; gap: 9px; border-top: 1px solid var(--m-border); }
.m-sheet-foot .m-btn { flex: 1; }
.m-center { position: fixed; inset: 0; z-index: 75; display: grid; place-items: center; padding: 24px; }
.m-dialog { background: #fff; border-radius: 16px; padding: 20px 18px 14px; width: 100%; max-width: 320px; text-align: center; animation: pop .2s; }
@keyframes pop { from { transform: scale(.92); opacity: .5; } to { transform: none; opacity: 1; } }
.m-dialog h3 { margin: 0 0 6px; font-size: 16px; }
.m-dialog-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.m-dialog-head h3 { margin: 0 0 6px; flex: 1; min-width: 0; }
.m-dialog p { margin: 0 0 16px; font-size: 13.5px; color: var(--m-muted); white-space: pre-wrap; text-align: left; max-height: 46vh; overflow: auto; }
.m-dialog textarea { width: 100%; min-height: 70px; border: 1px solid var(--m-border); border-radius: 11px; padding: 10px; margin-bottom: 12px; outline: none; }
.m-dialog-acts { display: flex; gap: 9px; }
.m-dialog-acts .m-btn { flex: 1; }
.m-message { margin: 12px 14px 0; border-radius: 12px; padding: 11px 13px; font-size: 13px; }
.m-message.info { background: var(--m-primary-soft); color: #0b7a4b; }
.m-message.warn { background: #fff8e6; color: #a46700; }
/* 可点击的提示条（离线待同步入口） */
button.m-message.act {
  display: block; width: calc(100% - 28px); text-align: left; border: 0; font: inherit;
  font-size: 13px; cursor: pointer;
}
button.m-message.act:active { background: #fdf0d5; }
button.m-message.act em { display: block; font-style: normal; font-size: 11.5px; opacity: .78; margin-top: 3px; }

/* 手写签名 ------------------------------------------------------------- */
.m-sign {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 76;
  background: var(--m-panel); border-radius: 20px 20px 0 0;
  padding: 16px 16px calc(14px + var(--m-bottom));
  animation: up .26s cubic-bezier(.32, .72, 0, 1);
}
.m-sign-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.m-sign-head b { display: block; font-size: 16px; }
.m-sign-head span { display: block; font-size: 11.5px; color: var(--m-faint); margin-top: 3px; }
.m-sign-head button { border: 0; background: none; font-size: 22px; line-height: 1; color: var(--m-faint); padding: 0 2px; }
.m-sign-pad {
  position: relative; height: 42dvh; min-height: 190px; max-height: 320px;
  border: 1px dashed #bfd0cb; border-radius: 14px; background: #fcfefd; overflow: hidden;
}
.m-sign-pad canvas { display: block; width: 100%; height: 100%; touch-action: none; }
.m-sign-tip {
  position: absolute; inset: 0; display: grid; place-items: center;
  font-size: 13px; color: var(--m-faint); pointer-events: none;
}
.m-sign-foot { display: flex; gap: 9px; margin-top: 14px; }
.m-sign-foot .m-btn { flex: 1; }
/* 弹层里的签字回显 */
.m-sign-box { display: flex; align-items: center; gap: 10px; }
.m-sign-box img {
  flex: 1; min-width: 0; height: 74px; object-fit: contain; object-position: left center;
  border: 1px solid var(--m-border); border-radius: 11px; background: #fff; padding: 3px;
}
.m-sign-box-empty {
  flex: 1; min-width: 0; height: 74px; border: 1px dashed #bfd0cb; border-radius: 11px;
  background: #f7faf9; color: var(--m-faint); font-size: 11.5px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
}
.m-sign-box-empty b { font-size: 18px; font-weight: 400; }
.m-sign-box .m-btn { flex: none; width: 96px; }

/* Toast -------------------------------------------------------------- */
.m-toasts { position: fixed; left: 0; right: 0; top: calc(16px + var(--m-top)); z-index: 99; display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none; }
.m-toast {
  background: rgba(20, 32, 29, .9); color: #fff; font-size: 13.5px;
  padding: 10px 16px; border-radius: 99px; max-width: 82vw;
  animation: toastIn .2s; box-shadow: 0 8px 24px rgba(0, 0, 0, .2);
}
.m-toast.ok { background: rgba(0, 140, 90, .94); }
.m-toast.err { background: rgba(206, 52, 58, .94); }
@keyframes toastIn { from { transform: translateY(-8px); opacity: 0; } to { transform: none; opacity: 1; } }

/* 空 / 加载 / 下拉 --------------------------------------------------- */
.m-empty { text-align: center; padding: 46px 20px; color: var(--m-faint); }
.m-empty i { font-size: 38px; font-style: normal; display: block; margin-bottom: 10px; opacity: .5; }
.m-empty p { margin: 0 0 4px; font-size: 13.5px; }
.m-empty button { margin-top: 12px; border: 1px solid var(--m-border); background: #fff; border-radius: 9px; padding: 8px 18px; color: var(--m-primary-2); font-size: 13px; }
.m-loading { text-align: center; padding: 20px; color: var(--m-faint); font-size: 13px; }
.m-loadmore { text-align: center; padding: 16px 0 6px; color: var(--m-faint); font-size: 12.5px; }
.m-pull { text-align: center; font-size: 12.5px; color: var(--m-muted); height: 0; overflow: hidden; transition: height .18s; }
.m-pull.show { height: 34px; padding-top: 10px; }

/* 打卡 --------------------------------------------------------------- */
.m-punch-hero { text-align: center; padding: 8px 0 4px; }
.m-punch-clock { font-size: 40px; font-weight: 700; letter-spacing: -1px; font-variant-numeric: tabular-nums; color: var(--m-primary-2); }
.m-punch-date { font-size: 12.5px; color: var(--m-muted); margin-top: 2px; }
.m-punch-ring {
  width: 168px; height: 168px; margin: 18px auto 6px; border-radius: 50%;
  display: grid; place-items: center; position: relative;
  background: conic-gradient(from 0deg, rgba(0, 168, 106, .16), rgba(0, 209, 138, .36), rgba(0, 168, 106, .16));
}
.m-punch-ring::after { content: ""; position: absolute; inset: 9px; border-radius: 50%; background: #fff; }
.m-punch-btn {
  position: relative; z-index: 1; width: 126px; height: 126px; border-radius: 50%; border: 0;
  background: linear-gradient(150deg, #00c17c, #0f766e); color: #fff;
  box-shadow: 0 12px 30px rgba(0, 168, 106, .34);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
}
.m-punch-btn:active { transform: scale(.96); }
.m-punch-btn b { font-size: 21px; letter-spacing: 2px; }
.m-punch-btn span { font-size: 11.5px; opacity: .86; }
.m-punch-btn.out { background: linear-gradient(150deg, #ffb44d, #e08a00); box-shadow: 0 12px 30px rgba(224, 138, 0, .3); }
.m-punch-btn.done { background: linear-gradient(150deg, #b8c6c2, #8a9a96); box-shadow: none; }
.m-punch-slots { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 14px; }
.m-punch-slot { background: #f7faf9; border: 1px solid var(--m-border); border-radius: 12px; padding: 10px 12px; }
.m-punch-slot span { display: block; font-size: 11.5px; color: var(--m-faint); }
.m-punch-slot b { display: block; font-size: 16px; font-variant-numeric: tabular-nums; margin-top: 3px; }
.m-punch-slot em { font-style: normal; font-size: 11px; color: var(--m-muted); display: block; margin-top: 2px; }

/* 消息 --------------------------------------------------------------- */
.m-msg { display: flex; gap: 10px; padding: 13px 14px; background: #fff; border-radius: var(--m-radius); box-shadow: var(--m-shadow); border: 1px solid rgba(230, 235, 233, .9); }
.m-msg + .m-msg { margin-top: 10px; }
.m-msg.unread { border-left: 3px solid var(--m-primary); }
.m-msg i {
  width: 36px; height: 36px; flex: none; border-radius: 11px; display: grid; place-items: center;
  background: var(--m-primary-soft); font-style: normal; font-size: 17px;
}
.m-msg > div { flex: 1; min-width: 0; }
.m-msg b { font-size: 14px; display: block; }
.m-msg p { margin: 3px 0 0; font-size: 12.5px; color: var(--m-muted); }
.m-msg time { font-size: 11px; color: var(--m-faint); flex: none; }

/* 我的 --------------------------------------------------------------- */
.m-me-hero { display: flex; align-items: center; gap: 13px; }
.m-avatar {
  width: 56px; height: 56px; border-radius: 18px; flex: none; display: grid; place-items: center;
  background: linear-gradient(140deg, #00d18a, #0f766e); color: #fff; font-size: 21px; font-weight: 700;
}
.m-me-hero b { font-size: 17px; display: block; }
.m-me-hero span { font-size: 12.5px; opacity: .82; }
.m-list { background: var(--m-panel); border-radius: var(--m-radius); overflow: hidden; box-shadow: var(--m-shadow); border: 1px solid rgba(230, 235, 233, .9); }
.m-list-item {
  width: 100%; border: 0; background: none; text-align: left;
  display: flex; align-items: center; gap: 11px; padding: 14px 15px; font-size: 14.5px;
  border-top: 1px solid #f2f5f4;
}
.m-list-item:first-child { border-top: 0; }
.m-list-item:active { background: #f7faf9; }
.m-list-item i { font-style: normal; width: 22px; text-align: center; font-size: 16px; }
.m-list-item span { flex: 1; min-width: 0; }
.m-list-item em { font-style: normal; font-size: 12.5px; color: var(--m-faint); }
.m-list-item.danger span { color: var(--m-red); }

/* 横屏提示 ----------------------------------------------------------- */
.m-rotate { display: none; }
@media (orientation: landscape) and (max-height: 480px) {
  .m-rotate { display: flex; position: fixed; inset: 0; z-index: 999; background: #0f766e; color: #fff; align-items: center; justify-content: center; font-size: 15px; }
}

/* 宽屏（平板）居中收窄，避免拉满难看 --------------------------------- */
@media (min-width: 620px) {
  body { background: #e4eae8; }
  .m-app, .m-login { max-width: 520px; margin: 0 auto; box-shadow: 0 0 40px rgba(0, 0, 0, .08); }
  .m-tabbar { max-width: 520px; left: 50%; transform: translateX(-50%); }
  .m-detail, .m-sheet { max-width: 520px; left: 50%; right: auto; width: 100%; transform: translateX(-50%); }
  .m-sign { max-width: 520px; left: 50%; right: auto; width: 100%; transform: translateX(-50%); }
  .m-detail { animation: none; }
}
