/* 算数-TMS · 移动端 H5 */
:root {
  --m-bg: #f3f6f8;
  --m-card: #ffffff;
  --m-ink: #122033;
  --m-muted: #6b7c8f;
  --m-accent: #0d9488;
  --m-accent-2: #c4860a;
  --m-danger: #dc2626;
  --m-ok: #059669;
  --m-line: #e5edf3;
  --m-top: #0f1c28;
}
* { box-sizing: border-box; }
body.m-body {
  margin: 0;
  font-family: "PingFang SC", "Noto Sans SC", "Microsoft YaHei", sans-serif;
  background: var(--m-bg);
  color: var(--m-ink);
  padding-bottom: calc(64px + env(safe-area-inset-bottom));
  -webkit-tap-highlight-color: transparent;
}
.m-top {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--m-top);
  color: #fff;
  padding: .85rem 1rem .75rem;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: .75rem;
}
.m-brand-row {
  display: flex;
  align-items: center;
  gap: .55rem;
}
.m-logo {
  height: 28px;
  width: auto;
  display: block;
  flex-shrink: 0;
}
.m-login-brand {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: .55rem;
  margin: 0;
  font-size: 1.2rem;
}
.m-login-brand img {
  height: 40px;
  width: auto;
  display: block;
}
.m-logout {
  color: #9fb2c2;
  text-decoration: none;
  font-size: .82rem;
  white-space: nowrap;
}
.m-main { padding: .9rem .9rem 1.25rem; max-width: 560px; margin: 0 auto; }
.m-alert {
  padding: .7rem .85rem;
  border-radius: 8px;
  margin-bottom: .85rem;
  font-size: .9rem;
}
.m-alert.ok { background: #ecfdf5; color: var(--m-ok); }
.m-alert.err { background: #fef2f2; color: var(--m-danger); }

.m-hero {
  background: linear-gradient(135deg, #123247, #0d9488);
  color: #fff;
  border-radius: 12px;
  padding: 1.1rem 1rem;
  margin-bottom: 1rem;
}
.m-hero h1 { margin: 0 0 .35rem; font-size: 1.25rem; }
.m-hero p { margin: 0; opacity: .88; font-size: .88rem; }

.m-todo {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .65rem;
  margin-bottom: 1rem;
}
.m-todo a {
  display: block;
  text-decoration: none;
  color: inherit;
  background: var(--m-card);
  border: 1px solid var(--m-line);
  border-radius: 10px;
  padding: .9rem .85rem;
}
.m-todo .n {
  font-size: 1.55rem;
  font-weight: 800;
  color: var(--m-accent);
  line-height: 1.1;
}
.m-todo .l { margin-top: .25rem; font-size: .82rem; color: var(--m-muted); }

.m-card {
  background: var(--m-card);
  border: 1px solid var(--m-line);
  border-radius: 10px;
  padding: .95rem;
  margin-bottom: .7rem;
}
.m-card h3 { margin: 0 0 .35rem; font-size: 1rem; }
.m-meta { color: var(--m-muted); font-size: .82rem; line-height: 1.55; }
.m-row {
  display: flex;
  justify-content: space-between;
  gap: .5rem;
  align-items: center;
  margin-top: .65rem;
}
.m-badge {
  display: inline-block;
  padding: .15rem .45rem;
  border-radius: 999px;
  background: #ecfdf5;
  color: #0f766e;
  font-size: .72rem;
  font-weight: 700;
}
.m-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: .65rem 1rem;
  border-radius: 8px;
  border: none;
  background: var(--m-accent);
  color: #fff;
  font-weight: 700;
  font-size: .95rem;
  text-decoration: none;
  width: 100%;
  cursor: pointer;
}
.m-btn.secondary { background: #1e293b; }
.m-btn.ghost {
  background: #fff;
  color: var(--m-accent);
  border: 1px solid var(--m-accent);
}
.m-btn.warn { background: var(--m-accent-2); color: #1a1200; }
.m-btn + .m-btn { margin-top: .55rem; }
.m-actions { display: grid; grid-template-columns: 1fr 1fr; gap: .55rem; margin-top: .75rem; }
.m-actions .m-btn { margin-top: 0; }

.m-field { margin-bottom: .85rem; }
.m-field label {
  display: block;
  margin-bottom: .35rem;
  font-size: .85rem;
  font-weight: 600;
  color: #334155;
}
.m-field input, .m-field select, .m-field textarea {
  width: 100%;
  min-height: 44px;
  padding: .7rem .75rem;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  font-size: 16px; /* 防 iOS 缩放 */
  background: #fff;
}
.m-field textarea { min-height: 88px; resize: vertical; }
.m-hint { font-size: .78rem; color: var(--m-muted); margin-top: .3rem; }

.m-timeline { margin: 0; padding: 0; list-style: none; }
.m-timeline li {
  position: relative;
  padding: 0 0 .85rem 1rem;
  border-left: 2px solid #d1e7e4;
  margin-left: .35rem;
}
.m-timeline li::before {
  content: "";
  position: absolute;
  left: -5px; top: .25rem;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--m-accent);
}
.m-timeline strong { display: block; font-size: .92rem; }
.m-timeline span { color: var(--m-muted); font-size: .78rem; }

.m-tab {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 20;
  display: flex;
  background: #fff;
  border-top: 1px solid var(--m-line);
  padding-bottom: env(safe-area-inset-bottom);
}
.m-tab a {
  flex: 1;
  text-align: center;
  text-decoration: none;
  color: var(--m-muted);
  font-size: .72rem;
  font-weight: 600;
  padding: .55rem .2rem .45rem;
}
.m-tab a.active { color: var(--m-accent); }
.m-tab span { display: block; }

.m-login {
  min-height: 100vh;
  background: linear-gradient(160deg, #0f1c28, #134e4a 55%, #0d9488);
  padding: 1.25rem 1rem 2rem;
}
.m-login-card {
  background: #fff;
  border-radius: 14px;
  padding: 1.25rem 1.1rem;
  max-width: 420px;
  margin: 1.5rem auto 1rem;
}
.m-login-card h1 { margin: 0; font-size: 1.35rem; }
.m-login-card .sub { color: var(--m-muted); margin: .35rem 0 1rem; font-size: .88rem; }
.m-role-list { max-width: 420px; margin: 0 auto; }
.m-role-list h2 {
  color: #dff7f3;
  font-size: .85rem;
  margin: .75rem 0 .45rem;
  font-weight: 700;
  letter-spacing: .06em;
}
.m-role-list a {
  display: block;
  text-decoration: none;
  color: #fff;
  background: rgba(255,255,255,.1);
  border: 1px solid rgba(255,255,255,.16);
  border-radius: 10px;
  padding: .8rem .85rem;
  margin-bottom: .5rem;
}
.m-role-list a strong { display: block; }
.m-role-list a span { color: #fbbf24; font-size: .8rem; font-family: ui-monospace, Consolas, monospace; }
.m-role-list a em { display: block; margin-top: .2rem; font-style: normal; color: #b7c9d4; font-size: .78rem; }

.m-empty {
  text-align: center;
  color: var(--m-muted);
  padding: 2rem 1rem;
  font-size: .92rem;
}
.m-amount { font-weight: 800; color: #b45309; font-size: 1.05rem; }
