/* ============================================================
   日报系统 · B端管理后台样式 —— UI 改版 v2（2026-09-26）
   ============================================================
   设计依据：artifacts/B端UI改版设计稿_2026-09-26.html
   核心原则：与小程序 syz/app.wxss 共用同一份语义令牌（名称/值/语义一字不差）。
            改品牌色只需改两处，再跑 verify_web_styles.py 校验。

   ⚠ 27 个语义令牌必须与 syz/app.wxss 的 page{} 完全一致 ——
      verify_web_styles.py 会解析两端令牌块逐项比对，漂移即失败。
   ⚠ --sh-1 / --sh-2 / --overlay 是**颜色值**（不是完整 box-shadow），
      与小程序保持一致；用的时候自己拼 box-shadow: 0 8px 24px var(--sh-1)。
   ⚠ 禁止再出现硬编码品牌色。中性透明度 rgba(255,255,255,.x) / rgba(0,0,0,.x)
      是允许的（见脚本白名单），有色彩倾向的 hex 一律走令牌。

   收敛口径：字号 10 档 → 8 档（11/12/14/16/18/20/24/30）
            圆角 5 档 → 4 档（6/8/12/999）
            令牌 13 个 → 27 语义 + 3 桌面布局

   v3「暖桃草绿」(2026-09-27)：主色 松青 → 草绿 #506e55；墨阶/面/线整体转暖；
             新增 --brand-accent 蜜桃粉 —— 参考图「绿底桃字」的原始手法，
             ⚠ 只用于**深底上的品牌强调**；与 --warn 色相仅差 5°，绝不作状态色。
   v4「墨绿商务」(2026-09-29)：主色 草绿 → 高饱和墨绿 #097144（S 15.8%→85.2%）；
             墨阶/面/线转中性（去暖黄）；accent 蜜桃粉 → 浅绿 #bfe3cf；
             --ok 改青推 #097163。选色依据见 开发变更日志.md §78。
   v5「商务蓝棕」(2026-09-29)：业主参考图 —— 深海藏青 #2c3e50 / 浅砂杏 #e6b388 /
             柔和米白 #f8f5f0。主色 → #2c3e50（白字 10.98:1）；面/线跟米白；
             accent → 参考图杏色 #e6b388；--ok 青推回**正绿** #0e7048（主色已离绿区）。
             选色依据见 开发变更日志.md §79。
   ⚠ --brand 白字 10.98:1 / 白72% 6.59 / 白60% 5.13 —— 可作大面底色（v4 限制已解除）。
   ============================================================ */

:root {
  /* ── 墨阶：结构色，承担全部文字层次 ── */
  --ink:          #1d2229;
  --ink-2:        #4d545d;
  --ink-3:        #666e76;
  --ink-x:        #a3a9b0;
  /* ── 面与线 ── */
  --paper:        #f8f5f0;
  --surface:      #ffffff;
  --surface-2:    #f2efe9;
  --rule:         #e8e3d9;
  --rule-2:       #d9d2c5;
  /* ── 品牌 ── */
  --brand:        #2c3e50;
  --brand-ink:    #1f2b38;
  --brand-strong: #22303f;
  --brand-tint:   #e8edf3;
  --brand-line:   #c3ceda;
  --brand-accent: #e6b388;
  /* ── 语义 ── */
  --ok:           #0e7048;
  --ok-bg:        #e6f2eb;
  --warn:         #b03a0a;
  --warn-bg:      #fdeee7;
  --danger:       #c4322a;
  --danger-bg:    #fdeceb;
  --info:         #1b5bc4;
  --info-bg:      #eaf1fd;
  /* ── 投影 ── */
  --sh-1:         rgba(31,43,56,0.06);
  --sh-2:         rgba(44,62,80,0.34);
  --overlay:      rgba(31,43,56,0.48);
  /* ── 数字字体栈（等宽表数） ── */
  --font-num:     'DIN Alternate','SF Mono',ui-monospace,'Roboto Mono',Menlo,Consolas,monospace;

  /* ── 桌面布局令牌（B端专属，不属语义层，不进两端比对） ── */
  --sidebar-w:    232px;
  --topbar-h:     56px;
  --row-h:        48px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--paper);
  color: var(--ink-2);
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
b, strong { color: var(--ink); font-weight: 600; }
a { color: var(--brand-strong); text-decoration: none; }
a:hover { text-decoration: underline; }

