/* ==========================================================================
   策划写作 Agent · 统一界面层（ui.css）
   --------------------------------------------------------------------------
   改这个文件前先读三条：

   1. 这里只放「跨页共用」的东西：令牌、排版、顶栏、卡片、表格、按钮、表单、
      弹窗、空态。页面特有的版式（如 shop 的 hero、工单台的两栏）留在各页
      自己的 <style> 里，不要往这里加。
   2. 不再新增第二套配色。要换主色只改本文件 :root 里的 --brand 一组，
      所有页面跟着变。现在前台与后台已经统一为同一套墨绿。
   3. 选择器保持与历史 class 名一致（.card .btn .st-* .detw 等），
      因为大量表格与弹窗是 JS 拼字符串生成的，改 class 名会静默丢样式。
      —— 注意：注释里不要写「星号紧跟斜杠」，那会提前闭合注释，
      整段 :root 会被当成注释吞掉，表现是「变量全空、卡片没底色」。
   ========================================================================== */

/* ---------- 1. 设计令牌 ---------- */
:root {
  /* 墨色阶：正文不用纯黑，用带一点暖的深墨，长文阅读不刺眼 */
  --ink: #1C1B18;
  --ink2: #3B3934;
  --mut: #6E6B63;
  --mut2: #9A978E;
  --mut3: #B5B1A6;

  /* 线与面 */
  --line: rgba(28, 26, 20, .085);
  --line2: rgba(28, 26, 20, .15);
  --bg: #F5F3EE;
  --bg2: #FAF9F5;
  --surface: #FFFFFF;
  --surface2: #FBFAF6;

  /* 主色：墨绿。深度咨询的底色，也和门面（/shop）连得上 */
  --brand: #1E4A3A;
  --brand-d: #14352A;
  --brand-l: #EDF2EE;
  --brand-l2: #F4F8F5;

  /* 语义色：琥珀表示「等你动手」，砖红表示「坏了」，靛蓝表示「进行中」 */
  --accent: #9A5B12;
  --accent-l: #FBF0DC;
  --ok: #1E6B4F;
  --ok-l: #E8F2EC;
  --warn: #9A5B12;
  --warn-l: #FBF0DC;
  --bad: #A3382D;
  --bad-l: #FAEAEA;
  --info: #2A5389;
  --info-l: #EDF1F8;

  /* 圆角 */
  --r-sm: 6px;
  --r: 8px;
  --r-md: 10px;
  --r-lg: 12px;
  --r-xl: 16px;

  /* 阴影：极浅。这几页的密度已经很高，阴影重一点就脏 */
  --sh-sm: 0 1px 2px rgba(28, 26, 20, .045);
  --sh: 0 2px 6px rgba(28, 26, 20, .055);
  --sh-lg: 0 16px 44px rgba(28, 26, 20, .16);

  /* 字体 */
  --ff: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
        "Hiragino Sans GB", "Microsoft YaHei", system-ui, sans-serif;
  --ff-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;

  --nav-h: 56px;
  --ease: cubic-bezier(.2, .7, .3, 1);

  /* 页面宽度：顶栏、正文、侧栏共用同一个值，否则左边缘会差几十像素 */
  --page-w: 1280px;
}

/* 客户侧只用 1120：表格列少，太宽会让人眼横着跑 */
body.skin-client { --page-w: 1120px; }

/* ---------- 2. 基础 ---------- */
*, *::before, *::after { box-sizing: border-box; }

/* `hidden` 属性必须压过任何 display 声明。
   HTML 的 [hidden] 只是 UA 样式表里的一句 `display:none`，优先级最低——
   只要选择器里写了 `display`（`.kv{display:grid}`、`.btn{display:inline-flex}`），
   元素照样显示出来。实测踩过：收银台的「我已付款」按钮和金额明细，
   在不需要显示的时候一直挂在那儿。凡是用 `el.hidden = true` 控制的地方都会中招。 */
[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--ff);
  font-size: 14px;
  line-height: 1.65;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: none; }

img, svg { display: block; max-width: 100%; }

::selection { background: #D6E4DB; color: var(--ink); }

/* 只有键盘操作才画焦点环：鼠标点按钮不该出现一圈描边 */
:focus { outline: none; }
:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
  border-radius: 4px;
}

