/* ============================================================
   繁露齿科 · 工厂管理后台
   设计令牌与小程序端保持一致（深墨蓝 + 香槟金 + 暖白），
   布局按「桌面工作台」重排：左侧固定导航 + 顶栏 + 内容区。
   ============================================================ */

:root {
  --ink:   #0E2340;
  --ink2:  #1C3A5E;
  --ink3:  #556777;
  --ink4:  #7C8A8C;
  --brand:  #B08D57;
  --brand-d:#7C5F33;
  --brand-l:#F2ECE1;
  --paper: #F7F5F1;
  --card:  #FFFFFF;
  --line:  rgba(14,35,64,.09);
  --line2: rgba(14,35,64,.055);
  --price: #A6482F;
  --ok:    #2F7D5C;
  --warn:  #8D5B16;
  --ok-bg:   #EAF4EF;
  --warn-bg: #FBF2E2;
  --red-bg:  #FBEFEC;
  --gray-bg: #EFF1F3;
  --neutral-bg: #F2EFE9;
  --sh1: 0 1px 2px rgba(14,35,64,.04), 0 8px 24px rgba(14,35,64,.05);
  --sh2: 0 24px 70px rgba(14,35,64,.20);
  --hover: #FBF9F5;
}

* { box-sizing: border-box; touch-action: manipulation; }

html, body {
  margin: 0; padding: 0;
  background: var(--paper);
  color: var(--ink);
  /* ★ 全站唯一的字体：系统无衬线（2026-10-15 定，当天起衬线全线退场）。
     此前登录页大标题与侧栏品牌名走 Georgia 衬线 —— 但 Georgia 只含拉丁字母，
     「繁露齿科」四个中文一律掉到 "Songti SC"（宋体），在小字号下看着歪；
     而本文件下面早就为数字下过结论（衬线 oldstyle 的 0 比 1 矮一截）。
     现在连那两处标题也一起换成系统无衬线，全站只留一支笔，
     层次改由字号 / 字重 / 颜色做。 */
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Helvetica Neue", sans-serif;
  /* 数字一律等宽对齐 —— 衬线退场后，「一列数字」（金额 / 订单号 / 日期）
     的对齐改由字体特性提供。可继承，根上写一次全站生效。 */
  font-variant-numeric: tabular-nums;
  font-size: 14px; line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--brand-d); }
/* 数字列：只留等宽特性。
   ⚠️ 这段原本写的是「数字列不走衬线、衬线只留给登录页/侧栏的标题」——
      2026-10-15 衬线全站退场（见 html, body 里的字体口径），
      于是「只留给标题」这个例外也不需要了。结论没变。 */
.mono { font-variant-numeric: tabular-nums; }
.muted { color: var(--ink3); }
.dim { color: var(--ink4); }
.nowrap { white-space: nowrap; }
.right { text-align: right; }
.hide { display: none !important; }

/* ---------------- 登录页 ---------------- */