/* 等宽数字（表格 / KPI / 时间）：右对齐由 .num 承担 */
.num, .mono {
  font-family: var(--font-num);
  font-variant-numeric: tabular-nums;
}
.num { text-align: right; }

/* 键盘可达的焦点环（不动 input/select/textarea，它们有自己的聚焦样式） */
.btn:focus-visible,
.nav-item:focus-visible,
.modal-close:focus-visible,
.tab:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* ============================================================
   登录页 —— 左右分栏：左深松青品牌块 + 右白表单
   ============================================================ */
.login-wrap { display: flex; height: 100vh; }
.login-brand {
  width: 420px; flex-shrink: 0; background: var(--brand-ink); color: #fff;
  padding: 48px 44px; display: flex; flex-direction: column; justify-content: space-between;
}
.login-brand .lb-name { font-size: 24px; font-weight: 700; letter-spacing: .5px; line-height: 1.3; }
.login-brand .lb-sub { font-size: 14px; color: var(--brand-accent); margin-top: 8px; }
.login-brand .lb-facts { font-size: 12px; color: rgba(255,255,255,.60); line-height: 2; }
.login-brand .lb-facts b { color: #fff; font-weight: 600; }

.login-panel { flex: 1; display: flex; align-items: center; justify-content: center; padding: 40px; background: var(--paper); }
.login-card { width: 340px; }
.login-title { font-size: 20px; font-weight: 700; color: var(--ink); }
.login-sub { font-size: 12px; color: var(--ink-3); margin: 6px 0 28px; }
.login-hint { min-height: 20px; color: var(--danger); font-size: 12px; margin-top: 12px; line-height: 1.6; }
@media (max-width: 900px) { .login-brand { display: none; } }

/* ============================================================
   布局：侧栏（白底墨字）+ 顶栏 + 内容
   ============================================================ */
.app-layout { display: flex; height: 100vh; }

.sidebar {
  width: var(--sidebar-w); background: var(--surface);
  border-right: 1px solid var(--rule);
  display: flex; flex-direction: column; flex-shrink: 0;
}
.brand {
  height: var(--topbar-h); flex-shrink: 0;
  display: flex; align-items: center; gap: 10px; padding: 0 20px;
  font-size: 16px; font-weight: 700; color: var(--ink); letter-spacing: .2px;
  border-bottom: 1px solid var(--rule);
}
.brand::before {
  content: ''; width: 22px; height: 22px; border-radius: 6px; flex-shrink: 0;
  /* 品牌标记：商娱座 logo 的图形 mark（与标签页 favicon 同源图，保证两端一致）。
     var(--brand) 作底色兜底 —— 图片加载失败时仍是一个品牌色方块，不会「塌成空白」。 */
  background: var(--brand) url('../logo-mark.png') center/cover no-repeat;
  box-shadow: 0 2px 6px var(--sh-2);
}
.nav { flex: 1; overflow-y: auto; padding: 12px; }
.nav-item {
  position: relative; display: flex; align-items: center; gap: 10px;
  height: 40px; padding: 0 12px; margin-bottom: 2px; border-radius: 8px;
  color: var(--ink-2); font-size: 14px; cursor: pointer; text-decoration: none;
  transition: background .15s, color .15s;
}
.nav-item:hover, .nav-item:focus { background: var(--surface-2); color: var(--ink); text-decoration: none; }
.nav-item.active { background: var(--brand-tint); color: var(--brand-strong); font-weight: 600; }
.nav-item.active::before {
  content: ''; position: absolute; left: 0; top: 9px; bottom: 9px;
  width: 2px; border-radius: 2px; background: var(--brand);
}
.nav-ico {
  width: 16px; height: 16px; flex-shrink: 0;
  fill: none; stroke: currentColor;
  stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round;
}
.nav-badge {
  margin-left: auto; min-width: 18px; height: 18px; padding: 0 5px;
  border-radius: 6px; background: var(--danger); color: #fff;
  font-family: var(--font-num); font-size: 11px; font-weight: 600;
  line-height: 18px; text-align: center;
}
.sidebar-foot {
  flex-shrink: 0; margin: 12px; padding: 10px 12px; border-radius: 8px;
  background: var(--surface-2); font-size: 12px; color: var(--ink-3);
  line-height: 1.8; overflow: hidden; text-overflow: ellipsis;
}

.main { flex: 1; display: flex; flex-direction: column; overflow: hidden; min-width: 0; }
.topbar {
  height: var(--topbar-h); flex-shrink: 0;
  background: var(--surface); border-bottom: 1px solid var(--rule);
  display: flex; align-items: center; justify-content: space-between; padding: 0 24px;
}
.topbar-title { font-size: 18px; font-weight: 600; color: var(--ink); letter-spacing: .2px; }
.topbar-actions { display: flex; align-items: center; gap: 12px; }
.topbar-user { color: var(--ink-3); font-size: 12px; }
.content { flex: 1; overflow-y: auto; padding: 24px; }

/* ============================================================
   面板与卡片 —— 描边替投影（与小程序卡片同源）
   ============================================================ */
.panel {
  background: var(--surface); border: 1px solid var(--rule); border-radius: 12px;
  padding: 20px; margin-bottom: 20px;
}
.panel:last-child { margin-bottom: 0; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 8px; flex-wrap: wrap; }
.panel-title { font-size: 16px; font-weight: 600; color: var(--ink); }
.panel-note { font-size: 12px; color: var(--ink-3); line-height: 1.7; margin-bottom: 14px; }
.panel-note b { color: var(--ink-2); }
.panel-toolbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

/* ============================================================
   角色管理（只读说明页）—— 说明横幅 / 角色卡 / 权限矩阵
   ============================================================ */
.panel-body { padding: 14px 16px; }

.notice-box {
  padding: 10px 12px; margin-bottom: 14px;
  border: 1px solid var(--rule); border-left: 3px solid var(--brand);
  border-radius: 6px; background: var(--surface-2);
  font-size: 13px; line-height: 1.75; color: var(--ink-2);
}
.notice-box b { color: var(--ink-1); }

.role-cards {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px;
}
.role-card {
  border: 1px solid var(--rule); border-radius: 8px;
  background: var(--surface); padding: 12px 14px;
}
.rc-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 6px; }
.rc-name { font-size: 15px; font-weight: 600; color: var(--ink-1); }
.rc-sum { font-size: 13px; line-height: 1.7; color: var(--ink-2); }
.rc-note {
  margin-top: 6px; font-size: 12px; line-height: 1.6; color: var(--ink-3);
  padding-left: 8px; border-left: 2px solid var(--rule);
}
.rc-perms { margin-top: 8px; display: flex; flex-wrap: wrap; gap: 4px; }
.perm-tag {
  font-size: 11px; line-height: 1.5; padding: 1px 7px; border-radius: 10px;
  background: var(--surface-2); color: var(--ink-2); border: 1px solid var(--rule);
  white-space: nowrap;
}
.perm-tag.perm-more { color: var(--ink-3); }
.rc-foot {
  margin-top: 10px; padding-top: 8px; border-top: 1px solid var(--rule);
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  flex-wrap: wrap;
}