/* 细滚动条：表格横向滚动时不抢视觉 */
* { scrollbar-width: thin; scrollbar-color: #CFCBC0 transparent; }
*::-webkit-scrollbar { width: 9px; height: 9px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb {
  background: #D3CFC4;
  border-radius: 99px;
  border: 2px solid transparent;
  background-clip: content-box;
}
*::-webkit-scrollbar-thumb:hover { background: #B9B4A7; background-clip: content-box; }

/* ---------- 3. 排版 ---------- */
h1, h2, h3, h4 { margin: 0; font-weight: 500; letter-spacing: .005em; }

h1 { font-size: 20px; line-height: 1.4; letter-spacing: .01em; }

.sub, .desc {
  font-size: 12.5px;
  color: var(--mut);
  line-height: 1.85;
  margin: 5px 0 22px;
  max-width: 760px;
}
.sub b, .desc b { color: var(--ink2); font-weight: 500; }

.hint { font-size: 12px; color: var(--mut2); line-height: 1.7; margin: 6px 0 0; }
.mut, .muted { color: var(--mut2); font-size: 12px; }
.sub2 { font-size: 11px; color: var(--mut2); margin-top: 2px; line-height: 1.6; }
.nm { font-weight: 500; }
.mono {
  font-family: var(--ff-mono);
  font-variant-numeric: tabular-nums;
  letter-spacing: .01em;
}
.num, td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }

/* 区块小标题（前台工单台用） */
.card h2 {
  font-size: 12px;
  font-weight: 500;
  color: var(--mut);
  letter-spacing: .08em;
  margin: 0 0 14px;
}

.sep { height: 1px; background: var(--line); margin: 18px 0; border: 0; }

/* ---------- 4. 顶栏 ---------- */
header {
  position: sticky;
  top: 0;
  z-index: 30;
  background: rgba(255, 255, 255, .88);
  backdrop-filter: saturate(180%) blur(10px);
  -webkit-backdrop-filter: saturate(180%) blur(10px);
  border-bottom: 1px solid var(--line);
}

/* 注意：必须挂在 header 下。工单台渲染结果里也有一个 .bar（工序配比条），
   不加限定会把它撑成 56px 高的导航条。 */
header .bar {
  display: flex;
  align-items: center;
  gap: 22px;
  height: var(--nav-h);
  max-width: var(--page-w);
  margin: 0 auto;
  padding: 0 26px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 13.5px;
  font-weight: 500;
  letter-spacing: .02em;
  color: var(--ink);
  flex: none;
  white-space: nowrap;
}

/* 三条横线的方标：不用图片，任何分辨率都清楚 */
.mark {
  width: 21px;
  height: 21px;
  border: 1.5px solid var(--brand);
  border-radius: 5px;
  position: relative;
  flex: none;
}
.mark::after {
  content: "";
  position: absolute;
  left: 4.5px;
  top: 4.5px;
  width: 9px;
  height: 1.5px;
  background: var(--brand);
  box-shadow: 0 4px 0 var(--brand), 0 8px 0 var(--brand);
}

nav { display: flex; gap: 1px; margin-left: 2px; flex-wrap: wrap; min-width: 0; }

nav a {
  position: relative;
  font-size: 12.5px;
  color: var(--mut);
  padding: 6px 11px;
  border-radius: var(--r-sm);
  transition: color .14s var(--ease), background .14s var(--ease);
}
nav a:hover { background: rgba(28, 26, 20, .045); color: var(--ink); }
nav a.on { color: var(--brand); font-weight: 500; background: var(--brand-l); }

.who, .me {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  color: var(--mut2);
  flex: none;
}
.who b, .me b { font-weight: 500; color: var(--ink2); }

/* 用户名前的小圆头像：用 CSS 画，不请求外部图片 */
.who::before, .me::before {
  content: "";
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--brand-l);
  border: 1px solid rgba(30, 74, 58, .14);
  flex: none;
}

.who button, .me button {
  font-family: inherit;
  font-size: 12px;
  background: none;
  border: 0;
  color: var(--mut2);
  cursor: pointer;
  padding: 4px 6px;
  border-radius: var(--r-sm);
  transition: color .14s, background .14s;
}
.who button:hover, .me button:hover { color: var(--bad); background: var(--bad-l); }

/* 工单台历史结构 .top > .in 保留兼容，观感与 header 对齐 */
.top {
  position: sticky;
  top: 0;
  z-index: 30;
  background: rgba(255, 255, 255, .88);
  backdrop-filter: saturate(180%) blur(10px);
  -webkit-backdrop-filter: saturate(180%) blur(10px);
  border-bottom: 1px solid var(--line);
}
.top .in {
  display: flex;
  align-items: center;
  gap: 22px;
  height: var(--nav-h);
  max-width: var(--page-w);
  margin: 0 auto;
  padding: 0 26px;
}
.top .lg { display: flex; align-items: center; gap: 9px; font-size: 13.5px; font-weight: 500; flex: none; }
.top .mk {
  width: 21px; height: 21px; border: 1.5px solid var(--brand); border-radius: 5px;
  position: relative; flex: none;
}
.top .mk::after {
  content: ""; position: absolute; left: 4.5px; top: 4.5px; width: 9px; height: 1.5px;
  background: var(--brand); box-shadow: 0 4px 0 var(--brand), 0 8px 0 var(--brand);
}

/* ---------- 5. 页面骨架 ---------- */
main, .wrap { width: 100%; margin: 0 auto; }
main { max-width: var(--page-w); padding: 26px 26px 80px; }
.wrap { max-width: var(--page-w); padding: 26px 26px 72px; }

/* 后台工作区：左导航 + 右内容 */
.lay {
  display: grid;
  grid-template-columns: 204px minmax(0, 1fr);
  gap: 22px;
  max-width: var(--page-w);
  margin: 0 auto;
  padding: 22px 26px 72px;
  align-items: start;
}
@media (max-width: 940px) { .lay { grid-template-columns: minmax(0, 1fr); } }

/* .lay 自带内边距，里面的 main 不再重复加一圈，否则内容会窄掉 52px */
.lay > main { max-width: none; padding: 0; }

/* 只有中台那种「左导航 + 右内容」的布局才需要吸顶；
   登录页的左栏也是 aside，不能一起推走 */
.lay aside { position: sticky; top: calc(var(--nav-h) + 20px); }

.grp {
  /* 10px 是「塞得下才用」的字号，看着廉价。11px 仍是全站最小一级，
     层级不变，但不用凑近看。 */
  font-size: 11px;
  color: var(--mut3);
  letter-spacing: .06em;
  line-height: 1.6;
  margin: 14px 0 5px 10px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  font-weight: 400;
}
.grp:first-child { margin-top: 0; padding-top: 0; border-top: 0; }

aside a {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--ink2);
  padding: 7px 10px;
  border-radius: var(--r);
  margin-bottom: 1px;
  border-left: 2px solid transparent;
  transition: background .13s var(--ease), color .13s var(--ease);
}
aside a:hover { background: rgba(28, 26, 20, .05); }
aside a.on {
  background: var(--surface);
  color: var(--brand);
  font-weight: 500;
  border-left-color: var(--brand);
  box-shadow: var(--sh-sm);
}
aside a .n {
  margin-left: auto;
  font-size: 11px;
  color: var(--mut2);
  font-variant-numeric: tabular-nums;
  background: rgba(28, 26, 20, .05);
  padding: 0 5px;
  border-radius: 99px;
  line-height: 16px;
}
aside a.hot .n { color: #fff; background: var(--bad); }

/* ---------- 6. 卡片 ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 18px 20px;
  box-shadow: var(--sh-sm);
}
.card + .card, .card + table, table + .card { margin-top: 14px; }
.card h3 { font-size: 13.5px; font-weight: 500; margin-bottom: 3px; }
.card .s { font-size: 12px; color: var(--mut2); line-height: 1.75; margin-bottom: 13px; }

/* ---------- 7. KPI ---------- */
.kpis { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 18px; }

.kpi {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 11px 16px 12px;
  min-width: 124px;
  box-shadow: var(--sh-sm);
  overflow: hidden;
}
.kpi b {
  display: block;
  font-size: 20px;
  font-weight: 500;
  line-height: 1.3;
  letter-spacing: -.015em;
  font-variant-numeric: tabular-nums;
}
.kpi span { font-size: 12px; color: var(--mut2); }

/* 有状态的 KPI 用左边缘一条色条说话，比给整块上色安静 */
.kpi.ok b { color: var(--ok); }
.kpi.hot b { color: var(--warn); }
.kpi.bad b { color: var(--bad); }
/* 一排 KPI 靠数字颜色区分状态就够了。早先给每张卡加了 3px 左色条，
   结果一排卡片的左边缘看起来不齐，反而更乱，所以去掉。 */

/* 到期提醒条 */
.due { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.due .d {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 8px 14px;
  font-size: 12.5px;
  cursor: pointer;
  display: flex;
  gap: 8px;
  align-items: center;
  box-shadow: var(--sh-sm);
  transition: border-color .14s, transform .14s var(--ease);
}
.due .d b { font-size: 16px; font-weight: 500; font-variant-numeric: tabular-nums; }
.due .d:hover { border-color: rgba(30, 74, 58, .38); transform: translateY(-1px); }
.due .d.bad b { color: var(--bad); }
.due .d.hot b { color: var(--warn); }

/* ---------- 8. 表格 ---------- */
table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  overflow: hidden;
  font-size: 13px;
}

thead th {
  font-size: 12px;
  font-weight: 500;
  color: var(--mut2);
  text-align: left;
  padding: 10px 13px;
  background: var(--surface2);
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}

tbody td {
  padding: 10px 13px;
  overflow-wrap: break-word;
  border-bottom: 1px solid rgba(28, 26, 20, .055);
  vertical-align: middle;
}
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: #FCFBF7; }

/* 展开行不参与 hover 高亮，否则层次会乱 */
tr.det { display: none; }
tr.det.on { display: table-row; }
tr.det > td { background: var(--surface2); padding: 0; border-bottom: 1px solid var(--line); }
tr.det:hover > td { background: var(--surface2); }
.detw { padding: 18px 20px 20px; }

tr.row { cursor: pointer; }
tr.row.on td { background: var(--brand-l2); }

/* 表格里的编号徽标 */
.pid, .pcode, .c-pid {
  font-size: 11px;
  color: var(--mut2);
  background: rgba(28, 26, 20, .055);
  padding: 1px 5px;
  border-radius: 3px;
  margin-right: 6px;
  font-variant-numeric: tabular-nums;
  vertical-align: 1px;
}

/* 表格内嵌小表（明细、流水） */
table.mini {
  border: 0;
  border-radius: 0;
  background: none;
  font-size: 12px;
}
table.mini th {
  background: none;
  padding: 6px 8px;
  border-bottom: 1px solid var(--line2);
  font-size: 11px;
}
table.mini td {
  padding: 6px 8px;
  font-size: 12px;
  border-bottom: 1px dashed rgba(28, 26, 20, .07);
}
table.mini tbody tr:hover td { background: none; }
/* 单号不许折行：折了就认不出是哪一单 */
.no, .orderno { white-space: nowrap; }
table.mini tbody tr:last-child td { border-bottom: 0; }

/* ---------- 9. 按钮 ---------- */
.btn, .btn2, .btn-ok, .btn-no {
  font-family: inherit;
  font-size: 12.5px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 34px;
  padding: 0 15px;
  border-radius: var(--r);
  border: 1px solid transparent;
  background: var(--brand);
  color: #fff;
  cursor: pointer;
  white-space: nowrap;
  transition: background .14s var(--ease), border-color .14s var(--ease),
              transform .1s var(--ease), box-shadow .14s var(--ease);
  box-shadow: var(--sh-sm);
}
.btn:hover, .btn-ok:hover { background: var(--brand-d); }
.btn:active, .btn-ok:active { transform: translateY(1px); box-shadow: none; }

/* 次按钮：白底细边，一屏里只留一个主按钮 */
.btn.ghost, .btn2 {
  background: var(--surface);
  color: var(--ink2);
  border-color: var(--line2);
  box-shadow: var(--sh-sm);
}
.btn.ghost:hover, .btn2:hover {
  background: var(--surface2);
  border-color: rgba(28, 26, 20, .24);
  color: var(--ink);
}

.btn.ok, .btn-ok { background: var(--brand); color: #fff; }
.btn.ok:hover { background: var(--brand-d); }

.btn.no, .btn-no {
  background: var(--surface);
  color: var(--bad);
  border-color: rgba(163, 56, 45, .3);
}
.btn.no:hover, .btn-no:hover { background: var(--bad-l); }

.btn.sm, .btn2.sm { height: 28px; font-size: 12px; padding: 0 10px; border-radius: var(--r-sm); }
.btn.lg { height: 42px; font-size: 13.5px; padding: 0 22px; }
.btn.block { width: 100%; }
.btn.pill { border-radius: 99px; }

.btn:disabled, .btn-ok:disabled, .btn-no:disabled {
  opacity: .45;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.ops { display: flex; gap: 6px; white-space: nowrap; align-items: center; }
.acts {
  display: flex;
  gap: 9px;
  justify-content: flex-end;
  align-items: center;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

/* ---------- 10. 表单 ---------- */
/* 选择器必须覆盖「没写 type」的 input。
   早先只列了 input[type=text] 等类型，而 <input id="prod"> 这种不写 type 的
   一个都匹配不到——登录框、下单表单、门面留资表单全部退化成浏览器默认样式
   （padding 1px 2px、字号 13.33px，手机上只有 21px 高，点起来费劲）。
   所以改成「排除非文本类型」，新加的输入框不写 type 也有样式。 */
input:not([type=checkbox]):not([type=radio]):not([type=submit]):not([type=button])
:not([type=reset]):not([type=file]):not([type=hidden]):not([type=image])
:not([type=range]):not([type=color]),
select, textarea {
  font-family: inherit;
  font-size: 12.5px;
  color: var(--ink);
  height: 34px;
  padding: 0 10px;
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--line2);
  border-radius: var(--r);
  outline: none;
  transition: border-color .14s var(--ease), box-shadow .14s var(--ease), background .14s;
  appearance: none;
  -webkit-appearance: none;
}
textarea {
  height: auto;
  min-height: 64px;
  padding: 8px 10px;
  line-height: 1.7;
  resize: vertical;
}
select {
  background-image: url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%236E6B63' stroke-width='1.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 28px;
}
input::placeholder, textarea::placeholder { color: var(--mut3); }
input:hover, select:hover, textarea:hover { border-color: rgba(28, 26, 20, .24); }
input:focus, select:focus, textarea:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(30, 74, 58, .1);
}
input:disabled, select:disabled, textarea:disabled {
  background: var(--bg2);
  color: var(--mut);
  cursor: not-allowed;
}
input[type=checkbox], input[type=radio] {
  width: 14px;
  height: 14px;
  accent-color: var(--brand);
  flex: none;
  cursor: pointer;
}

label.f, .lab {
  display: block;
  font-size: 12px;
  color: var(--mut);
  margin: 0 0 5px;
  letter-spacing: .01em;
}

.form { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; align-items: end; }
.form label { display: block; font-size: 12px; color: var(--mut); margin-bottom: 5px; }
.form .full { grid-column: 1 / -1; }
.form .wide { grid-column: span 2; }
.form .act { display: flex; gap: 8px; justify-content: flex-end; }
.form .hint { font-size: 11px; color: var(--mut3); margin-top: 4px; line-height: 1.55; }

.tool { display: flex; gap: 8px; align-items: center; margin-bottom: 12px; flex-wrap: wrap; }
.tool input, .tool select { width: auto; }
.tool .grow { flex: 1; min-width: 150px; }

/* 多选胶囊（筛选器） */
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip {
  font-size: 12px;
  padding: 5px 11px;
  border-radius: var(--r-sm);
  border: 1px solid var(--line2);
  background: var(--surface);
  color: var(--mut);
  cursor: pointer;
  user-select: none;
  transition: all .13s var(--ease);
}
.chip:hover { border-color: rgba(28, 26, 20, .26); color: var(--ink); }
.chip.on { background: var(--brand-l); border-color: rgba(30, 74, 58, .45); color: var(--brand); font-weight: 500; }

/* 标签页 */
.tabs {
  display: flex;
  gap: 2px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 20px;
}
.tabs button {
  font-family: inherit;
  font-size: 13px;
  color: var(--mut);
  background: none;
  border: 0;
  padding: 9px 14px 10px;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: color .14s, border-color .14s;
}
.tabs button:hover { color: var(--ink); }
.tabs button.on { color: var(--brand); border-bottom-color: var(--brand); font-weight: 500; }
.tabs .cnt { font-size: 11px; color: var(--mut3); margin-left: 5px; font-variant-numeric: tabular-nums; }
section { display: none; }
section.on { display: block; }

/* ---------- 11. 状态标签 ---------- */
.st, .tag, .pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  line-height: 1;
  padding: 4px 8px;
  border-radius: 5px;
  white-space: nowrap;
  background: rgba(28, 26, 20, .055);
  color: var(--mut);
  font-variant-numeric: tabular-nums;
}
.st::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
  opacity: .7;
  flex: none;
}
.st-on, .st-paid, .st-ok, .tag.ok, .st-accepted { background: var(--ok-l); color: var(--ok); }
.st-off { background: rgba(28, 26, 20, .055); color: var(--mut2); }
.st-off::before { opacity: .35; }
.st-warn, .st-partial, .st-pending, .tag.warn { background: var(--warn-l); color: var(--warn); }
.st-bad, .st-overdue, .st-rejected { background: var(--bad-l); color: var(--bad); }
.st-info, .st-open { background: var(--info-l); color: var(--info); }

