/* order-api 前端样式：管理端（桌面）+ 单兵端（移动 H5）共用 */
:root {
  --brand: #2563eb; --brand-dark: #1e40af; --ok: #16a34a; --warn: #d97706;
  --danger: #dc2626; --bg: #f5f7fa; --card: #fff; --text: #1f2937;
  --muted: #6b7280; --border: #e5e7eb; --radius: 10px;
}
* { box-sizing: border-box; }
body { margin: 0; font-family: -apple-system, "Segoe UI", "Microsoft YaHei", sans-serif;
  background: var(--bg); color: var(--text); font-size: 15px; line-height: 1.5; }
a { color: var(--brand); text-decoration: none; }
h1, h2, h3 { margin: 0 0 .5rem; }
.topbar { background: var(--brand); color: #fff; padding: .75rem 1rem;
  display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
.topbar a { color: #fff; opacity: .9; }
.topbar .brand { font-weight: 700; font-size: 1.05rem; }
.topbar .spacer { flex: 1; }
.container { max-width: 1100px; margin: 1rem auto; padding: 0 1rem; }
.card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 1rem; margin-bottom: 1rem; box-shadow: 0 1px 2px rgba(0,0,0,.04); }
.grid { display: grid; gap: .75rem; }
.grid.cols-2 { grid-template-columns: repeat(2, 1fr); }
.grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
.grid.cols-4 { grid-template-columns: repeat(4, 1fr); }
label { display: block; font-size: .85rem; color: var(--muted); margin-bottom: .25rem; }
input, select, textarea, button { font: inherit; }
input, select, textarea { width: 100%; padding: .5rem .6rem; border: 1px solid var(--border);
  border-radius: 8px; background: #fff; }
textarea { min-height: 64px; resize: vertical; }
.btn { display: inline-block; padding: .5rem .9rem; border: none; border-radius: 8px;
  background: var(--brand); color: #fff; cursor: pointer; font-weight: 600; }
.btn:hover { background: var(--brand-dark); }
.btn.secondary { background: #e5e7eb; color: var(--text); }
.btn.ok { background: var(--ok); } .btn.warn { background: var(--warn); }
.btn.danger { background: var(--danger); }
.btn[disabled] { opacity: .45; cursor: not-allowed; }
.btn.block { display: block; width: 100%; text-align: center; margin-top: .5rem; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: .5rem .6rem; border-bottom: 1px solid var(--border); font-size: .9rem; }
th { color: var(--muted); font-weight: 600; background: #fafafa; }
.badge { display: inline-block; padding: .1rem .5rem; border-radius: 999px; font-size: .75rem;
  font-weight: 600; background: #eef2ff; color: var(--brand-dark); }
.badge.CREATED { background:#e0e7ff; color:#3730a3; }
.badge.ASSIGNED { background:#dbeafe; color:#1e40af; }
.badge.ACCEPTED { background:#cffafe; color:#155e75; }
.badge.ARRIVED { background:#d1fae5; color:#065f46; }
.badge.WORKING { background:#fef3c7; color:#92400e; }
.badge.COMPLETED { background:#dcfce7; color:#166534; }
.badge.SIGNED { background:#bbf7d0; color:#14532d; }
.badge.CLOSED { background:#e5e7eb; color:#374151; }
.badge.EXCEPTION { background:#fee2e2; color:#991b1b; }
.muted { color: var(--muted); font-size: .85rem; }
.stat { text-align: center; } .stat .num { font-size: 1.8rem; font-weight: 700; }
.row { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; }
.timeline { list-style: none; padding: 0; margin: 0; }
.timeline li { padding: .5rem 0 .5rem 1rem; border-left: 2px solid var(--border); position: relative; }
.timeline li::before { content: ""; position: absolute; left: -6px; top: .8rem; width: 10px;
  height: 10px; border-radius: 50%; background: var(--brand); }
.alert { padding: .6rem .8rem; border-radius: 8px; margin-bottom: .75rem; }
.alert.error { background: #fee2e2; color: #991b1b; }
.alert.ok { background: #dcfce7; color: #166534; }
.hidden { display: none; }
/* 全屏遮罩（改密弹窗等）：.mask.hidden 特异性高于 .mask，确保可隐藏 */
.mask { position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 50;
  display: flex; align-items: center; justify-content: center; }
.mask.hidden { display: none; }
.thumb { max-width: 120px; max-height: 120px; border-radius: 6px; border: 1px solid var(--border); }

/* 单兵端 H5：移动优先，大按钮 */
.worker-wrap { max-width: 560px; margin: 0 auto; padding: 0 .75rem 2rem; }
.worker-head { background: var(--brand); color: #fff; padding: .75rem 1rem; position: sticky;
  top: 0; z-index: 5; display: flex; align-items: center; gap: .5rem; }
.task-card { background: #fff; border: 1px solid var(--border); border-radius: var(--radius);
  padding: .85rem; margin: .75rem 0; }
.action-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: .6rem; margin-top: .75rem; }
.action-grid .btn { padding: .85rem .5rem; font-size: 1rem; }
.chat-box { border: 1px solid var(--border); border-radius: 8px; padding: .5rem; height: 220px;
  overflow-y: auto; background: #fafafa; margin-bottom: .5rem; }
.chat-msg { margin: .3rem 0; padding: .4rem .6rem; border-radius: 8px; max-width: 85%; white-space: pre-wrap; }
.chat-msg.me { background: var(--brand); color: #fff; margin-left: auto; }
.chat-msg.eva { background: #fff; border: 1px solid var(--border); }
@media (max-width: 720px) {
  .grid.cols-3, .grid.cols-4 { grid-template-columns: repeat(2, 1fr); }
}