/* 权限勾选区（角色新建/编辑弹窗） */
.perm-picker {
  border: 1px solid var(--rule); border-radius: 6px;
  max-height: 320px; overflow-y: auto; overflow-x: hidden;
  background: var(--surface);
}
.perm-group { padding: 8px 10px; border-bottom: 1px solid var(--rule); }
.perm-group:last-child { border-bottom: none; }
.perm-group-title {
  font-size: 12px; font-weight: 600; color: var(--ink-3);
  margin-bottom: 5px; letter-spacing: .04em;
}
/* ⚠ 用 grid 而不是 flex：`.switch-check` 自带 `white-space: nowrap`，
   flex 布局下长描述文本会把复选框和名称挤到两列（真机/窄屏尤其明显）。
   grid 固定三列：勾选框 | 名称 | 说明，说明列可换行、不会横向溢出。 */
.perm-item {
  display: grid !important;
  grid-template-columns: 16px max-content 1fr;
  align-items: start;
  gap: 8px;
  padding: 4px 0;
  white-space: normal !important;
  cursor: pointer;
}
.perm-item input {
  width: 15px; height: 15px; margin: 2px 0 0; padding: 0;
  cursor: pointer; accent-color: var(--brand); flex: none;
}
.perm-item > span:nth-of-type(1) {
  font-size: 13px; color: var(--ink-1); line-height: 1.5; white-space: normal;
}
.perm-desc {
  font-size: 12px; color: var(--ink-3) !important;
  line-height: 1.5; white-space: normal;
}