.pill { border-radius: 99px; padding: 5px 11px; font-size: 12px; color: var(--ink2); }
.pill b { font-weight: 600; color: var(--brand); }

/* ---------- 12. 提示块 ---------- */
.note {
  font-size: 12px;
  color: var(--mut);
  line-height: 1.9;
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 3px solid rgba(30, 74, 58, .3);
  border-radius: var(--r-md);
  padding: 11px 15px;
  margin-bottom: 14px;
}
.note b { color: var(--ink2); font-weight: 500; }
.note.bad { border-color: rgba(163, 56, 45, .25); border-left-color: var(--bad); background: #FDF8F7; }

.warnbox {
  display: none;
  margin-top: 12px;
  padding: 13px 15px;
  background: #FDF8F7;
  border: 1px solid rgba(163, 56, 45, .2);
  border-radius: var(--r-md);
}
.warnbox.on { display: block; }
.warnbox .t { font-size: 12px; color: var(--bad); margin-bottom: 8px; line-height: 1.65; }
.warnbox .row { display: flex; gap: 8px; align-items: center; margin-top: 9px; }

/* ---------- 13. 键值行 ---------- */
.kv { font-size: 12.5px; line-height: 2; color: var(--ink2); }
.kv i { font-style: normal; color: var(--mut2); display: inline-block; min-width: 76px; }

/* ---------- 14. 弹窗 ---------- */
.mask {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: none;
  align-items: flex-start;
  justify-content: center;
  padding: 64px 18px 24px;
  overflow: auto;
  background: rgba(24, 22, 18, .38);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
}
.mask.on, .mask.hide { display: none; }
.mask.on { display: flex; }
.mask:not(.hide):not(.on) { display: none; }
/* 兼容旧写法：.mask 直接可见（工单台用 .mask.hide 控制） */
.mask.show { display: flex; }

.dlg, .box {
  position: relative;
  width: 100%;
  max-width: 620px;
  background: var(--surface);
  border-radius: var(--r-xl);
  padding: 22px 24px 20px;
  box-shadow: var(--sh-lg);
  animation: pop .18s var(--ease) both;
}
@keyframes pop {
  from { opacity: 0; transform: translateY(-8px) scale(.99); }
  to { opacity: 1; transform: none; }
}
.dlg h3, .box h3 { font-size: 16px; font-weight: 500; margin: 0 0 5px; }
.dlg .s, .box .sub { font-size: 12.5px; color: var(--mut); line-height: 1.8; margin: 0 0 16px; }

/* ---------- 15. Toast ---------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: 32px;
  z-index: 99;
  transform: translateX(-50%) translateY(14px);
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: min(560px, 86vw);
  padding: 11px 18px;
  font-size: 13px;
  line-height: 1.6;
  color: #fff;
  background: #24221D;
  border-radius: var(--r-md);
  box-shadow: 0 10px 30px rgba(0, 0, 0, .22);
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s var(--ease), transform .2s var(--ease);
}
.toast.on { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.bad, .toast.err { background: var(--bad); }
.toast.ok { background: var(--brand); }

/* ---------- 16. 空态与加载 ---------- */
.empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  background: var(--surface);
  border: 1px dashed rgba(28, 26, 20, .14);
  border-radius: var(--r-lg);
  padding: 44px 22px;
  text-align: center;
  color: var(--mut2);
  font-size: 13px;
  line-height: 1.9;
  min-height: 0;
}
.empty b { display: block; font-size: 14.5px; color: var(--ink2); font-weight: 500; }
.empty a { margin-top: 10px; font-size: 13px; color: var(--brand); }
/* 空态只用文字。早先加过一个虚线小方块，在只有一句话的空态里
   看起来像个没加载出来的图标，去掉。 */

