/* ===== 门店工作台 · 移动端样式 ===== */
:root {
  --bg: #f4f6f8;
  --card: #ffffff;
  --ink: #1f2937;
  --sub: #6b7280;
  --line: #e5e7eb;
  --brand: #2563eb;
  --brand-d: #1d4ed8;
  --ok: #16a34a;
  --warn: #dc2626;
  --mid: #d97706;
  --shadow: 0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.04);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--bg); color: var(--ink);
  max-width: 560px; margin: 0 auto; min-height: 100vh;
  padding-bottom: 64px; /* 给底部导航留位 */
}
#app { min-height: 100vh; display: flex; flex-direction: column; }

/* 顶部栏 */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px; background: var(--brand); color: #fff;
  box-shadow: var(--shadow);
}
.topbar .store { font-size: 18px; font-weight: 700; letter-spacing: .5px; }
.role-btn {
  border: 1px solid rgba(255,255,255,.6); background: rgba(255,255,255,.15);
  color: #fff; border-radius: 999px; padding: 5px 12px; font-size: 13px;
}
.main { flex: 1; padding: 16px; }

/* 提示横幅 */
.banner { font-size: 13px; padding: 10px 12px; border-radius: 10px; margin-bottom: 14px; background: #fff7ed; color: #9a3412; }
.banner.ok { background: #ecfdf5; color: #065f46; }

/* 仪表盘卡片 */
.cards { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.card {
  background: var(--card); border-radius: 14px; padding: 16px; text-decoration: none; color: inherit;
  box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 4px;
}
.card.alert { border: 1.5px solid #fca5a5; }
.card-ico { font-size: 22px; }
.card-n { font-size: 26px; font-weight: 800; }
.card-t { font-size: 13px; color: var(--sub); }

.sec { font-size: 15px; color: var(--sub); margin: 22px 4px 10px; }
.mods { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.mod {
  background: var(--card); border-radius: 14px; padding: 18px; text-decoration: none; color: inherit;
  box-shadow: var(--shadow); display: flex; align-items: center; gap: 10px; font-weight: 600; font-size: 15px;
}
.mod-ico { font-size: 22px; }

/* 页面标题 */
.pagetitle { font-size: 20px; margin: 0 0 14px; }

/* 列表 */
.list { display: flex; flex-direction: column; gap: 10px; }
.item {
  background: var(--card); border-radius: 12px; padding: 12px 14px; box-shadow: var(--shadow);
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
}
.item.warn { border-left: 4px solid var(--warn); }
.item-main { min-width: 0; }
.item-text { font-weight: 600; font-size: 15px; }
.item-sub { font-size: 13px; color: var(--sub); margin-top: 3px; }
.item-acts { display: flex; gap: 6px; flex-shrink: 0; }
.empty { text-align: center; color: var(--sub); padding: 40px 0; }

/* 小按钮 */
.mini {
  border: 1px solid var(--line); background: #fff; color: var(--ink);
  border-radius: 8px; padding: 6px 10px; font-size: 13px;
}
.mini.danger { color: var(--warn); border-color: #fecaca; }
.mini:active { background: #f3f4f6; }

/* 状态徽标 */
.badge { font-size: 11px; padding: 2px 7px; border-radius: 999px; margin-left: 6px; vertical-align: middle; }
.b-ok { background: #dcfce7; color: var(--ok); }
.b-mid { background: #fef3c7; color: var(--mid); }
.b-todo { background: #e0e7ff; color: var(--brand); }

/* 底部导航 */
.tabbar {
  position: fixed; bottom: 0; left: 50%; transform: translateX(-50%);
  width: 100%; max-width: 560px; z-index: 20;
  display: flex; background: #fff; border-top: 1px solid var(--line);
  box-shadow: 0 -1px 6px rgba(0,0,0,.05);
}
.nav-item {
  flex: 1; text-align: center; padding: 8px 0 6px; text-decoration: none; color: var(--sub);
  font-size: 11px; display: flex; flex-direction: column; align-items: center; gap: 2px;
}
.nav-ico { font-size: 20px; }
.nav-item.active { color: var(--brand); font-weight: 700; }

/* 悬浮加号按钮 */
.fab {
  position: fixed; right: max(16px, calc(50% - 280px + 16px)); bottom: 74px; z-index: 25;
  width: 56px; height: 56px; border-radius: 50%; border: none; background: var(--brand); color: #fff;
  font-size: 30px; line-height: 1; box-shadow: 0 4px 12px rgba(37,99,235,.4);
}
.fab:active { background: var(--brand-d); }

/* 弹层(新增/编辑) */
.sheet-mask {
  position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 50;
  display: flex; align-items: flex-end; justify-content: center;
}
.sheet {
  background: #fff; width: 100%; max-width: 560px; border-radius: 16px 16px 0 0;
  padding: 18px 18px 24px; max-height: 85vh; overflow-y: auto;
  animation: up .2s ease;
}
@keyframes up { from { transform: translateY(100%); } to { transform: translateY(0); } }
.sheet-head { font-size: 17px; font-weight: 700; margin-bottom: 14px; }
.sheet-form { display: flex; flex-direction: column; gap: 12px; }
.sheet-form label { display: flex; flex-direction: column; font-size: 13px; color: var(--sub); gap: 6px; }
.sheet-form input, .sheet-form select {
  border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; font-size: 15px; color: var(--ink); background: #fff;
}
.sheet-acts { display: flex; gap: 10px; margin-top: 6px; }
.btn {
  flex: 1; border: none; background: var(--brand); color: #fff; border-radius: 10px; padding: 12px; font-size: 15px; font-weight: 600;
}
.btn.ghost { background: #fff; color: var(--ink); border: 1px solid var(--line); }
.btn.block { width: 100%; margin-top: 12px; }
.btn:active { opacity: .9; }

/* 设置页 */
.card-row { background: #fff; border-radius: 12px; padding: 14px; box-shadow: var(--shadow); margin-bottom: 12px; }
.kv { display: flex; justify-content: space-between; font-size: 14px; }
.kv b { color: var(--brand); }
.hint { font-size: 13px; color: var(--sub); line-height: 1.6; background: #fff; border-radius: 12px; padding: 14px; }

/* Toast */
.toast {
  position: fixed; left: 50%; bottom: 90px; transform: translate(-50%, 20px); z-index: 99;
  background: rgba(17,24,39,.9); color: #fff; padding: 10px 18px; border-radius: 999px; font-size: 14px;
  opacity: 0; transition: all .25s; pointer-events: none;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* 暗色模式(夜间班次友好) */
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f172a; --card: #1e293b; --ink: #e2e8f0; --sub: #94a3b8; --line: #334155;
  }
  .banner { background: #3b2f1a; color: #fcd34d; }
  .banner.ok { background: #14342b; color: #6ee7b7; }
  .item.warn { border-left-color: #f87171; }
  .mini { background: #0f172a; }
  .role-btn { border-color: rgba(255,255,255,.4); }
  .hint { background: #1e293b; }
  .sheet, .tabbar { background: #1e293b; }
  .sheet-form input, .sheet-form select { background: #0f172a; border-color: #334155; }
  .nav-item { color: #94a3b8; }
}