/* 权限矩阵：自定义角色的单元格可勾选 */
/* 权限矩阵：角色多了会横向放不下 —— 首列（能力）与表头固定，容器可横向+纵向滚动 */
.matrix-wrap {
  overflow: auto;
  max-height: 66vh;
  border: 1px solid var(--rule);
  border-radius: 6px;
  background: var(--surface);
}
table.matrix {
  font-size: 13px;
  /* sticky 定位需要 separate（collapse 下边框会跟着一起滚） */
  border-collapse: separate;
  border-spacing: 0;
  min-width: max-content;   /* 列不被压扁，横向滚动由容器接管 */
}
table.matrix thead th {
  position: sticky; top: 0; z-index: 2;
  background: var(--surface-2);
  height: 44px; vertical-align: bottom;
}
table.matrix th.cap-col, table.matrix td.cap-col {
  text-align: left; min-width: 260px; max-width: 340px;
  color: var(--ink); font-weight: 500;
  /* 首列固定：横向滚动时始终看得见「这一行是什么能力」 */
  position: sticky; left: 0; z-index: 3;
  background: var(--surface);
  box-shadow: 1px 0 0 var(--rule);
}
table.matrix thead th.cap-col { z-index: 4; background: var(--surface-2); }
table.matrix td { background: var(--surface); }
table.matrix tbody tr:hover td { background: var(--surface-2); }
table.matrix tbody tr:hover td.cap-col { background: var(--surface-2); }
table.matrix tr.mx-dirty td { background: var(--brand-tint); }
table.matrix tr.mx-dirty td.cap-col { background: var(--brand-tint); }
table.matrix td.mx-cell { text-align: center; min-width: 96px; }
table.matrix input.mx-perm {
  width: 15px; height: 15px; margin: 0; cursor: pointer; accent-color: var(--brand);
}
table.matrix input.mx-perm:disabled { cursor: not-allowed; opacity: .55; }
table.matrix .mx-locked { color: var(--ink-3); }
table.matrix .mx-role-sub {
  display: block; font-size: 11px; font-weight: 400; color: var(--ink-3); letter-spacing: 0;
}
table.matrix .mx-empty { padding: 24px; text-align: center; color: var(--ink-3); }

/* 工具条里的小号输入框 / 下拉（回收站筛选用） */
.input-sm {
  height: 30px; padding: 0 8px; font-size: 13px;
  border: 1px solid var(--rule); border-radius: 6px;
  background: var(--surface); color: var(--ink-1);
  min-width: 120px;
}
.input-sm:focus { outline: 2px solid var(--brand); outline-offset: 1px; }

/* 页头：标题 + 说明 + 主动作（全站 CRUD 统一模式） */
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 16px; flex-wrap: wrap; }
.page-head .ph-text { min-width: 0; }

/* ============================================================
   统计卡 —— 有主次的看板：需要行动的最大最靠左
   ============================================================ */
.stat-grid { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 20px; }
.stat-card {
  flex: 1 1 150px; background: var(--surface);
  border: 1px solid var(--rule); border-radius: 12px; padding: 16px 18px;
  cursor: pointer; transition: border-color .15s, background .15s;
}
.stat-card:hover { border-color: var(--brand-line); background: var(--brand-tint); }
.stat-card .kk { font-size: 12px; color: var(--ink-3); margin-bottom: 6px; letter-spacing: .2px; }
.stat-card .kv {
  font-family: var(--font-num); font-variant-numeric: tabular-nums;
  font-size: 30px; font-weight: 700; color: var(--ink); line-height: 1.15;
}
/* ⚠ ink-3 只在白底/页底达标（4.92 / 4.59）；一旦底色变浅品牌色 tint 即掉到 4.34，
   所以 hover 时把标签升到 brand-strong（在 tint 上 5.50）。 */