/* 表格里的空行：td 被设成 flex 会把整行撑坏，单独还原 */
td.empty, .empty.inline {
  display: table-cell;
  border: 0;
  background: none;
  padding: 24px 12px;
  text-align: center;
  border-radius: 0;
}

/* 骨架：只给首屏加载用，别给按钮加 */
.skel {
  background: linear-gradient(90deg, #F1EFE9 25%, #F8F6F1 37%, #F1EFE9 63%);
  background-size: 400% 100%;
  animation: shimmer 1.3s ease-in-out infinite;
  border-radius: var(--r-sm);
  color: transparent;
}
@keyframes shimmer {
  from { background-position: 100% 0; }
  to { background-position: 0 0; }
}

/* ---------- 17. 杂项 ---------- */
.prog { display: flex; align-items: center; gap: 8px; min-width: 100px; }
.prog .track {
  flex: 1;
  height: 4px;
  min-width: 44px;
  background: rgba(28, 26, 20, .09);
  border-radius: 99px;
  overflow: hidden;
}
.prog .track i { display: block; height: 100%; background: var(--brand); border-radius: 99px; transition: width .3s var(--ease); }
.prog .txt { font-size: 12px; color: var(--mut); font-variant-numeric: tabular-nums; white-space: nowrap; }
.prog.full .txt { color: var(--brand); font-weight: 500; }
.prog.full .track i { background: var(--ok); }

.pos { color: var(--ok); }
.neg { color: var(--bad); }
.old { color: var(--mut2); text-decoration: line-through; }
.new { color: var(--brand); }
.aud-diff { font-size: 12px; color: var(--ink2); font-variant-numeric: tabular-nums; }
.aud-diff i { font-style: normal; color: var(--mut2); }

/* 交付文件行 */
.files { font-size: 12.5px; line-height: 1.95; }
.files .f { border-bottom: 1px dashed rgba(28, 26, 20, .08); padding: 6px 0; }
.files .f:last-child { border-bottom: 0; }
.files .f a { display: inline-block; margin-right: 12px; }
.files .f a.dl { font-size: 12px; color: var(--mut); }
.files .f .nm { font-weight: 400; }
.files .f .dt { color: var(--mut2); font-size: 12px; margin-left: 6px; }

/* 编号清单（交付范围） */
ol.scope { list-style: none; counter-reset: s; margin: 0; padding: 0; font-size: 12.5px; line-height: 1.95; color: var(--ink2); }
ol.scope li { counter-increment: s; padding-left: 26px; position: relative; }
ol.scope li::before {
  content: counter(s, decimal-leading-zero);
  position: absolute; left: 0; top: 2px;
  color: var(--mut3); font-size: 11px; font-variant-numeric: tabular-nums;
}

/* 验收条 */
.acc {
  border: 1px solid var(--line);
  border-left: 3px solid var(--brand);
  border-radius: var(--r-md);
  padding: 13px 15px;
  font-size: 12.5px;
  line-height: 1.8;
  background: var(--surface);
}
.acc b { font-weight: 500; display: block; margin-bottom: 2px; }
.acc p { color: var(--mut); margin: 2px 0; }
.acc.done { background: var(--brand-l2); }
.acc.wait { border-left-color: var(--warn); background: #FDFAF3; }
.accbtns { display: flex; gap: 8px; margin-top: 10px; }
.accform { display: none; margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--line2); }
.accform.on { display: block; }
.accform .row { display: flex; gap: 8px; margin-top: 8px; }

/* 待办条 */
.todo {
  display: none;
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 3px solid var(--warn);
  border-radius: var(--r-md);
  padding: 13px 17px;
  margin-bottom: 18px;
  font-size: 13px;
  box-shadow: var(--sh-sm);
}
.todo.on { display: block; }
.todo b { font-weight: 500; }
.todo p { color: var(--mut); font-size: 12.5px; margin-top: 3px; }

/* 页脚小字 */
.foot { margin-top: 26px; font-size: 12px; color: var(--mut2); line-height: 1.9; }
.fine { font-size: 12px; color: var(--mut2); line-height: 2; }

/* ---------- 18. 响应式与动效偏好 ---------- */
@media (max-width: 760px) {
  main, .wrap, .lay { padding-left: 16px; padding-right: 16px; }
  .bar, .top .in { padding: 0 16px; gap: 12px; }

  /* 手机上的导航：横向滚动，不允许把字挤成竖排。
     早先只写了 overflow-x，但 nav 仍会被 flex 压到最窄，结果为「工单台」三个字竖着叠。 */
  nav { flex: 1 1 auto; min-width: 0; overflow-x: auto; flex-wrap: nowrap; }
  nav::-webkit-scrollbar { display: none; }
  nav a { white-space: nowrap; flex: none; }
  .who b, .me b { display: none; }

  h1 { font-size: 18px; }
  .kpi { min-width: 104px; padding: 10px 13px; }
  .kpi b { font-size: 18px; }

  /* 多列表格在小屏放不下：让所在容器横滚。
     光给 table 设 min-width 不够——table-layout:auto 会优先满足「单号」这类
     不可断的长串，把「产品」列压到只剩一个字宽，看起来像竖排。
     所以给每一列一个宽度下限，宁可横滚也不要挤。 */
  main > div, .lay > main > div { overflow-x: auto; }
  table:not(.mini) td, table:not(.mini) th { min-width: 104px; }
  .card { overflow-x: auto; }

  /* 输入框：字号必须到 16px。
     iOS Safari 在 input 字号小于 16px 时，一聚焦就把整页放大，
     用户得手动缩回去——这是移动端表单最常见的「莫名其妙」体验问题。
     高度同时抬到 42，手指点得准。 */
  input:not([type=checkbox]):not([type=radio]):not([type=submit]):not([type=button]),
  select, textarea {
    font-size: 16px;
    height: 42px;
    padding: 0 12px;
  }
  textarea { height: auto; min-height: 96px; padding: 10px 12px; line-height: 1.6; }
  select { padding-right: 30px; }

  /* 顶栏右侧「退出」这类文字按钮：命中区抬到 36，避免点空 */
  .who a, .who button, .me a, .me button, header .bar > a, .bar .who > * {
    min-height: 36px;
    display: inline-flex;
    align-items: center;
    /* 左右只留 2px：给到 6px 时，360 宽下「退出」会把整个 .who 顶出视口
       （实测 363 > 360），溢出比点不准更糟。 */
    padding: 0 2px;
  }

  /* 页脚与正文内联链接：手机上 15px 高基本点不中，给上下内边距。
     **必须排除按钮**：`.foot .btn` 是 `<a class="btn">`，被这条改成 block 之后
     左右内边距归零、inline-flex 失效，文字贴边；而同一个 .foot 里的
     `<button class="btn">` 不受影响——两个按钮并排却长得不一样。 */
  .foot a:not(.btn):not(.btn2):not(.btn-ok):not(.btn-no),
  .fine a:not(.btn):not(.btn2):not(.btn-ok):not(.btn-no),
  footer a:not(.btn):not(.btn2):not(.btn-ok):not(.btn-no) {
    padding: 6px 0;
    display: inline-block;
  }

  /* 页脚按钮是这一页最后的动作，手机上不能只有 34 高 */
  .foot .btn, .foot .btn2, .foot .btn-ok, .foot .btn-no {
    min-height: 44px;
    font-size: 13.5px;
  }

  /* 卡片上的「开始这一项 / 查看」这类文字 CTA：抬到 44，
     它是转化的落点，不能只有一行字那么高 */
  .card .go, .go { min-height: 44px; display: flex; align-items: center; }

  /* 段落里的行内链接（忘记密码 / 去提交一个新工单 / 申请注销）：
     文字只有 16px 高，手指点十次中三次。给垂直内边距扩命中区，
     行内元素加 padding 不影响行盒高度，所以排版不会动。 */
  main p > a, main li > a, .card p > a, .auth p > a, .empty a, .blank a, #forgot {
    padding-top: 8px;
    padding-bottom: 8px;
  }

  /* 顶栏 logo 是可点的回首页入口，26px 高偏窄 */
  .lg, .logo, .me .mk { min-height: 34px; display: inline-flex; align-items: center; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
}

/* 打印：不留导航、按钮和弹窗 */
@media print {
  header, .top, nav, .who, .me, .btn, .tabs, .mask, .toast { display: none !important; }
  body { background: #fff; }
  .card, table { box-shadow: none; border-color: #ddd; }
}
