:root {
  /* 页面/卡片底色：浅灰底 + 白卡，留白承担分区职责 */
  --bg: #f5f7fa;
  --panel: #ffffff;
  --panel-2: #f7f9fc;
  /* 文字层级：主 / 次 / 弱 / 占位 */
  --ink: #141b24;
  --ink-2: #56606f;
  --muted: #8b95a5;
  /* 分割线：强分割 / 弱分割 */
  --line: #e8ecf2;
  --line-2: #f2f5f9;
  /* 品牌主色：明亮克制蓝，仅用于主操作与关键强调 */
  --brand: #1677ff;
  --brand-2: #4096ff;
  --brand-3: #0958d9;
  --brand-soft: #e8f2ff;
  /* 状态色：只承载语义 */
  --ok: #18a058;
  --ok-soft: #e9f7f0;
  --warn: #c98a04;
  --warn-soft: #fff8e6;
  --danger: #d93a3a;
  --danger-soft: #fdecec;
  /* 圆角：卡片 12 / 控件 8 / 标签 6，禁止更大圆角 */
  --r-sm: 6px;
  --r: 12px;
  --r-lg: 12px;
  --r-ctl: 8px;
  /* 阴影：轻量化，以描边+留白分区为主 */
  --shadow-1: 0 1px 2px rgba(16, 24, 40, .04);
  --shadow-2: 0 1px 2px rgba(16, 24, 40, .04), 0 2px 8px rgba(16, 24, 40, .05);
  --shadow: var(--shadow-1);

  /* 兼容别名：历史代码里引用过但未定义的变量，统一指向上面令牌，避免样式回退 */
  --text: var(--ink);
  --text-2: var(--ink-2);
  --border: var(--line);
  --border-soft: var(--line-2);
  --card: var(--panel);
  --surface: var(--panel);
  --input-bg: #fff;
  --nav-h: 58px;
}

* { box-sizing: border-box; }
html {
  /* 微信/QQ 浏览器会把系统字体设置放大，这里锁死，避免布局被撑破 */
  -webkit-text-size-adjust: 100% !important;
  text-size-adjust: 100% !important;
}
html, body { margin: 0; height: 100%; max-width: 100%; overflow-x: hidden; }
body {
  width: 100%;
  font-family: -apple-system, "PingFang SC", "Microsoft YaHei", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--ink);
  font-size: 14px;
  line-height: 1.5;
  overscroll-behavior-x: none;
  -webkit-font-smoothing: antialiased;
}
img, video, canvas, svg { max-width: 100%; }
button, input, select, textarea { font-family: inherit; }