.stat-card:hover .kk { color: var(--brand-strong); }
/* 待处理项：更大、红底红描边（不靠红字单打独斗） */
.stat-card.hot { flex: 1.5 1 220px; border-color: var(--danger); background: var(--danger-bg); }
.stat-card.hot .kk { color: var(--danger); font-weight: 600; }
.stat-card.hot .kv { color: var(--danger); }
.stat-card.hot:hover { border-color: var(--danger); background: var(--danger-bg); }
.stat-card.idle .kv { color: var(--ink-3); }

/* ============================================================
   按钮 —— 3 变体 × 2 尺寸
   ============================================================ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 34px; padding: 0 14px;
  border: 1px solid transparent; border-radius: 8px;
  font-family: inherit; font-size: 14px; font-weight: 500; line-height: 1;
  cursor: pointer; white-space: nowrap; text-decoration: none;
  transition: background .15s, border-color .15s, color .15s, opacity .15s;
}
a.btn:hover { text-decoration: none; }
.btn:disabled { opacity: .5; cursor: not-allowed; pointer-events: none; }
.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-strong); }
.btn-ghost { background: var(--surface); color: var(--ink-2); border-color: var(--rule-2); }
.btn-ghost:hover { background: var(--surface-2); color: var(--ink); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { opacity: .88; }
/* 次要但危险（如「驳回」）：描边 + 危险文字，悬停才上红底 */
.btn-ghost.danger { color: var(--danger); }
.btn-ghost.danger:hover { background: var(--danger-bg); border-color: var(--danger); }
.btn-sm { height: 26px; padding: 0 10px; font-size: 12px; border-radius: 6px; gap: 4px; }
.btn-block { width: 100%; }

/* ============================================================
   表格 —— B端最重要的组件
   ============================================================ */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td {
  padding: 0 12px; text-align: left; border-bottom: 1px solid var(--rule);
  vertical-align: middle;
}
th {
  height: 40px; background: var(--surface-2); color: var(--ink-3);
  font-size: 12px; font-weight: 600; letter-spacing: .3px; white-space: nowrap;
}
td { height: var(--row-h); font-size: 14px; color: var(--ink-2); }
td > b, td > strong { color: var(--ink); }
tbody tr { transition: background .12s; }
tbody tr:hover td { background: var(--brand-tint); }
tbody tr:last-child td { border-bottom: none; }
.table-wrap table { font-size: 14px; }
/* 行内次要信息（如门店的展示名） */
.cell-sub { display: block; font-size: 12px; color: var(--ink-3); font-weight: 400; }
.cell-clip { max-width: 280px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-actions { display: flex; gap: 8px; align-items: center; flex-wrap: nowrap; }

/* 已软删除的用户行：整行灰化，操作列只留「彻底清除」。
   软删的行仍占着 id，靠这个视觉区分避免误认为「删除没生效」。 */
tbody tr.row-deleted td { color: var(--ink-3); background: var(--surface-2); }
tbody tr.row-deleted td b { font-weight: 500; }
tbody tr.row-deleted:hover td { background: var(--surface-2); }

/* 「显示已删除」开关（面板标题右侧，与新增按钮并排） */
.switch-check {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 13px; color: var(--ink-2); cursor: pointer; user-select: none; white-space: nowrap;
}
.switch-check input {
  width: 15px; height: 15px; margin: 0; cursor: pointer; accent-color: var(--brand);
}

/* ============================================================
   徽章 —— 5 语义，全部 ≥4.5:1
   ============================================================ */
.badge {
  display: inline-flex; align-items: center; height: 20px; padding: 0 8px;
  border-radius: 6px; font-size: 12px; font-weight: 500; line-height: 1;
  white-space: nowrap;
}
.badge-ok     { background: var(--ok-bg);        color: var(--ok); }
.badge-warn   { background: var(--warn-bg);      color: var(--warn); }
.badge-danger { background: var(--danger-bg);    color: var(--danger); }
.badge-info   { background: var(--info-bg);   color: var(--info); }
.badge-gray   { background: var(--surface-2);    color: var(--ink-2); }

/* ============================================================
   徽章组（门店的平台标签）
   ============================================================ */
.badge-group { display: inline-flex; gap: 4px; flex-wrap: wrap; }

/* ============================================================
   表单
   ============================================================ */
.form-row { margin-bottom: 16px; }
.form-row:last-child { margin-bottom: 0; }
.form-row label { display: block; font-size: 12px; color: var(--ink-3); font-weight: 500; margin-bottom: 6px; }
.form-row label.required::after { content: ' *'; color: var(--danger); }
.form-row input, .form-row select, .form-row textarea {
  width: 100%; height: 38px; padding: 0 12px;
  border: 1px solid var(--rule-2); border-radius: 8px;
  font-family: inherit; font-size: 14px; color: var(--ink); background: var(--surface);
  outline: none; transition: border-color .15s, box-shadow .15s;
}
.form-row textarea { height: auto; min-height: 80px; padding: 10px 12px; line-height: 1.6; resize: vertical; }
.form-row select { cursor: pointer; }
.form-row input:focus, .form-row select:focus, .form-row textarea:focus {
  border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-tint);
}
/* 占位符用 ink-3（4.97:1 达标）——ink-x 太浅，作为「文字」不满足 AA */
.form-row input::placeholder, .form-row textarea::placeholder { color: var(--ink-3); }
/* 禁用态文字用 ink-x：WCAG 1.4.3 对「非活动控件」豁免，这是 ink-x 的正当用途 */
.form-row input:disabled, .form-row select:disabled {
  background: var(--surface-2); color: var(--ink-x); cursor: not-allowed;
}
.form-help { font-size: 12px; color: var(--ink-3); margin-top: 6px; line-height: 1.7; }
.form-help b { color: var(--ink-2); }

