/* =====================================================
   德尔克斯工作台 · 全局样式
   视觉方案：C 天青扁平
   —— 白色导航栏 + 天青主色；卡片仅描边不投影；操作台为「主内容 + 右侧待办栏」双列
   主题变量：主色系（--primary 等）由 JS 注入，管理员可在「权限管理 → 界面主题」改，
             默认为天青蓝 #2f6bff；侧栏固定白底，只随主色微调强调色。
   ===================================================== */
:root {
  /* 主色系（JS 可覆盖，勿在组件里写死颜色） */
  --primary: #2f6bff;
  --primary-dark: #1f4fd8;
  --primary-light: #e8efff;
  --primary-soft: #f4f7ff;
  --primary-ring: rgba(47, 107, 255, .16);

  /* 语义色 */
  --green: #12a06b;
  --red: #e04b4b;
  --orange: #d98a1c;

  /* 中性 */
  --bg: #f5f8fc;
  --card: #ffffff;
  --text: #16213a;
  --text-2: #697792;
  --text-3: #93a0b8;
  --border: #e5ebf5;
  --border-2: #eef2f9;

  /* 侧栏（浅色固定） */
  --side-bg: #ffffff;
  --side-text: #5b6883;
  --side-w: 212px;

  /* 形状与层次 */
  --radius: 10px;
  --radius-sm: 8px;
  --shadow: 0 1px 2px rgba(22, 33, 58, .04);
  --shadow-md: 0 8px 22px -14px rgba(22, 33, 58, .28);
  --shadow-primary: 0 6px 18px -12px rgba(22, 33, 58, .30);
  --tr: .16s cubic-bezier(.4, 0, .2, 1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
  background: var(--bg); color: var(--text);
  font-size: 14px; line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
button { font-family: inherit; cursor: pointer; }
a { color: var(--primary); }
::selection { background: var(--primary); color: #fff; }

/* 滚动条：细、浅、悬停才加深 */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: rgba(120, 134, 156, .30); border-radius: 8px; border: 3px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-thumb:hover { background: rgba(120, 134, 156, .55); border: 3px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-track { background: transparent; }

/* ---------- 表单控件 ---------- */
input, select, textarea {
  font-family: inherit; font-size: 13.5px; padding: 8px 11px;
  border: 1px solid var(--border); border-radius: var(--radius-sm); width: 100%;
  background: #fff; color: var(--text);
  transition: border-color var(--tr), box-shadow var(--tr);
}
input:hover, select:hover, textarea:hover { border-color: #cfd9ea; }
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-ring);
}
input[disabled], select[disabled], textarea[disabled] { background: var(--primary-soft); color: var(--text-3); cursor: not-allowed; }
label { display: block; font-size: 12.5px; color: var(--text-2); margin: 10px 0 5px; font-weight: 500; }

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 6px; justify-content: center;
  padding: 8px 14px; border-radius: var(--radius-sm); border: 1px solid var(--border);
  background: #fff; color: var(--text); font-size: 13.5px; font-weight: 600;
  text-decoration: none; white-space: nowrap; user-select: none;
  transition: background var(--tr), border-color var(--tr), color var(--tr), box-shadow var(--tr);
}
.btn:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-soft); }
.btn:active { transform: translateY(.5px); }
.btn:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--primary-ring); }
.btn-primary {
  background: var(--primary); border-color: transparent; color: #fff;
  box-shadow: 0 4px 12px -6px var(--primary);
}
.btn-primary:hover { background: var(--primary-dark); color: #fff; border-color: transparent; }
.btn-sm { padding: 4px 10px; font-size: 12.5px; border-radius: 7px; gap: 4px; }
.btn-danger { color: var(--red); }
.btn-danger:hover { border-color: var(--red); color: var(--red); background: rgba(224, 75, 75, .06); }
.btn[disabled] { opacity: .5; cursor: not-allowed; pointer-events: none; }
/* 报价单/合同单据筛选 tab：未选=白底描边，选中=主色实心+白字，SVG 图标 stroke=currentColor 同步变白 */
.tabbtn { border: 1px solid var(--border); background: #fff; color: var(--text); }
.tabbtn.on, .tabbtn.on:hover {
  background: var(--primary); border-color: var(--primary); color: #fff;
  box-shadow: 0 4px 12px -6px var(--primary);
}
.tabbtn.on svg { stroke: #fff; }

/* 报价单/合同客户区：历史客户框收窄、新建客户按钮略加宽；空选时显示占位灰字 */
.doc-cus-row { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; }
.doc-cus-picker { flex: 0 1 320px; min-width: 220px; }
.doc-cus-picker .cus-picker { height: 38px; padding: 8px 11px; }
.doc-cus-new { flex: 0 0 160px; height: 38px; padding-top: 8px; padding-bottom: 8px; }
.doc-cus-date { flex: 0 0 210px; min-width: 150px; margin-left: auto; }
select.cus-picker.is-placeholder { color: var(--text-3); }
select.cus-picker.is-placeholder option { color: var(--text); }

/* ---------- 登录页（浅色 · 天青点缀） ---------- */
.login-wrap {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  padding: 24px; position: relative; overflow: hidden;
  background:
    radial-gradient(1100px 540px at 8% -12%, #e4edff 0%, rgba(255, 255, 255, 0) 62%),
    radial-gradient(880px 500px at 104% 4%, #edf3ff 0%, rgba(255, 255, 255, 0) 58%),
    var(--bg);
}
.login-wrap::before, .login-wrap::after {
  content: ""; position: absolute; border-radius: 50%; pointer-events: none;
  border: 1px solid rgba(47, 107, 255, .10);
}
.login-wrap::before { width: 520px; height: 520px; top: -190px; right: -140px; }
.login-wrap::after { width: 340px; height: 340px; bottom: -140px; left: -100px; border-color: rgba(47, 107, 255, .08); }
.login-card {
  width: 100%; max-width: 392px; background: var(--card);
  border: 1px solid var(--border); border-radius: 16px; padding: 34px 30px;
  box-shadow: 0 20px 52px -24px rgba(22, 33, 58, .30);
  position: relative; z-index: 1; animation: popIn .3s cubic-bezier(.34, 1.3, .64, 1) both;
}
.login-card::before {
  content: ""; position: absolute; top: 0; left: 18px; right: 18px; height: 3px; border-radius: 0 0 3px 3px;
  background: linear-gradient(90deg, var(--primary), rgba(47, 107, 255, .18));
}
.login-card h1 { font-size: 21px; text-align: center; margin-bottom: 5px; color: var(--text); letter-spacing: -.2px; }
.login-card .sub { text-align: center; color: var(--text-3); margin-bottom: 24px; font-size: 12.5px; }
.login-err { color: var(--red); font-size: 12.5px; margin-top: 10px; min-height: 18px; }
.login-row { display: flex; gap: 8px; }
.login-row input { flex: 1; }
.divider { display: flex; align-items: center; gap: 12px; color: var(--text-3); font-size: 12px; margin: 20px 0 12px; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--border); }

/* ---------- 整体骨架 ---------- */
.shell { display: flex; min-height: 100vh; }
.sidebar {
  width: var(--side-w); background: var(--side-bg);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column; position: fixed; top: 0; bottom: 0; left: 0; z-index: 40;
}
.brand {
  padding: 17px 16px 15px; display: flex; align-items: center; gap: 9px;
  border-bottom: 1px solid var(--border-2);
}
/* 品牌标记：主色圆角方块 + 白色圆点 */
.brand::before {
  content: ""; width: 26px; height: 26px; border-radius: 8px; flex: none;
  background: radial-gradient(circle at 50% 50%, #fff 2.4px, rgba(255, 255, 255, 0) 3.4px), var(--primary);
  box-shadow: 0 4px 10px -4px rgba(47, 107, 255, .55);
}
.brand-txt { flex: 1; min-width: 0; }
.brand-txt .bt {
  display: block; font-size: 14.5px; font-weight: 700; color: var(--text);
  letter-spacing: .3px; line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.brand small {
  display: block; font-size: 10.5px; color: var(--text-3); font-weight: 400; margin-top: 2px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.nav { flex: 1; overflow-y: auto; padding: 6px 0 10px; }
.nav-group {
  font-size: 10px; color: var(--text-3); font-weight: 700; letter-spacing: 1.4px;
  padding: 14px 18px 5px;
}
.nav a {
  display: flex; align-items: center; gap: 9px; margin: 1px 8px; padding: 8px 11px;
  border-radius: var(--radius-sm); color: var(--side-text); text-decoration: none;
  font-size: 13.5px; font-weight: 500; position: relative;
  transition: background var(--tr), color var(--tr);
}
.nav a:hover { background: #f2f6ff; color: var(--text); }
.nav a.active { background: var(--primary-light); color: var(--primary); font-weight: 650; }
.nav a.active::before {
  content: ""; position: absolute; left: -8px; top: 7px; bottom: 7px; width: 3px;
  border-radius: 0 3px 3px 0; background: var(--primary);
}
.nav a .de { font-size: 15px; width: 18px; text-align: center; flex: none; line-height: 1; }

/* 侧栏在线成员 */
.online-box { padding: 8px 0 6px; border-top: 1px solid var(--border); max-height: 150px; overflow-y: auto; }
.online-title { padding: 3px 16px 6px; font-weight: 700; color: var(--text-3); font-size: 11px; letter-spacing: .4px; }
.online-item { padding: 3px 16px; display: flex; align-items: center; gap: 7px; color: var(--side-text); font-size: 12px; }
.online-item .dot {
  width: 6px; height: 6px; border-radius: 50%; background: var(--green);
  box-shadow: 0 0 0 3px rgba(18, 160, 107, .14); flex: none;
}
.online-item .dot.self { background: #e2a336; box-shadow: 0 0 0 3px rgba(226, 163, 54, .16); }
.online-item .online-tag { margin-left: auto; font-size: 10px; color: #a5761c; }

.side-user {
  border-top: 1px solid var(--border); padding: 11px 14px; font-size: 12px;
  display: flex; align-items: center; justify-content: space-between; gap: 8px; color: var(--text-2);
}
.side-user .who { min-width: 0; }
.side-user .who b { display: block; font-size: 12.5px; color: var(--text); font-weight: 650; }
.side-user .who span { color: var(--text-3); font-size: 11px; }
.side-user .btn { padding: 4px 9px; font-size: 12px; }

.main { flex: 1; margin-left: var(--side-w); display: flex; flex-direction: column; min-width: 0; }
/* 手机端顶栏（桌面隐藏） */
.topbar {
  display: none; align-items: center; gap: 10px; padding: 10px 14px;
  background: var(--card); border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 30;
}
.topbar .brand-m { font-weight: 700; font-size: 14.5px; color: var(--text); }
.hamburger, .bell {
  border: 1px solid var(--border); background: var(--card); border-radius: 9px;
  width: 34px; height: 34px; font-size: 15px; display: inline-flex; align-items: center; justify-content: center;
  color: var(--text); transition: var(--tr); flex: none;
}
.hamburger:hover, .bell:hover { border-color: var(--primary); color: var(--primary); }
.bell { position: relative; }
.bell .badge-n {
  position: absolute; top: -5px; right: -5px; background: var(--red); color: #fff;
  font-size: 10px; border-radius: 999px; min-width: 16px; height: 16px; line-height: 16px;
  text-align: center; padding: 0 3px; display: none; border: 2px solid var(--card);
}
.bell .badge-n.on { display: block; animation: popIn .25s ease both; }

.content { padding: 24px 26px 44px; max-width: 1320px; width: 100%; animation: fadeUp .26s ease both; }
.page-title {
  font-size: 19px; font-weight: 700; letter-spacing: -.2px;
  margin-bottom: 16px; display: flex; align-items: center; gap: 8px;
}
.backlink {
  display: inline-flex; align-items: center; gap: 4px; margin-bottom: 12px;
  color: var(--text-2); text-decoration: none; font-size: 12.5px; font-weight: 600;
  padding: 4px 11px 4px 9px; border-radius: 999px; border: 1px solid var(--border); background: #fff;
  transition: var(--tr);
}
.backlink:hover { color: var(--primary); border-color: var(--primary); background: var(--primary-soft); }

/* ---------- 页头（操作台等主页面） ---------- */
.phead { display: flex; align-items: flex-start; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.phead-l { min-width: 0; flex: 1; }
.phead-t { margin: 0; font-size: 20px; font-weight: 700; letter-spacing: -.2px; display: flex; align-items: center; gap: 8px; color: var(--text); }
.phead-s { margin: 6px 0 0; font-size: 12.5px; color: var(--text-2); }
.phead-r { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

/* ---------- 双列：主内容 + 右侧待办栏 ---------- */
.hub-cols { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 18px; align-items: start; margin-bottom: 22px; }
.hub-main { min-width: 0; }
.hub-side { min-width: 0; }
.side-card {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 15px 16px; margin-bottom: 12px;
}
.side-card h3 { margin: 0 0 10px; font-size: 13px; font-weight: 700; letter-spacing: .2px; color: var(--text); }
.todo { display: flex; flex-direction: column; gap: 2px; }
.todo a {
  display: flex; align-items: center; gap: 9px; padding: 8px 7px; border-radius: 8px;
  text-decoration: none; color: var(--text); font-size: 13px; transition: background var(--tr);
}
.todo a:hover { background: var(--primary-soft); }
.todo .n {
  margin-left: auto; background: var(--primary-light); color: var(--primary);
  font-size: 11.5px; font-weight: 700; border-radius: 99px; padding: 1px 8px;
  min-width: 22px; text-align: center; font-variant-numeric: tabular-nums;
}
.todo .n.warn { background: rgba(224, 75, 75, .12); color: #cf423c; }
.todo .n.zero { background: #f1f4f9; color: var(--text-3); }
.quick { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.quick a {
  display: block; padding: 10px 8px; border-radius: 9px; border: 1px dashed var(--border);
  background: transparent; font-size: 12.5px; color: var(--text-2); text-align: center;
  text-decoration: none; transition: var(--tr);
}
.quick a:hover { border-style: solid; border-color: var(--primary); color: var(--primary); background: var(--primary-soft); }

/* 分区标题 */
.sec-h { display: flex; align-items: baseline; gap: 10px; margin: 2px 0 12px; }
.sec-h h2 { margin: 0; font-size: 14.5px; font-weight: 700; letter-spacing: .2px; color: var(--text); }
.sec-h .hint { font-size: 12px; color: var(--text-3); }

/* ---------- 卡片 ---------- */
.card {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 16px; margin-bottom: 16px;
}
/* 后台模块：默认收起，点标题行展开；箭头随开合旋转 */
.admin-mod { padding: 0; overflow: hidden; }
.admin-mod > summary {
  list-style: none; display: flex; align-items: center; gap: 8px;
  padding: 14px 16px; cursor: pointer; font-size: 14px; font-weight: 700; color: var(--text);
  transition: background var(--tr);
}
.admin-mod > summary::-webkit-details-marker { display: none; }
.admin-mod > summary::marker { content: ''; }
.admin-mod > summary:hover { background: var(--primary-soft); }
.admin-mod[open] > summary { border-bottom: 1px solid var(--border-2); }
.admin-mod-chev {
  margin-left: auto; width: 26px; height: 26px; border-radius: 8px;
  border: 1px solid var(--border); background: var(--primary-soft);
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--primary); font-size: 13px; font-weight: 700; flex: 0 0 auto;
}
.admin-mod-chev::before { content: '⌄'; display: block; transform: rotate(-90deg); transition: transform var(--tr); }
.admin-mod[open] > summary .admin-mod-chev::before { transform: rotate(0); }
.admin-mod-body { padding: 16px; }
.admin-mod-body > :first-child { margin-top: 0; }

/* ---------- 统计区：标签居左、数字居右，扁平描边 ---------- */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(172px, 1fr)); gap: 12px; margin-bottom: 20px; }
.hub-main .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); margin-bottom: 0; }
.stat {
  position: relative; background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 13px 15px;
  display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-rows: auto auto;
  align-items: center; column-gap: 12px; row-gap: 1px; align-content: center;
  transition: border-color var(--tr); cursor: default; overflow: hidden;
}
.stat:hover { border-color: #cfd9ea; }
.stat .num {
  grid-column: 2; grid-row: 1 / span 2; align-self: center;
  font-size: 24px; font-weight: 750; letter-spacing: -.6px; line-height: 1.15;
  color: var(--text); font-variant-numeric: tabular-nums; white-space: nowrap;
}
.stat .lbl {
  grid-column: 1; grid-row: 1; margin: 0; min-width: 0;
  font-size: 12.5px; font-weight: 500; color: var(--text-2); line-height: 1.5;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.stat .lbl::before {
  content: ""; display: inline-block; width: 6px; height: 6px; border-radius: 99px;
  background: var(--primary); margin-right: 6px; vertical-align: 1px;
}
.stat.orange .lbl::before { background: #e2a336; }
.stat.green .lbl::before { background: #22b573; }
/* 第二行说明（仅操作台统计有） */
.stat .d { grid-column: 1; grid-row: 2; margin-top: 2px; font-size: 11.5px; color: var(--text-3); line-height: 1.4; }

/* ---------- 模块入口卡（扁平 · 自适应列） ---------- */
.mod-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(238px, 1fr)); gap: 12px; }
.mod-card {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 15px; text-decoration: none; color: var(--text);
  display: grid; grid-template-columns: auto minmax(0, 1fr); column-gap: 12px; row-gap: 0;
  position: relative;
  transition: border-color var(--tr), box-shadow var(--tr);
}
.mod-card:hover { border-color: var(--primary); box-shadow: var(--shadow-md); }
.mod-card .ic {
  font-size: 19px; width: 40px; height: 40px; border-radius: 11px; background: var(--primary-light);
  display: flex; align-items: center; justify-content: center;
  grid-column: 1; grid-row: 1;
  transition: transform var(--tr);
}
.mod-card:hover .ic { transform: scale(1.06); }
.mod-card .ic svg { width: 22px; height: 22px; fill: none; stroke: var(--primary); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.mod-card .nm { font-weight: 700; margin: 0; font-size: 16px; letter-spacing: .1px; grid-column: 2; grid-row: 1; align-self: center; }
.mod-card .ds { font-size: 12px; color: var(--text-2); line-height: 1.6; grid-column: 1 / -1; grid-row: 2; margin-top: 11px; }
.mod-card .tip { display: inline-block; margin-top: 8px; font-size: 11px; background: #fff5e5; color: #a5761c; border-radius: 5px; padding: 2px 7px; grid-column: 1 / -1; grid-row: 3; }

/* ---------- 表格 ---------- */
.table-wrap {
  overflow-x: auto; background: var(--card);
  border: 1px solid var(--border); border-radius: var(--radius);
}
table { width: 100%; border-collapse: collapse; font-size: 13.5px; min-width: 640px; }
th, td { padding: 11px 14px; text-align: left; border-bottom: 1px solid var(--border-2); white-space: nowrap; }
th {
  font-size: 12px; color: var(--text-2); font-weight: 600; letter-spacing: .3px;
  background: #fff; border-bottom: 2px solid var(--border);
}
/* 长内容（如物流单号）自动换行，保证打开时所有列完整显示、无需左右拖动 */
.table-wrap td { white-space: normal; overflow-wrap: anywhere; }
/* 客诉列表：客户/发生时间/型号各占独立列且与表头一一对应，反馈与整改方案固定两行省略 */
.table-wrap.cp-wrap { overflow-x: hidden; }
.cp-list-table { width: 100%; min-width: 0; table-layout: fixed; }
.cp-list-table th, .cp-list-table td { vertical-align: middle; padding: 9px 9px; overflow: hidden; }
.cp-list-table th { white-space: nowrap; }
.cp-list-table td { height: 60px; }
.cp-list-table td.cp-customer,
.cp-list-table td.cp-occ,
.cp-list-table td.cp-model {
  display: table-cell; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.cp-list-table td.cp-occ { font-variant-numeric: tabular-nums; }
.cp-list-table td.cp-ship { white-space: nowrap; text-overflow: ellipsis; }
.cp-list-table td:nth-child(9) { white-space: nowrap; text-overflow: ellipsis; }
.cp-list-table td:last-child { white-space: nowrap; }
/* 反馈问题 / 整改方案：默认收起，只显示下拉箭头；点击在本行下方展开全文 */
.cp-list-table td.cp-fold-cell { text-align: center; }
.cp-fold-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 26px; height: 26px; padding: 0; border: 0; border-radius: 7px;
  background: transparent; color: var(--text-3); cursor: pointer;
}
.cp-fold-btn:hover { background: var(--primary-soft); color: var(--primary); }
.cp-fold-btn svg { transition: transform var(--tr); }
.cp-fold-btn[aria-expanded="true"] { background: var(--primary-soft); color: var(--primary); }
.cp-fold-btn[aria-expanded="true"] svg { transform: rotate(180deg); }
.cp-list-table tr.cp-fold-row td {
  height: auto; padding: 10px 14px; background: var(--primary-soft);
  white-space: pre-wrap; overflow-wrap: anywhere; font-size: 12.5px; color: var(--text-2); line-height: 1.6;
}
.cp-list-table tr.cp-fold-row td b { color: var(--primary); margin-right: 6px; }
/* 客诉弹窗「导出图片」按钮：蓝底白字，图标同为白色（不被通用 .btn:hover 覆盖） */
.cp-img-export { color: #fff; background: var(--primary); border-color: var(--primary); }
.cp-img-export:hover { color: #fff; background: var(--primary-dark); border-color: var(--primary-dark); }
.cp-img-export svg { stroke: #fff !important; }
/* 客诉弹窗：反馈问题的型号 / 发货数量明细行 */
.cp-items { display: flex; flex-direction: column; gap: 6px; margin: 4px 0 8px; }
.cp-item-row { display: flex; gap: 6px; align-items: center; }
.cp-item-row input { flex: 1; min-width: 0; }
.cp-item-row input.cp-item-qty { flex: 0 0 120px; }
.cp-item-row .cp-item-del { flex: 0 0 34px; padding: 6px 0; color: var(--danger, var(--red)); }
@media (max-width: 760px) {
  .cp-item-row input.cp-item-qty { flex: 0 0 92px; }
}
@media (max-width: 760px) {
  .table-wrap.cp-wrap { overflow-x: auto; }
  .cp-list-table { min-width: 900px; }
  .cp-list-table th, .cp-list-table td { padding: 8px 7px; }
}
/* 成员权限：每个成员固定单行，标记与状态不换行 */
.admin-user-table { min-width: 1180px; table-layout: auto; }
.admin-user-table th, .admin-user-table td { white-space: nowrap !important; vertical-align: middle; padding: 9px 10px; }
.admin-user-table .badge { white-space: nowrap; }
.admin-user-table .admin-inline-badge { margin-left: 4px; vertical-align: middle; }
tbody tr { transition: background var(--tr); }
tbody tr:hover td { background: var(--primary-soft); }
tr:last-child td { border-bottom: none; }

.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 9px; border-radius: 999px; font-size: 12px; font-weight: 650; line-height: 1.4;
}
.badge::before { content: ""; width: 5px; height: 5px; border-radius: 99px; background: currentColor; flex: none; }
.badge.gray { background: rgba(120, 132, 145, .12); color: #6d7b88; }
.badge.blue { background: rgba(47, 107, 255, .10); color: #2454d6; }
.badge.green { background: rgba(15, 157, 107, .11); color: #0b8f61; }
.badge.orange { background: rgba(226, 163, 54, .14); color: #a5761c; }
.badge.red { background: rgba(224, 75, 75, .11); color: #c33a35; }

.toolbar { display: flex; gap: 8px; align-items: center; margin-bottom: 14px; flex-wrap: wrap; }
.toolbar .spacer { flex: 1; }
/* 日期/月份类输入框不参与拉伸，避免把工具栏挤散 */
.toolbar input[type="date"], .toolbar input[type="month"], .toolbar input[type="datetime-local"],
.toolbar input[type="time"] { width: auto; min-width: 138px; flex: 0 0 auto; }
.toolbar .hint { white-space: nowrap; }
.empty { text-align: center; color: var(--text-3); padding: 34px 0; font-size: 13px; }
.hint { font-size: 12px; color: var(--text-2); }
.inv-ok { color: var(--green); font-size: 12px; }
.inv-warn { color: var(--red); font-size: 12px; }

/* 闪烁提醒 */
@keyframes blinkbg { 0%, 100% { background: #fff; } 50% { background: #fef9c3; } }
.blink td { animation: blinkbg 1s ease-in-out 6; }

/* 明细折叠 */
.fold-row td { background: var(--primary-soft); }
.fold-btn { border: none; background: none; color: var(--primary); font-size: 12.5px; font-weight: 600; padding: 0; }
.fold-btn:hover { opacity: .75; }
.detail-box { background: var(--primary-soft); border: 1px solid var(--border); border-radius: 8px; padding: 10px; margin-top: 6px; }

/* ---------- 弹窗 ---------- */
.overlay {
  position: fixed; top: 0; right: 0; bottom: 0; left: 0; background: rgba(22, 33, 58, .40); z-index: 100;
  display: flex; align-items: center; justify-content: center; padding: 16px;
  animation: fadeIn .16s ease both; backdrop-filter: blur(3px);
}
.modal {
  background: #fff; border-radius: 14px; width: 100%; max-width: 640px;
  max-height: 90vh; overflow-y: auto; padding: 22px;
  box-shadow: 0 26px 64px -20px rgba(22, 33, 58, .38);
  animation: popIn .22s cubic-bezier(.34, 1.3, .64, 1) both;
}
.modal h3 { font-size: 16px; margin-bottom: 10px; padding-bottom: 9px; border-bottom: 1px solid var(--border); color: var(--text); font-weight: 700; }
.modal-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 18px; align-items: center; }
.modal-actions .left { margin-right: auto; font-size: 12px; color: var(--text-3); }
.img-preview { margin-top: 8px; }
.img-preview img { max-width: 100%; max-height: 220px; border-radius: 8px; border: 1px solid var(--border); }
.img-list { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.img-list .imgbox { position: relative; }
.img-list img { width: 84px; height: 84px; object-fit: cover; border-radius: 8px; border: 1px solid var(--border); }
.img-list .del {
  position: absolute; top: -6px; right: -6px; width: 20px; height: 20px; border-radius: 50%;
  background: var(--red); color: #fff; border: 2px solid #fff; font-size: 11px; line-height: 1;
  box-shadow: 0 2px 6px rgba(224, 75, 75, .35);
}

/* 弹窗右上角关闭按钮 */
.modal-head {
  display: flex; align-items: center; gap: 10px;
  margin: -2px 0 12px; padding-bottom: 9px; border-bottom: 1px solid var(--border);
}
.modal-head h3 { flex: 1; margin: 0; padding: 0; border: none; font-size: 16px; color: var(--text); }
.modal-x {
  flex: 0 0 auto; width: 30px; height: 30px; border-radius: 9px; cursor: pointer;
  border: 1px solid var(--border); background: #fff; color: var(--text-2);
  font-size: 13px; line-height: 1; display: flex; align-items: center; justify-content: center;
  transition: all .15s ease;
}
.modal-x:hover { background: var(--primary); border-color: var(--primary); color: #fff; transform: rotate(90deg); }
.modal-x:active { transform: scale(.94); }

/* ---------- 报价/合同样板预览（纸质，保持黑白打印观感） ---------- */
.paper { background: #fff; border: 1px solid var(--border); padding: 28px 32px; border-radius: 4px; font-size: 13px; color: #111; }
.paper h2 { text-align: center; font-size: 20px; letter-spacing: 6px; margin-bottom: 4px; }
.paper .p-no { text-align: right; font-size: 12px; color: #555; margin-bottom: 12px; }
.paper .p-line { display: flex; gap: 18px; margin: 6px 0; flex-wrap: wrap; }
.paper .p-line label { color: #333; font-weight: 600; margin: 0; }
.paper table { min-width: 0; margin: 12px 0; }
.paper th, .paper td { border: 1px solid #999; padding: 6px 8px; text-align: center; }
.paper th { background: #f2f2f2; border-bottom: 1px solid #999; color: #111; letter-spacing: 0; }
.paper .p-sign { display: flex; gap: 40px; margin-top: 26px; }
.paper .p-sign > div { flex: 1; line-height: 2; }
.paper .p-tip { margin-top: 18px; font-size: 12px; color: #666; line-height: 1.8; }

/* 模型选择卡片 */
.check-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.check-grid label.cb {
  display: flex; align-items: center; gap: 6px; border: 1px solid var(--border); border-radius: 8px;
  padding: 8px 10px; margin: 0; font-size: 13px; color: var(--text); cursor: pointer; font-weight: 400;
  transition: border-color var(--tr), background var(--tr);
}
.check-grid label.cb:hover { border-color: var(--primary); background: var(--primary-soft); }
.check-grid input { width: auto; }

/* ---------- 报价明细编辑 ---------- */
.item-table { width: 100%; border-collapse: collapse; font-size: 13px; min-width: 0; }
.item-table th, .item-table td { padding: 6px 4px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.item-table th { background: transparent; border-bottom: 1px solid var(--border); color: var(--text-2); }
.item-table input { padding: 6px 8px; }
/* 带图单据：明细行内产品图片格（点击/粘贴/拖拽上传） */
.item-imgcell { position: relative; width: 84px; min-height: 46px; border: 1px dashed var(--border); border-radius: 8px; background: var(--soft, #f4f7ff); cursor: pointer; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.item-imgcell:hover, .item-imgcell[data-active="1"]:focus { border-color: var(--primary); }
.item-imgcell .item-img-thumb { max-width: 100%; max-height: 56px; object-fit: contain; display: block; }
.item-imgcell .item-img-clear { position: absolute; top: 0; right: 0; border: 0; background: rgba(0,0,0,.55); color: #fff; border-radius: 0 0 0 6px; font-size: 11px; line-height: 1; padding: 2px 4px; cursor: pointer; }
/* 带图报价末列：产品图片 + 备注同格 */
.it-imgremark { display: flex; align-items: center; gap: 6px; min-width: 190px; }
.it-imgremark .item-imgcell { flex: 0 0 72px; width: 72px; min-height: 38px; }
.it-imgremark .it-remark { flex: 1; min-width: 80px; }
.suggest { position: relative; }
.suggest-list {
  position: absolute; top: 100%; left: 0; right: 0; background: #fff; border: 1px solid var(--border);
  border-radius: 8px; box-shadow: 0 8px 24px -12px rgba(22, 33, 58, .25); z-index: 20; max-height: 220px; overflow-y: auto;
  animation: fadeUp .15s ease both;
}
.suggest-list div { padding: 8px 10px; cursor: pointer; font-size: 13px; transition: background var(--tr); }
.suggest-list div:hover { background: var(--primary-light); }
.suggest-list .stk { color: var(--text-2); float: right; }

/* ---------- Toast ---------- */
#toast {
  position: fixed; top: 16px; left: 50%; transform: translateX(-50%);
  background: #16213a; color: #fff; padding: 10px 18px; border-radius: 10px;
  font-size: 13px; font-weight: 600; z-index: 200; display: none; max-width: 86vw; text-align: center;
  box-shadow: 0 14px 34px -14px rgba(22, 33, 58, .55); animation: toastIn .2s ease both;
}
#toast.err { background: var(--red); }
#toast.ok { background: var(--primary); }

/* ---------- 主题选择（管理员） ---------- */
.theme-swatches { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 8px; }
.theme-swatch {
  width: 92px; cursor: pointer; border: 2px solid var(--border); border-radius: 10px;
  padding: 6px; text-align: center; font-size: 11px; color: var(--text-2); background: #fff;
  transition: border-color var(--tr), box-shadow var(--tr), color var(--tr);
}
.theme-swatch:hover { border-color: #cfd9ea; }
.theme-swatch.on { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-ring); color: var(--primary); font-weight: 600; }
.theme-swatch .chip { height: 30px; border-radius: 6px; margin-bottom: 5px; }
.theme-custom { display: flex; align-items: center; gap: 10px; margin-top: 10px; flex-wrap: wrap; }
.theme-custom input[type="color"] {
  width: 44px; height: 34px; padding: 2px; border-radius: 8px; cursor: pointer;
}
.rgb-inputs { display: flex; align-items: center; gap: 6px; }
.rgb-inputs span { font-size: 12px; color: var(--text-2); font-weight: 600; }
.rgb-inputs input {
  width: 58px; padding: 6px 6px; text-align: center; font-size: 13px;
  -moz-appearance: textfield; appearance: textfield;
}
.rgb-inputs input::-webkit-outer-spin-button, .rgb-inputs input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

/* ---------- 动画 ---------- */
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes fadeUp { from { opacity: 0; transform: translateY(7px); } to { opacity: 1; transform: translateY(0); } }
@keyframes popIn { from { opacity: 0; transform: scale(.96); } to { opacity: 1; transform: scale(1); } }
@keyframes toastIn { from { opacity: 0; transform: translate(-50%, -12px); } to { opacity: 1; transform: translate(-50%, 0); } }

/* ---------- 截图粘贴/上传区 ---------- */
.paste-zone {
  display: flex; align-items: center; gap: 12px; cursor: pointer;
  border: 1.5px dashed #cfd9ea; border-radius: 10px; background: var(--primary-soft);
  padding: 12px 14px; transition: border-color var(--tr), background var(--tr); outline: none;
}
.paste-zone:hover, .paste-zone:focus, .paste-zone.dragging { border-color: var(--primary); background: var(--primary-light); }
.paste-zone .pz-icon { font-size: 22px; }
.paste-zone b { font-size: 13.5px; }
.paste-zone .hint { margin-top: 2px; color: var(--text-3); }
.paste-preview { display: flex; align-items: flex-start; gap: 10px; margin-top: 8px; }
.paste-preview img { max-width: 180px; max-height: 110px; border-radius: 6px; border: 1px solid var(--border); }

/* ---------- 客户名称可点击（打开客户信息 + 客户单价） ---------- */
#cus-table a.cus-open { color: var(--primary); font-weight: 700; text-decoration: none; border-bottom: 1px dashed rgba(47, 107, 255, .5); cursor: pointer; }
#cus-table a.cus-open:hover { color: var(--primary-dark); }
#prod-fold { padding: 14px 16px; }
#prod-fold > summary { list-style: none; }
#prod-fold > summary::-webkit-details-marker { display: none; }

/* ---------- 未读角标（收款 💰 / 模块卡） ---------- */
.mod-card .badge-n {
  position: absolute; top: 11px; right: 11px; background: var(--red); color: #fff;
  font-size: 11px; border-radius: 999px; min-width: 18px; height: 18px; line-height: 18px;
  text-align: center; padding: 0 4px; display: none; box-shadow: 0 2px 6px rgba(22, 33, 58, .18);
}
.mod-card .badge-n.on { display: block; animation: popIn .25s ease both; }
/* 群发通知未读角标：红色闪烁提醒 */
.mod-card .badge-n.blink.on { animation: popIn .25s ease both, badgeBlink 1.1s ease-in-out .25s infinite; }
@keyframes badgeBlink {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: .35; transform: scale(.86); }
}
.bell.pulse { animation: payPulse 1.2s ease-in-out 3; }
@keyframes payPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.18); }
}

/* ---------- 图片上传中的本地预览 ---------- */
.img-list .imgbox.uploading img { opacity: .45; }
.img-list .imgbox .upmask {
  position: absolute; top: 0; right: 0; bottom: 0; left: 0; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(22, 33, 58, .48); color: #fff; font-size: 11px; letter-spacing: .5px;
}

/* ---------- 权限管理：操作台模块排序（拖拽） ---------- */
.hub-order-list { display: flex; flex-direction: column; gap: 6px; margin-top: 10px; max-width: 520px; }
.hub-order-item {
  display: flex; align-items: center; gap: 10px; padding: 8px 12px;
  background: var(--primary-soft); border: 1px solid var(--border); border-radius: 10px;
  cursor: grab; user-select: none;
}
.hub-order-item.dragging { opacity: .45; border-style: dashed; cursor: grabbing; }
.hub-order-item.drag-over { border-color: var(--primary); box-shadow: 0 0 0 2px var(--primary-soft); }
.hub-order-item .drag-handle { color: var(--text-3); font-size: 15px; letter-spacing: 1px; cursor: grab; }
.hub-order-item .ic { font-size: 16px; }
.hub-order-item b { font-size: 13.5px; }
.hub-order-item .btn { padding: 3px 10px; font-size: 12px; }

/* ---------- 表格行手动拖拽排序（同行资料等） ---------- */
tr[draggable="true"] td .drag-handle { color: var(--text-3); cursor: grab; margin-right: 4px; font-size: 15px; letter-spacing: 1px; }
tr[draggable="true"] td:first-child { white-space: nowrap; }
tr.dragging { opacity: .45; }
tr.drag-over td { border-top: 2px solid var(--primary); }

/* ---------- 收款信息 ---------- */
.payinfo-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 14px; margin-bottom: 10px; }
.payinfo-qr .qr-box {
  margin-top: 10px; min-height: 180px; display: flex; align-items: center; justify-content: center;
  background: #fff; border: 1px solid var(--border); border-radius: 10px; padding: 10px;
}
.payinfo-acc .acc-txt {
  margin: 10px 0 8px; white-space: pre-wrap; word-break: break-all; font-family: inherit;
  font-size: 13.5px; line-height: 1.8; background: var(--primary-soft);
  border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px; min-height: 64px;
}

/* ---------- 新版本提示条 ---------- */
.ver-banner {
  position: fixed; top: 14px; left: 50%; transform: translateX(-50%);
  z-index: 300; display: flex; align-items: center; gap: 12px;
  max-width: min(680px, calc(100vw - 24px));
  padding: 12px 16px; border-radius: 12px;
  background: #fff; border: 1px solid var(--border);
  box-shadow: 0 20px 48px -20px rgba(22, 33, 58, .32);
  animation: verIn .3s cubic-bezier(.34, 1.3, .64, 1) both;
}
.ver-banner .ver-ic { font-size: 22px; line-height: 1; }
.ver-banner .ver-txt { display: flex; flex-direction: column; gap: 2px; font-size: 12.5px; color: var(--text-2); }
.ver-banner .ver-txt b { font-size: 14px; color: var(--text); }
.ver-banner .ver-no { color: var(--text-3); font-size: 11px; }
.ver-banner .btn { flex: 0 0 auto; }
@keyframes verIn { from { opacity: 0; transform: translate(-50%, -16px); } to { opacity: 1; transform: translate(-50%, 0); } }
@media (max-width: 560px) {
  .ver-banner { flex-wrap: wrap; top: 8px; padding: 10px 12px; }
  .ver-banner .ver-txt { flex: 1 1 100%; order: 3; }
}

/* ---------- 扫码配货（摄像头扫码） ---------- */
.scan-stage {
  position: relative; background: #0b1220; border-radius: 12px; overflow: hidden;
  aspect-ratio: 4 / 3; display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--border);
}
.scan-stage video { width: 100%; height: 100%; object-fit: cover; display: block; }
.scan-frame {
  position: absolute; left: 7%; right: 7%; top: 28%; height: 44%;
  border: 2px solid rgba(255, 255, 255, .9); border-radius: 10px;
  box-shadow: 0 0 0 9999px rgba(0, 0, 0, .22) inset; pointer-events: none;
}
.scan-frame::after {
  content: ''; position: absolute; left: 4px; right: 4px; top: 50%; height: 2px;
  background: rgba(255, 92, 92, .9); border-radius: 2px;
  animation: scanline 1.7s ease-in-out infinite;
}
@keyframes scanline { 0%, 100% { transform: translateY(-42px); } 50% { transform: translateY(42px); } }
.scan-tip {
  position: absolute; bottom: 8px; left: 8px; right: 8px; text-align: center;
  color: #fff; font-size: 12px; line-height: 1.4; text-shadow: 0 1px 4px rgba(0, 0, 0, .85);
}
.scan-manual { display: flex; gap: 8px; align-items: center; }
.scan-manual input { flex: 1 1 auto; }
.scan-hits { max-height: 180px; overflow-y: auto; border: 1px solid var(--border); border-radius: 10px; }
.scan-hit {
  display: flex; justify-content: space-between; align-items: center; gap: 10px;
  padding: 7px 10px; font-size: 13px; border-bottom: 1px solid var(--border-2);
  background: var(--card);
}
.scan-hit:last-child { border-bottom: none; }
.scan-hit span:first-child { overflow-wrap: anywhere; }
@media (max-width: 560px) {
  .scan-stage { aspect-ratio: 3 / 4; }
  .scan-manual { flex-wrap: wrap; }
  .scan-manual input { flex: 1 1 100%; }
  .scan-manual .btn { flex: 1 1 100%; }
}

/* ---------- 模板设置（报价单 / 合同样板） ---------- */
.tpl-wrap { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; align-items: start; }
@media (max-width: 1080px) { .tpl-wrap { grid-template-columns: 1fr; } }
.tpl-form { min-width: 0; }
.tpl-side { min-width: 0; position: sticky; top: 12px; }
.tpl-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 12px; margin-top: 8px; }
@media (max-width: 620px) { .tpl-grid { grid-template-columns: 1fr; } }
.tpl-form label { display: block; font-size: 12.5px; color: var(--text-2); margin-top: 8px; }
.tpl-form label input, .tpl-form label textarea { width: 100%; margin-top: 4px; }
.tpl-form textarea { font-family: inherit; line-height: 1.7; resize: vertical; }
.tpl-preview { background: #eef2f9; border: 1px solid var(--border); border-radius: 10px; padding: 10px; overflow: hidden; }
.tpl-paper {
  width: 186mm; min-height: 120mm; background: #fff; padding: 10mm 8mm;
  box-shadow: 0 2px 12px rgba(22, 33, 58, .12); transform-origin: top left;
}
.tpl-paper .doc-sheet { width: 100%; }

/* ---------- 喜报生成 ---------- */
.xibao-wrap { display: grid; grid-template-columns: minmax(0, 400px) minmax(0, 1fr); gap: 16px; align-items: start; }
@media (max-width: 900px) { .xibao-wrap { grid-template-columns: 1fr; } }
.xibao-form label { display: block; font-size: 12.5px; color: var(--text-2); margin-top: 8px; }
.xibao-form label input, .xibao-form label select { width: 100%; margin-top: 4px; }
.xibao-side { background: #eef2f9; border: 1px solid var(--border); border-radius: 10px; padding: 12px; display: flex; justify-content: center; }
.xibao-canvas { width: min(340px, 100%); height: auto; border-radius: 8px; box-shadow: 0 2px 12px rgba(22, 33, 58, .16); }
.xb-stars-row { margin-top: 12px; }
#xb-stars { display: flex; gap: 4px; margin-top: 4px; }
.xb-star { font-size: 26px; cursor: pointer; color: #cbd5e3; line-height: 1; }
.xb-star input { display: none; }
.xb-star input:checked + span { color: #f5b301; text-shadow: 0 0 6px rgba(245, 179, 1, .55); }
.xb-editor { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 300px); gap: 14px; align-items: start; }
.xb-ep { position: sticky; top: 0; align-self: start; }
@media (max-width: 860px) { .xb-editor { grid-template-columns: 1fr; } }
.xb-fs { border: 1px solid var(--border); border-radius: 8px; padding: 8px 10px 10px; margin-bottom: 10px; }
.xb-fs legend { font-size: 12.5px; font-weight: 600; padding: 0 4px; }
.xb-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 10px; }
.xb-grid label { display: block; font-size: 12px; color: var(--text-2); }
.xb-grid label input, .xb-grid label select { width: 100%; margin-top: 2px; }
.xb-chk { display: flex !important; align-items: center; gap: 6px; margin-top: 14px; }
.xb-chk input { width: auto !important; margin: 0 !important; }
.ops { white-space: nowrap; }
.ops .btn { margin-right: 4px; }

/* ---------- 报备型号 ---------- */
/* 手机端列太多，隐去「登记时间」把宽度留给型号与单价 */
@media (max-width: 640px) {
  .mr-table th.mr-hide-sm, .mr-table td.mr-hide-sm { display: none; }
  .mr-table th, .mr-table td { padding-left: 6px; padding-right: 6px; }
}

/* 成交评审：操作按钮区（间距均匀、可换行不挤压） */
.rv-ops { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.rv-ops .btn { white-space: nowrap; }

/* ---------- 新品定价 ---------- */
.np-form { display: grid; grid-template-columns: 220px 1fr; gap: 18px; }
.np-left { border-right: 1px solid var(--border); padding-right: 18px; min-width: 0; }
.np-right { min-width: 0; }
.np-display { min-height: 40px; display: flex; align-items: center; padding: 8px 11px; border: 1px dashed var(--border); border-radius: var(--radius-sm); background: var(--primary-soft); font-weight: 600; overflow-wrap: anywhere; }
.np-imgbox { min-height: 124px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; padding: 8px; border: 1px dashed var(--border); border-radius: var(--radius-sm); cursor: pointer; }
.np-imgbox:focus, .np-imgbox.dragging { border-color: var(--primary); background: var(--primary-soft); }
.np-imgbox .paste-zone { width: 100%; border: 0; box-shadow: none; background: transparent; }
.np-row3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.np-row2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
@media (max-width: 860px) {
  .np-form { grid-template-columns: 1fr; }
  .np-left { border-right: 0; border-bottom: 1px solid var(--border); padding: 0 0 14px; }
  .np-row3, .np-row2 { grid-template-columns: minmax(0, 1fr); }
}
/* 新品定价表：四列表格化单据格式（参照用户提供的表格截图） */
.np-sheet { width: 100%; border-collapse: collapse; table-layout: fixed; }
.np-sheet td { border: 1px solid var(--border); padding: 7px 9px; vertical-align: middle; font-size: 13px; line-height: 1.5; overflow-wrap: anywhere; }
.np-sheet .np-lbl { width: 132px; background: var(--bg); color: var(--text-2); font-weight: 600; }
.np-sheet input, .np-sheet select { width: 100%; box-sizing: border-box; min-width: 0; }
.np-sheet .np-modelcell { font-weight: 600; font-size: 14px; }
.np-sheet .np-modelcell input { font-weight: 600; font-size: 14px; }
.np-sheet .np-colhead td { background: var(--primary-soft); color: var(--text-2); font-weight: 600; text-align: center; padding: 6px 9px; }
.np-sheet .np-imgcell { min-height: 152px; text-align: center; padding: 10px; }
.np-sheet .np-imgcell img { max-width: 100%; max-height: 132px; object-fit: contain; border-radius: 8px; }
.np-sheet .np-model-imgcell { position: relative; min-height: 118px; height: 118px; cursor: pointer; outline: none; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.np-sheet .np-model-imgcell img { max-height: 98px; }
.np-sheet .np-model-imgcell .paste-zone { width: 100%; justify-content: center; text-align: center; }
.np-sheet .np-model-imgcell .hint { width: 100%; text-align: center; }
.np-sheet .np-model-img-del { position: absolute; top: 4px; right: 4px; width: 20px; height: 20px; padding: 0; border: none; border-radius: 50%; background: #e11d48; color: #fff; font-size: 12px; line-height: 20px; cursor: pointer; z-index: 2; box-shadow: 0 1px 3px rgba(0, 0, 0, .18); }
.np-sheet .np-model-img-del:hover { background: #be123c; }
.np-sheet .np-model-imgcell.dragging { background: var(--primary-light); box-shadow: inset 0 0 0 2px var(--primary); }
.np-sheet .np-auditrow td { background: var(--primary-soft); }
.np-sheet .np-auditrow .np-audit-title { font-weight: 700; color: var(--text); }
.np-sheet .np-auditrow .hint { display: inline; margin-left: 8px; }
.np-sheet .np-mini { color: var(--text-3); font-size: 12px; }
.np-sheet-ops { display: flex; justify-content: flex-end; gap: 8px; margin-top: 8px; }
/* 新品定价弹窗：型号区 5 列（删除放在主图后面），公司/三档价区 4 列等宽 */
.np-sheet.np-form-grid { display: block; border-collapse: separate; border-spacing: 0; }
.np-sheet.np-form-grid > tbody { display: block; }
.np-sheet.np-form-grid tr { display: grid; width: 100%; box-sizing: border-box; }
.np-sheet.np-form-grid td { min-width: 0; box-sizing: border-box; border: 0; border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.np-sheet.np-form-grid tr:first-child td { border-top: 1px solid var(--border); }
.np-sheet.np-form-grid td:first-child { border-left: 1px solid var(--border); }
.np-sheet.np-form-grid .np-lbl { width: auto; text-align: center; }
/* 型号格与型号输入框文字居中（用户要求：框起来的文字和框居中） */
.np-sheet.np-form-grid .np-modelcell,
.np-sheet.np-form-grid .np-modelcell input { text-align: center; }
.np-sheet.np-form-grid tr.np-model-row-create { grid-template-columns: 11% 31% 10% 38% 10%; }
.np-sheet.np-form-grid tr.np-model-row-read { grid-template-columns: 12% 30% 12% 46%; }
.np-sheet.np-form-grid tr.np-four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.np-sheet.np-form-grid .np-auditrow td,
.np-sheet.np-form-grid .np-mini-row td { grid-column: 1 / -1; }
.np-sheet.np-form-grid .np-auditrow td { border-right: 1px solid var(--border); }
.np-sheet.np-form-grid .np-delcell { display: flex; align-items: center; justify-content: center; background: var(--bg); padding: 6px 4px; }
.np-sheet.np-form-grid .np-delcell .btn { white-space: nowrap; padding: 4px 8px; }
/* 定价单详情：内容多（多型号+多级审核），放宽高度并压缩只读主图，尽量一屏看全 */
.modal.np-detail-modal { max-height: 96vh; padding: 18px 22px; }
.modal.np-detail-modal .modal-body { overflow-y: auto; }
.modal.np-detail-modal .np-sheet.np-form-grid tr.np-model-row-read .np-imgcell { min-height: 76px !important; padding: 5px 9px; }
.modal.np-detail-modal .np-sheet.np-form-grid tr.np-model-row-read .np-imgcell img { max-height: 64px; }
.modal.np-detail-modal .np-sheet.np-form-grid td { padding: 6px 9px; }
@media (max-width: 900px) {
  .np-sheet { table-layout: auto; }
  .np-sheet .np-lbl { width: 92px; }
}

/* =====================================================
   响应式
   ===================================================== */
/* 中屏：右侧待办栏收窄 */
@media (max-width: 1200px) {
  .hub-cols { grid-template-columns: minmax(0, 1fr) 248px; }
  .mod-grid { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
  .content { padding: 22px 20px 40px; }
}

/* 平板：双列合并，待办栏变两列横排放在主区之后 */
@media (max-width: 980px) {
  .hub-cols { grid-template-columns: 1fr; }
  .hub-side { max-width: none; }
  .hub-side .side-card { margin-bottom: 12px; }
}

/* 手机：抽屉式侧栏 + 白底顶栏 */
@media (max-width: 820px) {
  .sidebar {
    transform: translateX(-100%); transition: transform .25s cubic-bezier(.4, 0, .2, 1);
    box-shadow: 0 0 40px rgba(22, 33, 58, .22); width: 250px; border-right: none;
  }
  .sidebar.open { transform: translateX(0); }
  .main { margin-left: 0; }
  .topbar { display: flex; }
  .content { padding: 16px 14px 36px; }

  .phead { margin-bottom: 14px; gap: 10px; }
  .phead-t { font-size: 17px; }
  .phead-s { font-size: 11.5px; margin-top: 4px; }
  .phead-r { width: 100%; justify-content: flex-end; }
  .page-title { font-size: 17px; margin-bottom: 13px; }

  .hub-cols { grid-template-columns: 1fr; gap: 14px; }
  .hub-side { display: block; order: 2; }
  .hub-side .side-card { margin-bottom: 12px; }

  .stats, .hub-main .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-bottom: 16px; }
  .stat {
    display: grid; grid-template-columns: minmax(0, 1fr); grid-template-rows: auto auto;
    row-gap: 2px; padding: 11px 12px;
  }
  .stat .lbl { grid-column: 1; grid-row: 1; font-size: 11.5px; }
  .stat .num { grid-column: 1; grid-row: 2; align-self: start; font-size: 20px; letter-spacing: -.4px; }
  .stat .d { grid-column: 1; grid-row: 3; font-size: 11px; margin-top: 1px; }

  .mod-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .mod-card { padding: 11px 12px; column-gap: 9px; }
  .mod-card .ic { width: 32px; height: 32px; font-size: 15px; border-radius: 9px; }
  .mod-card .ic svg { width: 18px; height: 18px; }
  .mod-card .nm { font-size: 14px; }
  .mod-card .ds { font-size: 11px; line-height: 1.5; margin-top: 7px; }

  .toolbar { gap: 8px; }
  .toolbar .spacer { display: none; }
  .toolbar .hint { flex: 1 1 100%; white-space: normal; }
  .toolbar input:not([type="checkbox"]):not([type="radio"]), .toolbar select {
    width: 100% !important; min-width: 0 !important; max-width: none !important; flex: 1 1 100%;
  }
  .toolbar .btn { flex: 1 1 auto; }

  th, td { padding: 9px 10px; }
  .paper { padding: 18px 16px; }
  .card { padding: 14px; }
  .side-mask {
    position: fixed; top: 0; right: 0; bottom: 0; left: 0;
    background: rgba(22, 33, 58, .40); z-index: 35; animation: fadeIn .2s ease both;
  }
}

/* =====================================================
   线上发货 · 配货单工具视觉（参考「配货单打印工具」样式）
   作用域：.os-page（列表页） / .os-paste（录入弹窗内）
   仅作用于线上发货模块，不影响其他页面
   ===================================================== */
.os-page, .os-paste {
  --os-ink: #1a1a1a; --os-muted: #6b7280; --os-line: #d8dce2;
  --os-bg: #f4f5f7; --os-panel: #fff;
  --os-accent: #1f6feb; --os-accent-soft: #eaf1fd; --os-accent-border: #cfe0fb;
  --os-danger: #d93025; --os-ok: #178a4c;
  color: var(--os-ink);
}
.os-page { max-width: 1240px; margin: 0 auto; padding-bottom: 30px; }
.os-page *, .os-paste * { box-sizing: border-box; }

/* 头部 */
.os-head { display: flex; align-items: baseline; gap: 14px; margin-bottom: 16px; flex-wrap: wrap; }
.os-head h1 { font-size: 22px; font-weight: 700; margin: 0; letter-spacing: .3px; color: var(--os-ink); }
.os-head .os-sub { color: var(--os-muted); font-size: 13px; }

/* 两栏网格 */
.os-grid { display: grid; grid-template-columns: 420px 1fr; gap: 20px; align-items: start; }
@media (max-width: 980px) { .os-grid { grid-template-columns: 1fr; } }

/* 卡片 */
.os-card { background: var(--os-panel); border: 1px solid var(--os-line); border-radius: 12px; box-shadow: 0 1px 2px rgba(0,0,0,.04); overflow: hidden; }
.os-card + .os-card { margin-top: 20px; }
.os-card-h { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px; border-bottom: 1px solid var(--os-line); font-weight: 600; font-size: 14px; }
.os-card-b { padding: 16px 18px; }

/* 提示框 */
.os-hint { font-size: 12px; color: var(--os-muted); line-height: 1.6; background: #f8fafc; border: 1px dashed var(--os-line); border-radius: 8px; padding: 10px 12px; margin-bottom: 12px; }
.os-hint code { background: #eef1f5; padding: 1px 5px; border-radius: 4px; font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: 11px; }
.os-paste .os-hint { margin-top: 0; }

/* 按钮 */
.os-btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; border: none; border-radius: 8px; cursor: pointer; font-size: 14px; font-weight: 600; padding: 10px 16px; text-decoration: none; transition: transform .06s, filter .15s, background .15s; user-select: none; }
.os-btn:active { transform: translateY(1px); }
.os-btn:disabled { opacity: .5; cursor: not-allowed; }
.os-btn-primary { background: var(--os-accent); color: #fff; }
.os-btn-primary:hover:not(:disabled) { filter: brightness(1.06); }
.os-btn-ghost { background: #fff; color: var(--os-ink); border: 1px solid var(--os-line); }
.os-btn-ghost:hover:not(:disabled) { background: #f6f8fa; }
.os-btn-danger { background: var(--os-danger); color: #fff; }
.os-btn-sm { padding: 7px 12px; font-size: 13px; }
.os-row-actions { display: flex; gap: 10px; margin-top: 12px; flex-wrap: wrap; align-items: center; }
.os-print-actions { border-top: 1px solid var(--os-line); padding-top: 14px; }
.os-tip { font-size: 12px; color: var(--os-muted); }
.os-stat { font-size: 12px; font-weight: 400; color: var(--os-muted); }
.os-stat b { color: var(--os-ink); }

/* 订单卡片列表 */
.os-order-list { display: flex; flex-direction: column; gap: 10px; min-height: clamp(420px, calc(100vh - 250px), 640px); max-height: clamp(480px, calc(100vh - 240px), 760px); overflow-y: auto; padding-right: 4px; }
.os-order { border: 1px solid var(--os-line); border-radius: 10px; padding: 12px 14px; display: flex; gap: 12px; align-items: flex-start; background: #fcfcfd; transition: border-color .15s, background .15s; cursor: pointer; }
.os-order:hover { border-color: var(--os-accent-border); }
.os-order.selected { border-color: var(--os-accent); background: var(--os-accent-soft); }
.os-order input[type=checkbox] { width: 18px; height: 18px; margin-top: 2px; cursor: pointer; accent-color: var(--os-accent); flex-shrink: 0; }
.os-order .os-meta { flex: 1; min-width: 0; }
.os-order .os-title { font-weight: 700; font-size: 16px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.os-order .os-title .os-tag { font-size: 12px; color: var(--os-accent); background: var(--os-accent-soft); border: 1px solid var(--os-accent-border); padding: 1px 8px; border-radius: 20px; font-weight: 400; }
.os-order .os-title .os-status { margin-left: auto; font-size: 12px; font-weight: 700; padding: 3px 10px; border-radius: 20px; display: inline-flex; align-items: center; gap: 4px; flex-shrink: 0; }
.os-order .os-title .os-status.printed { color: #0d7a3d; background: #e2f6ea; border: 1px solid #b4e3c5; }
.os-order .os-title .os-status.unprinted { color: #c62a1f; background: #fdeaea; border: 1px solid #f4c2bd; }
.os-order .os-del-btn { margin-left: 2px; flex-shrink: 0; border: 1px solid var(--os-line); background: #fff; color: #c62a1f; border-radius: 6px; width: 24px; height: 24px; cursor: pointer; font-size: 13px; line-height: 1; display: inline-flex; align-items: center; justify-content: center; transition: background .15s, border-color .15s; }
.os-order .os-del-btn:hover { background: #fdeaea; border-color: #f4c2bd; }
.os-order .os-rec { font-size: 13px; color: var(--os-muted); margin-top: 4px; }
.os-order .os-rec b { color: var(--os-ink); }
.os-order .os-items { margin-top: 8px; font-size: 14px; color: #1f2937; }
.os-order .os-items .os-row { display: flex; gap: 10px; padding: 3px 0; }
.os-order .os-items .os-row span:first-child { flex: 1; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 13.5px; }
.os-order .os-items .os-row .os-q { min-width: 46px; text-align: right; font-weight: 700; font-size: 14px; }
.os-empty { color: var(--os-muted); font-size: 13px; text-align: center; padding: 28px 0; }

/* 录入弹窗内部 */
.os-paste .os-input { width: 100%; min-height: 170px; resize: vertical; font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: 13px; line-height: 1.7; border: 1px solid var(--os-line); border-radius: 8px; padding: 12px; color: var(--os-ink); background: #fcfcfd; outline: none; transition: border-color .15s; }
.os-paste .os-input:focus { border-color: var(--os-accent); }
.os-paste .os-label { display: block; font-size: 13px; font-weight: 600; margin: 14px 0 8px; }
.os-paste .os-tbl-wrap { overflow-x: auto; }
.os-paste .os-rec-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.os-paste .os-rec-table th, .os-paste .os-rec-table td { padding: 8px 10px; border-bottom: 1px solid var(--os-line); text-align: left; white-space: nowrap; }
.os-paste .os-rec-table th { background: #f8f9fb; font-weight: 600; color: #444; font-size: 12px; }
.os-paste .os-rec-table tbody tr:hover { background: #fafbfc; }
.os-paste .os-rec-table input { border: 1px solid var(--os-line); border-radius: 7px; padding: 7px 10px; font-size: 13px; background: #fff; color: var(--os-ink); outline: none; width: 100%; }
.os-paste .os-rec-table input:focus { border-color: var(--os-accent); }
.os-paste .os-rec-table input[data-k="entry_date"] { width: 110px; }
.os-paste .os-rec-table input[data-k="customer_name"] { width: 110px; }
.os-paste .os-rec-table input[data-k="model"] { width: 170px; }
.os-paste .os-rec-table input[data-k="qty"] { width: 80px; }
.os-paste .os-ditto { color: #bbb; }
.os-paste .os-icon-del { border: 1px solid var(--os-line); background: #fff; color: #c62a1f; border-radius: 6px; width: 24px; height: 24px; cursor: pointer; font-size: 13px; line-height: 1; display: inline-flex; align-items: center; justify-content: center; }
.os-paste .os-icon-del:hover { background: #fdeaea; border-color: #f4c2bd; }
.os-paste .os-modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--os-line); }

/* 页签（打印 / 打印记录 / 设置） */
.os-tabs { display: flex; gap: 6px; background: #e9ebef; padding: 5px; border-radius: 12px; width: fit-content; margin-bottom: 20px; }
.os-tab { border: none; background: transparent; cursor: pointer; font-size: 14px; font-weight: 600; padding: 8px 18px; border-radius: 9px; color: var(--os-muted); transition: background .15s, color .15s; }
.os-tab.active { background: #fff; color: var(--os-ink); box-shadow: 0 1px 3px rgba(0,0,0,.08); }
.os-tab:hover:not(.active) { color: var(--os-ink); }
.os-view { display: none; }
.os-view.active { display: block; }

/* 打印记录 */
.os-rec-toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; margin-bottom: 16px; }
.os-fld { display: flex; flex-direction: column; gap: 4px; }
.os-fld label { font-size: 12px; color: var(--os-muted); }
.os-fld input { border: 1px solid var(--os-line); border-radius: 7px; padding: 7px 10px; font-size: 13px; background: #fff; color: var(--os-ink); outline: none; }
.os-fld input:focus { border-color: var(--os-accent); }
.os-rec-quick { display: flex; gap: 6px; flex-wrap: wrap; }
.os-rec-export { margin-left: auto; }
.os-table-wrap { overflow-x: auto; }
.os-rec-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.os-rec-table th, .os-rec-table td { padding: 9px 12px; border-bottom: 1px solid var(--os-line); text-align: left; white-space: nowrap; }
.os-rec-table th { background: #f8f9fb; font-weight: 600; color: #444; font-size: 12px; }
.os-rec-table tbody tr:hover { background: #fafbfc; }
.os-rec-table td.mono { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 12px; }
.os-rec-actions { display: flex; gap: 6px; }
.os-rec-detail { font-size: 12px; color: var(--os-muted); max-width: 320px; overflow: hidden; text-overflow: ellipsis; }

/* 设置页 */
.os-set-layout { display: grid; grid-template-columns: 400px 1fr; gap: 20px; align-items: start; }
.os-set-grid { display: flex; flex-direction: column; gap: 12px; }
.os-set-group { border: 1px solid var(--os-line); border-radius: 10px; overflow: hidden; background: #fcfcfd; }
.os-set-group.open { background: #fff; }
.os-set-group h3 { margin: 0; font-size: 14px; font-weight: 700; }
.os-acc-head { display: flex; align-items: center; justify-content: space-between; padding: 13px 16px; cursor: pointer; user-select: none; background: #fff; }
.os-acc-head:hover { background: #f6f8fa; }
.os-acc-head .os-chev { transition: transform .2s; color: var(--os-muted); font-size: 12px; }
.os-set-group.open .os-acc-head .os-chev { transform: rotate(90deg); }
.os-acc-body { display: none; padding: 4px 16px 14px; border-top: 1px solid #eef0f3; }
.os-set-group.open .os-acc-body { display: block; }
.os-set-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px dashed #eef0f3; }
.os-set-row:last-child { border-bottom: none; }
.os-set-row .os-lab { font-size: 13px; color: var(--os-ink); }
.os-set-row .os-sub { font-size: 11px; color: var(--os-muted); }
.os-set-row input[type=range] { width: 140px; accent-color: var(--os-accent); }
.os-set-row input[type=text] { width: 140px; border: 1px solid var(--os-line); border-radius: 7px; padding: 6px 10px; font-size: 13px; outline: none; }
.os-set-row input[type=text]:focus { border-color: var(--os-accent); }
.os-set-row .os-val { font-size: 12px; color: var(--os-muted); min-width: 40px; text-align: right; }
.os-radio-group { display: flex; gap: 6px; }
.os-radio-group label { display: flex; align-items: center; gap: 5px; font-size: 13px; cursor: pointer; }
.os-radio-group input { accent-color: var(--os-accent); }
.os-toggle { position: relative; width: 42px; height: 24px; flex-shrink: 0; }
.os-toggle input { opacity: 0; width: 0; height: 0; }
.os-toggle .os-sl { position: absolute; inset: 0; background: #cdd2d9; border-radius: 24px; transition: .2s; cursor: pointer; }
.os-toggle .os-sl::before { content: ""; position: absolute; width: 18px; height: 18px; left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: .2s; box-shadow: 0 1px 2px rgba(0,0,0,.2); }
.os-toggle input:checked + .os-sl { background: var(--os-accent); }
.os-toggle input:checked + .os-sl::before { transform: translateX(18px); }
.os-set-actions { display: flex; gap: 10px; margin-top: 18px; flex-wrap: wrap; }
.os-set-preview-card { position: sticky; top: 16px; }
.os-preview-h { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px; border-bottom: 1px solid var(--os-line); }
.os-preview-h .os-ttl { font-weight: 600; font-size: 14px; }
.os-preview-h .os-note { font-size: 12px; color: var(--os-muted); }
.os-set-preview-holder { padding: 16px; display: flex; justify-content: center; background: repeating-conic-gradient(#e9ebee 0 25%, #f2f3f5 0 50%) 0 0 / 22px 22px; min-height: 640px; overflow: auto; }
.os-set-preview-page { width: 794px; background: #fff; box-shadow: 0 4px 18px rgba(0,0,0,.13); transform-origin: top center; flex-shrink: 0; display: flex; flex-direction: column; overflow: hidden; }
.os-set-preview-page .print-order { flex: 1 1 50%; min-height: 0; padding: 24px 30px 20px; }
.os-set-preview-page .print-order + .print-order { border-top: 1px solid #c9ccd1; }
.os-placeholder { display: flex; align-items: center; justify-content: center; color: #9aa3af; font-size: 13px; height: 480px; width: 100%; }

@media (max-width: 980px) {
  .os-set-layout { grid-template-columns: 1fr; }
  .os-rec-export { margin-left: 0; }
}
@media (max-width: 900px) {
  .os-grid { grid-template-columns: 1fr; }
  .os-order .os-title { font-size: 15px; }
  .os-card-b { padding: 14px; }
}

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