:root {
  --bg: #f5f6f8;
  --card: #ffffff;
  --line: #e6e8eb;
  --text: #1c1f23;
  --sub: #6b7280;
  --brand: #b3352b;
  --brand-soft: #fdecea;
  --ok: #197a4b;
  --ok-soft: #e6f5ec;
  --warn: #a15c00;
  --warn-soft: #fff5e5;
  --danger: #b3261e;
  --danger-soft: #fdecea;
  --radius: 12px;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.5;
  padding-bottom: 68px;
}
.hidden { display: none !important; }

/* 顶部 */
.topbar {
  position: sticky; top: 0; z-index: 20;
  background: var(--brand); color: #fff;
  padding: 12px 14px;
  display: flex; align-items: center; gap: 10px;
}
.topbar .title { font-weight: 600; font-size: 16px; flex: 1; }
.topbar .who { font-size: 12px; opacity: .9; }
.topbar button {
  background: rgba(255,255,255,.16); color: #fff; border: 0; border-radius: 8px;
  padding: 6px 10px; font-size: 12px;
}
.bell { position: relative; }
.bell .dot {
  position: absolute; top: -3px; right: -3px; background: #ffd54f; color: #4a2c00;
  font-size: 10px; border-radius: 9px; padding: 0 4px; font-weight: 700;
}
.env-banner {
  background: #fff5e5; color: #8a5300; font-size: 12px;
  padding: 8px 14px; border-bottom: 1px solid #f0dcb8; line-height: 1.4;
}
.env-banner b { color: #a15c00; }

/* 容器 */
.wrap { padding: 12px; max-width: 640px; margin: 0 auto; }
.section-title { font-size: 13px; color: var(--sub); margin: 16px 4px 8px; font-weight: 600; }
.section-title:first-child { margin-top: 4px; }

/* 卡片 */
.card {
  background: var(--card); border-radius: var(--radius); padding: 14px;
  margin-bottom: 10px; border: 1px solid var(--line);
}
.card.tap:active { background: #fafafa; }
.card h3 { margin: 0 0 4px; font-size: 15px; font-weight: 600; }
.card .sub { color: var(--sub); font-size: 13px; }
.row { display: flex; align-items: center; gap: 8px; }
.row.between { justify-content: space-between; }
.grow { flex: 1; min-width: 0; }
.mt8 { margin-top: 8px; }
.mt12 { margin-top: 12px; }

/* 徽标 */
.tag {
  display: inline-block; font-size: 11px; padding: 1px 7px; border-radius: 20px;
  background: #eef1f4; color: var(--sub); white-space: nowrap;
}
.tag.brand { background: var(--brand-soft); color: var(--brand); }
.tag.ok { background: var(--ok-soft); color: var(--ok); }
.tag.warn { background: var(--warn-soft); color: var(--warn); }
.tag.danger { background: var(--danger-soft); color: var(--danger); }
.tag.overdue { background: var(--danger-soft); color: var(--danger); font-weight: 600; }

/* 按钮 */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  border: 0; border-radius: 10px; padding: 11px 14px; font-size: 14px; font-weight: 600;
  background: var(--brand); color: #fff; width: 100%;
}
.btn:active { opacity: .85; }
.btn.sm { width: auto; padding: 6px 12px; font-size: 13px; border-radius: 8px; }
.btn.ghost { background: #fff; color: var(--brand); border: 1px solid var(--brand); }
.btn.gray { background: #eef1f4; color: #333; }
.btn:disabled { opacity: .5; }
.btn-row { display: flex; gap: 8px; }

/* 表单 */
label.field { display: block; margin-bottom: 10px; }
label.field span { display: block; font-size: 12px; color: var(--sub); margin-bottom: 4px; }
input, select, textarea {
  width: 100%; padding: 10px 11px; font-size: 15px; border: 1px solid var(--line);
  border-radius: 10px; background: #fff; color: var(--text); font-family: inherit;
}
input:focus, select:focus, textarea:focus { outline: 2px solid #f3c9c4; border-color: var(--brand); }
textarea { min-height: 64px; resize: vertical; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }

/* 待办卡 */
.todo { border-left: 3px solid var(--brand); }
.todo.p1 { border-left-color: var(--danger); }
.todo .due { font-size: 12px; }
.todo .due.late { color: var(--danger); font-weight: 600; }

/* 底部导航 */
.tabbar {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 30;
  background: #fff; border-top: 1px solid var(--line);
  display: flex; padding: 6px 0 calc(6px + env(safe-area-inset-bottom));
}
.tabbar a {
  flex: 1; text-align: center; font-size: 11px; color: var(--sub); text-decoration: none;
  padding: 4px 0; position: relative;
}
.tabbar a.on { color: var(--brand); font-weight: 600; }
.tabbar a .n {
  position: absolute; top: -2px; right: 50%; margin-right: -22px;
  background: var(--brand); color: #fff; font-size: 9px; border-radius: 8px; padding: 0 4px;
}
.tabbar .ico { display: block; font-size: 17px; line-height: 1.2; }

/* 表格 */
table.kv { width: 100%; border-collapse: collapse; font-size: 13px; }
table.kv td { padding: 6px 0; vertical-align: top; border-bottom: 1px solid #f0f2f4; }
table.kv td:first-child { color: var(--sub); width: 88px; }
.lines { width: 100%; border-collapse: collapse; font-size: 13px; margin-top: 8px; }
.lines th { background: #f7f8fa; color: var(--sub); font-weight: 600; font-size: 12px; padding: 7px 6px; text-align: left; }
.lines td { padding: 8px 6px; border-bottom: 1px solid #f0f2f4; vertical-align: top; }
.lines th:last-child, .lines td:last-child { text-align: right; }
/* 状态列允许换行：手机上「已出库待签收」这类标签不能把表格撑出屏幕 */
.lines td:last-child .tag { white-space: normal; }
.lines th, .lines td { word-break: break-word; }
.lines td:first-child { min-width: 96px; }

/* 状态条 */
.stepper { display: flex; gap: 4px; margin: 10px 0; }
.stepper i {
  flex: 1; height: 4px; border-radius: 2px; background: #e9ecef;
}
.stepper i.done { background: var(--ok); }
.stepper i.now { background: var(--brand); }

/* 弹层 */
.sheet-mask {
  position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 50;
  display: flex; align-items: flex-end;
}
.sheet {
  background: #fff; width: 100%; max-height: 88vh; overflow: auto;
  border-radius: 16px 16px 0 0; padding: 16px; max-width: 640px; margin: 0 auto;
}
.sheet h2 { margin: 0 0 4px; font-size: 17px; }
.sheet .hint { color: var(--sub); font-size: 12px; margin-bottom: 12px; }

/* 杂项 */
.empty { text-align: center; color: var(--sub); padding: 40px 16px; font-size: 14px; }
.toast {
  position: fixed; left: 50%; bottom: 84px; transform: translateX(-50%);
  background: #23272e; color: #fff; font-size: 13px; padding: 10px 16px; border-radius: 10px;
  z-index: 90; max-width: 86vw; text-align: center;
}
.toast.err { background: #7a1c16; }
.price { font-size: 18px; font-weight: 700; color: var(--brand); }
.price.stale { color: #9aa0a6; text-decoration: line-through; font-size: 15px; }
.muted { color: var(--sub); font-size: 12px; }
.thumb {
  width: 54px; height: 54px; border-radius: 8px; background: #eef1f4; flex: none;
  display: flex; align-items: center; justify-content: center; font-size: 11px; color: #9aa0a6;
  overflow: hidden;
}
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.login-wrap { max-width: 480px; margin: 0 auto; padding: 24px 16px 40px; }
.login-head { text-align: center; margin-bottom: 20px; }
.login-head h1 { font-size: 22px; margin: 0 0 6px; }
.login-head p { color: var(--sub); font-size: 13px; margin: 0; }
.acct {
  display: flex; align-items: center; gap: 10px; padding: 12px 14px; background: #fff;
  border: 1px solid var(--line); border-radius: 12px; margin-bottom: 8px; width: 100%; text-align: left;
}
.acct .nm { font-weight: 600; }
.acct .rl { font-size: 12px; color: var(--sub); }

/* 固定账号与分单 */
.form-error {color:var(--danger);min-height:1.5em;}
.login-mark {margin:0 auto 16px;width:64px;height:64px;display:grid;place-items:center;border-radius:18px;background:var(--brand);color:#fff;font-size:32px;}
.account-login {max-width:480px;}
.team-checks {display:flex;flex-wrap:wrap;gap:12px;padding:10px;}
.team-checks input {width:auto;}
fieldset {border:1px solid var(--line);border-radius:10px;margin:12px 0;}
.assignment details small {overflow-wrap:anywhere;}
.btn:disabled {opacity:.5;cursor:not-allowed;}
.row input {min-width:0;}
@media(max-width:520px){.topbar {gap:6px;}.who{font-size:12px;}.assignment h2{font-size:20px;}}