/* 工具条里的裸控件（日期选择 / 筛选下拉），与 .form-row 内的输入框同款 */
.control {
  height: 34px; padding: 0 12px;
  border: 1px solid var(--rule-2); border-radius: 8px;
  font-family: inherit; font-size: 14px; color: var(--ink); background: var(--surface);
  outline: none; transition: border-color .15s, box-shadow .15s;
}
.control:focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-tint); }
select.control { cursor: pointer; }

/* 内联勾选（表格/表单内的复选框）：必须压过上面的 .form-row label / input 规则 */
.form-row .plat-checks { display: flex; flex-wrap: wrap; gap: 8px 18px; }
.form-row .plat-check {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 14px; font-weight: 400; color: var(--ink-2);
  margin-bottom: 0; cursor: pointer;
}
.form-row .plat-check input,
.form-row .inline-check input {
  width: auto; height: auto; padding: 0; border: none; margin: 0; border-radius: 0;
  accent-color: var(--brand); cursor: pointer;
}
.form-row .plat-check input:focus, .form-row .inline-check input:focus { box-shadow: none; }
.inline-check {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 12px; color: var(--ink-3); cursor: pointer;
}

/* ============================================================
   弹窗
   ============================================================ */
.modal-mask {
  position: fixed; inset: 0; background: var(--overlay);
  display: flex; align-items: center; justify-content: center; padding: 24px; z-index: 100;
}
.modal {
  width: 480px; max-width: 100%; max-height: 100%;
  background: var(--surface); border-radius: 12px;
  display: flex; flex-direction: column; overflow: hidden;
  box-shadow: 0 16px 48px var(--overlay);
}
.modal.modal-wide { width: 820px; }
.modal-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 16px 20px; border-bottom: 1px solid var(--rule); flex-shrink: 0;
}
.modal-title { font-size: 16px; font-weight: 600; color: var(--ink); }
.modal-close {
  width: 32px; height: 32px; flex-shrink: 0; border: none; border-radius: 6px;
  background: none; color: var(--ink-3); font-size: 20px; line-height: 1; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background .15s, color .15s;
}
.modal-close:hover { background: var(--surface-2); color: var(--ink); }
.modal-body { padding: 20px; overflow-y: auto; }
.modal-foot {
  padding: 14px 20px; border-top: 1px solid var(--rule); flex-shrink: 0;
  display: flex; justify-content: flex-end; gap: 10px;
}

/* ============================================================
   抽屉（右侧滑出）—— 门店「平台身份」「从平台同步」的容器
   ============================================================ */
