:root {
  --bg: #f5f7fb;
  --card: #ffffff;
  --ink: #0f172a;
  --muted: #64748b;
  --line: #e2e8f0;
  --primary: #2563eb;
  --primary-soft: #eff4ff;
  --ok: #16a34a;
  --warn: #d97706;
  --danger: #dc2626;
  --radius: 14px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 14px/1.6 -apple-system, "Segoe UI", "Microsoft YaHei", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--primary); text-decoration: none; }

.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 12px;
  padding: 12px 18px;
  background: rgba(255,255,255,.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.topbar h1 { font-size: 16px; margin: 0; font-weight: 700; letter-spacing: .5px; }
.topbar .spacer { flex: 1; }
.topbar .who { color: var(--muted); font-size: 13px; }
.badge {
  display: inline-block; padding: 1px 8px; border-radius: 999px;
  background: var(--primary-soft); color: var(--primary); font-size: 12px; font-weight: 600;
}

.wrap { max-width: 1180px; margin: 0 auto; padding: 18px; }
.grid { display: grid; gap: 14px; }
.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 900px) { .cols-2, .cols-3, .cols-4 { grid-template-columns: 1fr; } }

.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px; box-shadow: 0 1px 2px rgba(15,23,42,.04);
}
.card h2 { margin: 0 0 12px; font-size: 14px; font-weight: 700; color: #334155; letter-spacing: .3px; }
.card h3 { margin: 0 0 8px; font-size: 13px; color: var(--muted); font-weight: 600; }

.stat { display: flex; flex-direction: column; gap: 4px; }
.stat .label { color: var(--muted); font-size: 12px; }
.stat .value { font-size: 24px; font-weight: 700; letter-spacing: .5px; }
.stat .value.small { font-size: 18px; }
.money { font-variant-numeric: tabular-nums; }

button, .btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 8px 14px; border-radius: 10px; border: 1px solid var(--line);
  background: #fff; color: var(--ink); font-size: 13px; font-weight: 600; cursor: pointer;
  transition: .15s;
}
button:hover, .btn:hover { border-color: #cbd5e1; background: #f8fafc; }
button.primary { background: var(--primary); border-color: var(--primary); color: #fff; }
button.primary:hover { background: #1d4ed8; }
button.danger { color: var(--danger); border-color: #fecaca; background: #fff5f5; }
button.ok { color: #fff; background: var(--ok); border-color: var(--ok); }
button:disabled { opacity: .5; cursor: not-allowed; }
button.sm { padding: 4px 10px; font-size: 12px; border-radius: 8px; }

input, select, textarea {
  width: 100%; padding: 9px 11px; border: 1px solid var(--line); border-radius: 10px;
  background: #fff; color: var(--ink); font: inherit; outline: none;
}
input:focus, select:focus, textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37,99,235,.12); }
label.field { display: block; margin-bottom: 10px; }
label.field > span { display: block; font-size: 12px; color: var(--muted); margin-bottom: 4px; }

.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.row > * { flex: 0 0 auto; }
.row .grow { flex: 1 1 180px; }

table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { padding: 9px 8px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-weight: 600; font-size: 12px; white-space: nowrap; background: #fbfdff; }
tr:hover td { background: #fafcff; }
td.nowrap, th.nowrap { white-space: nowrap; }

.tag { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: 12px; font-weight: 600; background: #f1f5f9; color: #475569; }
.tag.draft { background: #fef3c7; color: #92400e; }
.tag.pending_review { background: #e0f2fe; color: #075985; }
.tag.hall { background: #dcfce7; color: #166534; }
.tag.taken { background: #ede9fe; color: #5b21b6; }
.tag.submitted { background: #ffedd5; color: #9a3412; }
.tag.settled { background: #e2e8f0; color: #334155; }
.tag.rejected, .tag.cancelled { background: #fee2e2; color: #991b1b; }

.muted { color: var(--muted); }
.small { font-size: 12px; }
.mono { font-family: ui-monospace, Consolas, monospace; font-size: 12px; }
.hint { font-size: 12px; color: var(--muted); }
.err { color: var(--danger); font-size: 13px; }
.ok-text { color: var(--ok); }

.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.tabs button { border-radius: 999px; padding: 6px 14px; }
.tabs button.active { background: var(--primary); border-color: var(--primary); color: #fff; }

.toast {
  position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%) translateY(20px);
  background: #0f172a; color: #fff; padding: 10px 18px; border-radius: 10px;
  opacity: 0; pointer-events: none; transition: .25s; z-index: 100; max-width: 80vw;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

.overlay {
  position: fixed; inset: 0; background: rgba(15,23,42,.55);
  display: none; align-items: center; justify-content: center; z-index: 50; padding: 16px;
}
.overlay.show { display: flex; }
.overlay .card { width: min(520px, 100%); max-height: 88vh; overflow: auto; }

.thumb { width: 54px; height: 54px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); cursor: pointer; }
.thumb.big { width: 100%; height: auto; max-height: 60vh; object-fit: contain; }

.copy { cursor: pointer; color: var(--primary); font-weight: 600; }

/* ============================= 打手端（移动优先） ============================= */
body.has-tabbar .wrap { padding-bottom: 92px; }

.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
  display: flex; align-items: flex-end; gap: 2px;
  background: rgba(255,255,255,.97); backdrop-filter: blur(10px);
  border-top: 1px solid var(--line);
  padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
  max-width: 720px; margin: 0 auto;
}
.tabbar button {
  flex: 1; border: none; background: none; padding: 3px 0;
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  color: #94a3b8; font-size: 11px; font-weight: 600;
}
.tabbar button .ti { font-size: 17px; line-height: 1; }
.tabbar button.active { color: var(--primary); }
.tabbar button.main .ti {
  width: 42px; height: 42px; border-radius: 50%;
  background: linear-gradient(135deg, #2563eb, #38bdf8);
  color: #fff; display: flex; align-items: center; justify-content: center;
  box-shadow: 0 6px 16px rgba(37,99,235,.35); margin-top: -14px; font-size: 19px;
}
.tabbar button.main { color: var(--primary); }

.hall-head {
  border-radius: 16px; padding: 16px;
  background: linear-gradient(140deg, #132a52 0%, #1e4ed8 100%);
  color: #fff; box-shadow: 0 10px 26px rgba(19,42,82,.22);
}
.hall-top { display: flex; align-items: center; gap: 16px; }
.hall-divider { width: 1px; height: 38px; background: rgba(255,255,255,.22); }
.hall-label { font-size: 12px; color: #b9cdf6; }
.hall-value { font-size: 27px; font-weight: 800; letter-spacing: .5px; font-variant-numeric: tabular-nums; }
.hall-search { display: flex; gap: 8px; margin-top: 14px; }
.hall-select {
  width: 118px; border-radius: 10px; border: none; padding: 8px 10px;
  background: rgba(255,255,255,.14); color: #fff; font-weight: 600;
}
.hall-select option { color: #0f172a; }
.hall-search input {
  flex: 1; border: none; border-radius: 10px; padding: 8px 12px;
  background: rgba(255,255,255,.94); color: #0f172a;
}
.hall-btn {
  border: none; border-radius: 10px; padding: 8px 16px; font-weight: 700;
  background: #fff; color: #132a52;
}
.hall-foot {
  display: flex; justify-content: space-between; align-items: center;
  margin-top: 12px; font-size: 12px; color: #c7d8fb;
}
.hall-foot b { color: #fff; }
.refresh { cursor: pointer; font-size: 16px; opacity: .85; }

.deposit-bar {
  display: flex; justify-content: space-between; align-items: center;
  margin-top: 10px; padding: 10px 14px; border-radius: 12px;
  background: #fff; border: 1px solid var(--line); font-size: 13px; color: #475569;
}
.deposit-bar b { color: #0f172a; }

.order-card {
  display: flex; gap: 10px; padding: 14px; border-radius: 14px;
  background: #fff; border: 1px solid var(--line); box-shadow: 0 1px 2px rgba(15,23,42,.04);
}
.oc-body { flex: 1; min-width: 0; }
.oc-title { font-weight: 700; font-size: 14px; margin-bottom: 4px; }
.oc-meta { font-size: 12px; color: #64748b; line-height: 1.7; }
.oc-right { display: flex; flex-direction: column; align-items: flex-end; justify-content: space-between; gap: 8px; }
.oc-price { font-size: 20px; font-weight: 800; color: #0f172a; font-variant-numeric: tabular-nums; }

.credit-card {
  border-radius: 16px; padding: 16px; color: #fff;
  background: linear-gradient(135deg, #1d4ed8, #60a5fa);
  box-shadow: 0 10px 24px rgba(29,78,216,.25);
}
.credit-head { display: flex; justify-content: space-between; font-size: 13px; color: #dbeafe; }
.credit-head b { color: #fff; font-size: 15px; }
.credit-bar { height: 8px; border-radius: 99px; background: rgba(255,255,255,.28); margin: 10px 0 6px; overflow: hidden; }
.credit-bar i { display: block; height: 100%; border-radius: 99px; background: #fff; transition: width .4s; }
.credit-steps { display: flex; justify-content: space-between; font-size: 11px; color: #cfe0ff; }

.menu-card { background: #fff; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.menu-item {
  width: 100%; border: none; border-bottom: 1px solid var(--line); background: #fff;
  display: flex; align-items: center; gap: 12px; padding: 14px 16px; font-size: 14px;
  color: #0f172a; font-weight: 600; text-align: left; border-radius: 0;
}
.menu-item:last-child { border-bottom: none; }
.menu-item:hover { background: #f8fafc; }
.menu-item .mi-icon { font-size: 17px; width: 22px; text-align: center; }
.menu-item .arrow { margin-left: auto; color: #cbd5e1; font-size: 18px; }
.menu-item.danger, .mi-icon.danger { color: var(--danger); }

/* 打手端：桌面下收成手机宽度，移动端铺满 */
body[data-role="worker"] .wrap { max-width: 720px; }
.tabbar { max-width: none; }
.tabbar-inner { max-width: 720px; margin: 0 auto; display: flex; width: 100%; }

/* ---------- 平台端看板 ---------- */
.trend { display: flex; align-items: flex-end; gap: 10px; height: 150px; padding: 10px 4px 0; }
.trend-col { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; gap: 4px; }
.trend-bar {
  width: 70%; max-width: 42px; border-radius: 8px 8px 3px 3px;
  background: linear-gradient(180deg, #60a5fa, #2563eb);
  transition: height .4s;
}
.trend-num { font-size: 11px; color: #475569; font-weight: 700; font-variant-numeric: tabular-nums; }
.trend-date { font-size: 11px; color: #94a3b8; }

/* ---------------- 通知铃铛 ---------------- */
.bell { position: relative; }
.bell-btn {
  position: relative; border: 1px solid var(--line); background: #fff;
  border-radius: 10px; padding: 6px 10px; font-size: 15px; line-height: 1;
}
.bell-btn:hover { background: #f8fafc; }
.bell-dot {
  position: absolute; top: -6px; right: -6px; min-width: 17px; height: 17px; padding: 0 4px;
  border-radius: 99px; background: #ef4444; color: #fff; font-size: 10px; font-style: normal;
  display: flex; align-items: center; justify-content: center; font-weight: 700;
}
.bell-panel {
  position: absolute; right: 0; top: 40px; width: 320px; max-height: 420px; overflow: auto;
  background: #fff; border: 1px solid var(--line); border-radius: 12px; z-index: 60;
  box-shadow: 0 16px 40px rgba(15,23,42,.16);
}
.bell-head {
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 12px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: #fff;
}
.bell-read { border: none; background: none; color: var(--primary); font-size: 12px; cursor: pointer; padding: 0; }
.bell-item { padding: 10px 12px; border-bottom: 1px solid #f1f5f9; }
.bell-item.unread { background: #f5f9ff; }
.bell-title { font-size: 13px; font-weight: 700; }
.bell-body { font-size: 12px; color: #64748b; margin-top: 2px; }
.bell-time { font-size: 11px; color: #94a3b8; margin-top: 4px; }
.bell-empty { padding: 22px; text-align: center; color: #94a3b8; font-size: 12px; }
