/* 算数·广告执行 — 轻量移动 H5 */
:root {
  --bg: #eef6f5;
  --surface: #fff;
  --ink: #102826;
  --muted: #3d5a56;
  --line: #b8d4d0;
  --line-soft: #d4e8e5;
  --accent: #0abab5;
  --accent-deep: #067a76;
  --accent-soft: rgba(10, 186, 181, .14);
  --danger: #b42318;
  --ok: #0d8a5f;
  --warn: #c45c2a;
  --header: #0d3d38;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body.m-body {
  font-family: "PingFang SC", "Microsoft YaHei", sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.5;
  -webkit-tap-highlight-color: transparent;
}
a { color: var(--accent-deep); text-decoration: none; }
button { font: inherit; cursor: pointer; border: none; }
.hidden { display: none !important; }

.m-login {
  min-height: 100dvh;
  padding: calc(20px + env(safe-area-inset-top)) 20px calc(24px + env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  gap: 16px;
  background: linear-gradient(165deg, #fff 0%, #f3fbfa 100%);
}
.m-login-brand h1 { margin: 0; font-size: 1.35rem; font-weight: 800; }
.m-login-brand p { margin: 6px 0 0; font-size: .88rem; color: var(--muted); line-height: 1.45; }
.m-login-brand code {
  font-family: ui-monospace, Consolas, monospace; font-size: .9em;
  padding: .05em .35em; border-radius: 4px; background: var(--accent-soft); color: var(--accent-deep);
}
.m-role-block { margin: 0; }
.m-role-head {
  margin: 0 0 8px; font-size: .78rem; font-weight: 800; color: var(--ink);
  display: flex; align-items: baseline; justify-content: space-between; gap: 8px;
}
.m-role-head span { font-weight: 600; color: var(--muted); font-size: .7rem; }
.m-role-grid {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px;
}
.m-role-card {
  appearance: none; font: inherit; text-align: left; cursor: pointer;
  padding: 10px 11px; border-radius: 12px;
  border: 1px solid var(--line); background: #fff;
  display: grid; gap: 2px; color: var(--ink);
  box-shadow: 0 1px 4px rgba(16,40,38,.04);
  transition: border-color .15s, background .15s;
}
.m-role-card:hover, .m-role-card.is-on {
  border-color: var(--accent); background: var(--accent-soft);
}
.m-role-card-tag {
  font-size: .62rem; font-weight: 800; letter-spacing: .06em; color: var(--accent-deep);
}
.m-role-card-name { font-size: .92rem; font-weight: 800; }
.m-role-card-user {
  font-family: ui-monospace, Consolas, monospace; font-size: .68rem; color: var(--muted);
}
.m-role-card-scope {
  margin-top: 4px; font-size: .66rem; font-weight: 700; color: var(--warn);
  line-height: 1.35;
}
.m-role-tip {
  margin: 8px 0 0; font-size: .74rem; color: var(--muted); line-height: 1.45;
}
.m-login-foot { margin: 0; font-size: .78rem; color: var(--muted); text-align: center; }
.m-header-role {
  display: inline-block; margin-top: 4px; padding: 2px 8px; border-radius: 999px;
  font-size: .66rem; font-weight: 800; background: rgba(255,255,255,.14); color: #9aefe9;
}
.m-login-form label { display: block; font-size: .78rem; font-weight: 700; color: var(--muted); margin-bottom: 4px; }
.m-login-form input {
  width: 100%; padding: 12px 14px; margin-bottom: 12px;
  border: 1px solid var(--line); border-radius: 12px; font-size: 16px;
}
.m-login-form input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.m-btn {
  display: flex; align-items: center; justify-content: center;
  width: 100%; min-height: 46px; padding: 0 16px;
  border-radius: 12px; font-weight: 800; font-size: .95rem;
}
.m-btn-primary { background: var(--accent); color: #fff; }
.m-btn-ghost { background: #fff; color: var(--ink); border: 1px solid var(--line); }
.m-btn-danger { background: var(--danger); color: #fff; }
.m-btn-sm { min-height: 38px; font-size: .82rem; padding: 0 12px; width: auto; }
.m-msg { padding: 10px 12px; border-radius: 10px; font-size: .88rem; }
.m-msg.err { background: #fdecea; color: var(--danger); }

.m-app {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  max-width: 640px;
  margin: 0 auto;
  background: var(--bg);
}
.m-header {
  position: sticky; top: 0; z-index: 20;
  padding: calc(10px + env(safe-area-inset-top)) 16px 10px;
  background: var(--header); color: #e8f4f2;
}
.m-header h1 { margin: 0; font-size: 1.1rem; font-weight: 800; }
.m-header p { margin: 4px 0 0; font-size: .76rem; opacity: .75; }
.m-view {
  flex: 1;
  padding: 12px 14px calc(72px + env(safe-area-inset-bottom));
}
.m-dock {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  display: grid; grid-template-columns: repeat(5, 1fr);
  background: rgba(255,255,255,.96);
  backdrop-filter: blur(10px);
  border-top: 1px solid var(--line);
  padding: 4px 4px calc(4px + env(safe-area-inset-bottom));
  max-width: 640px; margin: 0 auto;
}
.m-dock a, .m-dock button {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 2px; min-height: 52px; padding: 4px;
  background: transparent; color: var(--muted); font-size: .68rem; font-weight: 700;
  position: relative;
}
.m-dock a.is-on, .m-dock button.is-on { color: var(--accent-deep); }
.m-dock .ico { font-size: 1.15rem; line-height: 1; }
.m-dock .dot {
  position: absolute; top: 6px; right: 18%;
  min-width: 16px; height: 16px; padding: 0 4px;
  border-radius: 99px; background: var(--warn); color: #fff;
  font-size: 10px; font-weight: 800; line-height: 16px; text-align: center;
}

.m-card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 14px; padding: 14px; margin-bottom: 10px;
  box-shadow: 0 2px 8px rgba(16,40,38,.04);
}
.m-card:active { transform: scale(.99); }
.m-stat-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin-bottom: 12px; }
.m-stat {
  background: var(--surface); border: 1px solid var(--line-soft);
  border-radius: 12px; padding: 12px;
}
.m-stat span { display: block; font-size: .72rem; color: var(--muted); }
.m-stat strong { font-size: 1.15rem; font-weight: 800; color: var(--ink); }
.m-section-title {
  margin: 14px 0 8px; font-size: .78rem; font-weight: 800;
  color: var(--muted); letter-spacing: .04em;
}
.m-list-card { display: block; color: inherit; }
.m-list-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 4px; }
.m-tag {
  font-size: .68rem; font-weight: 800; padding: 2px 8px; border-radius: 99px;
  background: var(--accent-soft); color: var(--accent-deep);
}
.m-badge {
  font-size: .68rem; font-weight: 700; padding: 2px 8px; border-radius: 99px;
  background: var(--accent-soft); color: var(--accent-deep);
}
.m-badge.pending, .m-badge.pending_fin { background: #fff1e8; color: var(--warn); }
.m-badge.approved { background: #e8f7ee; color: var(--ok); }
.m-badge.rejected { background: #fdecea; color: var(--danger); }
.m-list-title { font-size: .95rem; font-weight: 800; margin: 0 0 4px; }
.m-list-meta { font-size: .76rem; color: var(--muted); }
.m-list-hint { margin: 8px 0 0; font-size: .76rem; color: var(--muted); line-height: 1.4; }
.m-actions { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.m-empty {
  text-align: center; padding: 32px 16px; color: var(--muted); font-size: .88rem;
}
.m-empty b { display: block; font-weight: 800; color: var(--ink); margin-bottom: 4px; }
.m-empty p { margin: 0; font-size: .82rem; }
.toast-wrap {
  position: fixed; left: 50%; bottom: calc(72px + env(safe-area-inset-bottom));
  transform: translateX(-50%); z-index: 90; max-width: min(92vw, 420px);
  padding: 10px 16px; border-radius: 10px; font-size: .88rem; font-weight: 600;
  box-shadow: 0 4px 16px rgba(16,40,38,.12);
}
.toast-wrap.err { background: #fdecea; color: var(--danger); }
.toast-wrap.ok { background: #e8f7ee; color: var(--ok); }
.m-kv { display: grid; gap: 8px; font-size: .86rem; }
.m-kv div { display: grid; grid-template-columns: 88px 1fr; gap: 8px; }
.m-kv b { color: var(--muted); font-weight: 600; }
.m-quick { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.m-quick a {
  display: block; padding: 12px; border-radius: 12px;
  border: 1px solid var(--line); background: #fff;
  font-size: .82rem; font-weight: 700; color: var(--ink);
  text-align: center;
}
.m-foot-link {
  display: block; text-align: center; margin-top: 16px;
  font-size: .82rem; color: var(--accent-deep); font-weight: 700;
}
.m-busy {
  display: grid; place-items: center; gap: 10px; min-height: 40vh;
  color: var(--muted); font-weight: 700;
}
.m-busy i {
  width: 28px; height: 28px; border-radius: 50%;
  border: 3px solid var(--line); border-top-color: var(--accent);
  animation: m-spin .7s linear infinite;
}
@keyframes m-spin { to { transform: rotate(360deg); } }

.m-btn:focus-visible, .m-list-card:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.m-btn.is-busy { opacity: .65; pointer-events: none; }
.m-btn-sm { min-height: 40px; }

/* AI 开工包 · 问一句（L0 演示）底部弹层 */
.m-ai-mask { position: fixed; inset: 0; background: rgba(13,38,34,.45); z-index: 150; opacity: 0; pointer-events: none; transition: opacity .18s ease; }
.m-ai-mask.show { opacity: 1; pointer-events: auto; }
.m-ai-sheet { position: fixed; left: 0; right: 0; bottom: 0; max-height: 80vh; display: flex; flex-direction: column; background: #fff; border-radius: 18px 18px 0 0; box-shadow: 0 -12px 32px rgba(0,0,0,.2); z-index: 151; transform: translateY(105%); transition: transform .22s ease; }
.m-ai-sheet.show { transform: translateY(0); }
.m-ai-head { display: flex; align-items: center; gap: 8px; padding: 12px 14px 4px; }
.m-ai-head b { flex: 1; font-size: 15px; color: #0d3d38; }
.m-ai-x { border: 0; background: #eef3f1; border-radius: 8px; width: 30px; height: 30px; color: #5c716b; font-size: 18px; line-height: 1; }
.m-ai-body { overflow-y: auto; padding: 6px 14px 2px; }
.m-ai-qrow { display: flex; flex-wrap: wrap; gap: 6px; margin: 2px 0 8px; }
.m-ai-q { border: 1px solid #cfe0da; background: #f4faf8; color: #0f6b5f; font-size: 12px; padding: 5px 10px; border-radius: 999px; }
.m-ai-out { font-size: 13px; line-height: 1.65; color: #17332f; }
.m-ai-out .t { margin: 4px 0 2px; font-weight: 700; color: #0d3d38; }
.m-ai-out .lead { color: #6b7f7b; font-size: 12px; margin: 0 0 8px; }
.m-ai-out ul { margin: 0 0 8px; padding-left: 2px; list-style: none; }
.m-ai-out li { position: relative; padding-left: 12px; margin: 2px 0; word-break: break-word; }
.m-ai-out li::before { content: ""; position: absolute; left: 0; top: .62em; width: 5px; height: 5px; border-radius: 50%; background: #b9913c; }
.m-ai-out .src { display: inline-block; margin: 0 4px 4px 0; padding: 3px 8px; background: #f2f6f4; border: 1px solid #e2ece8; border-radius: 8px; font-size: 11px; color: #0f6b5f; text-decoration: none; }
.m-ai-foot { display: flex; gap: 6px; padding: 6px 12px 8px; align-items: flex-end; }
.m-ai-foot .m-ai-mic { border: 1px solid #d8e4e0; background: #fff; color: #0d3d38; border-radius: 10px; font-size: 12px; line-height: 1; height: 38px; padding: 0 8px; white-space: nowrap; }
.m-ai-foot .m-ai-mic.on { background: #0d3d38; color: #fff; }
.m-ai-foot textarea { flex: 1; border: 1px solid #d8e4e0; border-radius: 10px; padding: 7px 10px; font-size: 13px; min-height: 38px; max-height: 100px; resize: none; font-family: inherit; color: #17332f; }
.m-ai-go { border: 0; border-radius: 10px; background: #0d3d38; color: #fff; font-size: 14px; padding: 9px 16px; }
.m-ai-note { padding: 0 14px 12px; font-size: 11px; color: #9aaba6; }
.m-ai-empty { color: #6b7f7b; font-size: 12.5px; padding: 6px 0; }