.drawer-mask {
  position: fixed; inset: 0; background: var(--overlay); z-index: 110;
  opacity: 0; pointer-events: none; transition: opacity .2s;
}
.drawer-mask.show { opacity: 1; pointer-events: auto; }
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; width: 720px; max-width: 94vw;
  background: var(--surface); z-index: 111;
  display: flex; flex-direction: column;
  transform: translateX(100%); transition: transform .24s cubic-bezier(.22,.61,.36,1);
  box-shadow: -8px 0 32px var(--overlay);
}
.drawer.show { transform: translateX(0); }
.drawer.drawer-wide { width: 880px; }
.drawer-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 16px 20px; border-bottom: 1px solid var(--rule); flex-shrink: 0;
}
.drawer-title { font-size: 16px; font-weight: 600; color: var(--ink); }
.drawer-sub { font-size: 12px; color: var(--ink-3); font-weight: 400; margin-top: 3px; }
.drawer-body { flex: 1; overflow-y: auto; padding: 20px; }
.drawer-foot {
  padding: 14px 20px; border-top: 1px solid var(--rule); flex-shrink: 0;
  display: flex; justify-content: flex-end; gap: 10px;
}
@media (max-width: 1320px) { .drawer, .drawer.drawer-wide { width: 640px; } }

/* ============================================================
   分段控件（绑定申请的 待审核/已通过/已驳回/全部）
   ============================================================ */
.seg { display: inline-flex; gap: 2px; padding: 3px; background: var(--surface-2); border-radius: 8px; }
.tab {
  height: 28px; padding: 0 12px; border: none; border-radius: 6px;
  background: transparent; color: var(--ink-2);
  font-family: inherit; font-size: 12px; font-weight: 500; cursor: pointer;
  transition: background .15s, color .15s;
}
.tab:hover { color: var(--ink); }
.tab.active { background: var(--surface); color: var(--brand-strong); font-weight: 600; box-shadow: 0 1px 2px var(--sh-1); }

/* ============================================================
   门店 × 平台身份（抽屉内）
   ============================================================ */
.sect-title {
  font-size: 12px; font-weight: 600; color: var(--ink-3);
  letter-spacing: .3px; margin: 4px 0 10px; padding-top: 14px;
  border-top: 1px solid var(--rule);
}
.sect-title:first-child { padding-top: 0; border-top: none; }
.map-list { margin-bottom: 16px; }
.map-list table { table-layout: fixed; }
.map-list td, .map-list th { vertical-align: top; word-break: break-word; }
/* 固定几列宽度，否则「备注」一长就把平台徽章挤成竖排 */
.map-list th:nth-child(1), .map-list td:nth-child(1) { width: 96px; }
.map-list th:nth-child(2), .map-list td:nth-child(2) { width: 24%; }
.map-list th:nth-child(3), .map-list td:nth-child(3) { width: 118px; }
.map-list th:nth-child(4), .map-list td:nth-child(4) { width: 116px; }
.map-list th:nth-child(6), .map-list td:nth-child(6) { width: 132px; }
.map-list .badge { white-space: nowrap; }
.map-list .row-actions { flex-wrap: nowrap; white-space: nowrap; }
.map-list .btn-sm { white-space: nowrap; }
.map-list td { height: auto; padding-top: 10px; padding-bottom: 10px; }
.map-empty { color: var(--ink-3); font-size: 12px; padding: 10px 0; }

/* 同步预览：一行一个平台门店 */
.sync-sum { display: flex; gap: 16px; flex-wrap: wrap; margin-bottom: 12px; font-size: 12px; color: var(--ink-3); }
.sync-sum b { font-family: var(--font-num); color: var(--ink); font-weight: 600; }
.sync-row { padding: 12px 0; border-bottom: 1px solid var(--rule); }
.sync-row:last-child { border-bottom: none; }
.sync-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.sync-name { font-weight: 600; font-size: 14px; color: var(--ink); }
.sync-pid { color: var(--ink-3); font-size: 12px; font-family: var(--font-num); }
.sync-pick { display: flex; align-items: center; gap: 8px; }
.sync-pick select { flex: 1; min-width: 160px; }

/* 绑定自检结果 */
.verify-box {
  margin-top: 14px; padding: 12px 14px; font-size: 12px;
  background: var(--surface-2); border: 1px solid var(--rule); border-radius: 8px;
}
.verify-box .vp { display: flex; gap: 8px; padding: 3px 0; line-height: 1.7; }
.verify-box .vp b { min-width: 84px; flex-shrink: 0; font-weight: 600; color: var(--ink); }
.warn-line { color: var(--warn); font-size: 12px; padding: 3px 0; line-height: 1.7; }