.login {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: radial-gradient(120% 120% at 82% 0%, #1E4478 0%, #14325C 34%, #0E2340 64%, #0A1B33 100%);
  position: relative; overflow: hidden;
}
.login .arc { position: absolute; border: 1px solid rgba(203,170,121,.14); border-radius: 50%; }
.login .arc.a1 { width: 520px; height: 520px; right: -160px; top: -180px; }
.login .arc.a2 { width: 760px; height: 760px; right: -280px; top: -300px; border-color: rgba(203,170,121,.09); }
.login .arc.a3 { width: 1040px; height: 1040px; right: -400px; top: -420px; border-color: rgba(203,170,121,.06); }

.login-card {
  position: relative; width: 380px; padding: 40px 38px 34px;
  background: rgba(255,255,255,.98); border-radius: 20px; box-shadow: var(--sh2);
  text-align: center;
}
.badge {
  width: 78px; height: 78px; margin: 0 auto; border-radius: 50%;
  background: #fff; border: 1px solid rgba(203,170,121,.55);
  padding: 9px; box-shadow: 0 8px 22px rgba(14,35,64,.16);
}
.badge img { width: 100%; height: 100%; display: block; }
.login-card h1 {
  font-family: inherit; font-size: 27px; letter-spacing: 6px;
  margin: 20px 0 0; font-weight: 500; color: var(--ink);
}
.login-card .en { font-size: 10px; letter-spacing: 3px; color: var(--ink4); margin-top: 8px; }
.login-card .slogan {
  font-size: 14px; color: var(--brand-d); letter-spacing: 4px; margin-top: 16px;
}
.login-card .rule { width: 36px; height: 2px; background: var(--brand); margin: 18px auto 24px; border-radius: 2px; }
.login-card .tip { font-size: 12px; color: var(--ink4); margin-top: 18px; line-height: 1.7; }

/* ---------------- 结构：侧栏 + 主区 ---------------- */

.app { display: flex; min-height: 100vh; }

.side {
  width: 224px; flex-shrink: 0; position: fixed; left: 0; top: 0; bottom: 0;
  background: linear-gradient(180deg, #14325C 0%, #0E2340 58%, #0A1B33 100%);
  color: #fff; display: flex; flex-direction: column; z-index: 30;
}
.side-brand { padding: 22px 20px 18px; display: flex; align-items: center; gap: 12px; border-bottom: 1px solid rgba(203,170,121,.14); }
.side-brand .bd {
  width: 42px; height: 42px; border-radius: 50%; background: #fff; flex-shrink: 0;
  border: 1px solid rgba(203,170,121,.5); padding: 5px;
}
.side-brand .bd img { width: 100%; height: 100%; display: block; }
.side-brand .nm { font-family: inherit; font-size: 17px; letter-spacing: 3px; }
.side-brand .sub { font-size: 9px; letter-spacing: 1.6px; color: rgba(203,170,121,.8); margin-top: 3px; }

.side-nav { padding: 14px 12px; flex: 1; overflow-y: auto; }
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 14px; border-radius: 10px; margin-bottom: 4px;
  color: rgba(255,255,255,.72); font-size: 14px; cursor: pointer;
  transition: background .14s ease, color .14s ease;
  border: 1px solid transparent;
}
.nav-item:hover { background: rgba(255,255,255,.07); color: #fff; }
.nav-item.on {
  background: rgba(203,170,121,.16); color: #fff;
  border-color: rgba(203,170,121,.42);
}
.nav-item .ic { width: 18px; text-align: center; font-size: 15px; opacity: .95; }
.nav-item .badge-n {
  margin-left: auto; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px;
  background: var(--price); color: #fff; font-size: 11px; line-height: 20px; text-align: center;
}

.side-foot {
  padding: 14px 16px; border-top: 1px solid rgba(203,170,121,.14);
  font-size: 11px; color: rgba(255,255,255,.5); line-height: 1.8;
}
.side-foot b { color: rgba(255,255,255,.78); font-weight: 500; display: block; }

.main { margin-left: 224px; flex: 1; min-width: 0; display: flex; flex-direction: column; }

.topbar {
  height: 62px; background: rgba(255,255,255,.92); backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
  display: flex; align-items: center; padding: 0 26px; gap: 14px;
  position: sticky; top: 0; z-index: 20;
}

/* 顶部常驻提示条：断网 / 有新版本。
   两件事都不该只在控制台里发生 —— 工厂会把标签页开一整天。 */
.sysbar {
  display: flex; align-items: center; gap: 12px;
  padding: 9px 26px; font-size: 13px;
  background: var(--warn-bg); color: #6B5024; border-bottom: 1px solid rgba(176,141,87,.35);
  position: sticky; top: 0; z-index: 30;
}
.sysbar.red { background: var(--red-bg); color: #7A2A20; border-bottom-color: rgba(192,57,43,.3); }
.sysbar .x { margin-left: auto; cursor: pointer; opacity: .6; padding: 0 4px; }
.sysbar .x:hover { opacity: 1; }
.topbar h2 { font-size: 18px; font-weight: 500; margin: 0; letter-spacing: .5px; }
.topbar .sub { font-size: 12px; color: var(--ink4); margin-left: 2px; }
.topbar .sp { flex: 1; }

.content { padding: 22px 26px 70px; }

/* ---------------- 通用件 ---------------- */

.card {
  background: var(--card); border-radius: 14px; padding: 20px 22px;
  box-shadow: var(--sh1); margin-bottom: 18px;
}
.card.pad0 { padding: 0; overflow: hidden; }
.card-hd { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; }
.card-hd .bar { width: 3px; height: 15px; background: var(--brand); border-radius: 2px; }
.card-hd .tx { font-size: 15px; font-weight: 500; }
.card-hd .sp { flex: 1; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 38px; padding: 0 18px; border-radius: 9px; border: none;
  background: var(--ink); color: #fff; font-size: 14px; cursor: pointer;
  transition: transform .1s ease, opacity .1s ease, background .14s ease;
  font-family: inherit; white-space: nowrap;
}
.btn:hover { opacity: .92; }
.btn:active { transform: translateY(1px); }
.btn.brand { background: linear-gradient(135deg, #C29D66 0%, #B08D57 52%, #9C7C49 100%); box-shadow: 0 4px 14px rgba(176,141,87,.28); }
.btn.ghost { background: transparent; color: var(--ink); border: 1px solid rgba(14,35,64,.18); }
.btn.danger { background: transparent; color: var(--price); border: 1px solid rgba(166,72,47,.32); }
.btn.sm { height: 30px; padding: 0 12px; font-size: 13px; border-radius: 7px; }
.btn[disabled] { background: #C9CFD6; color: #fff; box-shadow: none; cursor: not-allowed; opacity: 1; }

.pill {
  display: inline-block; font-size: 12px; padding: 2px 10px; border-radius: 11px;
  background: var(--brand-l); color: var(--brand-d); white-space: nowrap;
}
.pill.gray { background: var(--gray-bg); color: var(--ink4); }
.pill.red { background: var(--red-bg); color: var(--price); }
.pill.green { background: var(--ok-bg); color: var(--ok); }
.pill.amber { background: var(--warn-bg); color: var(--warn); }
.pill.ink { background: rgba(14,35,64,.07); color: var(--ink2); }
/* pill.blue 原来被 STATUS 表引用（producing/ready 两个状态），
   但样式表里从来没定义过 —— 于是这两个状态跟「无颜色」完全一样，
   在一屏都是状态标签的列表里，它们看起来像是漏了色。补上。 */
.pill.blue { background: rgba(176,141,87,.1); color: #7C5F33; }

/* ---------------- 列表增值小件（分页 / 排序 / 交期 / 加急） ---------------- */

/* 分页外的「每页条数」下拉：尺寸要压到跟在 .btn.sm 后面不显大 */
.pager .pg-size { display: inline-flex; align-items: center; gap: 5px; }
.pager .pg-size select {
  width: auto; height: 30px; padding: 0 26px 0 10px; font-size: 13px;
  border-radius: 7px; appearance: none; -webkit-appearance: none;
  background: #fff url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%237A8B9D' stroke-width='2'><path d='M6 9l6 6 6-6'/></svg>") no-repeat right 8px center;
  background-size: 12px;
}
.pager b { color: var(--ink); font-weight: 600; font-variant-numeric: tabular-nums; }

/* 可排序表头：整格可点，别只让文字可点（热区太小点不中） */
table.tb th.th-sort { cursor: pointer; user-select: none; transition: color .12s ease, background .12s ease; }
table.tb th.th-sort:hover { color: var(--ink2); background: #F5F3EE; }
table.tb th.th-sort.on { color: var(--brand-d); background: var(--brand-l); }

/* 交期：工厂排产第一眼看的列。三档语义色 —— 超期红、今天/明天金、其余绿 */
.eta { font-size: 13px; font-weight: 500; white-space: nowrap; }
.eta.over { color: var(--price); }
.eta.soon { color: var(--warn); }
.eta.ok   { color: var(--ok); }

/* 加急单：整行左侧一道红边，扫一眼就知道哪几张要先做 */
table.tb tbody tr.row-urgent td:first-child { box-shadow: inset 3px 0 0 var(--price); }
table.tb tbody tr.row-urgent { background: rgba(166,72,47,.035); }
table.tb tbody tr.row-urgent:hover { background: rgba(166,72,47,.07); }

/* 抽屉 / 弹窗打开时锁住背景滚动 —— 原来滚的永远是列表，抽屉跟着晃 */
body.lock { overflow: hidden; }

/* 键盘可达：原来全站只有鼠标能操作，Tab 到按钮上看不出焦点在哪 */
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: 4px; }
table.tb tbody tr:focus-visible { outline: 2px solid var(--brand); outline-offset: -2px; }

/* 行内「复制」小标：不占地方、不抢注意力，但要一眼看出能点。
   字号压到 11px —— 它是内容的注脚，不是主角。 */
.copy-tag {
  margin-left: 6px; padding: 1px 7px; font-size: 11px; line-height: 16px;
  border: 1px solid rgba(14,35,64,.16); border-radius: 8px;
  background: #fff; color: var(--ink3); cursor: pointer;
  font-family: inherit; vertical-align: middle;
  transition: all .12s ease; white-space: nowrap;
}
.copy-tag:hover { border-color: var(--brand); color: var(--brand-d); background: var(--brand-l); }
.copy-tag:active { transform: scale(.96); }

/* 寄件地址旁的「已定位」标：点开是腾讯地图上的那个点。
   比 pill 再小一号 —— 它是地址的注脚，不该抢地址本身的注意力。 */
.geo-tag {
  display: inline-block; margin-left: 6px; padding: 1px 7px;
  font-size: 11px; line-height: 16px; border-radius: 9px;
  text-decoration: none; background: var(--brand-l); color: var(--brand-d);
  white-space: nowrap;
}
.geo-tag:hover { background: var(--brand); color: #fff; }

.money { font-variant-numeric: tabular-nums; }
.money.big { font-size: 26px; font-weight: 600; color: var(--ink); letter-spacing: .3px; }
.amount { color: var(--price); }
.amount.plus { color: var(--ok); }

.chips { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.chip {
  height: 32px; padding: 0 14px; border-radius: 16px; background: #fff;
  border: 1px solid var(--line); color: var(--ink2); font-size: 13px;
  cursor: pointer; display: inline-flex; align-items: center; gap: 6px;
  transition: all .14s ease;
}
.chip:hover { border-color: rgba(14,35,64,.2); }
.chip.on { background: var(--ink); color: #fff; border-color: var(--ink); }
.chip .n { font-size: 11px; opacity: .7; }
/* 「待审核」的条数 > 0 时要一眼看见 —— 它是「有人等你审批」的信号。
   0 的时候保持灰着不刺眼；选中态（.on）用浅青，否则深底上的警示色看不清。 */
.chip .n.warn { opacity: 1; color: var(--warn); font-weight: 700; }
.chip.on .n.warn { color: var(--brand); }

/* 文本类控件统一底样式。
   ⚠️ 不能只列 input[type=text] —— 属性选择器只认标签上**真写了** type 的：
   后台 30 多处是 <input id="note"> 这种没写 type 的，会被整条漏掉（既没有这份样式、
   渲染成浏览器默认的 21px 小盒子，字号也停在 UA 的 13.33px）；筛选行的 type=month 同理。 */
input[type=text], input[type=number], input[type=password], input[type=date], input[type=month], input:not([type]), select, textarea {
  width: 100%; height: 38px; padding: 0 12px; border-radius: 9px;
  border: 1px solid rgba(14,35,64,.14); background: #fff; color: var(--ink);
  font-size: 14px; font-family: inherit; outline: none; transition: border-color .14s ease, box-shadow .14s ease;
}
textarea { height: auto; min-height: 76px; padding: 10px 12px; line-height: 1.7; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(176,141,87,.14); }
input::placeholder, textarea::placeholder { color: var(--ink4); }
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 12px; color: var(--ink3); margin-bottom: 6px; }
.field .hint { font-size: 11px; color: var(--ink4); margin-top: 5px; line-height: 1.6; }
/* 必填星号：以前「哪些必须填」只写在正文的某一句提示里，得读完才知道 */
.field label .req { color: var(--price); margin-left: 3px; font-weight: 600; }
/* 校验失败就地标在那一栏（openModal 的 fieldErr 加 .err）。
   原来只有右上角一条 toast —— 长表单里得自己回头一栏一栏找是哪一栏。 */
.field.err > label { color: var(--price); }
.field.err input, .field.err select, .field.err textarea {
  border-color: var(--price); box-shadow: 0 0 0 3px rgba(166,72,47,.12);
}
.field .err-msg { font-size: 11.5px; color: var(--price); margin-top: 6px; line-height: 1.6; }
.field .err-msg::before { content: '⚠ '; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.row3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }

/* ---------------- 发券表单：券种三选一卡 ----------------
   把「类型 + 作用层」两个技术开关变成三张一看就懂的卡，
   卡片只替人选值（真身是隐藏的两个 select），不另起炉灶。 */
/* 活动封面（表单里的预览框，2026-10-14）。
   定高 170px + object-fit: cover：运营传什么尺寸进来都占一样的位置，
   不会把下面那几栏顶走；空白态与「已上传待保存」态共用同一个框。 */
.act-cover {
  display: block; width: 100%; max-width: 320px; height: 170px;
  object-fit: cover; border-radius: 10px;
  border: 1px solid var(--line); background: var(--gray-bg);
}
.act-cover.empty, .act-cover.loading {
  display: flex; align-items: center; justify-content: center;
  font-size: 12.5px; color: var(--ink4);
}
.cp-gt { font-size: 12px; font-weight: 600; color: var(--ink4); letter-spacing: .5px; margin: 16px 0 6px; }
.cp-gt:first-child { margin-top: 0; }
.cp-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.cp-card {
  font: inherit; text-align: left; cursor: pointer;
  border: 1.5px solid var(--line); border-radius: 10px;
  background: var(--card); padding: 10px 12px;
  display: flex; flex-direction: column; gap: 3px;
  transition: border-color .15s, background .15s;
}
.cp-card b { font-size: 13.5px; color: var(--ink); }
.cp-card span { font-size: 11.5px; color: var(--ink4); line-height: 1.45; }
.cp-card:hover { border-color: var(--brand); }
.cp-card.on { border-color: var(--brand); background: var(--brand-l); }
.cp-card.on b { color: var(--brand-d); }

/* 券的「适用品类」多选（2026-10-15；选中态当晚按用户实测重做，与员工端同一套）。
   ⚠️ 选中 = **--brand-d 实底 + 白字**，不再是「金边 + 金底 + 金字」：
      浅金底 #F2ECE1 在员工端的暖白纸底（#F7F5F1）上等于没上色，而没选中的是纯白 ——
      视觉权重整个反了，用户实测原话「都不知道点没点」。
      这里画在白底上本来还看得见，但两端必须同一套（cross-end 用 eq 逐字对拍钉住）。
   ⚠️ 用独立的 .cp-cat 而不是复用好列表页的 .chip —— .chip.on 是深墨蓝（那是「筛选」的
      语言，点它就换一批数据），而这里选的是**要提交的值**，语义不同。 */
.cp-cats { display: flex; flex-wrap: wrap; gap: 8px; }
.cp-cat {
  font: inherit; font-size: 13px; cursor: pointer;
  height: 32px; padding: 0 14px; border-radius: 16px;
  border: 1.5px solid var(--line); background: var(--card); color: var(--ink2);
  transition: border-color .15s, background .15s, color .15s;
}
.cp-cat:hover { border-color: var(--brand); }
.cp-cat.on { border-color: var(--brand-d); background: var(--brand-d); color: #FFFFFF; font-weight: 600; }
/* 「全部商品」那一颗加一点区分：它是「没有任何限制」，不是第 6 个品类 */
.cp-cat[data-cat=""] { border-style: dashed; }
.cp-cat[data-cat=""].on { border-style: solid; }

.search {
  height: 34px; padding: 0 12px 0 32px; border-radius: 17px; min-width: 220px;
  background: #fff url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%237A8B9D' stroke-width='2'><circle cx='11' cy='11' r='7'/><path d='M20 20l-3.5-3.5'/></svg>") no-repeat 10px center;
  background-size: 14px;
}
/* 上面那条统一样式给了 width:100%，筛选行里的搜索框要回到「跟内容走」的宽度（min-width 兜底）。
   ⚠️ 用 input.search 而不是 .search —— 要跟 untyped-input 那条同权重、靠源码顺序才盖得住。 */
input.search { width: auto; }

/* 列表筛选用的下拉（跟着 .chips 一起排，尺寸对齐 .search） */
.select-filter {
  width: auto; min-width: 160px; height: 34px; border-radius: 17px;
  padding: 0 30px 0 14px; font-size: 13px;
  background: #fff url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%237A8B9D' stroke-width='2'><path d='M6 9l6 6 6-6'/></svg>") no-repeat right 11px center;
  background-size: 13px;
  appearance: none; -webkit-appearance: none;
}

/* ---------------- 表格 ---------------- */

/* ⚠️ 这里的 max-height + overflow-y 不是一个随便挑的数字：它是让
   `th { position: sticky }` 真正生效的前提。sticky 是相对**最近的可滚动祖先**
   定位的，原来 .tbwrap 只有 overflow-x:auto，纵向滚动条在 <body> 上，
   于是表头滚两屏就跟着走了 —— 长列表里永远不知道自己在看哪一列。
   现在让表格自己在框内纵向滚，表头就钉在框顶。 */
.tbwrap { overflow-x: auto; overflow-y: auto; max-height: calc(100vh - 320px); min-height: 180px; }
table.tb { width: 100%; border-collapse: collapse; }
table.tb th {
  font-size: 12px; font-weight: 500; color: var(--ink4); text-align: left;
  padding: 12px 14px; background: #FBF9F5; border-bottom: 1px solid var(--line);
  white-space: nowrap; position: sticky; top: 0;
}
table.tb td { padding: 13px 14px; border-bottom: 1px solid #F2F0EC; font-size: 13.5px; vertical-align: middle; }
table.tb tbody tr { cursor: pointer; transition: background .12s ease; }
table.tb tbody tr:hover { background: var(--hover); }
table.tb tbody tr:last-child td { border-bottom: none; }
table.tb .t-main { font-weight: 500; color: var(--ink); }
table.tb .t-sub { font-size: 12px; color: var(--ink4); margin-top: 3px; }

/* 空态：一句话「没有数据」等于没说话 —— 这里是唯一能当场回答
   「为什么空、下一步点哪里」的地方，所以给它图标 + 结论 + 引导三段。 */
.empty-row { padding: 56px 20px; text-align: center; color: var(--ink4); font-size: 13px; line-height: 1.9; }
.empty-row .e-ic { font-size: 26px; color: var(--brand); opacity: .38; line-height: 1; margin-bottom: 12px; }
.empty-row .e-t { font-size: 14px; color: var(--ink3); font-weight: 500; letter-spacing: .2px; }
.empty-row .e-s { font-size: 12.5px; color: var(--ink4); margin-top: 7px; max-width: 440px; margin-left: auto; margin-right: auto; }
.empty-row .e-a { margin-top: 16px; }

.pager { display: flex; align-items: center; justify-content: flex-end; gap: 10px; padding: 14px 16px; font-size: 13px; color: var(--ink3); }

/* ---------------- 统计卡 ---------------- */

.stats { display: grid; grid-template-columns: repeat(6, 1fr); gap: 14px; margin-bottom: 18px; }
@media (max-width: 1400px) { .stats { grid-template-columns: repeat(3, 1fr); } }
.stat {
  background: #fff; border-radius: 14px; padding: 18px; box-shadow: var(--sh1);
  cursor: pointer; transition: transform .14s ease, box-shadow .14s ease;
  border: 1px solid transparent;
}
.stat:hover { transform: translateY(-2px); box-shadow: 0 4px 10px rgba(14,35,64,.06), 0 16px 36px rgba(14,35,64,.09); }
.stat.on { border-color: var(--brand); }
.stat .k { font-size: 12px; color: var(--ink3); display: flex; align-items: center; gap: 6px; }
/* 统计数字：系统无衬线 + 600 字重——这是后台被看得最多的数字。
   （原文是「衬线 oldstyle 的 0 比 1 矮一截，是说不出的不协调的最大来源」，
     2026-10-15 起全站无衬线，这个隐患从根上没有了。） */
.stat .v { font-size: 28px; font-weight: 600; line-height: 1.3; margin-top: 6px; font-variant-numeric: tabular-nums; letter-spacing: .2px; }
.stat .u { font-size: 12px; color: var(--ink4); font-family: inherit; margin-left: 3px; }
.stat.warn .v { color: var(--warn); }
.stat.red .v { color: var(--price); }
.stat.ok .v { color: var(--ok); }

/* ---------------- 抽屉 ---------------- */

.mask {
  position: fixed; inset: 0; background: rgba(14,35,64,.42); z-index: 50;
  opacity: 0; pointer-events: none; transition: opacity .2s ease;
}
.mask.on { opacity: 1; pointer-events: auto; }

.drawer {
  position: fixed; right: 0; top: 0; bottom: 0; width: 620px; max-width: 94vw;
  background: var(--card); z-index: 60; display: flex; flex-direction: column;
  transform: translateX(102%); transition: transform .24s cubic-bezier(.22,.61,.36,1);
  box-shadow: var(--sh2);
}
.drawer.on { transform: none; }
.drawer-hd {
  padding: 20px 24px 16px; border-bottom: 1px solid var(--line);
  display: flex; align-items: flex-start; gap: 12px;
}
.drawer-hd .t { font-size: 17px; font-weight: 500; }
.drawer-hd .d { font-size: 12px; color: var(--ink4); margin-top: 5px; }
.drawer-hd .x { margin-left: auto; font-size: 20px; color: var(--ink4); cursor: pointer; line-height: 1; padding: 4px 6px; }
.drawer-hd .x:hover { color: var(--ink); }
.drawer-bd { padding: 18px 24px 30px; overflow-y: auto; flex: 1; }
.drawer-ft {
  border-top: 1px solid var(--line); padding: 14px 24px; display: flex; gap: 10px; flex-wrap: wrap;
  background: #FCFBF9;
}

.kv { display: grid; grid-template-columns: 96px 1fr; gap: 10px 14px; font-size: 13.5px; }
.kv .k { color: var(--ink3); }
.kv .v { color: var(--ink); }

.sect { margin-top: 22px; }
.sect:first-child { margin-top: 0; }
.sect-t { font-size: 13px; color: var(--brand-d); font-weight: 500; letter-spacing: .5px; margin-bottom: 10px; display: flex; align-items: center; gap: 8px; }
.sect-t::after { content: ''; flex: 1; height: 1px; background: var(--line); }

.tl { border-left: 1px solid var(--line); margin-left: 5px; padding-left: 16px; }
.tl-item { position: relative; padding-bottom: 14px; }
.tl-item:last-child { padding-bottom: 0; }
.tl-item::before {
  content: ''; position: absolute; left: -21px; top: 5px;
  width: 9px; height: 9px; border-radius: 50%; background: var(--ink4); border: 2px solid #fff;
}
.tl-item.on::before { background: var(--brand); }
.tl-t { font-size: 13.5px; color: var(--ink); }
.tl-d { font-size: 12px; color: var(--ink4); margin-top: 3px; }

.list-row {
  display: flex; align-items: center; gap: 12px; padding: 11px 0;
  border-bottom: 1px solid var(--line2); font-size: 13.5px;
}
.list-row:last-child { border-bottom: none; }
.list-row .l { flex: 1; min-width: 0; }
.list-row .r { color: var(--ink3); }

/* ---------------- 版本 2 组件 ---------------- */

/* ---------------- 弹窗 ----------------
   全后台 29 处弹窗共用这一套（都从 openModal 出来）。三条结构上的承诺：
   ① 只有 .modal-bd 滚 —— 标题与底栏固定，多长的表单打开就看得见「保存」；
   ② 底栏永远是 flex 列的最后一个子项，不会跟着内容滚走；
   ③ 宽度按用途分四档（sm 确认 / 默认表单 / lg 宽表单 / xl 表格），
      窄屏统一塌成贴底全宽、两列栅格落成一列。 */
.modal-wrap {
  position: fixed; inset: 0; z-index: 70; display: flex; align-items: center; justify-content: center;
  background: rgba(14,35,64,.45); padding: 20px;
}
.modal {
  background: #fff; border-radius: 16px; width: 560px; max-width: 100%;
  max-height: 88vh; display: flex; flex-direction: column; overflow: hidden;
  box-shadow: var(--sh2); animation: pop .18s ease;
}
.modal.sm { width: 420px; }
.modal.lg { width: 760px; }
.modal.xl { width: 920px; }
@keyframes pop { from { opacity: 0; transform: translateY(12px) scale(.98); } to { opacity: 1; transform: none; } }
/* 点遮罩想关、但里面有没保存的内容时抖一下，把人叫回来 */
@keyframes nudge {
  0%, 100% { transform: none; }
  18% { transform: translateX(-7px); }
  38% { transform: translateX(6px); }
  58% { transform: translateX(-4px); }
  78% { transform: translateX(2px); }
}
.modal.shake { animation: nudge .34s ease; }

.modal-hd {
  padding: 18px 22px 14px; display: flex; align-items: flex-start; gap: 12px;
  border-bottom: 1px solid var(--line2);
}
.modal-hd .tt { flex: 1; min-width: 0; }
.modal-hd .t { font-size: 16px; font-weight: 600; letter-spacing: .3px; }
.modal-hd .s { font-size: 12.5px; color: var(--ink4); margin-top: 5px; line-height: 1.6; }
.modal-x {
  flex-shrink: 0; width: 30px; height: 30px; margin: -4px -6px 0 0;
  border: none; background: transparent; color: var(--ink4);
  font-size: 15px; line-height: 1; border-radius: 8px; cursor: pointer; font-family: inherit;
  transition: background .14s ease, color .14s ease;
}
.modal-x:hover { background: var(--gray-bg); color: var(--ink); }

.modal-bd { padding: 16px 22px 18px; overflow-y: auto; flex: 1; }
.modal-ft {
  padding: 13px 22px; display: flex; align-items: center; gap: 10px;
  border-top: 1px solid var(--line2); background: #FCFBF9; flex-wrap: wrap;
}
/* 提示就放在按钮旁边 —— 视线不用离开弹窗，比右上角闪一条 toast 有用 */
.modal-ft .ft-hint { flex: 1; min-width: 0; font-size: 12px; color: var(--price); opacity: 0; transition: opacity .18s ease; }
.modal-ft .ft-hint.on { opacity: 1; }
.modal-ft .btn { min-width: 92px; }

.toast-wrap { position: fixed; top: 18px; left: 50%; transform: translateX(-50%); z-index: 90; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.toast {
  background: rgba(14,35,64,.92); color: #fff; font-size: 13.5px;
  padding: 10px 18px; border-radius: 10px; box-shadow: 0 10px 30px rgba(14,35,64,.25);
  animation: pop .18s ease; max-width: 70vw;
}
.toast.err { background: rgba(166,72,47,.95); }
.toast.ok { background: rgba(47,125,92,.95); }

.check { display: flex; align-items: center; gap: 8px; padding: 8px 0; font-size: 14px; border-bottom: 1px solid var(--line2); }
.check:last-child { border-bottom: none; }
.check .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ink4); flex-shrink: 0; }
.check .dot.ok { background: var(--ok); }
.check .dot.no { background: var(--price); }
.check .k { color: var(--ink3); font-size: 13px; }
.check .v { margin-left: auto; font-size: 12.5px; color: var(--ink4); }

.notice { border-radius: 10px; padding: 12px 14px; font-size: 13px; line-height: 1.7; }
.notice.brand { background: var(--brand-l); color: var(--brand-d); }
.notice.red { background: var(--red-bg); color: var(--price); }
.notice.gray { background: var(--neutral-bg); color: var(--ink2); }
.notice.amber { background: var(--amber-bg, #FDF6EA); color: var(--amber, #8A5A17); }

/* 试排照片墙：工厂传的蜡型照，诊所端也要看得到 */
.imgs { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 10px; }
.imgs .img { display: block; width: 108px; height: 108px; border-radius: 12px; overflow: hidden; background: #F1EDE5; }
.imgs .img img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .25s; }
.imgs .img:hover img { transform: scale(1.06); }
/* 证件类（营业执照/执业许可证）：上面那档 108px 是给照片墙用的，
   执照满幅是文字，缩到 108px 等于看不清，审核时还是得点开。给大一号。 */
.imgs .img.lic { width: 180px; height: 180px; }

/* 裂图兜底：图片加载失败时（多半是签名地址过期）就地换成重试按钮。
   做成跟图片同尺寸的方块，布局不会因为「图没了」而跳一下。 */
.imgs .img .img-retry {
  display: flex; align-items: center; justify-content: center; text-align: center;
  width: 100%; height: 100%; padding: 6px; border: none; border-radius: 12px;
  background: #F1EDE5; color: var(--ink4); font-size: 11px; line-height: 1.5;
  font-family: inherit; cursor: pointer;
}
.imgs .img .img-retry:hover { background: var(--brand-l); color: var(--brand-d); }

.sk { height: 90px; border-radius: 12px; background: linear-gradient(90deg,#EFEDE8 25%,#F8F6F2 37%,#EFEDE8 63%); background-size: 400% 100%; animation: sk 1.4s ease infinite; margin-bottom: 12px; }
@keyframes sk { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }

@media (max-width: 900px) {
  .side { width: 64px; }
  .side-brand .nm, .side-brand .sub, .nav-item span.tx, .side-foot { display: none; }
  .nav-item { justify-content: center; }
  .main { margin-left: 64px; }
  .stats { grid-template-columns: repeat(2, 1fr); }
}

/* ---------------- 窄屏（笔记本小窗 / 平板 / 手机） ----------------
   后台主要跑在桌面，但运营常在笔记本小窗或平板上看。窄屏下三件事必须变：
   弹窗贴底全宽、两列/三列栅格塌成一列、顶栏与侧栏收窄。
   ⚠️ 必须排在 900px 那条之后，否则同权重下盖不住它的 .side 宽度。 */
@media (max-width: 760px) {
  .content { padding: 16px 14px 60px; }
  .topbar { height: auto; min-height: 56px; padding: 10px 14px; flex-wrap: wrap; gap: 8px; }
  .topbar h2 { font-size: 16px; }
  .topbar .sub { display: none; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  /* 统计卡若写了内联列数（如优惠券页 repeat(4,1fr)），内联样式会盖掉上面这条，
     手机上就横向溢出 —— 这里用 !important 一并收回来。 */
  .stats[style] { grid-template-columns: repeat(2, 1fr) !important; }

  /* 弹窗贴底：手机上「从下面升上来」比居中悬浮更像原生，拇指也够得着按钮 */
  .modal-wrap { padding: 0; align-items: flex-end; }
  .modal, .modal.sm, .modal.lg, .modal.xl {
    width: 100%; max-width: 100%; max-height: 92vh; border-radius: 16px 16px 0 0;
  }
  .modal-hd, .modal-bd { padding-left: 16px; padding-right: 16px; }
  .modal-ft { padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); }
  .modal-ft .btn { flex: 1; }

  /* 并排时每个输入框只剩百来像素，日期和手机号都会被截得看不全 */
  .row2, .row3 { grid-template-columns: 1fr; }

  .drawer { width: 100%; max-width: 100%; }
  .tbwrap { max-height: calc(100vh - 250px); }
}

/* ---------------- 触屏：输入框字号不得低于 16px ----------------
   iPhone / iPad / 微信内置浏览器聚焦输入框时，只要 font-size < 16px 就会**自动放大整页**，
   得双击才缩得回去（员工端早先踩过同一个坑）。桌面鼠标端保持 14px 的紧凑密度，不动。
   ⚠️ 必须放在文件最后：.select-filter（13px）与分页「每页条数」下拉写在前面，
   同权重下只能靠源码顺序盖住它们的 13px。 */
@media (pointer: coarse) {
  input[type=text], input[type=number], input[type=password], input[type=date], input[type=month], input:not([type]),
  select, textarea,
  .select-filter, .pager .pg-size select { font-size: 16px; }
}

/* ===== 商品图（2026-10-17 后台可换图）=====
   列表里那颗 44px 小图 + 编辑弹窗里 128px 的预览。
   无图时退成**品牌字牌**（与小程序 product-card 的兜底同一个语义），
   而不是一个空占位 —— 空占位会让运营以为「图没加载出来」去刷新十次。 */
.p-thumb {
  width: 44px; height: 44px; flex: 0 0 44px;
  border-radius: 8px; object-fit: cover;
  border: 1px solid var(--line); background: var(--gray-bg);
}
.p-thumb.mono {
  display: flex; align-items: center; justify-content: center;
  font-size: 15px; font-weight: 600; color: var(--ink4);
}
.p-imgbox { display: flex; align-items: flex-end; gap: 12px; }
.p-imgbox img, .p-imgbox .p-thumb {
  width: 128px; height: 128px; border-radius: 12px;
}
.p-imgbox .p-thumb.mono { font-size: 30px; }

/* 缩略图的「加载失败退字牌」：img 与 span 成对渲染，
   默认只显示 img；img 加了 .miss（onerror）才让字牌顶上。
   为什么不用「有图才渲染 img」：新商品还没镜像时，浏览器会画裂图，
   而工厂看到的应该是一个安静的字牌。 */
.p-thumb + .p-thumb.mono { display: none; }
.p-thumb.miss { display: none; }
.p-thumb.miss + .p-thumb.mono { display: flex; }
.p-imgbox .p-thumb.miss + .p-thumb.mono { display: flex; }

/* ===== 入驻审核台（2026-10-18）=====
   「待审核」页签不再借一般客户的那张 7 列表格 —— 待审行的账期/销售/余额
   全是默认值（还没审，当然没有），一排「现结 / 未分配 / ¥0.00」只是噪音；
   而审核真正要看的执照图反倒在表格里无处安放。改成卡片：执照、联系人、
   地址、等了多久、通过/驳回，一眼一单。 */
.pend-wrap { padding: 16px 18px; }
.pend-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: 12px;
}
.pend-card {
  display: flex; gap: 14px; padding: 16px;
  background: #fff; border: 1px solid var(--line); border-radius: 14px;
  cursor: pointer; transition: border-color .14s ease, box-shadow .14s ease;
}
.pend-card:hover { border-color: var(--brand); box-shadow: var(--sh1); }
/* 执照缩略图：审核依据直接上卡片，点开原图新窗口（不必先进抽屉） */
.pend-lic {
  flex: 0 0 92px; width: 92px; height: 92px;
  border-radius: 10px; overflow: hidden; display: block;
  background: var(--gray-bg); border: 1px solid var(--line2);
}
.pend-lic img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pend-lic:hover img { transform: scale(1.05); transition: transform .25s ease; }
/* 没传执照：红色占位 —— 待审还缺执照，这一眼就该看到 */
.pend-lic.none {
  display: flex; align-items: center; justify-content: center; text-align: center;
  background: var(--red-bg); color: var(--price);
  font-size: 11px; line-height: 1.6; text-decoration: none; cursor: default;
}
.pend-main { flex: 1; min-width: 0; }
.pend-name { font-size: 14.5px; font-weight: 600; color: var(--ink); }
.pend-sub {
  font-size: 12.5px; color: var(--ink3); margin-top: 4px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.pend-foot { display: flex; align-items: center; gap: 10px; margin-top: 8px; font-size: 12px; color: var(--ink4); flex-wrap: wrap; }
/* 等待时长：正常绿色；挂过 48 小时换警示色 —— 「有人等着答复」的信号 */
.pend-wait { color: var(--ok); font-weight: 500; }
.pend-wait.warn { color: var(--warn); font-weight: 600; }
.pend-acts { display: flex; gap: 8px; margin-top: 10px; }

/* 驳回弹窗的常用原因：点一下填入（不保留选中态 —— 输入框可自由改，
   选中态会跟内容失真），hover 才亮，暗示「可点」 */
.rj-why {
  height: 28px; padding: 0 12px; border-radius: 14px;
  border: 1px solid var(--line); background: #fff; color: var(--ink2);
  font-size: 12.5px; font-family: inherit; cursor: pointer;
  transition: border-color .14s ease, background .14s ease, color .14s ease;
}
.rj-why:hover { border-color: var(--brand); background: var(--brand-l); color: var(--brand-d); }

/* ===== 启动占位（2026-10-20）=====
   与登录页同一块深墨蓝渐变，视觉上「一打开就是繁露」，而不是一屏白。
   z-index 压过一切：js 没跑起来时它必须还在最上面。 */
.boot {
  position: fixed; inset: 0; z-index: 99;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: radial-gradient(120% 120% at 82% 0%, #1E4478 0%, #14325C 34%, #0E2340 64%, #0A1B33 100%);
}
.boot-mark {
  width: 64px; height: 64px; border-radius: 18px; margin-bottom: 16px;
  display: flex; align-items: center; justify-content: center;
  border: 1px solid rgba(203,170,121,.4); color: #E6C79A;
  font-size: 22px; letter-spacing: 1px;
  animation: bootPulse 1.6s ease-in-out infinite;
}
.boot-tip { color: rgba(255,255,255,.5); font-size: 13px; letter-spacing: 1px; }
.boot-retry {
  margin-top: 4px; height: 36px; padding: 0 22px; border-radius: 18px; cursor: pointer;
  border: 1px solid rgba(203,170,121,.5); background: transparent; color: #E6C79A;
  font-size: 13px; font-family: inherit; letter-spacing: 1px;
}
.boot-hint { margin-top: 14px; color: rgba(255,255,255,.32); font-size: 11.5px; }
@keyframes bootPulse { 0%, 100% { opacity: .55; } 50% { opacity: 1; } }

/* ===== 未捕获异常的黑匣子（2026-10-20）=====
   render() 的 try/catch 只管「渲染」那一段。事件处理器里抛的异常（点保存时
   某个字段是 undefined、点行取 id 时对象是 null）根本不经过它 ——
   浏览器只往控制台打一行，工厂看到的是「点了没反应」，反馈过来只有一句
   「按钮不好使」。这里接住，给一句人话 + 一个能复制的诊断。
   ⚠️ 不自动刷新、不自动重试：会把用户填了一半的表单吞掉。 */
.crashbar {
  position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%);
  z-index: 98; max-width: min(92vw, 620px);
  display: none; align-items: center; gap: 12px;
  padding: 10px 14px; border-radius: 12px;
  background: var(--ink); color: #fff; box-shadow: var(--sh2);
  font-size: 12.5px; line-height: 1.5;
}
.crashbar.on { display: flex; }
.crashbar .cb-msg { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.crashbar .cb-msg b { color: #E6C79A; font-weight: 600; }
.crashbar button {
  flex: none; height: 26px; padding: 0 11px; border-radius: 13px; cursor: pointer;
  border: 1px solid rgba(203,170,121,.45); background: transparent; color: #E6C79A;
  font-size: 12px; font-family: inherit;
}
.crashbar .cb-x { border-color: transparent; color: rgba(255,255,255,.45); padding: 0 4px; }

/* ===== 尊重「减弱动态效果」=====
   系统里开了这个开关的人（前庭功能敏感 / 晕动症），看到的是头晕而不是精致。
   只在系统要求时把**装饰性**动效压掉；功能性反馈（颜色/边框变化）保留，
   否则「点了没反应」又回来了 —— 所以压的是时长不是属性本身。 */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
}