/* ---------- 登录 ---------- */
.auth-view { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px; background: var(--bg); }
.auth-card {
  width: 400px; max-width: 92vw; background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--r-lg); box-shadow: var(--shadow-2); padding: 30px 28px 24px;
}
.brand { text-align: center; margin-bottom: 20px; }
/* 登录页公告横幅（备案审核期引导 / 应急地址等临时通知） */
.login-notice {
  display: flex; gap: 8px; align-items: flex-start;
  background: #fff8e6; border: 1px solid #f5d98a; border-left: 3px solid #e8a93c;
  border-radius: var(--r-sm); padding: 10px 12px; margin: 0 0 16px;
  font-size: 13px; line-height: 1.6; color: #7a5b16; text-align: left;
}
.login-notice .ln-icon { flex: none; }
.login-notice .ln-text { word-break: break-word; }
.login-notice a { color: #b06f00; text-decoration: underline; }
.brand-logo {
  font-size: 24px; width: 48px; height: 48px; margin: 0 auto 10px; border-radius: 12px;
  background: var(--brand); color: #fff;
  display: flex; align-items: center; justify-content: center; box-shadow: 0 4px 12px rgba(24, 96, 240, .22);
}
.brand h1 { font-size: 18px; margin: 0 0 4px; letter-spacing: .2px; font-weight: 600; color: var(--ink); }
.brand-sub { color: var(--muted); font-size: 12.5px; margin: 0; }
.auth-form h2 { font-size: 16px; margin: 0 0 18px; color: var(--ink); font-weight: 600; }
.hint { color: var(--muted); font-size: 12px; line-height: 1.65; margin: 0 0 12px; }
.confirm-text { font-size: 14px; line-height: 1.75; color: var(--ink); padding: 4px 0 2px; }
.confirm-text .hint { display: block; margin: 8px 0 0; }
/* 表单项：标签顶对齐 + 32~42px 控件，企业表单规范 */
.af-field { margin-bottom: 14px; }
.af-label { display: block; font-size: 13px; color: var(--ink-2); margin-bottom: 6px; font-weight: 500; }
.af-field input, .af-field select { margin-bottom: 0; }
.auth-form input, .auth-form select {
  width: 100%; height: 42px; padding: 0 12px; border: 1px solid var(--line);
  border-radius: var(--r-sm); font-size: 14px; outline: none; background: #fff; color: var(--ink);
  transition: border-color .15s, box-shadow .15s;
}
.auth-form input:focus, .auth-form select:focus { border-color: var(--brand); background: #fff; box-shadow: 0 0 0 3px rgba(24, 96, 240, .12); }
.auth-form button {
  width: 100%; height: 42px; border: none; border-radius: var(--r-sm);
  background: var(--brand); color: #fff;
  font-size: 15px; font-weight: 600; cursor: pointer; margin-top: 8px;
  transition: background .15s, transform .05s;
}
.auth-form button:hover { background: var(--brand-2); }
.auth-form button:disabled { opacity: .65; cursor: default; }
.auth-form button:active { transform: scale(.995); }
.form-msg { color: var(--danger); font-size: 12px; min-height: 18px; margin-top: 8px; text-align: center; }
.auth-form .check-line { display: flex; align-items: center; gap: 8px; margin: 2px 0 14px; font-size: 13px; color: var(--muted); }
.auth-form .check-line input { width: 16px; height: 16px; margin: 0; padding: 0; accent-color: var(--brand); }
.auth-form a { color: var(--brand); text-decoration: none; }

/* 账号页 */
.acct-card { padding: 20px 22px; margin-bottom: 16px; }
.acct-head { display: flex; align-items: center; gap: 14px; padding-bottom: 16px; border-bottom: 1px solid var(--line-2); margin-bottom: 12px; }
.acct-avatar {
  width: 46px; height: 46px; border-radius: var(--r); background: var(--brand-soft); color: var(--brand);
  font-size: 16px; font-weight: 600; display: flex; align-items: center; justify-content: center; flex: none;
}
.acct-id { min-width: 0; }
.acct-name { font-size: 16px; font-weight: 600; }
.acct-sub { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.acct-title { margin: 0 0 4px; font-size: 15px; font-weight: 600; }
.acct-info { display: grid; grid-template-columns: 1fr 1fr; gap: 0 24px; }
.acct-kv { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line-2); font-size: 13.5px; }
.acct-info .acct-kv:nth-last-child(-n + 2) { border-bottom: none; }
.acct-k { color: var(--muted); flex: none; }
.acct-v { text-align: right; word-break: break-all; }
/* 账号安全设置行（点击进独立弹窗） */
.acct-action {
  width: 100%; display: flex; align-items: center; gap: 13px; margin-top: 8px;
  padding: 13px 14px; border: 1px solid var(--line); border-radius: var(--r-sm);
  background: #fbfcfe; cursor: pointer; text-align: left; font-family: inherit;
  transition: border-color .15s, background .15s;
}
.acct-action:hover { border-color: var(--brand); background: #fff; }
.acct-action .aa-ic {
  flex: none; width: 38px; height: 38px; border-radius: var(--r); background: #eaf1fe;
  display: flex; align-items: center; justify-content: center; font-size: 17px;
}
.acct-action .aa-meta { flex: 1; min-width: 0; }
.acct-action .aa-t { display: block; font-size: 14px; font-weight: 600; color: var(--ink); }
.acct-action .aa-s { display: block; font-size: 12px; color: var(--muted); margin-top: 2px; }
.acct-action .aa-go { flex: none; color: var(--muted); font-size: 18px; font-weight: 700; }
/* 退出登录卡片：标题/说明/按钮统一居中 */
.acct-logout-card { text-align: center; }
.acct-title-center { text-align: center; }
.acct-logout-hint { margin: 0 auto 14px; max-width: 360px; }
.acct-logout-row { display: flex; justify-content: center; }
.acct-logout-row .btn-danger { min-width: 180px; padding: 9px 0; }
.pwd-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 16px; margin-top: 12px; }

/* 商品库改动审核（店长申请列表 + 超管审核卡） */
.list-sub { font-size: 14px; font-weight: 600; color: var(--ink-2); margin: 18px 0 10px; }
.ap-panel { padding: 18px 20px; margin-top: 16px; }
.ap-list { display: flex; flex-direction: column; gap: 10px; margin-top: 10px; }
.ap-row { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid var(--line-2); border-radius: var(--r-sm); background: #fbfcfe; }
.ap-row-main { flex: 1; min-width: 0; }
.ap-row-title { font-size: 13.5px; font-weight: 500; }
.ap-row-sub { font-size: 12px; color: var(--muted); margin-top: 3px; }
.ap-note { font-size: 12px; color: var(--danger); margin-top: 4px; }
.ap-row-side { flex: none; display: flex; align-items: center; gap: 8px; }
.ap-card { padding: 18px 20px; margin-bottom: 14px; }
.ap-card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding-bottom: 12px; border-bottom: 1px solid var(--line-2); }
.ap-card-title { font-size: 14.5px; }
.ap-kvs { display: grid; grid-template-columns: 1fr 1fr; gap: 0 24px; }
.ap-card-foot { margin-top: 14px; display: flex; gap: 10px; }
@media (max-width: 760px) {
  .acct-info, .pwd-grid, .ap-kvs { grid-template-columns: 1fr; }
  .acct-info .acct-kv { border-bottom: 1px solid var(--line-2); }
  .acct-info .acct-kv:last-child { border-bottom: none; }
  .ap-row { flex-direction: column; align-items: flex-start; }
  .ap-row-side { width: 100%; justify-content: space-between; }
  .auth-card { padding: 24px 20px 20px; }
}

/* ---------- 布局 ---------- */
.app-view { display: flex; height: 100vh; }
.sidebar {
  width: 216px; background: #fff; border-right: 1px solid var(--line);
  display: flex; flex-direction: column; flex-shrink: 0;
}
.sidebar-head { display: flex; align-items: center; gap: 9px; padding: 16px 18px; border-bottom: 1px solid var(--line-2); }
.sidebar-head .logo {
  width: 30px; height: 30px; border-radius: 7px; display: flex; align-items: center; justify-content: center;
  background: var(--brand); color: #fff; font-size: 16px;
}
.sidebar-head .title { font-weight: 700; font-size: 14.5px; letter-spacing: .2px; }
.sidebar nav { flex: 1; padding: 10px 10px; overflow-y: auto; }
.nav-item {
  position: relative; display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: var(--r);
  color: var(--ink-2); cursor: pointer; margin-bottom: 3px; font-size: 13.5px; transition: background .15s, color .15s;
}
.nav-item:hover { background: var(--bg); color: var(--ink); }
.nav-item.active { background: var(--brand-soft); color: var(--brand); font-weight: 600; }
.nav-item.active::before {
  content: ''; position: absolute; left: 0; top: 50%; transform: translateY(-50%);
  width: 3px; height: 16px; border-radius: 0 3px 3px 0; background: var(--brand);
}
.nav-item .ic { width: 18px; text-align: center; font-size: 15px; }
.sidebar-foot { padding: 12px 16px; border-top: 1px solid var(--line-2); font-size: 12px; color: var(--muted); line-height: 1.6; }
.sidebar-foot b { color: var(--ink); }
/* 电脑端置底「我的账号」入口 */
.acct-foot-btn {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px 12px; margin-bottom: 10px;
  border: none; border-radius: var(--r); background: transparent; color: var(--ink-2);
  cursor: pointer; font-size: 13.5px; text-align: left;
}
.acct-foot-btn:hover { background: var(--bg); color: var(--ink); }
.acct-foot-btn.active { background: var(--brand-soft); color: var(--brand); font-weight: 600; }
.acct-foot-btn .ic { width: 18px; text-align: center; font-size: 15px; }
.acct-foot-info { padding-left: 2px; }

/* ---------- 「更多」二级菜单（仅手机端出现，电脑端侧边栏保持完整列表） ---------- */
.nav-more { display: none; } /* 电脑端不显示 */
.nav-dot {
  position: absolute; top: -1px; right: -9px; width: 8px; height: 8px; border-radius: 50%;
  background: var(--danger); box-shadow: 0 0 0 2px #fff;
}
.nav-sheet-mask {
  position: fixed; inset: 0; z-index: 60; background: rgba(17, 24, 39, .45);
  display: flex; align-items: flex-end; justify-content: center; animation: sheetFade .16s ease-out;
}
.nav-sheet {
  width: 100%; max-width: 520px; background: #fff; border-radius: 18px 18px 0 0;
  padding: 4px 14px calc(18px + env(safe-area-inset-bottom));
  box-shadow: 0 -8px 34px rgba(20, 30, 60, .2); animation: sheetUp .2s ease-out;
  max-height: 80dvh; overflow-y: auto; overscroll-behavior: contain; touch-action: pan-y;
}
.nav-sheet-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 4px 14px; font-weight: 700; font-size: 15px;
}
.nav-sheet-close {
  border: none; background: var(--bg); color: var(--muted); border-radius: 14px;
  padding: 6px 14px; font-size: 13px; cursor: pointer; font-family: inherit;
}
.nav-sheet-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.nav-sheet-item {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 7px;
  padding: 15px 6px; border: 1px solid var(--line); border-radius: 14px; background: #fbfcfe;
  font-family: inherit; color: var(--ink); cursor: pointer; transition: border-color .15s, background .15s;
}
.nav-sheet-item .sic { position: relative; font-size: 22px; line-height: 1; }
.nav-sheet-item .slb { font-size: 12.5px; }
.nav-sheet-item.active { border-color: var(--brand); background: var(--brand-soft); color: var(--brand); font-weight: 600; }
.nav-sheet-item:active { transform: scale(.97); }
@keyframes sheetFade { from { opacity: 0; } to { opacity: 1; } }
@keyframes sheetUp { from { transform: translateY(16px); } to { transform: none; } }

.main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.topbar {
  height: 54px; background: rgba(255, 255, 255, .92); backdrop-filter: saturate(160%) blur(8px);
  border-bottom: 1px solid var(--line); display: flex;
  align-items: center; justify-content: space-between; padding: 0 20px;
}
.topbar-title { font-weight: 700; font-size: 16px; letter-spacing: .2px; }
.content { flex: 1; overflow-y: auto; padding: 20px; }

/* ---------- 通用控件 ---------- */
.btn {
  border: 1px solid var(--brand); background: var(--brand); color: #fff; padding: 8px 15px;
  border-radius: var(--r-sm); cursor: pointer; font-size: 13px; font-weight: 500;
  box-shadow: none; transition: filter .15s, background .15s;
}
.btn:hover { filter: brightness(1.05); }
.btn:active { filter: brightness(.97); }
.btn-ghost { border: 1px solid var(--line); background: #fff; color: var(--ink-2); padding: 7px 13px; border-radius: var(--r-sm); cursor: pointer; font-size: 13px; transition: background .15s, border-color .15s; }
.btn-ghost:hover { background: var(--bg); border-color: #dfe3ec; }
.btn-sm { padding: 5px 11px; font-size: 12px; border-radius: 7px; }
.btn-danger { background: var(--danger-soft); color: var(--danger); border-color: #f5cdcb; box-shadow: none; font-weight: 500; }
.btn-danger:hover { background: #fbdedc; filter: none; }
/* 我的账号页：退出登录按钮放大醒目（默认 .btn 仅 13px/8px，偏小） */
#logout-btn { padding: 12px 30px; font-size: 15px; font-weight: 600; letter-spacing: .5px; }
.btn[disabled], .btn-ghost[disabled] { opacity: .5; cursor: not-allowed; box-shadow: none; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.spacer { flex: 1; }
.section-head { display: flex; align-items: center; margin-bottom: 14px; gap: 10px; flex-wrap: wrap; }
.section-head h2 { margin: 0; font-size: 16.5px; letter-spacing: .2px; }
.muted { color: var(--muted); }
.hidden { display: none !important; }

/* ---------- 卡片/表格 ---------- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; margin-bottom: 18px; }
.stat {
  background: #fff; border: 1px solid var(--line); border-radius: var(--r); padding: 14px 15px;
  box-shadow: var(--shadow-1);
}
.stat .num { font-size: 27px; font-weight: 700; line-height: 1.15; letter-spacing: -.5px; }
.stat .lbl { color: var(--muted); font-size: 12.5px; margin-top: 5px; }
.stat.alert .num { color: var(--danger); }
.stat.warn .num { color: var(--warn); }
.stat.alert { border-color: #f2cfcc; background: #fffafa; }
.stat.warn { border-color: #f2e2c0; background: #fffdf6; }
/* 可点击的统计卡片（首页点数字直接进对应页面） */
.stat-link { display: block; width: 100%; text-align: left; font-family: inherit; color: var(--ink); cursor: pointer; position: relative; transition: border-color .18s, box-shadow .18s, transform .18s; }
.stat-link:hover { border-color: var(--brand); box-shadow: 0 6px 18px rgba(24, 96, 240, .12); transform: translateY(-1px); }
.stat-link:active { transform: translateY(0) scale(.995); }
/* 手机没有 hover，「查看 ›」默认就显示出来，否则用户看不出卡片能点 */
.stat-link .stat-go { position: absolute; right: 12px; top: 12px; font-size: 11px; color: var(--muted); opacity: .55; transition: opacity .18s; }
.stat-link:hover .stat-go, .stat-link:focus-visible .stat-go { opacity: 1; color: var(--brand); }

/* 多门店勾选（员工弹窗） */
.check-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.store-check { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--r); background: #fff; font-size: 13px; cursor: pointer; transition: border-color .15s, background .15s; }
.store-check input { width: 16px; height: 16px; accent-color: var(--brand); }
.store-check:has(input:checked) { border-color: var(--brand); background: var(--brand-soft); color: var(--brand); font-weight: 600; }
/* 通讯录分组标题：门店电话靠右 */
.contact-group h3 { display: flex; align-items: center; gap: 8px; }
.contact-group h3 .spacer { flex: 1; }

.panel { background: #fff; border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow-1); overflow: hidden; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 11px 14px; text-align: left; border-bottom: 1px solid var(--line-2); font-size: 13px; }
th { background: #fafbfc; color: var(--muted); font-weight: 600; font-size: 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
tr:last-child td { border-bottom: none; }
tbody tr:hover { background: #fafbfe; }
.empty {
  text-align: center; color: var(--muted); font-size: 13px; line-height: 1.7;
  padding: 26px 20px; background: #fff; border: 1px dashed var(--line); border-radius: var(--r);
}

.badge { display: inline-block; padding: 2px 8px; border-radius: 6px; font-size: 11.5px; font-weight: 600; line-height: 1.6; }
.badge.normal { background: var(--ok-soft); color: var(--ok); }
.badge.warning { background: var(--warn-soft); color: var(--warn); }
.badge.urgent { background: var(--danger-soft); color: var(--danger); }
.badge.expired { background: #f6dada; color: #a01818; }
.badge.role-super { background: #efeaff; color: #6a3df0; }
.badge.role-admin { background: #e8f0fe; color: #1a56c4; }
.badge.role-manager { background: var(--brand-soft); color: var(--brand); }
.badge.role-staff { background: #eef1f5; color: #5a6b86; }
.badge.done { background: var(--ok-soft); color: var(--ok); }
.badge.pending { background: var(--warn-soft); color: var(--warn); }

/* 生日提醒页面 */
.bd-summary { display: flex; gap: 10px; margin-bottom: 14px; }
.bd-stat { flex: 1; background: var(--panel); border: 1px solid var(--border); border-radius: 12px; padding: 12px 10px; text-align: center; }
.bd-stat b { display: block; font-size: 24px; line-height: 1.1; color: var(--text); }
.bd-stat span { font-size: 12px; color: var(--muted); }
.bd-stat.urgent b { color: var(--danger); }
.bd-stat.warn b { color: var(--warn); }
.bd-toolbar { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.bd-select { padding: 7px 10px; border: 1px solid var(--border); border-radius: 8px; background: var(--input-bg); color: var(--text); font-size: 14px; }
.bd-card { background: var(--panel); border: 1px solid var(--border); border-radius: 12px; margin-bottom: 12px; overflow: hidden; }
.bd-card-head { padding: 10px 14px; font-weight: 600; font-size: 14px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; }
.bd-count { background: var(--brand-soft); color: var(--brand); font-size: 12px; padding: 1px 9px; border-radius: 20px; font-weight: 600; }
.bd-row { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-bottom: 1px solid var(--border-soft); }
.bd-row:last-child { border-bottom: none; }
.bd-avatar { width: 38px; height: 38px; border-radius: 50%; background: var(--brand-soft); color: var(--brand); display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 16px; flex-shrink: 0; }
.bd-info { flex: 1; min-width: 0; }
.bd-name { font-size: 14px; font-weight: 600; color: var(--text); display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.bd-sub { font-size: 12px; color: var(--muted); margin-top: 2px; }
.badge.storetype-conv { background: #eef1f5; color: #5a6b86; }
.badge.storetype-online { background: #e6f7f0; color: #0c7a52; }
.badge.multi { background: #e8f0fe; color: #1a56c4; }

.reminder-group { margin-bottom: 14px; }
.reminder-group h3 { font-size: 13px; margin: 0 0 8px; color: var(--ink-2); font-weight: 600; display: flex; align-items: center; gap: 6px; }
.home-empty { color: var(--muted); font-size: 12.5px; padding: 6px 2px 2px; }

/* ---------- 首页内嵌区块（日常事务 / 门店通讯录） ---------- */
.home-block {
  background: #fff; border: 1px solid var(--line); border-radius: var(--r); padding: 12px 13px;
  margin-bottom: 14px; box-shadow: var(--shadow-1);
}
.home-head { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.home-head h3 { font-size: 13.5px; margin: 0; display: flex; align-items: center; gap: 6px; color: var(--ink-2); }
.home-head .spacer { flex: 1; }
.home-head .cnt { background: var(--brand); color: #fff; font-size: 11px; font-weight: 600; border-radius: 9px; padding: 1px 7px; }
.home-body { display: flex; flex-direction: column; gap: 8px; }
.home-row { display: flex; gap: 10px; align-items: center; padding: 10px 11px; border: 1px solid var(--line-2); border-radius: var(--r); background: #fbfcfe; }
.home-row .ic { font-size: 17px; }
.home-row .meta { flex: 1; min-width: 0; }
.home-row .meta .t { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.home-row .meta .s { color: var(--muted); font-size: 12px; line-height: 1.5; }
.home-row .btn-sm { flex-shrink: 0; }
.store-tag { font-size: 12px; color: var(--muted); font-weight: 600; margin: 6px 0 2px; }
.store-tag:first-child { margin-top: 0; }
.me-tag { background: var(--line-2); color: var(--muted); font-size: 11px; border-radius: 6px; padding: 1px 6px; font-weight: 500; }
.home-more { text-align: center; color: var(--muted); font-size: 12px; padding: 6px 0 2px; }

/* 首页入口卡片（如门店通讯录） */
.entry-card {
  width: 100%; display: flex; align-items: center; gap: 12px; padding: 14px 15px;
  border: 1px solid var(--line); border-radius: var(--r); background: var(--panel);
  font-family: inherit; text-align: left; cursor: pointer; color: var(--ink);
  box-shadow: var(--shadow-1);
  transition: border-color .18s, box-shadow .18s, transform .18s;
}
.entry-card:hover { border-color: var(--brand); box-shadow: 0 6px 18px rgba(24, 96, 240, .12); transform: translateY(-1px); }
.entry-card:active { transform: translateY(0) scale(.995); }
.entry-card:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.entry-ic {
  width: 44px; height: 44px; border-radius: 13px; flex-shrink: 0;
  background: var(--brand-soft); display: flex; align-items: center; justify-content: center; font-size: 21px;
}
.entry-meta { flex: 1; min-width: 0; }
.entry-meta .t { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 15px; }
.entry-meta .t .cnt { background: var(--brand); color: #fff; font-size: 11px; font-weight: 600; border-radius: 9px; padding: 1px 7px; }
.entry-meta .s { color: var(--muted); font-size: 12px; line-height: 1.5; margin-top: 3px; }
.entry-avatars { display: flex; gap: 6px; margin-top: 9px; flex-wrap: wrap; }
.entry-avatars span {
  width: 26px; height: 26px; border-radius: 50%; background: var(--brand-soft); color: var(--brand);
  font-size: 11px; display: flex; align-items: center; justify-content: center; font-weight: 600;
}
.entry-avatars span.more { background: transparent; border: 1px dashed var(--line); color: var(--muted); font-weight: 500; }
.entry-arrow { color: var(--muted); font-size: 22px; line-height: 1; flex-shrink: 0; }
.reminder-item { display: flex; gap: 10px; align-items: center; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--r); margin-bottom: 8px; background: #fff; box-shadow: var(--shadow-1); }
.reminder-item .ic { font-size: 18px; }
.reminder-item .meta { flex: 1; min-width: 0; }
.reminder-item .meta .t { font-weight: 600; font-size: 13.5px; }
.reminder-item .meta .s { color: var(--muted); font-size: 12px; line-height: 1.5; }

/* ---------- 模态框 ---------- */
/* 注意：这里不能用 touch-action:none —— 它会连同遮罩内部的弹窗一起禁掉触摸滚动（touch-action 取祖先链交集），
   导致手机端弹窗内容滑不动、手指一划反而拖动整个页面。背景拖动交给 JS 的 touchmove 拦截。 */
.modal-mask { position: fixed; inset: 0; background: rgba(17, 24, 39, .42); display: flex; align-items: center; justify-content: center; z-index: 50; overscroll-behavior: contain; }
/* 弹窗打开时锁住背景：html/body/.content 三级全部脱离文档流 + 禁手势，从根上杜绝 iOS(含 iPhone 17/微信) 的「整页拖动/橡皮筋」穿透 */
html.modal-open, html.modal-open body {
  position: fixed; inset: 0; width: 100%; height: 100%;
  overflow: hidden; overscroll-behavior: none; touch-action: none;
}
body.modal-open { overflow: hidden; }
/* 弹窗打开时把背景主滚动容器锁死：脱离文档流 + 禁手势 */
.content.modal-locked { position: fixed; left: 0; right: 0; top: 0; bottom: 0; overflow: hidden; touch-action: none; overscroll-behavior: none; }
body.modal-open .app-view { pointer-events: none; }
.modal { width: 460px; max-width: 94vw; max-height: 88vh; overflow-y: auto; overflow-x: hidden; background: #fff; border-radius: var(--r-lg); box-shadow: 0 18px 50px rgba(20, 30, 60, .22); touch-action: pan-y; overscroll-behavior: contain; }
.modal-head { display: flex; justify-content: space-between; align-items: center; padding: 15px 18px; border-bottom: 1px solid var(--line-2); font-weight: 600; font-size: 16px; }
.modal-head button { border: none; background: none; font-size: 20px; line-height: 1; cursor: pointer; color: var(--muted); width: 30px; height: 30px; border-radius: 8px; display: flex; align-items: center; justify-content: center; }
.modal-head button:hover { background: var(--bg); color: var(--ink); }
.modal-body { padding: 16px 18px; }
.modal-foot { padding: 12px 18px; border-top: 1px solid var(--line-2); display: flex; justify-content: flex-end; gap: 10px; }
.field { margin-bottom: 13px; }
.field label { display: block; font-size: 12.5px; color: var(--muted); margin-bottom: 6px; }
.field input, .field select, .field textarea {
  width: 100%; min-width: 0; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--r); font-size: 14px; outline: none; background: #fbfcfe; color: var(--ink);
  transition: border-color .15s, box-shadow .15s;
}
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--brand); background: #fff; box-shadow: 0 0 0 3px rgba(24, 96, 240, .12); }
.field textarea { line-height: 1.6; resize: vertical; }
.field .preview { font-size: 12px; color: var(--brand); margin-top: 5px; min-height: 15px; line-height: 1.4; }
.field .field-note { font-size: 11.5px; color: var(--muted); margin-top: 5px; line-height: 1.5; }
/* 一键复制单号行 */
.copy-row { display: flex; align-items: center; gap: 8px; }
.copy-row .copy-val { flex: 1 1 0; min-width: 0; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--r); background: #fbfcfe; color: var(--ink); font-size: 14px; font-weight: 600; word-break: break-all; }
.copy-row .btn { flex: none; white-space: nowrap; }
/* 销毁凭证上传 / 展示 */
.ev-box { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 8px; }
.ev-box .ev-empty { width: 100%; font-size: 12.5px; color: var(--muted); padding: 8px 0; }
.ev-item { position: relative; width: 72px; height: 72px; border-radius: var(--r); overflow: hidden; border: 1px solid var(--line); background: #f0f2f5; }
.ev-item img, .ev-item video { width: 100%; height: 100%; object-fit: cover; display: block; }
.ev-del { position: absolute; top: 2px; right: 2px; width: 20px; height: 20px; border-radius: 50%; border: none; background: rgba(0,0,0,.6); color: #fff; font-size: 12px; line-height: 1; cursor: pointer; }
.ev-gallery { display: flex; flex-wrap: wrap; gap: 8px; margin: 6px 0 8px; }
.ev-thumb { display: block; width: 80px; height: 80px; border-radius: var(--r); overflow: hidden; border: 1px solid var(--line); }
.ev-thumb img, .ev-thumb video { width: 100%; height: 100%; object-fit: cover; display: block; }
/* 收货单号三段式：SH - 日期 - 流水号 */
.rno-row { display: flex; align-items: center; gap: 6px; }
.rno-row .rno-fix {
  flex: none; min-width: 44px; text-align: center; padding: 10px 8px;
  background: var(--bg); border: 1px solid var(--line); border-radius: var(--r);
  font-size: 14px; font-weight: 700; color: var(--ink-2); letter-spacing: .5px;
}
.rno-row .rno-dash { flex: none; color: var(--muted); font-weight: 700; }
.rno-row input { flex: 1 1 0; min-width: 0; padding: 10px 10px; border: 1px solid var(--line); border-radius: var(--r); font-size: 14px; outline: none; background: #fbfcfe; color: var(--ink); }
.rno-row input:focus { border-color: var(--brand); background: #fff; box-shadow: 0 0 0 3px rgba(24, 96, 240, .12); }

/* ---------- 中心仓判责：结果卡片 + 后续流程预览 ---------- */
.fault-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.fault-card {
  position: relative; display: flex; align-items: flex-start; gap: 10px;
  padding: 13px 12px; border: 1px solid var(--line); border-radius: var(--r-sm);
  background: #fbfcfe; cursor: pointer; transition: border-color .15s, background .15s, box-shadow .15s;
}
.fault-card:hover { border-color: #bcd2fb; background: #fff; }
.fault-card input { position: absolute; opacity: 0; pointer-events: none; }
.fault-card .fc-ic { flex: none; font-size: 19px; line-height: 1.3; }
.fault-card .fc-meta { flex: 1; min-width: 0; }
.fault-card .fc-t { display: block; font-size: 13.5px; font-weight: 600; color: var(--ink); line-height: 1.4; }
.fault-card .fc-s { display: block; font-size: 11.5px; color: var(--muted); margin-top: 3px; line-height: 1.5; }
.fault-card .fc-check {
  position: absolute; top: 0; right: 0; min-width: 20px; height: 20px; padding: 0 5px;
  border-radius: 0 var(--r-sm) 0 10px; background: var(--brand); color: #fff;
  font-size: 12px; font-weight: 700; display: none; align-items: center; justify-content: center;
}
.fault-card.selected { border-color: var(--brand); background: #eef4ff; box-shadow: 0 0 0 3px rgba(24, 96, 240, .10); }
.fault-card.selected .fc-check { display: flex; }
/* 异常类型选择卡片（新建工单） */
.src-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.src-card {
  position: relative; display: flex; align-items: center; gap: 9px;
  padding: 9px 11px; border: 1px solid var(--line); border-radius: var(--r-sm);
  background: #fbfcfe; cursor: pointer; transition: border-color .15s, background .15s, box-shadow .15s;
}
.src-card:hover { border-color: #bcd2fb; background: #fff; }
.src-card input { position: absolute; opacity: 0; pointer-events: none; }
.src-card .sc-ic { flex: none; font-size: 19px; line-height: 1; }
.src-card .sc-meta { flex: 1; min-width: 0; }
.src-card .sc-t { display: block; font-size: 13.5px; font-weight: 600; color: var(--ink); line-height: 1.3; }
.src-card .sc-s { display: block; font-size: 11px; color: var(--muted); margin-top: 2px; line-height: 1.4; }
.src-card .sc-check {
  position: absolute; top: 0; right: 0; min-width: 20px; height: 20px; padding: 0 5px;
  border-radius: 0 var(--r-sm) 0 10px; background: var(--brand); color: #fff;
  font-size: 12px; font-weight: 700; display: none; align-items: center; justify-content: center;
}
.src-card.selected { border-color: var(--brand); background: #eef4ff; box-shadow: 0 0 0 3px rgba(24, 96, 240, .10); }
.src-card.selected .sc-check { display: flex; }
/* 手机端保持 2 列，卡片内文字紧凑，避免过长说明换行撑高 */
@media (max-width: 640px) {
  .src-cards { grid-template-columns: 1fr 1fr; gap: 8px; }
  .src-card { gap: 7px; padding: 8px 9px; }
  .src-card .sc-ic { font-size: 17px; }
  .src-card .sc-t { font-size: 13px; }
  .src-card .sc-s { font-size: 10px; line-height: 1.35; }
}

/* 新建工单添加商品的步骤引导 */
.ticket-line-form .tlf-step { display: flex; align-items: center; gap: 7px; font-size: 12px; font-weight: 700; color: var(--brand); margin: 4px 0 8px; }
.ticket-line-form .tlf-step:first-child { margin-top: 0; }
.ticket-line-form .tlf-num {
  flex: none; width: 18px; height: 18px; border-radius: 50%; background: var(--brand); color: #fff;
  font-size: 11px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center;
}
.fault-flow {
  margin-top: 12px; padding: 12px 14px; border: 1px solid #d8e5fb; border-radius: var(--r-sm);
  background: #f0f6ff;
}
.fault-flow .ff-empty { font-size: 12.5px; color: var(--muted); }
.fault-flow .ff-title { font-size: 12.5px; font-weight: 700; color: var(--brand); margin-bottom: 8px; }
.fault-flow .ff-steps { list-style: none; margin: 0; padding: 0; }
.fault-flow .ff-steps li { display: flex; align-items: center; gap: 9px; font-size: 13px; color: var(--ink-2); padding: 4px 0; }
.fault-flow .ff-steps li i {
  flex: none; width: 18px; height: 18px; border-radius: 50%; background: #dbe7fb; color: var(--brand);
  font-size: 11px; font-style: normal; font-weight: 700; display: flex; align-items: center; justify-content: center;
}
@media (max-width: 640px) {
  .fault-cards { grid-template-columns: 1fr; }
}
.field .inline { display: flex; gap: 8px; align-items: center; }
/* 输入框占主导，后面的选择框/按钮保持自适应宽度（解决保质期输入框过短） */
.field .inline input { flex: 2 1 0; width: auto; min-width: 0; }
.field .inline select { flex: 0 0 auto; width: auto; min-width: 88px; }
.field .inline button { flex: 0 0 auto; white-space: nowrap; }
/* 保质期：数字输入框 + 天/个月 选择框。用 grid 固定比例，输入框吃掉剩余宽度，不再被压缩 */
.field .inline.shelf-row { display: grid; grid-template-columns: minmax(0, 1fr) 106px; gap: 8px; align-items: stretch; }
.field .inline.shelf-row > input,
.field .inline.shelf-row > select { width: 100%; min-width: 0; flex: none; }
/* 提前提醒的 N 值输入框保持紧凑，单位文字跟在后面 */
#rval-wrap input { flex: 0 0 110px; }
#scan-video { max-height: 50vh; object-fit: cover; }

/* ---------- 告警浮层（延期风险等） ---------- */
.alert-mask {
  position: fixed; inset: 0; z-index: 120; display: flex; align-items: center; justify-content: center;
  padding: 20px; background: rgba(17, 24, 39, .5);
}
.alert-box {
  width: 380px; max-width: 92vw; background: #fff; border-radius: var(--r-lg);
  box-shadow: 0 18px 50px rgba(20, 30, 60, .24); overflow: hidden; animation: alertIn .16s ease-out;
}
.alert-title { padding: 17px 18px 4px; font-size: 15px; font-weight: 700; display: flex; align-items: center; gap: 6px; }
.alert-box.warn .alert-title { color: var(--danger); }
.alert-body { padding: 6px 18px 16px; font-size: 13.5px; line-height: 1.75; color: var(--ink-2); }
.alert-body b { color: var(--danger); }
.alert-foot { padding: 12px 18px; border-top: 1px solid var(--line-2); display: flex; justify-content: flex-end; gap: 10px; }
@keyframes alertIn { from { opacity: 0; transform: translateY(8px) scale(.98); } to { opacity: 1; transform: none; } }
@media (max-width: 640px) {
  .alert-mask { align-items: flex-end; padding: 0; }
  .alert-box { width: 100%; max-width: 100%; border-radius: 18px 18px 0 0; padding-bottom: env(safe-area-inset-bottom); }
  .alert-title { font-size: 16px; padding: 18px 18px 4px; }
  .alert-body { font-size: 14px; }
  .alert-foot { padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); }
  .alert-foot button { flex: 1; padding: 11px 0; font-size: 14px; }
}

/* ---------- 商品库导入 ---------- */#imp-msg { font-size: 12.5px; line-height: 1.6; color: var(--brand); margin-top: 10px; min-height: 18px; }
.imp-text { width: 100%; font-family: inherit; font-size: 13px; line-height: 1.55; resize: vertical; }
.imp-tip { font-size: 12px; color: var(--muted); margin-top: 12px; }
.home-block-last { margin-top: 2px; margin-bottom: 6px; }


/* ---------- Toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: 36px; transform: translateX(-50%); background: #1b2230; color: #fff;
  padding: 10px 18px; border-radius: 999px; z-index: 100; box-shadow: 0 8px 26px rgba(20, 30, 60, .24);
  font-size: 13px; max-width: 86vw; text-align: center;
}
.toast.err { background: var(--danger); }
.toast.ok { background: var(--ok); }

/* ---------- 快捷入口 ---------- */
.quick-actions { display: flex; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.quick-btn {
  flex: 1 1 140px; display: flex; align-items: center; justify-content: center; gap: 8px;
  padding: 13px 12px; border: 1px solid var(--line); background: #fff; border-radius: var(--r);
  font-size: 14px; font-weight: 600; color: var(--ink); cursor: pointer; box-shadow: var(--shadow-1);
  transition: border-color .15s, box-shadow .15s;
}
.quick-btn:hover { border-color: #d6e2fb; box-shadow: var(--shadow-2); }
.quick-btn span { font-size: 18px; }
.quick-btn.primary {
  background: var(--brand); border-color: transparent; color: #fff;
  box-shadow: none;
}
.quick-btn:active { transform: scale(.99); }

/* ---------- 扫码录入 ---------- */
.scan-cta {
  width: 100%; display: flex; align-items: center; justify-content: center; gap: 8px;
  padding: 15px; margin-bottom: 16px; border: none; border-radius: var(--r); cursor: pointer;
  background: var(--brand); color: #fff; font-size: 16px; font-weight: 700;
  box-shadow: none;
}
.scan-cta .scan-ic { font-size: 20px; }
.scan-box { position: relative; background: #000; border-radius: var(--r); overflow: hidden; }
#scan-video { width: 100%; height: 240px; object-fit: cover; display: block; }
.scan-frame {
  position: absolute; left: 12%; right: 12%; top: 30%; height: 40%; border: 2px solid rgba(255, 255, 255, .85);
  border-radius: var(--r); box-shadow: 0 0 0 9999px rgba(0, 0, 0, .28); pointer-events: none;
}
.scan-box .hint { padding: 8px 12px; margin: 0; background: rgba(0, 0, 0, .55); color: #fff; }
.scan-box .center { text-align: center; }
/* 扫码入口：先选方式（微信里实时取流常不可用，拍照识别放第一个） */
.scan-choice { display: flex; flex-direction: column; gap: 9px; }
.scan-choice-btn {
  display: flex; align-items: center; gap: 12px; width: 100%; text-align: left;
  padding: 14px; border: 1px solid var(--line); border-radius: var(--r); background: var(--panel);
  color: var(--ink); cursor: pointer; box-shadow: var(--shadow-1);
  transition: border-color .15s, background .15s, box-shadow .15s;
}
.scan-choice-btn:active { background: var(--brand-soft); }
.scan-choice-btn .sc-ic { font-size: 23px; line-height: 1; }
.scan-choice-btn .sc-txt { display: flex; flex-direction: column; gap: 3px; }
.scan-choice-btn .sc-txt b { font-size: 14.5px; }
.scan-choice-btn .sc-txt i { font-style: normal; font-size: 12px; color: var(--muted); }
.scan-choice-btn.primary { border-color: var(--brand); background: var(--brand-soft); }
.scan-choice-btn.primary .sc-txt i { color: var(--brand); }

.scan-alt { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.scan-alt > * { flex: 1 1 30%; text-align: center; }
.file-btn { display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
/* 摄像头不可用 / 长时间扫不出时，把「拍照识别」凸显出来 */
.file-btn.primary-tip, .btn-ghost.primary-tip {
  background: var(--brand); color: #fff; border-color: var(--brand);
}
.btn-link { border: none; background: none; color: var(--brand); font-size: 12px; cursor: pointer; padding: 0 2px; text-decoration: underline; }
.match-cands { margin-top: 6px; display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: center; font-size: 12px; color: var(--muted); }
.match-cands .btn-link { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- 商品库提示 / 列表 ---------- */
.lib-hint { display: none; font-size: 12px; line-height: 1.6; padding: 9px 11px; border-radius: 9px; margin: -4px 0 12px; }
.lib-hint.ok { display: block; background: #eef7f1; color: #14713f; border: 1px solid #cfe9da; }
.lib-hint.warn { display: block; background: #fdf7e6; color: #8a6100; border: 1px solid #f2e3ba; }
.req { color: var(--danger); font-style: normal; }
.check-line { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ink); padding: 6px 0 2px; }
.check-line input { width: 17px; height: 17px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.lib-add { display: grid; grid-template-columns: 1fr 1.4fr .9fr auto; gap: 8px; align-items: end; padding: 12px; background: #fafbfd; border: 1px solid var(--line-2); border-radius: var(--r); margin-bottom: 12px; }
.lib-add .field { margin: 0; }
.lib-list { max-height: 46vh; overflow-y: auto; border: 1px solid var(--line); border-radius: var(--r); }
.lib-row { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-bottom: 1px solid var(--line-2); }
.lib-row:last-child { border-bottom: none; }
.lib-row:hover { background: #fafbfe; }
.lib-main { flex: 1; min-width: 0; }
.lib-main .ln { font-weight: 600; font-size: 13px; }
.lib-main .lb { color: var(--muted); font-size: 11.5px; }
.lib-row .lp { color: var(--danger); font-weight: 700; font-size: 14px; white-space: nowrap; }

/* ---------- 表格转卡片 ---------- */
.cell-main { font-weight: 600; font-size: 13.5px; }
.cell-main.done-text { text-decoration: line-through; color: var(--muted); }
.cell-sub { color: var(--muted); font-size: 11.5px; line-height: 1.5; margin-top: 3px; }

/* ---------- 效期处置 ---------- */
.nav-item .ic { position: relative; }
.nav-badge {
  position: absolute; top: -7px; right: -9px; min-width: 15px; height: 15px; padding: 0 4px;
  background: var(--danger); color: #fff; font-size: 10px; font-style: normal; font-weight: 700;
  border-radius: 8px; line-height: 15px; text-align: center; box-shadow: 0 0 0 2px #fff;
}
.badge.handled { background: var(--ok-soft); color: var(--ok); }
.badge.snoozed { background: #eef1f5; color: #5a6b86; }
.badge.rejected { background: var(--danger-soft); color: var(--danger); }
.badge.memo { background: #eef1f5; color: #5a6b86; }
.badge.purchase { background: #efeaff; color: #6a3df0; }

/* ---------- 新建事务：类型切换 / 采购明细 ---------- */
.type-tabs { display: flex; gap: 8px; margin-bottom: 14px; flex-wrap: wrap; }
.type-tab {
  flex: 1 1 0; min-width: 100px; padding: 10px; border: 1px solid var(--line); border-radius: var(--r);
  background: #fbfcfe; color: var(--muted); font-size: 13px; font-weight: 600; cursor: pointer; font-family: inherit;
  transition: border-color .15s, background .15s, color .15s;
}
.type-tab.active { border-color: var(--brand); background: var(--brand-soft); color: var(--brand); box-shadow: inset 0 0 0 1px rgba(24, 96, 240, .25); }
.pur-row { display: flex; gap: 8px; margin-bottom: 8px; align-items: center; }
.pur-row input {
  flex: 1; min-width: 0; padding: 10px 11px; border: 1px solid var(--line); border-radius: var(--r);
  font-size: 14px; background: #fbfcfe; outline: none; font-family: inherit;
}
.pur-row input:focus { border-color: var(--brand); background: #fff; box-shadow: 0 0 0 3px rgba(24, 96, 240, .12); }
.pur-row .pur-qty { flex: 0 0 74px; text-align: center; }
.pur-del {
  flex: 0 0 32px; height: 36px; border: 1px solid var(--line); border-radius: var(--r); background: #fff;
  color: var(--muted); cursor: pointer; font-size: 13px;
}
.pur-del:hover { border-color: var(--danger); color: var(--danger); }

/* ---------- 备忘提醒 / 采购内容 ---------- */
.remind-inline { margin-top: 8px; }
.remind-inline input[type="date"] { flex: 1; }
.remind-inline input[type="time"] { flex: 0 0 118px; }
.remind-on { color: var(--brand); font-weight: 600; }
.remind-off { color: var(--muted); }
.remind-done { color: var(--muted); }
#f-tdetail { min-height: 132px; line-height: 1.6; resize: vertical; }

.disp-head { padding: 11px 13px; background: #fafbfd; border: 1px solid var(--line-2); border-radius: var(--r); margin-bottom: 14px; }
.disp-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; margin-bottom: 14px; }
.disp-opt {
  display: flex; flex-direction: column; gap: 3px; align-items: flex-start; text-align: left;
  padding: 12px; border: 1px solid var(--line); border-radius: var(--r); background: #fff;
  cursor: pointer; font: inherit; color: var(--ink); transition: border-color .15s, background .15s;
}
.disp-opt b { font-size: 14px; }
.disp-opt span { font-size: 11px; color: var(--muted); line-height: 1.45; }
.disp-opt.active { border-color: var(--brand); background: var(--brand-soft); box-shadow: 0 0 0 1px var(--brand); }
.chip-row { display: flex; gap: 8px; flex-wrap: wrap; }
.chip {
  padding: 7px 14px; border: 1px solid var(--line); background: #fff; border-radius: 18px;
  font: inherit; font-size: 13px; cursor: pointer; color: var(--ink-2); transition: border-color .15s, background .15s, color .15s;
}
.chip.active { border-color: var(--brand); background: var(--brand-soft); color: var(--brand); font-weight: 600; }

/* 员工管理筛选栏 */
.emp-filter { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin: 2px 0 14px; }

/* 利润核算（仅线上外卖店） */
.pf-cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin: 12px 0; }
.pf-card { padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: #fff; box-shadow: var(--shadow-1, 0 1px 2px rgba(16,24,40,.04)); }
.pf-card-t { font-size: 12px; color: var(--muted); margin-bottom: 6px; }
.pf-card-v { font-size: 18px; font-weight: 700; color: var(--ink); line-height: 1.2; }
.pf-card-s { font-size: 11.5px; color: var(--muted); margin-top: 4px; line-height: 1.4; }
.pf-card.pos .pf-card-v { color: #1a9e5c; }
.pf-card.neg .pf-card-v { color: #c62828; }
.pf-section { margin: 16px 0 4px; }
.pf-section h4 { font-size: 13px; color: var(--ink-2); margin: 0 0 8px; font-weight: 600; }
.pf-bar { display: flex; align-items: center; gap: 10px; padding: 4px 0; font-size: 13px; }
.pf-bar-label { flex: 0 0 108px; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pf-bar-track { flex: 1 1 auto; height: 10px; background: #eef1f6; border-radius: 6px; overflow: hidden; }
.pf-bar-fill { display: block; height: 100%; background: #1a9e5c; border-radius: 6px; transition: width .2s; }
.pf-bar-val { flex: 0 0 auto; min-width: 84px; text-align: right; font-weight: 600; color: var(--ink); }
/* 开业前期固定支出横条（门店级固定值，不计入资产合计） */
.pf-banner { display: flex; align-items: stretch; gap: 12px; flex-wrap: wrap; margin: 12px 0 4px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: #fbfaf6; }
.pf-banner-i { flex: 0 0 auto; min-width: 132px; }
.pf-banner-t { font-size: 12px; color: var(--muted); margin-bottom: 4px; }
.pf-banner-v { font-size: 17px; font-weight: 700; color: var(--ink); line-height: 1.2; }
.pf-banner-v.pos { color: #1a9e5c; }
.pf-banner-v.neg { color: #c62828; }
.pf-banner-n { flex: 1 1 200px; font-size: 11.5px; color: var(--muted); line-height: 1.5; align-self: center; }
/* 环比对比行：上月 → 本月 → 增减 */
.pf-diff { display: grid; grid-template-columns: 1fr auto auto auto; gap: 4px 10px; align-items: baseline; padding: 7px 2px; font-size: 13px; border-bottom: 0.5px dashed var(--line); }
.pf-diff-l { color: var(--ink-2); }
.pf-diff-p, .pf-diff-a { color: var(--muted); font-variant-numeric: tabular-nums; }
.pf-diff-c { font-weight: 600; color: var(--ink); font-variant-numeric: tabular-nums; }
.pf-diff-d { font-weight: 700; font-variant-numeric: tabular-nums; min-width: 96px; text-align: right; }
.pf-diff-d.up { color: #1a9e5c; }
.pf-diff-d.down { color: #c62828; }
.pf-diff-d.flat { color: var(--muted); font-weight: 500; }
.pf-exp-form { margin: 12px 0 16px; }
.pf-exp-form .btn { margin-top: 4px; }
.pf-cat { display: inline-block; padding: 2px 8px; border-radius: 6px; font-size: 11.5px; font-weight: 600; background: #e8f0fe; color: #1a56c4; }
@media (max-width: 640px) {
  .pf-cards { grid-template-columns: 1fr 1fr; }
  /* 卡片数为奇数时，最后一张占满整行，避免右侧留一大块空白 */
  .pf-cards .pf-card:last-child:nth-child(odd) { grid-column: 1 / -1; }
  .pf-bar-label { flex: 0 0 88px; font-size: 12.5px; }
  .pf-bar-val { min-width: 76px; font-size: 12.5px; }
  /* 窄屏：标签+增减一行，上月→本月一行 */
  .pf-diff { grid-template-columns: 1fr auto; gap: 2px 8px; font-size: 12.5px; }
  .pf-diff-l { grid-column: 1; grid-row: 1; }
  .pf-diff-d { grid-column: 2; grid-row: 1; }
  .pf-diff-p { grid-column: 1; grid-row: 2; }
  .pf-diff-c { grid-column: 2; grid-row: 2; }
  .pf-diff-a { display: none; }
}
.emp-filter .ef-kw { flex: 1 1 180px; min-width: 0; }
.emp-filter select { flex: 0 0 auto; }
.emp-filter .ef-count { font-size: 13px; color: var(--muted); margin-left: auto; white-space: nowrap; }
.emp-filter .ef-count b { color: var(--ink); }
@media (max-width: 760px) {
  .emp-filter .ef-kw { flex-basis: 100%; }
  .emp-filter .ef-count { margin-left: 0; width: 100%; }
}

.review-banner {
  display: block; width: 100%; text-align: left; margin: 0 0 14px; padding: 12px 14px;
  border: 1px solid #f6dfb8; background: #fff8ea; color: #8a5a00; border-radius: var(--r);
  font: inherit; font-size: 13px; cursor: pointer; box-shadow: var(--shadow-1);
}
.review-banner.waiting { border-color: var(--line); background: #f7f9fc; color: var(--muted); cursor: default; box-shadow: none; }
.review-card { background: #fff; border: 1px solid var(--line); border-radius: var(--r); padding: 14px; margin-bottom: 10px; box-shadow: var(--shadow-1); }
.review-top { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; margin-bottom: 6px; }
.review-reason { font-size: 13px; background: #fafbfd; border-radius: var(--r-sm); padding: 9px 11px; margin: 8px 0; color: var(--ink-2); line-height: 1.6; }
.review-actions { display: flex; gap: 8px; margin-top: 10px; }
.review-actions .btn, .review-actions .btn-danger { flex: 1; padding: 9px 0; }
.sub-title { font-size: 13px; margin: 18px 0 10px; color: var(--muted); font-weight: 600; }

.msg-list { display: flex; flex-direction: column; gap: 9px; }
.msg-item {
  background: #fff; border: 1px solid var(--line); border-radius: var(--r); padding: 13px 14px;
  cursor: pointer; box-shadow: var(--shadow-1); transition: border-color .15s, box-shadow .15s;
}
.msg-item:hover { border-color: #d6e2fb; box-shadow: var(--shadow-2); }
.msg-item.unread { border-color: #c9d9fb; background: #f7faff; }
.msg-item.unread .msg-title::after {
  content: ''; display: inline-block; width: 6px; height: 6px; border-radius: 50%;
  background: var(--brand); margin-left: 6px; vertical-align: 2px;
}
.msg-title { font-weight: 600; font-size: 14px; margin-bottom: 5px; }
.msg-text { font-size: 13px; color: var(--ink-2); line-height: 1.6; }
.msg-time { font-size: 11.5px; color: var(--muted); margin-top: 7px; }

/* ---------- 通讯录 ---------- */
.tel-link { color: var(--brand); text-decoration: none; font-weight: 600; }
.contact-group { background: #fff; border: 1px solid var(--line); border-radius: var(--r); padding: 2px 14px 8px; margin-bottom: 12px; box-shadow: var(--shadow-1); }
.contact-group h3 { font-size: 12.5px; margin: 12px 0 6px; color: var(--muted); font-weight: 600; }
.contact-row { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-top: 1px solid var(--line-2); }
.contact-row:first-of-type { border-top: none; }
.contact-avatar {
  width: 36px; height: 36px; border-radius: 12px; background: var(--brand-soft); color: var(--brand);
  display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 700; flex-shrink: 0;
}
.contact-meta { flex: 1; min-width: 0; }
.contact-name { font-size: 14px; font-weight: 600; }
.call-btn {
  display: inline-flex; align-items: center; gap: 4px; padding: 7px 13px; border-radius: 18px;
  background: var(--brand-soft); color: var(--brand); text-decoration: none; font-size: 13px; font-weight: 600; white-space: nowrap;
}
.call-btn:active { background: #d8e6ff; }

/* ---------- 手机 / 微信内 ---------- */
@media (max-width: 760px) {
  html, body { height: 100%; }
  .app-view { height: 100dvh; flex-direction: column; }
  .sidebar {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
    width: 100%; height: auto; flex-direction: row; align-items: stretch;
    border-right: none; border-top: 1px solid var(--line);
    padding-bottom: env(safe-area-inset-bottom);
    background: rgba(255, 255, 255, .97); backdrop-filter: saturate(160%) blur(10px);
    box-shadow: 0 -1px 0 rgba(20, 30, 60, .04), 0 -6px 20px rgba(20, 30, 60, .06);
  }
  .sidebar-head, .sidebar-foot { display: none; }
  /* 底部导航：固定「常用项 + 更多」，不横滑，均分整行宽度 */
  .sidebar nav { display: flex; flex-direction: row; gap: 0; padding: 6px 6px; overflow: visible; }
  /* 次要入口收进「更多」，电脑端侧边栏仍完整显示 */
  .nav-secondary { display: none; }
  .nav-more { display: flex; }
  .nav-item {
    flex: 1 1 0; width: auto; flex-direction: column; gap: 3px; margin: 0; padding: 6px 2px 5px;
    font-size: 10.5px; line-height: 1.2; text-align: center; min-width: 0; border-radius: var(--r);
  }
  .nav-item.active::before { display: none; }
  .nav-item > span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
  .nav-item .ic { width: auto; font-size: 19px; }
  .main { padding-bottom: calc(var(--nav-h, 56px) + 8px); }
  .topbar { height: 50px; padding: 0 14px; position: sticky; top: 0; z-index: 30; }
  .topbar-title { font-size: 15.5px; }
  .content { padding: 12px 12px 18px; overflow-x: hidden; }
  .section-head { flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
  .section-head h2 { font-size: 16px; width: 100%; }
  .section-head .spacer { display: none; }
  .section-head .btn, .section-head .btn-ghost, .section-head select { padding: 8px 12px; font-size: 12.5px; }
  .filter-row input { flex: 1 1 100%; max-width: 100%; width: 100%; }
  .grid { grid-template-columns: repeat(2, 1fr); gap: 10px; margin-bottom: 14px; }
  .stat { padding: 12px 13px; border-radius: var(--r); }
  .stat .num { font-size: 22px; }
  .stat .lbl { font-size: 11.5px; }
  .quick-btn { flex: 1 1 calc(50% - 5px); padding: 13px 10px; }
  .reminder-item { padding: 10px 11px; }

  /* 弹窗改成底部抽屉 */
  .modal-mask { align-items: flex-end; }
  /* 抽屉：头部/底部按钮固定，只有中间内容区滚动，滑动行为可预期，手指不会拖到背景页 */
  .modal {
    width: 100%; max-width: 100%; border-radius: 18px 18px 0 0; max-height: 92dvh;
    display: flex; flex-direction: column; overflow: hidden;
  }
  .modal-head { position: relative; padding: 18px 16px 12px; flex: 0 0 auto; }
  /* 抽屉顶部的小横条，看起来更像「从底部拉起」 */
  .modal-head::before {
    content: ''; position: absolute; left: 50%; top: 7px; transform: translateX(-50%);
    width: 36px; height: 4px; border-radius: 2px; background: #e2e6ee;
  }
  .modal-body {
    padding: 14px 16px; flex: 1 1 auto; min-height: 0; overflow-y: auto; overflow-x: hidden;
    -webkit-overflow-scrolling: touch; overscroll-behavior: contain; touch-action: pan-y;
  }
  .modal-foot { padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); flex: 0 0 auto; }
  .modal-foot .btn, .modal-foot .btn-ghost, .modal-foot .btn-danger { flex: 1; padding: 11px 0; font-size: 14px; }
  #scan-video { height: 200px; }
  .lib-add { grid-template-columns: 1fr 1fr; }
  .lib-add button { width: 100%; }
  .field input, .field select, .field textarea { font-size: 16px; padding: 11px 12px; }
  /* 手机上两列表单改单列堆叠：date/number 输入框有固有最小宽度，窄屏两列会挤压重叠 */
  .grid-2 { grid-template-columns: 1fr; gap: 0; }
  .grid-2 .field { margin-bottom: 13px; }
  .empty { padding: 22px 16px; }

  /* 表格变卡片 */
  table.table-cards thead { display: none; }
  table.table-cards, table.table-cards tbody { display: block; }
  table.table-cards tr {
    display: block; border: 1px solid var(--line); border-radius: 14px;
    margin: 0 0 10px; padding: 4px 0; background: #fff; box-shadow: var(--shadow-1);
  }
  table.table-cards td {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    border: none; padding: 5px 13px; font-size: 13px; text-align: right;
  }
  table.table-cards td::before {
    content: attr(data-label); color: var(--muted); font-size: 12px; flex-shrink: 0; text-align: left;
  }
  table.table-cards td[data-label="商品"], table.table-cards td[data-label="事务"], table.table-cards td[data-label="员工"] {
    display: block; text-align: left; padding: 9px 13px 4px;
  }
  table.table-cards td[data-label="商品"]::before, table.table-cards td[data-label="事务"]::before, table.table-cards td[data-label="员工"]::before { display: none; }
  table.table-cards td:last-child { border-top: 1px dashed var(--line-2); margin-top: 4px; padding-top: 9px; justify-content: flex-end; }
  table.table-cards td.row-actions { flex-wrap: wrap; gap: 6px; }
  table.table-cards td.row-actions::before { margin-right: auto; }
  .panel:has(table.table-cards) { background: transparent; border: none; box-shadow: none; }
  /* 普通宽表格兜底：允许横向滑动，避免按钮被裁在屏幕外 */
  .panel:not(:has(table.table-cards)) { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .toast { bottom: calc(66px + env(safe-area-inset-bottom)); }
}

/* ---------- 电脑端：内容区限宽，避免大屏上表格被拉得过长 ---------- */
@media (min-width: 761px) {
  .content { padding: 20px 24px; }
  .content > * { max-width: 1120px; margin-left: auto; margin-right: auto; }
  /* 电脑端：「我的账号」从导航列表移除，改为置底入口（在用户信息区上方） */
  .sidebar nav .nav-item[data-id="account"] { display: none; }
}

/* ---------- 系统日志筛选条 ---------- */
.log-filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.log-filters select, .log-filters input {
  flex: 1 1 150px; min-width: 120px;
  padding: 9px 11px; border: 1px solid var(--line); border-radius: 8px; font-size: 14px; outline: none; background: #fbfcfe;
}
.log-filters select:focus, .log-filters input:focus { border-color: var(--brand); background: #fff; }
.log-filters .btn { flex: 0 0 auto; padding: 9px 16px; }
@media (max-width: 640px) {
  .log-filters select, .log-filters input, .log-filters .btn { flex: 1 1 100%; font-size: 16px; }
}
/* 日志表格在手机上的卡片排版：时间做卡片头，详情整行左对齐 */
@media (max-width: 760px) {
  table.table-cards td[data-label="时间"] {
    display: block; text-align: left; padding: 8px 12px 0; color: var(--muted); font-size: 12px;
  }
  table.table-cards td[data-label="时间"]::before { display: none; }
  table.table-cards td[data-label="详情"] {
    display: block; text-align: left; padding: 2px 12px 6px; line-height: 1.55; color: var(--ink);
  }
  table.table-cards td[data-label="详情"]::before { display: none; }
}


/* ---------- 备案号（工信部要求展示在网站底部） ---------- */
.icp-line { margin: 16px 0 0; text-align: center; font-size: 11px; color: var(--muted); line-height: 1.6; }
.icp-line a { color: var(--muted); text-decoration: none; }
.icp-line a:active { color: var(--brand); }

/* ---------- 徽章简写别名（工单/报损页用） ---------- */
.badge.ok { background: var(--ok-soft); color: var(--ok); }
.badge.warn { background: var(--warn-soft); color: var(--warn); }
.badge.danger { background: var(--danger-soft); color: var(--danger); }
.badge.info { background: #e8f0fe; color: #1a56c4; }
.badge.void { background: #eef1f5; color: #5a6b86; text-decoration: line-through; }

/* ---------- 页签 / 筛选行 ---------- */
.tabs { display: flex; gap: 6px; margin: 4px 0 14px; border-bottom: 1px solid var(--line); }
.tab { padding: 8px 14px; border: none; background: none; font-size: 13.5px; color: var(--ink-2); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; font-family: inherit; }
.tab.active { color: var(--brand); border-bottom-color: var(--brand); font-weight: 600; }
.filter-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 12px; }
.filter-row input { flex: 1 1 100%; min-width: 0; max-width: 480px; }
.field-row { display: flex; gap: 10px; }
.field-row > .field { flex: 1; min-width: 0; }
.readonly-field { background: var(--bg, #f5f7fa); color: var(--ink-2, #8a93a3); cursor: not-allowed; }
.field-note { font-size: 11.5px; color: var(--ink-2, #8a93a3); margin-top: 4px; line-height: 1.4; }

/* ---------- 异常工单卡片 ---------- */
.ticket-card { background: var(--surface, #fff); border: 1px solid var(--line); border-radius: var(--r); padding: 12px 14px; margin-bottom: 10px; cursor: pointer; transition: border-color .15s; }
.ticket-card:active { border-color: var(--brand); }
.ticket-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.ticket-badges { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.ticket-meta { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 8px; font-size: 12.5px; color: var(--ink-2); }
.ticket-meta b { color: var(--ink); }

/* ---------- 工单详情：步骤条 / 信息 / 时间线 ---------- */
.steps { display: flex; gap: 0; overflow-x: auto; padding: 4px 0 10px; }
.step { flex: 1; min-width: 64px; text-align: center; position: relative; }
.step::before { content: ''; position: absolute; top: 9px; left: -50%; width: 100%; height: 2px; background: var(--line); }
.step:first-child::before { display: none; }
.step.done::before { background: var(--ok); }
.step-dot { width: 18px; height: 18px; border-radius: 50%; background: #fff; border: 2px solid var(--line); margin: 0 auto 6px; position: relative; z-index: 1; }
.step.done .step-dot { border-color: var(--ok); background: var(--ok); box-shadow: inset 0 0 0 3px #fff; }
.step-label { font-size: 11.5px; color: var(--ink-2); line-height: 1.4; }
.step.done .step-label { color: var(--ink); font-weight: 600; }
.step-at { font-size: 10.5px; color: var(--muted); font-weight: 400; margin-top: 2px; }
.ticket-info { background: var(--panel-2, #f7f8fa); border-radius: var(--r); padding: 10px 12px; margin: 8px 0 4px; }
.ticket-info > div { display: flex; align-items: center; gap: 10px; font-size: 13px; padding: 3px 0; }
.ticket-info > div > span { flex: none; width: 64px; color: var(--muted); }
.ticket-info > div > b { word-break: break-all; }
/* 单号旁的一键复制小图标 */
.copy-ic { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 26px; padding: 0; border: 1px solid var(--line); border-radius: 7px; background: #fff; font-size: 13px; line-height: 1; cursor: pointer; transition: border-color .15s, box-shadow .15s, background .15s; }
.copy-ic:active { background: var(--panel-2, #f7f8fa); border-color: var(--brand); }
.ticket-actions { display: flex; gap: 8px; flex-wrap: wrap; margin: 12px 0 4px; }
.timeline { padding: 4px 0 4px 6px; }
.tl-item { display: flex; gap: 10px; padding: 6px 0; }
.tl-dot { flex: none; width: 9px; height: 9px; border-radius: 50%; background: var(--brand); margin-top: 5px; }
.tl-body { flex: 1; min-width: 0; }
.tl-title { font-size: 13px; font-weight: 600; }
.tl-note { font-size: 12.5px; color: var(--ink-2); }
.tl-at { font-size: 11px; color: var(--muted); margin-top: 1px; }

/* ---------- 表单辅助 ---------- */
.ticket-line-form { border: 1px dashed var(--line); border-radius: var(--r); padding: 12px; }
.scan-row { display: flex; gap: 8px; align-items: center; }
.scan-row input { flex: 1; min-width: 0; }
.opt-row { display: flex; gap: 8px; flex-wrap: wrap; }
.opt { display: inline-flex; align-items: center; gap: 5px; font-size: 13px; padding: 7px 10px; border: 1px solid var(--line); border-radius: 8px; cursor: pointer; }
.opt:has(input:checked) { border-color: var(--brand); background: var(--brand-soft); color: var(--brand); font-weight: 600; }
.check-list { margin: 6px 0; padding-left: 4px; font-size: 13px; color: var(--ink-2); }
.check-list li { padding: 3px 0; list-style: none; }
.scan-result { background: var(--panel-2, #f7f8fa); border-radius: var(--r); padding: 10px 12px; }

/* ---------- 弹窗滚动锁：html 一起锁，避免iOS/安卓拖动整页（位置固定已在上方声明，这里兜底） ---------- */
html.modal-open, html.modal-open body { overflow: hidden; overscroll-behavior: none; }

/* ---------- 侧边栏分组（按门店类型 / 系统管理区分菜单） ---------- */
.nav-group {
  padding: 16px 14px 6px; font-size: 11.5px; font-weight: 700;
  color: var(--muted); letter-spacing: .06em;
}
.nav-item + .nav-group { border-top: 1px solid var(--line-2); }

/* ---------- 首页：新建异常工单大卡片 ---------- */
.ticket-cta {
  width: 100%; display: flex; align-items: center; gap: 14px; margin-bottom: 12px; padding: 16px;
  border: none; border-radius: var(--r-lg); text-align: left; cursor: pointer; font-family: inherit;
  background: var(--brand); color: #fff;
  box-shadow: none;
  transition: filter .15s;
}
.ticket-cta:active { filter: brightness(1.06); }
.ticket-cta .cta-ic {
  width: 48px; height: 48px; border-radius: 14px; flex-shrink: 0;
  background: rgba(255, 255, 255, .18); display: flex; align-items: center; justify-content: center; font-size: 24px;
}
.ticket-cta .cta-meta { flex: 1; min-width: 0; }
.ticket-cta .cta-t { font-size: 16.5px; font-weight: 700; }
.ticket-cta .cta-s { font-size: 12.5px; opacity: .88; margin-top: 3px; }
.ticket-cta .cta-go {
  width: 34px; height: 34px; border-radius: 50%; flex-shrink: 0; font-size: 20px; line-height: 1;
  background: rgba(255, 255, 255, .22); display: flex; align-items: center; justify-content: center;
}

/* ---------- 首页：全部功能卡片网格 ---------- */
.entry-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 10px; }
.entry-card-sm {
  flex-direction: column; align-items: center; gap: 8px; padding: 14px 8px; text-align: center;
  border-radius: var(--r); position: relative;
}
.entry-card-sm .entry-ic { width: 42px; height: 42px; font-size: 20px; margin: 0; }
.entry-card-sm .entry-t { font-size: 12.5px; font-weight: 600; line-height: 1.3; }
.entry-card-sm .nav-badge { top: -6px; right: -6px; }

/* ---------- 处理进度条（工单分类 / 列表 / 详情） ---------- */
.progress-line {
  display: flex; align-items: center; gap: 8px; margin-top: 6px;
  height: 14px; background: var(--line-2); border-radius: 8px; overflow: hidden; position: relative;
}
.progress-bar { height: 100%; border-radius: 8px; background: var(--brand); transition: width .3s; }
.progress-num { position: absolute; right: 8px; font-size: 10px; font-weight: 700; color: var(--ink-2); }
.progress-num-inline { margin-left: 8px; font-size: 12px; color: var(--muted); }
.home-row-link { cursor: pointer; }
.home-row-link:active { background: var(--bg); }

/* ---------- 工单详情：商品明细折叠 ---------- */
.lines-collapse { margin: 8px 0 4px; }
.lines-collapse > summary {
  cursor: pointer; font-size: 13px; font-weight: 600; color: var(--brand);
  padding: 10px 12px; background: var(--panel-2, #f7f8fa); border-radius: var(--r); list-style: none;
}
.lines-collapse > summary::-webkit-details-marker { display: none; }
.lines-collapse > summary::before { content: '▸ '; }
.lines-collapse[open] > summary::before { content: '▾ '; }
.lines-collapse > .panel { margin-top: 8px; }

/* ---------- 加入清单主按钮（新建工单） ---------- */
.btn-block { width: 100%; }
.btn-add-line { margin-top: 4px; padding: 12px; font-size: 14.5px; font-weight: 700; }

/* 手机端底部导航不显示分组标题（侧边栏分组只在电脑端可见） */
@media (max-width: 760px) {
  .nav-group { display: none !important; }
  .ticket-cta { padding: 14px; }
  .ticket-cta .cta-t { font-size: 15.5px; }
}

/* ---------- 出库单录入器（出库单版块） ---------- */
.ob-composer { display: flex; flex-direction: column; gap: 10px; }
.ob-current { background: #f7f9fc; border: 1px solid #e6ebf2; border-radius: 12px; padding: 12px; display: flex; flex-direction: column; gap: 10px; }
.ob-goods-list { margin-top: 6px; }
.ob-goods-list .table-cards { margin: 0; }
.ob-confirm-row { gap: 16px; flex-wrap: wrap; }
.ob-ocr { margin-top: 4px; }
.ob-orders-list { display: flex; flex-direction: column; gap: 8px; }
.ob-card { background: #fff; border: 1px solid #e6ebf2; border-radius: 10px; padding: 10px 12px; }
.ob-card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; font-size: 14px; }
.ob-card-head .cell-sub { font-size: 12px; color: #6b7a90; margin-top: 2px; }
.ob-card-goods { margin: 8px 0 4px; display: flex; flex-wrap: wrap; gap: 6px; }
.ob-chip { background: #eef3fb; border: 1px solid #dde6f3; border-radius: 999px; padding: 3px 9px; font-size: 12.5px; color: #2a3a52; }
.ob-card-flags { font-size: 13px; color: #44566f; display: flex; gap: 16px; flex-wrap: wrap; }
.ob-card-flags .check-line { margin: 0; }
.ob-ocr-goods .table-cards { margin: 0 0 6px; }
.ob-ocr-goods input { width: 100%; box-sizing: border-box; }
#ob-sec .rno-row { background: #fff; }
#ob-sec .rno-fix, #ob-sec .rno-dash { background: #eef3fb; }
.ob-upload { margin-top: 4px; padding: 10px; border: 1px dashed #cfe0f3; border-radius: 10px; background: #f7fbff; }
.ob-upload-title { font-size: 12.5px; font-weight: 600; color: #3a5c82; margin-bottom: 8px; }
.ob-upload .btn-block { margin-bottom: 8px; }
.ob-upload .field-note { margin: 2px 0 0; }
.ob-upload .btn-link { padding: 0; margin-top: 2px; }

/* ---------- 首页未完成工单：折叠展示 ---------- */
.ticket-col-row { border: 1px solid var(--line-2); border-radius: var(--r); background: #fff; margin-bottom: 8px; overflow: hidden; }
.row-top { display: flex; align-items: center; gap: 10px; padding: 10px 11px; cursor: pointer; user-select: none; }
.row-top:active { background: var(--bg); }
.row-top .ic { font-size: 17px; flex-shrink: 0; }
.row-top .meta { flex: 1; min-width: 0; }
.row-top .meta .t { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: flex; align-items: center; gap: 6px; }
.chev { display: inline-block; color: var(--muted); transition: transform .2s ease; font-size: 11px; }
.chev.open { transform: rotate(90deg); }
.row-detail { padding: 0 11px 11px; border-top: 1px solid var(--line-2); }
.row-detail .s { color: var(--muted); font-size: 12px; line-height: 1.5; padding: 9px 0 6px; }
.row-detail .progress-line { margin: 4px 0 8px; }
.row-detail .btn-sm { flex-shrink: 0; }

/* ---------- 首页工单：按类型折叠 ---------- */
.ticket-type-block .type-head { cursor: pointer; user-select: none; }
.ticket-type-block .type-head:active { background: var(--bg); }
.home-head .chev { flex-shrink: 0; }
.home-row .progress-line { margin: 6px 0 0; }
.ob-tip { background: #eaf7ee; border: 1px solid #c8e6d0; color: #2f6b41; border-radius: 8px; padding: 8px 10px; font-size: 12.5px; line-height: 1.5; margin-bottom: 8px; }
/* 工单纠错（修改内容 / 回退步骤） */
.fx-line-box { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; margin-bottom: 10px; background: var(--card); }
.fx-line-t { font-weight: 600; font-size: 13px; margin-bottom: 8px; color: var(--text); }
#modal-body .ticket-actions { flex-wrap: wrap; gap: 8px; }
#modal-body .ticket-actions .btn-sm, #modal-body .ticket-actions .btn-ghost.btn-sm { margin: 0; }

/* =====================================================================
   视觉统一层（Design System，放在最后以统一覆盖前面的零散规则）
   原则：留白分区 + 细描边 + 轻阴影；圆角 12/8/6；间距走 4/8/12/16/24；
        字号收敛为 12 / 13.5 / 15 / 17 / 22；状态色只承载语义。
   ===================================================================== */

/* 1. 基础：触控反馈、数字等宽、字号基线 */
button, [role="button"], .nav-item, .home-row, .ticket-card, .msg-item, .entry-card, .stat-link {
  -webkit-tap-highlight-color: transparent;
}
.num, .stat .num, .pf-card-v, .bd-stat b, .ob-card-head b,
td[data-label="金额"], td[data-label="小计"], td[data-label="采购价"], td[data-label="数量"], td[data-label="差异"] {
  font-variant-numeric: tabular-nums;
}

/* 2. 卡片 / 面板：统一描边 + 圆角 + 极轻阴影（不靠阴影分区） */
.panel, .stat, .home-block, .ticket-card, .msg-item, .review-card, .contact-group,
.entry-card, .reminder-item, .ap-card, .ap-panel, .bd-card, .ob-card, .acct-card,
.ticket-col-row, .fx-line-box, .lines-collapse > .panel {
  border: 1px solid var(--line);
  border-radius: var(--r);
  box-shadow: var(--shadow-1);
}
.home-block { padding: 14px; margin-bottom: 12px; }
.home-head { margin-bottom: 12px; }
.home-head h3 { font-size: 14px; font-weight: 600; color: var(--ink); }
.home-head .cnt { background: var(--brand-soft); color: var(--brand); border-radius: 9px; font-size: 11.5px; padding: 2px 8px; }
.home-row { border-color: var(--line-2); background: #fff; border-radius: var(--r-ctl); padding: 11px 12px; }
.home-row .meta .t { font-size: 14px; }
.home-row .meta .s { font-size: 12.5px; }
.stat { padding: 16px; }
.stat .num { font-size: 26px; letter-spacing: -.4px; }
.stat .lbl { font-size: 12.5px; }

/* 3. 按钮层级：主按钮唯一 / 次按钮描边 / 危险按钮弱填充 */
.btn {
  min-height: 36px; padding: 0 16px; border-radius: var(--r-ctl);
  background: var(--brand); border: 1px solid var(--brand); color: #fff;
  font-size: 14px; font-weight: 600; box-shadow: none;
}
.btn:hover { background: var(--brand-2); border-color: var(--brand-2); filter: none; }
.btn:active { background: var(--brand-3); border-color: var(--brand-3); }
.btn-ghost {
  min-height: 36px; padding: 0 14px; border-radius: var(--r-ctl);
  border: 1px solid var(--line); background: #fff; color: var(--ink-2); font-size: 14px; font-weight: 500;
}
.btn-ghost:hover { color: var(--brand); border-color: var(--brand-2); background: #fff; }
.btn-ghost:active { background: var(--brand-soft); }
.btn-danger {
  background: #fff; border: 1px solid #f3c9c9; color: var(--danger); font-weight: 500; box-shadow: none;
}
.btn-danger:hover { background: var(--danger-soft); border-color: #ecb3b3; filter: none; }
.btn-sm { min-height: 30px; padding: 0 10px; font-size: 12.5px; border-radius: var(--r-sm); }
.btn[disabled], .btn-ghost[disabled], .btn-danger[disabled] { opacity: .5; }

/* 4. 表单控件：统一圆角 / 边框 / 聚焦态（聚焦用主色描边 + 3px 光环） */
input[type="text"], input[type="password"], input[type="number"], input[type="date"],
input[type="datetime-local"], input[type="time"], input[type="month"], input[type="tel"],
input[type="email"], input[type="search"], input[type="url"], select, textarea {
  border: 1px solid var(--line); border-radius: var(--r-ctl); background: #fff; color: var(--ink);
}
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(22, 119, 255, .12);
}
.field label { font-size: 13px; color: var(--ink-2); font-weight: 500; }
.field input, .field select, .field textarea { padding: 9px 12px; }
.field .preview { color: var(--brand); font-size: 12.5px; }
.hint, .field-note { font-size: 12.5px; color: var(--muted); line-height: 1.6; }
.af-field { margin-bottom: 16px; }
.af-label { font-size: 13px; color: var(--ink-2); font-weight: 500; }

/* 5. 表格：表头浅底弱字，正文 13.5，行分隔用弱线 */
th {
  background: #f7f9fc; color: var(--ink-2); font-size: 12px; font-weight: 600;
  padding: 11px 14px; border-bottom: 1px solid var(--line); white-space: nowrap;
}
td { padding: 12px 14px; font-size: 13.5px; border-bottom: 1px solid var(--line-2); }
tbody tr:hover { background: #fafbfe; }
.cell-main { font-size: 14px; }

/* 6. 状态标签：统一「浅底 + 深字」，12px，圆角 6 */
.badge { font-size: 12px; padding: 2px 8px; border-radius: var(--r-sm); font-weight: 600; line-height: 1.7; }
.badge.normal, .badge.ok, .badge.done, .badge.handled, .badge.storetype-online { background: var(--ok-soft); color: #0f7a45; }
.badge.warning, .badge.warn, .badge.pending { background: var(--warn-soft); color: #a26a00; }
.badge.urgent, .badge.danger, .badge.expired, .badge.rejected { background: var(--danger-soft); color: #b3261e; }
.badge.info, .badge.multi, .badge.role-admin { background: #e8f2ff; color: #0b57c7; }
.badge.void, .badge.memo, .badge.snoozed, .badge.role-staff, .badge.storetype-conv { background: #f2f5f9; color: #5c6675; }
.badge.role-super, .badge.purchase { background: #f0ecff; color: #5a3ad6; }
.badge.role-manager { background: var(--brand-soft); color: var(--brand); }

/* 7. 顶栏与导航：弱化装饰，靠细线分区；激活态用主色 */
.topbar { height: 56px; background: #fff; border-bottom: 1px solid var(--line); padding: 0 20px; }
.topbar-title { font-size: 17px; font-weight: 600; letter-spacing: 0; }
.sidebar { background: #fff; }
.nav-item { border-radius: var(--r-ctl); font-size: 13.5px; padding: 10px 12px; }
.nav-item:hover { background: #f5f7fa; color: var(--ink); }
.nav-item.active { background: var(--brand-soft); color: var(--brand); }
.nav-group { color: var(--muted); font-size: 11.5px; letter-spacing: .06em; }
.sidebar-head .title { font-size: 15px; font-weight: 700; }

/* 8. 弹窗 / 抽屉 */
.modal { border-radius: var(--r-lg); box-shadow: 0 12px 40px rgba(16, 24, 40, .16); }
.modal-head { padding: 16px 18px; font-size: 16px; font-weight: 600; border-bottom: 1px solid var(--line-2); }
.modal-body { padding: 16px 18px; }
.modal-foot { padding: 12px 18px; gap: 10px; border-top: 1px solid var(--line-2); }
.sub-title { font-size: 13.5px; color: var(--ink-2); font-weight: 600; margin: 18px 0 10px; }

/* 9. 空状态 / 提示 / 时间线 / 步骤条 */
.empty {
  padding: 28px 20px; font-size: 13px; color: var(--muted);
  border: 1px dashed var(--line); border-radius: var(--r); background: #fff;
}
.ticket-info { background: #f7f9fc; border-radius: var(--r-ctl); padding: 12px 14px; }
.ticket-info > div { font-size: 13.5px; padding: 4px 0; }
.ticket-info > div > span { width: 68px; color: var(--muted); font-size: 12.5px; }
.tl-dot { width: 8px; height: 8px; margin-top: 6px; }
.step-label { font-size: 12px; }
.toast { background: #1f2733; border-radius: 10px; font-size: 13.5px; padding: 11px 18px; }

/* 10. 首页入口 / 快捷按钮 */
.entry-card, .quick-btn, .scan-choice-btn, .acct-action, .ob-current {
  border-radius: var(--r); box-shadow: var(--shadow-1);
}
.entry-ic { border-radius: var(--r-ctl); }
.ticket-cta { border-radius: var(--r); box-shadow: none; }
.quick-btn, .scan-choice-btn { border-color: var(--line); }
.section-head h2 { font-size: 17px; font-weight: 600; }

/* =====================================================================
   移动端：触控优先（点按目标 ≥ 44px，表单 ≥ 44px 防 iOS 聚焦缩放）
   ===================================================================== */
@media (max-width: 760px) {
  .content { padding: 12px 12px calc(24px + var(--nav-h)); }
  .topbar { height: 52px; padding: 0 14px; }
  .topbar-title { font-size: 16.5px; }

  /* 按钮：主操作够大、够好点 */
  .btn, .btn-ghost, .btn-danger, .quick-btn, .scan-cta {
    min-height: 44px; padding: 0 16px; font-size: 14.5px; border-radius: 10px;
  }
  .btn-sm { min-height: 34px; padding: 0 12px; font-size: 13px; border-radius: var(--r-sm); }
  .modal-foot .btn, .modal-foot .btn-ghost, .modal-foot .btn-danger { min-height: 44px; }

  /* 表单：统一 44px + 16px 字号（16px 可防止 iOS 聚焦时页面自动放大） */
  input[type="text"], input[type="password"], input[type="number"], input[type="date"],
  input[type="datetime-local"], input[type="time"], input[type="month"], input[type="tel"],
  input[type="email"], input[type="search"], input[type="url"], select, textarea {
    min-height: 44px; font-size: 16px; padding: 10px 12px;
  }
  .field input, .field select, .field textarea { min-height: 44px; }
  .copy-ic { width: 32px; height: 32px; }

  /* 底部导航：加大点击区，激活态更明确 */
  .sidebar nav { padding: 6px 4px; }
  .nav-item { min-height: 50px; padding: 7px 2px 6px; font-size: 11px; border-radius: 10px; }
  .nav-item .ic { font-size: 21px; }
  .nav-item.active { background: var(--brand-soft); }
  .nav-item.active .ic { transform: none; }
  .nav-item.active::after {
    content: ''; position: absolute; left: 50%; top: 2px; transform: translateX(-50%);
    width: 18px; height: 3px; border-radius: 2px; background: var(--brand);
  }

  /* 列表行：加大内边距，手指更好点 */
  .home-row { padding: 12px; }
  .msg-item, .review-card, .ticket-card, .reminder-item { padding: 13px 14px; }
  .stat { padding: 14px; }
  .stat .num { font-size: 23px; }

  /* 弹窗抽屉 */
  .modal { border-radius: 16px 16px 0 0; max-height: 90dvh; }
  .modal-head { padding: 18px 16px 12px; }
  .modal-body { padding: 14px 16px; }
  .modal-foot { padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); }

  /* 表格转卡片：卡片化后统一圆角与间距 */
  table.table-cards tr { border-radius: var(--r); margin-bottom: 10px; border-color: var(--line); }
  table.table-cards td { padding: 6px 14px; font-size: 13.5px; }
  .empty { padding: 24px 16px; }
}


/* ---------- 电脑端弹窗加宽（工单详情 / 纠错：商品明细表列多，460px 会把「操作」列裁掉） ---------- */
@media (min-width: 761px) {
  .modal { width: min(620px, 92vw); max-height: 90vh; }
  /* 宽弹窗：工单详情、纠错、出库单详情（openModal 第 4 参 { wide: true }） */
  .modal.modal-wide { width: min(1000px, 94vw); }
  .modal-body { padding: 18px 20px; }
  /* 弹窗里的表格允许横向滚动：.panel 默认 overflow:hidden，窄屏/窄弹窗下右侧列会被直接裁掉看不见 */
  #modal-body .panel { overflow-x: auto; }
  /* 操作列按钮不换行，列不够宽时靠上面的横向滚动查看 */
  #modal-body td.row-actions { white-space: nowrap; }
}
@media (min-width: 1500px) {
  .modal.modal-wide { width: min(1180px, 94vw); }
}
/* 电脑端内容区表格兜底：列多时允许横向滚动，别把右侧「操作」按钮裁掉 */
@media (min-width: 761px) {
  .content .panel:has(table) { overflow-x: auto; }
}

/* ---------- 报损：核对到账勾选行 + 三段式单号窄屏适配 ---------- */
.chk-line { display: flex; align-items: center; gap: 8px; min-height: 44px; padding: 6px 0; font-size: 13.5px; color: var(--ink); cursor: pointer; }
.chk-line input[type="checkbox"] { width: 20px; height: 20px; flex: none; accent-color: var(--brand); }
/* 手机窄屏（≤420px）：三段式单号压缩间距，保证 BS-日期-流水号 三段都完整可见不截断 */
@media (max-width: 420px) {
  .rno-row { gap: 4px; }
  .rno-row .rno-fix { min-width: 38px; padding: 9px 5px; font-size: 13px; }
  .rno-row .rno-dash { font-size: 13px; }
  .rno-row input { padding: 9px 6px; font-size: 14px; }
}

/* ---------- 工单批量操作（勾选 + 底部操作条） ---------- */
.ticket-card.pickable { position: relative; padding-left: 48px; }
.ticket-card.picked { border-color: var(--brand); background: var(--brand-soft); }
.tk-pick {
  position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
  width: 32px; height: 32px; display: flex; align-items: center; justify-content: center;
}
.tk-pick input { width: 22px; height: 22px; accent-color: var(--brand); cursor: pointer; }
.batch-top { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 12px; }
.batch-bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 45;
  background: rgba(255, 255, 255, .98); border-top: 1px solid var(--line);
  box-shadow: 0 -2px 12px rgba(16, 24, 40, .07);
  padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
}
.batch-bar .bb-info { font-size: 13px; color: var(--ink-2); }
.batch-bar .bb-info b { color: var(--brand); font-size: 16px; }
.batch-bar .bb-btns { display: flex; gap: 8px; flex-wrap: wrap; margin-left: auto; }
.batch-bar-space { height: 74px; }
.batch-list { max-height: 40vh; overflow: auto; border: 1px solid var(--line); border-radius: var(--r-ctl); margin: 8px 0 4px; }
.batch-li { padding: 8px 10px; border-bottom: 1px solid var(--line-2); display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 13px; }
.batch-li:last-child { border-bottom: none; }
@media (max-width: 760px) {
  .batch-bar { bottom: calc(var(--nav-h, 58px) + env(safe-area-inset-bottom)); }
  .batch-bar .bb-btns { width: 100%; margin-left: 0; }
  .batch-bar .bb-btns .btn, .batch-bar .bb-btns .btn-ghost { flex: 1 1 auto; }
}
/* 批量操作后：刚处理过的工单短暂高亮，避免「提示成功但页面看着没变化」 */
.ticket-card.flash { animation: tk-flash 2.4s ease; }
@keyframes tk-flash {
  0%, 55% { box-shadow: 0 0 0 2px var(--brand); border-color: var(--brand); }
  100% { box-shadow: none; }
}

/* ---------- 利润核算：自定义银行卡（名称 + 余额，可多张） ---------- */
.bank-row { display: flex; gap: 8px; align-items: center; margin-bottom: 8px; }
.bank-row .bk-name { flex: 1 1 auto; min-width: 0; }
.bank-row .bk-bal { flex: 0 0 110px; width: 110px; }
.bank-row .bk-del { flex: none; }
#pf-e-bank-add { margin-top: 2px; }
@media (max-width: 420px) {
  .bank-row { gap: 6px; }
  .bank-row .bk-bal { flex: 0 0 96px; width: 96px; }
}