/* 自检汇总条（页头常驻位） */
.verify-bar {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 10px 14px; margin-bottom: 16px; border-radius: 8px;
  background: var(--surface); border: 1px solid var(--rule); font-size: 12px; color: var(--ink-3);
}
.verify-bar.has-issue { border-color: var(--warn); background: var(--warn-bg); color: var(--warn); }
.verify-bar b { font-family: var(--font-num); font-weight: 600; }
.verify-bar .vb-sp { flex: 1; }

/* 自检明细项 */
.verify-item { padding: 10px 0; border-bottom: 1px solid var(--rule); }
.verify-item:last-child { border-bottom: none; }
.verify-item > b { display: block; font-size: 14px; margin-bottom: 2px; }

/* 分步流程指示器（从平台同步） */
.steps { display: flex; align-items: center; gap: 8px; margin-bottom: 16px; flex-wrap: wrap; }
.step { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--ink-3); }
.step .sn {
  width: 18px; height: 18px; border-radius: 999px; flex-shrink: 0;
  background: var(--surface-2); color: var(--ink-3);
  font-family: var(--font-num); font-size: 11px; line-height: 18px; text-align: center;
}
.step.on { color: var(--ink); font-weight: 600; }
.step.on .sn { background: var(--brand); color: #fff; }
.step.done { color: var(--ink-2); }
.step.done .sn { background: var(--ok); color: #fff; }
.step-sep { width: 16px; height: 1px; background: var(--rule-2); flex-shrink: 0; }

/* ============================================================
   空态 / 加载 / 提示
   ============================================================ */
.empty { text-align: center; color: var(--ink-3); padding: 48px 20px; font-size: 14px; }
.empty-title { font-size: 16px; font-weight: 600; color: var(--ink-2); margin-bottom: 6px; }
.empty-hint { font-size: 12px; color: var(--ink-3); margin-bottom: 14px; line-height: 1.7; }
.muted { color: var(--ink-3); font-size: 12px; }
/* 已删除行状态列的第二行（删除时间 · 操作人）：比 .muted 再小一号且不断行 */
.tiny { font-size: 11px; line-height: 1.35; margin-top: 2px; white-space: nowrap; }

/* 表单里的补充说明（放在字段下方，解释这个选项会影响什么） */
.form-hint {
  margin-top: 6px; font-size: 12px; line-height: 1.6;
  color: var(--ink-3);
}
.form-hint b { color: var(--ink-2); }

/* 长按确认按钮（ui.js::confirmWithHold）：按住时从左往右填充，松手即回弹 */
.btn-hold {
  position: relative; overflow: hidden;
  user-select: none; -webkit-user-select: none; touch-action: manipulation;
}
.btn-hold::after {
  content: ''; position: absolute; inset: 0;
  background: rgba(255, 255, 255, .32);
  transform: scaleX(0); transform-origin: left center;
  pointer-events: none;
}
.btn-hold.holding::after { animation: holdfill var(--hold-ms, 1500ms) linear forwards; }
@keyframes holdfill { from { transform: scaleX(0); } to { transform: scaleX(1); } }
.hold-tip {
  min-height: 18px; margin-top: 10px;
  color: var(--danger); font-size: 12px; line-height: 1.6;
}
.hold-tip:empty { min-height: 0; margin-top: 0; }
.hint-danger { color: var(--danger); font-size: 12px; line-height: 1.6; }

/* 加载骨架 */
.skeleton { height: 12px; border-radius: 6px; background: var(--surface-2); animation: sk-pulse 1.4s ease-in-out infinite; }
.skeleton + .skeleton { margin-top: 12px; }
.skeleton.w40 { width: 40%; }
.skeleton.w70 { width: 70%; }
@keyframes sk-pulse { 0%,100% { opacity: 1; } 50% { opacity: .5; } }
.loading-box { padding: 8px 0; }

/* ============================================================
   Toast
   ============================================================ */
.toast {
  position: fixed; top: 20px; left: 50%;
  transform: translateX(-50%) translateY(-16px);
  background: var(--ink); color: #fff;
  padding: 10px 18px; border-radius: 8px; font-size: 14px;
  max-width: 80vw; box-shadow: 0 8px 24px var(--sh-1);
  opacity: 0; pointer-events: none; z-index: 300;
  transition: opacity .2s, transform .2s;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.error { background: var(--danger); }
.toast.success { background: var(--ok); }
