/* 算数 · 小家电维修 — 移动作业端 */
:root {
  --bg: #eef5f3;
  --surface: #ffffff;
  --ink: #102826;
  --muted: #5a736e;
  --line: #d0e2de;
  --accent: #0abab5;
  --accent-deep: #067a76;
  --aside: #0d3d38;
  --ok: #0d8a5f;
  --warn: #c45c2a;
  --danger: #b42318;
  --signal: #b8e04a;
  --shadow: 0 8px 24px rgba(16, 40, 38, 0.08);
  --nav-h: 64px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --radius: 14px;
  --sans: "PingFang SC", "Microsoft YaHei", "Noto Sans SC", sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: var(--sans);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.5;
  -webkit-tap-highlight-color: transparent;
}
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
.hidden { display: none !important; }
a { color: inherit; text-decoration: none; }

/* —— Login —— */
.m-login {
  min-height: 100dvh;
  padding: 28px 18px calc(28px + var(--safe-b));
  background:
    radial-gradient(ellipse 80% 50% at 10% -10%, rgba(10, 186, 181, 0.28), transparent 55%),
    linear-gradient(165deg, #0a2421 0%, #0d3d38 55%, #102826 100%);
  color: #e8f4f2;
}
.m-login__brand { margin: 8px 0 22px; }
.m-login__brand .eyebrow {
  margin: 0 0 6px;
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  color: #7affe8;
  font-weight: 700;
}
.m-login__brand h1 {
  margin: 0;
  font-size: 1.85rem;
  letter-spacing: 0.04em;
}
.m-login__brand p {
  margin: 8px 0 0;
  color: rgba(232, 244, 242, 0.72);
  font-size: 0.92rem;
}
.role-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 16px;
}
.role-card {
  text-align: left;
  padding: 12px 12px 14px;
  border-radius: 12px;
  border: 1px solid rgba(127, 196, 184, 0.28);
  background: rgba(8, 36, 33, 0.55);
  color: #e8f4f2;
  min-height: 86px;
}
.role-card.is-selected {
  border-color: var(--signal);
  box-shadow: 0 0 0 1px var(--signal);
}
.role-card-tag {
  display: block;
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  color: #7affe8;
  margin-bottom: 4px;
}
.role-card-title { display: block; font-size: 1rem; margin-bottom: 2px; }
.role-card-user { display: block; font-size: 0.78rem; opacity: 0.65; }
.m-login form label {
  display: block;
  margin-bottom: 10px;
  font-size: 0.82rem;
  color: rgba(232, 244, 242, 0.75);
}
.m-login input {
  display: block;
  width: 100%;
  margin-top: 4px;
  padding: 12px 12px;
  border-radius: 10px;
  border: 1px solid rgba(127, 196, 184, 0.35);
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
}
.m-login .btn-go {
  width: 100%;
  margin-top: 8px;
  padding: 14px;
  border: none;
  border-radius: 999px;
  background: var(--signal);
  color: #102826;
  font-weight: 700;
  font-size: 1rem;
}
.m-login__links {
  margin-top: 18px;
  text-align: center;
  font-size: 0.85rem;
  color: rgba(232, 244, 242, 0.55);
}
.m-login__links a { color: #7affe8; margin: 0 6px; }
.msg-err {
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(180, 35, 24, 0.2);
  color: #ffb4ae;
  font-size: 0.88rem;
}

/* —— App shell —— */
.m-app {
  max-width: 560px;
  margin: 0 auto;
  min-height: 100dvh;
  padding-bottom: calc(var(--nav-h) + var(--safe-b) + 12px);
}
.m-top {
  position: sticky;
  top: 0;
  z-index: 30;
  padding: 12px 14px 10px;
  background: rgba(238, 245, 243, 0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.m-top__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.m-top__title { font-weight: 800; font-size: 1.05rem; }
.m-top__who { font-size: 0.78rem; color: var(--muted); margin-top: 2px; }
.m-scanbar {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}
.m-scanbar input {
  flex: 1;
  min-width: 0;
  padding: 11px 12px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #fff;
}
.m-scanbar .btn {
  flex-shrink: 0;
  padding: 0 14px;
  border-radius: 12px;
  border: none;
  background: var(--aside);
  color: #fff;
  font-weight: 650;
}
.m-scanbar .btn-cam {
  background: var(--accent);
  width: 46px;
  padding: 0;
  font-size: 1.2rem;
}

.m-body { padding: 12px 14px; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 42px;
  padding: 0 14px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  font-weight: 600;
}
.btn.primary { background: var(--accent); border-color: transparent; color: #fff; }
.btn.dark { background: var(--aside); border-color: transparent; color: #fff; }
.btn.danger { background: var(--danger); border-color: transparent; color: #fff; }
.btn.ghost { background: transparent; }
.btn.block { width: 100%; }
.btn:disabled { opacity: 0.5; }

.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  background: #e2efec;
  color: var(--ink);
}
.badge.warn { background: #fde8d8; color: var(--warn); }
.badge.ok { background: #d8f3e8; color: var(--ok); }
.badge.danger { background: #fad9d6; color: var(--danger); }

/* Home tiles */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}
.stat {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 14px;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  text-align: left;
}
.stat__n {
  font-size: 1.65rem;
  font-weight: 800;
  line-height: 1.1;
  color: var(--aside);
}
.stat__l { font-size: 0.8rem; color: var(--muted); margin-top: 4px; }
.stat.is-hot .stat__n { color: var(--warn); }

.shortcut-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-top: 14px;
}
.shortcut {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  padding: 16px 14px;
  border-radius: var(--radius);
  border: none;
  background: var(--aside);
  color: #e8f4f2;
  font-weight: 700;
  text-align: left;
  min-height: 88px;
}
.shortcut span { font-size: 0.78rem; font-weight: 500; opacity: 0.75; }
.shortcut.alt { background: #fff; color: var(--ink); border: 1px solid var(--line); }

/* Order cards */
.order-list { display: flex; flex-direction: column; gap: 10px; }
.order-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px 14px;
  box-shadow: var(--shadow);
}
.order-card.overdue { border-color: #f0a090; background: #fff8f6; }
.order-card__top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
}
.order-card__no { font-weight: 800; font-size: 0.95rem; }
.order-card__meta {
  margin-top: 6px;
  font-size: 0.84rem;
  color: var(--muted);
}
.order-card__shelf {
  margin-top: 6px;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--accent-deep);
}
.empty {
  text-align: center;
  padding: 36px 12px;
  color: var(--muted);
  font-size: 0.92rem;
}

/* Detail sheet */
.sheet {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: rgba(8, 24, 22, 0.45);
  display: flex;
  align-items: flex-end;
  justify-content: center;
}
.sheet__panel {
  width: 100%;
  max-width: 560px;
  max-height: 92dvh;
  overflow: auto;
  background: #fff;
  border-radius: 18px 18px 0 0;
  padding: 14px 16px calc(18px + var(--safe-b));
  animation: sheetUp 0.28s ease;
}
@keyframes sheetUp {
  from { transform: translateY(24%); opacity: 0.6; }
  to { transform: none; opacity: 1; }
}
.sheet__head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 10px;
}
.kv {
  display: grid;
  grid-template-columns: 4.5rem 1fr;
  gap: 6px 8px;
  font-size: 0.88rem;
  margin: 10px 0 14px;
  padding: 12px;
  background: var(--bg);
  border-radius: 12px;
}
.kv b { color: var(--muted); font-weight: 600; }
.form-block {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 8px;
}
.form-block label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--muted);
}
.form-block input,
.form-block select,
.form-block textarea {
  display: block;
  width: 100%;
  margin-top: 4px;
  padding: 11px 12px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #fff;
}
.form-block textarea { min-height: 72px; resize: vertical; }
.form-row {
  display: flex;
  gap: 10px;
}
.form-row > * { flex: 1; min-width: 0; }
.action-stack {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 12px;
}
.photos {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.photos img {
  width: 72px;
  height: 72px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--line);
}

/* Outbound / scan page */
.scan-hero {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 16px;
  text-align: center;
  box-shadow: var(--shadow);
}
.scan-hero h2 { margin: 0 0 6px; font-size: 1.15rem; }
.scan-hero p { margin: 0 0 14px; color: var(--muted); font-size: 0.88rem; }
.scan-hero input {
  width: 100%;
  padding: 14px;
  font-size: 1.05rem;
  text-align: center;
  letter-spacing: 0.04em;
  border-radius: 12px;
  border: 2px solid var(--accent);
  margin-bottom: 10px;
}

/* Bottom nav */
.m-nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 40;
  display: flex;
  gap: 0;
  padding: 6px 6px calc(6px + var(--safe-b));
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(12px);
  border-top: 1px solid var(--line);
  max-width: 560px;
  margin: 0 auto;
}
.m-nav button {
  flex: 1;
  border: none;
  background: transparent;
  padding: 8px 4px;
  font-size: 0.72rem;
  color: var(--muted);
  font-weight: 600;
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}
.m-nav button .ico { font-size: 1.15rem; line-height: 1; }
.m-nav button.active {
  color: var(--aside);
  background: rgba(10, 186, 181, 0.12);
}

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(var(--nav-h) + 20px + var(--safe-b));
  transform: translateX(-50%);
  z-index: 80;
  max-width: 90%;
  padding: 10px 16px;
  border-radius: 999px;
  background: var(--aside);
  color: #fff;
  font-size: 0.88rem;
  box-shadow: var(--shadow);
  animation: toastIn 0.25s ease;
}
@keyframes toastIn {
  from { opacity: 0; transform: translate(-50%, 8px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}

.section-title {
  margin: 18px 0 10px;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--muted);
  letter-spacing: 0.06em;
}
